This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix Ada testsuite failures introduced by my folding patch
- From: Richard Guenther <rguenther at suse dot de>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 5 Sep 2010 19:22:43 +0200 (CEST)
- Subject: Re: Fix Ada testsuite failures introduced by my folding patch
- References: <20100905141956.GH31380@kam.mff.cuni.cz>
On Sun, 5 Sep 2010, Jan Hubicka wrote:
> Hi,
> my previous folding patch introduced several Ada testsuite failures. In some cases
> we replace a=b by a={1,2} that is no longer valid gimple. Other case is:
>
> .3194_2 = (void (*ada__tags__prim_ptr) (void)[1:1] * {ref-all}) &c390011_2__tableT + 32;
>
> here I think the expression can be validized and is ommision in
> maybe_fold_offset_to_address, but i did not put too much effort to figure out where it fails.
>
> This patch adds test that result of fold_const_aggregate_ref is min_invariant
> before using it. The function can return constructors to allow self recursion
> when handling multiple references.
>
> In the first case disabling transform is the only correct thing to do. In the second case
> this just turns ICE into suboptimal codegen.
>
> Bootstrapped/regtested x86_64-linux, OK?
Ok.
Thanks,
Richard.
> Honza
>
> * gimple-fold.c (maybe_fold_reference): Test that result of
> fold_const_aggregate_ref is gimple_min_invariant.
> Index: gimple-fold.c
> ===================================================================
> --- gimple-fold.c (revision 163862)
> +++ gimple-fold.c (working copy)
> @@ -477,7 +477,8 @@ maybe_fold_reference (tree expr, bool is
> tree result;
>
> if (!is_lhs
> - && (result = fold_const_aggregate_ref (expr)))
> + && (result = fold_const_aggregate_ref (expr))
> + && is_gimple_min_invariant (result))
> return result;
>
> /* ??? We might want to open-code the relevant remaining cases
>
>
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex