Target dependence of conditional expression gimplification

Florian Weimer fweimer@redhat.com
Tue May 6 08:24:00 GMT 2014


On 05/05/2014 06:11 PM, Jeff Law wrote:

> Yes, this is a known issue.  There's places where the costing models
> change the gimple we initially generate and what transformations we
> apply later.

Well, "known issue" is very subjective.  Our developers run into this 
quite regularly because you get more -Wstrict-overflow warnings on ppc64 
and s390x than on x86_64.  The GIMPLE on x86_64 contains fewer 
conditional statements, so the warning does not fire.

> Long term we want to push this stuff to a later point in the pipeline,
> but there's some disagreement over exactly how/when to do that.

Would it be feasible (for someone like me who is not really familiar 
with GCC internals) to move the BRANCH_COST-dependent bits of fold to an 
early GIMPLE pass?  There's another target dependence related to 
function pointers which could receive similar treatment.

This wouldn't help with the -Wstrict-overflow issue that prompted my 
original message, but it would benefit warnings and other analyses 
performed on early not-fully-optimized GIMPLE.

-- 
Florian Weimer / Red Hat Product Security Team



More information about the Gcc-help mailing list