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

--- Comment #7 from federico <federico.perini at gmail dot com> ---
Thanks Harald and Steve, great hints. Looking at the `-fdump-tree-original`, I
see: 

- the on-the-fly expression seems the difference between a complex(8) and a
complex(4) expressions:

```
__builtin_cabs ( COMPLEX_EXPR <(real(kind=8)) REALPART_EXPR <SAVE_EXPR <a[S.7 +
D.3055]>>, 
                               (real(kind=8)) IMAGPART_EXPR <SAVE_EXPR <a[S.7 +
D.3055]>> >  ! complex(8)
                -COMPLEX_EXPR <eye[S.7 + D.3056], 0.0>) ! complex(4)
```

double `cabs` is OK here I believe, and it is saved to `real(kind=8) limit.4;`.

- when B is saved: 

```
b[S.3 + D.3048] = COMPLEX_EXPR <(real(kind=4)) REALPART_EXPR <SAVE_EXPR
<COMPLEX_EXPR <(real(kind=8)) REALPART_EXPR <SAVE_EXPR <a[S.3 + D.3046]>>, 
                                                                               
       (real(kind=8)) IMAGPART_EXPR <SAVE_EXPR <a[S.3 + D.3046]>>>
                                                                        
-COMPLEX_EXPR <eye[S.3 + D.3047], 0.0>> >,
                                (real(kind=4)) IMAGPART_EXPR <SAVE_EXPR
<COMPLEX_EXPR <(real(kind=8)) REALPART_EXPR <SAVE_EXPR <a[S.3 + D.3046]>>, 
                                                                               
       (real(kind=8)) IMAGPART_EXPR <SAVE_EXPR <a[S.3 + D.3046]>>> 
                                                                        
-COMPLEX_EXPR <eye[S.3 + D.3047], 0.0>>>>;
```

The expression seems identical except there is a SAVE_EXPR and is then
downgraded to a real(4) complex expression for saving into b (uses
`__builtin_cabsf`).

Reply via email to