fix Cmp input normalisation
authorMatthias Braun <matze@braunis.de>
Fri, 19 Oct 2007 18:13:10 +0000 (18:13 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 19 Oct 2007 18:13:10 +0000 (18:13 +0000)
[r16285]

ir/ir/iropt.c

index ad239d5..428fe2d 100644 (file)
@@ -3707,8 +3707,10 @@ static ir_node *transform_node_Proj_Cmp(ir_node *proj) {
         * We ignore the case that both are constants
         * this case should be optimized away.
         */
-       if (is_Const(right)) {
-               c = right;
+       if (is_irn_constlike(right) && !(is_Const(left) && !is_Const(right))) {
+               if(is_Const(right)) {
+                       c = right;
+               }
        } else if (is_irn_constlike(left)) {
                c     = left;
                left  = right;