strange compiling problem

Richard Henderson rth@redhat.com
Sun Sep 7 19:17:00 GMT 2003


On Sun, Sep 07, 2003 at 04:22:21PM +0100, Jamie Lokier wrote:
> >       :"=m"(ra)
> >       :"0"(ra), "m"(rb)
> 
> I'm just making a guess from Jim's reply; I haven't tried it.  Try this:
> 
> 	:"=m"(*&ra)
> 	:"0"(*&ra), "m"(*&rb)

No, the problem is that matching constraints with memory operands
doesn't really make sense.

What happens in this case is that you have two evaluations of *&ra,
and so you wind up with

	(mem:SI (reg:SI 1000))
	(mem:SI (reg:SI 1001))

which are not identical, and thus do not match.  Even though the
two registers contain the same data.  Sometimes this can be hidden
by turning on the optimizer, but not always.

A followup implies that "+m" would help, but due to the way that
interacts with reload internals it doesn't really make sense either.

The correct way to write this is 

	"=m"(ra) : "m"(ra), "m"(rb)


r~



More information about the Gcc mailing list