This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/51904] [4.6/4.7 Regression] ICE on SIZE function evaluation
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 19 Jan 2012 16:50:33 +0000
- Subject: [Bug fortran/51904] [4.6/4.7 Regression] ICE on SIZE function evaluation
- Auto-submitted: auto-generated
- References: <bug-51904-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51904
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-01-19 16:50:33 UTC ---
Fails:
gcc version 4.6.0 20100828 (experimental) [trunk revision 163612] (GCC)
Works:
gcc version 4.6.0 20100716 (experimental) [trunk revision 162255] (GCC)
(Note: The builds might have local patches.)
I think it's due to the patch Rev. 162648 of 2010-07-28
http://gcc.gnu.org/viewcvs?view=revision&revision=162648
That patch tries to compile-time simplify SIZE but also changes for
nonconstant-bound arrays, e.g., SIZE(X ** 2) to SIZE(X).
Possibly the additional resolution only happens if also a symtree is available?
That would be a change to gfc_build_intrinsic_call.
If one replaces
print *, size(f*x)
by
i = size(f*x)
print *, i
the program works and one finds in the dump:
i = (integer(kind=4))
MAX_EXPR <(D.1879->dim[0].ubound - D.1879->dim[0].lbound) + 1, 0>;