[Bug middle-end/79835] load to a variable outside the scope of a function is optimized out
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Mar 3 19:39:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79835
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|c |middle-end
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
You need to mark the variable as volatile as gcc thinks malloc does not change
any global visiable state. There is a duplicate of this issue already but I
can't find it right now.
More information about the Gcc-bugs
mailing list