Dear Steve,

OK for trunk.

Some of the code around the patch brings back fond memories;
especially the "scalarization"!

Thanks for the patch.

Paul

On 16 November 2015 at 03:22, Steve Kargl
<s...@troutmask.apl.washington.edu> wrote:
> First, thanks to Dominiq for prodding me into looking at PR 58027.
>
> This was a fun ICE to track down!
>
> Most users have no idea what the Fortran standard requires for
> the parsing of a BOZ.  Consider the line of code
>
>   integer, parameter :: i(1) = (/ z'ff800000' /)
>
> The naive user wants to assign a BOZ interpreted as a 32-bit entity
> to i(1) in an array constructor.  Ignoring the fact that a BOZ
> can't be used here, the BOZ is converted to an integer with the
> widest decimal exponential range.  On all(?) targets this is at
> least a 64-bit integer (known as INTEGER(8)).  To do the assignment
> gfortan inserts a __convert_i8_i4(), but it does so after any
> checking for an initialization expression.  So, when gfortran
> finally gets around to calling gfc_conv_array_initializer() to
> translates into tree-ssa form, gfc_conv_array_initializer() is not
> expecting a function and dies with an ICE.
>
> The fix is affected by calling gfc_check_init_expr() under
> appropriate conditions.  Because the __convert_* functions
> are sort of psuedo-intrinsic procedures, a check for an intrinsic
> procedure needs to be circumvented.
>
> Anyway, the patch has been built and tested on i386-*-freebsd
> and x86_64-*-freebsd.  OK to commit?
>
> 2015-11-15  Steven G. Kargl  <ka...@gcc.gnu.org>
>
>         PR fortran/58027
>         PR fortran/60993
>         * expr.c (gfc_check_init_expr): Prevent a redundant check when a
>         __convert_* function was inserted into an array constructor.
>         (gfc_check_assign_symbol): Check for an initialization expression
>         when a __convert_* was inserted.
>
> 2015-11-15  Steven G. Kargl  <ka...@gcc.gnu.org>
>
>         PR fortran/58027
>         PR fortran/60993
>         * gfortran.dg/pr58027.f90: New test.
>
> --
> Steve



-- 
Outside of a dog, a book is a man's best friend. Inside of a dog it's
too dark to read.

Groucho Marx

Reply via email to