public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Matthew Fortune <Matthew.Fortune@imgtec.com>
Cc: "java-patches@gcc.gnu.org" <java-patches@gcc.gnu.org>,
	Yunqiang Su <Yunqiang.Su@imgtec.com>
Subject: Re: [RFC] interpreter use of closures and return types
Date: Wed, 22 Jun 2016 16:49:00 -0000	[thread overview]
Message-ID: <20160622164851.GA13195@aurel32.net> (raw)
In-Reply-To: <6D39441BF12EF246A7ABCE6654B023537E45723C@HHMAIL01.hh.imgtec.org>

Hi,

On 2016-06-22 11:54, Matthew Fortune wrote:
> Hi,
> 
> While working on getting mips64el support in place for Debian we found a
> bug relating to libgcj/libffi and closures for MIPS n32 and n64. The bug
> is essentially that return types <= 32bit do not end up correctly sign
> extended in registers when a function is called via a closure. A test case
> showing what I think the problem boils down to is at the end of this email.
> Switch between the two lines in foo_binding to see the difference. Note
> that this will not fail on x86 but I believe it will fail on any big endian
> architecture.
> 
> The root of the problem seems to be in a oddity of FFI that integer return
> values less than word (or rather register) size are returned as an ffi_arg.
> The java interpreter does not appear to adhere to this and the patch below
> seems to fix the issue. Can anyone comment if this looks like the right
> approach?
> 
> I think there may be a similar issue in the lang/reflect/natVMProxy.cc
> code (unbox function) by code inspection alone but haven't investigated
> further.
> 
> If this looks OK I'll do some full testsuite runs.

I have been testing Matthew's patch in the last days. I confirm this
patch correctly fixes the original issue I reported him, the fact that
the Arrays.sort() method sort arrays incorrectly. This in turns cause
ecj to fail finding most of the identifiers. With this patch I can use
ecj and rebuild it with itself without any problem.

Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

      parent reply	other threads:[~2016-06-22 16:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 11:54 Matthew Fortune
2016-06-22 12:28 ` Anthony Green
2016-06-22 12:53   ` Matthew Fortune
2016-06-22 16:49 ` Aurelien Jarno [this message]

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=20160622164851.GA13195@aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=Matthew.Fortune@imgtec.com \
    --cc=Yunqiang.Su@imgtec.com \
    --cc=java-patches@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).