This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PR middle-end/18160
Richard Henderson writes:
> register int foo __asm__("%eax");
> &foo;
>
> should, in my opinion, be a HARD error. This case is so ill
> formed that the user should be smacked.
This is the variant, the PR is talking about. And it was confirmed as
a regression in the PR. I acted accordingly.
In fact I brought up in my previous email the possibility of issuing
an error and keeping the compiler clean. But actually the fix is a
one-liner, nothing major. But I guess the conclusion is that this is
not a regression but an undefined behavior that happened to work until
3.4.
I will create a patch to issue an error for this case.
> In contrast, I understood
>
> register int bar;
> &bar;
>
> to be the case we were allowing as just a warning. Which,
> I suppose, is ok. Personally I'd still vote for a hard
> error, but whatever.
Should this be turned into an error too? The fact that DECL_REGISTER
remains set here does not affect code generation as expand_one_var
checks DECL_HARD_REGISTER.
Adam