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]

PATCH: gcc.dg/compat testsuite patch


I have a (seperate) patch that will cause GCC to generate an error if it
sees an array whose elements have an alignment requirement greater than
there size.  That patch causes regressions in the gcc.dg/compat
testsuite because the struct-layout-1_generate.c program that generates
test cases creates arrays with elements whose alignment is greater than
their size.

This patch changes struct-layout-1_generate.c to not generate such test
cases by not allowing the alignment attribute on array elements.

Tested on HPPA HP-UX and IA64 HP-UX and Linux with no regressions.  It
also allowed me to use my front-end patch (the one that gives the
front-end error when it sees elements whose alignment is greater than
their size) with no new failures.

OK for checkin?

Steve Ellcey
sje@cup.hp.com


testsuite/ChangeLog

2005-09-29  Steve Ellcey  <sje@cup.hp.com>

	* gcc.dg/compat/struct-layout-1_generate.c (generate_fields):
	Do not put aligned attributes on array elements.


*** gcc.orig/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c	Thu Sep 29 08:36:19 2005
--- gcc/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c	Thu Sep 29 08:39:46 2005
*************** generate_fields (enum FEATURE features, 
*** 1743,1748 ****
--- 1743,1756 ----
  		  || (e[n].type >= &aligned_bitfld_types[0]
  		      && e[n].type < &aligned_bitfld_types[n_aligned_bitfld_types])))
  	    e[n].attrib = NULL;
+ 
+ 	  /* If this is an array type, do not put aligned attributes on
+ 	     elements.  Aligning elements to a value greater than their
+ 	     size will result in a compiler error.  */
+ 
+ 	  if ((e[n].etype == ETYPE_ARRAY)
+ 	      && (strncmp (e[n].attrib, "atal", 4) == 0))
+             e[n].attrib = NULL;
  	}
      }
  }


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