[PATCH] Fix ICEs in *.mod writer
Paul Thomas
paulthomas2@wanadoo.fr
Mon Mar 12 18:47:00 GMT 2007
Jakub,
>
> Ok for 4.3/4.2/4.1?
>
OK - thanks
Paul
> 2007-03-12 Jakub Jelinek <jakub@redhat.com>
>
> * module.c (mio_typespec): Don't look at ts->cl if not BT_CHARACTER.
>
> * gfortran.dg/module_implicit_conversion.f90: New test.
>
> --- gcc/fortran/module.c.jj 2007-03-12 17:17:56.000000000 +0100
> +++ gcc/fortran/module.c 2007-03-12 17:54:56.000000000 +0100
> @@ -1814,7 +1814,14 @@ mio_typespec (gfc_typespec *ts)
> else
> mio_symbol_ref (&ts->derived);
>
> - mio_charlen (&ts->cl);
> + if (ts->type != BT_CHARACTER)
> + {
> + /* ts->cl is only valid for BT_CHARACTER. */
> + mio_lparen ();
> + mio_rparen ();
> + }
> + else
> + mio_charlen (&ts->cl);
>
> mio_rparen ();
> }
> --- gcc/testsuite/gfortran.dg/module_implicit_conversion.f90.jj 2007-03-12 18:02:29.000000000 +0100
> +++ gcc/testsuite/gfortran.dg/module_implicit_conversion.f90 2007-03-12 18:06:20.000000000 +0100
> @@ -0,0 +1,9 @@
> +! { dg-do compile }
> +! { dg-options "-std=gnu" }
> +
> +module module_implicit_conversion
> + ! double complex :: s = (1.0D0, 0D0)
> + double complex :: s = (1.0, 0D0)
> +end module module_implicit_conversion
> +
> +! { dg-final { cleanup-modules "module_implicit_conversion" } }
>
> Jakub
>
>
>
More information about the Gcc-patches
mailing list