This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/6883] Fails to optimize temporary objects.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]