[Bug rtl-optimization/15725] New: ICE in EXECUTE_IF_SET_IN_REG_SET macro when gcc built with BOOT_CFLAGS="-g -O2 -fold-unroll-loops"

danglin at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun May 30 20:21:00 GMT 2004


The following three testcases fail with an ICE when GCC is built with 
BOOT_CFLAGS="-g -O2 -fold-unroll-loops":

FAIL: gcc.c-torture/compile/20001212-1.c  -O3 -fomit-frame-pointer  (test for 
excess errors)
FAIL: gcc.c-torture/compile/20001212-1.c  -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/execute/complex-1.c compilation,  -O1

These testcases don't fail when GCC is built without -fold-unroll-loops.

This the location of the first ICE:
(gdb) r `cat xxx.sh`
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: /home/dave/gcc-3.4/objdir/gcc/cc1 `cat xxx.sh`
GNU C version 3.4.1 20040529 (prerelease) (hppa-linux)
        compiled by GNU C version 3.4.1 20040529 (prerelease).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
options passed:  -iprefix -isystem -auxbase-strip -O3 -w
 -fomit-frame-pointer
options enabled:  -feliminate-unused-debug-types -fdefer-pop
 -fomit-frame-pointer -foptimize-sibling-calls -funit-at-a-time
 -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations
 -fthread-jumps -fstrength-reduce -funswitch-loops -fpeephole -fforce-mem
 -ffunction-cse -fkeep-static-consts -fcaller-saves -freg-struct-return
 -fdelayed-branch -fweb -fgcse -fgcse-lm -fgcse-sm -fgcse-las
 -floop-optimize -fcrossjumping -fif-conversion -fif-conversion2
 -frerun-cse-after-loop -frerun-loop-opt -fdelete-null-pointer-checks
 -fschedule-insns -fschedule-insns2 -fsched-interblock -fsched-spec
 -fsched-stalled-insns -fsched-stalled-insns-dep -fbranch-count-reg
 -freorder-blocks -freorder-functions -frename-registers -fcprop-registers
 -fcommon -fregmove -foptimize-register-move -fargument-alias
 -fstrict-aliasing -fmerge-constants -fzero-initialized-in-bss -fident
 -fpeephole2 -fguess-branch-probability -fmath-errno -ftrapping-math
 -msnake -mpa-risc-1-1 -mno-space-regs -mgas -mschedule=8000
 a

Analyzing compilation unit
Performing intraprocedural optimizations
Assembling functions:
 a

Program received signal SIGSEGV, Segmentation fault.
0x001212e8 in update_life_info (blocks=0x0, extent=UPDATE_LIFE_LOCAL,
    prop_flags=5) at ../../gcc/gcc/flow.c:715
715           EXECUTE_IF_SET_IN_REG_SET (ENTRY_BLOCK_PTR->global_live_at_end,
(gdb) disass 0x001212d0 0x00121300
Dump of assembler code from 0x1212d0 to 0x121300:
0x001212d0 <update_life_info+2596>:     depw,z r19,26,27,r19
0x001212d4 <update_life_info+2600>:     andcm r21,r20,r21
0x001212d8 <update_life_info+2604>:     add,l r19,r23,r22
0x001212dc <update_life_info+2608>:     shladd,l r22,2,ret0,r20
0x001212e0 <update_life_info+2612>:     ldw 10(,r20),r19
0x001212e4 <update_life_info+2616>:     cmpib,= 0,r21,0x1213a0 <update_life_info+
2804>
0x001212e8 <update_life_info+2620>:     stw r31,24(,r19)
0x001212ec <update_life_info+2624>:     subi 1f,r24,r1
0x001212f0 <update_life_info+2628>:     mtsar r1
0x001212f4 <update_life_info+2632>:     depwi,z 1,%sar,32,r20
0x001212f8 <update_life_info+2636>:     and r21,r20,r19
0x001212fc <update_life_info+2640>:     cmpib,= 0,r19,0x121328 <update_life_info+
2684>
End of assembler dump.
(gdb) p $r19
$2 = 0

This is the location of the third ICE:
(gdb) r `cat yyy.sh`
Starting program: /home/dave/gcc-3.4/objdir/gcc/cc1 `cat yyy.sh`
GNU C version 3.4.1 20040529 (prerelease) (hppa-linux)
        compiled by GNU C version 3.4.1 20040529 (prerelease).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
options passed:  -iprefix -isystem -auxbase -O1 -w
options enabled:  -feliminate-unused-debug-types -fdefer-pop
 -fomit-frame-pointer -fthread-jumps -fpeephole -ffunction-cse
 -fkeep-static-consts -freg-struct-return -fdelayed-branch -fgcse-lm
 -fgcse-sm -fgcse-las -floop-optimize -fif-conversion -fif-conversion2
 -fsched-interblock -fsched-spec -fsched-stalled-insns
 -fsched-stalled-insns-dep -fbranch-count-reg -fcprop-registers -fcommon
 -fargument-alias -fmerge-constants -fzero-initialized-in-bss -fident
 -fguess-branch-probability -fmath-errno -ftrapping-math -msnake
 -mpa-risc-1-1 -mno-space-regs -mgas -mschedule=8000
 g0
 g1
 g2
 cexp
 main

Program received signal SIGSEGV, Segmentation fault.
0x002efb90 in mark_target_live_regs (insns=0x40006c40, target=0x400a2440,
    res=0xbff016f8) at ../../gcc/gcc/resource.c:966
966           EXECUTE_IF_SET_IN_REG_SET
(gdb) disass 0x002efb80 0x002efba0
Dump of assembler code from 0x2efb80 to 0x2efba0:
0x002efb80 <mark_target_live_regs+872>: nop
0x002efb84 <mark_target_live_regs+876>: ldw c(,r24),r19
0x002efb88 <mark_target_live_regs+880>: ldw 2c(,r19),r20
0x002efb8c <mark_target_live_regs+884>: ldw,s ret0(,r20),r21
0x002efb90 <mark_target_live_regs+888>: ldb 2(,r21),r19
0x002efb94 <mark_target_live_regs+892>: ldb r5(,r19),r20
0x002efb98 <mark_target_live_regs+896>: ldo 3(r20),r19
0x002efb9c <mark_target_live_regs+900>: extrw,s r19,29,30,r19
End of assembler dump.
(gdb) p $r21
$1 = 0

As can be seen, both occur in the EXECUTE_IF_SET_IN_REG_SET macro.

GCC was configured as follows:
dave@gsyprf11:~/gcc-3.4/objdir/gcc$ ./xgcc -B./ -v
Reading specs from ./specs
Configured with: ../gcc/configure --with-gnu-as --with-as=/home/dave/opt/gnu/bin/
as --with-gnu-ld --with-ld=/home/dave/opt/gnu/bin/ld --enable-shared --disable-
nls --prefix=/home/dave/opt/gnu/gcc/gcc-3.4.1 --with-local-prefix=/home/dave/opt/
gnu --enable-threads=posix --enable-__cxa_atexit --disable-checking --host=hppa-
linux
Thread model: posix
gcc version 3.4.1 20040529 (prerelease)

I hope this isn't more fallout from PR bootstrap/14671.  That's why I tested
building GCC with -fold-unroll-loops.

-- 
           Summary: ICE in EXECUTE_IF_SET_IN_REG_SET macro when gcc built
                    with BOOT_CFLAGS="-g -O2 -fold-unroll-loops"
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: danglin at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: hppa-unknown-linux-gnu
  GCC host triplet: hppa-unknown-linux-gnu
GCC target triplet: hppa-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15725



More information about the Gcc-bugs mailing list