This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Committed: adjust gcc.dg/torture/pr26565.c for target default_packed


For cris-elf, I've seen this for too long:
Running /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/torture/dg-torture.exp ...
FAIL: gcc.dg/torture/pr26565.c  -O0  (test for excess errors)
FAIL: gcc.dg/torture/pr26565.c  -O1  (test for excess errors)
FAIL: gcc.dg/torture/pr26565.c  -O2  (test for excess errors)
FAIL: gcc.dg/torture/pr26565.c  -O3 -fomit-frame-pointer  (test for excess errors)
FAIL: gcc.dg/torture/pr26565.c  -O3 -g  (test for excess errors)
FAIL: gcc.dg/torture/pr26565.c  -Os  (test for excess errors)

gcc.log:
gcc.dg/torture/pr26565.c:14: warning: 'packed' attribute ignored for field of type 'struct timeval'

It's just missing an adjustment for targets where the structure layout
is packed by default.  IMHO the warning is completely superfluous and
hurts portability.

DJ, maybe you want to consider removing the dg-skip-if for m32c at the
top of the file.  The comment there leads me to believe that the
warning causing the FAIL is why you skip the test.  I have problems
running the test-suite even after constructing a m32c-sim.exp (with
"sed -e s/m32r/m32c/g < m32r-sim.exp > m32c-sim.exp") but then
m32c-elf needs to find -lnosys to link.  If you haven't solved this
some other way than install, I suggest having a look at
libgloss/cris/Makefile.in for how this can be done.

Test now passes for cris-elf, also checked that it passes for native
x86_64-unknown-linux-gnu.

Committed as obvious.

	* gcc.dg/torture/pr26565.c: Expect warning on packed field for
	target default_packed.

Index: gcc.dg/torture/pr26565.c
===================================================================
--- gcc.dg/torture/pr26565.c	(revision 123028)
+++ gcc.dg/torture/pr26565.c	(working copy)
@@ -11,7 +11,7 @@ struct timeval {
 struct outdata {
     long align;
     char seq;
-    struct timeval tv __attribute__((packed));
+    struct timeval tv __attribute__((packed)); /* { dg-warning "attribute ignored" "" { target default_packed } } */
 };
 
 void send_probe(struct outdata *outdata, struct timeval *tp) __attribute__((noinline));

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]