public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: libffi-discuss@sourceware.org,
		"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Anthony Green <green@moxielogic.com>,
	Richard Henderson <rth@redhat.com>,
		Ian Lance Taylor <iant@google.com>
Subject: [PATCH, libffi, alpha]: Use FFI_ASSERT in ffi_closure_osf_inner
Date: Mon, 21 Jul 2014 18:21:00 -0000	[thread overview]
Message-ID: <CAFULd4ZDJxVU+v7fLOd3jW73LUn0LEcBdwHZpdre4hcGLa6wyw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

Hello!

Attached patch fixes libgo reflect test failure with libffi closures.
The gccgo compiler started to use FFI closures recently; the compiler
passes ffi_type_void for structures with zero members.

ffi_call form src/alpha/ffi.c allows FFI_TYPE_VOID arguments in
non-debug mode through the default: case, but ffi_closure_osf_inner
aborts with this type of argument.

The patch changes the default case in ffi_closure_osf_inner from abort
to FFI_ASSERT, an this way synchronizes argument handling in both
cases.

2014-07-21  Uros Bizjak  <ubizjak@gmail.com>

    * src/alpha/ffi.c: Do not include stdlib.h.
    (ffi_closure_osf_inner) <default>: Use FFI_ASSERT instead of abort.

Patch was tested with libffi testsuite on alphaev6-linux-gnu.
Additionally, the patch fixed reflect test from the libgo testsuite
and go.test/test/recover.go test from the gcc testsuite.

Uros.

[-- Attachment #2: f.diff.txt --]
[-- Type: text/plain, Size: 584 bytes --]

Index: src/alpha/ffi.c
===================================================================
--- src/alpha/ffi.c	(revision 212882)
+++ src/alpha/ffi.c	(working copy)
@@ -27,7 +27,6 @@
 
 #include <ffi.h>
 #include <ffi_common.h>
-#include <stdlib.h>
 
 /* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE;
    all further uses in this file will refer to the 128-bit type.  */
@@ -273,7 +272,7 @@ ffi_closure_osf_inner(ffi_closure *closure, void *
 	  break;
 
 	default:
-	  abort ();
+	  FFI_ASSERT (0);
 	}
 
       argn += ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;

             reply	other threads:[~2014-07-21 18:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21 18:21 Uros Bizjak [this message]
2014-07-25  9:03 ` Uros Bizjak
2014-09-20 10:04 ` Anthony Green
2014-09-20 18:28   ` Jay
2014-09-20 22:04   ` Ian Lance Taylor
2014-09-21  9:17   ` Uros Bizjak

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=CAFULd4ZDJxVU+v7fLOd3jW73LUn0LEcBdwHZpdre4hcGLa6wyw@mail.gmail.com \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=green@moxielogic.com \
    --cc=iant@google.com \
    --cc=libffi-discuss@sourceware.org \
    --cc=rth@redhat.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.
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).