PR c++/82872
* convert.c (convert_to_integer_1) <POINTER_TYPE>: Do not return the
shared zero if the input has overflowed.
From-SVN: r255944
+2017-12-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR c++/82872
+ * convert.c (convert_to_integer_1) <POINTER_TYPE>: Do not return the
+ shared zero if the input has overflowed.
+
2017-12-21 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/driver-arm.c (arm_cpu_table): Specify dotprod
{
case POINTER_TYPE:
case REFERENCE_TYPE:
- if (integer_zerop (expr))
+ if (integer_zerop (expr) && !TREE_OVERFLOW (expr))
return build_int_cst (type, 0);
/* Convert to an unsigned integer of the correct width first, and from
+2017-12-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * c-c++-common/pr82872.c: New test.
+
2017-12-21 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/82973
--- /dev/null
+/* PR c++/82872 */
+/* { dg-do compile } */
+
+#include <stddef.h>
+
+struct S { int i, a[1]; };
+
+size_t foo (void)
+{
+ return offsetof (struct S, a[__PTRDIFF_MAX__]);
+}