[Bug debug/86941] New: ICE in i386/winnt.c:1258 in i386_pe_seh_unwind_emit

nightstrike at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Aug 13 23:08:00 GMT 2018


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

            Bug ID: 86941
           Summary: ICE in i386/winnt.c:1258 in i386_pe_seh_unwind_emit
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nightstrike at gmail dot com
  Target Milestone: ---

The following code from the stack-trace-7.c testsuite case causes an ICE on
x86_64-w64-mingw32:

/* { dg-do run } */
/* { dg-options "-O2 -fstack-clash-protection -fno-optimize-sibling-calls
--param stack-clash-protection-probe-interval=12 --param
stack-clash-protection-guard-size=12" } */
/* { dg-require-effective-target supports_stack_clash_protection } */

/* For further testing, this can be run under valgrind where it's crashed
   on aarch64 and ppc64le with -fstack-check=specific.  */


__attribute__((noinline, noclone)) void
foo (char *p)
{
  asm volatile ("" : : "r" (p) : "memory");
}

__attribute__((noinline, noclone)) void
bar (void)
{
  char buf[131072];
  foo (buf);
}

__attribute__((noinline, noclone)) void
baz (void)
{
  char buf[12000];
  foo (buf);
}

int
main ()
{
  bar ();
  baz ();
  return 0;
}



stack-check-7.c:20:1: internal compiler error: in i386_pe_seh_unwind_emit, at
config/i386/winnt.c:1258
0x71157e i386_pe_seh_unwind_emit(_IO_FILE*, rtx_insn*)
        ../../../gccsvn/gcc/config/i386/winnt.c:1258
0x9e174a final_scan_insn_1
        ../../../gccsvn/gcc/final.c:3110
0x9e1c3b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
        ../../../gccsvn/gcc/final.c:3146
0x9e1f04 final_1
        ../../../gccsvn/gcc/final.c:2019
0x9e2c64 rest_of_handle_final
        ../../../gccsvn/gcc/final.c:4657
0x9e2c64 execute
        ../../../gccsvn/gcc/final.c:4731
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.




winnt.c:

        case REG_CFA_DEF_CFA:
        case REG_CFA_EXPRESSION:
          /* Only emitted with DRAP and aligned memory access using a
             realigned SP, both of which we disable.  */
          gcc_unreachable ();
          break;


More information about the Gcc-bugs mailing list