[Bug rtl-optimization/79059] Information from CCmode is not propagated across basic blocks
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jan 11 18:55:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79059
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I can't remember if this is the same but
I don't know how to describe this optimization right now but take the following
two functions:
struct arc
{
int ident;
};
int bea_is_dual_infeasible( struct arc *arc, int red_cost )
{
return( (red_cost < 0 && arc->ident == 1)
|| (red_cost > 0 && arc->ident == 2) );
}
int bea_is_dual_infeasible1( struct arc *arc, int red_cost )
{
int t;
if (red_cost == 0)
return 0;
return arc->ident == ((red_cost > 0) ? 2 : 1);
}
They both do the same thing but bea_is_dual_infeasible1 has only one branch (no
conditional move either) while bea_is_dual_infeasible has many branches. This
is true on x86 (have not checked arm though).
More information about the Gcc-bugs
mailing list