[Bug tree-optimization/84595] __builtin_trap() causes optimizer to remove code
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 27 16:40:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84595
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Daniel Gutson from comment #3)
> OK. That was my second suggested alternative.
> BTW I didn't see __builtin_trap documented as noreturn in the documentation.
Depends on the reading of __builtin_trap documentation.
My reading says it does not return.
"This function causes the program to exit abnormally. GCC implements this
function by using a target-dependent mechanism (such as intentionally executing
an illegal instruction) or by calling abort."
Since the documentation talks about calling abort, I would assume __built_trap
should be treated almost the same as calling abort.
More information about the Gcc-bugs
mailing list