This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/16172] [3.5 Regression] simple function generates an inappropriate memmove() call
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jun 2004 08:06:12 -0000
- Subject: [Bug middle-end/16172] [3.5 Regression] simple function generates an inappropriate memmove() call
- References: <20040624072409.16172.akpm@osdl.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-24 08:06 -------
This does not make sense:
return *(fn_hash_idx_t*)&h;
why do it this way, to get NRV to work well for 3.5.0 this is not needed at all and is what caused the
problem, also this is undefined by the C standard (but we define it with -fno-strict-aliasing but this just
makes the code ugly to look at).
Also why have it return a struct in the first place this seems dumb.
Anyways a workaround (maybe even a real fix):
fn_hash_idx_t t;
t.datum = h;
return t;
But anyways the call to memmove is a regression.
--
What |Removed |Added
----------------------------------------------------------------------------
Component|c |middle-end
Keywords| |missed-optimization
Summary|simple function generates an|[3.5 Regression] simple
|inappropriate memmove() call|function generates an
| |inappropriate memmove() call
Target Milestone|--- |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16172