public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/49379] New: warning from Mac OS X linker alignment lost for -ftree-vectorize optimization
@ 2011-06-12  2:25 nenad at intrepid dot com
  2011-06-12  2:26 ` [Bug c/49379] " nenad at intrepid dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: nenad at intrepid dot com @ 2011-06-12  2:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49379

           Summary: warning from Mac OS X linker alignment lost for
                    -ftree-vectorize optimization
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: nenad@intrepid.com


While running some tests on Mac OS X 10.6.7 I ran into
the following warning from the linker:

ld: warning: alignment lost in merging tentative definition _u_th_arr

Test links without the warning if -fno-tree-vectorize option is
provided when compiling the source.

I didn't have a chance to verify that executable is correct as 
my test is hanging - there might be multiple reasons for it. 

Linker is:

@(#)PROGRAM:ld  PROJECT:ld64-123.2
llvm version 2.9svn, from Apple Clang 2.0 (build 139)

I am attaching a small test program that I checked out against 
the snapshot of the compiler 4.7.0 20110604. Here is the output
of the compile/link process:

+ snapshot/gcc/xgcc -B../bld/packed-opt/gcc/ -v
Reading specs from ../bld/packed-opt/gcc/specs
COLLECT_GCC=snapshot/gcc/xgcc
COLLECT_LTO_WRAPPER=../bld/packed-opt/gcc/lto-wrapper
Target: x86_64-apple-darwin10.7.4
Configured with: ../../src/gcc-4.7-20110604/configure --disable-bootstrap
Thread model: posix
gcc version 4.7.0 20110604 (experimental) (GCC) 
+ snapshot/gcc/xgcc -B../bld/packed-opt/gcc/ -I. -O3 -c a.c
+ snapshot/gcc/xgcc -B../bld/packed-opt/gcc/ -I. -O3 -c b.c
+ snapshot/gcc/xgcc -B../bld/packed-opt/gcc/ -o a -O3 a.o b.o
ld: warning: alignment lost in merging tentative definition _u_th_arr
+ snapshot/gcc/xgcc -B../bld/packed-opt/gcc/ -I. -O3 -fno-tree-vectorize -c a.c
+ snapshot/gcc/xgcc -B../bld/packed-opt/gcc/ -I. -O3 -fno-tree-vectorize -c b.c
+ snapshot/gcc/xgcc -B../bld/packed-opt/gcc/ -o a -O3 a.o b.o


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/49379] warning from Mac OS X linker alignment lost for -ftree-vectorize optimization
  2011-06-12  2:25 [Bug c/49379] New: warning from Mac OS X linker alignment lost for -ftree-vectorize optimization nenad at intrepid dot com
@ 2011-06-12  2:26 ` nenad at intrepid dot com
  2011-06-12 11:43 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: nenad at intrepid dot com @ 2011-06-12  2:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49379

