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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |5.5.0
            Summary|fortran complex abs does    |[11/12/13/14/15 Regression]
                   |not vectorise               |complex abs does not
                   |                            |vectorise
   Target Milestone|---                         |11.5
           Keywords|                            |needs-bisection
      Known to fail|                            |6.1.0

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So before forwprop3 we have:
```
  _10 = REALPART_EXPR <*_3>;
  _9 = IMAGPART_EXPR <*_3>;
  _4 = COMPLEX_EXPR <_10, _9>;
  _5 = cabs (_4);
  _6 = _1 * 8;
  _7 = b_14(D) + _6;
  reassocpow_18 = __builtin_powi (_5, 2);

```

After we get:
```
  _10 = REALPART_EXPR <*_3>;
  _4 = *_3;
  _9 = IMAGPART_EXPR <*_3>;
  _5 = cabs (_4);
  _6 = _1 * 8;
  _7 = b_14(D) + _6;
  reassocpow_18 = __builtin_powi (_5, 2);
```
Which undoes complex lowering.

But then powcabs does:
```
  _10 = REALPART_EXPR <*_3>;
  _4 = *_3;
  _9 = IMAGPART_EXPR <*_3>;
  cabs_8 = REALPART_EXPR <_4>;
  cabs_17 = cabs_8 * cabs_8;
  cabs_22 = IMAGPART_EXPR <_4>;
  cabs_23 = cabs_22 * cabs_22;
  cabs_24 = cabs_17 + cabs_23;
  powroot_25 = __builtin_sqrt (cabs_24);
  _5 = powroot_25;
  _6 = _1 * 8;
  _7 = b_14(D) + _6;
  powmult_26 = _5 * _5;
  reassocpow_18 = powmult_26;
  *_7 = reassocpow_18;
```
Which redoes some of the complex lowering but misses undoing the undo of
COMPLEX_EXPR<REAL<*3>, IMAG<*3>> ...

This is a regression even as GCC 5 used to be able top vectorize it.

Reply via email to