This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR61762 testcase
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 1 Aug 2014 14:35:50 +0200 (CEST)
- Subject: [PATCH] Fix PR61762 testcase
- Authentication-results: sourceware.org; auth=none
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));