flow still deleting important labels

Richard Henderson rth@cygnus.com
Sun Mar 28 15:13:00 GMT 1999


On Sun, Mar 28, 1999 at 01:44:14PM -0700, Jeffrey A Law wrote:
> The way labels are handled is different when you use gas.

Ok, then there are multiple problems. 

In the first (-mgas), I don't replicate what you reported 
exactly.. the label hangs out until flow2.  At which point 
there are no references to the label whatsoever, and it 
gets deleted.

No references, that is, except for the constant pool.  And
there are no references to the constant pool symbol either,
so there's no point in outputting it.

So there are two choices here -- either set LABEL_PRESERVE_P
on things that enter the constant pool, or always garbage
collect the constant pool.  The later solution seems better.

In the second (-mno-gas), the initial rtl has the label in
the constant pool, but no REG_LABEL note.  So jump1 purges
the label.  Curious.  Looking again I see the reference in
the constant pool set to zero...  I'll check this some more.


r~


	* varasm.c (output_constant_pool): Always mark the constant pool.

Index: varasm.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/varasm.c,v
retrieving revision 1.56
diff -c -p -d -r1.56 varasm.c
*** varasm.c	1999/03/19 08:50:14	1.56
--- varasm.c	1999/03/28 22:52:04
*************** output_constant_pool (fnname, fndecl)
*** 3615,3622 ****
    /* It is possible for gcc to call force_const_mem and then to later
       discard the instructions which refer to the constant.  In such a
       case we do not need to output the constant.  */
!   if (optimize >= 0 && flag_expensive_optimizations)
!     mark_constant_pool ();
  
  #ifdef ASM_OUTPUT_POOL_PROLOGUE
    ASM_OUTPUT_POOL_PROLOGUE (asm_out_file, fnname, fndecl, pool_offset);
--- 3615,3621 ----
    /* It is possible for gcc to call force_const_mem and then to later
       discard the instructions which refer to the constant.  In such a
       case we do not need to output the constant.  */
!   mark_constant_pool ();
  
  #ifdef ASM_OUTPUT_POOL_PROLOGUE
    ASM_OUTPUT_POOL_PROLOGUE (asm_out_file, fnname, fndecl, pool_offset);


More information about the Gcc-patches mailing list