From ea72cc1dcab80a27beb22a2c9f0b4110392ec56d Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Wed, 8 Feb 2012 13:29:22 +0000 Subject: [PATCH] re PR rtl-optimization/52170 (ICE in trunc_int_for_mode, at explow.c:57 during simplify_plus_minus) 2012-02-08 Richard Guenther PR rtl-optimization/52170 * simplify-rtx.c (simplify_plus_minus): Use CONSTM1_RTX to properly handle integer vector modes. * gcc.dg/torture/pr52170.c: New testcase. From-SVN: r184007 --- gcc/ChangeLog | 6 ++++++ gcc/simplify-rtx.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr52170.c | 17 +++++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr52170.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fcea3cfb7fe..71cdd934b69 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-02-08 Richard Guenther + + PR rtl-optimization/52170 + * simplify-rtx.c (simplify_plus_minus): Use CONSTM1_RTX to + properly handle integer vector modes. + 2012-02-08 Jakub Jelinek PR gcov-profile/52150 diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 6733b84d572..bba565ddfd3 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -3947,7 +3947,7 @@ simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0, /* ~a -> (-a - 1) */ if (n_ops != 7) { - ops[n_ops].op = constm1_rtx; + ops[n_ops].op = CONSTM1_RTX (mode); ops[n_ops++].neg = this_neg; ops[i].op = XEXP (this_op, 0); ops[i].neg = !this_neg; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6cedc9e1d09..7928ea12cb5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-02-08 Richard Guenther + + PR rtl-optimization/52170 + * gcc.dg/torture/pr52170.c: New testcase. + 2012-02-08 Jakub Jelinek PR gcov-profile/52150 diff --git a/gcc/testsuite/gcc.dg/torture/pr52170.c b/gcc/testsuite/gcc.dg/torture/pr52170.c new file mode 100644 index 00000000000..3d0a038893d --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr52170.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ + +typedef unsigned char uint8_t ; +typedef unsigned long uint32_t; +void f0a(uint32_t * result, uint32_t * arg1) +{ + int idx; + for (idx=0;idx<96;idx += 1) + { + uint8_t temp_5; + uint8_t temp_6; + + temp_5 = ~(*arg1); + temp_6 = (*arg1) + 1 - temp_5; + result[idx] = temp_6; + } +}