From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3051 invoked by alias); 9 Nov 2007 16:14:54 -0000 Received: (qmail 3017 invoked by uid 48); 9 Nov 2007 16:14:44 -0000 Date: Fri, 09 Nov 2007 16:14:00 -0000 Subject: [Bug tree-optimization/34043] New: Missed optimization causing extra loads and stores when using x86_64 builtin function together with aggregate types. X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jsjodin at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg00805.txt.bz2 Compile the attached file test.cpp with the following flags: g++ -DNDEBUG -m32 -msse2 -O2 -msse2 -DSHOW_BUG gcc_bug.cpp -S In the generated code there are useless stores and loads of %xmm0 to -40(%eps) and -56(%eps). If the code is compiled without -DSHOW_BUG it will generate a more optimal version without the extra memory accesses. See the attached generated files test_bad.s and test_good.s for the resulting code. This is an old problem existing in 4.1.x. -- Summary: Missed optimization causing extra loads and stores when using x86_64 builtin function together with aggregate types. Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jsjodin at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34043