re PR rtl-optimization/55010 (Internal consistency failure : invalid rtl sharing found in the insn)

PR rtl-optimization/55010
	* cse.c (fold_rtx) <RTX_COMPARE>: Call copy_rtx on folded_arg{0,1}
	before passing it to simplify_relational_operation.

	* gcc.dg/pr55010.c: New test.

From-SVN: r192760
This commit is contained in:
Jakub Jelinek 2012-10-24 11:13:09 +02:00 committed by Jakub Jelinek
parent 848be0946c
commit bca3cc973b
4 changed files with 24 additions and 3 deletions

View File

@ -1,5 +1,9 @@
2012-10-24 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/55010
* cse.c (fold_rtx) <RTX_COMPARE>: Call copy_rtx on folded_arg{0,1}
before passing it to simplify_relational_operation.
PR debug/54828
* gimple.h (is_gimple_sizepos): New inline function.
* gimplify.c (gimplify_one_sizepos): Use it. Remove useless

View File

@ -3461,9 +3461,10 @@ fold_rtx (rtx x, rtx insn)
}
{
rtx op0 = const_arg0 ? const_arg0 : folded_arg0;
rtx op1 = const_arg1 ? const_arg1 : folded_arg1;
new_rtx = simplify_relational_operation (code, mode, mode_arg0, op0, op1);
rtx op0 = const_arg0 ? const_arg0 : copy_rtx (folded_arg0);
rtx op1 = const_arg1 ? const_arg1 : copy_rtx (folded_arg1);
new_rtx = simplify_relational_operation (code, mode, mode_arg0,
op0, op1);
}
break;

View File

@ -1,5 +1,8 @@
2012-10-24 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/55010
* gcc.dg/pr55010.c: New test.
PR debug/54828
* g++.dg/debug/pr54828.C: New test.

View File

@ -0,0 +1,13 @@
/* PR rtl-optimization/55010 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-additional-options "-march=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
long long int a;
unsigned long long int b;
void
foo (void)
{
a = (a < 0) / ((a -= b) ? b >= ((b = a) || 0) : 0);
}