http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46479
--- Comment #3 from Jeffrey A. Law <law at redhat dot com> 2010-11-15 18:17:26 UTC --- On 11/15/10 08:07, jakub at gcc dot gnu.org wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46479 > > --- Comment #2 from Jakub Jelinek<jakub at gcc dot gnu.org> 2010-11-15 > 15:00:37 UTC --- > Perhaps you're right, if > asm ("movl $0, %0; movl $1, %1" : "=g" (x), "=g" (y)) > would be allowed to use register for x and memory for y and use the register > chosen for x as address of memory chosen for y, then the above one wouldn't > work without early clobbers, eventhough no inputs are consumed after first > output is written. > That would mean gccs before 4.0 were buggy. In general, I wouldn't think a register used in an output address would be valid in another output. There may be cases where it works, depending on what gets reloaded and the ordering of operands, etc, but writing code which depended on allowing the same reg to be used in both circumstances, knowing reload would DTRT because of how the asm was written would be, umm, bad. > Now, perhaps we could see if the output operand for the MEM is ever referenced > in the asm template, but then we are jumping into the territory of different > code generation depending on what is actually appears in the template, not > sure > if we want to go there (well, we already base inlining decisions etc.on the > quess count of insns in the template). I really don't like the idea of peeking in the template. > In any case, having a way to express some memory is clobbered without actually > forcing its address to be passed to the inline asm might be useful too. Yea. I'm assuming that clobbers still force generation of the address? And presumably we can't model the use of a memory location in the clobber which might argue we need a "uses" argument to asms... Jeff