On Wed, Dec 12, 2018 at 1:30 AM Andy Gibbs <andyg1...@hotmail.co.uk> wrote:

> On 10 December 2018 18:17, David Blaikie wrote:
>
> Possible that the online one isn't built with assertions enabled (you
> could test this with other known crashers to see if they reproduce on
> godbolt with assertion crash dumps or only with raw segfaults)? If that's
> the case,t hen it's possible that the codepath that should assert continues
> on and perhaps either has unexpected or even undefined behavior but not a
> crash.
>
> Yes, it seems this is right.  I have done a number of further tests and it
> seems that the godbolt compilers are built without asserts.
>
> This, however, is a possible problem generally, isn't it?  I build my
> compilers always with release-asserts but I would guess it common that
> compiler builds are simply release builds.  And this means, if there is a
> bug in the compiler, it may generate invalid code with no warning at all
> (my bug report gives an example of this) where in fact, if it were built
> with asserts then the bug would have been made visible (and maybe fixed!).
>
> I know there can always be bugs which still act invisibly, but given that
> clang is good at sticking asserts everywhere in its code :o) isn't it worth
> ensuring asserts are always enabled?  i.e. build 'release-asserts' even
> when asked to do a release build?
>

Assertions are expensive (at one point the LLVM build system had a warning
about builds with assertions enabled, that they may be 10x slower than
without assertions) - so it's not practical for most folks to run with them
enabled for all their builds.

- Dave


>
> Cheers,
> Andy
>
_______________________________________________
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Reply via email to