This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PowerPC-sysV/eabi, harmonization of section attribute and small data optimization


David Edelsohn wrote:

>         First, I assume that you sent the patch reversed.
>

Yes, and moreover, the patch was not relative to the unretouched
GCC-3.2.2.
Please find the updated patch (still the diff-reported line
numbers for the
fixed file do not match, please disegard those).

>
>         Did you remove the comment about _SDA_BASE_ on purpose?
For what
> reason?
>

The comment related to a validation that can only be made by the
linker.

>
>         I understand removing the -G limit in
rs6000_encode_section_info
> if the section explicitly was selected with the GCC section
attribute, but
> I think it is incorrect to unilaterally remove the -G limit from
> small_data_operand just to allow potentially large objects
specified by
> the GCC section attribute through -- this will accept any large
object
> which then will need to be fixed up if it was not suppose to be
in the
> small data section.
>

Indeed, this will accept any large object, as if someone would
specify -G
100000, or as if someone would affix the __attribute__ to too many
data
objects. In either case, the programmer was too ambitious in using
some
options.

In any event, these errors can only be catched by the linker, and
their
solution can only be done by the programmer.

Not applying the fix to small_data_operand would defeat the
purpose the fix to
rs6000_encode_section_info. If I remember well, I did try.

>
> David

Again, many thanks for this ...

--

- Thierry Moreau

CONNOTECH Experts-conseils inc.
9130 Place de Montgolfier
Montreal, Qc
H2M 2A1

Tel.: (514)385-5691
Fax:  (514)385-5900

e-mail: thierry.moreau@connotech.com

*** gcc-3.2.2/gcc/config/rs6000/rs6000.c	Thu Jan 23 17:19:42 2003
--- gcc-3.2.2-fixed/gcc/config/rs6000/rs6000.c	Sat Feb 15 11:53:02 2003
*************** small_data_operand (op, mode)
*** 1679,1688 ****
        rtx sum = XEXP (op, 0);
        HOST_WIDE_INT summand;

-       /* We have to be careful here, because it is the referenced address
-         that must be 32k from _SDA_BASE_, not just the symbol.  */
        summand = INTVAL (XEXP (sum, 1));
!       if (summand < 0 || summand > g_switch_value)
         return 0;

        sym_ref = XEXP (sum, 0);
--- 1748,1755 ----
        rtx sum = XEXP (op, 0);
        HOST_WIDE_INT summand;

        summand = INTVAL (XEXP (sum, 1));
!       if (summand < 0)
         return 0;

        sym_ref = XEXP (sum, 0);
*************** rs6000_encode_section_info (decl)
*** 11033,11052 ****
  	    abort ();
  	}

!       if ((size > 0 && size <= g_switch_value)
! 	  || (name
! 	      && ((len == sizeof (".sdata") - 1
  		   && strcmp (name, ".sdata") == 0)
! 		  || (len == sizeof (".sdata2") - 1
  		      && strcmp (name, ".sdata2") == 0)
! 		  || (len == sizeof (".sbss") - 1
  		      && strcmp (name, ".sbss") == 0)
! 		  || (len == sizeof (".sbss2") - 1
  		      && strcmp (name, ".sbss2") == 0)
! 		  || (len == sizeof (".PPC.EMB.sdata0") - 1
  		      && strcmp (name, ".PPC.EMB.sdata0") == 0)
! 		  || (len == sizeof (".PPC.EMB.sbss0") - 1
! 		      && strcmp (name, ".PPC.EMB.sbss0") == 0))))
  	{
  	  rtx sym_ref = XEXP (DECL_RTL (decl), 0);
  	  size_t len = strlen (XSTR (sym_ref, 0));
--- 11100,11119 ----
  	    abort ();
  	}

!       if (name?
! 		   ((len == sizeof (".sdata")
  		   && strcmp (name, ".sdata") == 0)
! 		  || (len == sizeof (".sdata2")
  		      && strcmp (name, ".sdata2") == 0)
! 		  || (len == sizeof (".sbss")
  		      && strcmp (name, ".sbss") == 0)
! 		  || (len == sizeof (".sbss2")
  		      && strcmp (name, ".sbss2") == 0)
! 		  || (len == sizeof (".PPC.EMB.sdata0")
  		      && strcmp (name, ".PPC.EMB.sdata0") == 0)
! 		  || (len == sizeof (".PPC.EMB.sbss0")
! 		      && strcmp (name, ".PPC.EMB.sbss0") == 0))
! 		   :(size > 0 && size <= g_switch_value))
  	{
  	  rtx sym_ref = XEXP (DECL_RTL (decl), 0);
  	  size_t len = strlen (XSTR (sym_ref, 0));

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]