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

            Bug ID: 102285
           Summary: New flag -ftrivial-auto-var-init=zero causes many
                    crashes in the testsuite
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For the C source code under gcc/trunk/gcc/testsuite, I did:

$ find . -name \*.c -print | sort > file.c.list
$ head file.c.list
./ada/acats/tests/cd/cd300051.c
./ada/acats/tests/cxb/cxb30040.c
./ada/acats/tests/cxb/cxb30060.c
./ada/acats/tests/cxb/cxb30130.c
./ada/acats/tests/cxb/cxb30131.c
./c-c++-common/addrtmp.c
./c-c++-common/array-1.c
./c-c++-common/array-5.c
./c-c++-common/array-6.c
./c-c++-common/array-init.c
$ wc -l file.c.list
42647 file.c.list
$

So I did a bit of light testing:

$ for i in `cat file.c.list`; do echo $i; /home/dcb/gcc/results/bin/gcc -c -g
-O2 -Wall -ftrivial-auto-var-init=zero  $i; done > 11.out 2>&1 
$

Normally, this kind of for loop would produce a small number of crashes.
Instead, I get 25 and it's only done about 25% of all the C source code files.

$ grep -c "\.c$" 11.out 
9184
$ 

The compiler is built with checking enabled.

Here are the first few:

$ fgrep "internal compiler error:" 11.out | head
./c-c++-common/dfp/func-vararg-size0.c:16:5: internal compiler error:
Segmentation fault
./c-c++-common/dfp/struct-layout-1.c:51:5: internal compiler error:
Segmentation fault
./c-c++-common/gomp/reduction-1.c:8:1: internal compiler error: Segmentation
fault
./c-c++-common/gomp/udr-1.c:11:1: internal compiler error: Segmentation fault
./c-c++-common/torture/pr46137.c:13:1: internal compiler error: Segmentation
fault
./c-c++-common/ubsan/bounds-14.c:6:1: internal compiler error: Segmentation
fault
./c-c++-common/Warray-bounds-10.c:63:6: internal compiler error: Segmentation
fault
./c-c++-common/Warray-bounds-9.c:12:12: internal compiler error: Segmentation
fault
./c-c++-common/Wsizeof-pointer-memaccess1.c:71:1: internal compiler error:
Segmentation fault
./c-c++-common/Wsizeof-pointer-memaccess2.c:176:1: internal compiler error:
Segmentation fault
$ 

The -ftrivial... flag although a good idea, doesn't look ready for
prime time yet. I suggest it is removed and the original code reworked
until it doesn't cause any "internal compiler error:" for the C testsuite.

Reply via email to