tree-optimization/93661 properly guard tree_to_poly_int64
authorRichard Biener <rguenther@suse.de>
Tue, 11 Feb 2020 09:56:03 +0000 (10:56 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 11 Feb 2020 09:56:03 +0000 (10:56 +0100)
2020-02-11  Richard Biener  <rguenther@suse.de>

PR tree-optimization/93661
PR tree-optimization/93662
* tree-ssa-sccvn.c (vn_reference_lookup_3): Properly guard
tree_to_poly_int64.
* tree-sra.c (get_access_for_expr): Likewise.

* gcc.dg/pr93661.c: New testcase.

gcc/testsuite/gcc.dg/pr93661.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/pr93661.c b/gcc/testsuite/gcc.dg/pr93661.c
new file mode 100644 (file)
index 0000000..e311ba5
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int f ()
+{
+  unsigned x = 0xffffffff;
+  __builtin_memset (1+(char *) &x, 0, -1); /* { dg-warning "maximum object size" } */
+  return (x != 0xf0000000);
+}