This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]