This is the mail archive of the gcc-patches@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]

Re: Infamous PR fortran/19925


Steve,

On Sun, Sep 14, 2008 at 7:17 AM, Steve Kargl
<sgk@troutmask.apl.washington.edu> wrote:
> Well, I spent some time last week thinking about PR
> fortran/19925 and have decided that the best option
> may be to punt.  Consider the somewhat far fetched
> but legal Fortran,

I concur with you completely on this.  I have visited this PR on one
or two occasions and have failed to come up with any better
alternative.  Maybe a warning like that at the head of module files
should be emitted? :-)

OK for trunk

Thanks

Paul

>
>   program test
>     implicit none
>     integer j
>     integer, parameter :: n = 1000000
>     integer, parameter :: i(n) = (/ (2*j, j = 1, n) /)
>     real :: x(i(5))
>     do j = 1, i(5)
>        x(j) =  sin(i(j) * 1.23)
>     end do
>     print *, x
>   end program test
>
> Most possible solutions that I could fathom would inhibit
> the optimizer from possibly optimizing the above loop.
>
> So, I've come up with the following patch.  It does not
> fix the compile time problem, the memory consumption
> problem during compilation, nor the size of an object file.
> It simply gives a user a method (or more appropriately a
> gun) to shoot their feet if they do something like the above.
> The above code will not compile with gfortran.  With my
> patch, one can do
>
> gfortran -fmax-array-construct=1000000 test.f90
>
> If the gfortran maintainers prefer a better solution, then I'll
> certainly won't be offended.
>
> 2008-09-13  Steven G. Kargl  <kargls@comcast.net>
>
>        PR fortran/19925
>        * trans-array.c (gfc_trans_array_constructor_value): Replace an
>        internal_error with gfc_error_now.
>        * array.c: Remove GFC_MAX_AC_EXPAND
>        (gfc_expand_constructor): Use gfc_option.flag_max_array_constructor.
>        * gfortran.h: Add flag_max_array_constructor
>        * lang.opt: Add -fmax-array-constructor option.
>        * invoke.texi: Document option.
>        * options.c (gfc_init_options): Set
>        gfc_option.flag_max_array_constructor
>        (gfc_handle_option): Process option.
>
>
> --
> Steve
>



-- 
The knack of flying is learning how to throw yourself at the ground and miss.
 --Hitchhikers Guide to the Galaxy


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