This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/34282] Unnecessary load from volatile var
- From: "ebotcazou at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Nov 2007 07:13:47 -0000
- Subject: [Bug middle-end/34282] Unnecessary load from volatile var
- References: <bug-34282-1649@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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