mailing list of musl libc
 help / color / mirror / code / Atom feed
From: ardi <ardillasdelmonte@gmail.com>
To: musl@lists.openwall.com
Subject: Re: Views on bare metal port
Date: Sun, 1 Apr 2018 13:19:01 +0200	[thread overview]
Message-ID: <CA+fZqCX_bxjDcEBtXonJieFE-4xyU5fT+d47_5B=xNGAoE+Pdw@mail.gmail.com> (raw)
In-Reply-To: <20180131182546.GL4418@port70.net>

On Wed, Jan 31, 2018 at 7:25 PM, Szabolcs Nagy <nsz@port70.net> wrote:
>
> note that in particular for math code llvm is problematic.
>
> i'm not aware of any issues in musl libm currently, but
> rounding mode changes can break in unexpected ways because
> there is no support for -frounding-math (last time i checked
> the few cases where it matters clang did not miscompile those,
> but this is not actively tested)
>
> an illustration of the kind of things that can go wrong:
> https://github.com/freebsd/freebsd/commit/e7b0a63c190c7ecb475b09f41387a75952540f49
> we don't have equivalent hacks in musl.

Being a clang user, this comment has worried me, because, according to
this bug report, there's a risk of generating wrong code:

https://bugs.llvm.org/show_bug.cgi?id=8100

However, a participant in the bug comments, argues that this doesn't
really violate standards compliance, just that a C99 feature is not
implemented yet, and that a warning will be triggered:

>> (quoting Richard Smith at bug report above):
>>
>> You are mistaken. Setting the rounding mode
>> without using #pragma STDC FENV_ACCESS ON
>> invokes undefined behavior. See C11 7.6.1/2. (This
>> pragma does not exist in C++, so <cfenv> is
>> unusable, but that's not our fault...)
>>
>> Clang doesn't support that pragma, making this
>> an unimplemented feature from C99, for which we
>> will produce a warning or error. That's the subject of
>> this enhancement request.

Now, and to the point that really interests me (generating safe code
from a clang+musl environment):

- What kind of math operations can be affected by this bug?

- Is there any workaround at this moment?

- Or is gcc the only compiler that can generate valid math code with
musl at this moment and we should better wait until clang gets bug
8100 fixed?

Thanks!

ardi


  parent reply	other threads:[~2018-04-01 11:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAOUYtQBwKmfwjmxUy+mfd0Qg+n78rCwKtK2=X6xgK-Cmt6EGXQ@mail.gmail.com>
     [not found] ` <CAOUYtQB4+8Yey+Q2yT3GWqTiobgPNf60G6dZHjUyjbj1SUC0TA@mail.gmail.com>
     [not found]   ` <CAOUYtQD1LF03fbZ3U4e=s3uXiiY46jkuTjvzdfnz=c3mvzCrhw@mail.gmail.com>
     [not found]     ` <CAOUYtQAZ-90b39f0Okz+KsnYK9G1FwdpTGtMSwJsWtsPwEWM-Q@mail.gmail.com>
     [not found]       ` <CAOUYtQCNCU4rN74+HHmBTfgLTEdAhypWSL1L=Ooc1ocqjpEW_Q@mail.gmail.com>
     [not found]         ` <CAOUYtQCCwhp-RSmod+dzLrFzqrR_Om-p6dD5kEkNtMT2B48FjQ@mail.gmail.com>
     [not found]           ` <CAOUYtQDM4BW=WEXD5RK2YWf+3zj+opBuK8vsPwEPfyM3Hyo_6w@mail.gmail.com>
     [not found]             ` <CAOUYtQCsJU_qczmjpH8NHbgqSHVLEAYOdpHVu7nmkie3zWAAyw@mail.gmail.com>
     [not found]               ` <CAOUYtQDc8VHkH13Ah_+azk+goeOsthjFOhE4KfV6PCMoMKfukA@mail.gmail.com>
     [not found]                 ` <CAOUYtQCJD1Y-xV2bbBiGxE-W8jSWA9Qm=bzn1ri5Lq9+ACKSLw@mail.gmail.com>
     [not found]                   ` <CAOUYtQA3i8-z+LtzDbsUTJmLn76UXvDUpbKVHNfECSCMrPdiKA@mail.gmail.com>
     [not found]                     ` <CAOUYtQBDV0_0hkjtT3A+uOqnDkuKD-ZDr_DLo=DVSO5B6YZ3AA@mail.gmail.com>
     [not found]                       ` <CAOUYtQCHi6qR+=Jae--6M1VzeSiDBjj9_86hkpmN=XhSFDTTiQ@mail.gmail.com>
2018-01-31 13:38                         ` Jon Chesterfield
2018-01-31 15:25                           ` Rich Felker
2018-01-31 17:51                             ` Jon Chesterfield
2018-01-31 18:25                               ` Szabolcs Nagy
2018-01-31 18:37                                 ` Jon Chesterfield
2018-01-31 19:11                                   ` Rich Felker
2018-04-01 11:19                                 ` ardi [this message]
2018-04-01 14:29                                   ` Szabolcs Nagy
2018-04-01 20:12                                     ` ardi
2018-02-17 22:37                           ` ardi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+fZqCX_bxjDcEBtXonJieFE-4xyU5fT+d47_5B=xNGAoE+Pdw@mail.gmail.com' \
    --to=ardillasdelmonte@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).