[Bug fortran/31218] ICE on valid code with gfortran
fxcoudert at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri May 4 11:31:00 GMT 2007
------- Comment #5 from fxcoudert at gcc dot gnu dot org 2007-05-04 12:31 -------
RESHAPE is not simplified, because "x" has type EXPR_CONSTANT (scalar constant)
which is not accepted by the simplification routine gfc_simplify_reshape,
because it wants arguments to be EXPR_ARRAY (ie array constructor). Thus, the
following code fails to compile:
integer, parameter :: x(1) = 1, y(1) = reshape(x,(/1/))
print *, y
end
while that other one works fine:
integer, parameter :: x(1) = (/1/), y(1) = reshape(x,(/1/))
print *, y
end
I don't know if it's OK for x to have type EXPR_CONSTANT, but I think it is. In
that case, gfc_simplify_reshape should be modified to account for this
possibility.
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
Last reconfirmed|2007-03-17 15:42:32 |2007-05-04 12:31:41
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31218
More information about the Gcc-bugs
mailing list