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. */
|| (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
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);
--- /dev/null
+/* 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)
+{
+}
{
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);
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,