diff options
author | Dale Johannesen <dalej@apple.com> | 2004-11-16 01:26:00 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@gcc.gnu.org> | 2004-11-16 01:26:00 +0000 |
commit | b00843d2851a8021f148ea11209d205f5b8e6469 (patch) | |
tree | 82ac2ff37928b22b45e27ce54db8f8931281757a /gcc/profile.c | |
parent | 32f84e48f38788f1f90b370d8835d7686b697554 (diff) | |
download | gcc-b00843d2851a8021f148ea11209d205f5b8e6469.zip gcc-b00843d2851a8021f148ea11209d205f5b8e6469.tar.gz gcc-b00843d2851a8021f148ea11209d205f5b8e6469.tar.bz2 |
profile.c (compute_branch_probabilities): Prevent crash with EH in RTL-based profiling.
2004-11-15 Dale Johannesen <dalej@apple.com>
* profile.c (compute_branch_probabilities): Prevent
crash with EH in RTL-based profiling.
From-SVN: r90711
Diffstat (limited to 'gcc/profile.c')
-rw-r--r-- | gcc/profile.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/profile.c b/gcc/profile.c index 93d79d0..318defd 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -569,10 +569,13 @@ compute_branch_probabilities (void) } } /* Otherwise try to preserve the existing REG_BR_PROB probabilities - tree based profile guessing put into code. */ + tree based profile guessing put into code. BB can be the + ENTRY_BLOCK, and it can have multiple (fake) successors in + EH cases, but it still has no code; don't crash in this case. */ else if (profile_status == PROFILE_ABSENT && !ir_type () && EDGE_COUNT (bb->succs) > 1 + && BB_END (bb) && (note = find_reg_note (BB_END (bb), REG_BR_PROB, 0))) { int prob = INTVAL (XEXP (note, 0)); |