This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/84595] __builtin_trap() causes optimizer to remove code
- From: "danielgutson at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 Feb 2018 16:42:57 +0000
- Subject: [Bug tree-optimization/84595] __builtin_trap() causes optimizer to remove code
- Auto-submitted: auto-generated
- References: <bug-84595-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84595
--- Comment #5 from Daniel Gutson <danielgutson at gmail dot com> ---
(In reply to Andrew Pinski from comment #4)
> (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.
OK. I'll leave this issue as a feature request for __builtin_break(). Maybe the
component should be changed to something more appropriate?