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/16172] [3.5 Regression] simple function generates an inappropriate memmove() call


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


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