public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "aldyh at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/107046] [13 Regression] Recent FP range work causing inf-2 to be miscompiled on rx-elf
Date: Tue, 27 Sep 2022 09:39:57 +0000	[thread overview]
Message-ID: <bug-107046-4-1eLXTBeiOz@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107046-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> Ah, probably the
> 
> void test(double f, double i)
> {
> ...
>   if (i != __builtin_inf())
>     abort ();
> 
> int main()
> {
>   test (34.0, __builtin_inf());
> ...
> 
> test is "miscompiled", similar to what we see in povray.
> 
> We can probably gate parts of the testcase with
> 
> #if __FINITE_MATH_ONLY__ == 0

Yeah, I saw that.  Agreed that we should predicate parts of this testcase.

Also, it seems weird that the gimple representation is inconsistent between the
conditional and the call site.  Before einline we have:

void test (double f, double i)
{
  <bb 2> :
  if (i_1(D) <= 3.4028234663852885981170418348451692544e+38)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  abort ();

  <bb 4> :
  return;

}

int main ()
{
  <bb 2> :
  test (3.4e+1,  Inf);

}

Which the inliner through some unknown mechanism (to me), folds to a call to
abort in main.  This is before evrp or ethread.  I wonder how it folded that
with.  Anywho..that's neither here nor there.

What I'm concerned is that INF is being expanded differently between test and
main.  Shouldn't we at least be consistent?

  parent reply	other threads:[~2022-09-27  9:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-26 23:44 [Bug tree-optimization/107046] New: " jeffreyalaw at gmail dot com
2022-09-27  7:20 ` [Bug tree-optimization/107046] " aldyh at gcc dot gnu.org
2022-09-27  8:54 ` rguenth at gcc dot gnu.org
2022-09-27  8:59 ` rguenth at gcc dot gnu.org
2022-09-27  9:39 ` aldyh at gcc dot gnu.org [this message]
2022-09-27 20:12 ` [Bug testsuite/107046] " jeffreyalaw at gmail dot com
2022-12-02 11:16 ` jakub at gcc dot gnu.org
2022-12-05 18:47 ` law at gcc dot gnu.org
2022-12-06 10:43 ` cvs-commit at gcc dot gnu.org
2022-12-22 14:33 ` rguenth at gcc dot gnu.org
2022-12-22 16:08 ` law 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-107046-4-1eLXTBeiOz@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).