http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58387

--- Comment #14 from Jeffrey A. Law <law at redhat dot com> ---
It's the action of executing the code with undefined behaviour which is the
trigger.  ie, if you don't execute the code, then it has no effect on the
defined/undefined state of the program as a whole.

It's interesting that you mention undefined behaviour -- the primary motivation
behind the patch that's causing this problem is to better expose to the
analysis and optimization phases of GCC that certain paths, if executed, result
in undefined behaviour.

In particular, propagating NULL pointers into PHI nodes in non-dominated
successors exposes more opportunities to identify paths which, if executed,
would dereference a NULL pointer.  We want to then isolate those paths which
exhibit undefined behaviour from the rest of the code.  That allows the "real"
code paths to be better optimized and the undefined behaviour paths to be
pulled out of the main instruction stream.

The same can be done for out-of-bounds array accesses or uninitialized
variables.

Reply via email to