public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Antoni Boucher <bouanto@zoho.com>,
	gcc-patches@gcc.gnu.org, jit@gcc.gnu.org
Subject: Re: [PATCH] libgccjit: Handle truncation and extension for casts [PR 95498]
Date: Tue, 14 Jul 2020 17:15:03 -0400	[thread overview]
Message-ID: <e8a24f62aa15780e834fb26865b5ac6579e466da.camel@redhat.com> (raw)
In-Reply-To: <20200713003002.bs5hwv4gav6ml5rt@bouanto-laptop.localdomain>

On Sun, 2020-07-12 at 20:30 -0400, Antoni Boucher via Jit wrote:
> Hello.
> 
> As mentioned in bug 95498, some conversions do not work. After 
> investigation, it turns out that it's caused by multiple casts on an 
> expression where it should do a truncation/extension.

Thanks for investigating this.

> I added a testcase, but for some reasons, the tests only pass when
> ran 
> via `./testsuite/jit/test-cast.c.exe`, not when ran via `make check-
> jit 
> RUNTESTFLAGS="-v -v -v  jit.exp=test-cast.c"`.

That's weird.

It sounds like you're following the instructions on 
https://gcc.gnu.org/onlinedocs/jit/internals/index.html#running-the-test-suite

If you're not specifying LD_LIBRARY_PATH, it might be that when you
run 
  ./testsuite/jit/test-cast.c.exe
directly that the version of libgccjit.so that the exe gets dynamically
linked against might not be the one you expect (e.g. a distribution-
provided libgccjit.so, rather than the one in your build
directory).  Maybe that explains the differences in behavior?  (or
maybe somehow "make check-jit" is using the wrong DSO???).  You could
try exporting LD_DEBUG=files (or somesuch) to get info on which
libgccjit.so is being used in each manner of invoking the test.

There are some notes at the URL above on how to run a test under gdb.

If all else fails, add some printfs and look at the output from "make
check-jit", and look at jit.sum and jit.log (though you don't specify
how the tests fail to pass when run that way)

> Furthermore, some other tests failed, but they also fail on master.

Which tests are failing for you?  (and for what configuration triplet?)

> Also, I was under the impression that adding `STRIP_TYPE_NOPS
> (t_expr);` 
> in `playback::context::build_cast` would be a better fix for this,
> but 
> that doesn't fix the issue.
> Am I missing something?

I'm not sure yet what the best fix would be.  In general I try to mimic
C behavior as much as is reasonable, but off the top of my head I'm not
sure what the C frontend does here.

> It's my first contribution to gcc, so I'd need help for fixing the
> tests 
> and also a confirmation that this is the best way to fix this issue.

Thanks for posting the patch; I hope the above is helpful
Dave


  reply	other threads:[~2020-07-14 21:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13  0:30 Antoni Boucher
2020-07-14 21:15 ` David Malcolm [this message]
2020-07-21 21:29 ` Andrea Corallo
2020-10-15 19:00   ` Antoni Boucher
2021-02-13  1:35   ` Antoni Boucher
2021-02-20 18:20 ` Tom Tromey
2021-02-20 22:17   ` Antoni Boucher
2021-05-13  8:34     ` Martin Liška
2021-05-13 22:13     ` David Malcolm
2021-05-13 23:31       ` Antoni Boucher
2021-05-13 23:58         ` David Malcolm
2021-05-26  0:16           ` Antoni Boucher
2021-05-27 22:21             ` David Malcolm
2021-05-28  1:22               ` Antoni Boucher
2021-06-11 17:49                 ` David Malcolm
2021-06-18 20:42                   ` Antoni Boucher
2021-06-18 20:54                     ` David Malcolm
2021-06-18 21:11                       ` Antoni Boucher
2021-06-19  9:08                         ` Bernhard Reutner-Fischer
2021-07-06 13:00                           ` Antoni Boucher
2021-07-08 20:44                             ` David Malcolm
2021-07-08 21:28                               ` Antoni Boucher
2021-07-08 21:34                                 ` David Malcolm

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=e8a24f62aa15780e834fb26865b5ac6579e466da.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=bouanto@zoho.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jit@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).