From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3C38A15ACFB for ; Fri, 28 Apr 2023 00:07:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7DD33E09F1; Fri, 28 Apr 2023 00:07:06 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 pigeon.gentoo.org (Postfix) with ESMTPS id 51A95E09F1 for ; Fri, 28 Apr 2023 00:07:06 +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)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 99003340E87 for ; Fri, 28 Apr 2023 00:07:05 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 35454A40 for ; Fri, 28 Apr 2023 00:07:04 +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: <1682640031.4e3415bb2e54c2b4ae6fe5b3ceb2b1a4253a011f.sam@gentoo> Subject: [gentoo-commits] proj/gcc-patches:master commit in: 10.5.0/gentoo/ X-VCS-Repository: proj/gcc-patches X-VCS-Files: 10.5.0/gentoo/77_all_all_PR109585_13_rtl-alias-analysis-typo.patch 10.5.0/gentoo/README.history X-VCS-Directories: 10.5.0/gentoo/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 4e3415bb2e54c2b4ae6fe5b3ceb2b1a4253a011f X-VCS-Branch: master Date: Fri, 28 Apr 2023 00:07:04 +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: 28e6f351-9513-4016-baa1-7478f41cf82a X-Archives-Hash: 8b6b6439fa952ba984555c0142f4bc27 commit: 4e3415bb2e54c2b4ae6fe5b3ceb2b1a4253a011f Author: Sam James gentoo org> AuthorDate: Fri Apr 28 00:00:31 2023 +0000 Commit: Sam James gentoo org> CommitDate: Fri Apr 28 00:00:31 2023 +0000 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=4e3415bb 10.5.0: add miscompilation patch (77_all_all_PR109585_13_rtl-alias-analysis-typo.patch) Signed-off-by: Sam James gentoo.org> ...l_all_PR109585_13_rtl-alias-analysis-typo.patch | 79 ++++++++++++++++++++++ 10.5.0/gentoo/README.history | 7 +- 2 files changed, 84 insertions(+), 2 deletions(-) diff --git a/10.5.0/gentoo/77_all_all_PR109585_13_rtl-alias-analysis-typo.patch b/10.5.0/gentoo/77_all_all_PR109585_13_rtl-alias-analysis-typo.patch new file mode 100644 index 0000000..b7b57d6 --- /dev/null +++ b/10.5.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 +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 ++ ++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/10.5.0/gentoo/README.history b/10.5.0/gentoo/README.history index 74ee905..f848c9c 100644 --- a/10.5.0/gentoo/README.history +++ b/10.5.0/gentoo/README.history @@ -1,7 +1,10 @@ -5 27 Jan 2022 +6 28 Apr 2023 + + 77_all_all_PR109585_13_rtl-alias-analysis-typo.patch + +5 27 Jan 2023 - 77_all_driver_environ_putenv_PR106624.patch -4 23 Jan 2022 +4 23 Jan 2023 + 77_all_driver_environ_putenv_PR106624.patch 3 17 Dec 2022