This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR 40493] Fix SRA miscompilation of binutils
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Guenther <rguenther at suse dot de>, "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Thu, 25 Jun 2009 18:15:24 -0700
- Subject: Re: [PATCH, PR 40493] Fix SRA miscompilation of binutils
- References: <20090624163734.GD4430@virgil.suse.cz>
2009/6/24 Martin Jambor <mjambor@suse.cz>:
> Hi,
>
> the patch below fixes two rather serious problems in the new SRA.
>
> The ?first one ?is ?that I ?misremembered ?the order ?of arguments ?of
> BIT_FIELD_REF and was looking for the offset and size of the reference
> at exactly the wrong places.
>
> The second ?is a slightly ?more complex one. ? sra_modify_assign() and
> load_assign_lhs_subreplacements() ?try hard ?to ?remove the ?aggregate
> assignment ?if ?possible ?and ?so ?can ?decide ?to ?flush ?RHS ?scalar
> replacements ?directly to ?the ?LHS ?when it ?knows ?there's no ?other
> (unscalarized) data on the RHS. ?That is all good and well except that
> load_assign_lhs_subreplacements() always ?looked to the ?RHS aggregate
> when it did ?not find a RHS scalar replacement ?corresponding to a LHS
> scalar replacement. ?However, that contained
>
> This patch fixes ?this changes a boolean variable ?that keeps track of
> whether scalars were flushed into one of the original aggregates to an
> enum that also tells to which one and makes
> load_assign_lhs_subreplacements use it to look at the correct place.
>
> I have bootstrapped ?and tested this on x86-64. ? There was however an
> acats new ?failure which has something ?to do with ?timing and delays.
> However, these happen ?to me all the ?time but go away when ?I run the
> tests again and so that's what I am doing right now.
>
> So, is this OK provided that the acats failure does not reoccur?
>
> Thanks,
>
> Martin
>
> 2009-06-24 ?Martin Jambor ?<mjambor@suse.cz>
>
> ? ? ? ?* tree-sra.c (sra_modify_expr): Correct BIT_FIELD_REF argument numbers.
> ? ? ? ?(enum unscalarized_data_handling): New type.
> ? ? ? ?(handle_unscalarized_data_in_subtree): Return what has been done.
> ? ? ? ?(load_assign_lhs_subreplacements): Handle left flushes differently.
> ? ? ? ?(sra_modify_assign): Use unscalarized_data_handling, simplified
> ? ? ? ?condition determining whether to remove the statement.
>
> ? ? ? ?* testsuite/gcc.c-torture/execute/pr40493.c: New test.
>
This patch caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40554
H.J.