public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/43597]  New: Move and compare with 0 can be combined
@ 2010-03-31  7:50 carrot at google dot com
  2010-03-31  7:51 ` [Bug target/43597] " carrot at google dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: carrot at google dot com @ 2010-03-31  7:50 UTC (permalink / raw)
  To: gcc-bugs

Compile the attached source code with options -Os -march=armv7-a -mthumb, gcc
generates:

foo4:
        push    {r3, r4, r5, lr}
        bl      bar
        cmp     r0, #0     // A
        mov     r5, r0     // B
        blt     .L3
        ...

Instructions AB can be merged into one instruction   "sub r5, r0, 0"

The rtx for instructions AB are:

(insn:TI 9 7 8 src/ta.c:8 (set (reg:CC 24 cc)
        (compare:CC (reg:SI 0 r0 [orig:134 f ] [134])
            (const_int 0 [0x0]))) 220 {*arm_cmpsi_insn} (expr_list:REG_DEAD
(reg:SI 0 r0 [orig:134 f ] [134])
        (nil)))

(insn 8 9 10 src/ta.c:7 (set (reg/v:SI 5 r5 [orig:134 f ] [134])
        (reg:SI 0 r0)) 658 {*thumb2_movsi_insn} (nil))

We have another insn pattern "*movsi_compare0" that can be used to represent
the combined operations. Should insns AB be combined automatically?


-- 
           Summary: Move and compare with 0 can be combined
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          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=43597


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

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

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-43597-4@http.gcc.gnu.org/bugzilla/>
2011-08-17 11:45 ` [Bug target/43597] Move and compare with 0 can be combined vries at gcc dot gnu.org
2011-08-17 13:05 ` vries at gcc dot gnu.org
2010-03-31  7:50 [Bug target/43597] New: " carrot at google dot com
2010-03-31  7:51 ` [Bug target/43597] " carrot at google dot com
2010-03-31  9:01 ` steven at gcc dot gnu dot org
2010-03-31  9:08 ` ramana at gcc dot gnu dot org
2010-03-31 14:59 ` steven at gcc dot gnu dot org
2010-03-31 15:16 ` steven at gcc dot gnu dot org
2010-03-31 22:50 ` steven at gcc dot gnu dot org
2010-03-31 22:51 ` steven at gcc dot gnu dot org
2010-04-17 17:15 ` rearnsha at gcc dot gnu dot org
2010-04-22 12:26 ` carrot at google dot com

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).