Re: not computable at load time

2018-05-31 Thread Joseph Myers
On Tue, 29 May 2018, Richard Biener wrote: > The testcase dates back to some repository creation rev. (egcs?) and > I'm not sure we may compute the difference of addresses of structure > members. So that GCC accepts this is probably not required. Joseph > may have a definitive answer here. My m

Re: not computable at load time

2018-05-29 Thread Paul Koning
> On May 29, 2018, at 5:49 AM, Richard Biener > wrote: > ... > It might be a "regression" with the POINTER_MINUS_EXPR introduction. > You can debug this with gdb when you break on 'pointer_diff'. For me > on x86_64 this builds a POINTER_DIFF_EXPR: (char *) &s.f - &s.b > of ptrdiff_t. That a

Re: not computable at load time

2018-05-29 Thread Richard Biener
On Mon, May 28, 2018 at 8:34 PM Paul Koning wrote: > > On May 28, 2018, at 12:03 PM, Richard Biener > wrote: > > > > On May 28, 2018 12:45:04 PM GMT+02:00, Andreas Schwab wrote: > >> On Mai 28 2018, Richard Biener wrote: > >> > >>> It means there's no relocation that can express the result o

Re: not computable at load time

2018-05-28 Thread Paul Koning
> On May 28, 2018, at 12:03 PM, Richard Biener > wrote: > > On May 28, 2018 12:45:04 PM GMT+02:00, Andreas Schwab wrote: >> On Mai 28 2018, Richard Biener wrote: >> >>> It means there's no relocation that can express the result of 's.f - >> &s.b' >>> and the frontend doesn't consider this

Re: not computable at load time

2018-05-28 Thread Richard Biener
On May 28, 2018 12:45:04 PM GMT+02:00, Andreas Schwab wrote: >On Mai 28 2018, Richard Biener wrote: > >> It means there's no relocation that can express the result of 's.f - >&s.b' >> and the frontend doesn't consider this a constant expression (likely >because >> of the conversion). > >Shouldn't

Re: not computable at load time

2018-05-28 Thread Andreas Schwab
On Mai 28 2018, Richard Biener wrote: > It means there's no relocation that can express the result of 's.f - &s.b' > and the frontend doesn't consider this a constant expression (likely because > of the conversion). Shouldn't the frontend notice that s.f - &s.b by itself is a constant? Andreas.

Re: not computable at load time

2018-05-28 Thread Richard Biener
On Fri, May 25, 2018 at 8:05 PM Paul Koning wrote: > One of my testsuite failures for the pdp11 back end is gcc.c-torture/compile/930326-1.c which is: > struct > { >char a, b, f[3]; > } s; > long i = s.f-&s.b; > It fails with "error: initializer element

not computable at load time

2018-05-25 Thread Paul Koning
One of my testsuite failures for the pdp11 back end is gcc.c-torture/compile/930326-1.c which is: struct { char a, b, f[3]; } s; long i = s.f-&s.b; It fails with "error: initializer element is not computable at load time". I don't understand why because it seem

Re: [named address] rejects-valid: error: initializer element is not computable at load time

2011-08-08 Thread Georg-Johann Lay
Ulrich Weigand schrieb: Georg-Johann Lay wrote: Ulrich Weigand wrote: This is pretty much working as expected. "pallo" is a string literal which (always) resides in the default address space. According to the named address space specification (TR 18037) there are no string literals in non-d

Re: [named address] rejects-valid: error: initializer element is not computable at load time

2011-08-05 Thread Ulrich Weigand
Georg-Johann Lay wrote: > Ulrich Weigand wrote: > > This is pretty much working as expected. "pallo" is a string literal > > which (always) resides in the default address space. According to the > > named address space specification (TR 18037) there are no string literals > > in non-default addre

Re: [named address] rejects-valid: error: initializer element is not computable at load time

2011-08-04 Thread Georg-Johann Lay
Ulrich Weigand wrote: > Georg-Johann Lay wrote: > >> For the following 1-liner I get an error with current trunk r177267: >> >> const __pgm char * pallo = "pallo"; >> >> __pgm as a named address space qualifier. > [snip] >> Moreover, if a user writes a line like >>const __pgm char * pallo = "p

Re: [named address] rejects-valid: error: initializer element is not computable at load time

2011-08-04 Thread Ulrich Weigand
Georg-Johann Lay wrote: > For the following 1-liner I get an error with current trunk r177267: > > const __pgm char * pallo = "pallo"; > > __pgm as a named address space qualifier. [snip] > Moreover, if a user writes a line like >const __pgm char * pallo = "pallo"; > he wants the string lite

[named address] rejects-valid: error: initializer element is not computable at load time

2011-08-04 Thread Georg-Johann Lay
as set -1 canonical type 0xb7473f00> readonly constant arg 0 readonly constant arg 0 readonly constant static "pallo\000"> pgm.c:1:28> pgm.c:1:28> pgm.c:1:28> pgm.c:1:1: error: initializer eleme