diff options
author | Martin Jambor <mjambor@suse.cz> | 2013-01-21 17:16:57 +0000 |
---|---|---|
committer | Martin Jambor <mjambor@suse.cz> | 2013-01-21 17:16:57 +0000 |
commit | 24d21d3a4908806e1e37755310d6fa8e569bd97e (patch) | |
tree | cc5bb08d0366e222ced364bd242ff1fda185c1b0 /gcc/function.c | |
parent | 203baab47f1f3ab47193ba24f9597bb88c9a2866 (diff) |
2013-01-21 Martin Jambor <mjambor@suse.cz>
PR middle-end/56022
* function.c (allocate_struct_function): Call
invoke_set_current_function_hook earlier.
testsuite/
* gcc.target/i386/pr56022.c: New test.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@195341 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/function.c b/gcc/function.c index bb6a9ae9979..4ce2259ef71 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4479,7 +4479,6 @@ get_last_funcdef_no (void) void allocate_struct_function (tree fndecl, bool abstract_p) { - tree result; tree fntype = fndecl ? TREE_TYPE (fndecl) : NULL_TREE; cfun = ggc_alloc_cleared_function (); @@ -4498,8 +4497,13 @@ allocate_struct_function (tree fndecl, bool abstract_p) DECL_STRUCT_FUNCTION (fndecl) = cfun; cfun->decl = fndecl; current_function_funcdef_no = get_next_funcdef_no (); + } + + invoke_set_current_function_hook (fndecl); - result = DECL_RESULT (fndecl); + if (fndecl != NULL_TREE) + { + tree result = DECL_RESULT (fndecl); if (!abstract_p && aggregate_value_p (result, fndecl)) { #ifdef PCC_STATIC_STRUCT_RETURN @@ -4518,8 +4522,6 @@ allocate_struct_function (tree fndecl, bool abstract_p) but is this worth the hassle? */ cfun->can_throw_non_call_exceptions = flag_non_call_exceptions; } - - invoke_set_current_function_hook (fndecl); } /* This is like allocate_struct_function, but pushes a new cfun for FNDECL |