From 02484af985da5f2f56cf2f8aecb69f7d50848807 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 24 Mar 2003 12:29:11 +0100 Subject: [PATCH] re PR target/10072 ([Sparc] internal compiler error: in trunc_int_for_mode, at explow.c:54) PR target/10072 * combine.c (simplify_if_then_else): Check that the mode has MODE_INT class before applying the (OP Z (mult COND C2)) transformation. From-SVN: r64785 --- gcc/ChangeLog | 8 ++++++++ gcc/combine.c | 4 +++- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/ultrasp5.c | 12 ++++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/ultrasp5.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a470d16cad8..9bc5b91838a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-03-23 Eric Botcazou + + PR target/10072 + * combine.c (simplify_if_then_else): Check that the mode + has MODE_INT class before applying the (OP Z (mult COND C2)) + transformation. + 2003-03-23 Eric Botcazou PR optimization/9414 @@ -9040,3 +9047,4 @@ * doc/tm.texi (REGISTER_TARGET_PRAGMAS): Update See ChangeLog.8 for earlier changes. + diff --git a/gcc/combine.c b/gcc/combine.c index cd7261bf1eb..dd017062daa 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -4969,7 +4969,9 @@ simplify_if_then_else (x) neither 1 or -1, but it isn't worth checking for. */ if ((STORE_FLAG_VALUE == 1 || STORE_FLAG_VALUE == -1) - && comparison_p && mode != VOIDmode && ! side_effects_p (x)) + && comparison_p + && GET_MODE_CLASS (mode) == MODE_INT + && ! side_effects_p (x)) { rtx t = make_compound_operation (true_rtx, SET); rtx f = make_compound_operation (false_rtx, SET); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b7965819754..d5fbd913f71 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-03-23 Eric Botcazou + + * gcc.dg/ultrasp5.c: New test. + 2003-03-23 Arpad Beszedes PR middle-end/9967 diff --git a/gcc/testsuite/gcc.dg/ultrasp5.c b/gcc/testsuite/gcc.dg/ultrasp5.c new file mode 100644 index 00000000000..c3660073cb9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ultrasp5.c @@ -0,0 +1,12 @@ +/* PR target/10072 */ +/* Originator: Peter van Hoof +/* { dg-do compile } */ +/* { dg-options "-O1 -mcpu=ultrasparc -ffast-math" { target sparc-*-* } } */ + +void p(int v) +{ + int i=v,j; + float a,b,c,x[i]; + + x[i] = (a/(((b)>(c)) ? (b) : (c)) - (((i) == (j)) ? 1.f : 0.f)); +}