This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR44667


On Tue, Jun 29, 2010 at 5:12 AM, Richard Guenther <rguenther@suse.de> wrote:
> On Mon, 28 Jun 2010, Richard Guenther wrote:
>
>>
>> In this PR we end up doing early inlining before local optimizations
>> (due to -fprofile-generate). ?This makes the following issue more
>> likely to appear.
>>
>> The issue is that when inlining
>>
>> bar (character(kind=1)[2][1:_s] * s, integer(kind=4) _s)
>> {
>> ? character(kind=1)[2][1:_s] * s.0;
>> ? s.0 = s; ?// no conversion needed
>> }
>>
>> at the call site
>>
>> ? D.1597 = atmp.4.data;
>> ? D.1598 = (character(kind=1)[2][1:10] * restrict) D.1597;
>> ? bar (D.1598, 10);
>>
>> we end up replacing the parameter s with
>>
>> ? character(kind=1)[2][1:_s] * s;
>>
>> but the local var with
>>
>> ? character(kind=1)[2][1:10] * s.0;
>>
>> as we map _s to 10 and remap its uses in the types. ?But we fail to
>> do so for the parameter replacements we added (and we can't do so
>> in setup_one_parameter as that's too early). ?So the following makes
>> sure to remap parameter replacement types by a 2nd loop over all
>> parameters. ?This results in the expected
>>
>> ? character(kind=1)[2][1:10] * s;
>>
>> and retains the fact that s.0 = s does not need a conversion.
>>
>> Bootstrap and regtest running on x86_64-unknown-linux-gnu.
>
> And the following is what actually passed bootstrap & regtest.
> We also have to care for already re-mapped SSA names.
>
> Committed as rev. 161527.
>
> Richard.
>
> 2010-06-29 ?Richard Guenther ?<rguenther@suse.de>
>
> ? ? ? ?PR middle-end/44667
> ? ? ? ?* tree-inline.c (initialize_inlined_parameters): Make sure
> ? ? ? ?to remap the inlined parameter variable substitutions types.
>

This caused:

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


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]