This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]