]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR ipa/64813 (23_containers/unordered_map/requirements/explicit_instanti...
authorYvan Roux <yvan.roux@linaro.org>
Mon, 23 Mar 2015 09:55:34 +0000 (09:55 +0000)
committerYvan Roux <yroux@gcc.gnu.org>
Mon, 23 Mar 2015 09:55:34 +0000 (09:55 +0000)
2015-03-23  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r220616.
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.

From-SVN: r221590

gcc/ChangeLog
gcc/cgraphunit.c

index 3b0b55bc094a2761fe41d41af6c8e77010c14c0d..b7849cd1c512a047bc92a8575024dc449af27223 100644 (file)
@@ -1,3 +1,12 @@
+2015-03-23  Yvan Roux  <yvan.roux@linaro.org>
+
+       Backport from trunk r220616.
+       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-03-23  Yvan Roux  <yvan.roux@linaro.org>
 
        Backport from trunk r216841.
index 27016adf7d359472a32396a7c79f525ab644d3f4..f189980e9f8735a02eb4d7135a763e1689416dc4 100644 (file)
@@ -1532,6 +1532,7 @@ expand_thunk (struct cgraph_node *node, bool output_asm_thunks)
 
       gimple call;
       gimple ret;
+      bool alias_is_noreturn = TREE_THIS_VOLATILE (alias);
 
       if (in_lto_p)
        cgraph_get_body (node);
@@ -1566,7 +1567,7 @@ expand_thunk (struct cgraph_node *node, bool output_asm_thunks)
       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))
            restmp = gimple_fold_indirect_ref (resdecl);
@@ -1612,14 +1613,14 @@ expand_thunk (struct cgraph_node *node, bool output_asm_thunks)
       call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs);
       node->callees->call_stmt = call;
       gimple_call_set_from_thunk (call, true);
-      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))