Merge with trunk.
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Nov 2013 14:26:12 +0000 (14:26 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Nov 2013 14:26:12 +0000 (14:26 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@205218 138bc75d-0d04-0410-961f-82ee72b054a4

18 files changed:
1  2 
gcc/cgraph.c
gcc/config/arm/arm.c
gcc/config/i386/i386.c
gcc/config/rs6000/rs6000.c
gcc/config/sparc/sparc.c
gcc/cse.c
gcc/dbxout.c
gcc/dwarf2out.c
gcc/gimple-fold.c
gcc/omp-low.c
gcc/real.c
gcc/recog.c
gcc/targhooks.c
gcc/tree-inline.c
gcc/tree-ssa-forwprop.c
gcc/tree-ssa-loop-ch.c
gcc/tree-vect-loop-manip.c
gcc/tree-vect-loop.c

diff --cc gcc/cgraph.c
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -10643,33 -10642,31 +10643,31 @@@ sparc_fold_builtin (tree fndecl, int n_
          && TREE_CODE (arg1) == VECTOR_CST
          && TREE_CODE (arg2) == INTEGER_CST)
        {
-         bool overflow, overall_overflow = false;
+         bool overflow = false;
 -        double_int result = TREE_INT_CST (arg2);
 -        double_int tmp;
 +        wide_int result = arg2;
 +        wide_int tmp;
          unsigned i;
  
          for (i = 0; i < VECTOR_CST_NELTS (arg0); ++i)
            {
 -            double_int e0 = TREE_INT_CST (VECTOR_CST_ELT (arg0, i));
 -            double_int e1 = TREE_INT_CST (VECTOR_CST_ELT (arg1, i));
 +            tree e0 = VECTOR_CST_ELT (arg0, i);
 +            tree e1 = VECTOR_CST_ELT (arg1, i);
  
-             tmp = wi::neg (e1, &overflow);
-             overall_overflow |= overall_overflow;
-             tmp = wi::add (e0, tmp, SIGNED, &overflow);
-             overall_overflow |= overall_overflow;
-             if (wi::neg_p (tmp))
-               {
-                 tmp = wi::neg (tmp, &overflow);
-                 overall_overflow |= overall_overflow;
-               }
+             bool neg1_ovf, neg2_ovf, add1_ovf, add2_ovf;
  
-             result = wi::add (result, tmp, SIGNED, &overflow);
-             overall_overflow |= overall_overflow;
 -            tmp = e1.neg_with_overflow (&neg1_ovf);
 -            tmp = e0.add_with_sign (tmp, false, &add1_ovf);
 -            if (tmp.is_negative ())
 -              tmp = tmp.neg_with_overflow (&neg2_ovf);
++            tmp = wi::neg (e1, &neg1_ovf);
++            tmp = wi::add (e0, tmp, SIGNED, &add1_ovf);
++            if (wi::neg_p (tmp))
++              tmp = wi::neg (tmp, &neg2_ovf);
+             else
+               neg2_ovf = false;
 -            result = result.add_with_sign (tmp, false, &add2_ovf);
++            result = wi::add (result, tmp, SIGNED, &add2_ovf);
+             overflow |= neg1_ovf | neg2_ovf | add1_ovf | add2_ovf;
            }
  
-         gcc_assert (!overall_overflow);
+         gcc_assert (!overflow);
  
 -        return build_int_cst_wide (rtype, result.low, result.high);
 +        return wide_int_to_tree (rtype, result);
        }
  
      default:
diff --cc gcc/cse.c
Simple merge
diff --cc gcc/dbxout.c
Simple merge
diff --cc gcc/dwarf2out.c
Simple merge
Simple merge
diff --cc gcc/omp-low.c
Simple merge
diff --cc gcc/real.c
Simple merge
diff --cc gcc/recog.c
Simple merge
diff --cc gcc/targhooks.c
Simple merge
Simple merge
Simple merge
@@@ -243,6 -243,16 +243,16 @@@ copy_loop_headers (void
         are not now, since there was the loop exit condition.  */
        split_edge (loop_preheader_edge (loop));
        split_edge (loop_latch_edge (loop));
 -      double_int max;
+       /* We peeled off one iteration of the loop thus we can lower
+        the maximum number of iterations if we have a previously
+        recorded value for that.  */
 -        max -= double_int_one;
++      widest_int max;
+       if (get_max_loop_iterations (loop, &max))
+       {
++        max -= 1;
+         loop->nb_iterations_upper_bound = max;
+       }
      }
  
    update_ssa (TODO_update_ssa);
Simple merge
Simple merge