diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-02-01 09:40:31 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-02-01 09:40:31 +0100 |
commit | 021293cb5abbe2a03c36bb5324ef2ebebcc98c9d (patch) | |
tree | 22ced0be1f1d48fca4a1b793689fd1f9bffc18f7 /gcc/gimple-low.c | |
parent | b49e41743c3343f32642a4fbb2dd3c2bc4ccb838 (diff) | |
download | gcc-021293cb5abbe2a03c36bb5324ef2ebebcc98c9d.zip gcc-021293cb5abbe2a03c36bb5324ef2ebebcc98c9d.tar.gz gcc-021293cb5abbe2a03c36bb5324ef2ebebcc98c9d.tar.bz2 |
re PR tree-optimization/60003 (wrong code with __builtin_setjmp/__builtin_longjmp and inlining)
PR tree-optimization/60003
* gimple-low.c (lower_builtin_setjmp): Set cfun->has_nonlocal_label.
* profile.c (branch_prob): Use gimple_call_builtin_p
to check for BUILT_IN_SETJMP_RECEIVER.
* tree-inline.c (copy_bb): Call notice_special_calls.
* gcc.c-torture/execute/pr60003.c: New test.
From-SVN: r207382
Diffstat (limited to 'gcc/gimple-low.c')
-rw-r--r-- | gcc/gimple-low.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c index c60e817..5fbcf3f3 100644 --- a/gcc/gimple-low.c +++ b/gcc/gimple-low.c @@ -709,6 +709,12 @@ lower_builtin_setjmp (gimple_stmt_iterator *gsi) tree dest, t, arg; gimple g; + /* __builtin_setjmp_{setup,receiver} aren't ECF_RETURNS_TWICE and for RTL + these builtins are modelled as non-local label jumps to the label + that is passed to these two builtins, so pretend we have a non-local + label during GIMPLE passes too. See PR60003. */ + cfun->has_nonlocal_label = true; + /* NEXT_LABEL is the label __builtin_longjmp will jump to. Its address is passed to both __builtin_setjmp_setup and __builtin_setjmp_receiver. */ FORCED_LABEL (next_label) = 1; |