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

Sergei Trofimovich <slyfox at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |slyfox at gcc dot gnu.org

--- Comment #7 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
I see a similar crash on the following example:

// $ cat ~/n/expand-response-params.c.c
// $
/nix/store/6lf3lmvmrfdhg2m54y31ci1spg848y8x-bootstrap-stage2-gcc-wrapper-16.0.0.99999999/bin/gcc
-fPIC -fstack-clash-protection -O1 -c expand-response-params.c.c -o bug.o
-Werror -Wall
int expandArg_f;
void fopen();
int fgetc();
typedef enum { quotation_mark } CharClass;
typedef enum { unq } State;
CharClass charClass();
void expandArg() {
  fopen();
  if (expandArg_f)
    return;
  int c = fgetc();
  State next = charClass();
  if (next)
    while (c)
      ;
}

The trick is to use -fno-omit-frame-pointer:

gcc/xgcc -Bgcc -fstack-clash-protection  -fstack-clash-protection -O1 -c
~/n/expand-response-params.c.c -o bug.o -fno-omit-frame-pointer
during RTL pass: pro_and_epilogue
/home/slyfox/n/expand-response-params.c.c: In function ‘expandArg’:
/home/slyfox/n/expand-response-params.c.c:17:1: internal compiler error: in
ix86_expand_prologue, at config/i386/i386.cc:9380
   17 | }
      | ^
0x2506d45 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x2522d35 internal_error(char const*, ...)
        ???:0
0x250291c fancy_abort(char const*, int, char const*)
        ???:0
0x14f427b ix86_expand_prologue()
        ???:0
0x1d7bd98 gen_prologue()
        ???:0
0x14e16a1 target_gen_prologue()
        ???:0
0xbcda18 make_prologue_seq()
        ???:0
0xbcdc1b thread_prologue_and_epilogue_insns()
        ???:0
0xbce434 rest_of_handle_thread_prologue_and_epilogue(function*)
        ???:0
0xbce483 (anonymous
namespace)::pass_thread_prologue_and_epilogue::execute(function*)
        ???:0
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.

gcc is built as:

$ gcc/xgcc -Bgcc -v
Reading specs from gcc/specs
COLLECT_GCC=gcc/xgcc
COLLECT_LTO_WRAPPER=gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/slyfox/dev/git/gcc/configure --disable-multilib
--disable-bootstrap --disable-lto --disable-libsanitizer --enable-languages=c
CFLAGS='-O1 -g0' CXXFLAGS='-O1 -g0' LDFLAGS='-O1 -g0'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 16.0.0 20250618 (experimental) (GCC)

Reply via email to