re PR target/27907 (ICE in expand_simple_unop, at optabs.c:2307)
authorZdenek Dvorak <dvorakz@suse.cz>
Wed, 26 Jul 2006 16:47:28 +0000 (18:47 +0200)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Wed, 26 Jul 2006 16:47:28 +0000 (16:47 +0000)
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
gcc/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr27907.c [new file with mode: 0644]

index 0ec948f9b2a8127becdd897a934bf036e127a69f..f4d3620a07e15b0308c57ab0937a814a93fcde60 100644 (file)
@@ -1,3 +1,9 @@
+2006-07-26  Zdenek Dvorak <dvorakz@suse.cz>
+
+       PR rtl-optimization/27907
+       * expr.c (force_operand): Use convert_move to handle FLOAT_EXTEND and
+       FLOAT_TRUNCATE.
+
 2006-07-25  Roger Sayle  <roger@eyesopen.com>
 
        PR middle-end/28473
index 48ec0ef6f6757fc9e639f4bcbe20754c1919d1fb..a0dc9c360f08fffa55629f1b9b1ef9560a0171d5 100644 (file)
@@ -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;
 
index 5f5bdccda792678ba45b6ac1a03afc5562c484b0..6f504ce95669c8c25b92a31b6ca0beea344c87b8 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-26  Zdenek Dvorak <dvorakz@suse.cz>
+
+       PR rtl-optimization/27907
+       * gcc.c-torture/compile/pr27907.c: New test.
+
 2006-07-26  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 
        * 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 (file)
index 0000000..575ac6a
--- /dev/null
@@ -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;
+    }
+}