[Vm-dev] compiling the stack VM with LLVM at -Ofasty

Eliot Miranda eliot.miranda at gmail.com
Thu Oct 9 19:42:47 UTC 2014


Hi Hans,

On Oct 9, 2014, at 11:35 AM, Holger Hans Peter Freyther <holger at freyther.de> wrote:

> 
> On Thu, Oct 09, 2014 at 11:20:44AM -0700, Eliot Miranda wrote:
> 
>> What's the bug?  The llvm folks claim their compiler passes the test suites
>> and is correct (but I'm not siding with them).  So I'm very curious...
> 
> Well, a start would be to address the compiler warnings and compiler
> errors (e.g. warnings about integer/long shifts, returning voide from
> a method that should return int)

The shift warnings are not really fixable without going to a #define for something evaluated at compile time (sizeof(sqInt)) so they can be safely ignored, and fixed with something ugly.  Really the C compiler should recognize that the shift warning is in unreachable code.

But other warnings can and should be fixed.  I have fixed all other warnings in the core VM (cointerp.c, interp.c, cogit.c) except an annoying printf warning in cogit.c that IMO shouldn't be fixed because the "fix" adds unnecessary code.  But that leaves the plugins.  Any fixed you have therein are gratefully received.

> 
> I had already raised some of these points when building your cog
> branch on FreeBSD with clang. In terms of system tools using the undefined
> behavior sanitizer and address sanitizer might reveal some further
> issues.
> 
> cheers
>    holger


Eliot (phone)


More information about the Vm-dev mailing list