Infamous PR fortran/19925

Steve Kargl sgk@troutmask.apl.washington.edu
Sat Sep 20 02:49:00 GMT 2008


On Sun, Sep 14, 2008 at 11:20:57AM +0200, Paul Richard Thomas wrote:
> 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
> 

I no longer have commit access to the tree, so someone will need
to do the commit.

Here's a new patch that adds twoi testcases and it changes an error
message from "Error: Initialization expression didn't reduce (1)"
to "Error: Initialization expression didn't reduce (1).  The
-fmax-array-constructor option may be required"

troutmask:sgk[204] cat g.f90
INTEGER, PARAMETER :: N=70000
INTEGER, PARAMETER :: I(N)=(/(MOD(K,2),K=1,N)/)
INTEGER, PARAMETER :: M(N)=I(N:1:-1)
print *, i(5)
END

troutmask:sgk[205] gfc4x -o z g.f90
g.f90:3.36:

INTEGER, PARAMETER :: M(N)=I(N:1:-1)
                                   1
Error: Initialization expression didn't reduce (1).  The -fmax-array-constructor option may be required
troutmask:sgk[206] gfc4x -o z -fmax-array-constructor=70000 g.f90


2008-09-19  Steven G. Kargl  <kargls@comcast.net>

	PR fortran/19925
	* gfortran.dg/initialization_20.f90: New test.
	* gfortran.dg/initialization_21.f90: Ditto.

2008-09-19  Steven G. Kargl  <kargls@comcast.net>

	PR fortran/19925
	* trans-array.c (gfc_trans_array_constructor_value): Fix comment.
	(gfc_conv_array_initializer): Convert internal_error() to gfc_error_now.
	* array.c: Remove GFC_MAX_AC_EXPAND macro.
	(gfc_expand_constructor): Use gfc_option.flag_max_array_constructor.
	* gfortran.h (gfc_option): Add flag_max_array_constructor member.
	* lang.opt: Add -fmax-array-constructor option.
	* expr.c (gfc_match_init_expr): Fix error message to mention new option.
	* invoke.texi: Document new option.
	* options.c(gfc_init_options): Set default value for new option.
	(gfc_handle_option): Deal with commandline.

-- 
Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 7933 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080920/f440357e/attachment.bin>


More information about the Gcc-patches mailing list