From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12487 invoked by alias); 26 Mar 2011 17:15:41 -0000 Received: (qmail 12473 invoked by uid 22791); 26 Mar 2011 17:15:39 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,LOTS_OF_MONEY,TW_BG,TW_CB,TW_PN X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 26 Mar 2011 17:15:34 +0000 From: "steven at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/47855] missed cbnz optimization X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: steven at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Target Status Last reconfirmed Ever Confirmed Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Sat, 26 Mar 2011 17:54:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-03/txt/msg02772.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D47855 Steven Bosscher changed: What |Removed |Added ---------------------------------------------------------------------------- Target|arm-linux-androideabi |arm-* Status|UNCONFIRMED |NEW Last reconfirmed| |2011.03.26 17:15:33 Ever Confirmed|0 |1 --- Comment #3 from Steven Bosscher 2011-03-26 = 17:15:33 UTC --- Confirmed. Many of the lengths are wrong, even for simple instructions. $ arm-eabi-gcc -c -Os -march=3Darmv7-a -mthumb -dAp -Wa,-ahlms=3Dt.lst t.c $ cat t.lst ARM GAS /tmp/ccLnp6gX.s page 1 1 .syntax unified 2 .arch armv7-a 3 .eabi_attribute 27, 3 4 .fpu neon 5 .eabi_attribute 20, 1 6 .eabi_attribute 21, 1 7 .eabi_attribute 23, 3 8 .eabi_attribute 24, 1 9 .eabi_attribute 25, 1 10 .eabi_attribute 26, 1 11 .eabi_attribute 30, 4 12 .eabi_attribute 18, 4 13 .file "t.c" 14 .text 15 .align 1 16 .global pnm_gethdr 17 .thumb 18 .thumb_func 19 .type pnm_gethdr, %function 20 pnm_gethdr: 21 @ args =3D 0, pretend =3D 0, frame =3D 8 22 @ frame_needed =3D 0, uses_anonymous_args =3D 0 23 @ basic block 2 24 0000 37B5 push {r0, r1, r2, r4, r5, lr} @ 173=20=20= =20 *push_multi [length =3D 4] 25 0002 0546 mov r5, r0 @ 2 *thumb2_movsi_vfp/1=20= =20=20 [length =3D 4] 26 0004 0C46 mov r4, r1 @ 3 *thumb2_movsi_vfp/1=20= =20=20 [length =3D 4] 27 0006 FFF7FEFF bl foo2 @ 15 *call_value_symbol [len= gth =3D 4] 28 000a 0028 cmp r0, #0 @ 18 *thumb2_cbnz/1 [leng= th =3D 8] 29 000c 33D1 bne .L13 30 @ basic block 3 31 000e 211D adds r1, r4, #4 @ 199 *thumb2_addsi_sho= rt/1 [length =3D 2] 32 0010 2846 mov r0, r5 @ 21 *thumb2_movsi_vfp/1=20= =20=20 [length =3D 4] 33 0012 FFF7FEFF bl foo3 @ 23 *call_value_symbol [len= gth =3D 4] 34 0016 0028 cmp r0, #0 @ 26 *thumb2_cbnz/1 [leng= th =3D 8] 35 0018 2DD1 bne .L13 36 @ basic block 4 37 001a 04F10801 add r1, r4, #8 @ 28 *arm_addsi3/1=20=20= =20 [length =3D 4] 38 001e 2846 mov r0, r5 @ 29 *thumb2_movsi_vfp/1=20= =20=20 [length =3D 4] 39 0020 FFF7FEFF bl foo1 @ 31 *call_value_symbol [len= gth =3D 4] 40 0024 38BB cbnz r0, .L13 @ 34 *thumb2_cbnz/1=20=20= =20 [length =3D 2] 41 @ basic block 5 42 0026 2068 ldr r0, [r4, #0] @ 36 *thumb2_movsi_vfp= /5=20=20 [length =3D 4] 43 0028 FFF7FEFF bl pnm_type @ 37 *call_value_symbol=20= =20=20 [length =3D 4] 44 002c 0228 cmp r0, #2 @ 39 *arm_cmpsi_insn/1=20=20= =20 [length =3D 4] 45 002e 05D0 beq .L3 @ 40 *arm_cond_branch [lengt= h =3D 4] 46 @ basic block 6 47 0030 2846 mov r0, r5 @ 43 *thumb2_movsi_vfp/1=20= =20=20 [length =3D 4] 48 0032 01A9 add r1, sp, #4 @ 44 *arm_addsi3/1=20=20= =20 [length =3D 4] 49 0034 FFF7FEFF bl pnm_getsintstr @ 45 *call_value_symb= ol=20=20 [length =3D 4] 50 0038 10B1 cbz r0, .L4 @ 48 *thumb2_cbz/1 [leng= th =3D 2] 51 @ basic block 7 52 003a 1CE0 b .L13 @ 201 *arm_jump [length =3D 4] 53 .L3: 54 @ basic block 8 55 003c 0123 movs r3, #1 @ 198 *thumb2_movsi_shortim= =20=20=20 [length =3D 2] 56 003e 0193 str r3, [sp, #4] @ 55 *thumb2_movsi_vfp= /7=20=20 [length =3D 4] 57 .L4: =0CARM GAS /tmp/ccLnp6gX.s page 2 58 @ basic block 9 59 0040 019B ldr r3, [sp, #4] @ 58 *thumb2_movsi_vfp= /5=20=20 [length =3D 4] 60 0042 002B cmp r3, #0 @ 59 *arm_cmpsi_insn/1=20=20= =20 [length =3D 4] 61 0044 03DA bge .L5 @ 60 *arm_cond_branch [lengt= h =3D 4] 62 @ basic block 10 63 0046 5B42 negs r3, r3 @ 196 *thumb2_negsi2_short= =20=20=20 [length =3D 2] 64 0048 2361 str r3, [r4, #16] @ 63 *thumb2_movsi_vf= p/7=20 [length =3D 4] 65 004a 0123 movs r3, #1 @ 197 *thumb2_movsi_shortim= =20=20=20 [length =3D 2] 66 004c 01E0 b .L14 @ 203 *arm_jump [length =3D 4] 67 .L5: 68 @ basic block 11 69 004e 2361 str r3, [r4, #16] @ 71 *thumb2_movsi_vf= p/7=20 [length =3D 4] 70 0050 0023 movs r3, #0 @ 195 *thumb2_movsi_shortim= =20=20=20 [length =3D 2] 71 .L14: 72 @ basic block 12 73 0052 2375 strb r3, [r4, #20] @ 74 *arm_movqi_insn= /4=20=20 [length =3D 4] 74 0054 2068 ldr r0, [r4, #0] @ 77 *thumb2_movsi_vfp= /5=20=20 [length =3D 4] 75 0056 FFF7FEFF bl pnm_type @ 78 *call_value_symbol=20= =20=20 [length =3D 4] 76 005a 0028 cmp r0, #0 @ 80 *arm_cmpsi_insn/1=20=20= =20 [length =3D 4] 77 005c 06D0 beq .L8 @ 81 *arm_cond_branch [lengt= h =3D 4] 78 @ basic block 13 79 005e 08DB blt .L7 @ 83 *arm_cond_branch [lengt= h =3D 4] 80 @ basic block 14 81 0060 0228 cmp r0, #2 @ 84 *arm_cmpsi_insn/1=20=20= =20 [length =3D 4] 82 0062 06DC bgt .L7 @ 85 *arm_cond_branch [lengt= h =3D 4] 83 @ basic block 15 84 0064 0123 movs r3, #1 @ 193 *thumb2_movsi_shortim= =20=20=20 [length =3D 2] 85 0066 0020 movs r0, #0 @ 194 *thumb2_movsi_shortim= =20=20=20 [length =3D 2] 86 0068 E360 str r3, [r4, #12] @ 93 *thumb2_movsi_vf= p/7=20 [length =3D 4] 87 006a 06E0 b .L2 @ 205 *arm_jump [length =3D 4] 88 .L8: 89 @ basic block 16 90 006c 0323 movs r3, #3 @ 192 *thumb2_movsi_shortim= =20=20=20 [length =3D 2] 91 006e E360 str r3, [r4, #12] @ 99 *thumb2_movsi_vf= p/7=20 [length =3D 4] 92 0070 03E0 b .L2 @ 207 *arm_jump [length =3D 4] 93 .L7: 94 @ basic block 17 95 0072 FFF7FEFF bl abort @ 104 *call_symbol [length = =3D 4] 96 .L13: 97 @ basic block 18 98 0076 4FF0FF30 mov r0, #-1 @ 6 *thumb2_movsi_vfp/2=20= =20=20 [length =3D 4] 99 .L2: 100 @ basic block 19 101 007a 3EBD pop {r1, r2, r3, r4, r5, pc} 102 .size pnm_gethdr, .-pnm_gethdr 103 .ident "GCC: (GNU) 4.7.0 20110326 (experimenta= l) [trunk revision 171556]" =0CARM GAS /tmp/ccLnp6gX.s page 3 DEFINED SYMBOLS *ABS*:0000000000000000 t.c /tmp/ccLnp6gX.s:20 .text:0000000000000000 pnm_gethdr /tmp/ccLnp6gX.s:24 .text:0000000000000000 $t UNDEFINED SYMBOLS foo2 foo3 foo1 pnm_type pnm_getsintstr abort