This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix Ada testsuite failures introduced by my folding patch


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]