PR middle-end/55851
* fold-const.c (int_binop_types_match_p): Allow all INTEGRAL_TYPE_P
types instead of just INTEGER_TYPE types.
* gcc.c-torture/compile/pr55851.c: New test.
Co-Authored-By: Richard Biener <rguenther@suse.de>
From-SVN: r195006
+2013-01-08 Jakub Jelinek <jakub@redhat.com>
+ Richard Biener <rguenther@suse.de>
+
+ PR middle-end/55851
+ * fold-const.c (int_binop_types_match_p): Allow all INTEGRAL_TYPE_P
+ types instead of just INTEGER_TYPE types.
+
2013-01-07 Mark Kettenis <kettenis@openbsd.org>
* config/i386/openbsdelf.h (LIBGCC2_HAS_TF_MODE, LIBGCC2_TF_CEXT,
static bool
int_binop_types_match_p (enum tree_code code, const_tree type1, const_tree type2)
{
- if (TREE_CODE (type1) != INTEGER_TYPE && !POINTER_TYPE_P (type1))
+ if (!INTEGRAL_TYPE_P (type1) && !POINTER_TYPE_P (type1))
return false;
- if (TREE_CODE (type2) != INTEGER_TYPE && !POINTER_TYPE_P (type2))
+ if (!INTEGRAL_TYPE_P (type2) && !POINTER_TYPE_P (type2))
return false;
switch (code)
2013-01-08 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/55851
+ * gcc.c-torture/compile/pr55851.c: New test.
+
PR sanitizer/55844
* c-c++-common/asan/null-deref-1.c: Add -fno-shrink-wrap to
dg-options.
--- /dev/null
+/* PR middle-end/55851 */
+
+enum { A = 1UL, B = -1UL } var = A;
+void foo (char *);
+
+void
+test (void)
+{
+ char vla[1][var];
+ vla[0][0] = 1;
+ foo (&vla[0][0]);
+}