]> git.pld-linux.org Git - packages/crossalpha-gcc.git/commitdiff
- put const c++ arrays in .rodata section. auto/th/gcc-4_0_1-0_20050507_8 auto/th/gcc-4_0_1-0_20050507_9 auto/th/gcc-4_0_1-0_20050514_1_1 auto/th/gcc-4_0_1-0_20050514_2
authorPaweł Sikora <pluto@pld-linux.org>
Wed, 11 May 2005 21:07:47 +0000 (21:07 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    gcc-pr21454.patch -> 1.1

gcc-pr21454.patch [new file with mode: 0644]

diff --git a/gcc-pr21454.patch b/gcc-pr21454.patch
new file mode 100644 (file)
index 0000000..c41ec51
--- /dev/null
@@ -0,0 +1,30 @@
+From: Jakub Jelinek <jakub at redhat dot com>
+Subject: [PATCH] Set TREE_READONLY const POD arrays with size determined from initializer (PR c++/21454)
+
+This is a fallout of the PR c++/20073 fix.
+For arrays like:
+const int a[] = { 0, 1, 2, 3 };
+when cp_apply_type_quals_to_decl is called, its type is not complete yet,
+so C++ frontend does not set TREE_READONLY flag.  But such variables
+aren't put into incomplete_vars chain either, so nothing sets the flag
+afterwards.
+
+2005-05-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/21454
+       * decl.c (maybe_deduce_size_from_array_init): Call
+       cp_apply_type_quals_to_decl after completing array type.
+
+       * g++.dg/opt/const4.C: New test.
+
+--- gcc/gcc/cp/decl.c  2005-05-11 11:50:14.000000000 +0200
++++ gcc/gcc/cp/decl.c  2005-05-11 19:03:28.000000000 +0200
+@@ -3933,6 +3933,8 @@ maybe_deduce_size_from_array_init (tree 
+       if (failure == 3)
+       error ("zero-size array %qD", decl);
++      cp_apply_type_quals_to_decl (cp_type_quals (TREE_TYPE (decl)), decl);
++
+       layout_decl (decl, 0);
+     }
+ }
This page took 0.067598 seconds and 4 git commands to generate.