public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [SPARC] Fix PR target/87807
Date: Wed, 05 Dec 2018 13:16:00 -0000	[thread overview]
Message-ID: <yddftvc867m.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <37650183.iAzO7P3RYW@polaris> (Eric Botcazou's message of "Fri,	30 Nov 2018 00:08:24 +0100")

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

Hi Eric,

> This started as a simple fix for a small issue (passing floating-point vectors 
> to variadic functions in 64-bit mode) and then evolved into a small cleanup of 
> the code implementing the calling conventions of the 2 SPARC ABIs.
>
> Tested and compat-regtested on SPARC/Solaris 11, applied on the mainline.
>
>
> 2018-11-29  Eric Botcazou  <ebotcazou@adacore.com>
>
> 	PR target/87807
> 	* config/sparc/sparc-modes.def: Minor tweak.
> 	* config/sparc/sparc.c: Minor reordering.
> 	(sparc_pass_by_reference): Move around.
> 	(traverse_record_type): Change offset from HOST_WIDE_INT to int.
> 	(classify_registers): Likewise for bitpos.
> 	(function_arg_slotno): Remove dead test and tweak comments.
> 	<MODE_RANDOM>: Remove useless assertion and test whether the
> 	parameter is named in order to pass it in FP registers.  Return
> 	the regno for floating-point vector types.
> 	(compute_int_layout): Change bitpos from HOST_WIDE_INT to int.
> 	(compute_fp_layout): Likewise.
> 	(count_registers): Likewise.
> 	(assign_int_registers): Likewise.
> 	(assign_fp_registers): Likewise.
> 	(assign_registers): Likewise.
> 	(function_arg_record_value): Change size from HOST_WIDE_INT to int
> 	and use CEIL_NWORDS to compute the number of registers.
> 	(function_arg_union_value): Minor tweaks.
> 	(function_arg_vector_value): Add slotno and named parameters, use
> 	CEIL_NWORDS to compute the number of registers.
> 	(sparc_function_arg_1): Rework handling of vector types.  Change
> 	size from HOST_WIDE_INT to int.
> 	(sparc_arg_partial_bytes): Rework handling of 32-bit ABI and deal
> 	with vector types for the 64-bt ABI.
> 	(sparc_function_arg_advance): Likewise.
> 	(sparc_return_in_memory): Add reference to -fpcc-struct-return.
> 	(sparc_struct_value_rtx): Return NULL_RTX instead of 0.
> 	(sparc_function_value_1): Rework handling of vector types.  Change
> 	size from HOST_WIDE_INT to int.
>
>
> 2018-11-29  Eric Botcazou  <ebotcazou@adacore.com>
>
> 	* gcc.target/sparc/20181129-1.c: New test.
> 	* gcc.target/sparc/20181129-2.c: Likewise.

unfortunately, the new tests FAIL to compile, both 32 and 64-bit:

+FAIL: gcc.target/sparc/20181129-1.c (test for excess errors)
+UNRESOLVED: gcc.target/sparc/20181129-1.c compilation failed to produce executable
+FAIL: gcc.target/sparc/20181129-2.c (test for excess errors)
+UNRESOLVED: gcc.target/sparc/20181129-2.c compilation failed to produce executable

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.target/sparc/20181129-1.c:17:3: error: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.target/sparc/20181129-2.c: In function 'f':
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.target/sparc/20181129-2.c:17:3: error: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

The following patch fixes this by building as C99.  Alternatively, it
would work just as well to split the x declaration and initialization.

Tested on sparc-sun-solaris2.11.  Ok for mainline?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2018-12-04  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.target/sparc/20181129-1.c: Compile with -std=c99.
	* gcc.target/sparc/20181129-2.c: Likewise.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: testsuite-sparc-20181129-c99.patch --]
[-- Type: text/x-patch, Size: 914 bytes --]

# HG changeset patch
# Parent  3a9647e8254db33d54bc0ed4f11e3b89fcda10b2
Build gcc.target/sparc/20181129-?.c as C99

	* gcc.target/sparc/20181129-1.c: Compile with -std=c99.
	* gcc.target/sparc/20181129-2.c: Likewise.

diff --git a/gcc/testsuite/gcc.target/sparc/20181129-1.c b/gcc/testsuite/gcc.target/sparc/20181129-1.c
--- a/gcc/testsuite/gcc.target/sparc/20181129-1.c
+++ b/gcc/testsuite/gcc.target/sparc/20181129-1.c
@@ -2,6 +2,7 @@
 /* Reported by Rainer Orth <ro@gcc.gnu.org> */
 
 /* { dg-do run } */
+/* { dg-options "-std=c99" } */
 
 #include <stdarg.h>
 
diff --git a/gcc/testsuite/gcc.target/sparc/20181129-2.c b/gcc/testsuite/gcc.target/sparc/20181129-2.c
--- a/gcc/testsuite/gcc.target/sparc/20181129-2.c
+++ b/gcc/testsuite/gcc.target/sparc/20181129-2.c
@@ -2,6 +2,7 @@
 /* Reported by Rainer Orth <ro@gcc.gnu.org> */
 
 /* { dg-do run } */
+/* { dg-options "-std=c99" } */
 
 #include <stdarg.h>
 

  reply	other threads:[~2018-12-05 13:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29 23:08 Eric Botcazou
2018-12-05 13:16 ` Rainer Orth [this message]
2018-12-05 13:50   ` Jeff Law
2018-12-05 15:39   ` Eric Botcazou

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=yddftvc867m.fsf@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-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).