[Bug middle-end/34282] Unnecessary load from volatile var

ebotcazou at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Nov 29 07:14:00 GMT 2007



------- Comment #1 from ebotcazou at gcc dot gnu dot org  2007-11-29 07:13 -------
> IMO, there is no need for (1), since we already have correct value in %eax.
> However, even when value lives in another register, we should load it into
> the return register from the reg, not from mem location.

If 'return z' is deemed an access to the volatile object, we have no other
choices that generating the load.  In any cases, I'd be extremely cautious
about optimizing code manipulating volatile objects.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34282



More information about the Gcc-bugs mailing list