OSDN Git Service

optimize
[pf3gnuchains/gcc-fork.git] / gcc / expr.c
index 3c15a7b..a3e64f4 100644 (file)
@@ -1923,8 +1923,8 @@ emit_group_load (rtx dst, rtx orig_src, tree type ATTRIBUTE_UNUSED, int ssize)
                                     mode, mode, ssize);
 
       if (shift)
-       expand_binop (mode, ashl_optab, tmps[i], GEN_INT (shift),
-                     tmps[i], 0, OPTAB_WIDEN);
+       tmps[i] = expand_shift (LSHIFT_EXPR, mode, tmps[i],
+                               build_int_2 (shift, 0), tmps[i], 0);
     }
 
   emit_queue ();
@@ -2037,8 +2037,8 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED, int ssize)
              )
            {
              int shift = (bytelen - (ssize - bytepos)) * BITS_PER_UNIT;
-             expand_binop (mode, ashr_optab, tmps[i], GEN_INT (shift),
-                           tmps[i], 0, OPTAB_WIDEN);
+             tmps[i] = expand_shift (RSHIFT_EXPR, mode, tmps[i],
+                                     build_int_2 (shift, 0), tmps[i], 0);
            }
          bytelen = ssize - bytepos;
        }
@@ -3802,7 +3802,9 @@ expand_assignment (tree to, tree from, int want_value)
          MEM_KEEP_ALIAS_SET_P (to_rtx) = 1;
        }
 
-      while (mode1 == VOIDmode && !want_value
+      /* Disabled temporarily.  GET_MODE (to_rtx) is often not the right
+        mode.  */
+      while (0 && mode1 == VOIDmode && !want_value
             && bitpos + bitsize <= BITS_PER_WORD
             && bitsize < BITS_PER_WORD
             && GET_MODE_BITSIZE (GET_MODE (to_rtx)) <= BITS_PER_WORD
@@ -4495,11 +4497,11 @@ count_type_elements (tree type)
        tree telts = array_type_nelts (type);
        if (telts && host_integerp (telts, 1))
          {
-           HOST_WIDE_INT n = tree_low_cst (telts, 1);
+           HOST_WIDE_INT n = tree_low_cst (telts, 1) + 1;
            HOST_WIDE_INT m = count_type_elements (TREE_TYPE (type));
            if (n == 0)
              return 0;
-           if (max / n < m)
+           else if (max / n > m)
              return n * m;
          }
        return -1;
@@ -6441,8 +6443,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
   original_target = target;
   ignore = (target == const0_rtx
            || ((code == NON_LVALUE_EXPR || code == NOP_EXPR
-                || code == CONVERT_EXPR || code == REFERENCE_EXPR
-                || code == COND_EXPR || code == VIEW_CONVERT_EXPR)
+                || code == CONVERT_EXPR || code == COND_EXPR 
+     || code == VIEW_CONVERT_EXPR)
                && TREE_CODE (type) == VOID_TYPE));
 
   /* If we are going to ignore this result, we need only do something
@@ -7501,7 +7503,6 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
     case NON_LVALUE_EXPR:
     case NOP_EXPR:
     case CONVERT_EXPR:
-    case REFERENCE_EXPR:
       if (TREE_OPERAND (exp, 0) == error_mark_node)
        return const0_rtx;