public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/105069] New: [12 regression] sh-elf internal compiler errors and test failures with -Os
@ 2022-03-27 14:12 jscott at posteo dot net
  2022-03-27 14:14 ` [Bug target/105069] " pinskia at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: jscott at posteo dot net @ 2022-03-27 14:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105069

            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-metal
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:
‘global_options’ 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: ‘global_options’ are modified 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/Linux
system. I'm not sure that this issue lies in the C frontend, so please reassign
wherever appropriate.

I discovered this issue running the test suite to upgrade the Debian gcc-sh-elf
package.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-05-08 12:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-27 14:12 [Bug c/105069] New: [12 regression] sh-elf internal compiler errors and test failures with -Os jscott at posteo dot net
2022-03-27 14:14 ` [Bug target/105069] " pinskia at gcc dot gnu.org
2022-03-27 15:02 ` jscott at posteo dot net
2022-03-28  9:34 ` jakub at gcc dot gnu.org
2022-03-28  9:34 ` jakub at gcc dot gnu.org
2022-03-28 10:36 ` marxin at gcc dot gnu.org
2022-03-31  7:32 ` marxin at gcc dot gnu.org
2022-03-31  8:01 ` jakub at gcc dot gnu.org
2022-03-31  8:09 ` marxin at gcc dot gnu.org
2022-04-06 15:42 ` cvs-commit at gcc dot gnu.org
2022-04-06 15:45 ` jakub at gcc dot gnu.org
2022-05-06  8:33 ` [Bug target/105069] [12/13 " jakub at gcc dot gnu.org
2023-05-08 12:24 ` [Bug target/105069] [12/13/14 " rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).