OSDN Git Service

* calls.c (expand_call): When modes of target and valreg match, force
[pf3gnuchains/gcc-fork.git] / gcc / calls.c
index 06ed14a..135f949 100644 (file)
@@ -38,6 +38,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "langhooks.h"
 #include "target.h"
 #include "cgraph.h"
+#include "except.h"
 
 /* Decide whether a function's arguments should be processed
    from first to last or from last to first.
@@ -588,6 +589,8 @@ emit_call_1 (funexp, fndecl, funtype, stack_size, rounded_stack_size,
   if (ecf_flags & ECF_NOTHROW)
     REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_EH_REGION, const0_rtx,
                                               REG_NOTES (call_insn));
+  else
+    note_eh_region_may_contain_throw ();
 
   if (ecf_flags & ECF_NORETURN)
     REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_NORETURN, const0_rtx,
@@ -3276,6 +3279,12 @@ expand_call (exp, target, ignore)
             If they refer to the same register, this move will be a no-op,
             except when function inlining is being done.  */
          emit_move_insn (target, valreg);
+
+         /* If we are setting a MEM, this code must be executed.  Since it is
+            emitted after the call insn, sibcall optimization cannot be
+            performed in that case.  */
+         if (GET_CODE (target) == MEM)
+           sibcall_failure = 1;
        }
       else if (TYPE_MODE (TREE_TYPE (exp)) == BLKmode)
        {