2017-04-11 Martin Liska <mliska@suse.cz>
PR sanitizer/70878
* ubsan.c (instrument_object_size): Do not instrument register
variables.
2017-04-11 Martin Liska <mliska@suse.cz>
PR sanitizer/70878
* gcc.dg/ubsan/pr70878.c: New test.
From-SVN: r246837
+2017-04-11 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/70878
+ * ubsan.c (instrument_object_size): Do not instrument register
+ variables.
+
2017-04-11 Jakub Jelinek <jakub@redhat.com>
PR target/80381
+2017-04-11 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/70878
+ * gcc.dg/ubsan/pr70878.c: New test.
+
2017-04-11 Jakub Jelinek <jakub@redhat.com>
PR target/80381
--- /dev/null
+/* PR sanitizer/80878 */
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-options "-fsanitize=object-size" } */
+
+void * sbrk ()
+{
+ volatile register unsigned int sp_r1 __asm__ ("ebx");
+ return __builtin_strcat ((char*)sp_r1, 0); /* { dg-warning "cast to pointer from integer of different size" } */
+}
bool decl_p = DECL_P (inner);
tree base;
if (decl_p)
- base = inner;
+ {
+ if (DECL_REGISTER (inner))
+ return;
+ base = inner;
+ }
else if (TREE_CODE (inner) == MEM_REF)
base = TREE_OPERAND (inner, 0);
else