https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123960
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution|--- |INVALID
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
ptr = memory + -((unsigned int)*ptr); //results with segmentation fault
when
There is no bug here with respect to x86_64 or any other LP64 target.
When you do:
memory + -((unsigned int)*ptr)
`-((unsigned int)*ptr)` part is done in 32bit and is still unsigned int type.
and then adding it to a pointer will zero extend it to 64bit when adding to
memory.