On Tue, Sep 24, 2019 at 01:15:46PM +0200, Richard Biener wrote:
> > build_array_type_nelts is only meaningful for non-zero number of elements,
> > for 0 it creates weirdo arrays like char D.2358[0:18446744073709551615].
> > The following patch uses in that case types like the C FE emits for
> > zero-length array instead (i.e. char D.2358[0:] with forced 0 size).
> > 
> > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> Not sure [0:-1] is actually the canonical zero-length array (and IIRC
> what the C++ FE creates and what layout_type can lay out).  So why

You're right, patch withdrawn.

> not fix the sanitizers instead?

Well, the problem isn't in sanitizers, but jump threading and late warnings
that are warning even about code specialized by jump threading.
It could be indeed solved with __builtin_warning if we defer the late
warnings and ignore them inside of sanitization report only paths (if we can
detect them reliably, perhaps pass dominated by a failed ubsan or asan
sanitization check), or by making jump threading not try to optimize the
cold sanitization diagnostics parts.

        Jakub

Reply via email to