This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR tree-optimize/45085 (-fpartial-inlining miscompile)
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 30 Oct 2010 07:22:52 -0700
- Subject: Re: PR tree-optimize/45085 (-fpartial-inlining miscompile)
- References: <20100803132808.GA18021@kam.mff.cuni.cz> <AANLkTikSrEfAKuCQ3kNBX8p=4qXWH-57G2ikzDjUZ_t2@mail.gmail.com> <AANLkTikU6UZK0y-gCo1873PFM2GZSVASWbH2ADsPLhyQ@mail.gmail.com>
On Thu, Aug 26, 2010 at 7:17 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sat, Aug 7, 2010 at 11:48 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Tue, Aug 3, 2010 at 6:28 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
>>> hi,
>>> in the testcase we decide to split part of fn9 and by mistake we overwrite earlier computed
>>> return value. ?The actual bug is that visit_bb still expect single statement return bb while
>>> later I allowed return bb to contain move and return.
>>>
>>> However as observed by jakub, it does not make sense to always require the split part to compute
>>> return value. In some cases return value is already known from header but still we can split out
>>> some code. ?In fact I already handle case of constant returns, this patch makes the support
>>> generic and allow the return value to be computed either by header or split part.
>>> When it is computed by header, the split part gets empty return statement.
>>>
>>> Bootstrapped/regtested x86_64-linux, also tested on Mozilla build.
>>>
>>> OK?
>>> Honza
>>> ? ? ? ?* gcc.c-torture/compile/pr45085.c: New testcase.
>>> ? ? ? ?* ipa-split.c (struct split_point): Add split_part_set_retval.
>>> ? ? ? ?(find_retval): Forward declare.
>>> ? ? ? ?(test_nonssa_use, mark_nonssa_use): Special case return by reference.
>>> ? ? ? ?(consider_split): Compute current->split_part_set_retval.
>>> ? ? ? ?(visit_bb): Do not look into return value.
>>> ? ? ? ?(split_function): Handle !split_part_set_retval
>>
>> This caused:
>>
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45219
>>
>>
>
> This also caused:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45412
>
This also caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46240
--
H.J.