public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/41117]  New: spurious _gfortran_internal_pack (II)
@ 2009-08-19 10:10 jv244 at cam dot ac dot uk
  2009-08-19 13:36 ` [Bug fortran/41117] " burnus at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-08-19 10:10 UTC (permalink / raw)
  To: gcc-bugs

Another case of a spurious pack (which really affects performance
unfortunately). 

> cat test.f90
MODULE M1
CONTAINS
 SUBROUTINE S1(data)
   REAL, DIMENSION(*) :: data
 END SUBROUTINE S1
END MODULE

SUBROUTINE S2
 REAL :: data(10,10)
 DO i=1,10
    CALL S1(data(:,i))
 ENDDO
 DO i=1,10
    CALL S1(data(1,i))
 ENDDO
END SUBROUTINE S2

> cat test.f90.003t.original
s1 (real(kind=4)[0:] * data)
{
  (void) 0;
}


s2 ()
{
  real(kind=4) data[100];
  integer(kind=4) i;

  i = 1;
  if (i <= 10)
    {
      while (1)
        {
          {
            logical(kind=4) D.1557;

            {
              void * D.1554;
              struct array1_real(kind=4) parm.0;
              integer(kind=8) D.1543;

              D.1543 = (integer(kind=8)) i;
              parm.0.dtype = 281;
              parm.0.dim[0].lbound = 1;
              parm.0.dim[0].ubound = 10;
              parm.0.dim[0].stride = 1;
              parm.0.data = (void *) &data[(D.1543 + -1) * 10];
              parm.0.offset = -11;
              D.1554 = _gfortran_internal_pack (&parm.0);
              s1 (D.1554);
              if ((real(kind=4)[0:] *) parm.0.data != (real(kind=4)[0:] *)
D.1554)
                {
                  _gfortran_internal_unpack (&parm.0, D.1554);
                  {
                    void * D.1555;

                    D.1555 = D.1554;
                    if (D.1555 != 0B)
                      {
                        __builtin_free (D.1555);
                      }
                  }
                }
            }
            L.1:;
            D.1557 = i == 10;
            i = i + 1;
            if (D.1557) goto L.2;
          }
        }
    }
  L.2:;
  i = 1;
  if (i <= 10)
    {
      while (1)
        {
          {
            logical(kind=4) D.1560;

            s1 (&data[((integer(kind=8)) i + -1) * 10]);
            L.3:;
            D.1560 = i == 10;
            i = i + 1;
            if (D.1560) goto L.4;
          }
        }
    }
  L.4:;
}


-- 
           Summary: spurious _gfortran_internal_pack (II)
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


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


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

end of thread, other threads:[~2010-02-22  5:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-19 10:10 [Bug fortran/41117] New: spurious _gfortran_internal_pack (II) jv244 at cam dot ac dot uk
2009-08-19 13:36 ` [Bug fortran/41117] " burnus at gcc dot gnu dot org
2010-02-10  9:05 ` jv244 at cam dot ac dot uk
2010-02-13 12:43 ` pault at gcc dot gnu dot org
2010-02-20 21:51 ` burnus at gcc dot gnu dot org
2010-02-22  5:45 ` pault 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).