+2017-04-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/80310
+ * tree-nvr.c: Include internal-fn.h.
+ (pass_return_slot::execute): Ignore internal calls without
+ direct optab.
+
2017-04-04 Jakub Jelinek <jakub@redhat.com>
Richard Biener <rguenther@suse.de>
--- /dev/null
+/* PR target/80310 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fsanitize=signed-integer-overflow" } */
+/* { dg-additional-options "-mno-avx" { target i?86-*-* x86_64-*-* } } */
+
+typedef int V __attribute__((vector_size (32)));
+
+void
+foo (V *a, V *b, V *c)
+{
+ *a = *b + *c; /* { dg-bogus "AVX vector return without AVX enabled changes the ABI" "" { target i?86-*-* x86_64-*-* } } */
+}
#include "tree-pretty-print.h"
#include "gimple-iterator.h"
#include "gimple-walk.h"
+#include "internal-fn.h"
/* This file implements return value optimizations for functions which
return aggregate types.
if (stmt
&& gimple_call_lhs (stmt)
&& !gimple_call_return_slot_opt_p (stmt)
+ /* Ignore internal functions without direct optabs,
+ those are expanded specially and aggregate_value_p
+ on their result might result in undesirable warnings
+ with some backends. */
+ && (!gimple_call_internal_p (stmt)
+ || direct_internal_fn_p (gimple_call_internal_fn (stmt)))
&& aggregate_value_p (TREE_TYPE (gimple_call_lhs (stmt)),
gimple_call_fndecl (stmt)))
{