From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E0C6B3858C83; Sun, 27 Mar 2022 14:12:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E0C6B3858C83 From: "jscott at posteo dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/105069] New: [12 regression] sh-elf internal compiler errors and test failures with -Os Date: Sun, 27 Mar 2022 14:12:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jscott at posteo dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Sun, 27 Mar 2022 14:13:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105069 Bug ID: 105069 Summary: [12 regression] sh-elf internal compiler errors and test failures with -Os Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: jscott at posteo dot net Target Milestone: --- Hi, This seems to be a regression as compared to GCC 11. When building a bare-m= etal compiler for sh-elf (Newlib or an ISO C standard library is not required), = GCC aborts with an internal compiler error: gcc.c-torture/compile/pr104327.c:13:1: internal compiler error: =E2=80=98global_options=E2=80=99 are modified in local context 13 | { | ^ There are numerous test suite failures that this causes: gcc.c-torture/compile/pr104327.c (no special flags needed, since -Os is set= via an attribute) and for the following, building with -Os is necessary: gcc.c-torture/compile/pr58332.c gcc.c-torture/compile/pr81360.c gcc.c-torture/compile/pr84425.c Here is a one-line reproducer: cat bar.c [[gnu::optimize("Os")]] int main(void) {} $ sh-elf-gcc bar.c bar.c:1:1: internal compiler error: =E2=80=98global_options=E2=80=99 are mo= dified in local context 1 | [[gnu::optimize("Os")]] int main(void) {} | ^ 0x7f231098a7fc __libc_start_main ../csu/libc-start.c:332 This occurs using the latest Git master on an x86_64 Debian Bullseye GNU/Li= nux system. I'm not sure that this issue lies in the C frontend, so please reas= sign wherever appropriate. I discovered this issue running the test suite to upgrade the Debian gcc-sh= -elf package.=