[testsuite] Fix 32-bit gcc.dg/lto/pr55525 with Sun ld

Submitted by Rainer Orth on Jan. 7, 2013, 4:09 p.m.


Message ID yddsj6d3rgo.fsf@lokon.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Jan. 7, 2013, 4:09 p.m.
gcc.dg/lto/pr55525 currently FAILs on Solaris with Sun ld for the 32-bit

FAIL: gcc.dg/lto/pr55525 c_lto_pr55525_0.o-c_lto_pr55525_1.o link,  -flto -w 
UNRESOLVED: gcc.dg/lto/pr55525 c_lto_pr55525_0.o-c_lto_pr55525_1.o execute  -flto -w 

ld: fatal: symbol 's' has differing sizes:
        (file c_lto_pr55525_0.o value=0x8; file c_lto_pr55525_1.o value=0x4);
        tentative symbol cannot override defined symbol of smaller size

The following patch (from Richi) fixes this.

Tested with the appropriate runtest invocation on i386-pc-solaris2.10
and x86_64-unknown-linux-gnu (both multilibs each), installed on
mainline as approved in the PR.


2013-01-07  Richard Biener  <rguenther@suse.de>

	* gcc.dg/lto/pr55525_0.c (s): Size like char *.

Patch hide | download patch | download mbox

# HG changeset patch
# Parent 698c7b5e4929ecd54651ad11b9f49dc7e8c3f395
Fix 32-bit gcc.dg/lto/pr55525 with Sun ld

diff --git a/gcc/testsuite/gcc.dg/lto/pr55525_0.c b/gcc/testsuite/gcc.dg/lto/pr55525_0.c
--- a/gcc/testsuite/gcc.dg/lto/pr55525_0.c
+++ b/gcc/testsuite/gcc.dg/lto/pr55525_0.c
@@ -1,7 +1,7 @@ 
 /* { dg-lto-do link } */
 /* { dg-lto-options { { -flto -w } } } */
-char s[8];
+char s[sizeof (char *)];
 int main(void)
   return strcmp(&s[1], "foo");