This is the mail archive of the
mailing list for the GCC project.
Re: PowerPC-sysV/eabi, harmonization of section attribute and small data optimization
On Sat, Feb 15, 2003 at 08:57:25PM -0800, Geoff Keating wrote:
> This reintroduces a bug that this code was designed to fix. It is not OK.
> Code that triggers the bug can look like:
> static char array;
> t = array[x + 80000]; // valid values of x are -80000 through -79997
> GCC can internally optimise this into
> t = (array + 80000)[x];
> and 'array + 80000' can't be done with a SDA relocation.
Seems like the proper solution here is to reject
(const (plus (symbol_ref "array") (const_int large)))
when array is in the sda, and large puts it out of
range of the SDA reloc. Bounding large by the max
size of an SDA object seems reasonable.