summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-11 13:33:47 +0000
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-11 13:33:47 +0000
commite9a9dc0931b409f259957ea331ce42e1760ff21f (patch)
tree81e26b69e9721be6b9ce0cea3e83f9f11043cfb2
parent108b3f6e9846ba53f9791b81294e69acf3ea7ace (diff)
downloadgcc-e9a9dc0931b409f259957ea331ce42e1760ff21f.tar.gz
Handle noreturn function thunk creation.
PR ipa/64813 * cgraphunit.c (cgraph_node::expand_thunk): Do not create a return value for call to a function that is noreturn. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220616 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cgraphunit.c7
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 08d430f80f9..eab5cdba8f8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-02-11 Martin Liska <mliska@suse.cz>
+
+ PR ipa/64813
+ * cgraphunit.c (cgraph_node::expand_thunk): Do not create
+ a return value for call to a function that is noreturn.
+
2015-02-11 Richard Biener <rguenther@suse.de>
PR lto/65015
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 48a4b35a938..f2c40d43d71 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1580,6 +1580,7 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
gcall *call;
greturn *ret;
+ bool alias_is_noreturn = TREE_THIS_VOLATILE (alias);
if (in_lto_p)
get_untransformed_body ();
@@ -1616,7 +1617,7 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
bsi = gsi_start_bb (bb);
/* Build call to the function being thunked. */
- if (!VOID_TYPE_P (restype))
+ if (!VOID_TYPE_P (restype) && !alias_is_noreturn)
{
if (DECL_BY_REFERENCE (resdecl))
{
@@ -1675,14 +1676,14 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
callees->call_stmt = call;
gimple_call_set_from_thunk (call, true);
gimple_call_set_with_bounds (call, instrumentation_clone);
- if (restmp)
+ if (restmp && !alias_is_noreturn)
{
gimple_call_set_lhs (call, restmp);
gcc_assert (useless_type_conversion_p (TREE_TYPE (restmp),
TREE_TYPE (TREE_TYPE (alias))));
}
gsi_insert_after (&bsi, call, GSI_NEW_STMT);
- if (!(gimple_call_flags (call) & ECF_NORETURN))
+ if (!alias_is_noreturn)
{
if (restmp && !this_adjusting
&& (fixed_offset || virtual_offset))