GCC build failed for native with your patch on 2002-06-02T22:30:03Z.

Jan Hubicka jh@suse.cz
Mon Jun 3 10:15:00 GMT 2002


> > On Mon, Jun 03, 2002 at 01:21:06PM +0100, Neil Booth wrote:
> > > neil@cat:~/src/gcc/build/i686-pc-linux-gnu/libstdc++-v3/src$
> > > /home/neil/src/gcc/build/gcc/xgcc -shared-libgcc
> > > -B/home/neil/src/gcc/build/gcc/ -nostdinc++
> > > -L/home/neil/src/gcc/build/i686-pc-linux-gnu/libstdc++-v3/src
> > > -L/home/neil/src/gcc/build/i686-pc-linux-gnu/libstdc++-v3/src/.libs
> > > -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/i686-pc-linux-gnu/lib/
> > > -isystem /usr/local/i686-pc-linux-gnu/include -nostdinc++
> > > -I/home/neil/src/gcc/build/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu
> > > -I/home/neil/src/gcc/build/i686-pc-linux-gnu/libstdc++-v3/include
> > > -I../../../../libstdc++-v3/libsupc++ -I../../../../libstdc++-v3/libmath
> > > -g -O2 -D_GNU_SOURCE -fno-implicit-templates -Wall -Wno-format -W
> > > -Wwrite-strings -Winline -fdiagnostics-show-location=once
> > > -ffunction-sections -fdata-sections -g -Wp,-MD,.deps/functexcept.pp -c
> > > ../../../../libstdc++-v3/src/functexcept.cc -o functexcept.o >/dev/null
> > > ../../../../libstdc++-v3/src/functexcept.cc: In destructor `virtual 
> > >    std::domain_error::~domain_error()':
> > > ../../../../libstdc++-v3/src/functexcept.cc:61: Internal compiler error
> > > in 
> > >    remove_insn, at emit-rtl.c:3537
> > > Please submit a full bug report,
> > > with preprocessed source if appropriate.
> > > See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
> > > 
> > > This is how it died for me.  Why do we pipe stderr to /dev/null?
> 
Hi,
the attached patch solves the problem.  I am still bootstrapping, but I
guess it will pass.
The problem is that cfg has been rebuilt before find_exception_labels
without calling free_bb_for_insn first.  This worked in old code by
leaking the memory, but now it produces crash.
Is the attached patch OK assuming it passes bootstrap?
I am now rebuilding the CFG only when sibcall optimization is done, as
otherwise the CFG is already built anyway.

Mon Jun  3 19:11:53 CEST 2002  Jan Hubicka  <jh@suse.cz>
	* except.c (except.c): Do not rebuild CFG.
	* toplev.c (rest_of_compilation): Recompute CFG after sibcall
	optimization.

Index: except.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/except.c,v
retrieving revision 1.222
diff -c -3 -p -r1.222 except.c
*** except.c	3 Jun 2002 01:13:15 -0000	1.222
--- except.c	3 Jun 2002 17:11:02 -0000
*************** finish_eh_generation ()
*** 2499,2506 ****
       connect many of the handlers, and then type information will not
       be effective.  Still, this is a win over previous implementations.  */
  
-   rebuild_jump_labels (get_insns ());
-   find_basic_blocks (get_insns (), max_reg_num (), 0);
    cleanup_cfg (CLEANUP_PRE_LOOP | CLEANUP_NO_INSN_DEL);
  
    /* These registers are used by the landing pads.  Make sure they
--- 2499,2504 ----
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.642
diff -c -3 -p -r1.642 toplev.c
*** toplev.c	3 Jun 2002 10:02:38 -0000	1.642
--- toplev.c	3 Jun 2002 17:11:08 -0000
*************** rest_of_compilation (decl)
*** 2560,2565 ****
--- 2560,2571 ----
        rtx insn;
        optimize_sibling_and_tail_recursive_calls ();
  
+       /* Recompute the CFG as sibling optimization clobbers it randomly.  */
+       free_bb_for_insn ();
+       find_exception_handler_labels ();
+       rebuild_jump_labels (insns);
+       find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
+ 
        /* There is pass ordering problem - we must lower NOTE_INSN_PREDICTION
           notes before simplifying cfg and we must do lowering after sibcall
           that unhides parts of RTL chain and cleans up the CFG.
*************** rest_of_compilation (decl)
*** 2576,2582 ****
  
    scope_to_insns_initialize ();
    /* Complete generation of exception handling code.  */
-   find_exception_handler_labels ();
    if (doing_eh (0))
      {
        timevar_push (TV_JUMP);
--- 2582,2587 ----



More information about the Gcc-regression mailing list