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 <rguent...@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));