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] Fix PR61762 testcase


After trying to fix the missed optimization on strict-align targets
in a fancy way for some time I gave up and this fixes the testcase
instead.

Tested on a sparc cross and on x86_64-unknown-linux-gnu, applied.

Richard.

2014-08-01  Richard Biener  <rguenther@suse.de>

	PR middle-end/61762
	* gcc.dg/pr61762.c: Align the string to make the testcase work
	on strict-align targets.

Index: gcc/testsuite/gcc.dg/pr61762.c
===================================================================
--- gcc/testsuite/gcc.dg/pr61762.c	(revision 213342)
+++ gcc/testsuite/gcc.dg/pr61762.c	(working copy)
@@ -3,7 +3,7 @@
 
 unsigned int f()
 {
-  static const char string[] = "Private";
+  static const char string[] __attribute__((aligned(sizeof(int)))) = "Private";
 
   unsigned int priv;
   __builtin_memcpy(&priv, &string[0], sizeof(priv));


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