From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E80CF1584AD for ; Wed, 16 Apr 2025 13:30:41 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id D3F863430E5 for ; Wed, 16 Apr 2025 13:30:41 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id CBADF110494; Wed, 16 Apr 2025 13:30:40 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id C1A6E110494 for ; Wed, 16 Apr 2025 13:30:40 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6B62233BED4 for ; Wed, 16 Apr 2025 13:30:40 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9EEF919B9 for ; Wed, 16 Apr 2025 13:30:38 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1744810223.9d237724dba71ae461284d7e4c36db94cb35112f.sam@gentoo> Subject: [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/ X-VCS-Repository: proj/gcc-patches X-VCS-Files: 15.0.0/gentoo/85_all_PR119614-ipa-vrp-lto.patch 15.0.0/gentoo/README.history X-VCS-Directories: 15.0.0/gentoo/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 9d237724dba71ae461284d7e4c36db94cb35112f X-VCS-Branch: master Date: Wed, 16 Apr 2025 13:30:38 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b2fd45bc-2f88-497e-b85a-9c05cc7693a4 X-Archives-Hash: 82f8e583bb3b5f9847495a776dccddd5 commit: 9d237724dba71ae461284d7e4c36db94cb35112f Author: Sam James gentoo org> AuthorDate: Wed Apr 16 13:30:23 2025 +0000 Commit: Sam James gentoo org> CommitDate: Wed Apr 16 13:30:23 2025 +0000 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9d237724 15.0.0: drop now-upstream IPA-VRP patch \o/ Signed-off-by: Sam James gentoo.org> 15.0.0/gentoo/85_all_PR119614-ipa-vrp-lto.patch | 226 ------------------------ 15.0.0/gentoo/README.history | 1 - 2 files changed, 227 deletions(-) diff --git a/15.0.0/gentoo/85_all_PR119614-ipa-vrp-lto.patch b/15.0.0/gentoo/85_all_PR119614-ipa-vrp-lto.patch deleted file mode 100644 index 0f9b0c9..0000000 --- a/15.0.0/gentoo/85_all_PR119614-ipa-vrp-lto.patch +++ /dev/null @@ -1,226 +0,0 @@ -https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119614#c47 - - PR tree-optimization/119614 - -gcc/ChangeLog: - - * ipa-prop.cc (ipa_write_return_summaries): - (ipa_record_return_value_range_1): - (ipa_read_return_summaries): - (ipa_prop_read_section): - (read_ipcp_transformation_info): - (ipcp_write_transformation_summaries): - (read_replacements_section): - (ipa_record_return_value_range): - -gcc/testsuite/ChangeLog: - - * g++.dg/lto/pr119614_0.C: New test. - -diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc -index 49d68ab044b..7b50c4fc31f 100644 ---- a/gcc/ipa-prop.cc -+++ b/gcc/ipa-prop.cc -@@ -5439,6 +5439,49 @@ ipa_read_node_info (class lto_input_block *ib, struct cgraph_node *node, - } - } - -+/* Stream out ipa_return_summary. */ -+static void -+ipa_write_return_summaries (output_block *ob) -+{ -+ if (!ipa_return_value_sum) -+ { -+ streamer_write_uhwi (ob, 0); -+ return; -+ } -+ -+ lto_symtab_encoder_t encoder = ob->decl_state->symtab_node_encoder; -+ unsigned int count = 0; -+ for (int i = 0; i < lto_symtab_encoder_size (encoder); i++) -+ { -+ symtab_node *snode = lto_symtab_encoder_deref (encoder, i); -+ cgraph_node *cnode = dyn_cast (snode); -+ ipa_return_value_summary *v; -+ -+ if (cnode && cnode->definition && !cnode->alias -+ && (v = ipa_return_value_sum->get (cnode)) -+ && v->vr) -+ count++; -+ } -+ streamer_write_uhwi (ob, count); -+ -+ for (int i = 0; i < lto_symtab_encoder_size (encoder); i++) -+ { -+ symtab_node *snode = lto_symtab_encoder_deref (encoder, i); -+ cgraph_node *cnode = dyn_cast (snode); -+ ipa_return_value_summary *v; -+ -+ if (cnode && cnode->definition && !cnode->alias -+ && (v = ipa_return_value_sum->get (cnode)) -+ && v->vr) -+ { -+ streamer_write_uhwi -+ (ob, -+ lto_symtab_encoder_encode (encoder, cnode)); -+ v->vr->streamer_write (ob); -+ } -+ } -+} -+ - /* Write jump functions for nodes in SET. */ - - void -@@ -5475,11 +5518,54 @@ ipa_prop_write_jump_functions (void) - && ipa_node_params_sum->get (node) != NULL) - ipa_write_node_info (ob, node); - } -- streamer_write_char_stream (ob->main_stream, 0); -+ ipa_write_return_summaries (ob); - produce_asm (ob); - destroy_output_block (ob); - } - -+/* Record that current function return value range is VAL. */ -+ -+static void -+ipa_record_return_value_range_1 (cgraph_node *n, value_range val) -+{ -+ if (!ipa_return_value_sum) -+ { -+ if (!ipa_vr_hash_table) -+ ipa_vr_hash_table = hash_table::create_ggc (37); -+ ipa_return_value_sum = new (ggc_alloc_no_dtor ()) -+ ipa_return_value_sum_t (symtab, true); -+ ipa_return_value_sum->disable_insertion_hook (); -+ } -+ ipa_return_value_sum->get_create (n)->vr = ipa_get_value_range (val); -+ if (dump_file && (dump_flags & TDF_DETAILS)) -+ { -+ fprintf (dump_file, "Recording return range "); -+ val.dump (dump_file); -+ fprintf (dump_file, "\n"); -+ } -+} -+ -+/* Stream out ipa_return_summary. */ -+static void -+ipa_read_return_summaries (lto_input_block *ib, -+ struct lto_file_decl_data *file_data, -+ class data_in *data_in) -+{ -+ unsigned int f_count = streamer_read_uhwi (ib); -+ for (unsigned int i = 0; i < f_count; i++) -+ { -+ unsigned int index = streamer_read_uhwi (ib); -+ lto_symtab_encoder_t encoder = file_data->symtab_node_encoder; -+ struct cgraph_node *node = dyn_cast (lto_symtab_encoder_deref (encoder, -+ index)); -+ ipa_vr rvr; -+ rvr.streamer_read (ib, data_in); -+ value_range tmp; -+ rvr.get_vrange (tmp); -+ ipa_record_return_value_range_1 (node, tmp); -+ } -+} -+ - /* Read section in file FILE_DATA of length LEN with data DATA. */ - - static void -@@ -5516,6 +5602,7 @@ ipa_prop_read_section (struct lto_file_decl_data *file_data, const char *data, - gcc_assert (node->definition); - ipa_read_node_info (&ib_main, node, data_in); - } -+ ipa_read_return_summaries (&ib_main, file_data, data_in); - lto_free_section_data (file_data, LTO_section_jump_functions, NULL, data, - len); - lto_data_in_delete (data_in); -@@ -5635,6 +5722,7 @@ read_ipcp_transformation_info (lto_input_block *ib, cgraph_node *node, - } - } - -+ - /* Write all aggregate replacement for nodes in set. */ - - void -@@ -5673,7 +5761,7 @@ ipcp_write_transformation_summaries (void) - && lto_symtab_encoder_encode_body_p (encoder, cnode)) - write_ipcp_transformation_info (ob, cnode, ts); - } -- streamer_write_char_stream (ob->main_stream, 0); -+ ipa_write_return_summaries (ob); - produce_asm (ob); - destroy_output_block (ob); - } -@@ -5714,6 +5802,7 @@ read_replacements_section (struct lto_file_decl_data *file_data, - index)); - read_ipcp_transformation_info (&ib_main, node, data_in); - } -+ ipa_read_return_summaries (&ib_main, file_data, data_in); - lto_free_section_data (file_data, LTO_section_jump_functions, NULL, data, - len); - lto_data_in_delete (data_in); -@@ -6194,22 +6283,7 @@ ipcp_transform_function (struct cgraph_node *node) - void - ipa_record_return_value_range (value_range val) - { -- cgraph_node *n = cgraph_node::get (current_function_decl); -- if (!ipa_return_value_sum) -- { -- if (!ipa_vr_hash_table) -- ipa_vr_hash_table = hash_table::create_ggc (37); -- ipa_return_value_sum = new (ggc_alloc_no_dtor ()) -- ipa_return_value_sum_t (symtab, true); -- ipa_return_value_sum->disable_insertion_hook (); -- } -- ipa_return_value_sum->get_create (n)->vr = ipa_get_value_range (val); -- if (dump_file && (dump_flags & TDF_DETAILS)) -- { -- fprintf (dump_file, "Recording return range "); -- val.dump (dump_file); -- fprintf (dump_file, "\n"); -- } -+ ipa_record_return_value_range_1 (cgraph_node::get (current_function_decl), val); - } - - /* Return true if value range of DECL is known and if so initialize RANGE. */ -diff --git a/gcc/testsuite/g++.dg/lto/pr119614_0.C b/gcc/testsuite/g++.dg/lto/pr119614_0.C -new file mode 100644 -index 00000000000..09c07fbf566 ---- /dev/null -+++ b/gcc/testsuite/g++.dg/lto/pr119614_0.C -@@ -0,0 +1,34 @@ -+// PR tree-optimization/119614 -+// { dg-lto-do link } -+// { dg-lto-options { { -O2 -fPIC -flto -flto-partition=max } } } -+// { dg-require-effective-target shared } -+// { dg-require-effective-target fpic } -+// { dg-require-effective-target musttail } -+// { dg-extra-ld-options "-shared" } -+ -+struct S {} b; -+char *foo (); -+int e, g; -+void bar (); -+void corge (S); -+ -+[[gnu::noinline]] static char * -+baz () -+{ -+ bar (); -+ return 0; -+} -+ -+const char * -+qux () -+{ -+ if (e) -+ { -+ S a = b; -+ corge (a); -+ if (g) -+ return 0; -+ [[gnu::musttail]] return baz (); -+ } -+ return foo (); -+} diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history index 35249b2..678df05 100644 --- a/15.0.0/gentoo/README.history +++ b/15.0.0/gentoo/README.history @@ -3,7 +3,6 @@ - 82_all_PR119318-ipa-cp.patch - 84_all_PR116975.patch + 84_all_PR116975-GDCFLAGS.patch - + 85_all_PR119614-ipa-vrp-lto.patch 54 13 April 2025