https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97708

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |documentation

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Boris from comment #7)
> (In reply to Jakub Jelinek from comment #6)
> > I agree with Andrew here, the compiler does what it is asked to do, so puts
> > the value into either memory or general purpose register.  Neither "r" nor
> > "g" allows putting the value into an SSE register.  Use "x" constraint for
> > that.
> 
> Look at the documentation:
> 
> "ā€˜g’ Any register, memory or immediate integer operand is allowed, except
> for registers that are not general registers."

I think the wording is ambiguous and thus this is a documentation issue.
This is not about what "values" are allowed but what registers _GCC_
is allowed to choose to put the value in during register allocation.  And
GCC will just choose on of the allowed places to put the value.  GCC will
even put a floating point value into a GPR if you ask for that.  Or fail
spectacularly if it doesn't manage to do.

I'm not a native speaker but maybe

"'g' The compiler can choose any register, memory or immediate integer operand
to put the value, except for registers that are not general registers."

is the behavior consistent with that wording?

Reply via email to