public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/6883] Fails to optimize temporary objects.
       [not found] <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de>
@ 2003-07-21  2:45 ` pinskia at physics dot uc dot edu
  2003-07-24  3:43 ` pinskia at physics dot uc dot edu
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-21  2:45 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


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

* [Bug optimization/6883] Fails to optimize temporary objects.
       [not found] <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de>
  2003-07-21  2:45 ` [Bug optimization/6883] Fails to optimize temporary objects pinskia at physics dot uc dot edu
@ 2003-07-24  3:43 ` pinskia at physics dot uc dot edu
  2003-11-05  7:38 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-24  3:43 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-24 03:43 -------
Related to bug 6880.


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

* [Bug optimization/6883] Fails to optimize temporary objects.
       [not found] <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de>
  2003-07-21  2:45 ` [Bug optimization/6883] Fails to optimize temporary objects pinskia at physics dot uc dot edu
  2003-07-24  3:43 ` pinskia at physics dot uc dot edu
@ 2003-11-05  7:38 ` pinskia at gcc dot gnu dot org
  2003-12-01  4:03 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-05  7:38 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2003-08-03 19:20:35         |2003-11-05 07:38:30
               date|                            |
   Target Milestone|---                         |tree-ssa


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-05 07:38 -------
More for the tree-ssa branch might be able to fix.


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

* [Bug optimization/6883] Fails to optimize temporary objects.
       [not found] <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de>
                   ` (2 preceding siblings ...)
  2003-11-05  7:38 ` pinskia at gcc dot gnu dot org
@ 2003-12-01  4:03 ` pinskia at gcc dot gnu dot org
  2004-01-20 16:48 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-01  4:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-01 04:03 -------
SRA did not help here either.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2003-11-05 07:38:30         |2003-12-01 04:03:37
               date|                            |


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


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

* [Bug optimization/6883] Fails to optimize temporary objects.
       [not found] <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de>
                   ` (3 preceding siblings ...)
  2003-12-01  4:03 ` pinskia at gcc dot gnu dot org
@ 2004-01-20 16:48 ` pinskia at gcc dot gnu dot org
  2004-03-03  7:39 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-20 16:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-20 16:48 -------
Suspending as it now works on the tree-ssa right.

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


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


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

* [Bug optimization/6883] Fails to optimize temporary objects.
       [not found] <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de>
                   ` (4 preceding siblings ...)
  2004-01-20 16:48 ` pinskia at gcc dot gnu dot org
@ 2004-03-03  7:39 ` pinskia at gcc dot gnu dot org
  2004-03-03  7:42 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-03  7:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-03 07:39 -------
The problem with the storing on the stack is still fixed but there is a different issue which 
the tree-ssa should have fixed:
<L24>:;
  <D1819>_176 = 0;
  goto <bb 9> (<L26>);

  if (T.4_164 > T.6_165) goto <L24>; else goto <L25>;
<L25>:;
  <D1819>_175 = 1;

  # <D1819>_2 = PHI <1(8), 0(7)>;
<L26>:;
  T.31_166 = (bool)<D1819>_2;
  T.31_167 = T.31_166;
  if (T.31_166) goto <L15>; else goto <L27>;

Looks like the jump thread for some reason is not doing its job here.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu dot org
             Status|SUSPENDED                   |NEW
   Last reconfirmed|2003-12-01 04:03:37         |2004-03-03 07:39:34
               date|                            |


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


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

* [Bug optimization/6883] Fails to optimize temporary objects.
       [not found] <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de>
                   ` (5 preceding siblings ...)
  2004-03-03  7:39 ` pinskia at gcc dot gnu dot org
