* [PATCH] fix #69573 - FAIL: gcc.dg/pr61053.c
@ 2016-01-31 2:11 Martin Sebor
2016-02-01 11:49 ` Marek Polacek
0 siblings, 1 reply; 2+ messages in thread
From: Martin Sebor @ 2016-01-31 2:11 UTC (permalink / raw)
To: Gcc Patch List, Marek Polacek
[-- Attachment #1: Type: text/plain, Size: 714 bytes --]
While doing some research into the aligned attribute I came across
c/61053 that had been reopened after the regression test added with
the fix had started to fail on a couple of targets. Since the bug
is fixed and the test failure is due to the added test I resolved
it as fixed and opened a new one for the test failure (to avoid
giving the impression there's still a problem with _Alignas).
The attached patch should fix these outstanding test failures on
the two targets (x86_64-apple-darwin15.3.0 and x86_64-w64-mingw32).
I don't have access to either but I verified it on x86_64 by
running the test with the following:
RUNTESTFLAGS='--target_board=unix/-m32/-m128bit-long-double
dg.exp=pr61053.c'
Martin
[-- Attachment #2: gcc-69573.patch --]
[-- Type: text/x-patch, Size: 1938 bytes --]
PR testsuite/69573 - FAIL: gcc.dg/pr61053.c (test for excess errors)
gcc/testsuite/ChangeLog:
2016-01-30 Martin Sebor <msebor@redhat.com>
PR testsuite/69573
* gcc.dg/pr61053.c: Tweaked test to avoid bogus failures.
diff --git a/gcc/testsuite/gcc.dg/pr61053.c b/gcc/testsuite/gcc.dg/pr61053.c
index e270420..1c090e0 100644
--- a/gcc/testsuite/gcc.dg/pr61053.c
+++ b/gcc/testsuite/gcc.dg/pr61053.c
@@ -67,9 +67,19 @@ _Alignas (long double) double dld;
_Alignas (char) long double ldc; /* { dg-error "cannot reduce alignment" } */
_Alignas (short int) long double lds; /* { dg-error "cannot reduce alignment" } */
-_Alignas (int) long double ldi; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */
-_Alignas (long int) long double ldl; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */
-_Alignas (long long int) long double ldll; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */
-_Alignas (float) long double ldf; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */
-_Alignas (double) long double ldd; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */
+
+#if __SIZEOF_LONG_DOUBLE__ == 12
+/* Get around PR testsuite/69573 - FAIL: gcc.dg/pr61053.c (test for excess
+ errors) on targets such as x86_64-apple-darwin15.3.0 where long double
+ is 16 bytes wide even in LP32. */
+# define X(T) short
+#else
+# define X(T) T
+#endif
+
+_Alignas (X (int)) long double ldi; /* { dg-error "cannot reduce alignment" } */
+_Alignas (X (long int)) long double ldl; /* { dg-error "cannot reduce alignment" } */
+_Alignas (X (long long int)) long double ldll; /* { dg-error "cannot reduce alignment" } */
+_Alignas (X (float)) long double ldf; /* { dg-error "cannot reduce alignment" } */
+_Alignas (X (double)) long double ldd; /* { dg-error "cannot reduce alignment" } */
_Alignas (long double) long double ldld;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fix #69573 - FAIL: gcc.dg/pr61053.c
2016-01-31 2:11 [PATCH] fix #69573 - FAIL: gcc.dg/pr61053.c Martin Sebor
@ 2016-02-01 11:49 ` Marek Polacek
0 siblings, 0 replies; 2+ messages in thread
From: Marek Polacek @ 2016-02-01 11:49 UTC (permalink / raw)
To: Martin Sebor; +Cc: Gcc Patch List
On Sat, Jan 30, 2016 at 07:11:14PM -0700, Martin Sebor wrote:
> While doing some research into the aligned attribute I came across
> c/61053 that had been reopened after the regression test added with
> the fix had started to fail on a couple of targets. Since the bug
> is fixed and the test failure is due to the added test I resolved
> it as fixed and opened a new one for the test failure (to avoid
> giving the impression there's still a problem with _Alignas).
Right. This is a testsuite-only issue; I've never gotten to fixing it.
> The attached patch should fix these outstanding test failures on
> the two targets (x86_64-apple-darwin15.3.0 and x86_64-w64-mingw32).
> I don't have access to either but I verified it on x86_64 by
> running the test with the following:
>
> RUNTESTFLAGS='--target_board=unix/-m32/-m128bit-long-double
> dg.exp=pr61053.c'
Thanks for looking into this. I guess I'm ok with this as long as the
test still passes on all non-weirdo targets ;).
Marek
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-01 11:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-31 2:11 [PATCH] fix #69573 - FAIL: gcc.dg/pr61053.c Martin Sebor
2016-02-01 11:49 ` Marek Polacek
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).