+2020-05-12 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/95033
+ PR sanitizer/95051
+ * sanopt.c (sanitize_rewrite_addressable_params):
+ Clear DECL_NOT_GIMPLE_REG_P for argument.
+
2020-05-12 Richard Sandiford <richard.sandiford@arm.com>
PR tree-optimization/94980
&& TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST)
{
TREE_ADDRESSABLE (arg) = 0;
+ DECL_NOT_GIMPLE_REG_P (arg) = 0;
/* The parameter is no longer addressable. */
has_any_addressable_param = true;
+2020-05-12 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/95033
+ PR sanitizer/95051
+ * g++.dg/asan/function-argument-4.C: New test.
+ * gcc.dg/asan/pr95033.c: New test.
+ * gcc.dg/asan/pr95051.c: New test.
+
2020-05-12 Jakub Jelinek <jakub@redhat.com>
PR c++/95063
--- /dev/null
+// { dg-do run }
+// { dg-shouldfail "asan" }
+
+#include <complex.h>
+
+static __attribute__ ((noinline)) long double
+goo (long double _Complex *a)
+{
+ return crealf(*(volatile _Complex long double *)a);
+}
+
+__attribute__ ((noinline)) float
+foo (float _Complex arg)
+{
+ return goo ((long double _Complex *)&arg);
+}
+
+int
+main ()
+{
+ return foo (3 + 2 * I);
+}
+
+// { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow on address.*(\n|\r\n|\r)" }
+// { dg-output "READ of size \[0-9\]* at.*" }
+// { dg-output ".*'arg' \\(line 13\\) <== Memory access at offset \[0-9\]* partially overflows this variable.*" }
--- /dev/null
+/* PR sanitizer/95033 */
+/* { dg-do compile } */
+/* { dg-options "-fsanitize=address" } */
+
+struct a
+{
+ int b;
+};
+
+struct a c(_Complex d)
+{
+ return *(struct a *)&d;
+}
--- /dev/null
+/* PR sanitizer/95051 */
+/* { dg-do compile } */
+/* { dg-options "-fsanitize=kernel-address --param=asan-stack=1 -O2" } */
+
+struct a {
+ struct {
+ struct {
+ int b;
+ } c;
+ };
+};
+struct d {
+ struct {
+ int e;
+ } f;
+}
+
+g(int h) {
+ struct a *i;
+ struct d *j = (struct d*)&h;
+ i->c.b = j->f.e;
+}