From e69e3d0e8b7ccc7ba990130dfd6ed909609ed971 Mon Sep 17 00:00:00 2001 From: Zdenek Dvorak Date: Wed, 26 Jul 2006 18:47:28 +0200 Subject: [PATCH] re PR target/27907 (ICE in expand_simple_unop, at optabs.c:2307) PR rtl-optimization/27907 * expr.c (force_operand): Use convert_move to handle FLOAT_EXTEND and FLOAT_TRUNCATE. * gcc.c-torture/compile/pr27907.c: New test. From-SVN: r115760 --- gcc/ChangeLog | 6 +++++ gcc/expr.c | 2 ++ gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/gcc.c-torture/compile/pr27907.c | 23 +++++++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr27907.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0ec948f9b2a8..f4d3620a07e1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2006-07-26 Zdenek Dvorak + + PR rtl-optimization/27907 + * expr.c (force_operand): Use convert_move to handle FLOAT_EXTEND and + FLOAT_TRUNCATE. + 2006-07-25 Roger Sayle PR middle-end/28473 diff --git a/gcc/expr.c b/gcc/expr.c index 48ec0ef6f675..a0dc9c360f08 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -6024,6 +6024,8 @@ force_operand (rtx value, rtx target) case ZERO_EXTEND: case SIGN_EXTEND: case TRUNCATE: + case FLOAT_EXTEND: + case FLOAT_TRUNCATE: convert_move (target, op1, code == ZERO_EXTEND); return target; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5f5bdccda792..6f504ce95669 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-07-26 Zdenek Dvorak + + PR rtl-optimization/27907 + * gcc.c-torture/compile/pr27907.c: New test. + 2006-07-26 Francois-Xavier Coudert * gfortran.dg/mclock.f90: New test. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr27907.c b/gcc/testsuite/gcc.c-torture/compile/pr27907.c new file mode 100644 index 000000000000..575ac6a774c7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr27907.c @@ -0,0 +1,23 @@ +typedef double fann_type; +typedef struct { } _G_fpos64_t; +struct fann_neuron +{ + fann_type value; +} +__attribute__ ((packed)); +struct fann_layer +{ + struct fann_neuron *last_neuron; +}; +struct fann +{ + struct fann_layer *first_layer; +}; +fann_run (struct fann *ann, fann_type * input) +{ + struct fann_layer *layer_it, *layer_it2, *last_layer; + for (layer_it = ann->first_layer + 1; layer_it != last_layer; layer_it++) + { + ((layer_it - 1)->last_neuron - 1)->value = 1; + } +}