do gigo earlier to avoid optimisations seeing bad inputs with wrong more
authorMatthias Braun <matze@braunis.de>
Thu, 24 Feb 2011 18:17:02 +0000 (19:17 +0100)
committerMatthias Braun <matze@braunis.de>
Thu, 24 Feb 2011 22:05:55 +0000 (23:05 +0100)
ir/ir/iropt.c

index 2c17270..0775c92 100644 (file)
@@ -6500,6 +6500,12 @@ ir_node *optimize_in_place_2(ir_node *n)
        if (iro == iro_Deleted)
                return n;
 
+       /* Remove nodes with dead (Bad) input.
+          Run always for transformation induced Bads.  */
+       n = gigo(n);
+       if (is_Bad(n))
+               return n;
+
        /* constant expression evaluation / constant folding */
        if (get_opt_constant_folding()) {
                /* neither constants nor Tuple values can be evaluated */
@@ -6545,10 +6551,6 @@ ir_node *optimize_in_place_2(ir_node *n)
                (iro == iro_Proj))     /* Flags tested local. */
                n = transform_node(n);
 
-       /* Remove nodes with dead (Bad) input.
-          Run always for transformation induced Bads.  */
-       n = gigo(n);
-
        /* Now we can verify the node, as it has no dead inputs any more. */
        irn_verify(n);