From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21934 invoked by alias); 26 Feb 2013 00:15:32 -0000 Received: (qmail 21799 invoked by uid 48); 26 Feb 2013 00:15:06 -0000 From: "kkojima at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/56451] New: [4.8 regression] Wrong code for gcc.c-torture/execute/941015-1.c on SH Date: Tue, 26 Feb 2013 00:15:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: kkojima at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2013-02/txt/msg02416.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56451 Bug #: 56451 Summary: [4.8 regression] Wrong code for gcc.c-torture/execute/941015-1.c on SH Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: kkojima@gcc.gnu.org Target: sh*-*-* On sh4-linux, the function foo1 of gcc.c-torture/execute/941015-1.c int foo1 (value) long long value; { register const long long constant = 0xc000000080000000LL; if (value < constant) return 1; else return 2; } is assembled to a wrong code with -O1 foo1: mov.l .L7,r1 cmp/gt r1,r5 bt/s .L10 mov #2,r0 cmp/ge r1,r5 bf/s .L10 mov #1,r0 .L10: rts nop .L9: .align 2 .L7: .long -1073741824 It looks delayed branch optimization causes this.