public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/19703] New: Poor optimisation of loop test
@ 2005-01-30  2:59 andrewhutchinson at cox dot net
  2005-01-30  3:17 ` [Bug tree-optimization/19703] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: andrewhutchinson at cox dot net @ 2005-01-30  2:59 UTC (permalink / raw)
  To: gcc-bugs

Missed optimization

gcc version 4.0.0 20041205 (experimental)
4.0.0/cc1.exe -quiet -v looprv.c -quiet -dumpbase
looprv.c -mmcu=atmega169 -auxbase looprv -Os -Wall -version -funsigned-char
-funsigned-bitfields -fpack-struct -fshort-enums -o looprv.s

Down counting loop, uses expensive compare EQ (-n) instead of compare >=0.
Testcase as follows:

volatile char  value6;
extern void foo6(char);
void testloop6(void)
{
int i;
for (i=100;i>= 0;i-=10)
{
   if (!value6)
   {
       foo6(i);
   } 
}

Loop test in RTL is compare NE -10. It should be compare GE 0 - which
is(generally) free. First dump of Expanded RTL show the compare.

-- 
           Summary: Poor optimisation of loop test
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andrewhutchinson at cox dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-11-04 15:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-30  2:59 [Bug c/19703] New: Poor optimisation of loop test andrewhutchinson at cox dot net
2005-01-30  3:17 ` [Bug tree-optimization/19703] " pinskia at gcc dot gnu dot org
2005-01-30  3:17 ` pinskia at gcc dot gnu dot org
2005-01-30  4:58 ` andrewhutchinson at cox dot net
2005-01-30  5:25 ` [Bug tree-optimization/19703] [4.0 Regression] Poor optimisation of loop test, DOM causing unsigned to int and missing combine compares pinskia at gcc dot gnu dot org
2005-01-30 19:20 ` pinskia at gcc dot gnu dot org
2005-02-10 23:46 ` pinskia at gcc dot gnu dot org
2005-04-21  5:05 ` [Bug tree-optimization/19703] [4.0/4.1 " mmitchel at gcc dot gnu dot org
2005-06-26 18:03 ` pinskia at gcc dot gnu dot org
2005-07-08  1:43 ` mmitchel at gcc dot gnu dot org
2005-08-17 12:43 ` [Bug tree-optimization/19703] [4.0 " pinskia at gcc dot gnu dot org
2005-09-27 16:12 ` mmitchel at gcc dot gnu dot org
     [not found] <bug-19703-7648@http.gcc.gnu.org/bugzilla/>
2005-11-04 15:36 ` pinskia 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).