This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/17019] THUMB -O1: bad code generated for simple for loop
- From: "danfuzz at milk dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Aug 2004 17:18:10 -0000
- Subject: [Bug target/17019] THUMB -O1: bad code generated for simple for loop
- References: <20040813164249.17019.danfuzz@milk.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From danfuzz at milk dot com 2004-08-13 17:18 -------
The bug still seems to happen with 3.4.1. For the record, here's the assemby code that I think is in
error:
badness:
push {r4, r5, lr}
mov r4, #1
neg r4, r4
// probably missing a test here
bmi .L7
That is, the code correctly initializes r4 to -1, but then always branches around the loop because the
branch condition is always true.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17019