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-6402] testsuite: Handle "packed" targets in c-c++-common/auto-init-7.c and -8.c
Date: Thu,  2 Mar 2023 01:09:10 +0000 (GMT)	[thread overview]
Message-ID: <20230302010910.3776F3858D33@sourceware.org> (raw)

https://gcc.gnu.org/g:854a268dccd7976bfc17584be8f9b2afa6c51fa0

commit r13-6402-g854a268dccd7976bfc17584be8f9b2afa6c51fa0
Author: Hans-Peter Nilsson <hp@axis.com>
Date:   Wed Feb 15 20:11:58 2023 +0100

    testsuite: Handle "packed" targets in c-c++-common/auto-init-7.c and -8.c
    
    Looks like there's a failed assumption that
    sizeof (union U { char u1[5]; int u2; float u3; }) == 8.
    However, for "packed" targets like cris-elf, it's 5.
    
    These two tests have always failed for cris-elf.  I see from
    https://gcc.gnu.org/pipermail/gcc-testresults/2023-February/777912.html
    that they fail on pru-elf too, but I don't know if the cause
    (and/or remedy) is the same.
    
    IMHO this is preferred over the alternative; splitting up
    that last line into two lines, like:
    /* { dg-final { scan-tree-dump "temp4 = \
     .DEFERRED_INIT \\(8, 2, \&\"temp4\"" "gimple" { target { ! default_packed } } } } */
    /* { dg-final { scan-tree-dump "temp4 = \
     .DEFERRED_INIT \\(5, 2, \&\"temp4\"" "gimple" { target default_packed } } } */
    
    gcc/testsuite:
            * c-c++-common/auto-init-7.c, c-c++-common/auto-init-8.c: Also
            match targets where sizeof (union U) == 5, like "packed" targets.

Diff:
---
 gcc/testsuite/c-c++-common/auto-init-7.c | 2 +-
 gcc/testsuite/c-c++-common/auto-init-8.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/auto-init-7.c b/gcc/testsuite/c-c++-common/auto-init-7.c
index b44dd5e68ed..dd48d691596 100644
--- a/gcc/testsuite/c-c++-common/auto-init-7.c
+++ b/gcc/testsuite/c-c++-common/auto-init-7.c
@@ -32,4 +32,4 @@ double foo()
 /* { dg-final { scan-tree-dump "temp1 = .DEFERRED_INIT \\(12, 2, \&\"temp1\"" "gimple" } } */
 /* { dg-final { scan-tree-dump "temp2 = .DEFERRED_INIT \\(24, 2, \&\"temp2\"" "gimple" } } */
 /* { dg-final { scan-tree-dump "temp3 = .DEFERRED_INIT \\(28, 2, \&\"temp3\"" "gimple" } } */
-/* { dg-final { scan-tree-dump "temp4 = .DEFERRED_INIT \\(8, 2, \&\"temp4\"" "gimple" } } */
+/* { dg-final { scan-tree-dump "temp4 = .DEFERRED_INIT \\((8|5), 2, \&\"temp4\"" "gimple" } } */
diff --git a/gcc/testsuite/c-c++-common/auto-init-8.c b/gcc/testsuite/c-c++-common/auto-init-8.c
index 739ac028931..863f2ba87d7 100644
--- a/gcc/testsuite/c-c++-common/auto-init-8.c
+++ b/gcc/testsuite/c-c++-common/auto-init-8.c
@@ -32,4 +32,4 @@ double foo()
 /* { dg-final { scan-tree-dump "temp1 = .DEFERRED_INIT \\(12, 1, \&\"temp1\"" "gimple" } } */
 /* { dg-final { scan-tree-dump "temp2 = .DEFERRED_INIT \\(24, 1, \&\"temp2\"" "gimple" } } */
 /* { dg-final { scan-tree-dump "temp3 = .DEFERRED_INIT \\(28, 1, \&\"temp3\"" "gimple" } } */
-/* { dg-final { scan-tree-dump "temp4 = .DEFERRED_INIT \\(8, 1, \&\"temp4\"" "gimple" } } */
+/* { dg-final { scan-tree-dump "temp4 = .DEFERRED_INIT \\((8|5), 1, \&\"temp4\"" "gimple" } } */

                 reply	other threads:[~2023-03-02  1:09 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=20230302010910.3776F3858D33@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).