From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C80EA3858C27; Sat, 25 Dec 2021 09:55:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C80EA3858C27 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/56139] [9/10/11/12 Regression] unmodified static data could go in .rodata, not .data Date: Sat, 25 Dec 2021 09:55:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: deferred, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component target_milestone keywords cf_known_to_fail bug_severity cc short_desc 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Dec 2021 09:55:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D56139 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Component|tree-optimization |ipa Target Milestone|--- |13.0 Keywords| |deferred Known to fail| |4.7.1 Severity|enhancement |normal CC| |marxin at gcc dot gnu.org Summary|unmodified static data |[9/10/11/12 Regression] |could go in .rodata, not |unmodified static data |.data |could go in .rodata, not | |.data --- Comment #2 from Andrew Pinski --- We do handle: static int x[] =3D {1, 2, 3, 4}; void bar (int x); int func(int i) { bar(x[i]); return 0; } Just fine. It is the IR of the other case where we mess up. And it looks li= ke it is a regression too. I suspect it is because we used to be able to create back the ARARY_REF in GCC 4.6.x and that was removed in GCC 4.7 as it caused other issues.=