Re: clang miscompiles OpenLibm on i686-*-freebsd

From: Steve Kargl <sgk_at_troutmask.apl.washington.edu>
Date: Tue, 8 Sep 2020 14:15:49 -0700
On Tue, Sep 08, 2020 at 09:11:50PM +0200, Dimitry Andric wrote:
> On 8 Sep 2020, at 19:47, Steve Kargl <sgk_at_troutmask.apl.washington.edu> wrote:
> > 
> > I think I've found the problem, and it appears to be
> > due to a change byt Openlibm developers to the file
> > math_private.h copied from FreeBSD.  Namely, one finds
> > 
> > //VBS
> > #define STRICT_ASSIGN(type, lval, rval) ((lval) = (rval))
> > 
> > /* VBS
> > #ifdef FLT_EVAL_METHOD
> > // Attempt to get strict C99 semantics for assignment with non-C99 compilers.
> > #if FLT_EVAL_METHOD == 0 || __GNUC__ == 0
> > #define STRICT_ASSIGN(type, lval, rval) ((lval) = (rval))
> > #else
> > #define STRICT_ASSIGN(type, lval, rval) do { \
> > volatile type __lval;   \
> >      \
> > if (sizeof(type) >= sizeof(double)) \
> >  (lval) = (rval);  \
> > else {     \
> >  __lval = (rval);  \
> >  (lval) = __lval;  \
> > }     \
> > } while (0)
> > #endif
> > #endif
> > */
> > 
> > So, STRICT_ASSIGN is broken in Openlibm.  I'll be reporting
> > a bug upstream.  Apoogies for the noise.
> 
> Hi Steve,
> 
> I'm curious what their rationale was, as the commit that changed it is:
> 
> https://github.com/JuliaMath/openlibm/commit/f5fb92746715beb0441a60feca202ee16cb19fc9
> 
> with a description of just "Build with gcc"... Maybe they've assumed gcc
> never needs the volatile approach?
> 

I have no idea why OpenLibm would change math_private.h.  I've 
reported the issue at https://github.com/JuliaMath/openlibm/issues/215

-- 
Steve
Received on Tue Sep 08 2020 - 19:15:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:25 UTC