maybe fix opt/5863

Richard Henderson rth@redhat.com
Thu Mar 21 10:36:00 GMT 2002


This doesn't avoid spilling the symbolic constant to memory, but does
at least put it in .data instead of .rodata.  Franz, is this enough to
get ld.so functional, or is something more invasive needed?

I've gone ahead and committed it since it's a good change either way.


r~


        * config/rs6000/rs6000.c (rs6000_select_rtx_section): Put symbolic
        constants in .data when -fpic.

Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.300
diff -c -p -d -r1.300 rs6000.c
*** rs6000.c	2002/03/19 19:46:49	1.300
--- rs6000.c	2002/03/21 18:28:36
*************** rs6000_select_rtx_section (mode, x)
*** 10787,10792 ****
--- 10787,10797 ----
  {
    if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (x, mode))
      toc_section ();
+   else if (flag_pic
+ 	   && (GET_CODE (x) == SYMBOL_REF
+ 	       || GET_CODE (x) == LABEL_REF
+ 	       || GET_CODE (x) == CONST))
+     data_section ();
    else
      const_section ();
  }



More information about the Gcc-patches mailing list