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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-02-17

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed on the current master. There's a reduced test-case:

$ cat pr99127.i
int c_pow_r_1, c_pow_r_0, c_pow_phase;

void
c_pow() {
  c_pow_r_0 = __builtin_cos(c_pow_phase);
  c_pow_r_1 = __builtin_sin(c_pow_phase);
}

It's related to sincos optimization we do:

-fdump-tree-optimized=/dev/stdout:

  sincostmp_10 = __builtin_cexpi (_2);
  _3 = REALPART_EXPR <sincostmp_10>;
  _4 = (int) _3;
  c_pow_r_0 = _4;
  _5 = IMAGPART_EXPR <sincostmp_10>;

Unfortunately, we don't have an option which can be used to disable the
optimization:

gcc/tree-ssa-math-opts.c:2252:

  /* opt_pass methods: */
  virtual bool gate (function *)
    {
      /* We no longer require either sincos or cexp, since powi expansion
         piggybacks on this pass.  */
      return optimize;
    }

Reply via email to