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: supression of 'matching constraint does not allow a register'warning


Daniel Jacobowitz wrote:
Er, except I'm not sure that's right; something was said about operands
unreferenced in the asm text being a bad idea.

The optimizer never looks at the asm text, so whether an operand is used has no effect on how the compiler will optimize. The asm text is only used when we emit assembly to the .s file.


If this really matters, one could always add "; %2" assuming ; is the assembler comment character, but I doubt that will do anything useful.

The only thing I can think of is that if an operand has side effects, and the compiler makes assuptions about those side-effects, then whether an operand is used could make a difference. However, there are so many other issues here, the operand could be used multiple times, the operand might not actually be used by the instruction, or we might be using the operand in a special way. The optimizer really can't make any assumptions about what is happening here, so it shouldn't make any difference whether or not the operand is used.

The only thing I can immediately think of that has side-effects is auto-inc addresses, and you could avoid them if necessary by using an o constraint instead of a m constraint.

In the absence of an actual bug report, I don't think there is anything wrong with unreferenced operands.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



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