summaryrefslogtreecommitdiff
path: root/gcc/config/bfin
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-23 15:52:27 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-23 15:52:27 +0000
commitee445de834169dc5b14651db7148287d38e8b546 (patch)
treee0197c48e3af8eaef9decd7bca09bb2ae9c93539 /gcc/config/bfin
parentbb6c19c890cbfe3ee51988189b41e7a600c9aea7 (diff)
downloadgcc-ee445de834169dc5b14651db7148287d38e8b546.tar.gz
* config/bfin/bfin.md (doloop_end): Fail for loops that can iterate
2^32-1 or more times unless flag_unsafe_loop_optimizations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122262 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/bfin')
-rw-r--r--gcc/config/bfin/bfin.md11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/config/bfin/bfin.md b/gcc/config/bfin/bfin.md
index 8c088f93caf..63a651a5035 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)