public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org,	jit@gcc.gnu.org
Cc: David Malcolm <dmalcolm@redhat.com>
Subject: [committed] Fix jit.dg/test-alignment* (PR jit/82846)
Date: Mon, 01 Jan 2018 00:00:00 -0000	[thread overview]
Message-ID: <1516841604-40283-1-git-send-email-dmalcolm@redhat.com> (raw)

These testcases jit-compile functions that return char, but
were erroneously calling them as if they returned int.

This led to errors for certain target configurations (e.g.
reading from %eax (32-bit) in the harness when only %al (8-bit)
had been written to in the jit-compiled function).

Regrtested on x86_64-pc-linux-gnu, and smoketested with
"-with-arch=haswell--with-cpu=haswell".

Committed to trunk as r257037.

gcc/testsuite/ChangeLog:
	PR jit/82846
	* jit.dg/test-alignment.c (create_aligned_code): Fix return type
	of "fn_type" typedef.
	* jit.dg/test-alignment.cc (verify_aligned_code): Likewise.
---
 gcc/testsuite/jit.dg/test-alignment.c  | 2 +-
 gcc/testsuite/jit.dg/test-alignment.cc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/jit.dg/test-alignment.c b/gcc/testsuite/jit.dg/test-alignment.c
index 686d981..82328d5 100644
--- a/gcc/testsuite/jit.dg/test-alignment.c
+++ b/gcc/testsuite/jit.dg/test-alignment.c
@@ -166,7 +166,7 @@ create_aligned_code (gcc_jit_context *ctxt, const char *struct_name,
 				   gcc_jit_result *result,		\
 				   const char *writer_fn_name)		\
   {									\
-  typedef int (*fn_type) (struct TYPENAME *);				\
+  typedef char (*fn_type) (struct TYPENAME *);				\
   CHECK_NON_NULL (result);						\
 									\
   struct TYPENAME tmp;							\
diff --git a/gcc/testsuite/jit.dg/test-alignment.cc b/gcc/testsuite/jit.dg/test-alignment.cc
index 3e99209..9a09a41 100644
--- a/gcc/testsuite/jit.dg/test-alignment.cc
+++ b/gcc/testsuite/jit.dg/test-alignment.cc
@@ -126,7 +126,7 @@ verify_aligned_code (gcc_jit_context *ctxt,
                      gcc_jit_result *result,
                      const char *writer_fn_name)
 {
-  typedef int (*fn_type) (T *);
+  typedef char (*fn_type) (T *);
   CHECK_NON_NULL (result);
 
   T tmp;
-- 
1.8.5.3

                 reply	other threads:[~2018-01-25  0:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1516841604-40283-1-git-send-email-dmalcolm@redhat.com \
    --to=dmalcolm@redhat.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).