public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "henning dot m at insightbb dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/33970] Missed optimization using unsigned char loop variable
Date: Thu, 01 Nov 2007 21:26:00 -0000	[thread overview]
Message-ID: <20071101212618.12813.qmail@sourceware.org> (raw)
In-Reply-To: <bug-33970-15294@http.gcc.gnu.org/bugzilla/>



------- Comment #6 from henning dot m at insightbb dot com  2007-11-01 21:26 -------
(In reply to comment #5)
> Mike, can you provide additional information as to where the bug is?
> 
This is the assembly output I get:

Note that r14,r15 is being reserved for variable x when only a single reg is
needed. Strange enough if call sub2 with (x+1) then only one reg is used and
the code decreases by 12 bytes.

000000e8 <main>:
  e8:   ef 92           push    r14
  ea:   ff 92           push    r15
  ec:   1f 93           push    r17
  ee:   cf 93           push    r28
  f0:   df 93           push    r29
  f2:   cd b7           in      r28, 0x3d       ; 61
  f4:   de b7           in      r29, 0x3e       ; 62
  f6:   21 97           sbiw    r28, 0x01       ; 1
  f8:   0f b6           in      r0, 0x3f        ; 63
  fa:   f8 94           cli
  fc:   de bf           out     0x3e, r29       ; 62
  fe:   0f be           out     0x3f, r0        ; 63
 100:   cd bf           out     0x3d, r28       ; 61
 102:   ee 24           eor     r14, r14
 104:   ff 24           eor     r15, r15
 106:   19 81           ldd     r17, Y+1        ; 0x01
 108:   8e 2d           mov     r24, r14
 10a:   0e 94 57 00     call    0xae    ; 0xae <sub2>
 10e:   18 0f           add     r17, r24
 110:   19 83           std     Y+1, r17        ; 0x01
 112:   08 94           sec
 114:   e1 1c           adc     r14, r1
 116:   f1 1c           adc     r15, r1
 118:   80 e8           ldi     r24, 0x80       ; 128
 11a:   e8 16           cp      r14, r24
 11c:   f1 04           cpc     r15, r1
 11e:   99 f7           brne    .-26            ; 0x106 <main+0x1e>
 120:   f0 cf           rjmp    .-32            ; 0x102 <main+0x1a>

00000122 <_exit>:
 122:   ff cf           rjmp    .-2             ; 0x122 <_exit>


-- 


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


  parent reply	other threads:[~2007-11-01 21:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-01 13:44 [Bug c/33970] New: " henning dot m at insightbb dot com
2007-11-01 14:10 ` [Bug c/33970] " rguenth at gcc dot gnu dot org
2007-11-01 17:09 ` [Bug middle-end/33970] " pinskia at gcc dot gnu dot org
2007-11-01 17:28 ` eweddington at cso dot atmel dot com
2007-11-01 17:45 ` eweddington at cso dot atmel dot com
2007-11-01 17:47 ` eweddington at cso dot atmel dot com
2007-11-01 21:26 ` henning dot m at insightbb dot com [this message]
2007-11-04 23:28 ` eweddington at cso dot atmel dot com
2007-11-04 23:28 ` eweddington at cso dot atmel dot com
2007-11-05 22:48 ` wvangulik at xs4all dot nl
2007-11-06 12:37 ` henning dot m at insightbb dot com
2007-11-06 19:35 ` wvangulik at xs4all dot nl
2007-11-06 21:01 ` wvangulik at xs4all dot nl
2010-09-13 12:09 ` abnikant dot singh at atmel dot com
     [not found] <bug-33970-4@http.gcc.gnu.org/bugzilla/>
2011-07-20 17:48 ` gjl at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071101212618.12813.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).