[Bug fortran/44742] ICE in gfc_conv_array_initializer

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Jul 6 05:33:00 GMT 2010



------- Comment #10 from burnus at gcc dot gnu dot org  2010-07-06 05:33 -------
(In reply to comment #9)
> Even shorter:
>   integer, parameter :: N = 256
>
> Note: N=256 is the smallest number for which it fails.

Workaround: Use a sufficiently large -fmax-array-constructor=<n>, e.g.

  -fmax-array-constructor=65536

(65536 = 256**2; default is 65535)


Side remark: It is not particularly efficient to use a huge static variable. If
you use PARAMETER (as in your example), that leads to huge .mod files and on
assignment to large code.

If you use a normal variable (with [implied] SAVE), a non-zero initializer will
be written as is into the assembler file, which makes the binary unnecessarily
large. For variables, using initialization at run time is the better choice for
large arrays. The best solution for PARAMETER depends on the purpose.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code


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



More information about the Gcc-bugs mailing list