This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/56451] New: [4.8 regression] Wrong code for gcc.c-torture/execute/941015-1.c on SH
- From: "kkojima at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 26 Feb 2013 00:15:05 +0000
- Subject: [Bug rtl-optimization/56451] New: [4.8 regression] Wrong code for gcc.c-torture/execute/941015-1.c on SH
- Auto-submitted: auto-generated
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.