--- Comment #1 from Nenad Vukicevic <nenad at intrepid dot com> 2011-06-12 02:26:32 UTC ---
Created attachment 24495
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24495
Sample code for MAc OS X linker warning


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/49379] warning from Mac OS X linker alignment lost for -ftree-vectorize optimization
  2011-06-12  2:25 [Bug c/49379] New: warning from Mac OS X linker alignment lost for -ftree-vectorize optimization nenad at intrepid dot com
  2011-06-12  2:26 ` [Bug c/49379] " nenad at intrepid dot com
@ 2011-06-12 11:43 ` rguenth at gcc dot gnu.org
  2011-06-12 12:44 ` dominiq at lps dot ens.fr
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-06-12 11:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49379

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-06-12 11:42:57 UTC ---
You should probably report this to Apple instead.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/49379] warning from Mac OS X linker alignment lost for -ftree-vectorize optimization
  2011-06-12  2:25 [Bug c/49379] New: warning from Mac OS X linker alignment lost for -ftree-vectorize optimization nenad at intrepid dot com
  2011-06-12  2:26 ` [Bug c/49379] " nenad at intrepid dot com
  2011-06-12 11:43 ` rguenth at gcc dot gnu.org
@ 2011-06-12 12:44 ` dominiq at lps dot ens.fr
  2011-06-12 13:07 ` gary at intrepid dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-06-12 12:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49379

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.06.12 12:43:18
     Ever Confirmed|0                           |1

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-06-12 12:43:18 UTC ---
Confirmed on x86_64-apple-darwin10 

@(#)PROGRAM:ld  PROJECT:ld64-97.17
llvm version 2.9svn, from Apple Clang 1.7 (build 77)

and powerpc-apple-darwin9.8.0

@(#)PROGRAM:ld  PROJECT:ld64-85.2.1

for trunk and gcc 4.5.2, but not for 4.4.4.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/49379] warning from Mac OS X linker alignment lost for -ftree-vectorize optimization
  2011-06-12  2:25 [Bug c/49379] New: warning from Mac OS X linker alignment lost for -ftree-vectorize optimization nenad at intrepid dot com
                   ` (2 preceding siblings ...)
  2011-06-12 12:44 ` dominiq at lps dot ens.fr
@ 2011-06-12 13:07 ` gary at intrepid dot com
  2011-06-29  4:20 ` PHHargrove at lbl dot gov
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gary at intrepid dot com @ 2011-06-12 13:07 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49379

--- Comment #4 from Gary Funck <gary at intrepid dot com> 2011-06-12 13:04:59 UTC ---
We think that this issue is related to an optimization that increases the
alignment of common symbols that have the potential to improve vectorization. 
We didn't run a reghunt, but it looks like this may have been the update that
initially implemented the alignment change.

r120576 | hubicka | 2007-01-08 03:13:14 -0800 (Mon, 08 Jan 2007) | 23 lines
[...]
        * tree-vectorizer.c (increase_alignment): Move here from cgraphunit.c
        (gate_increase_alignment): New function.
        (pass_ipa_increase_alignment): New pass.

We've determined: (1) the vanilla GNU/Linux linker doesn't complain, (2) the
installed (Apple) GCC compiler likely pre-dates the change above.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/49379] warning from Mac OS X linker alignment lost for -ftree-vectorize optimization
  2011-06-12  2:25 [Bug c/49379] New: warning from Mac OS X linker alignment lost for -ftree-vectorize optimization nenad at intrepid dot com
                   ` (3 preceding siblings ...)
  2011-06-12 13:07 ` gary at intrepid dot com
@ 2011-06-29  4:20 ` PHHargrove at lbl dot gov
  2011-06-29  5:28 ` PHHargrove at lbl dot gov
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: PHHargrove at lbl dot gov @ 2011-06-29  4:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49379

--- Comment #5 from Paul H. Hargrove <PHHargrove at lbl dot gov> 2011-06-29 04:20:13 UTC ---
Created attachment 24629
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24629
Second (non Apple) reproducer for bug 49379

This attachment is a simple 3-file reproducer for this bug on x86-64/Linux (no
Apple linker involved):

As seen by Gary the -fno-tree-vectorize flag eliminates an alignment warning
from the linker that is otherwise present at -O3 (or with explicit
"-ftree-vectorize at -O1 and -O2):

$ tar xfvj bug49379-2.tar.bz2
bug49379-2.h
bug49379-2_aux.c
bug49379-2_main.c

$ /tmp/gcc-4.7-20110625/host-x86_64-unknown-linux-gnu/gcc/xgcc
-B/tmp/gcc-4.7-20110625/host-x86_64-unknown-linux-gnu/gcc -O3 bug49379-2_main.c
bug49379-2_aux.c 
/usr/bin/ld: Warning: alignment 4 of symbol `flag' in /tmp/ccwZjyV0.o is
smaller than 16 in /tmp/ccYSRWEX.o

$ /tmp/gcc-4.7-20110625/host-x86_64-unknown-linux-gnu/gcc/xgcc
-B/tmp/gcc-4.7-20110625/host-x86_64-unknown-linux-gnu/gcc -O3
-fno-tree-vectorize bug49379-2_main.c bug49379-2_aux.c

$ /tmp/gcc-4.7-20110625/host-x86_64-unknown-linux-gnu/gcc/xgcc
-B/tmp/gcc-4.7-20110625/host-x86_64-unknown-linux-gnu/gcc -O2 -ftree-vectorize
bug49379-2_main.c bug49379-2_aux.c
/usr/bin/ld: Warning: alignment 4 of symbol `flag' in /tmp/ccSN6r8r.o is
smaller than 16 in /tmp/cc7JOniC.o

$ /tmp/gcc-4.7-20110625/host-x86_64-unknown-linux-gnu/gcc/xgcc
-B/tmp/gcc-4.7-20110625/host-x86_64-unknown-linux-gnu/gcc -O1 -ftree-vectorize
bug49379-2_main.c bug49379-2_aux.c
/usr/bin/ld: Warning: alignment 4 of symbol `flag' in /tmp/ccw0AZs5.o is
smaller than 16 in /tmp/ccRVugJ6.o


$ /tmp/gcc-4.7-20110625/host-x86_64-unknown-linux-gnu/gcc/xgcc -v
Using built-in specs.
COLLECT_GCC=/tmp/gcc-4.7-20110625/host-x86_64-unknown-linux-gnu/gcc/xgcc
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --enable-languages=c
--with-mpc=/usr/common/ftg/gcc/common/
Thread model: posix
gcc version 4.7.0 20110625 (experimental) (GCC)

$ ld --version
GNU ld version 2.17.50.0.6-14.el5 20061020
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.

$ uname -a
Linux tesla 2.6.18-194.17.1.el5 #1 SMP Wed Sep 29 12:09:22 EDT 2010 x86_64
x86_64 x86_64 GNU/Linux

$ cat /etc/redhat-release
Scientific Linux SL release 5.5 (Boron)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/49379] warning from Mac OS X linker alignment lost for -ftree-vectorize optimization
  2011-06-12  2:25 [Bug c/49379] New: warning from Mac OS X linker alignment lost for -ftree-vectorize optimization nenad at intrepid dot com
                   ` (4 preceding siblings ...)
  2011-06-29  4:20 ` PHHargrove at lbl dot gov
