add a note
authorChris Lattner <sabre@nondot.org>
Fri, 21 May 2010 23:16:21 +0000 (23:16 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 21 May 2010 23:16:21 +0000 (23:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104404 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/README.txt

index 144bf5d3e3dc6976c98344106c862f60fb4c2076..7fa73edaefee2509128c39beb0e591949c7f4c87 100644 (file)
@@ -1833,6 +1833,21 @@ entry:
 We should use DSE + llvm.lifetime.end to delete dead vtable pointer updates.
 See GCC PR34949
 
+Another interesting case is that something related could be used for variables
+that go const after their ctor has finished.  In these cases, globalopt (which
+can statically run the constructor) could mark the global const (so it gets put
+in the readonly section).  A testcase would be:
+
+#include <complex>
+using namespace std;
+const complex<char> should_be_in_rodata (42,-42);
+complex<char> should_be_in_data (42,-42);
+complex<char> should_be_in_bss;
+
+Where we currently evaluate the ctors but the globals don't become const because
+the optimizer doesn't know they "become const" after the ctor is done.  See
+GCC PR4131 for more examples.
+
 //===---------------------------------------------------------------------===//
 
 In this code: