public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/15513] New: loop peeling failed
@ 2004-05-18 22:16 kunert at physik dot tu-dresden dot de
  2004-05-18 22:49 ` [Bug rtl-optimization/15513] loop peeling failed becuase of non-constant start pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: kunert at physik dot tu-dresden dot de @ 2004-05-18 22:16 UTC (permalink / raw)
  To: gcc-bugs

The code:

double ff( double* x )
{
    double a=0;
    for( int p = 0; p < 2; ++p ) for( int q = p; q < 2; ++q ) a += x[q];
    return a;
}

compiled with
/opt/gcc34/bin/g++ -save-temps -O3 -c xtest.cc -fpeel-loops

results in assembler code that still contains the loops, instead of the obvious
straightforward code.

Regards,
Thomas Kunert

        .file   "xtest.cc"
        .text
        .align 2
        .p2align 4,,15
.globl _Z2ffPd
        .type   _Z2ffPd, @function
_Z2ffPd:
.LFB2:
        pushl   %ebp
.LCFI0:
        fldz
        movl    %esp, %ebp
.LCFI1:
        movl    8(%ebp), %ecx
        xorl    %edx, %edx
.L9:
        cmpl    $1, %edx
        movl    %edx, %eax
        jle     .L14
.L13:
        incl    %edx
        cmpl    $1, %edx
        jle     .L9
        popl    %ebp
        ret
        .p2align 4,,7
.L14:
        faddl   (%ecx,%eax,8)
        incl    %eax
        cmpl    $1, %eax
        jg      .L13
        faddl   (%ecx,%eax,8)
        incl    %eax
        cmpl    $1, %eax
        jle     .L14
        jmp     .L13
.LFE2:
        .size   _Z2ffPd, .-_Z2ffPd
        .section        .note.GNU-stack,"",@progbits
        .ident  "GCC: (GNU) 3.4.0"

[kunert@ptpp80 dymol]$ /opt/gcc34/bin/g++ -v
Reading specs from /opt/gcc34/lib/gcc/i686-pc-linux-gnu/3.4.0/specs
Configured with: ../configure --enable-shared --disable-checking
--with-arch=pentiumpro --prefix=/opt/gcc34 --enable-__cxa_atexit
--enable-languages=c,c++
Thread model: posix
gcc version 3.4.0

-- 
           Summary: loop peeling failed
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kunert at physik dot tu-dresden dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug rtl-optimization/15513] loop peeling failed becuase of non-constant start
  2004-05-18 22:16 [Bug middle-end/15513] New: loop peeling failed kunert at physik dot tu-dresden dot de
@ 2004-05-18 22:49 ` pinskia at gcc dot gnu dot org
  2004-05-18 22:50 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-18 22:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-18 11:37 -------
Confirmed, but since the inner loop does not constant start, it is not peeled or unrolled.

This is very simular to bug 10624.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |10624
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
          Component|middle-end                  |rtl-optimization
     Ever Confirmed|                            |1
           Keywords|                            |missed-optimization
   Last reconfirmed|0000-00-00 00:00:00         |2004-05-18 11:37:53
               date|                            |
            Summary|loop peeling failed         |loop peeling failed becuase
                   |                            |of non-constant start


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


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

* [Bug rtl-optimization/15513] loop peeling failed becuase of non-constant start
  2004-05-18 22:16 [Bug middle-end/15513] New: loop peeling failed kunert at physik dot tu-dresden dot de
  2004-05-18 22:49 ` [Bug rtl-optimization/15513] loop peeling failed becuase of non-constant start pinskia at gcc dot gnu dot org
@ 2004-05-18 22:50 ` pinskia at gcc dot gnu dot org
  2004-08-20 17:14 ` pinskia at gcc dot gnu dot org
  2005-05-12 17:36 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-18 22:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-18 11:38 -------
Suspending as PR 10624 is also suspended.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |SUSPENDED


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


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

* [Bug rtl-optimization/15513] loop peeling failed becuase of non-constant start
  2004-05-18 22:16 [Bug middle-end/15513] New: loop peeling failed kunert at physik dot tu-dresden dot de
  2004-05-18 22:49 ` [Bug rtl-optimization/15513] loop peeling failed becuase of non-constant start pinskia at gcc dot gnu dot org
  2004-05-18 22:50 ` pinskia at gcc dot gnu dot org
@ 2004-08-20 17:14 ` pinskia at gcc dot gnu dot org
  2005-05-12 17:36 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-20 17:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-20 17:14 -------
I should note that there is some hope about getting this fixed but I do not know how much.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2004-05-18 11:37:53         |2004-08-20 17:14:19
               date|                            |


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


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

* [Bug rtl-optimization/15513] loop peeling failed becuase of non-constant start
  2004-05-18 22:16 [Bug middle-end/15513] New: loop peeling failed kunert at physik dot tu-dresden dot de
                   ` (2 preceding siblings ...)
  2004-08-20 17:14 ` pinskia at gcc dot gnu dot org
@ 2005-05-12 17:36 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-12 17:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-12 17:36 -------
Actually this is a dup of bug 10624.

*** This bug has been marked as a duplicate of 10624 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2005-05-12 17:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-18 22:16 [Bug middle-end/15513] New: loop peeling failed kunert at physik dot tu-dresden dot de
2004-05-18 22:49 ` [Bug rtl-optimization/15513] loop peeling failed becuase of non-constant start pinskia at gcc dot gnu dot org
2004-05-18 22:50 ` pinskia at gcc dot gnu dot org
2004-08-20 17:14 ` pinskia at gcc dot gnu dot org
2005-05-12 17: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).