[Bug tree-optimization/126827] Missing vrp due to builtin calls are not all handled (only handled in nonnegative)

"pinskia at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126827

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2026-08-12
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
here is a list not implementing but is implemented in nonnegative:

Indepdent of arguments:
    CASE_CFN_ACOS:
    CASE_CFN_ACOS_FN:
    CASE_CFN_ACOSH:
    CASE_CFN_ACOSH_FN:
    CASE_CFN_ACOSPI:
    CASE_CFN_ACOSPI_FN:

    CASE_CFN_COSH:
    CASE_CFN_COSH_FN:
    CASE_CFN_ERFC:
    CASE_CFN_ERFC_FN:

    CASE_CFN_EXP:
    CASE_CFN_EXP_FN:
    CASE_CFN_EXP10:
    CASE_CFN_EXP2:
    CASE_CFN_EXP2_FN:

    CASE_CFN_FABS:
    CASE_CFN_FABS_FN:
    CASE_CFN_FDIM:
    CASE_CFN_FDIM_FN:
    CASE_CFN_HYPOT:
    CASE_CFN_HYPOT_FN:
    CASE_CFN_POW10:

Depends on arg0 being non-negative:
    CASE_CFN_ASINH:
    CASE_CFN_ASINH_FN:
    CASE_CFN_ASINPI:
    CASE_CFN_ASINPI_FN:
    CASE_CFN_ATAN:
    CASE_CFN_ATAN_FN:
    CASE_CFN_ATANH:
    CASE_CFN_ATANH_FN:
    CASE_CFN_ATANPI:
    CASE_CFN_ATANPI_FN:
    CASE_CFN_CBRT:
    CASE_CFN_CBRT_FN:
    CASE_CFN_CEIL:
    CASE_CFN_CEIL_FN:
    CASE_CFN_ERF:
    CASE_CFN_ERF_FN:
    CASE_CFN_EXPM1:
    CASE_CFN_EXPM1_FN:
    CASE_CFN_FLOOR:
    CASE_CFN_FLOOR_FN:
    CASE_CFN_FMOD:
    CASE_CFN_FMOD_FN:
    CASE_CFN_FREXP:
    CASE_CFN_FREXP_FN:
    CASE_CFN_ICEIL:
    CASE_CFN_IFLOOR:
    CASE_CFN_IRINT:
    CASE_CFN_IROUND:
    CASE_CFN_LCEIL:
    CASE_CFN_LDEXP:
    CASE_CFN_LFLOOR:
    CASE_CFN_LLCEIL:
    CASE_CFN_LLFLOOR:
    CASE_CFN_LLRINT:
    CASE_CFN_LLRINT_FN:
    CASE_CFN_LLROUND:
    CASE_CFN_LLROUND_FN:
    CASE_CFN_LRINT:
    CASE_CFN_LRINT_FN:
    CASE_CFN_LROUND:
    CASE_CFN_LROUND_FN:
    CASE_CFN_MODF:
    CASE_CFN_MODF_FN:
    CASE_CFN_NEARBYINT:
    CASE_CFN_NEARBYINT_FN:
    CASE_CFN_RINT:
    CASE_CFN_RINT_FN:
    CASE_CFN_ROUND:
    CASE_CFN_ROUND_FN:
    CASE_CFN_ROUNDEVEN:
    CASE_CFN_ROUNDEVEN_FN:
    CASE_CFN_SCALB:
    CASE_CFN_SCALBLN:
    CASE_CFN_SCALBLN_FN:
    CASE_CFN_SCALBN:
    CASE_CFN_SCALBN_FN:

    CASE_CFN_SIGNIFICAND:
    CASE_CFN_SINH:
    CASE_CFN_SINH_FN:
    CASE_CFN_TANH:
    CASE_CFN_TANH_FN:
    CASE_CFN_TRUNC:
    CASE_CFN_TRUNC_FN:

Slightly more complex based on arg0/arg1:
    CASE_CFN_FMAX:
    CASE_CFN_FMAX_FN:


Depends on both being non-negative:
    CASE_CFN_FMIN:
    CASE_CFN_FMIN_FN:


arg0 is non-negative then non-negative otherwise if arg1 is even (integer):
    CASE_CFN_POWI:

Same but fp being even instead of integer:
    CASE_CFN_POW:
    CASE_CFN_POW_FN:



powi testcase:
```
double f(double a, int b)
{
  b &= ~1;
  a = __builtin_powi(a, b);
  if (a < 0)
    __builtin_trap();
  return a;
}
```
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.