First Last Prev Next    No search results available
Details
: C++ front-end is not generating linkonce linkage type whe...
Bug#: 29
: tools
: llvm-g++
Status: RESOLVED
Resolution: FIXED
: PC
: Linux
: trunk
: P2
: normal
: 1.1

:
: quality-of-implementation
: 58
:
  Show dependency tree - Show dependency graph
People
Reporter: Chris Lattner <sabre@nondot.org>
Assigned To: Chris Lattner <sabre@nondot.org>

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2003-10-10 00:12
In this testcase:

inline int foo() {
  static int X = 0;
  return ++X;
}
int bar() {
  return foo();
}

The LLVM global variable declaration for the X variable should have "linkonce",
not "weak" linkage.

It is not clear how to get this information from the GCC front-end.
------- Comment #1 From Chris Lattner 2003-10-10 00:14:36 -------
Just to be perfectly clear here: this does not cause incorrect compilation at
all.  This just prevents the LLVM optimizers from deleting the variable when it
is unreferenced in a translation unit.
------- Comment #2 From Chris Lattner 2003-10-26 14:18:22 -------
A question about this has now been asked on the GCC list:
http://gcc.gnu.org/ml/gcc/2003-10/msg01272.html
------- Comment #3 From Chris Lattner 2003-10-27 00:23:46 -------
More analysis is available here:
http://gcc.gnu.org/ml/gcc/2003-10/msg01292.html

Fixing this bug is critical for compiling reasonably sized C++ translation
units, so I'm upgrading it's severity to 'normal', and targetting it to 1.1.
------- Comment #4 From Chris Lattner 2003-10-27 11:02:06 -------
This has now been fixed by 'ifdef'ing out the "win32" specific case in this
post:
http://gcc.gnu.org/ml/gcc/2003-10/msg01309.html

-Chris
------- Comment #5 From Chris Lattner 2003-11-02 00:38:50 -------
New testcase for another form of this problem:
test/Regression/C++Frontend/2003-11-02-WeakLinkage.cpp.tr

This instance of the bug has also been fixed in the CFE now.

First Last Prev Next    No search results available