[PATCH] Fix PR70937
Jerry DeLisle
jvdelisle@charter.net
Tue May 10 17:43:00 GMT 2016
On 05/09/2016 12:41 AM, Richard Biener wrote:
> On Fri, 6 May 2016, Richard Biener wrote:
>
>> On Fri, 6 May 2016, Richard Biener wrote:
>>
>>>
>>> The following patch fixes another case of missing DECL_EXPR in the FE.
>>>
>>> Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
>>>
>>> Ok for trunk?
>>
>> Dominique noticed a FAIL early which is fixed by adjusting the patch
>> to only handle TYPE_DECL TYPE_NAME like so:
>>
>> Index: gcc/fortran/trans-decl.c
>> ===================================================================
>> --- gcc/fortran/trans-decl.c (revision 235945)
>> +++ gcc/fortran/trans-decl.c (working copy)
>> @@ -3818,6 +3818,12 @@ gfc_trans_vla_type_sizes (gfc_symbol *sy
>> }
>>
>> gfc_trans_vla_type_sizes_1 (type, body);
>> + /* gfc_build_qualified_array may have built this type but left
>> TYPE_NAME
>> + pointing to the original type whose type sizes we need to expose to
>> + the gimplifier unsharing. */
>> + if (TYPE_NAME (type)
>> + && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
>> + gfc_add_expr_to_block (body, build1 (DECL_EXPR, type, TYPE_NAME
>> (type)));
>> }
>>
>>
>> I've re-started testing.
>>
>> Ok with that change?
>
Richard, yes Ok if all works. We are very short on reviewers right now, so very
much appreciate your help here. (the below approach if you find it best)
Jerry
> It doesn't work fully either. Given also the original problem where
> unshared IL exposes the need to visit the "unrelated" VLA types in
> the gimplifier unsharing I tested the following patch instead which
> resolves the issue as well. Furthermore it can't regress things
> and at this point is the easiest way forward to unbreak fortran.
>
> Thus, bootstrapped and tested on x86_64-unknown-linux-gnu, applied to
> trunk.
>
> I am testing if reverting my first fix is possible after this now.
>
> Richard.
More information about the Fortran
mailing list