About the is_gimple_min_invariant predicate

Eric Botcazou ebotcazou@adacore.com
Wed Jul 4 13:57:00 GMT 2007

> Sure, but CONST isn't specified.

OK, but if it's a formal predicate you cannot do what you want because of the 
rest of the grammar that is "implemented" by the GIMPLE verifier.

For example &A[C + 1] and &A[C], where A is static and C is a constant 
identifier, have the same degree of constness, but the former is probably
not GIMPLE since the verifier will choke on it.

> Simply restricting it to "real" constants might pessimize optimization
> (though it also simplifies code to not having to special case
> non-constants). 

Right.  I guess that most consumers expect is_gimple_min_invariant to mean
"minimal invariant in GIMPLE form".  I'll try to come up with the maximally 
valid predicate implementing this for ADDR_EXPR expressions.

Thanks for your feedback.

Eric Botcazou

More information about the Gcc mailing list