OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / tree-complex.c
index a675f0a..de23119 100644 (file)
@@ -31,6 +31,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
 #include "tree-iterator.h"
 #include "tree-pass.h"
 #include "tree-ssa-propagate.h"
+#include "diagnostic.h"
 
 
 /* For each complex ssa name, a lattice value.  We're interested in finding
@@ -501,7 +502,7 @@ set_component_ssa_name (tree ssa_name, bool imag_p, tree value)
     ;
 
   /* If we've nothing assigned, and the value we're given is already stable,
-     then install that as the value for this SSA_NAME.  This pre-emptively
+     then install that as the value for this SSA_NAME.  This preemptively
      copy-propagates the value, which avoids unnecessary memory allocation.  */
   else if (is_gimple_min_invariant (value))
     {
@@ -843,7 +844,7 @@ expand_complex_addition (block_stmt_iterator *bsi, tree inner_type,
 
     case PAIR (VARYING, ONLY_IMAG):
       rr = ar;
-      ri = gimplify_build2 (bsi, MINUS_EXPR, inner_type, ai, bi);
+      ri = gimplify_build2 (bsi, code, inner_type, ai, bi);
       break;
 
     case PAIR (ONLY_REAL, VARYING):
@@ -857,7 +858,7 @@ expand_complex_addition (block_stmt_iterator *bsi, tree inner_type,
       if (code == MINUS_EXPR)
        goto general;
       rr = br;
-      ri = gimplify_build2 (bsi, MINUS_EXPR, inner_type, ai, bi);
+      ri = gimplify_build2 (bsi, code, inner_type, ai, bi);
       break;
 
     case PAIR (VARYING, VARYING):
@@ -1566,7 +1567,9 @@ tree_lower_complex_O0 (void)
 static bool
 gate_no_optimization (void)
 {
-  return optimize == 0;
+  /* With errors, normal optimization passes are not run.  If we don't
+     lower complex operations at all, rtl expansion will abort.  */
+  return optimize == 0 || sorrycount || errorcount;
 }
 
 struct tree_opt_pass pass_lower_complex_O0 =