mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] -frounding-math breaking src/math/acosf.c
@ 2020-10-09 22:16 joao
  2020-10-09 23:10 ` Rich Felker
  0 siblings, 1 reply; 5+ messages in thread
From: joao @ 2020-10-09 22:16 UTC (permalink / raw)
  To: musl

Hi,

I just noticed that the upstream LLVM is no longer capable of compiling musl 1.2.0 (and possibly more recent versions too) when -frounding-math is in use. I bisected the LLVM commit to https://reviews.llvm.org/D87822, and pointed the problem there.

Just reporting in case someone else also has issues with this.

Best,
Joao.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [musl] -frounding-math breaking src/math/acosf.c
  2020-10-09 22:16 [musl] -frounding-math breaking src/math/acosf.c joao
@ 2020-10-09 23:10 ` Rich Felker
  2020-10-09 23:15   ` joao
  2020-10-12  9:39   ` Szabolcs Nagy
  0 siblings, 2 replies; 5+ messages in thread
From: Rich Felker @ 2020-10-09 23:10 UTC (permalink / raw)
  To: joao; +Cc: musl

On Sat, Oct 10, 2020 at 12:16:13AM +0200, joao@overdrivepizza.com wrote:
> Hi,
> 
> I just noticed that the upstream LLVM is no longer capable of
> compiling musl 1.2.0 (and possibly more recent versions too) when
> -frounding-math is in use. I bisected the LLVM commit to
> https://reviews.llvm.org/D87822, and pointed the problem there.
> 
> Just reporting in case someone else also has issues with this.
> 
> Best,
> Joao.

Thanks. This probably needs to be reported as aa bug against LLVM (or
clang?) rather than just a comment on the review so that it's tracked
as such. It seems they've erroneously made it treat static
initializers as non-constant-expressions rather than evaluating them
statically in the default rounding mode per the spec.

Rich

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [musl] -frounding-math breaking  src/math/acosf.c
  2020-10-09 23:10 ` Rich Felker
@ 2020-10-09 23:15   ` joao
  2020-10-12  9:39   ` Szabolcs Nagy
  1 sibling, 0 replies; 5+ messages in thread
From: joao @ 2020-10-09 23:15 UTC (permalink / raw)
  To: Rich Felker; +Cc: musl

> Thanks. This probably needs to be reported as aa bug against LLVM (or
> clang?) rather than just a comment on the review so that it's tracked
> as such.

Makes sense, I'll submit/report it.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [musl] -frounding-math breaking src/math/acosf.c
  2020-10-09 23:10 ` Rich Felker
  2020-10-09 23:15   ` joao
@ 2020-10-12  9:39   ` Szabolcs Nagy
  2020-12-18 17:13     ` Fangrui Song
  1 sibling, 1 reply; 5+ messages in thread
From: Szabolcs Nagy @ 2020-10-12  9:39 UTC (permalink / raw)
  To: Rich Felker; +Cc: joao, musl

* Rich Felker <dalias@libc.org> [2020-10-09 19:10:00 -0400]:

> On Sat, Oct 10, 2020 at 12:16:13AM +0200, joao@overdrivepizza.com wrote:
> > Hi,
> > 
> > I just noticed that the upstream LLVM is no longer capable of
> > compiling musl 1.2.0 (and possibly more recent versions too) when
> > -frounding-math is in use. I bisected the LLVM commit to
> > https://reviews.llvm.org/D87822, and pointed the problem there.
> > 
> > Just reporting in case someone else also has issues with this.
> > 
> > Best,
> > Joao.
> 
> Thanks. This probably needs to be reported as aa bug against LLVM (or
> clang?) rather than just a comment on the review so that it's tracked
> as such. It seems they've erroneously made it treat static
> initializers as non-constant-expressions rather than evaluating them
> statically in the default rounding mode per the spec.

const expressions should work as described in

http://port70.net/~nsz/c/c11/n1570.html#F.8.4

but it seems clang handles literals that don't
need conversion:

float x = 0.1f; // works
float y = 0.1; // fails

we may want to fix this anyway in musl to always
use the right type of literal (then it's clear
that there is no double rounding).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [musl] -frounding-math breaking src/math/acosf.c
  2020-10-12  9:39   ` Szabolcs Nagy
@ 2020-12-18 17:13     ` Fangrui Song
  0 siblings, 0 replies; 5+ messages in thread
From: Fangrui Song @ 2020-12-18 17:13 UTC (permalink / raw)
  To: musl, Rich Felker, joao

On Mon, Oct 12, 2020 at 2:40 AM Szabolcs Nagy <nsz@port70.net> wrote:
>
> * Rich Felker <dalias@libc.org> [2020-10-09 19:10:00 -0400]:
>
> > On Sat, Oct 10, 2020 at 12:16:13AM +0200, joao@overdrivepizza.com wrote:
> > > Hi,
> > >
> > > I just noticed that the upstream LLVM is no longer capable of
> > > compiling musl 1.2.0 (and possibly more recent versions too) when
> > > -frounding-math is in use. I bisected the LLVM commit to
> > > https://reviews.llvm.org/D87822, and pointed the problem there.
> > >
> > > Just reporting in case someone else also has issues with this.
> > >
> > > Best,
> > > Joao.
> >
> > Thanks. This probably needs to be reported as aa bug against LLVM (or
> > clang?) rather than just a comment on the review so that it's tracked
> > as such. It seems they've erroneously made it treat static
> > initializers as non-constant-expressions rather than evaluating them
> > statically in the default rounding mode per the spec.
>
> const expressions should work as described in
>
> http://port70.net/~nsz/c/c11/n1570.html#F.8.4

clang main has fixed (https://reviews.llvm.org/D89360) the regression
of https://reviews.llvm.org/D87822

> but it seems clang handles literals that don't
> need conversion:
>
> float x = 0.1f; // works
> float y = 0.1; // fails
>
> we may want to fix this anyway in musl to always
> use the right type of literal (then it's clear
> that there is no double rounding).

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-18 17:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 22:16 [musl] -frounding-math breaking src/math/acosf.c joao
2020-10-09 23:10 ` Rich Felker
2020-10-09 23:15   ` joao
2020-10-12  9:39   ` Szabolcs Nagy
2020-12-18 17:13     ` Fangrui Song

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).