aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/function.cc4
-rw-r--r--gcc/function.h2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr105554.c10
-rw-r--r--gcc/tree-inline.cc11
4 files changed, 16 insertions, 11 deletions
diff --git a/gcc/function.cc b/gcc/function.cc
index cfc4d2f..edf0b2e 100644
--- a/gcc/function.cc
+++ b/gcc/function.cc
@@ -4891,7 +4891,7 @@ allocate_struct_function (tree fndecl, bool abstract_p)
instead of just setting it. */
void
-push_struct_function (tree fndecl)
+push_struct_function (tree fndecl, bool abstract_p)
{
/* When in_dummy_function we might be in the middle of a pop_cfun and
current_function_decl and cfun may not match. */
@@ -4900,7 +4900,7 @@ push_struct_function (tree fndecl)
|| (cfun && current_function_decl == cfun->decl));
cfun_stack.safe_push (cfun);
current_function_decl = fndecl;
- allocate_struct_function (fndecl, false);
+ allocate_struct_function (fndecl, abstract_p);
}
/* Reset crtl and other non-struct-function variables to defaults as
diff --git a/gcc/function.h b/gcc/function.h
index cf85d2a..d4ce8a7 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -687,7 +687,7 @@ extern void pop_cfun (void);
extern int get_next_funcdef_no (void);
extern int get_last_funcdef_no (void);
extern void allocate_struct_function (tree, bool);
-extern void push_struct_function (tree fndecl);
+extern void push_struct_function (tree fndecl, bool = false);
extern void push_dummy_function (bool);
extern void pop_dummy_function (void);
extern void init_dummy_function_start (void);
diff --git a/gcc/testsuite/gcc.target/i386/pr105554.c b/gcc/testsuite/gcc.target/i386/pr105554.c
new file mode 100644
index 0000000..08e90bb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr105554.c
@@ -0,0 +1,10 @@
+/* PR target/105554 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-psabi -mno-sse3" } */
+
+typedef long long v4di __attribute__((__vector_size__(32)));
+
+__attribute__((target_clones ("arch=core-avx2", "default"))) void
+foo (v4di x)
+{
+}
diff --git a/gcc/tree-inline.cc b/gcc/tree-inline.cc
index 7fd0831..c702f00 100644
--- a/gcc/tree-inline.cc
+++ b/gcc/tree-inline.cc
@@ -2781,16 +2781,12 @@ initialize_cfun (tree new_fndecl, tree callee_fndecl, profile_count count)
{
struct function *src_cfun = DECL_STRUCT_FUNCTION (callee_fndecl);
- if (!DECL_ARGUMENTS (new_fndecl))
- DECL_ARGUMENTS (new_fndecl) = DECL_ARGUMENTS (callee_fndecl);
- if (!DECL_RESULT (new_fndecl))
- DECL_RESULT (new_fndecl) = DECL_RESULT (callee_fndecl);
-
/* Register specific tree functions. */
gimple_register_cfg_hooks ();
/* Get clean struct function. */
- push_struct_function (new_fndecl);
+ push_struct_function (new_fndecl, true);
+ targetm.target_option.relayout_function (new_fndecl);
/* We will rebuild these, so just sanity check that they are empty. */
gcc_assert (VALUE_HISTOGRAMS (cfun) == NULL);
@@ -6235,8 +6231,7 @@ tree_function_versioning (tree old_decl, tree new_decl,
id.transform_return_to_modify = false;
id.transform_parameter = false;
- old_entry_block = ENTRY_BLOCK_PTR_FOR_FN
- (DECL_STRUCT_FUNCTION (old_decl));
+ old_entry_block = ENTRY_BLOCK_PTR_FOR_FN (DECL_STRUCT_FUNCTION (old_decl));
DECL_RESULT (new_decl) = DECL_RESULT (old_decl);
DECL_ARGUMENTS (new_decl) = DECL_ARGUMENTS (old_decl);
initialize_cfun (new_decl, old_decl,