This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] RFC: Never gimplify ASM_EXPRs
- From: Linus Torvalds <torvalds at transmeta dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: Richard Henderson <rth at redhat dot com>, Jason Merrill <jason at redhat dot com>, Diego Novillo <dnovillo at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Thu, 5 Jun 2003 22:45:26 -0700 (PDT)
- Subject: Re: [tree-ssa] RFC: Never gimplify ASM_EXPRs
On Thu, 5 Jun 2003, Zack Weinberg wrote:
> Richard Henderson <rth@redhat.com> writes:
> >
> > register short int x;
> > __asm__ ("fldcw %0" : : "m"(x));
> >
> > I.e. a DECL_P that cannot be addressed. Possibly that
> > already happens inside the lang_hook; I havn't checked.
>
> 3.3 treats this identically to
>
> register short int x;
> use(&x);
>
> i.e. on-by-default warning, becomes an error with -pedantic-errors.
That's just ugly. Think of this:
register short int x;
__asm__ ("fldcw %0" : : "m"(x)); // ERROR!
__asm__ ("fldcw %0" : : "m"(x+0)); // OK!
that's just not sensible. Why didn't gcc create a temporary for the first
case to make it addressable, since it did so for the second case? Yeah,
_I_ see why, but I think it shows just how ugly that thing is.
Having a lvalue rule would make it unambiguous. Both cases would be errors
(for seemingly different reasons, but it boils down to the same thing:
neither expression properly has an address).
I dunno. I think C is a beautiful language - "simple and internally
self-consistent", if you will. And it would be nice if the extensions were
that way too.
Linus