public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/47267] New: array constructor causing long compile times
@ 2011-01-12 10:18 Joost.VandeVondele at pci dot uzh.ch
  2011-01-12 10:24 ` [Bug fortran/47267] " Joost.VandeVondele at pci dot uzh.ch
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Joost.VandeVondele at pci dot uzh.ch @ 2011-01-12 10:18 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: array constructor causing long compile times
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: Joost.VandeVondele@pci.uzh.ch


The following program needs about 40s to compile (-O0):

> cat test.f90
   IMPLICIT NONE
   INTEGER, PARAMETER :: wp=8
   INTEGER, PARAMETER :: Niter=30000000
   INTEGER, ALLOCATABLE, DIMENSION(:) :: perm1

   INTEGER :: i

   ALLOCATE(perm1(Niter))
   perm1=(/(i,i=1,Niter)/)
END

Time grows linearly with Niter.


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

* [Bug fortran/47267] array constructor causing long compile times
  2011-01-12 10:18 [Bug fortran/47267] New: array constructor causing long compile times Joost.VandeVondele at pci dot uzh.ch
@ 2011-01-12 10:24 ` Joost.VandeVondele at pci dot uzh.ch
  2011-01-12 14:11 ` burnus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Joost.VandeVondele at pci dot uzh.ch @ 2011-01-12 10:24 UTC (permalink / raw)
  To: gcc-bugs

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

Joost VandeVondele <Joost.VandeVondele at pci dot uzh.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |compile-time-hog
      Known to fail|                            |4.3.2, 4.6.0

--- Comment #1 from Joost VandeVondele <Joost.VandeVondele at pci dot uzh.ch> 2011-01-12 09:43:31 UTC ---
obviously removing the parameter attribute from niter makes compilation very
fast. Presumably something down this call tree should not simplify stuff for
too large constructors

#0  0x00007ffff6ca9ad9 in _int_malloc () from /lib64/libc.so.6
#1  0x00007ffff6cacaa9 in malloc () from /lib64/libc.so.6
#2  0x0000000000d9e9a9 in __gmp_default_allocate (size=8) at
../../gcc/gmp/memory.c:44
#3  0x0000000000da39f5 in __gmpz_init (x=0x14f4038) at
../../../gcc/gmp/mpz/init.c:28
#4  0x00000000004ebc39 in gfc_get_constant_expr (type=BT_INTEGER, kind=4,
where=0x136b920) at ../../gcc/gcc/fortran/expr.c:160
#5  0x00000000004ebd6b in gfc_get_int_expr (kind=<value optimized out>,
where=<value optimized out>, value=0) at ../../gcc/gcc/fortran/expr.c:215
#6  0x00000000004caf17 in gfc_simplify_iterator_var (e=0x14f3f00) at
../../gcc/gcc/fortran/array.c:1401
#7  0x00000000004f06a8 in gfc_simplify_expr (p=0x14f3f00, type=1) at
../../gcc/gcc/fortran/expr.c:1873
#8  0x00000000004c99a6 in expand_constructor (base=<value optimized out>) at
../../gcc/gcc/fortran/array.c:1540
#9  0x00000000004c9be9 in expand_expr (base=<value optimized out>) at
../../gcc/gcc/fortran/array.c:1416
#10 expand_expr (base=<value optimized out>) at
../../gcc/gcc/fortran/array.c:1515
#11 expand_iterator (base=<value optimized out>) at
../../gcc/gcc/fortran/array.c:1486
#12 expand_constructor (base=<value optimized out>) at
../../gcc/gcc/fortran/array.c:1524
#13 0x00000000004cb94d in gfc_array_size (array=0x14f4ad0,
result=0x7fffffffd830) at ../../gcc/gcc/fortran/array.c:2190
#14 0x00000000005311eb in expression_shape (e=0x14f4ad0) at
../../gcc/gcc/fortran/resolve.c:4812
#15 expression_rank (e=0x14f4ad0) at ../../gcc/gcc/fortran/resolve.c:4888
#16 0x0000000000538742 in gfc_resolve_expr (e=0x14f4ad0) at
../../gcc/gcc/fortran/resolve.c:6060
#17 0x000000000054176f in resolve_code (code=0x14f4b90, ns=0x14efed0) at
../../gcc/gcc/fortran/resolve.c:8928
#18 0x000000000054379f in resolve_codes (ns=0x14efed0) at
../../gcc/gcc/fortran/resolve.c:13478


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

* [Bug fortran/47267] array constructor causing long compile times
  2011-01-12 10:18 [Bug fortran/47267] New: array constructor causing long compile times Joost.VandeVondele at pci dot uzh.ch
  2011-01-12 10:24 ` [Bug fortran/47267] " Joost.VandeVondele at pci dot uzh.ch
