Compile error when not using -ftree-ter
Ian Lance Taylor
iant@google.com
Wed Aug 18 21:22:00 GMT 2010
Job Noorman <jobnoorman@gmail.com> writes:
>> ... it's just happenstance of how the compiler is written."
>
> No offense but I think that's a non-argument. You could use that to reject
> any bug report.
No, I can't. Here is the rule: when optimizing, you can use "i" if the
expression is known to reduce to a constant. When not optimizing, the
behaviour is unspecified: it will either work correctly or fail noisily.
In other words, it just depends on how the compiler is written, and it
may change in different releases.
>> It's not a bug, because the compiler only promises to reduce an address to
>> match the "i" constraint when optimizing.
>
> Where does it promise that?
While asm constraints are under-documented, it's generally true that "r"
always works for a value that fits in a register, and for anything else
it depends.
Ian
More information about the Gcc-help
mailing list