Commit ef53f36f by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/64255 (failures with -O2 optimization on i >= 0 ?…

re PR rtl-optimization/64255 (failures with -O2 optimization on i >= 0 ? (unsigned long) i : - (unsigned long) i)

	PR rtl-optimization/64255
	* gcc.c-torture/execute/pr64255.c: New test.

	PR rtl-optimization/64260
	* gcc.c-torture/execute/pr64260.c: New test.

From-SVN: r218665
parent 69aef6dc
2014-12-12 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/64255
* gcc.c-torture/execute/pr64255.c: New test.
PR rtl-optimization/64260
* gcc.c-torture/execute/pr64260.c: New test.
2014-12-12 Zhenqiang Chen <zhenqiang.chen@arm.com>
* gcc.dg/pr64007.c: New test.
......
/* PR rtl-optimization/64255 */
__attribute__((noinline, noclone)) void
bar (long i, unsigned long j)
{
if (i != 1 || j != 1)
__builtin_abort ();
}
__attribute__((noinline, noclone)) void
foo (long i)
{
unsigned long j;
if (!i)
return;
j = i >= 0 ? (unsigned long) i : - (unsigned long) i;
if ((i >= 0 ? (unsigned long) i : - (unsigned long) i) != j)
__builtin_abort ();
bar (i, j);
}
int
main ()
{
foo (1);
return 0;
}
/* PR rtl-optimization/64260 */
int a = 1, b;
void
foo (char p)
{
int t = 0;
for (; b < 1; b++)
{
int *s = &a;
if (--t)
*s &= p;
*s &= 1;
}
}
int
main ()
{
foo (0);
if (a != 0)
__builtin_abort ();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment