public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/37451]  New: Extra addition for doloop in some cases
@ 2008-09-09 22:04 pinskia at gcc dot gnu dot org
  2008-09-09 22:05 ` [Bug rtl-optimization/37451] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-09-09 22:04 UTC (permalink / raw)
  To: gcc-bugs

Simple testcase:
/* { dg-do compile } */
/* { dg-options "-O2" } */

int f(int l, int *a)
{
  int i;
  for(i = 0;i < l; i++)
    a[i] = i;
  return l;
}

/* We should be able to do this loop without adding -1 to the l
   to get the number of iterations with this loop still doing a do-loop. */
/* The place where we were getting an extra -1 is when converting from 32bits
   to 64bits as the ctr register is used as 64bits on powerpc64. */
/* { dg-final { scan-assembler-not "-1" } } */
/* { dg-final { scan-assembler "bdnz" } } */
/* { dg-final { scan-assembler-times "mtctr" 1 } } */

---- CUT ---
The issue is that we zero extend before correcting the count of the iterations.


-- 
           Summary: Extra addition for doloop in some cases
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc64-*-*


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


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

end of thread, other threads:[~2020-05-15  3:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-37451-4@http.gcc.gnu.org/bugzilla/>
2011-12-02 16:55 ` [Bug rtl-optimization/37451] Extra addition for doloop in some cases jsm28 at gcc dot gnu.org
2012-01-10 16:56 ` jsm28 at gcc dot gnu.org
2012-01-10 23:54 ` jsm28 at gcc dot gnu.org
2020-05-15  3:27 ` cvs-commit at gcc dot gnu.org
2020-05-15  3:31 ` luoxhu at gcc dot gnu.org
2020-05-15  3:49 ` luoxhu at gcc dot gnu.org
2008-09-09 22:04 [Bug rtl-optimization/37451] New: " pinskia at gcc dot gnu dot org
2008-09-09 22:05 ` [Bug rtl-optimization/37451] " pinskia at gcc dot gnu dot org
2008-09-15  1:16 ` pinskia at gcc dot gnu dot org
2008-09-18 19:31 ` pinskia at gcc dot gnu dot org
2008-09-18 19:31 ` pinskia at gcc dot gnu dot org
2008-09-29 14:53 ` schwab at suse dot de
2009-04-16 15:48 ` 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).