From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1972 invoked by alias); 27 Jun 2008 04:58:07 -0000 Received: (qmail 1863 invoked by uid 48); 27 Jun 2008 04:57:22 -0000 Date: Fri, 27 Jun 2008 04:58:00 -0000 Subject: [Bug tree-optimization/36646] New: [4.4 regression] Unnecessary moves generated on loop boundaries X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "astrange at ithinksw dot com" 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: 2008-06/txt/msg01603.txt.bz2 The attached source is a loop+switch statement, where only some of the switch cases change the variable 'val'. 4.4 generates moves for it in every case, even the ones where it's not mentioned, while 4.2 didn't; the difference is visible in tree dumps. This part: case Op_Inc1: (*tape)++; break; with 4.2 at -O: :; *tape = *tape + 1; goto (); L5: incb (%edx) jmp L13 SVN at -O: :; *tape.17 = *tape.17 + 1; val.16 = val; goto (); L6: incb (%esi) movl %edx, %eax jmp L10 Suprisingly, -O3 is worse: L6: movl %edx, %eax incb (%esi) movl %eax, %edx jmp L2 IRA doesn't improve it. This isn't from real-world code, so it's not really important, but I'd like to make a code-copying VM out of this. -- Summary: [4.4 regression] Unnecessary moves generated on loop boundaries Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: astrange at ithinksw dot com GCC target triplet: i?86-*-* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36646