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

            Bug ID: 97709
           Summary: powerpc: ICE when building glibc with latest gcc
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msc at linux dot ibm.com
  Target Milestone: ---

Created attachment 49499
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49499&action=edit
Pre-processed source with the issue

This was first observed when upgrading GCC on Advance Toolchain, but I was also
able to reproduce this with upstream GCC (commit 93e79ed391b9c636f0). 

Trying to build glibc with latest GCC causes an internal compiler error:

vfprintf-internal.c: In function ‘__vfprintf_internal’:
vfprintf-internal.c:1320:1: error: SSA_NAME_OCCURS_IN_ABNORMAL_PHI should be
set
for SSA_NAME: _1972 in statement:
prec_413(ab) = PHI <_1972(36)>
PHI argument
_1972
for PHI node
prec_413(ab) = PHI <_1972(36)>
during GIMPLE pass: slp
vfprintf-internal.c:1320:1: internal compiler error: verify_ssa failed
0x10dfa0d3 verify_ssa(bool, bool)
        /home/mscastanho/src/gcc/gcc/tree-ssa.c:1208
0x1099fc1f execute_function_todo
        /home/mscastanho/src/gcc/gcc/passes.c:2046
0x109a088b do_per_function
        /home/mscastanho/src/gcc/gcc/passes.c:1687
0x109a0aaf execute_todo
        /home/mscastanho/src/gcc/gcc/passes.c:2093
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.



Preprocessed source generated with -save-temps is attached to the bug. The
issue only happens if I use -mcpu=power9 or -mcpu=power10. -mcpu=power8 seems
to be OK.

Cmdline used:
~/usr/bin/gcc -m64 ./stdio-common/vfprintf-internal.i -c -std=gnu11
-fgnu89-inline  -g -O3 -mcpu=power9 -Wall



NOTE: The original Advance Toolchain build used a slightly older GCC (commit
943cc2a1b70f), and the error message I saw was a bit different (although still
somewhat related):

Unable to coalesce ssa_names 219 and 1972 which are marked as MUST COALESCE.   
                                                                               
                                                                               
             prec_219(ab) and  _1972                         
during RTL pass: expand
vfprintf-internal.c: In function ‘__vfprintf_internal’:
vfprintf-internal.c:148:25: internal compiler error: SSA corruption             
  148 | # define vfprintf       __vfprintf_internal                             
      |                         ^~~~~~~~~~~~~~~~~~~                             
vfprintf-internal.c:1320:1: note: in expansion of macro ‘vfprintf’              
 1320 | vfprintf (FILE *s, const CHAR_T *format, va_list ap, unsigned int
mode_flags)
      | ^~~~~~~~                                                                
0x109e7dc7 fail_abnormal_edge_coalesce                         
       
/home/mscastanho/AT/broken-gcc-p910/build/at15.0-0-alpha.redhat-8_ppc64le_ppc64le/sources/gcc/gcc/tree-ssa-coalesce.c:1003
 
0x109e7dc7 coalesce_partitions   
       
/home/mscastanho/AT/broken-gcc-p910/build/at15.0-0-alpha.redhat-8_ppc64le_ppc64le/sources/gcc/gcc/tree-ssa-coalesce.c:1425
0x109e7dc7 coalesce_ssa_name(_var_map*)
       
/home/mscastanho/AT/broken-gcc-p910/build/at15.0-0-alpha.redhat-8_ppc64le_ppc64le/sources/gcc/gcc/tree-ssa-coalesce.c:1755
0x1097f8bb remove_ssa_form
       
/home/mscastanho/AT/broken-gcc-p910/build/at15.0-0-alpha.redhat-8_ppc64le_ppc64le/sources/gcc/gcc/tree-outof-ssa.c:1065
0x1097f8bb rewrite_out_of_ssa(ssaexpand*)
       
/home/mscastanho/AT/broken-gcc-p910/build/at15.0-0-alpha.redhat-8_ppc64le_ppc64le/sources/gcc/gcc/tree-outof-ssa.c:1323
0x1035f04b execute
       
/home/mscastanho/AT/broken-gcc-p910/build/at15.0-0-alpha.redhat-8_ppc64le_ppc64le/sources/gcc/gcc/cfgexpand.c:6378

Reply via email to