This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/59744] miscompilation of unsigned comparison on aarch64
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 Jan 2014 01:00:19 +0000
- Subject: [Bug target/59744] miscompilation of unsigned comparison on aarch64
- Auto-submitted: auto-generated
- References: <bug-59744-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59744
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-01-10
Ever confirmed|0 |1
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(insn 14 13 15 2 (set (reg:CC_SWP 66 cc)
(compare:CC_SWP (neg:DI (reg:DI 0 x0 [ offset ]))
(reg:DI 1 x1 [orig:85 D.3895 ] [85]))) t7.c:11 114 {*compare_negdi}
(expr_list:REG_DEAD (reg:DI 1 x1 [orig:85 D.3895 ] [85])
(expr_list:REG_DEAD (reg:DI 0 x0 [ offset ])
(nil))))
--- CUT ---
Here is a testcase that fails at -O1 and above without any arguments.
int a[2] = { 10, 20 };
int
is_bigger (long, int) __attribute__((noinline,noclone));
int
is_bigger (long offset, int index)
{
unsigned long size = -offset;
if (size > a[index])
return 1;
return 0;
}
int
main (int argc, char** argv)
{
long v;
if (is_bigger(0, 0))
__builtin_abort ();
if (!is_bigger(1, 0))
__builtin_abort ();
if (is_bigger(-10, 0))
__builtin_abort ();
if (!is_bigger(10, 0))
__builtin_abort ();
return 0;
}