public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hp@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-6434] testsuite: Tweak gcc.dg/attr-aligned.c for CRIS
Date: Fri,  3 Mar 2023 03:33:30 +0000 (GMT)	[thread overview]
Message-ID: <20230303033330.405983858D33@sourceware.org> (raw)

https://gcc.gnu.org/g:dc1be3eb33c7f37ac45ad0ccf5be063134a513be

commit r13-6434-gdc1be3eb33c7f37ac45ad0ccf5be063134a513be
Author: Hans-Peter Nilsson <hp@axis.com>
Date:   Thu Feb 16 20:21:50 2023 +0100

    testsuite: Tweak gcc.dg/attr-aligned.c for CRIS
    
    tm.texi says for BIGGEST_ALIGNMENT (from which
    __BIGGEST_ALIGNMENT__ is derived): "Biggest alignment that
    any data type can require on this machine, in bits."
    
    That is, using that value might be too strict for alignment
    of *functions* and CRIS requires at least 16-bit alignment
    for functions.  But, one purpose of the test is to test that
    alignment can be set to a large but valid value, so pick
    512, which has some use as a historically required alignment
    for certain I/O descriptors.
    
            * gcc.dg/attr-aligned.c: Adjust comment for ALIGN_MAX_STATIC.
            (ALIGN_MAX_STATIC): Set to 512 for CRIS.

Diff:
---
 gcc/testsuite/gcc.dg/attr-aligned.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/attr-aligned.c b/gcc/testsuite/gcc.dg/attr-aligned.c
index 887bdd0f379..4f0c885dc81 100644
--- a/gcc/testsuite/gcc.dg/attr-aligned.c
+++ b/gcc/testsuite/gcc.dg/attr-aligned.c
@@ -18,6 +18,10 @@
 # else
 #   define ALIGN_MAX_STATIC      ALIGN_MAX_HARD
 # endif
+#elif __CRIS__
+/* __BIGGEST_ALIGNMENT__ doesn't cover functions (16 bits for CRIS). */
+#  define ALIGN_MAX_STATIC      512
+#  define ALIGN_TOO_BIG_OFILE   (ALIGN_MAX_HARD << 1)
 #elif pdp11
 #  define ALIGN_MAX_STATIC      2
 /* Work around a pdp11 ICE (see PR target/87821).  */
@@ -29,7 +33,9 @@
 /* Is this processor- or operating-system specific?  */
 #  define ALIGN_MAX_STATIC      ALIGN_MAX_HARD
 #else
-   /* Guaranteed to be accepted regardless of the target.  */
+   /* Guaranteed to be accepted regardless of the target for objects.
+      This might not be true for alignment of functions though, so
+      may need to be set to a target-specific value above.  */
 #  define ALIGN_MAX_STATIC      __BIGGEST_ALIGNMENT__
    /* Guaranteed to be rejected regardless of the target.  */
 #  define ALIGN_TOO_BIG_OFILE   (ALIGN_MAX_HARD << 1)

                 reply	other threads:[~2023-03-03  3:33 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=20230303033330.405983858D33@sourceware.org \
    --to=hp@gcc.gnu.org \
    --cc=gcc-cvs@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).