This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR 29585: C++ front end not setting TREE_ADDRESSABLE on vtbl entries
On Apr 10, 2007, at 7:18 PM, Mark Mitchell wrote:
So, let's just stomp on the type:
... build_address (...) ...
/* ??? We should call fold_convert to convert the address to
vtbl_ptr_type_node, which is the type of elements in the vtable.
However, the resulting NOP_EXPRs confuse other parts of the C++
front end. */
gcc_assert (TREE_CODE (vtbl) == ADDR_EXPR);
TREE_TYPE (vtbl) = vtbl_ptr_type_node;
That patch is OK if it passes testing.
Does the patch and results look ok to you?
The init5 used to fail for be before, so, though it is a regression in
my regtest, it isn't from before the previous change to class.c. The
various timeouts are probably safe, probably due to either slow
network filesystems, or make -j3 check. encode-8.mm did used to fail
before, so it is safe. The oddest result was:
-XPASS: 26_numerics/cmath/c99_classification_macros_c.cc (test for
excess errors)
? I don't have a clue. It _used_ to XPASS for me.
I tested:
* class.c (dfs_accumulate_vtbl_inits): Slam the vtbl type back to
vtbl_ptr_type_node
to ensure the mode is correct.
* g++.dg/tree-ssa/pr29585.C: Don't die on an expected warning.
Index: testsuite/g++.dg/tree-ssa/pr29585.C
===================================================================
--- testsuite/g++.dg/tree-ssa/pr29585.C (revision 123722)
+++ testsuite/g++.dg/tree-ssa/pr29585.C (working copy)
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O2 -w" } */
class ios_base{};
struct basic_ostream : virtual ios_base{};
Index: cp/class.c
===================================================================
--- cp/class.c (revision 123722)
+++ cp/class.c (working copy)
@@ -7113,6 +7113,12 @@
/* Figure out the position to which the VPTR should point. */
vtbl = TREE_PURPOSE (l);
vtbl = build_address (vtbl);
+ /* ??? We should call fold_convert to convert the address to
+ vtbl_ptr_type_node, which is the type of elements in the
+ vtable. However, the resulting NOP_EXPRs confuse other parts
+ of the C++ front end. */
+ gcc_assert (TREE_CODE (vtbl) == ADDR_EXPR);
+ TREE_TYPE (vtbl) = vtbl_ptr_type_node;
index = size_binop (PLUS_EXPR,
size_int (non_fn_entries),
size_int (list_length (TREE_VALUE (l))));
and got:
--- mail-report-070411.log 2007-04-11 14:48:38.000000000 -0700
+++ mail-report-070411-ice.log 2007-04-11 13:40:42.000000000 -0700
@@ -6,47 +6,34 @@
=== g++ tests ===
Running target unix
WARNING: Could not compile g++.dg/compat/struct-layout-1 generator
-FAIL: g++.dg/eh/ctor3.C (test for excess errors)
FAIL: g++.dg/other/unused1.C scan-assembler (string|ascii?)z?\
\t"class2("|\\\\\\\\000)
FAIL: g++.dg/other/unused1.C scan-assembler (string|ascii?)z?\
\t"printer("|\\\\\\\\000)
+WARNING: program timed out.
XPASS: g++.dg/tree-ssa/ivopts-1.C scan-tree-dump-not offset: -4B
XPASS: g++.dg/tree-ssa/ivopts-1.C scan-tree-dump-not &x\\[5\\]
-FAIL: g++.dg/tree-ssa/pr29585.C (test for excess errors)
FAIL: g++.dg/warn/weak1.C (test for excess errors)
WARNING: g++.dg/warn/weak1.C compilation failed to produce executable
FAIL: g++.dg/special/conpr-3.C execution test
WARNING: program timed out.
-FAIL: g++.old-deja/g++.brendan/crash25.C (test for excess errors)
-FAIL: g++.old-deja/g++.mike/p4736b.C (internal compiler error)
-FAIL: g++.old-deja/g++.mike/p4736b.C (test for excess errors)
-WARNING: g++.old-deja/g++.mike/p4736b.C compilation failed to produce
executable
-FAIL: g++.old-deja/g++.mike/p700.C (test for excess errors)
+FAIL: g++.old-deja/g++.other/init5.C (test for excess errors)
=== g++ Summary ===
-# of expected passes 13132
-# of unexpected failures 10
+# of expected passes 13137
+# of unexpected failures 5
# of unexpected successes 2
# of expected failures 66
# of unsupported tests 110
/Volumes/mrs5/net/gcc-4.2-fsf/gcc-darwinO2/gcc/testsuite/g++/../../g+
+ version 4.2.0 20070411 (prerelease)
=== gcc tests ===
Running target unix
-WARNING: program timed out.
-FAIL: gcc.c-torture/compile/20020109-1.c -O1 (test for excess errors)
-WARNING: program timed out.
-FAIL: gcc.c-torture/execute/20021120-3.c compilation, -Os
-UNRESOLVED: gcc.c-torture/execute/20021120-3.c execution, -Os
-WARNING: program timed out.
-FAIL: gcc.c-torture/execute/950511-1.c compilation, -O3 -fomit-frame-
pointer
-UNRESOLVED: gcc.c-torture/execute/950511-1.c execution, -O3 -fomit-
frame-pointer
XPASS: gcc.c-torture/execute/mayalias-2.c compilation, -O3 -g
FAIL: gcc.dg/sibcall-6.c execution test
FAIL: gcc.dg/tree-ssa/gen-vect-11b.c scan-tree-dump-times vectorized
0 loops 1
FAIL: gcc.dg/tree-ssa/gen-vect-11c.c scan-tree-dump-times vectorized
0 loops 1
FAIL: gcc.dg/tree-ssa/loadpre1.c scan-tree-dump-times Eliminated: 1 1
@@ -64,15 +51,14 @@
FAIL: gcc.target/i386/vectorize1.c (internal compiler error)
FAIL: gcc.target/i386/vectorize1.c (test for excess errors)
=== gcc Summary ===
-# of expected passes 41680
-# of unexpected failures 19
+# of expected passes 41685
+# of unexpected failures 16
# of unexpected successes 2
# of expected failures 110
-# of unresolved testcases 2
# of untested testcases 28
# of unsupported tests 392
/Volumes/mrs5/net/gcc-4.2-fsf/gcc-darwinO2/gcc/xgcc version 4.2.0
20070411 (prerelease)
=== gfortran tests ===
@@ -91,10 +77,12 @@
FAIL: gfortran.dg/common_equivalence_1.f -O3 -g (test for excess
errors)
FAIL: gfortran.dg/common_pointer_1.f90 -O3 -g (test for excess
errors)
FAIL: gfortran.dg/contained_1.f90 -O3 -g (test for excess errors)
FAIL: gfortran.dg/cray_pointers_2.f90 -O3 -g (test for excess
errors)
FAIL: gfortran.dg/cray_pointers_5.f90 -O3 -g (test for excess
errors)
+WARNING: program timed out.
+FAIL: gfortran.dg/direct_io_1.f90 -O0 (test for excess errors)
FAIL: gfortran.dg/entry_array_specs_2.f -O3 -g (test for excess
errors)
FAIL: gfortran.dg/equiv_6.f90 -O3 -g (test for excess errors)
FAIL: gfortran.dg/f2c_6.f90 -O3 -g (test for excess errors)
FAIL: gfortran.dg/loc_1.f90 -O3 -g (test for excess errors)
FAIL: gfortran.dg/loc_2.f90 -O3 -g (test for excess errors)
@@ -136,33 +124,31 @@
FAIL: gfortran.dg/g77/intrinsic-unix-erf.f -O3 -g (test for excess
errors)
FAIL: gfortran.dg/g77/short.f -O3 -g (test for excess errors)
=== gfortran Summary ===
-# of expected passes 15854
-# of unexpected failures 56
+# of expected passes 15853
+# of unexpected failures 57
# of expected failures 7
# of unsupported tests 38
/Volumes/mrs5/net/gcc-4.2-fsf/gcc-darwinO2/gcc/testsuite/
gfortran/../../gfortran version 4.2.0 20070411 (prerelease)
=== obj-c++ tests ===
Running target unix
-WARNING: program timed out.
-FAIL: obj-c++.dg/encode-8.mm (test for excess errors)
FAIL: obj-c++.dg/stubify-1.mm (test for excess errors)
ERROR: obj-c++.dg/stubify-1.mm: error executing dg-final: couldn't
open "stubify-1.s": no such file or directory
UNRESOLVED: obj-c++.dg/stubify-1.mm: error executing dg-final:
couldn't open "stubify-1.s": no such file or directory
FAIL: obj-c++.dg/stubify-2.mm (test for excess errors)
ERROR: obj-c++.dg/stubify-2.mm: error executing dg-final: couldn't
open "stubify-2.mm.08.jump": no such file or directory
UNRESOLVED: obj-c++.dg/stubify-2.mm: error executing dg-final:
couldn't open "stubify-2.mm.08.jump": no such file or directory
=== obj-c++ Summary ===
-# of expected passes 460
-# of unexpected failures 3
+# of expected passes 461
+# of unexpected failures 2
# of unresolved testcases 2
/Volumes/mrs5/net/gcc-4.2-fsf/gcc-darwinO2/gcc/testsuite/obj-c+
+/../../g++ version 4.2.0 20070411 (prerelease)
=== objc tests ===
@@ -295,11 +281,10 @@
FAIL: 23_containers/vector/invalidation/2.cc execution test
FAIL: 23_containers/vector/invalidation/3.cc execution test
FAIL: 23_containers/vector/invalidation/4.cc execution test
FAIL: 23_containers/vector/modifiers/swap/2.cc (test for excess
errors)
FAIL: 23_containers/vector/modifiers/swap/3.cc (test for excess
errors)
-XPASS: 26_numerics/cmath/c99_classification_macros_c.cc (test for
excess errors)
FAIL: backward/strstream_members.cc execution test
FAIL: ext/bitmap_allocator/check_allocate_max_size.cc (test for
excess errors)
FAIL: ext/bitmap_allocator/check_deallocate_null.cc (test for excess
errors)
FAIL: ext/bitmap_allocator/check_delete.cc (test for excess errors)
FAIL: ext/mt_allocator/check_allocate_big_per_type.cc (test for
excess errors)
@@ -382,12 +367,12 @@
=== libstdc++ Summary ===
# of expected passes 3693
# of unexpected failures 140
-# of unexpected successes 3
-# of expected failures 13
+# of unexpected successes 2
+# of expected failures 14
# of unsupported tests 318
Compiler version: 4.2.0 20070411 (prerelease)
Platform: i686-apple-darwin9
configure flags: --with-arch=nocona --with-tune=generic --prefix=/
tmp/gcc-061220 --build=i686-apple-darwin9 --host=i686-apple-darwin9 --
enable-languages=c,c++,fortran,objc,obj-c++,treelang