@ 2011-06-29  5:28 ` PHHargrove at lbl dot gov
  2011-06-29 17:08 ` d.g.gorbachev at gmail dot com
  2014-11-19 23:40 ` [Bug tree-optimization/49379] warning from linker: " egall at gwmail dot gwu.edu
  7 siblings, 0 replies; 9+ messages in thread
From: PHHargrove at lbl dot gov @ 2011-06-29  5:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49379

Paul H. Hargrove <PHHargrove at lbl dot gov> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |PHHargrove at lbl dot gov

--- Comment #6 from Paul H. Hargrove <PHHargrove at lbl dot gov> 2011-06-29 05:27:36 UTC ---
Following up on my previous comment, I've repeated the experiment w/ a system
with more recent binutils.  The result is the same:


$ /tmp/gcc-4.7-20110625/host-x86_64-unknown-linux-gnu/gcc/xgcc
-B/tmp/gcc-4.7-20110625/host-x86_64-unknown-linux-gnu/gcc -O3 bug49379-2_main.c
bug49379-2_aux.c
/usr/bin/ld: Warning: alignment 4 of symbol `flag' in /tmp/ccIvQMTp.o is
smaller than 16 in /tmp/ccP5ZCFr.o

$ /tmp/gcc-4.7-20110625/host-x86_64-unknown-linux-gnu/gcc/xgcc
-B/tmp/gcc-4.7-20110625/host-x86_64-unknown-linux-gnu/gcc -O3
-fno-tree-vectorize bug49379-2_main.c bug49379-2_aux.c


$ ld --version
GNU ld (GNU Binutils for Ubuntu) 2.20
Copyright 2009 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

$ uname -a
Linux ftg4 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009 x86_64
GNU/Linux

$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu 9.10"


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c/49379] warning from Mac OS X linker alignment lost for -ftree-vectorize optimization
  2011-06-12  2:25 [Bug c/49379] New: warning from Mac OS X linker alignment lost for -ftree-vectorize optimization nenad at intrepid dot com
                   ` (5 preceding siblings ...)
  2011-06-29  5:28 ` PHHargrove at lbl dot gov
@ 2011-06-29 17:08 ` d.g.gorbachev at gmail dot com
  2014-11-19 23:40 ` [Bug tree-optimization/49379] warning from linker: " egall at gwmail dot gwu.edu
  7 siblings, 0 replies; 9+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2011-06-29 17:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49379

--- Comment #7 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2011-06-29 17:07:50 UTC ---
See also bug 48127.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/49379] warning from linker: alignment lost for -ftree-vectorize optimization
  2011-06-12  2:25 [Bug c/49379] New: warning from Mac OS X linker alignment lost for -ftree-vectorize optimization nenad at intrepid dot com
                   ` (6 preceding siblings ...)
  2011-06-29 17:08 ` d.g.gorbachev at gmail dot com
@ 2014-11-19 23:40 ` egall at gwmail dot gwu.edu
  7 siblings, 0 replies; 9+ messages in thread
From: egall at gwmail dot gwu.edu @ 2014-11-19 23:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49379

Eric Gallager <egall at gwmail dot gwu.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egall at gwmail dot gwu.edu

--- Comment #8 from Eric Gallager <egall at gwmail dot gwu.edu> ---
(In reply to Dominique d'Humieres from comment #3)
> Confirmed on x86_64-apple-darwin10 
> 
> @(#)PROGRAM:ld  PROJECT:ld64-97.17
> llvm version 2.9svn, from Apple Clang 1.7 (build 77)
> 
> and powerpc-apple-darwin9.8.0
> 
> @(#)PROGRAM:ld  PROJECT:ld64-85.2.1
>

It looks like Apple has removed the warning since then;
searching opensource.apple.com for the warning string in the OP shows that the
most recent time it appeared was around line 246 of
ld64/ld64-127.2/src/ld/SymbolTable.cpp.
Looking around the same place in my copy of the ld64-136 sources, the warning
is now no longer anywhere to be found around there.
Still, I suppose, though, if other linkers still print similar warnings, the
underlying issue must still remain then...


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-11-19 23:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-12  2:25 [Bug c/49379] New: warning from Mac OS X linker alignment lost for -ftree-vectorize optimization nenad at intrepid dot com
2011-06-12  2:26 ` [Bug c/49379] " nenad at intrepid dot com
2011-06-12 11:43 ` rguenth at gcc dot gnu.org
2011-06-12 12:44 ` dominiq at lps dot ens.fr
2011-06-12 13:07 ` gary at intrepid dot com
2011-06-29  4:20 ` PHHargrove at lbl dot gov
2011-06-29  5:28 ` PHHargrove at lbl dot gov
2011-06-29 17:08 ` d.g.gorbachev at gmail dot com
2014-11-19 23:40 ` [Bug tree-optimization/49379] warning from linker: " egall at gwmail dot gwu.edu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).