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; 7+ 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] 7+ messages in thread

* [Bug rtl-optimization/37451] Extra addition for doloop in some cases
  2008-09-09 22:04 [Bug rtl-optimization/37451] New: Extra addition for doloop in some cases pinskia at gcc dot gnu dot org
@ 2008-09-09 22:05 ` pinskia at gcc dot gnu dot org
  2008-09-15  1:16 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-09-09 22:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-09-09 22:03 -------
I have a fix which I will try to submit for 4.5, I will attach it soon.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-09-09 22:03:49
               date|                            |


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


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

* [Bug rtl-optimization/37451] Extra addition for doloop in some cases
  2008-09-09 22:04 [Bug rtl-optimization/37451] New: Extra addition for doloop in some cases 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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-09-15  1:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-09-15 01:15 -------
Hmm, I posted a patch which fixes some of this but we still don't get rid of
the extra zero extend because of the way variables are promoted. Boo.


-- 


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


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

* [Bug rtl-optimization/37451] Extra addition for doloop in some cases
  2008-09-09 22:04 [Bug rtl-optimization/37451] New: Extra addition for doloop in some cases pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-09-18 19:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2008-09-18 19:30 -------
Subject: Bug 37451

Author: pinskia
Date: Thu Sep 18 19:28:48 2008
New Revision: 140470

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140470
Log:
2008-09-18  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR rtl-opt/37451
        * loop-doloop.c (doloop_modify): New argument zero_extend_p and
        zero extend count after the correction to it is done.
        (doloop_optimize): Update call to doloop_modify, don't zero extend
        count before call.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/loop-doloop.c


-- 


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


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

* [Bug rtl-optimization/37451] Extra addition for doloop in some cases
  2008-09-09 22:04 [Bug rtl-optimization/37451] New: Extra addition for doloop in some cases 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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-09-18 19:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2008-09-18 19:30 -------
This is still not fully fixed.  There is still an issue dealing the DECL_RTX's
being promoted early on.


-- 


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


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

* [Bug rtl-optimization/37451] Extra addition for doloop in some cases
  2008-09-09 22:04 [Bug rtl-optimization/37451] New: Extra addition for doloop in some cases pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: schwab at suse dot de @ 2008-09-29 14:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from schwab at suse dot de  2008-09-29 14:52 -------
This is causing miscompilation of the stage2 ada compiler.

fatal error: system.ads is incorrectly formatted
unrecognized or incorrect restrictions pragma: No_Implicit_Dynamic_Code
compilation abandoned
make[3]: *** [ada/ada.o] Error 1


-- 


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


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

* [Bug rtl-optimization/37451] Extra addition for doloop in some cases
  2008-09-09 22:04 [Bug rtl-optimization/37451] New: Extra addition for doloop in some cases pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-09-29 14:53 ` schwab at suse dot de
@ 2009-04-16 15:48 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-16 15:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2009-04-16 15:48 -------
I am no longer working on this one.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|pinskia at gcc dot gnu dot  |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW


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


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

end of thread, other threads:[~2009-04-16 15:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-09 22:04 [Bug rtl-optimization/37451] New: Extra addition for doloop in some cases 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).