@ 2004-03-03  7:42 ` pinskia at gcc dot gnu dot org
  2004-03-03 10:07 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-03  7:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-03 07:42 -------
Stupid me copied and pasted the tree dump worng, it should have been:
  if (T.4_164 > T.6_165) goto <L24>; else goto <L25>;

<L24>:;
  <D1819>_176 = 0;
  goto <bb 9> (<L26>);

<L25>:;
  <D1819>_175 = 1;

  # <D1819>_2 = PHI <1(8), 0(7)>;
<L26>:;
  T.31_166 = (bool)<D1819>_2;
  T.31_167 = T.31_166;
  if (T.31_166) goto <L15>; else goto <L27>;

-- 


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


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

* [Bug optimization/6883] Fails to optimize temporary objects.
       [not found] <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de>
                   ` (6 preceding siblings ...)
  2004-03-03  7:42 ` pinskia at gcc dot gnu dot org
@ 2004-03-03 10:07 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-03-08  7:04 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-03-03 10:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-03-03 10:06 -------
Subject: Re:  Fails to optimize temporary objects.

On Wed, 3 Mar 2004, pinskia at gcc dot gnu dot org wrote:

>
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-03 07:42 -------
> Stupid me copied and pasted the tree dump worng, it should have been:
>   if (T.4_164 > T.6_165) goto <L24>; else goto <L25>;
>
> <L24>:;
>   <D1819>_176 = 0;
>   goto <bb 9> (<L26>);
>
> <L25>:;
>   <D1819>_175 = 1;
>
>   # <D1819>_2 = PHI <1(8), 0(7)>;
> <L26>:;
>   T.31_166 = (bool)<D1819>_2;
>   T.31_167 = T.31_166;
>   if (T.31_166) goto <L15>; else goto <L27>;

which results in:

        movl    $1, %ecx        #, i$m_i
        movl    $1081081856, 4(%eax)    #,
        jmp     .L2     #
        .p2align 4,,7
.L18:
        movl    %edx, %ecx      # T.1, i$m_i
.L2:
        leal    1(%ecx), %edx   #, T.1
        leal    0(,%ecx,8), %eax        #, tmp90
        cmpl    $254, %edx      #, T.1
        fldl    (%ebx,%edx,8)   #* <anonymous>
        faddl   -8(%ebx,%ecx,8) #
        fmull   (%esi,%eax)     #
        fstpl   (%edi,%eax)     #
        jle     .L18    #,

note that the loop optimizer is not noticing the second BIV it could
eliminate.  Also the first loop dump is not exactly helpful - not either
GIV is mentioned.  The second loop dump tells the loop optimizer is not
able to prove that the loop iterates constant times... possibly due to the
strange loop entry.

Still work to do ;)

Richard.


-- 


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


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

* [Bug optimization/6883] Fails to optimize temporary objects.
       [not found] <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de>
                   ` (7 preceding siblings ...)
  2004-03-03 10:07 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-03-08  7:04 ` pinskia at gcc dot gnu dot org
  2004-05-24  4:18 ` [Bug rtl-optimization/6883] " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-08  7:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-08 07:04 -------
