+2014-04-23 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2014-04-02 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/60729
+ * optabs.c (expand_abs_nojump): Honor flag_trapv only for
+ MODE_INTs. Properly use negv_optab.
+ (expand_abs): Likewise.
+
+ 2014-04-03 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/60740
+ * graphite-scop-detection.c (stmt_simple_for_scop_p): Iterate
+ over all GIMPLE_COND operands.
+
2014-04-23 Richard Biener <rguenther@suse.de>
PR middle-end/60635
case GIMPLE_COND:
{
- tree op;
- ssa_op_iter op_iter;
- enum tree_code code = gimple_cond_code (stmt);
-
/* We can handle all binary comparisons. Inequalities are
also supported as they can be represented with union of
polyhedra. */
+ enum tree_code code = gimple_cond_code (stmt);
if (!(code == LT_EXPR
|| code == GT_EXPR
|| code == LE_EXPR
|| code == NE_EXPR))
return false;
- FOR_EACH_SSA_TREE_OPERAND (op, stmt, op_iter, SSA_OP_ALL_USES)
- if (!graphite_can_represent_expr (scop_entry, loop, op)
- /* We can not handle REAL_TYPE. Failed for pr39260. */
- || TREE_CODE (TREE_TYPE (op)) == REAL_TYPE)
- return false;
+ for (unsigned i = 0; i < 2; ++i)
+ {
+ tree op = gimple_op (stmt, i);
+ if (!graphite_can_represent_expr (scop_entry, loop, op)
+ /* We can not handle REAL_TYPE. Failed for pr39260. */
+ || TREE_CODE (TREE_TYPE (op)) == REAL_TYPE)
+ return false;
+ }
return true;
}
{
rtx temp;
- if (! flag_trapv)
+ if (GET_MODE_CLASS (mode) != MODE_INT
+ || ! flag_trapv)
result_unsignedp = 1;
/* First try to do it with a special abs instruction. */
{
rtx last = get_last_insn ();
- temp = expand_unop (mode, neg_optab, op0, NULL_RTX, 0);
+ temp = expand_unop (mode, result_unsignedp ? neg_optab : negv_optab,
+ op0, NULL_RTX, 0);
if (temp != 0)
temp = expand_binop (mode, smax_optab, op0, temp, target, 0,
OPTAB_WIDEN);
{
rtx temp, op1;
- if (! flag_trapv)
+ if (GET_MODE_CLASS (mode) != MODE_INT
+ || ! flag_trapv)
result_unsignedp = 1;
temp = expand_abs_nojump (mode, op0, target, result_unsignedp);
+2014-04-23 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2014-04-02 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/60729
+ * g++.dg/vect/pr60729.cc: New testcase.
+
+ 2014-04-03 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/60740
+ * gcc.dg/graphite/pr60740.c: New testcase.
+
2014-04-23 Richard Biener <rguenther@suse.de>
PR middle-end/60635
--- /dev/null
+// { dg-do compile }
+// { dg-additional-options "-ftrapv" }
+
+void doSomething(int dim, double *Y, double *A)
+{
+ for (int k=0; k<dim; k++)
+ Y[k] += __builtin_fabs (A[k]);
+}
+
+// { dg-final { cleanup-tree-dump "vect" } }
--- /dev/null
+/* { dg-options "-O2 -floop-interchange" } */
+
+int **db6 = 0;
+
+void
+k26(void)
+{
+ static int geb = 0;
+ int *a22 = &geb;
+ int **l30 = &a22;
+ int *c4b;
+ int ndf;
+ for (ndf = 0; ndf <= 1; ++ndf)
+ *c4b = (db6 == l30) && (*a22)--;
+}
+