Bugzilla – Bug 509
[llvm-g++] Do not use dynamic initialization where static init will do
Last modified: 2005-02-14 15:27:06
You need to log in before you can comment on or make changes to this bug.
For the following testcase: --- struct Data { unsigned *data; unsigned array[1]; }; Data shared_null = { shared_null.array, {0} }; --- llvm-g++ emits a dynamic initialization of the 'shared_null' global. g++ statically intializes the global (because the initializer *IS* a constant), and we should too. This bug causes us to miscompile QT-4.0, as it has other dynamic intializers that depend on this. In this case, some initializers run that use this, then this initializer runs, then others run. This is a problem. -Chris
Fixed. Testcase here: test/Regression/C++Frontend/2005-02-13-BadDynamicInit.cpp Primary patch here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050207/024086.html Note that this patch is the correct fix for some old ugly gross hacky code that worked around bugs in GCC. As such, these patches are now in to revert the ugliness: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050207/024087.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050207/024088.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050207/024089.html -Chris
Note that these patches caused a regression in Prolangs-C/cdecl. These patches fix the regression: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050214/024105.html ... http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050214/024110.html -Chris