https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99591
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2021-09-01
Ever confirmed|0 |1
Component|target |c
Status|UNCONFIRMED |NEW
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to eggert from comment #3)
> (In reply to Andrew Pinski from comment #2)
> > (In reply to Andrew Pinski from comment #1)
> > > Looks fixed for GCC 11+.
> It doesn't appear to be fixed in GCC 11.2.1 20210728 (Red Hat 11.2.1-1). For
> signed1_overflow I get the same suboptimal machine code described in comment
> #0. For signed2_overflow I get:
This is interesting, the C++ front-end is fine but the C front-end is not.
C front-end:
return r = REALPART_EXPR <SAVE_EXPR <.ADD_OVERFLOW ((int) a, (int) b)>>;,
(_Bool) IMAGPART_EXPR <SAVE_EXPR <.ADD_OVERFLOW ((int) a, (int) b)>>;;
While the C++ frontend is:
<<cleanup_point return <retval> = r = REALPART_EXPR <SAVE_EXPR <.ADD_OVERFLOW
(a, b)>>;, (bool) IMAGPART_EXPR <SAVE_EXPR <.ADD_OVERFLOW (a, b)>>;>>;