OSDN Git Service

2006-11-11 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 11 Nov 2006 12:05:16 +0000 (12:05 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 11 Nov 2006 12:05:16 +0000 (12:05 +0000)
* tree.def (FIX_CEIL_EXPR, FIX_FLOOR_EXPR, FIX_ROUND_EXPR):
Remove unused tree codes.
* tree-vrp.c (extract_range_from_unary_expr): Remove handling
of FIX_CEIL_EXPR, FIX_FLOOR_EXPR and FIX_ROUND_EXPR.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* tree.c (stabilize_reference): Likewise.
* fold-const.c (fold_convert_const_int_from_real, operand_equal_p,
fold_unary): Likewise.
* tree-gimple.c (is_gimple_cast): Likewise.
* dwarf2out.c (loc_descriptor_from_tree_1): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* tree-eh.c (tree_could_trap_p): Likewise.
* gimplify.c (gimplify_expr): Likewise.
* tree-inline.c (estimate_num_insns_1): Likewise.
* tree-cfg.c (verify_expr): Likewise.

cp/
* typeck.c (build_unary_op): Likewise.

java/
* check-init.c (check_init): Likewise.

ada/
* trans.c (maybe_stabilize_reference): Likewise.

fortran/
* trans-intrinsic.c (enum rounding_mode): New enum.
(build_fix_expr, gfc_conv_intrinsic_aint, gfc_conv_intrinsic_mod,
gfc_conv_intrinsic_function): Use it instead of FIX_CEIL_EXPR,
FIX_FLOOR_EXPR, FIX_ROUND_EXPR and FIX_TRUNC_EXPR.

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

21 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/trans.c
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/dwarf2out.c
gcc/expr.c
gcc/fold-const.c
gcc/fortran/ChangeLog
gcc/fortran/trans-intrinsic.c
gcc/gimplify.c
gcc/java/ChangeLog
gcc/java/check-init.c
gcc/tree-cfg.c
gcc/tree-eh.c
gcc/tree-gimple.c
gcc/tree-inline.c
gcc/tree-pretty-print.c
gcc/tree-vrp.c
gcc/tree.c
gcc/tree.def

index 59ecc97..653de70 100644 (file)
@@ -1,3 +1,21 @@
+2006-11-11  Richard Guenther  <rguenther@suse.de>
+
+       * tree.def (FIX_CEIL_EXPR, FIX_FLOOR_EXPR, FIX_ROUND_EXPR):
+       Remove unused tree codes.
+       * tree-vrp.c (extract_range_from_unary_expr): Remove handling
+       of FIX_CEIL_EXPR, FIX_FLOOR_EXPR and FIX_ROUND_EXPR.
+       * tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
+       * tree.c (stabilize_reference): Likewise.
+       * fold-const.c (fold_convert_const_int_from_real, operand_equal_p,
+       fold_unary): Likewise.
+       * tree-gimple.c (is_gimple_cast): Likewise.
+       * dwarf2out.c (loc_descriptor_from_tree_1): Likewise.
+       * expr.c (expand_expr_real_1): Likewise.
+       * tree-eh.c (tree_could_trap_p): Likewise.
+       * gimplify.c (gimplify_expr): Likewise.
+       * tree-inline.c (estimate_num_insns_1): Likewise.
+       * tree-cfg.c (verify_expr): Likewise.
+
 2006-11-11  Zdenek Dvorak <dvorakz@suse.cz>
 
        * tree-ssa-loop.c (pass_loop_prefetch): Change name to aprefetch.
index d9ab2ab..cae53bb 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-11  Richard Guenther  <rguenther@suse.de>
+
+       * trans.c (maybe_stabilize_reference): Remove handling of
+       FIX_CEIL_EXPR, FIX_FLOOR_EXPR and FIX_ROUND_EXPR.
+
 2006-11-05  Arnaud Charlet  <charlet@adacore.com>
 
        * s-osinte-linux-alpha.ads, s-osinte-linux-hppa.ads
index eaa6fc6..873ad5f 100644 (file)
@@ -6033,9 +6033,6 @@ maybe_stabilize_reference (tree ref, bool force, bool lvalues_only,
     case CONVERT_EXPR:
     case FLOAT_EXPR:
     case FIX_TRUNC_EXPR:
-    case FIX_FLOOR_EXPR:
-    case FIX_ROUND_EXPR:
-    case FIX_CEIL_EXPR:
     case VIEW_CONVERT_EXPR:
       result
        = build1 (code, type,
index 9cd3d29..dc6a266 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-11  Richard Guenther  <rguenther@suse.de>
+
+       * typeck.c (build_unary_op): Remove handling of FIX_CEIL_EXPR,
+       FIX_FLOOR_EXPR and FIX_ROUND_EXPR.
+
 2006-11-03  Roger Sayle  <roger@eyesopen.com>
 
        * call.c (build_op_delete_call): Test user-visible type against
index 242ae19..c257f00 100644 (file)
@@ -4146,9 +4146,6 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
          case CONVERT_EXPR:
          case FLOAT_EXPR:
          case FIX_TRUNC_EXPR:
-         case FIX_FLOOR_EXPR:
-         case FIX_ROUND_EXPR:
-         case FIX_CEIL_EXPR:
            {
              tree incremented, modify, value, compound;
              if (! lvalue_p (arg) && pedantic)
@@ -4301,9 +4298,6 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
        case CONVERT_EXPR:
        case FLOAT_EXPR:
        case FIX_TRUNC_EXPR:
-       case FIX_FLOOR_EXPR:
-       case FIX_ROUND_EXPR:
-       case FIX_CEIL_EXPR:
          if (! lvalue_p (arg) && pedantic)
            pedwarn ("ISO C++ forbids taking the address of a cast to a non-lvalue expression");
          break;
index 0aaf70e..28108ec 100644 (file)
@@ -9478,9 +9478,6 @@ loc_descriptor_from_tree_1 (tree loc, int want_address)
       break;
 
     case FIX_TRUNC_EXPR:
-    case FIX_CEIL_EXPR:
-    case FIX_FLOOR_EXPR:
-    case FIX_ROUND_EXPR:
       return 0;
 
     default:
index f380413..dc5f844 100644 (file)
@@ -8188,11 +8188,6 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
                       subtarget, &op0, &op1, 0);
       return expand_divmod (1, code, mode, op0, op1, target, unsignedp);
 
-    case FIX_ROUND_EXPR:
-    case FIX_FLOOR_EXPR:
-    case FIX_CEIL_EXPR:
-      gcc_unreachable ();                      /* Not used for C.  */
-
     case FIX_TRUNC_EXPR:
       op0 = expand_normal (TREE_OPERAND (exp, 0));
       if (target == 0 || modifier == EXPAND_STACK_PARM)
index e1c3c1f..b715ad8 100644 (file)
@@ -1860,18 +1860,6 @@ fold_convert_const_int_from_real (enum tree_code code, tree type, tree arg1)
       real_trunc (&r, VOIDmode, &x);
       break;
 
-    case FIX_CEIL_EXPR:
-      real_ceil (&r, VOIDmode, &x);
-      break;
-
-    case FIX_FLOOR_EXPR:
-      real_floor (&r, VOIDmode, &x);
-      break;
-
-    case FIX_ROUND_EXPR:
-      real_round (&r, VOIDmode, &x);
-      break;
-
     default:
       gcc_unreachable ();
     }
@@ -2610,10 +2598,7 @@ operand_equal_p (tree arg0, tree arg1, unsigned int flags)
         {
         case NOP_EXPR:
         case CONVERT_EXPR:
-        case FIX_CEIL_EXPR:
         case FIX_TRUNC_EXPR:
-        case FIX_FLOOR_EXPR:
-        case FIX_ROUND_EXPR:
          if (TYPE_UNSIGNED (TREE_TYPE (arg0))
              != TYPE_UNSIGNED (TREE_TYPE (arg1)))
            return 0;
@@ -7299,9 +7284,6 @@ fold_unary (enum tree_code code, tree type, tree op0)
     case FLOAT_EXPR:
     case CONVERT_EXPR:
     case FIX_TRUNC_EXPR:
-    case FIX_CEIL_EXPR:
-    case FIX_FLOOR_EXPR:
-    case FIX_ROUND_EXPR:
       if (TREE_TYPE (op0) == type)
        return op0;
       
index 2b4eaad..66ee88e 100644 (file)
@@ -1,3 +1,10 @@
+2006-11-11  Richard Guenther  <rguenther@suse.de>
+
+       * trans-intrinsic.c (enum rounding_mode): New enum.
+       (build_fix_expr, gfc_conv_intrinsic_aint, gfc_conv_intrinsic_mod,
+       gfc_conv_intrinsic_function): Use it instead of FIX_CEIL_EXPR,
+       FIX_FLOOR_EXPR, FIX_ROUND_EXPR and FIX_TRUNC_EXPR.
+
 2006-11-10  Brooks Moses  <brooks.moses@codesourcery.com>
 
        * lang.opt (-fmodule-private): Remove option.
index 5389c0b..ec857a5 100644 (file)
@@ -160,6 +160,7 @@ typedef struct
 }
 real_compnt_info;
 
+enum rounding_mode { RND_ROUND, RND_TRUNC, RND_CEIL, RND_FLOOR };
 
 /* Evaluate the arguments to an intrinsic function.  */
 
@@ -307,23 +308,24 @@ build_round_expr (stmtblock_t * pblock, tree arg, tree type)
 
 static tree
 build_fix_expr (stmtblock_t * pblock, tree arg, tree type,
-               enum tree_code op)
+               enum rounding_mode op)
 {
   switch (op)
     {
-    case FIX_FLOOR_EXPR:
+    case RND_FLOOR:
       return build_fixbound_expr (pblock, arg, type, 0);
       break;
 
-    case FIX_CEIL_EXPR:
+    case RND_CEIL:
       return build_fixbound_expr (pblock, arg, type, 1);
       break;
 
-    case FIX_ROUND_EXPR:
+    case RND_ROUND:
       return build_round_expr (pblock, arg, type);
 
     default:
-      return build1 (op, type, arg);
+      gcc_assert (op == RND_TRUNC);
+      return build1 (FIX_TRUNC_EXPR, type, arg);
     }
 }
 
@@ -338,7 +340,7 @@ build_fix_expr (stmtblock_t * pblock, tree arg, tree type,
    */
 
 static void
-gfc_conv_intrinsic_aint (gfc_se * se, gfc_expr * expr, enum tree_code op)
+gfc_conv_intrinsic_aint (gfc_se * se, gfc_expr * expr, enum rounding_mode op)
 {
   tree type;
   tree itype;
@@ -355,7 +357,7 @@ gfc_conv_intrinsic_aint (gfc_se * se, gfc_expr * expr, enum tree_code op)
   /* We have builtin functions for some cases.  */
   switch (op)
     {
-    case FIX_ROUND_EXPR:
+    case RND_ROUND:
       switch (kind)
        {
        case 4:
@@ -373,7 +375,7 @@ gfc_conv_intrinsic_aint (gfc_se * se, gfc_expr * expr, enum tree_code op)
        }
       break;
 
-    case FIX_TRUNC_EXPR:
+    case RND_TRUNC:
       switch (kind)
        {
        case 4:
@@ -437,7 +439,7 @@ gfc_conv_intrinsic_aint (gfc_se * se, gfc_expr * expr, enum tree_code op)
 /* Convert to an integer using the specified rounding mode.  */
 
 static void
-gfc_conv_intrinsic_int (gfc_se * se, gfc_expr * expr, int op)
+gfc_conv_intrinsic_int (gfc_se * se, gfc_expr * expr, enum rounding_mode op)
 {
   tree type;
   tree arg;
@@ -1076,9 +1078,9 @@ gfc_conv_intrinsic_mod (gfc_se * se, gfc_expr * expr, int modulo)
 
       itype = gfc_get_int_type (ikind);
       if (modulo)
-       tmp = build_fix_expr (&se->pre, tmp, itype, FIX_FLOOR_EXPR);
+       tmp = build_fix_expr (&se->pre, tmp, itype, RND_FLOOR);
       else
-       tmp = build_fix_expr (&se->pre, tmp, itype, FIX_TRUNC_EXPR);
+       tmp = build_fix_expr (&se->pre, tmp, itype, RND_TRUNC);
       tmp = convert (type, tmp);
       tmp = build3 (COND_EXPR, type, test2, tmp, arg);
       tmp = build2 (MULT_EXPR, type, tmp, arg2);
@@ -3474,7 +3476,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
       break;
 
     case GFC_ISYM_AINT:
-      gfc_conv_intrinsic_aint (se, expr, FIX_TRUNC_EXPR);
+      gfc_conv_intrinsic_aint (se, expr, RND_TRUNC);
       break;
 
     case GFC_ISYM_ALL:
@@ -3482,7 +3484,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
       break;
 
     case GFC_ISYM_ANINT:
-      gfc_conv_intrinsic_aint (se, expr, FIX_ROUND_EXPR);
+      gfc_conv_intrinsic_aint (se, expr, RND_ROUND);
       break;
 
     case GFC_ISYM_AND:
@@ -3515,19 +3517,19 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
     case GFC_ISYM_INT2:
     case GFC_ISYM_INT8:
     case GFC_ISYM_LONG:
-      gfc_conv_intrinsic_int (se, expr, FIX_TRUNC_EXPR);
+      gfc_conv_intrinsic_int (se, expr, RND_TRUNC);
       break;
 
     case GFC_ISYM_NINT:
-      gfc_conv_intrinsic_int (se, expr, FIX_ROUND_EXPR);
+      gfc_conv_intrinsic_int (se, expr, RND_ROUND);
       break;
 
     case GFC_ISYM_CEILING:
-      gfc_conv_intrinsic_int (se, expr, FIX_CEIL_EXPR);
+      gfc_conv_intrinsic_int (se, expr, RND_CEIL);
       break;
 
     case GFC_ISYM_FLOOR:
-      gfc_conv_intrinsic_int (se, expr, FIX_FLOOR_EXPR);
+      gfc_conv_intrinsic_int (se, expr, RND_FLOOR);
       break;
 
     case GFC_ISYM_MOD:
index fedc284..4e5d609 100644 (file)
@@ -5489,9 +5489,6 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
          /* FALLTHRU */
 
        case FIX_TRUNC_EXPR:
-       case FIX_CEIL_EXPR:
-       case FIX_FLOOR_EXPR:
-       case FIX_ROUND_EXPR:
          /* unary_expr: ... | '(' cast ')' val | ...  */
          ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
                               is_gimple_val, fb_rvalue);
index d171343..8bc6c35 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-11  Richard Guenther  <rguenther@suse.de>
+
+       * check-init.c (check_init): Remove handling of FIX_CEIL_EXPR,
+       FIX_FLOOR_EXPR and FIX_ROUND_EXPR.
+
 2006-10-23 Rafael Avila de Espindola  <rafael.espindola@gmail.com>
 
        * decl.c: Include langhooks.h.
index 6eb1f16..4aca992 100644 (file)
@@ -814,9 +814,6 @@ check_init (tree exp, words before)
     case ADDR_EXPR:
     case NON_LVALUE_EXPR:
     case INSTANCEOF_EXPR:
-    case FIX_CEIL_EXPR:
-    case FIX_FLOOR_EXPR:
-    case FIX_ROUND_EXPR:
     case ABS_EXPR:
       /* Avoid needless recursion. */
       exp = TREE_OPERAND (exp, 0);
index 46ee1b1..ab5a234 100644 (file)
@@ -3329,9 +3329,6 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
     case NOP_EXPR:
     case CONVERT_EXPR:
     case FIX_TRUNC_EXPR:
-    case FIX_CEIL_EXPR:
-    case FIX_FLOOR_EXPR:
-    case FIX_ROUND_EXPR:
     case FLOAT_EXPR:
     case NEGATE_EXPR:
     case ABS_EXPR:
index e3341b1..2a723b3 100644 (file)
@@ -1956,9 +1956,6 @@ tree_could_trap_p (tree expr)
 
     case CONVERT_EXPR:
     case FIX_TRUNC_EXPR:
-    case FIX_CEIL_EXPR:
-    case FIX_FLOOR_EXPR:
-    case FIX_ROUND_EXPR:
       /* Conversion of floating point might trap.  */
       return honor_nans;
 
index 740f673..3dab75d 100644 (file)
@@ -409,10 +409,7 @@ is_gimple_cast (tree t)
 {
   return (TREE_CODE (t) == NOP_EXPR
          || TREE_CODE (t) == CONVERT_EXPR
-          || TREE_CODE (t) == FIX_TRUNC_EXPR
-          || TREE_CODE (t) == FIX_CEIL_EXPR
-          || TREE_CODE (t) == FIX_FLOOR_EXPR
-          || TREE_CODE (t) == FIX_ROUND_EXPR);
+          || TREE_CODE (t) == FIX_TRUNC_EXPR);
 }
 
 /* Return true if T is a valid op0 of a CALL_EXPR.  */
index 07fae35..8ce32db 100644 (file)
@@ -1700,9 +1700,6 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
     case MULT_EXPR:
 
     case FIX_TRUNC_EXPR:
-    case FIX_CEIL_EXPR:
-    case FIX_FLOOR_EXPR:
-    case FIX_ROUND_EXPR:
 
     case NEGATE_EXPR:
     case FLOAT_EXPR:
index bca6c00..c2a47f0 100644 (file)
@@ -1324,9 +1324,6 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
       break;
 
     case FIX_TRUNC_EXPR:
-    case FIX_CEIL_EXPR:
-    case FIX_FLOOR_EXPR:
-    case FIX_ROUND_EXPR:
     case FLOAT_EXPR:
     case CONVERT_EXPR:
     case NOP_EXPR:
@@ -2236,9 +2233,6 @@ op_prio (tree op)
     case NOP_EXPR:
     case CONVERT_EXPR:
     case FIX_TRUNC_EXPR:
-    case FIX_CEIL_EXPR:
-    case FIX_FLOOR_EXPR:
-    case FIX_ROUND_EXPR:
     case TARGET_EXPR:
       return 14;
 
index afe7140..637263d 100644 (file)
@@ -1596,9 +1596,6 @@ extract_range_from_unary_expr (value_range_t *vr, tree expr)
   /* Refuse to operate on certain unary expressions for which we
      cannot easily determine a resulting range.  */
   if (code == FIX_TRUNC_EXPR
-      || code == FIX_CEIL_EXPR
-      || code == FIX_FLOOR_EXPR
-      || code == FIX_ROUND_EXPR
       || code == FLOAT_EXPR
       || code == BIT_NOT_EXPR
       || code == NON_LVALUE_EXPR
index 6f8dc86..92b25e3 100644 (file)
@@ -2599,9 +2599,6 @@ stabilize_reference (tree ref)
     case CONVERT_EXPR:
     case FLOAT_EXPR:
     case FIX_TRUNC_EXPR:
-    case FIX_FLOOR_EXPR:
-    case FIX_ROUND_EXPR:
-    case FIX_CEIL_EXPR:
       result = build_nt (code, stabilize_reference (TREE_OPERAND (ref, 0)));
       break;
 
index 2c16cb9..3c40688 100644 (file)
@@ -634,15 +634,8 @@ DEFTREECODE (RDIV_EXPR, "rdiv_expr", tcc_binary, 2)
    Used for pointer subtraction in C.  */
 DEFTREECODE (EXACT_DIV_EXPR, "exact_div_expr", tcc_binary, 2)
 
-/* Conversion of real to fixed point: four ways to round,
-   like the four ways to divide.
-   CONVERT_EXPR can also be used to convert a real to an integer,
-   and that is what is used in languages that do not have ways of
-   specifying which of these is wanted.  Maybe these are not needed.  */
+/* Conversion of real to fixed point by truncation.  */
 DEFTREECODE (FIX_TRUNC_EXPR, "fix_trunc_expr", tcc_unary, 1)
-DEFTREECODE (FIX_CEIL_EXPR, "fix_ceil_expr", tcc_unary, 1)
-DEFTREECODE (FIX_FLOOR_EXPR, "fix_floor_expr", tcc_unary, 1)
-DEFTREECODE (FIX_ROUND_EXPR, "fix_round_expr", tcc_unary, 1)
 
 /* Conversion of an integer to a real.  */
 DEFTREECODE (FLOAT_EXPR, "float_expr", tcc_unary, 1)