public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR other/16820 (struct-layout-1 failures on non-ISOC99 systems)
@ 2004-07-30 16:36 Jakub Jelinek
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Jelinek @ 2004-07-30 16:36 UTC (permalink / raw)
  To: gcc-patches

Hi!

Ok to commit?
complex.h include has been there just as a left over from test development
(and compat-common.h takes care of including complex.h if necessary),
stdint.h was needed just for uintptr_t, but as the test is usually testing
just a few bottom-most bits of it, I think it can cast to long as well.
If sizeof (long) is not equal to sizeof (void *), the compiler might issue
a warning, but the tests are run with -w.

2004-07-30  Jakub Jelinek  <jakub@redhat.com>

	PR other/16820
	* gcc.dg/compat/struct-layout-1.h: Don't include complex.h nor
	stdint.h.
	* gcc.dg/compat/struct-layout-1_x1.h (TX): Cast to long instead of
	uintptr_t.

--- gcc/testsuite/gcc.dg/compat/struct-layout-1.h.jj	2004-07-23 14:35:43.000000000 +0200
+++ gcc/testsuite/gcc.dg/compat/struct-layout-1.h	2004-07-30 09:17:06.624834793 +0200
@@ -1,9 +1,7 @@
-#include <complex.h>
 #include <limits.h>
 #include <stdarg.h>
 #include <stdbool.h>
 #include <stdlib.h>
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
 #include "compat-common.h"
--- gcc/testsuite/gcc.dg/compat/struct-layout-1_x1.h.jj	2004-07-13 20:35:54.000000000 +0200
+++ gcc/testsuite/gcc.dg/compat/struct-layout-1_x1.h	2004-07-30 09:46:21.861615761 +0200
@@ -56,7 +56,7 @@ void test##n (void)						\
   info.als = __alignof__ (s##n);				\
   info.ala0 = __alignof__ (a##n[0]);				\
   info.ala3 = __alignof__ (a##n[3]);				\
-  if (((uintptr_t) &a##n[3]) & (info.als - 1))			\
+  if (((long) &a##n[3]) & (info.als - 1))			\
     FAIL (n, 1);						\
   i = 0; j = 0;							\
   ops								\

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix PR other/16820 (struct-layout-1 failures on non-ISOC99 systems)
       [not found] <20040731193855.GB8296@devserv.devel.redhat.com>
  2004-08-01 22:08 ` John David Anglin
@ 2004-09-27 16:51 ` Steve Ellcey
  1 sibling, 0 replies; 3+ messages in thread
From: Steve Ellcey @ 2004-09-27 16:51 UTC (permalink / raw)
  To: jakub; +Cc: gcc-patches, dave

I looked into why this test gets a runtime failures on HPPA even after
the compile time fixes have been made.  The failure I saw was because
the test was checking to see if a structure had 16-byte alignment and it
looks to me like HPPA only supports 8 byte alignment.

It looks like the tests are supposed to discover what the maximum
alignment really is and check for that but it doesn't seem to be working
correctly for PA.

Jakub, do you know what could be going wrong with the check for
alignment?  I looked around but I couldn't really see where it was
trying to determine the maximum alignment.

I noticed that when I generated and compiled the t001_main.c, t001_x.c,
and t001_y.c files outside of the testsuite that I got 110 warnings.
This doesn't leave me with a good feeling that this is a valid test.
The warnings are all one of 3 types:
	t001_test.h:12: warning: overflow in implicit constant conversion
	t001_test.h:44: warning: large integer implicitly truncated to unsigned type
	t001_test.h:50: warning: alignment of 's49' is greater than maximum object file alignment.  Using 8

Steve Ellcey
sje@cup.hp.com


> On Sat, Jul 31, 2004 at 01:20:00PM -0400, John David Anglin wrote:
> > > 2004-07-30  Jakub Jelinek  <jakub@redhat.com>
> > > 
> > > 	PR other/16820
> > > 	* gcc.dg/compat/struct-layout-1.h: Don't include complex.h nor
> > > 	stdint.h.
> > > 	* gcc.dg/compat/struct-layout-1_x1.h (TX): Cast to long instead of
> > > 	uintptr_t.
> > 
> > The change fixes the build problem for these tests on hppa2.0w-hp-hpux11.11
> > and hppa64-hp-hpux11.11.  However, all the execute tests fail on hppa2.0w
> > and three on hppa64.  See:
> > 
> > <http://gcc.gnu.org/ml/gcc-testresults/2004-07/msg01348.html>
> > <http://gcc.gnu.org/ml/gcc-testresults/2004-07/msg01349.html>.
> 
> There are a couple of failures even on i386 and x86-64.
> I think a lot of targets will need some fixes to make them all pass.
> Of course, failing all of them is too much.
> You can build the tests with -DDBG and it will tell you in
> gcc/testsuite/gcc.log what exact tests failed.
> 
> 	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix PR other/16820 (struct-layout-1 failures on non-ISOC99 systems)
       [not found] <20040731193855.GB8296@devserv.devel.redhat.com>
@ 2004-08-01 22:08 ` John David Anglin
  2004-09-27 16:51 ` Steve Ellcey
  1 sibling, 0 replies; 3+ messages in thread
From: John David Anglin @ 2004-08-01 22:08 UTC (permalink / raw)
  To: jakub; +Cc: gcc-patches

> Of course, failing all of them is too much.
> You can build the tests with -DDBG and it will tell you in
> gcc/testsuite/gcc.log what exact tests failed.

# ./tmpdir-gcc-dg-struct-layout-1-t001-01
fail 49.1
fail 81.1
fail 101.1
fail 113.1
fail 114.1
fail 125.1
fail 171.1
fail 231.1
fail 262.1
ABORT instruction (core dumped)

Ok, I see what's wrong.  These all involve 16-byte alignment.  This
exceeds the alignment specified by TARGET_ASM_FILE_START for the
subspaces $DATA$ and $BSS$.  BIGGEST_ALIGNMENT is 64 bits for this
target, so technically no data object is supposed to need an alignment
larger than this.  Thus, the test is trying to align data to a higher
alignment than currently supported by the target.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-09-27 16:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-30 16:36 [PATCH] Fix PR other/16820 (struct-layout-1 failures on non-ISOC99 systems) Jakub Jelinek
     [not found] <20040731193855.GB8296@devserv.devel.redhat.com>
2004-08-01 22:08 ` John David Anglin
2004-09-27 16:51 ` Steve Ellcey

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).