public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
Date: Mon, 10 Feb 2025 21:22:19 +0000 (UTC)	[thread overview]
Message-ID: <1739222515.1240e2dfcd8257243dfbe473fc934fa18482b91b.sam@gentoo> (raw)

commit:     1240e2dfcd8257243dfbe473fc934fa18482b91b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 10 21:21:55 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Feb 10 21:21:55 2025 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=1240e2df

15.0.0: drop upstream ipa-cp patch

Merged upstream.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...orm-operations-in-the-appropriate-types-P.patch | 271 ---------------------
 15.0.0/gentoo/README.history                       |   4 +
 2 files changed, 4 insertions(+), 271 deletions(-)

diff --git a/15.0.0/gentoo/81_all_PR118097-ipa-cp-Perform-operations-in-the-appropriate-types-P.patch b/15.0.0/gentoo/81_all_PR118097-ipa-cp-Perform-operations-in-the-appropriate-types-P.patch
deleted file mode 100644
index 165793d..0000000
--- a/15.0.0/gentoo/81_all_PR118097-ipa-cp-Perform-operations-in-the-appropriate-types-P.patch
+++ /dev/null
@@ -1,271 +0,0 @@
-From 70951aa9a0c324893d957da614fcc8c749571a52 Mon Sep 17 00:00:00 2001
-Message-ID: <70951aa9a0c324893d957da614fcc8c749571a52.1738971381.git.sam@gentoo.org>
-From: Martin Jambor <mjambor@suse.cz>
-Date: Wed, 22 Jan 2025 17:44:48 +0100
-Subject: [PATCH] ipa-cp: Perform operations in the appropriate types (PR
- 118097)
-
-Hi,
-
-one of the testcases from PR 118097 and the one from PR 118535 show
-that the fix to PR 118138 was incomplete.  We must not only make sure
-that (intermediate) results of operations performed by IPA-CP are
-fold_converted to the type of the destination formal parameter but we
-also must decouple the these types from the ones in which operations
-are performed.
-
-This patch does that, even though we do not store or stream the
-operation types, instead we simply limit ourselves to tcc_comparisons
-and operations for which the first operand and the result are of the
-same type as determined by expr_type_first_operand_type_p.  If we
-wanted to go beyond these, we would indeed need to store/stream the
-respective operation type.
-
-ipa_value_from_jfunc needs an additional check that res_type is not
-NULL because it is not called just from within IPA-CP (where we know
-we have a destination lattice slot belonging to a defined parameter)
-but also from inlining, ipa-fnsummary and ipa-modref where it is used
-to examine a call to a function with variadic arguments and we do not
-have types for the unknown parameters.  But we cannot really work with
-those or estimate any benefits when it comes to them, so ignoring them
-should be OK.
-
-Even after this patch, ipa_get_jf_arith_result has a parameter called
-res_type in which it performs operations for aggregate jump functions,
-where we do not allow type conversions when constucting the jump
-functions and the type is the type of the stored data.  In GCC 16, we
-could relax this and allow conversions like for scalars.
-
-Bootstrapped, LTO-bootstrapped and tested on x86_64-linux.  OK for
-master?
-
-Thanks,
-
-Honza
-
-gcc/ChangeLog:
-
-2025-01-20  Martin Jambor  <mjambor@suse.cz>
-
-	PR ipa/118097
-	* ipa-cp.cc (ipa_get_jf_arith_result): Adjust comment.
-	(ipa_get_jf_pass_through_result): Removed.
-	(ipa_value_from_jfunc): Use directly ipa_get_jf_arith_result, do
-	not specify operation type but make sure we check and possibly
-	convert the result.
-	(get_val_across_arith_op): Remove the last parameter, always pass
-	NULL_TREE to ipa_get_jf_arith_result in its last argument.
-	(propagate_vals_across_arith_jfunc): Do not pass res_type to
-	get_val_across_arith_op.
-	(propagate_vals_across_pass_through): Add checking assert that
-	parm_type is not NULL.
-
-gcc/testsuite/ChangeLog:
-
-2025-01-20  Martin Jambor  <mjambor@suse.cz>
-
-PR ipa/118097
-	* gcc.dg/ipa/pr118097.c: New test.
-	* gcc.dg/ipa/pr118535.c: Likewise.
-	* gcc.dg/ipa/ipa-notypes-1.c: Likewise.
----
- gcc/ipa-cp.cc                            | 46 ++++++++++--------------
- gcc/testsuite/gcc.dg/ipa/ipa-notypes-1.c | 17 +++++++++
- gcc/testsuite/gcc.dg/ipa/pr118097.c      | 23 ++++++++++++
- gcc/testsuite/gcc.dg/ipa/pr118535.c      | 17 +++++++++
- 4 files changed, 75 insertions(+), 28 deletions(-)
- create mode 100644 gcc/testsuite/gcc.dg/ipa/ipa-notypes-1.c
- create mode 100644 gcc/testsuite/gcc.dg/ipa/pr118097.c
- create mode 100644 gcc/testsuite/gcc.dg/ipa/pr118535.c
-
-diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc
-index d89324a00775..68959f2677ba 100644
---- a/gcc/ipa-cp.cc
-+++ b/gcc/ipa-cp.cc
-@@ -1467,11 +1467,10 @@ ipacp_value_safe_for_type (tree param_type, tree value)
-     return NULL_TREE;
- }
- 
--/* Return the result of a (possibly arithmetic) operation on the constant
--   value INPUT.  OPERAND is 2nd operand for binary operation.  RES_TYPE is
--   the type of the parameter to which the result is passed.  Return
--   NULL_TREE if that cannot be determined or be considered an
--   interprocedural invariant.  */
-+/* Return the result of a (possibly arithmetic) operation on the constant value
-+   INPUT.  OPERAND is 2nd operand for binary operation.  RES_TYPE is the type
-+   in which any operation is to be performed.  Return NULL_TREE if that cannot
-+   be determined or be considered an interprocedural invariant.  */
- 
- static tree
- ipa_get_jf_arith_result (enum tree_code opcode, tree input, tree operand,
-@@ -1513,21 +1512,6 @@ ipa_get_jf_arith_result (enum tree_code opcode, tree input, tree operand,
-   return res;
- }
- 
--/* Return the result of a (possibly arithmetic) pass through jump function
--   JFUNC on the constant value INPUT.  RES_TYPE is the type of the parameter
--   to which the result is passed.  Return NULL_TREE if that cannot be
--   determined or be considered an interprocedural invariant.  */
--
--static tree
--ipa_get_jf_pass_through_result (struct ipa_jump_func *jfunc, tree input,
--				tree res_type)
--{
--  return ipa_get_jf_arith_result (ipa_get_jf_pass_through_operation (jfunc),
--				  input,
--				  ipa_get_jf_pass_through_operand (jfunc),
--				  res_type);
--}
--
- /* Return the result of an ancestor jump function JFUNC on the constant value
-    INPUT.  Return NULL_TREE if that cannot be determined.  */
- 
-@@ -1595,7 +1579,14 @@ ipa_value_from_jfunc (class ipa_node_params *info, struct ipa_jump_func *jfunc,
- 	return NULL_TREE;
- 
-       if (jfunc->type == IPA_JF_PASS_THROUGH)
--	return ipa_get_jf_pass_through_result (jfunc, input, parm_type);
-+	{
-+	  if (!parm_type)
-+	    return NULL_TREE;
-+	  enum tree_code opcode = ipa_get_jf_pass_through_operation (jfunc);
-+	  tree op2 = ipa_get_jf_pass_through_operand (jfunc);
-+	  tree cstval = ipa_get_jf_arith_result (opcode, input, op2, NULL_TREE);
-+	  return ipacp_value_safe_for_type (parm_type, cstval);
-+	}
-       else
- 	return ipa_get_jf_ancestor_result (jfunc, input);
-     }
-@@ -2120,15 +2111,13 @@ ipcp_lattice<valtype>::add_value (valtype newval, cgraph_edge *cs,
- /* A helper function that returns result of operation specified by OPCODE on
-    the value of SRC_VAL.  If non-NULL, OPND1_TYPE is expected type for the
-    value of SRC_VAL.  If the operation is binary, OPND2 is a constant value
--   acting as its second operand.  If non-NULL, RES_TYPE is expected type of
--   the result.  */
-+   acting as its second operand.  */
- 
- static tree
- get_val_across_arith_op (enum tree_code opcode,
- 			 tree opnd1_type,
- 			 tree opnd2,
--			 ipcp_value<tree> *src_val,
--			 tree res_type)
-+			 ipcp_value<tree> *src_val)
- {
-   tree opnd1 = src_val->value;
- 
-@@ -2137,7 +2126,7 @@ get_val_across_arith_op (enum tree_code opcode,
-       && !useless_type_conversion_p (opnd1_type, TREE_TYPE (opnd1)))
-     return NULL_TREE;
- 
--  return ipa_get_jf_arith_result (opcode, opnd1, opnd2, res_type);
-+  return ipa_get_jf_arith_result (opcode, opnd1, opnd2, NULL_TREE);
- }
- 
- /* Propagate values through an arithmetic transformation described by a jump
-@@ -2213,7 +2202,7 @@ propagate_vals_across_arith_jfunc (cgraph_edge *cs,
- 	  for (int j = 1; j < max_recursive_depth; j++)
- 	    {
- 	      tree cstval = get_val_across_arith_op (opcode, opnd1_type, opnd2,
--						     src_val, res_type);
-+						     src_val);
- 	      cstval = ipacp_value_safe_for_type (res_type, cstval);
- 	      if (!cstval)
- 		break;
-@@ -2238,7 +2227,7 @@ propagate_vals_across_arith_jfunc (cgraph_edge *cs,
- 	  }
- 
- 	tree cstval = get_val_across_arith_op (opcode, opnd1_type, opnd2,
--					       src_val, res_type);
-+					       src_val);
- 	cstval = ipacp_value_safe_for_type (res_type, cstval);
- 	if (cstval)
- 	  ret |= dest_lat->add_value (cstval, cs, src_val, src_idx,
-@@ -2261,6 +2250,7 @@ propagate_vals_across_pass_through (cgraph_edge *cs, ipa_jump_func *jfunc,
- 				    ipcp_lattice<tree> *dest_lat, int src_idx,
- 				    tree parm_type)
- {
-+  gcc_checking_assert (parm_type);
-   return propagate_vals_across_arith_jfunc (cs,
- 				ipa_get_jf_pass_through_operation (jfunc),
- 				NULL_TREE,
-diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-notypes-1.c b/gcc/testsuite/gcc.dg/ipa/ipa-notypes-1.c
-new file mode 100644
-index 000000000000..e8f4adaed171
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/ipa/ipa-notypes-1.c
-@@ -0,0 +1,17 @@
-+/* { dg-do compile } */
-+/* { dg-options "-O2" } */
-+
-+void some_memcpy(void *, long);
-+long bufused;
-+char buf, otest_s;
-+void otest(...) {
-+  long slength;
-+  some_memcpy(&buf + bufused, slength & otest_s);
-+}
-+int f, finish_root_table_fli2_1;
-+static void finish_root_table(char *lastname) {
-+  for (;;)
-+    if (finish_root_table_fli2_1)
-+      otest(f, lastname);
-+}
-+void write_roots() { finish_root_table(""); }
-diff --git a/gcc/testsuite/gcc.dg/ipa/pr118097.c b/gcc/testsuite/gcc.dg/ipa/pr118097.c
-new file mode 100644
-index 000000000000..772e83f3bf49
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/ipa/pr118097.c
-@@ -0,0 +1,23 @@
-+/* { dg-do run } */
-+/* { dg-options "-O2 -fno-inline" } */
-+
-+int a, b, c, *d = &a;
-+long e;
-+static long am (long f, int g) {
-+  return g == 0 || f == 1 && g == 1 ?: f / g;
-+}
-+static void aq (unsigned f)
-+{
-+  c ^= e = am(~f, 1);
-+  b = 7 - (e >= 1) - 33;
-+  *d = b;
-+}
-+
-+int main() {
-+  //  am(1, 1);
-+  aq(1);
-+  if (a == 0xffffffffffffffe5)
-+    ;
-+  else
-+    __builtin_abort();
-+}
-diff --git a/gcc/testsuite/gcc.dg/ipa/pr118535.c b/gcc/testsuite/gcc.dg/ipa/pr118535.c
-new file mode 100644
-index 000000000000..960ba4a5db2a
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/ipa/pr118535.c
-@@ -0,0 +1,17 @@
-+/* { dg-do run } */
-+/* { dg-options "-O2" } */
-+
-+int a, b, c, d, e, f, *g = &b;
-+static int h(int i) { return i < 0 || i > a ? 0 : i << a; }
-+static int j(unsigned short i) {
-+  f = d == e;
-+  *g = h(65535 ^ i);
-+  return c;
-+}
-+int main() {
-+  j(0);
-+  h(0);
-+  if (b != 0)
-+    __builtin_abort();
-+  return 0;
-+}
-
-base-commit: 7d8e8f89732b1f13752e1b370852c7bcbbbde259
--- 
-2.48.1
-

diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index ac36710..be23e46 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+46	????
+
+	- 81_all_PR118097-ipa-cp-Perform-operations-in-the-appropriate-types-P.patch
+
 45	9 February 2025
 
 	U 09_all_esysroot.patch


             reply	other threads:[~2025-02-10 21:22 UTC|newest]

Thread overview: 204+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10 21:22 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-04-07  7:07 [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/ Sam James
2025-04-07  6:54 Sam James
2025-04-06 23:08 Sam James
2025-04-05 15:33 Sam James
2025-04-05  8:02 Sam James
2025-04-05  1:43 Sam James
2025-04-04 19:06 Sam James
2025-04-02 18:48 Sam James
2025-04-02 18:03 Sam James
2025-04-02 16:14 Sam James
2025-04-02 13:56 Sam James
2025-04-02  4:59 Sam James
2025-04-01 14:46 Sam James
2025-04-01 14:46 Sam James
2025-03-31 22:16 Sam James
2025-03-31 22:03 Sam James
2025-03-31  4:05 Sam James
2025-03-29 20:31 Sam James
2025-03-29 14:33 Sam James
2025-03-29 13:51 Sam James
2025-03-26  6:25 Sam James
2025-03-25 10:27 Sam James
2025-03-25  8:38 Sam James
2025-03-25  2:32 Sam James
2025-03-25  1:27 Sam James
2025-03-24  0:35 Sam James
2025-03-21 19:31 Sam James
2025-03-21 17:21 Sam James
2025-03-21 16:23 Sam James
2025-03-21 11:20 Sam James
2025-03-21  8:51 Sam James
2025-03-21  6:07 Sam James
2025-03-20 22:08 Sam James
2025-03-20  1:59 Sam James
2025-03-20  1:59 Sam James
2025-03-16 22:37 Sam James
2025-03-14 14:46 Sam James
2025-03-14 13:37 Sam James
2025-03-13 16:48 Sam James
2025-03-13 10:08 Sam James
2025-03-11 10:32 Sam James
2025-03-07 16:54 Sam James
2025-03-03 16:38 Sam James
2025-03-01 10:33 Sam James
2025-03-01  6:50 Sam James
2025-02-17  1:30 Sam James
2025-02-13  9:23 Sam James
2025-02-12 15:12 Sam James
2025-02-09 23:58 Sam James
2025-02-07 23:37 Sam James
2025-02-07 21:19 Sam James
2025-02-03 22:04 Sam James
2025-02-02 22:41 Sam James
2025-01-29 20:21 Sam James
2025-01-26 22:52 Sam James
2025-01-22 16:27 Sam James
2025-01-19 22:43 Sam James
2025-01-16 23:11 Sam James
2025-01-16 23:11 Sam James
2025-01-15 11:41 Sam James
2025-01-14 16:22 Sam James
2025-01-14 15:06 Sam James
2025-01-14 15:06 Sam James
2025-01-14 12:29 Sam James
2025-01-14  8:43 Sam James
2025-01-14  8:40 Sam James
2025-01-13 13:58 Sam James
2025-01-13  6:00 Sam James
2025-01-13  3:40 Sam James
2025-01-13  3:23 Sam James
2025-01-13  3:20 Sam James
2025-01-13  0:20 Sam James
2025-01-12 18:53 Sam James
2025-01-11 12:53 Sam James
2025-01-08 21:51 Sam James
2025-01-06 10:50 Sam James
2025-01-06 10:03 Sam James
2025-01-06  4:49 Sam James
2025-01-06  4:44 Sam James
2025-01-06  4:13 Sam James
2025-01-06  4:13 Sam James
2025-01-06  4:13 Sam James
2025-01-06  4:03 Sam James
2025-01-05 23:19 Sam James
2025-01-03  3:07 Sam James
2024-12-30  1:05 Sam James
2024-12-29 10:00 Sam James
2024-12-27 15:14 Sam James
2024-12-24 20:48 Sam James
2024-12-22 22:46 Sam James
2024-12-20 11:25 Sam James
2024-12-20  5:57 Sam James
2024-12-20  1:55 Sam James
2024-12-19 18:34 Sam James
2024-12-13 13:23 Sam James
2024-12-13 11:52 Sam James
2024-12-13  5:08 Sam James
2024-12-12 12:28 Sam James
2024-12-11  4:41 Sam James
2024-12-11  0:58 Sam James
2024-12-10 19:19 Sam James
2024-12-10 14:55 Sam James
2024-12-10  5:19 Sam James
2024-12-10  5:13 Sam James
2024-12-10  5:11 Sam James
2024-12-10  5:07 Sam James
2024-12-09  3:05 Sam James
2024-12-08 22:41 Sam James
2024-12-06 17:33 Sam James
2024-12-04 20:40 Sam James
2024-12-01 22:51 Sam James
2024-12-01 22:51 Sam James
2024-11-30 11:30 Sam James
2024-11-27 17:42 Sam James
2024-11-25 15:10 Sam James
2024-11-25  3:01 Sam James
2024-11-25  3:00 Sam James
2024-11-25  3:00 Sam James
2024-11-24 22:42 Sam James
2024-11-18 17:25 Sam James
2024-11-18 10:42 Sam James
2024-11-18 10:42 Sam James
2024-11-18  9:25 Sam James
2024-11-18  9:25 Sam James
2024-11-14 18:38 Sam James
2024-11-13  4:26 Sam James
2024-11-13  0:16 Sam James
2024-11-12  2:33 Sam James
2024-11-11 19:46 Sam James
2024-11-11 19:46 Sam James
2024-11-10 22:41 Sam James
2024-11-09 16:24 Sam James
2024-11-09  7:55 Sam James
2024-11-08  8:22 Sam James
2024-11-07 16:13 Sam James
2024-11-03 23:16 Sam James
2024-11-01  8:24 Sam James
2024-11-01  8:24 Sam James
2024-11-01  8:18 Sam James
2024-11-01  8:17 Sam James
2024-10-30 16:03 Sam James
2024-10-29 19:17 Sam James
2024-10-28 21:32 Sam James
2024-10-28  8:09 Sam James
2024-10-23 15:40 Sam James
2024-10-22 19:09 Sam James
2024-10-22 18:34 Sam James
2024-10-21 12:33 Sam James
2024-10-21 12:27 Sam James
2024-10-21 12:26 Sam James
2024-10-21 11:45 Sam James
2024-10-20 22:42 Sam James
2024-10-18 14:05 Sam James
2024-10-18 10:35 Sam James
2024-10-17 23:33 Sam James
2024-10-17 23:03 Sam James
2024-10-17  5:01 Sam James
2024-10-17  4:15 Sam James
2024-10-13 22:48 Sam James
2024-10-07  2:45 Sam James
2024-10-04 10:37 Sam James
2024-10-04  9:28 Sam James
2024-10-02 19:45 Sam James
2024-09-30 14:05 Sam James
2024-09-29 22:56 Sam James
2024-09-24  1:41 Sam James
2024-09-23 15:23 Sam James
2024-09-02  2:28 Sam James
2024-08-26 13:44 Sam James
2024-08-26  6:24 Sam James
2024-08-23 13:51 Sam James
2024-08-20 20:31 Sam James
2024-08-19 18:43 Sam James
2024-08-14  9:48 Sam James
2024-08-14  2:57 Sam James
2024-08-11 22:40 Sam James
2024-08-09 19:54 Sam James
2024-08-09 19:54 Sam James
2024-08-09 19:47 Sam James
2024-08-09 19:25 Sam James
2024-08-08 11:10 Sam James
2024-08-08 11:06 Sam James
2024-08-08 11:03 Sam James
2024-08-05  9:09 Sam James
2024-08-05  1:54 Sam James
2024-08-05  1:51 Sam James
2024-08-02 20:39 Sam James
2024-08-01 14:40 Sam James
2024-07-28 23:34 Sam James
2024-07-22  1:11 Sam James
2024-07-19 11:14 Sam James
2024-07-18  0:45 Sam James
2024-07-14 23:36 Sam James
2024-06-28 12:49 Sam James
2024-06-27  0:02 Sam James
2024-06-26 23:57 Sam James
2024-06-16 22:45 Sam James
2024-06-10 20:18 Sam James
2024-06-10 17:28 Sam James
2024-06-10 17:28 Sam James
2024-06-10  2:08 Sam James
2024-06-08 17:03 Sam James
2024-06-08 17:03 Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1739222515.1240e2dfcd8257243dfbe473fc934fa18482b91b.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox