public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/17019] New: THUMB -O1: bad code generated for simple for loop
@ 2004-08-13 16:42 danfuzz at milk dot com
  2004-08-13 16:43 ` [Bug target/17019] " danfuzz at milk dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: danfuzz at milk dot com @ 2004-08-13 16:42 UTC (permalink / raw)
  To: gcc-bugs

Compiling the following with -O1 for thumb results in bogus code being generated:

    void badness(int a)
    {
        void zorch(int b);
        int b;

        for (b = -1; b < a + 1; b++) {
            zorch(b);
        }
    }

In particular, it looks like the loop prologue code is screwed up and will cause the loop to always be 
skipped.

Here's how I configured and built the compiler:

$ tar -xjvf gcc-core-3.4.0.tar.bz2
$ cd gcc-3.4.0
$ ./configure --prefix=/usr/local/armdev --target=arm-elf --with-newlib --enable-languages=c

The following lines were uncommented in gcc/config/arm/t-arm-elf:

MULTILIB_OPTIONS    += mno-thumb-interwork/mthumb-interwork
MULTILIB_DIRNAMES   += normal interwork
MULTILIB_EXCEPTIONS += *mapcs-26/*mthumb-interwork*

$ make
$ sudo make install

In case it matters, I'm currently using binutils-2.15.

I will try this with 3.4.1 shortly.

-- 
           Summary: THUMB -O1: bad code generated for simple for loop
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: danfuzz at milk dot com
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: arm-unknown-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17019


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2004-08-17 11:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-13 16:42 [Bug target/17019] New: THUMB -O1: bad code generated for simple for loop danfuzz at milk dot com
2004-08-13 16:43 ` [Bug target/17019] " danfuzz at milk dot com
2004-08-13 16:45 ` danfuzz at milk dot com
2004-08-13 17:18 ` danfuzz at milk dot com
2004-08-13 17:23 ` danfuzz at milk dot com
2004-08-13 17:54 ` danfuzz at milk dot com
2004-08-13 20:07 ` danfuzz at milk dot com
2004-08-13 20:11 ` danfuzz at milk dot com
2004-08-13 21:23 ` danfuzz at milk dot com
2004-08-13 21:34 ` [Bug target/17019] THUMB: bad switch statement in md code for addsi3_cbranch_scratch danfuzz at milk dot com
2004-08-13 21:36 ` danfuzz at milk dot com
2004-08-16 14:53 ` rearnsha at gcc dot gnu dot org
2004-08-17 10:02 ` cvs-commit at gcc dot gnu dot org
2004-08-17 10:18 ` cvs-commit at gcc dot gnu dot org
2004-08-17 11:32 ` cvs-commit at gcc dot gnu dot org
2004-08-17 11:33 ` rearnsha at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).