[Patch,Fortran] PR 44857 [4.6 Regression] ICE in output_constructor_regular_field, at varasm.c:4996

H.J. Lu hjl.tools@gmail.com
Wed Aug 4 16:18:00 GMT 2010


On Wed, Aug 4, 2010 at 4:52 AM, Tobias Burnus <burnus@net-b.de> wrote:
>  On 08/04/2010 12:36 PM, Daniel Kraft wrote:
>>
>> Tobias Burnus wrote:
>>>
>>> Build on x86-64-linux and successfully regtested an earlier version of
>>> the patch; I am currently regtesting the current patch.
>>> OK for the trunk, when successful?
>>
>> Ok.  You may just consider to use "else if" instead of "if" for
>>
>> +      if (cons->expr->expr_type == EXPR_ARRAY)
>> +        {
>>
>> While it does not change anything of course, it seems clearer to me.
>
> Well, actually, it does: I replace the previous expression by a new one, an
> EXPR_ARRAY, to use the string-length machinery for EXPR_ARRAY. I will add a
> comment to make this clearer.
>
> (The extra layer of expressions does not matter for PARAMETER as the whole
> expression gets reduced to a simple string literal as the dump shows.)
>
> +         if (cons->expr->expr_type == EXPR_VARIABLE
> + && cons->expr->symtree->n.sym->attr.flavor == FL_PARAMETER)
> +           {
> +             /* Wrap the parameter in an array constructor (EXPR_ARRAY)
> +                to make use of the gfc_resolve_character_array_constructor
> +                machinery.  The expression is later simplified away to
> +                an array of string literals.  */
>
> I have committed now the patch as Rev. 162863.
>

gfortran.dg/derived_constructor_char_1.f90 failed on Linux/ia32:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45183


-- 
H.J.



More information about the Gcc-patches mailing list