This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33317] CSHIFT/EOSHIFT: Rejects optional dummy for DIM=
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Nov 2007 18:22:38 -0000
- Subject: [Bug fortran/33317] CSHIFT/EOSHIFT: Rejects optional dummy for DIM=
- References: <bug-33317-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from jvdelisle at gcc dot gnu dot org 2007-11-17 18:22 -------
The problem here is that when we resolve cshift and eoshift we convert dim from
a EXPR_VARIABLE to a EXPR_FUNCTION that converts the type to match up with the
runtime function.
Later in trans-expr.c, code is not built to test for NULL and set dim to the
default of 1 since dim is no longer a variable and there is nothing in
gfc_conv_function_call to handle it. It is normally handled by
gfc_conv_missing_dummy.
Further complicating this, the conversion of type function, such as
convert_i8_i4 which gets simplified to a cast segfaults when dim is NULL.
I think the solution is to build the type conversion later in
gfc_conv_missing_dummy after building the test for NULL.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33317