function.c (requires_stack_frame_p): If the function can throw non-call exceptions...

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

From-SVN: r187430
This commit is contained in:
Eric Botcazou 2012-05-12 21:37:23 +00:00 committed by Eric Botcazou
parent f21e25afae
commit f1c2a405ce
4 changed files with 37 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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-10 Eric Botcazou <ebotcazou@adacore.com>
* gimplify.c (gimplify_decl_expr): For a TYPE_DECL, also gimplify the

View File

@ -5287,6 +5287,10 @@ requires_stack_frame_p (rtx insn, HARD_REG_SET prologue_used,
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++)
{

View File

@ -1,3 +1,7 @@
2012-05-12 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/null_pointer_deref3.adb: New test.
2012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53301

View File

@ -0,0 +1,24 @@
-- { dg-do run }
-- { dg-options "-O -gnatp" }
-- This test requires architecture- and OS-specific support code for unwinding
-- through signal frames (typically located in *-unwind.h) to pass. Feel free
-- to disable it if this code hasn't been implemented yet.
procedure Null_Pointer_Deref3 is
procedure Leaf is
type Int_Ptr is access all Integer;
function n return Int_Ptr is
begin return null; end;
Data : Int_Ptr := n;
begin
Data.all := 0;
end;
begin
Leaf;
exception
when others => null;
end;