Bug 48055 - FAIL: gcc.c-torture/execute/builtins/memcpy-chk.c compilation, -O2 -flto
Summary: FAIL: gcc.c-torture/execute/builtins/memcpy-chk.c compilation, -O2 -flto
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-10 07:35 UTC by Uroš Bizjak
Modified: 2011-03-10 16:51 UTC (History)
0 users

See Also:
Host: alphaev68-pc-linux-gnu
Target: alphaev68-pc-linux-gnu
Build: alphaev68-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Uroš Bizjak 2011-03-10 07:35:27 UTC
Recent changes cause three of ...-chk.c lto tests to fail on alpha [1]:

Executing on host: /space/uros/gcc-build/gcc/xgcc -B/space/uros/gcc-build/gcc/ /home/uros/gcc-svn/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/memcpy-chk.c /home/uros/gcc-svn/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/memcpy-chk-lib.c /home/uros/gcc-svn/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c  -w  -O2 -flto   -lm   -o /space/uros/gcc-build/gcc/testsuite/gcc5/memcpy-chk.x9    (timeout = 300)
spawn /space/uros/gcc-build/gcc/xgcc -B/space/uros/gcc-build/gcc/ /home/uros/gcc-svn/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/memcpy-chk.c /home/uros/gcc-svn/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/memcpy-chk-lib.c /home/uros/gcc-svn/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c -w -O2 -flto -lm -o /space/uros/gcc-build/gcc/testsuite/gcc5/memcpy-chk.x9^M
/usr/lib/gcc/alpha-unknown-linux-gnu/4.4.5/../../../../alpha-unknown-linux-gnu/bin/ld: Warning: alignment 8 of symbol `buf5' in /tmp/ccgnDykf.ltrans1.ltrans.o is smaller than 16 in /tmp/ccc3QsSw.o.ironly^D^M
/usr/lib/gcc/alpha-unknown-linux-gnu/4.4.5/../../../../alpha-unknown-linux-gnu/bin/ld: Warning: alignment 8 of symbol `buf7' in /tmp/ccgnDykf.ltrans1.ltrans.o is smaller than 16 in /tmp/ccc3QsSw.o.ironly^D^M
/usr/lib/gcc/alpha-unknown-linux-gnu/4.4.5/../../../../alpha-unknown-linux-gnu/bin/ld: Warning: alignment 8 of symbol `buf1' in /tmp/ccgnDykf.ltrans1.ltrans.o is smaller than 16 in /tmp/ccc3QsSw.o.ironly^D^M
output is:
/usr/lib/gcc/alpha-unknown-linux-gnu/4.4.5/../../../../alpha-unknown-linux-gnu/bin/ld: Warning: alignment 8 of symbol `buf5' in /tmp/ccgnDykf.ltrans1.ltrans.o is smaller than 16 in /tmp/ccc3QsSw.o.ironly^D^M
/usr/lib/gcc/alpha-unknown-linux-gnu/4.4.5/../../../../alpha-unknown-linux-gnu/bin/ld: Warning: alignment 8 of symbol `buf7' in /tmp/ccgnDykf.ltrans1.ltrans.o is smaller than 16 in /tmp/ccc3QsSw.o.ironly^D^M
/usr/lib/gcc/alpha-unknown-linux-gnu/4.4.5/../../../../alpha-unknown-linux-gnu/bin/ld: Warning: alignment 8 of symbol `buf1' in /tmp/ccgnDykf.ltrans1.ltrans.o is smaller than 16 in /tmp/ccc3QsSw.o.ironly^D^M

FAIL: gcc.c-torture/execute/builtins/memcpy-chk.c compilation,  -O2 -flto
UNRESOLVED: gcc.c-torture/execute/builtins/memcpy-chk.c execution,  -O2 -flto

[1] http://gcc.gnu.org/ml/gcc-testresults/2011-03/msg00887.html
Comment 1 Richard Biener 2011-03-10 10:18:52 UTC
This looks like a linker issue.  I remember seeing similar errors when
using GNU ld and not gold.

And I don't think GCC produces intermediate files named ccc3QsSw.o.ironly.
Comment 2 Uroš Bizjak 2011-03-10 11:08:00 UTC
(In reply to comment #1)
> This looks like a linker issue.  I remember seeing similar errors when
> using GNU ld and not gold.
> 
> And I don't think GCC produces intermediate files named ccc3QsSw.o.ironly.

Indeed. The new warning is generated due to the upgrade to binutils-2.21.

Following testsuite patch fixes the problem:

Index: gcc.c-torture/execute/builtins/memcpy-chk.c
===================================================================
--- gcc.c-torture/execute/builtins/memcpy-chk.c	(revision 170823)
+++ gcc.c-torture/execute/builtins/memcpy-chk.c	(working copy)
@@ -78,10 +78,10 @@
     abort ();
 }
 
-long buf1[64];
+static long buf1[64];
 char *buf2 = (char *) (buf1 + 32);
-long buf5[20];
-char buf7[20];
+static long buf5[20];
+static char buf7[20];
 
 void
 __attribute__((noinline))
Index: gcc.c-torture/execute/builtins/memmove-chk.c
===================================================================
--- gcc.c-torture/execute/builtins/memmove-chk.c	(revision 170823)
+++ gcc.c-torture/execute/builtins/memmove-chk.c	(working copy)
@@ -81,10 +81,10 @@
     abort ();
 }
 
-long buf1[64];
+static long buf1[64];
 char *buf2 = (char *) (buf1 + 32);
-long buf5[20];
-char buf7[20];
+static long buf5[20];
+static char buf7[20];
 
 void
 __attribute__((noinline))
Index: gcc.c-torture/execute/builtins/mempcpy-chk.c
===================================================================
--- gcc.c-torture/execute/builtins/mempcpy-chk.c	(revision 170823)
+++ gcc.c-torture/execute/builtins/mempcpy-chk.c	(working copy)
@@ -84,10 +84,10 @@
   mempcpy_disallowed = 0;
 }
 
-long buf1[64];
+static long buf1[64];
 char *buf2 = (char *) (buf1 + 32);
-long buf5[20];
-char buf7[20];
+static long buf5[20];
+static char buf7[20];
 
 void
 __attribute__((noinline))
Comment 3 Richard Biener 2011-03-10 11:14:41 UTC
Are there conflicting definitions somewhere?  Then it would indeed be a
testsuite bug.
Comment 4 Uroš Bizjak 2011-03-10 12:09:50 UTC
(In reply to comment #3)
> Are there conflicting definitions somewhere?  Then it would indeed be a
> testsuite bug.

No, these are the only definitions for the particular testcase.
Comment 5 Jan Hubicka 2011-03-10 12:56:56 UTC
> No, these are the only definitions for the particular testcase.
Hmm, in every case it is GNU ld bug - the GNU ld internal ironly section should not be leaking
to user warnings. Please fill in GNU ld PR.

Honza
Comment 6 Uroš Bizjak 2011-03-10 14:39:57 UTC
(In reply to comment #5)
> > No, these are the only definitions for the particular testcase.
> Hmm, in every case it is GNU ld bug - the GNU ld internal ironly section should
> not be leaking
> to user warnings. Please fill in GNU ld PR.

Submitted as binutils PR 12564.

Anyway, should the patch be committed to gcc testsuite, since it doesn't change the test and avoids the linker bug at the same time?

[1] http://sourceware.org/bugzilla/show_bug.cgi?id=12564
Comment 7 Uroš Bizjak 2011-03-10 16:51:35 UTC
Linker bug, see also [1].

[1] http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00521.html