OSDN Git Service

* fold-const.c (fold): Revert 2004-02-25 change. Use the original
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Feb 2004 08:11:34 +0000 (08:11 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Feb 2004 08:11:34 +0000 (08:11 +0000)
operands to build a tree with swapped operands.
* expr.c (expand_expr_real) <MAX_EXPR>: Consistently use the
'unsignedp' predicate to specify the signedness.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78558 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/expr.c
gcc/fold-const.c

index a0677fe..d0d6185 100644 (file)
@@ -1,3 +1,11 @@
+2004-02-27  Eric Botcazou  <ebotcazou@act-europe.fr>
+            Roger Sayle  <roger@eyesopen.com>
+
+       * fold-const.c (fold): Revert 2004-02-25 change.  Use the original
+       operands to build a tree with swapped operands.
+       * expr.c (expand_expr_real) <MAX_EXPR>: Consistently use the
+       'unsignedp' predicate to specify the signedness.
+
 2004-02-27  Kazu Hirata  <kazu@cs.umass.edu>
 
        * c-decl.c, c-ppoutput.c, combine.c, cppfiles.c, dwarf2out.c,
index bf14606..205dc78 100644 (file)
@@ -8034,7 +8034,7 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode,
       /* First try to do it with a special MIN or MAX instruction.
         If that does not win, use a conditional jump to select the proper
         value.  */
-      this_optab = (TREE_UNSIGNED (type)
+      this_optab = (unsignedp
                    ? (code == MIN_EXPR ? umin_optab : umax_optab)
                    : (code == MIN_EXPR ? smin_optab : smax_optab));
 
@@ -8068,18 +8068,16 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode,
          && ! can_compare_p (GE, mode, ccp_jump))
        {
          if (code == MAX_EXPR)
-           do_jump_by_parts_greater_rtx (mode, TREE_UNSIGNED (type),
-                                         target, op1, NULL_RTX, op0);
+           do_jump_by_parts_greater_rtx (mode, unsignedp, target, op1,
+                                         NULL_RTX, op0);
          else
-           do_jump_by_parts_greater_rtx (mode, TREE_UNSIGNED (type),
-                                         op1, target, NULL_RTX, op0);
+           do_jump_by_parts_greater_rtx (mode, unsignedp, op1, target,
+                                         NULL_RTX, op0);
        }
       else
        {
-         int unsignedp = TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 1)));
          do_compare_rtx_and_jump (target, op1, code == MAX_EXPR ? GE : LE,
-                                  unsignedp, mode, NULL_RTX, NULL_RTX,
-                                  op0);
+                                  unsignedp, mode, NULL_RTX, NULL_RTX, op0);
        }
       emit_move_insn (target, op1);
       emit_label (op0);
index 956478a..9178a34 100644 (file)
@@ -5423,10 +5423,7 @@ fold (tree expr)
          if (op == 0)
            continue;           /* Valid for CALL_EXPR, at least.  */
 
-         if (kind == '<'
-             || code == MAX_EXPR
-             || code == MIN_EXPR
-             || code == RSHIFT_EXPR)
+         if (kind == '<' || code == RSHIFT_EXPR)
            {
              /* Signedness matters here.  Perhaps we can refine this
                 later.  */
@@ -5459,7 +5456,8 @@ fold (tree expr)
      to ARG1 to reduce the number of tests below.  */
   if (commutative_tree_code (code)
       && tree_swap_operands_p (arg0, arg1, true))
-    return fold (build (code, type, arg1, arg0));
+    return fold (build (code, type, TREE_OPERAND (t, 1),
+                       TREE_OPERAND (t, 0)));
 
   /* Now WINS is set as described above,
      ARG0 is the first operand of EXPR,