2015-02-04 Thomas Preud'homme <thomas.preudhomme@arm.com>
gcc/
PR middle-end/62103
* tree-ssa-sccvn.c (fully_constant_vn_reference_p): Use TYPE_PRECISION
to compute size of referenced value in the constant case.
gcc/testsuite/
PR middle-end/62103
* gcc.c-torture/execute/bitfld-7.c: New test adapted from bitfld-6.c
to use 24 bits for bitfield b.
From-SVN: r220390
+2015-02-04 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR middle-end/62103
+ * tree-ssa-sccvn.c (fully_constant_vn_reference_p): Use TYPE_PRECISION
+ to compute size of referenced value in the constant case.
+
2015-02-03 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/64756
+2015-02-04 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR middle-end/62103
+ * gcc.c-torture/execute/bitfld-7.c: New test adapted from bitfld-6.c
+ to use 24 bits for bitfield b.
+
2015-02-04 Thomas Preud'homme <thomas.preudhomme@arm.com>
PR testsuite/64796
--- /dev/null
+union U
+{
+ const int a;
+ unsigned b : 24;
+};
+
+static union U u = { 0x12345678 };
+
+/* Constant folding used to fail to account for endianness when folding a
+ union. */
+
+int
+main (void)
+{
+#ifdef __BYTE_ORDER__
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ return u.b - 0x345678;
+#else
+ return u.b - 0x123456;
+#endif
+#endif
+ return 0;
+}
|| TYPE_PRECISION (ref->type) % BITS_PER_UNIT == 0))
{
HOST_WIDE_INT off = 0;
- HOST_WIDE_INT size = tree_to_shwi (TYPE_SIZE (ref->type));
+ HOST_WIDE_INT size = TYPE_PRECISION (ref->type);
if (size % BITS_PER_UNIT != 0
|| size > MAX_BITSIZE_MODE_ANY_MODE)
return NULL_TREE;