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

            Bug ID: 90794
           Summary: adding -O3 leads to crash
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhonghao at pku dot org.cn
  Target Milestone: ---

My gcc is 10.0.0, and my code is:

#include <malloc.h>

int run(int sz)
{
 typedef double MAT[sz][sz];
 MAT *a;
 a = (MAT*) malloc(sizeof(MAT));
 return (a==0);
}

int main(int argc, char* argv[])
{
 return run(500);
}

I compiles well, but after adding -O3, it crashes:
: In function ‘int main(int, char**)’:
: internal compiler error: Segmentation fault
   11 | int main(int argc, char* argv[])
      |     ^~~~
0xb3badf crash_signal
        ../../9.1/gcc/toplev.c:326
0xc1660d has_zero_uses
        ../../9.1/gcc/ssa-iterators.h:389
0xc1660d coalesce_with_default
        ../../9.1/gcc/tree-ssa-coalesce.c:1019
0xc1660d populate_coalesce_list_for_outofssa
        ../../9.1/gcc/tree-ssa-coalesce.c:1241
0xc1660d coalesce_ssa_name(_var_map*)
        ../../9.1/gcc/tree-ssa-coalesce.c:1709
0xbc96eb remove_ssa_form
        ../../9.1/gcc/tree-outof-ssa.c:1031
0xbc96eb rewrite_out_of_ssa(ssaexpand*)
        ../../9.1/gcc/tree-outof-ssa.c:1289
0x7b8500 execute
        ../../9.1/gcc/cfgexpand.c:6327
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.

Reply via email to