diff options
author | Steven Bosscher <steven@gcc.gnu.org> | 2009-06-26 06:06:04 +0000 |
---|---|---|
committer | Steven Bosscher <steven@gcc.gnu.org> | 2009-06-26 06:06:04 +0000 |
commit | b3c54c8f55b487e77f1e2c881f30781cc784b1d8 (patch) | |
tree | 158847ecfbaeb40d35db538def492421cf2c123d /gcc | |
parent | f5e6686534eab43fb0b9e6807b9489958a12c74e (diff) | |
download | gcc-b3c54c8f55b487e77f1e2c881f30781cc784b1d8.zip gcc-b3c54c8f55b487e77f1e2c881f30781cc784b1d8.tar.gz gcc-b3c54c8f55b487e77f1e2c881f30781cc784b1d8.tar.bz2 |
re PR middle-end/40525 (if conversion (in dead_or_predicable) fails for targets with limited conditional execution support)
PR middle-end/40525
* ifcvt.c (dead_or_predicable): If predicating MERGE_BB fails,
try the non-cond_exec path also.
From-SVN: r148961
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ifcvt.c | 19 |
2 files changed, 19 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5702f67..c914f34 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-06-26 Steven Bosscher <steven@gcc.gnu.org> + + PR middle-end/40525 + * ifcvt.c (dead_or_predicable): If predicating MERGE_BB fails, + try the non-cond_exec path also. + 2009-06-25 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> PR target/40468 diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index fee72e7..c47dfab 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -3780,6 +3780,8 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb, basic_block other_bb, basic_block new_dest, int reversep) { rtx head, end, jump, earliest = NULL_RTX, old_dest, new_label = NULL_RTX; + /* Number of pending changes. */ + int n_validated_changes = 0; jump = BB_END (test_bb); @@ -3848,14 +3850,17 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb, prob_val = GEN_INT (REG_BR_PROB_BASE - INTVAL (prob_val)); } - if (! cond_exec_process_insns ((ce_if_block_t *)0, head, end, cond, - prob_val, 0)) - goto cancel; + if (cond_exec_process_insns (NULL, head, end, cond, prob_val, 0) + && verify_changes (0)) + n_validated_changes = num_validated_changes (); + else + cancel_changes (0); earliest = jump; } - else #endif + /* Try the NCE path if the CE path did not result in any changes. */ + if (n_validated_changes == 0) { /* In the non-conditional execution case, we have to verify that there are no trapping operations, no calls, no references to memory, and @@ -3995,8 +4000,10 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb, goto cancel; } - if (! apply_change_group ()) - return FALSE; + if (verify_changes (n_validated_changes)) + confirm_change_group (); + else + goto cancel; if (other_bb != new_dest) { |