[Bug rtl-optimization/71793] Volatile local variable passed by value is (wrongly?) optimised away, but the containing loop is not
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 18 13:23:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71793
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to DB from comment #2)
> Thanks Richard! About this -
>
> > RTL expansion expands x as register copy for some reason
>
> - is this person's explanation about this originating in the ABI accurate?
> http://stackoverflow.com/a/38248847/2757035
>
> If so - again not that I expect anyone really to use this pattern! - but
> from a Standard perspective, I'm interested whether it forbids such register
> allocation, and whether any workaround is feasible. In practical terms, a
> very academic exercise :-) but valuable for its implications wrt the
> Standard and ABI
Well, if you look at the out-of-line copies of the function then he is correct.
But the inline copy in main() does not have this constraint and is still
mishandled. Note I didn't yet investigate closer what is going on.
More information about the Gcc-bugs
mailing list