]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sparc: Char arrays are 64-bit aligned on SPARC
authorDaniel Cederman <cederman@gaisler.com>
Fri, 8 Dec 2023 08:49:12 +0000 (09:49 +0100)
committerDaniel Hellstrom <daniel@gaisler.com>
Tue, 16 Jan 2024 11:53:49 +0000 (12:53 +0100)
pr88077 fails on SPARC since char HeaderStr[1] in pr88077_1.c and
long HeaderStr in pr88077_0.c differs in alignment.

Warning printed by Binutils ld:
warning: alignment 4 of normal symbol `HeaderStr' in c_lto_pr88077_0.o is
smaller than 8 used by the common definition in c_lto_pr88077_1.o

gcc/testsuite/ChangeLog:

* gcc.dg/lto/pr88077_0.c: Change type to match alignment for SPARC

gcc/testsuite/gcc.dg/lto/pr88077_0.c

index 924fe9fc3f01f64c2712480c5507693e66e7b5f8..9455295051fcf3c7585903de8b271410b8d95e7f 100644 (file)
@@ -1,3 +1,7 @@
 /* { dg-lto-do link } */
 
+#if defined __sparc__
+long long HeaderStr;
+#else
 long HeaderStr;
+#endif