From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20246 invoked by alias); 24 Jun 2004 08:06:14 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 20227 invoked by uid 48); 24 Jun 2004 08:06:12 -0000 Date: Thu, 24 Jun 2004 08:11:00 -0000 Message-ID: <20040624080612.20225.qmail@sourceware.org> From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040624072409.16172.akpm@osdl.org> References: <20040624072409.16172.akpm@osdl.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug middle-end/16172] [3.5 Regression] simple function generates an inappropriate memmove() call X-Bugzilla-Reason: CC X-SW-Source: 2004-06/txt/msg03019.txt.bz2 List-Id: ------- 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