PR tree-optimize/45085 (-fpartial-inlining miscompile)

H.J. Lu hjl.tools@gmail.com
Sat Aug 7 18:49:00 GMT 2010


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


-- 
H.J.



More information about the Gcc-patches mailing list