public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/102498] [9/10/11/12 Regression] Long double constant and non-default rounding mode on x86
Date: Tue, 28 Sep 2021 01:14:05 +0000	[thread overview]
Message-ID: <bug-102498-4-t7oyNHj5jf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102498-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102498

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Vincent Lefèvre from comment #5)
> (In reply to Andrew Pinski from comment #4)
> > A regression since GCC 3.2 (r0-47863-g881b2a9652748ad).
> 
> Always reproducible with GCC 5. But with GCC 4.7 to 4.9, it seems that one
> needs -O1 to get fldpi generated. I can't reproduce the bug with GCC 4.1.2
> to 4.6.4 on godbolt (even with -O3).

Here is a testcase which shows it can be reproduced all the back to GCC 4.1.2
even:

#include <fenv.h>

#define X 0xc.90fdaa22168c235p-2l
#define Y 0xc.90fdaa22168c234p-2l
__attribute__((noinline))
void g(long double x){}
__attribute((noinline))
int f(long double z)
{
  volatile long double x, y;

  fesetround (FE_TOWARDZERO);
  x = X + z;
  g(x);
  y = Y + z;
  return x - y == ((X) - (Y)) ? 0 : 1;
}


int main (void)
{
    f(0);
}

  parent reply	other threads:[~2021-09-28  1:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27 14:27 [Bug c/102498] New: wrong output of printf with long double constant and non-default rounding mode zimmerma+gcc at loria dot fr
2021-09-27 15:00 ` [Bug c/102498] wrong output of printf with long double constant (pi) " vincent-gcc at vinc17 dot net
2021-09-27 15:11 ` [Bug target/102498] " jakub at gcc dot gnu.org
2021-09-27 15:20 ` jakub at gcc dot gnu.org
2021-09-27 16:50 ` vincent-gcc at vinc17 dot net
2021-09-27 22:35 ` [Bug target/102498] [9/10/11/12 Regression] Long double constant and non-default rounding mode on x86 pinskia at gcc dot gnu.org
2021-09-28  0:57 ` vincent-gcc at vinc17 dot net
2021-09-28  1:14 ` pinskia at gcc dot gnu.org [this message]
2021-09-28  8:17 ` vincent-gcc at vinc17 dot net
2021-09-28 11:03 ` cvs-commit at gcc dot gnu.org
2021-09-28 11:07 ` cvs-commit at gcc dot gnu.org
2021-09-28 11:10 ` [Bug target/102498] [9/10 " jakub at gcc dot gnu.org
2022-05-10  8:20 ` cvs-commit at gcc dot gnu.org
2022-05-10  8:46 ` zimmerma+gcc at loria dot fr
2022-05-10 11:57 ` vincent-gcc at vinc17 dot net
2022-05-10 12:00 ` vincent-gcc at vinc17 dot net
2022-05-11  6:22 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:36 ` jakub at gcc dot gnu.org

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=bug-102498-4-t7oyNHj5jf@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).