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: 11.4.0/gentoo/
Date: Thu, 27 Apr 2023 23:56:36 +0000 (UTC)	[thread overview]
Message-ID: <1682639653.b8eab6cef231c608a4857db592b347cd6f4b0cae.sam@gentoo> (raw)

commit:     b8eab6cef231c608a4857db592b347cd6f4b0cae
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 27 23:38:41 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Apr 27 23:54:13 2023 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b8eab6ce

11.4.0: add miscompilation patch (77_all_all_PR109585_13_rtl-alias-analysis-typo)

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

 ...l_all_PR109585_13_rtl-alias-analysis-typo.patch | 79 ++++++++++++++++++++++
 11.4.0/gentoo/README.history                       |  9 ++-
 2 files changed, 85 insertions(+), 3 deletions(-)

diff --git a/11.4.0/gentoo/77_all_all_PR109585_13_rtl-alias-analysis-typo.patch b/11.4.0/gentoo/77_all_all_PR109585_13_rtl-alias-analysis-typo.patch
new file mode 100644
index 0000000..b7b57d6
--- /dev/null
+++ b/11.4.0/gentoo/77_all_all_PR109585_13_rtl-alias-analysis-typo.patch
@@ -0,0 +1,79 @@
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109609
+https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=ef6051b36241bf130bf76af0b775248635dc616e
+
+From ef6051b36241bf130bf76af0b775248635dc616e Mon Sep 17 00:00:00 2001
+From: Richard Biener <rguenther@suse.de>
+Date: Mon, 24 Apr 2023 13:31:07 +0200
+Subject: [PATCH] rtl-optimization/109585 - alias analysis typo
+
+When r10-514-gc6b84edb6110dd2b4fb improved access path analysis
+it introduced a typo that triggers when there's an access to a
+trailing array in the first access path leading to false
+disambiguation.
+
+	PR rtl-optimization/109585
+	* tree-ssa-alias.c (aliasing_component_refs_p): Fix typo.
+
+	* gcc.dg/torture/pr109585.c: New testcase.
+
+(cherry picked from commit 6d4bd27a60447c7505cb4783e675e98a191a8904)
+---
+ gcc/testsuite/gcc.dg/torture/pr109585.c | 33 +++++++++++++++++++++++++
+ gcc/tree-ssa-alias.c                   |  2 +-
+ 2 files changed, 34 insertions(+), 1 deletion(-)
+ create mode 100644 gcc/testsuite/gcc.dg/torture/pr109585.c
+
+diff --git a/gcc/testsuite/gcc.dg/torture/pr109585.c b/gcc/testsuite/gcc.dg/torture/pr109585.c
+new file mode 100644
+index 00000000000..f92de7c1f2e
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/torture/pr109585.c
+@@ -0,0 +1,33 @@
++/* { dg-do run } */
++
++#include <stdlib.h>
++
++struct P {
++    long v;
++    struct P *n;
++};
++
++struct F {
++    long x;
++    struct P fam[];
++};
++
++int __attribute__((noipa))
++f(struct F *f, int i)
++{
++  struct P *p = f->fam;
++  asm("" : "+r"(f): "r"(p));
++  p->v = 0;
++  p->n = 0;
++  return f->fam->n != 0;
++}
++
++int
++main()
++{
++  struct F *m = malloc (sizeof (long) + 2 * sizeof (struct P));
++  m->fam[0].n = &m->fam[1];
++  if (f (m, 0))
++    abort ();
++  return 0;
++}
+diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
+index b1e7a2d5afc..be7b597266f 100644
+--- a/gcc/tree-ssa-alias.c
++++ b/gcc/tree-ssa-alias.c
+@@ -1326,7 +1326,7 @@ aliasing_component_refs_p (tree ref1,
+   /* If we didn't find a common base, try the other way around.  */
+   if (cmp_outer <= 0 
+       || (end_struct_ref1
+-	  && compare_type_sizes (TREE_TYPE (end_struct_ref1), type1) <= 0))
++	  && compare_type_sizes (TREE_TYPE (end_struct_ref1), type2) <= 0))
+     {
+       int res = aliasing_component_refs_walk (ref2, type2, base2,
+ 					      offset2, max_size2,
+-- 
+2.31.1

diff --git a/11.4.0/gentoo/README.history b/11.4.0/gentoo/README.history
index 5c06066..a5fca96 100644
--- a/11.4.0/gentoo/README.history
+++ b/11.4.0/gentoo/README.history
@@ -1,11 +1,14 @@
-8		28 Jan 2022
+9		28 Apr 2023
+	+ 77_all_all_PR109585_13_rtl-alias-analysis-typo.patch
+
+8		28 Jan 2023
 	- 77_all_driver_environ_putenv_PR106624.patch
 
-7		23 Jan 2022
+7		23 Jan 2023
 	- 26_all_enable-cet.patch
 	+ 77_all_driver_environ_putenv_PR106624.patch
 
-6		7 Jan 2022
+6		7 Jan 2023
 	- 77_all_configure-c89.patch
 
 5		17 Dec 2022


             reply	other threads:[~2023-04-27 23:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 23:56 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-12-09 13:49 [gentoo-commits] proj/gcc-patches:master commit in: 11.4.0/gentoo/ Sam James
2023-12-06 10:52 Sam James
2023-12-02  5:28 Sam James
2023-05-05  2:37 Sam James
2023-01-28  5:13 Sam James
2023-01-23  0:35 Sam James
2023-01-23  0:35 Sam James
2023-01-07  7:47 Sam James
2022-12-17  4:54 Sam James
2022-12-17  4:54 Sam James
2022-12-17  4:54 Sam James
2022-11-20  0:25 Sam James
2022-08-22  2:14 Sam James
2022-05-22 23:16 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=1682639653.b8eab6cef231c608a4857db592b347cd6f4b0cae.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