This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/42461] Missed optimisation for pure functions with __builtin_unreachable
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Dec 2009 14:25:59 -0000
- Subject: [Bug c/42461] Missed optimisation for pure functions with __builtin_unreachable
- References: <bug-42461-8951@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from jakub at gcc dot gnu dot org 2009-12-22 14:25 -------
This broke with the EH rewrite changes, in particular:
http://gcc.gnu.org/viewcvs/trunk/gcc/dce.c?r1=151696&r2=151695&pathrev=151696
causes no const or pure calls to be ever removed by RTL DCE.
As __builtin_unreachable is preserved until expand, it can't be DCEd before
(unless we taught tree DCE that whether __builtin_unreachable is called or not
isn't relevant reg use).
And, deletable_insn_p used to allow delete many pure or const calls (unless
they used stack args), but now doesn't, as it returns false already on
!NONJUMP_INSN_P (insn) - CALL_INSN isn't NONJUMP_INSN_P. But even if
|| CALL_P (insn) is added, insn_nothrow_p (insn) returns true for all calls
unconditionally, even for C or with -fno-exceptions.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42461