ICE in pre_insert_insn (gcse.c)

Jeffrey A Law law@cygnus.com
Tue Dec 15 04:07:00 GMT 1998


  In message < 36701153.4C40@acm.org >you write:
  > This is a multi-part message in MIME format.
  > 
  > --------------A023ED2148B
  > Content-Type: text/plain; charset=us-ascii
  > Content-Transfer-Encoding: 7bit
  > 
  > Hi,
  > I've tickled a bug in the gcse module with some simple C++ code
  > (a do .. while loop!). I've attached the test case (compile with -O2).
  > The problem is present in the 19981206 snapshot. Here's the session log,
  > 
  > nathan@manao:780>uname -a
  > SunOS manao 5.6 Generic_105181-03 sun4u sparc SUNW,Ultra-5_10
  > nathan@manao:781>ss-g++ -c -O2 preinsert.ii -v
  > Reading specs from /home/staff/nathan/solaris/local/sparc-SunOS_5/lib/gcc-l
  > ib/sparc-sun-solaris2.6/egcs-2.92.27/specs
  > gcc version egcs-2.92.27 19981206 (gcc2 ss-980609 experimental)
  >  /home/staff/nathan/solaris/local/sparc-SunOS_5/lib/gcc-lib/sparc-sun-solar
  > is2.6/egcs-2.92.27/cc1plus preinsert.ii -quiet -O2 -version -o /var/tmp/cc2
  > t4hAi.s
  > GNU C++ version egcs-2.92.27 19981206 (gcc2 ss-980609 experimental) (sparc-
  > sun-solaris2.6) compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 r
  > elease).
  > gcse.c:4484: Internal compiler error in function pre_insert_insn
I'm testing a patch for this overnight.  With any luck testing will be
successful and the bug fixed by this time tomorrow.

Some global optimization algorithms can do weird things if presented a flow
graph with blocks that have no successors (ie blocks which end with calls
to functions which never return, like "__throw").

The common way to deal with this is to insert a fake edge for any such block
to the exit block.  Such an edge can never be traversed and it adds stability
to the global optimization algorithms and shouldn't cause the compiler to
miss any optimizations.

jeff



More information about the Gcc-bugs mailing list