+2014-04-10 Jakub Jelinek <jakub@redhat.com>
+
+ Backport from mainline
+ 2014-03-12 Jakub Jelinek <jakub@redhat.com>
+ Marc Glisse <marc.glisse@inria.fr>
+
+ PR tree-optimization/60502
+ * tree-ssa-reassoc.c (eliminate_not_pairs): Use build_all_ones_cst
+ instead of build_low_bits_mask.
+
+ 2013-06-13 Marc Glisse <marc.glisse@inria.fr>
+
+ * tree.c (build_all_ones_cst): New function.
+ * tree.h (build_all_ones_cst): Declare it.
+
+ 2013-05-10 Marc Glisse <marc.glisse@inria.fr>
+
+ * tree.c (build_minus_one_cst): New function.
+ * tree.h (build_minus_one_cst): Declare new function.
+
2014-04-10 Jakub Jelinek <jakub@redhat.com>
Backport from mainline
2014-04-10 Jakub Jelinek <jakub@redhat.com>
Backport from mainline
+ 2014-03-12 Jakub Jelinek <jakub@redhat.com>
+ Marc Glisse <marc.glisse@inria.fr>
+
+ PR tree-optimization/60502
+ * gcc.c-torture/compile/pr60502.c: New test.
+
2014-03-28 Jakub Jelinek <jakub@redhat.com>
PR target/60693
if (opcode == BIT_AND_EXPR)
oe->op = build_zero_cst (TREE_TYPE (oe->op));
else if (opcode == BIT_IOR_EXPR)
- oe->op = build_low_bits_mask (TREE_TYPE (oe->op),
- TYPE_PRECISION (TREE_TYPE (oe->op)));
+ oe->op = build_all_ones_cst (TREE_TYPE (oe->op));
reassociate_stats.ops_eliminated += ops->length () - 1;
ops->truncate (0);
}
}
+/* Return an integer of type TYPE containing all 1's in as much precision as
+ it contains, or a complex or vector whose subparts are such integers. */
+
+tree
+build_all_ones_cst (tree type)
+{
+ if (TREE_CODE (type) == COMPLEX_TYPE)
+ {
+ tree scalar = build_all_ones_cst (TREE_TYPE (type));
+ return build_complex (type, scalar, scalar);
+ }
+ else
+ return build_minus_one_cst (type);
+}
+
+/* Return a constant of arithmetic type TYPE which is the
+ opposite of the multiplicative identity of the set TYPE. */
+
+tree
+build_minus_one_cst (tree type)
+{
+ switch (TREE_CODE (type))
+ {
+ case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE:
+ case POINTER_TYPE: case REFERENCE_TYPE:
+ case OFFSET_TYPE:
+ return build_int_cst (type, -1);
+
+ case REAL_TYPE:
+ return build_real (type, dconstm1);
+
+ case FIXED_POINT_TYPE:
+ /* We can only generate 1 for accum types. */
+ gcc_assert (ALL_SCALAR_ACCUM_MODE_P (TYPE_MODE (type)));
+ return build_fixed (type, fixed_from_double_int (double_int_minus_one,
+ TYPE_MODE (type)));
+
+ case VECTOR_TYPE:
+ {
+ tree scalar = build_minus_one_cst (TREE_TYPE (type));
+
+ return build_vector_from_val (type, scalar);
+ }
+
+ case COMPLEX_TYPE:
+ return build_complex (type,
+ build_minus_one_cst (TREE_TYPE (type)),
+ build_zero_cst (TREE_TYPE (type)));
+
+ default:
+ gcc_unreachable ();
+ }
+}
+
/* Build 0 constant of type TYPE. This is used by constructor folding
and thus the constant should be represented in memory by
zero(es). */
extern tree build_real_from_int_cst (tree, const_tree);
extern tree build_complex (tree, tree, tree);
extern tree build_one_cst (tree);
+extern tree build_minus_one_cst (tree);
+extern tree build_all_ones_cst (tree);
extern tree build_zero_cst (tree);
extern tree build_string (int, const char *);
extern tree build_tree_list_stat (tree, tree MEM_STAT_DECL);