diff options
author | Bernd Schmidt <bernd.schmidt@analog.com> | 2007-02-23 15:52:27 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2007-02-23 15:52:27 +0000 |
commit | 0a8f8c4572b2f0cea7f56922122275d2ff76746c (patch) | |
tree | e0197c48e3af8eaef9decd7bca09bb2ae9c93539 | |
parent | 94217473a56f0000494125485f9ee67a5067d201 (diff) | |
download | gcc-0a8f8c4572b2f0cea7f56922122275d2ff76746c.zip gcc-0a8f8c4572b2f0cea7f56922122275d2ff76746c.tar.gz gcc-0a8f8c4572b2f0cea7f56922122275d2ff76746c.tar.bz2 |
bfin.md (doloop_end): Fail for loops that can iterate 2^32-1 or more times unless...
* config/bfin/bfin.md (doloop_end): Fail for loops that can iterate
2^32-1 or more times unless flag_unsafe_loop_optimizations.
From-SVN: r122262
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/bfin/bfin.md | 11 |
2 files changed, 15 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c0fcb11..fed1961 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-02-23 Bernd Schmidt <bernd.schmidt@analog.com> + + * config/bfin/bfin.md (doloop_end): Fail for loops that can iterate + 2^32-1 or more times unless flag_unsafe_loop_optimizations. + 2007-02-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * builtins.c (fold_builtin_logb, fold_builtin_significand): New. diff --git a/gcc/config/bfin/bfin.md b/gcc/config/bfin/bfin.md index 8c088f9..63a651a 100644 --- a/gcc/config/bfin/bfin.md +++ b/gcc/config/bfin/bfin.md @@ -1639,7 +1639,16 @@ (unspec [(const_int 0)] UNSPEC_LSETUP_END) (clobber (match_scratch:SI 5 ""))])] "" - {bfin_hardware_loop ();}) +{ + /* Due to limitations in the hardware (an initial loop count of 0 + does not loop 2^32 times) we must avoid to generate a hardware + loops when we cannot rule out this case. */ + + if (!flag_unsafe_loop_optimizations + && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) >= 0xFFFFFFFF) + FAIL; + bfin_hardware_loop (); +}) (define_insn "loop_end" [(set (pc) |