From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6D5EC3858D35; Mon, 15 Apr 2024 06:46:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D5EC3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713163574; bh=lpzP24gYoM4bMH0xw3vbNx8i5WF4nfxPlLPE+zpK09c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rEIPjNPZsWnfN91GDaIu6rDnmblTzPfos1oEz6Ri907a9XVrYZl2BvvwSiQemSu95 4MkJI57zk/WpKwHuUzMffdSAIkGtJYz8tbb02Jp3g8vLya1xMCNWbn0UMhvhFYuM71 +Os+Iyk2qVsN18pIAB0+LR0OI2E5vvnce0DGAfOs= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/111231] [12/13/14 regression] armhf: Miscompilation with -O2/-fno-exceptions level (-fno-tree-vectorize is working) Date: Mon, 15 Apr 2024 06:46:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111231 --- Comment #30 from Richard Biener --- I have tested the following since that might confuse the redundant store removal sanity checks. It bootstraps fine on x86-64-unknown-linux-gnu but causes FAIL: gcc.dg/tree-ssa/ssa-dse-36.c scan-tree-dump-times dse1 "Deleted redun= dant call" 3 FAIL: gcc.dg/tree-ssa/ssa-dse-36.c scan-tree-dump-times dse1 "Deleted redun= dant store" 3 in particular foo1 and foo2 are no longer optimized. Specifically foo1: - x =3D {}; + MEM [(struct X *)&x] =3D {}; + memset (&x.mem1, 0, 10); the lack of the 'memset' removal looks fishy since memset uses alias set zero while the earlier store uses the alias set of struct X (but contains alias set zero because of the char[] members). For foo2: x =3D {}; + x.mem1[5] =3D 0; the issue is less clear since 'x' is also involved in the store to x.mem1[5] (but that store also uses alias-set zero). This shows the situation is a bit odd wrt the behavior of a whole-aggregate store vs. a component-wise store. But again in both cases a later conflict check with say *(int *)p, while conflicting with the memset and x.mem1[5] stores, would not conflict with the x =3D {} store. So this fallout is to be expected and desired. diff --git a/gcc/alias.cc b/gcc/alias.cc index 808e2095d9b..bacae30db18 100644 --- a/gcc/alias.cc +++ b/gcc/alias.cc @@ -427,9 +427,7 @@ alias_set_subset_of (alias_set_type set1, alias_set_type set2)=20 /* Check if set1 is a subset of set2. */ ase2 =3D get_alias_set_entry (set2); - if (ase2 !=3D 0 - && (ase2->has_zero_child - || (ase2->children && ase2->children->get (set1)))) + if (ase2 !=3D 0 && ase2->children && ase2->children->get (set1)) return true; /* As a special case we consider alias set of "void *" to be both subset=