public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "slyfox at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/104705] New: [12 regression] ICE ‘global_options’ are modified in local context in cl_optimization_compare
Date: Sat, 26 Feb 2022 20:59:19 +0000	[thread overview]
Message-ID: <bug-104705-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 104705
           Summary: [12 regression] ICE ‘global_options’ are modified in
                    local context in cl_optimization_compare
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
                CC: mliska at suse dot cz
  Target Milestone: ---

Tried to build ghc-HEAD with gcc-master today, got an ICE on pragmas in
intrisics.

Here is a small reproducer (I think I lost real "optimize" value during
shrinking, does it matter much for this ICE?):

    //$ cat a.c
    #pragma GCC optimize "foo"
    #pragma GCC push_options
    #pragma GCC pop_options

$ /tmp/bg/gcc/xgcc -B/tmp/bg/gcc -c a.c  -O2 -Wall
a.c:1:9: warning: bad option ‘-ffoo’ to pragma ‘optimize’ [-Wpragmas]
    1 | #pragma GCC optimize "foo"
      |         ^~~
a.c:3:9: internal compiler error: ‘global_options’ are modified in local
context
    3 | #pragma GCC pop_options
      |         ^~~
0xccf111 cl_optimization_compare(gcc_options*, gcc_options*)
        /tmp/bg/gcc/options-save.cc:15919
0x7ca26f handle_pragma_pop_options
        /home/slyfox/dev/git/gcc/gcc/c-family/c-pragma.cc:1141
0x7cd42e c_invoke_pragma_handler(unsigned int)
        /home/slyfox/dev/git/gcc/gcc/c-family/c-pragma.cc:1569
0x72a4ca c_parser_pragma
        /home/slyfox/dev/git/gcc/gcc/c/c-parser.cc:12621
0x7555e7 c_parser_external_declaration
        /home/slyfox/dev/git/gcc/gcc/c/c-parser.cc:1760
0x75596a c_parser_translation_unit
        /home/slyfox/dev/git/gcc/gcc/c/c-parser.cc:1652
0x75596a c_parse_file()
        /home/slyfox/dev/git/gcc/gcc/c/c-parser.cc:23357
0x7c7e81 c_common_parse_file()
        /home/slyfox/dev/git/gcc/gcc/c-family/c-opts.cc:1238
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ /tmp/bg/gcc/xgcc -B/tmp/bg/gcc -v
Reading specs from /tmp/bg/gcc/specs
COLLECT_GCC=/tmp/bg/gcc/xgcc
COLLECT_LTO_WRAPPER=/tmp/bg/gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/slyfox/dev/git/gcc/configure --disable-multilib
--disable-bootstrap
--with-native-system-header-dir=/<<NIX>>/glibc-2.33-108-dev/include
--prefix=/tmp/bg/__td__ CFLAGS='-O1 -ggdb3' CXXFLAGS='-O1 -ggdb3' LDFLAGS='-O1
-ggdb3'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.1 20220226 (experimental) (GCC)

             reply	other threads:[~2022-02-26 20:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-26 20:59 slyfox at gcc dot gnu.org [this message]
2022-02-26 21:02 ` [Bug middle-end/104705] " pinskia at gcc dot gnu.org
2022-02-26 21:03 ` pinskia at gcc dot gnu.org
2022-02-27  9:27 ` marxin at gcc dot gnu.org
2022-02-28  9:17 ` marxin at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-104705-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).