About the is_gimple_min_invariant predicate

Richard Guenther richard.guenther@gmail.com
Wed Jul 4 10:55:00 GMT 2007


On 7/4/07, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Ada bootstrap has been broken by the SCC value numbering patch too (this is PR
> tree-optimization/32589) but this might be due to a latent problem.
>
> In the FRE dump:
>
> RHS &p__name_buffer[1]{lb: 1 sz: 1} + n_32 simplified to
> &p__name_buffer[(<unnamed-signed:32>) MAX_EXPR <D.738_31, 0> + 1]{lb: 1 sz:
> 1} has constants 0
>
> and the latter expression is caught by the GIMPLE expression verifier:
>
> error: invalid array index (<unnamed-signed:32>) MAX_EXPR <D.738_31, 0> + 1;

This is invalid gimple.  Can you figure our why we don't gimplify this to

tmp_1 = MAX_EXPR <D.738_31, 0>;
tmp_2 = (<unnamed-signed:32>)tmp_1;
tmp_3 = tmp_2 + 1;
&p_name_buffer[tmp3]

?  We shouldn't allow expressions (even if invariant) in such places.

Richard.



More information about the Gcc mailing list