[llvm-dev] GEP with a null pointer base

Chandler Carruth via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 10 12:00:01 PDT 2017


On Mon, Jul 10, 2017 at 2:36 PM Peter Lawrence <peterl95124 at sbcglobal.net>
wrote:

> The question is what should LLVM do with UB in general, saying that
> we are going to change one specific idiom from undefined to defined glosses
> over the real question: why should we ever optimize / delete any UB at all
> ?
>
> This “depressing and faintly terrifying thing” as you call it, should be
> viewed not as
> an opportunity for optimization, but rather as the source of bugs that
> need to be
> warned about at the very least.
>
> The current action is to delete UB (without warning), is that really right
> ?
> Who can possibly benefit from this optimization ?
> And how can that ever outweigh the harm in not reporting an error ?
> Why are we expending any effort at all to optimize something that just
> about everyone agrees should always be avoided ?
>
> These last questions are all rhetorical so no need to answer them, the
> problem
> as I see it now is that everyone CC'ed on this email probably by now would
> agree
> privately that optimizing away undefined behavior is wrong, but no one
> wants
> to be the first to say so publicly. We’re stuck in a log-jam. We need
> someone like
> you to take that first step so the rest can go along.
>
> Please help in un-jamming the current log-jam.
>

As several others have pointed out, we are not in a log-jam and your
hypothesis about how people feel is false.

However, I also want to point out that using rhetorical questions (or more
broadly, rhetorical devices and techniques) is probably not the best
approach for any of these discussions. And down this path comes a form of
dialog that has been a problem in prior discussions, so I strongly urge you
to phrase your emails differently.

If you want to persuade people on this list about how LLVM should work, I
would suggest that you to avoid rhetoric and instead focus on actually
making changes to LLVM (it is open source) and showing the empirical
results of the experiment.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170710/ab8f1c91/attachment.html>


More information about the llvm-dev mailing list