https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98436
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Samuel Benjamin from comment #4)
> I got your point, But why is this working with 64bit and other gcc versions
> other than 7.4.0 - 32 bit ?
Because the ABI for x86_64 and i?86 are different. One passes the this
arugment via the stack (i?86) while the other passes it via a register. In the
case for x86_64, the register can be safely ignored.
Again this is undefined code and just happens to work on x86_64.