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

            Bug ID: 109700
           Summary: [13/14 regression] ICE with address sanitizer after
                    declaring __builtin_alloca
           Product: gcc
           Version: 13.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlegg at feralinteractive dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

Created attachment 54971
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54971&action=edit
Preprocessed source, GCC 13.1.1

When compiling this as C++:
void *__builtin_alloca(unsigned long);
void f(int *);
void g() {
  int x;
  int *y = (int *)__builtin_alloca(sizeof(int));
  *y = 0;
  f(&x);
}

using g++ -fsanitize=address -Og test.cpp -c, I get the following error with
GCC 13.1.1:
during GIMPLE pass: ehcleanup
test.cpp: In function ‘void g()’:
test.cpp:3:6: internal compiler error: in mark_reachable_handlers, at
tree-eh.cc:4063
    3 | void g() {
      |      ^

The GCC trunk option on Compiler Explorer currently
((Compiler-Explorer-Build-gcc-4d68c7f7b5aea5e95f44c3af13a24aa3daae9cf5-binutils-2.40)
14.0.0 20230501 (experimental)) has a different internal compiler error:
<source>: In function 'void g()':
<source>:5:6: error: BB 2 cannot throw but has an EH edge
    5 | void g() {
      |      ^
during GIMPLE pass: asan
<source>:5:6: internal compiler error: verify_flow_info failed
0x23643ae internal_error(char const*, ...)
        ???:0
0xe18267 verify_flow_info()
        ???:0

GCC 12.2 compiles this code.

Reply via email to