@ 2011-01-12 14:11 ` burnus at gcc dot gnu.org
  2011-01-13 19:56 ` jvdelisle at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-01-12 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org,
                   |                            |dfranke at gcc dot gnu.org,
                   |                            |jvdelisle at gcc dot
                   |                            |gnu.org

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-12 13:51:43 UTC ---
You can use -fmax-array-constructor=<n> to tune this. However, I think
currently there is no distinction made between constructors which have to be be
run at compile time (a) and those which can be run at compile time (b).

<n> is currently 65535.


Example for (a): Parameter array or initialization expression

   INTEGER, PARAMETER :: Niter=30000000
   INTEGER, PARAMETER :: ARRAY(Niter) = (/(i,i=1,Niter)/)

Example for (b): Assignment to an array

   INTEGER, PARAMETER :: Niter=30000000
   INTEGER :: ARRAY(Niter)
   ARRAY(Niter) = (/(i,i=1,Niter)/)


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

* [Bug fortran/47267] array constructor causing long compile times
  2011-01-12 10:18 [Bug fortran/47267] New: array constructor causing long compile times Joost.VandeVondele at pci dot uzh.ch
  2011-01-12 10:24 ` [Bug fortran/47267] " Joost.VandeVondele at pci dot uzh.ch
  2011-01-12 14:11 ` burnus at gcc dot gnu.org
@ 2011-01-13 19:56 ` jvdelisle at gcc dot gnu.org
  2011-02-06 23:19 ` jvdelisle at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-01-13 19:56 UTC (permalink / raw)
  To: gcc-bugs

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

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot       |jvdelisle at gcc dot
                   |gnu.org                     |gnu.org

--- Comment #3 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-01-13 19:33:25 UTC ---
I think currently we use the limit for parameter arrays to not simplify at
compile time.  We do not do this for non parameter arrays.  I will look into it
further.


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

* [Bug fortran/47267] array constructor causing long compile times
  2011-01-12 10:18 [Bug fortran/47267] New: array constructor causing long compile times Joost.VandeVondele at pci dot uzh.ch
                   ` (2 preceding siblings ...)
  2011-01-13 19:56 ` jvdelisle at gcc dot gnu.org
@ 2011-02-06 23:19 ` jvdelisle at gcc dot gnu.org
  2011-02-07  0:59 ` dfranke at gcc dot gnu.org
  2013-06-24  6:59 ` dominiq at lps dot ens.fr
  5 siblings, 0 replies; 7+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-02-06 23:19 UTC (permalink / raw)
  To: gcc-bugs

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

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.02.06 23:16:02
     Ever Confirmed|0                           |1

--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-02-06 23:16:02 UTC ---
This is fun.  We actually pass through the loop in array.c (expand_iterator)
four times, each time the trip count is Niter=300000000. There is no check of
the trip count before starting.


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

* [Bug fortran/47267] array constructor causing long compile times
  2011-01-12 10:18 [Bug fortran/47267] New: array constructor causing long compile times Joost.VandeVondele at pci dot uzh.ch
                   ` (3 preceding siblings ...)
  2011-02-06 23:19 ` jvdelisle at gcc dot gnu.org
@ 2011-02-07  0:59 ` dfranke at gcc dot gnu.org
  2013-06-24  6:59 ` dominiq at lps dot ens.fr
  5 siblings, 0 replies; 7+ messages in thread
From: dfranke at gcc dot gnu.org @ 2011-02-07  0:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Daniel Franke <dfranke at gcc dot gnu.org> 2011-02-07 00:34:00 UTC ---
Jerry, good luck with that one - I'm pretty sure that this is at least
implicitly related to PR42189. Can of Pandoras's Worms ahead :)


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

* [Bug fortran/47267] array constructor causing long compile times
  2011-01-12 10:18 [Bug fortran/47267] New: array constructor causing long compile times Joost.VandeVondele at pci dot uzh.ch
                   ` (4 preceding siblings ...)
  2011-02-07  0:59 ` dfranke at gcc dot gnu.org
@ 2013-06-24  6:59 ` dominiq at lps dot ens.fr
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-06-24  6:59 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW

--- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Was marked as ASSIGNED, but actually "Not yet assigned to anyone". Set to NEW.


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

end of thread, other threads:[~2013-06-24  6:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-12 10:18 [Bug fortran/47267] New: array constructor causing long compile times Joost.VandeVondele at pci dot uzh.ch
2011-01-12 10:24 ` [Bug fortran/47267] " Joost.VandeVondele at pci dot uzh.ch
2011-01-12 14:11 ` burnus at gcc dot gnu.org
2011-01-13 19:56 ` jvdelisle at gcc dot gnu.org
2011-02-06 23:19 ` jvdelisle at gcc dot gnu.org
2011-02-07  0:59 ` dfranke at gcc dot gnu.org
2013-06-24  6:59 ` dominiq at lps dot ens.fr

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