This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: not computable at load time
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: paulkoning at comcast dot net
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Mon, 28 May 2018 11:02:46 +0200
- Subject: Re: not computable at load time
- References: <1A72BAC7-9DFB-4F98-9191-DDE896021A41@comcast.net>
On Fri, May 25, 2018 at 8:05 PM Paul Koning <paulkoning@comcast.net> 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 is not computable at load time".
> I don't understand why because it seems to be a perfectly reasonable
> compile time constant; "load time" doesn't enter into the picture that
> I can see.
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).
> If I replace "long" by "short" it works correctly. So presumably it has
> something to do with the fact that Pmode == HImode. But how that
translates
> into this failure I don't know.
> paul