I have a fix which converts what I gave into:
  if ((bool)(int)!(T.4 > T.6) goto <L0>; else goto <L14>;
which is better but there are still some stores to the stack (at least on powerpc-apple-darwin) but that is caused by the C++ front-end lowering things like &a[b] and such.

-- 


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


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

* [Bug rtl-optimization/6883] Fails to optimize temporary objects.
       [not found] <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de>
                   ` (8 preceding siblings ...)
  2004-03-08  7:04 ` pinskia at gcc dot gnu dot org
@ 2004-05-24  4:18 ` pinskia at gcc dot gnu dot org
  2004-09-14 13:23 ` [Bug tree-optimization/6883] " rguenth at tat dot physik dot uni-tuebingen dot de
  2004-09-14 13:59 ` giovannibajo at libero dot it
  11 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-24  4:18 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.5.0                       |---


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


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

* [Bug tree-optimization/6883] Fails to optimize temporary objects.
       [not found] <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de>
                   ` (9 preceding siblings ...)
  2004-05-24  4:18 ` [Bug rtl-optimization/6883] " pinskia at gcc dot gnu dot org
@ 2004-09-14 13:23 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2004-09-14 13:59 ` giovannibajo at libero dot it
  11 siblings, 0 replies; 12+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2004-09-14 13:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-09-14 13:23 -------
Mainline as of 4.0.0 20040914 now produces

.L13:
        movl    %esi, %ebx
        movl    %eax, %edx
        movl    %ecx, %esi
.L2:
        leal    1(%edx), %eax
        fldl    (%edi,%eax,8)
        cmpl    $255, %eax
        faddl   -8(%edi,%edx,8)
        movl    -16(%ebp), %edx
        leal    8(%esi), %ecx
        fmull   (%edx,%ebx)
        movl    -20(%ebp), %edx
        fstpl   (%edx,%ebx)
        jne     .L13

and

.L14:
        movl    %esi, %ebx
        movl    %edx, %esi
.L5:
        movl    %ecx, %eax
        incl    %ecx
        movl    -16(%ebp), %edx
        fldl    -8(%edi,%ecx,8)
        cmpl    $255, %eax
        faddl   -24(%edi,%ecx,8)
        fmull   (%edx,%ebx)
        movl    -20(%ebp), %edx
        fstpl   (%edx,%ebx)
        leal    8(%esi), %edx
        jne     .L14

which looks nearly identical.  The optimized tree dump is

  pretmp.28 = (unsigned int) 1;
  pretmp.32 = (double *) (pretmp.28 * 8);
  prephitmp.33 = pretmp.32;
  D.1760 = 1;
  ivtmp.70 = 16B;

<L0>:;
  D.1981 = (<unnamed type>) D.1760;
  D.1991 = D.1981 + 1;
  it$m_i = (int) D.1991;
  *(D.1740 + prephitmp.33) = (*(D.1745 + (double *) D.1981 * 8B - 8B) + *(D.1745
+ (double *) (<unnamed type>) it$m_i * 8B)) * *(D.1750 + prephitmp.33);
  ivtmp.61 = ivtmp.70 + 8B;
  if (D.1991 != 255) goto <L38>; else goto <L37>;

<L38>:;
  D.1760 = it$m_i;
  prephitmp.33 = ivtmp.70;
  ivtmp.70 = ivtmp.61;
  goto <bb 1> (<L0>);

and

<L37>:;
  prephitmp.39 = pretmp.32;
  D.1828 = 1;
  ivtmp.69 = 16B;

<L15>:;
  D.1956 = (<unnamed type>) D.1828;
  D.1966 = D.1956 + 1;
  D.1828 = (int) D.1966;
  *(D.1740 + prephitmp.39) = (*(D.1745 + (double *) D.1956 * 8B - 8B) + *(D.1745
+ (double *) (<unnamed type>) D.1828 * 8B)) * *(D.1750 + prephitmp.39);
  ivtmp.46 = ivtmp.69 + 8B;
  if (D.1966 != 255) goto <L39>; else goto <L27>;

<L39>:;
  prephitmp.39 = ivtmp.69;
  ivtmp.69 = ivtmp.46;
  goto <bb 2> (<L15>);

where apart from the unnecessary store to D.1760 sra did its work.  Nice.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |4.0.0
         Resolution|                            |FIXED


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


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

* [Bug tree-optimization/6883] Fails to optimize temporary objects.
       [not found] <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de>
                   ` (10 preceding siblings ...)
  2004-09-14 13:23 ` [Bug tree-optimization/6883] " rguenth at tat dot physik dot uni-tuebingen dot de
@ 2004-09-14 13:59 ` giovannibajo at libero dot it
  11 siblings, 0 replies; 12+ messages in thread
From: giovannibajo at libero dot it @ 2004-09-14 13:59 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.0


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


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

end of thread, other threads:[~2004-09-14 13:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de>
2003-07-21  2:45 ` [Bug optimization/6883] Fails to optimize temporary objects pinskia at physics dot uc dot edu
2003-07-24  3:43 ` pinskia at physics dot uc dot edu
2003-11-05  7:38 ` pinskia at gcc dot gnu dot org
2003-12-01  4:03 ` pinskia at gcc dot gnu dot org
2004-01-20 16:48 ` pinskia at gcc dot gnu dot org
2004-03-03  7:39 ` pinskia at gcc dot gnu dot org
2004-03-03  7:42 ` pinskia at gcc dot gnu dot org
2004-03-03 10:07 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-03-08  7:04 ` pinskia at gcc dot gnu dot org
2004-05-24  4:18 ` [Bug rtl-optimization/6883] " pinskia at gcc dot gnu dot org
2004-09-14 13:23 ` [Bug tree-optimization/6883] " rguenth at tat dot physik dot uni-tuebingen dot de
2004-09-14 13:59 ` giovannibajo at libero dot it

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).