https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88626

--- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Also note that builtin_constant_p is handled conservatively.
If you have

if (builtin_constant_p (x))
  constant code;
else
  nonconstant code;

inliner will know that nonconstant code will be optimized out if x is constant,
but it will not know that constant code will be optimized out if x is variable
(because it never knows that info, only later optimizations will decide) and it
does not know that it is always the case that one of the branches will be
optimized out.

The last problem I think is most serious about our BCP handling. It may be
possible to compute size/time vectors of the two variants and then produce
final one that will take constant variant when x is constant and longer of the
two variants when x is not, but it will need some work.

Honza

Reply via email to