This is the mail archive of the
mailing list for the GCC project.
Re: supression of 'matching constraint does not allow a register'warning
- From: Jim Wilson <wilson at specifixinc dot com>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: Peter Barada <peter at the-baradas dot com>, gcc at gcc dot gnu dot org
- Date: Fri, 30 Apr 2004 23:29:07 -0700
- Subject: Re: supression of 'matching constraint does not allow a register'warning
- References: <20040430161027.83EF798C8A@baradas.org> <firstname.lastname@example.org> <20040430180953.GA23976@nevyn.them.org>
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