This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31218] ICE on valid code with gfortran
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 May 2007 11:31:41 -0000
- Subject: [Bug fortran/31218] ICE on valid code with gfortran
- References: <bug-31218-6642@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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