+2016-04-26 Marc Glisse <marc.glisse@inria.fr>
+
+ * genmatch.c (write_predicate): Add ATTRIBUTE_UNUSED.
+ * fold-const.c (fold_binary_loc): Remove 2 transformations
+ superseded by match.pd.
+ * match.pd (x+x -> x*2): Generalize to integers.
+
2016-04-26 Bernd Schmidt <bschmidt@redhat.com>
* config/i386/i386.md (operation on memory peephole): Duplicate an
fold_convert_loc (loc, type,
negate_expr (op0)), tem);
- /* (A + A) * C -> A * 2 * C */
- if (TREE_CODE (arg0) == PLUS_EXPR
- && TREE_CODE (arg1) == INTEGER_CST
- && operand_equal_p (TREE_OPERAND (arg0, 0),
- TREE_OPERAND (arg0, 1), 0))
- return fold_build2_loc (loc, MULT_EXPR, type,
- omit_one_operand_loc (loc, type,
- TREE_OPERAND (arg0, 0),
- TREE_OPERAND (arg0, 1)),
- fold_build2_loc (loc, MULT_EXPR, type,
- build_int_cst (type, 2) , arg1));
-
- /* ((T) (X /[ex] C)) * C cancels out if the conversion is
- sign-changing only. */
- if (TREE_CODE (arg1) == INTEGER_CST
- && TREE_CODE (arg0) == EXACT_DIV_EXPR
- && operand_equal_p (arg1, TREE_OPERAND (arg0, 1), 0))
- return fold_convert_loc (loc, type, TREE_OPERAND (arg0, 0));
-
strict_overflow_p = false;
if (TREE_CODE (arg1) == INTEGER_CST
&& 0 != (tem = extract_muldiv (op0, arg1, code, NULL_TREE,
"%s%s (tree t%s%s)\n"
"{\n", gimple ? "gimple_" : "tree_", p->id,
p->nargs > 0 ? ", tree *res_ops" : "",
- gimple ? ", tree (*valueize)(tree)" : "");
+ gimple ? ", tree (*valueize)(tree) ATTRIBUTE_UNUSED" : "");
/* Conveniently make 'type' available. */
fprintf_indent (f, 2, "tree type = TREE_TYPE (t);\n");
(if (!TREE_OVERFLOW (tem) || !flag_trapping_math)
(minus @0 { tem; })))))
-/* Convert x+x into x*2.0. */
+/* Convert x+x into x*2. */
(simplify
(plus @0 @0)
(if (SCALAR_FLOAT_TYPE_P (type))
- (mult @0 { build_real (type, dconst2); })))
+ (mult @0 { build_real (type, dconst2); })
+ (if (INTEGRAL_TYPE_P (type))
+ (mult @0 { build_int_cst (type, 2); }))))
(simplify
(minus integer_zerop @1)
+2016-04-26 Marc Glisse <marc.glisse@inria.fr>
+
+ * gcc.dg/fold-plusmult.c: Adjust.
+ * gcc.dg/no-strict-overflow-6.c: Adjust.
+ * gcc.dg/gomp/loop-1.c: Xfail some tests.
+
2016-04-26 Bernd Schmidt <bschmidt@redhat.com>
* gcc.target/i386/avx512bw-vptestmb-1.c: Correct [xyz]mm register
return (a + a)*2;
}
-/* { dg-final { scan-tree-dump-times "<a> \\\* 4" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "a \\\* 4" 2 "original" } } */
#pragma omp for
for (i = 5; i <= i; i++) /* { dg-error "invalid controlling predicate|condition expression refers to iteration variable" } */
;
- #pragma omp for /* { dg-error "increment expression refers to iteration variable" } */
- for (i = 5; i < 16; i += i)
+ #pragma omp for /* { dg-error "increment expression refers to iteration variable" "" { xfail *-*-* } } */
+ for (i = 5; i < 16; i += i) /* { dg-bogus "invalid increment expression" "" { xfail *-*-* } } */
;
#pragma omp for
for (i = 5; i < 16; i = i + 2 * i) /* { dg-error "invalid increment expression|increment expression refers to iteration variable" } */
;
- #pragma omp for /* { dg-error "increment expression refers to iteration variable" } */
- for (i = 5; i < 16; i = i + i)
+ #pragma omp for /* { dg-error "increment expression refers to iteration variable" "" { xfail *-*-* } } */
+ for (i = 5; i < 16; i = i + i) /* { dg-bogus "invalid increment expression" "" { xfail *-*-* } } */
;
#pragma omp for
for (i = 5; i < 16; i = i + bar (i)) /* { dg-error "increment expression refers to iteration variable" } */
#pragma omp for
for (int i = 5; i <= i; i++) /* { dg-error "invalid controlling predicate|condition expression refers to iteration variable" } */
;
- #pragma omp for /* { dg-error "increment expression refers to iteration variable" } */
- for (int i = 5; i < 16; i += i)
+ #pragma omp for /* { dg-error "increment expression refers to iteration variable" "" { xfail *-*-* } } */
+ for (int i = 5; i < 16; i += i) /* { dg-bogus "invalid increment expression" "" { xfail *-*-* } } */
;
#pragma omp for
for (int i = 5; i < 16; i = i + 2 * i) /* { dg-error "invalid increment expression|increment expression refers to iteration variable" } */
;
- #pragma omp for /* { dg-error "increment expression refers to iteration variable" } */
- for (int i = 5; i < 16; i = i + i)
+ #pragma omp for /* { dg-error "increment expression refers to iteration variable" "" { xfail *-*-* } } */
+ for (int i = 5; i < 16; i = i + i) /* { dg-bogus "invalid increment expression" "" { xfail *-*-* } } */
;
#pragma omp for
for (int i = 5; i < 16; i = i + bar (i)) /* { dg-error "increment expression refers to iteration variable" } */
int i, bits;
for (i = 1, bits = 1; i > 0; i += i)
++bits;
- return bits;
+ return bits - sizeof(int) * __CHAR_BIT__;
}
-/* { dg-final { scan-tree-dump "return bits" "optimized" } } */
+/* { dg-final { scan-tree-dump "return 0" "optimized" } } */