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: strange compiling problem


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~


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