public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/43920]  New: A lot of instructions for condition (start == -1 || end == -1)
@ 2010-04-28  8:18 carrot at google dot com
  2010-04-28  8:18 ` [Bug target/43920] " carrot at google dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: carrot at google dot com @ 2010-04-28  8:18 UTC (permalink / raw)
  To: gcc-bugs

Compile the attached source code with options -march=armv7-a -mthumb -Os, gcc
generates following instructions for "if (start == -1 || end == -1)":

        ...
        cmp     r4, #-1
        ite     ne
        movne   r3, #0
        moveq   r3, #1
        cmp     r0, #-1
        it      eq
        orreq   r3, r3, #1
        cbnz    r3, .L4
        ...

A simplified code sequence is:

        ...
        cmp r4, #-1
        bne .L4
        cmp r0, #-1
        bne .L4
        ...

The if statement is trivially translated into the following gimple statements:

  D.2530 = start == -1;
  D.2531 = end == -1;
  D.2532 = D.2530 || D.2531;
  if (D.2532 != 0) goto <D.2533>; else goto <D.2534>;

And then expanded into rtl insns without further optimizations.


-- 
           Summary: A lot of instructions for condition (start == -1 || end
                    == -1)
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: carrot at google dot com
 GCC build triplet: i686-linux
  GCC host triplet: i686-linux
GCC target triplet: arm-eabi


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


^ permalink raw reply	[flat|nested] 16+ messages in thread
[parent not found: <bug-43920-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2011-09-19  6:20 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-28  8:18 [Bug target/43920] New: A lot of instructions for condition (start == -1 || end == -1) carrot at google dot com
2010-04-28  8:18 ` [Bug target/43920] " carrot at google dot com
2010-04-28  9:01 ` carrot at google dot com
2010-04-28  9:55 ` [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases ramana at gcc dot gnu dot org
2010-04-29  2:24 ` carrot at google dot com
     [not found] <bug-43920-4@http.gcc.gnu.org/bugzilla/>
2011-04-05 10:05 ` vries at gcc dot gnu.org
2011-04-05 10:13 ` vries at gcc dot gnu.org
2011-04-05 10:34 ` vries at gcc dot gnu.org
2011-04-05 13:02 ` vries at gcc dot gnu.org
2011-04-06  9:41 ` ramana at gcc dot gnu.org
2011-04-07  8:10 ` vries at gcc dot gnu.org
2011-04-07  8:35 ` vries at gcc dot gnu.org
2011-04-07  9:28 ` vries at gcc dot gnu.org
2011-04-07  9:48 ` vries at gcc dot gnu.org
2011-07-11 16:38 ` vries at gcc dot gnu.org
2011-09-19  6:21 ` jye2 at gcc dot gnu.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).