diff mbox

Fix minor bug with shrink wrapping

Message ID 201205122331.30570.ebotcazou@adacore.com
State New
Headers show

Commit Message

Eric Botcazou May 12, 2012, 9:31 p.m. UTC
This is a regression present on the mainline and 4.7 branch.  The attached 
testcase now fails because the function lacks a stack frame that would yield 
the unique CFA expected by the unwinder.

Bootstrapped/regtested on PowerPC/Linux, applied on mainline and 4.7 branch.


2012-05-12  Eric Botcazou  <ebotcazou@adacore.com>

	* function.c (requires_stack_frame_p): If the function can throw
	non-call exceptions, return true if the insn can throw internally.


2012-05-12  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/null_pointer_deref3.adb: New test.
diff mbox

Patch

Index: function.c
===================================================================
--- function.c	(revision 187393)
+++ function.c	(working copy)
@@ -5316,6 +5316,10 @@  requires_stack_frame_p (rtx insn, HARD_R
   if (CALL_P (insn))
     return !SIBLING_CALL_P (insn);
 
+  /* We need a frame to get the unique CFA expected by the unwinder.  */
+  if (cfun->can_throw_non_call_exceptions && can_throw_internal (insn))
+    return true;
+
   CLEAR_HARD_REG_SET (hardregs);
   for (df_rec = DF_INSN_DEFS (insn); *df_rec; df_rec++)
     {