On 12/11/14 10:06, Jan Hubicka wrote:
Hi,
in firefox .optimized dumps one can see few places where __builtin_unreachable
is called (as a result of devirtualization code proving the code path to be
undefined). There is usually some argument setup for the parameters of
__builtin_unreachable that are dead. This patch makes it somewhat better
so now we get:
<bb 30>:
# prephitmp_222 = PHI <_52(27), pretmp_245(29)>
_57 = prephitmp_222 + 2;
pool_40(D)->ptr = _57;
__builtin_unreachable ();
Why DSE does not eliminate the stores prior noreturn const function?
Bootstrapped/regtested x86_64-linux, OK?
Honza
* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Remove dead
parameters
of BUILT_IN_UNREACHABLE
ISTM that we shouldn't need any special handling in DCE for this. When
something is transformed into a builtin_unreachable(), arguments which
are SSA_NAMEs which are no longer referenced ought to just go away via
the normal DCE mechanisms.
A memory store has side effects that might be observable prior to
reaching the builtin_unreachable, thus it ought not be deleted. At
least that's my recollection of how we wanted this to work for other
transformations which turned turned statements with undefined behaviour
into a __builtin_unreachable.
jeff