This is the mail archive of the gcc-bugs@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]

[Bug middle-end/46479] [4.4/4.5/4.6 Regression] "+m" (*regs) : "a" (regs) doesn't use (%eax) for the MEM


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.

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).

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.


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