This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Isolate erroneous paths optimization -- preserve *0.


On Tue, 12 Nov 2013, Jeff Law wrote:

Here's a patch which arranges to leave a null pointer dereferece in the IL. For a memory load through a null pointer, we just leave the statement as-is since the LHS is going to be a throw-away SSA_NAME. For a store through a null pointer, we try to simplify the RHS when it's trivially easy to do so (when the RHS is an integral type). This allows DCE to sometimes do a better job if the RHS is something that was computed on the isolated path. This could be easily extended to floating types, vectors and structures if someone is interested. We issue the builtin_trap after the null dereference.

You didn't like Jakub's comment about __builtin_unreachable?

-  /* Now delete all remaining statements in this block.  */
+     If the dereference is a load, then there's nothing to do as the
+     LHS will be a throw-away SSA_NAME and the LHS is the NULL dereference.

I assume the second LHS should be RHS. Don't you want to mark it somehow
so the next DCE doesn't remove it?

For PR59083, signals as yet another control flow mechanism are a pain...

--
Marc Glisse


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]