This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR44667
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org, Jan Hubicka <jh at suse dot de>
- Date: Fri, 2 Jul 2010 20:52:04 -0700
- Subject: Re: [PATCH] Fix PR44667
- References: <alpine.LNX.2.00.1006281417050.1429@zhemvz.fhfr.qr> <alpine.LNX.2.00.1006291410060.1429@zhemvz.fhfr.qr>
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.