This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR 29585: C++ front end not setting TREE_ADDRESSABLE on vtbl entries


On Apr 4, 2007, at 7:00 PM, Mike Stump wrote:
On Mar 31, 2007, at 11:03 AM, Diego Novillo wrote:
2007-03-30  Diego Novillo  <dnovillo@redhat.com>
           Mark Mitchell  <mark@codesourcery.com>

   PR 29585
   * class.c (dfs_accumulate_vtbl_inits): Use build_address
   to build the vtbl entry.

I think this patch breaks:


 FAIL: g++.old-deja/g++.mike/p4736b.C (internal compiler error)
 FAIL: g++.old-deja/g++.mike/p4736b.C (test for excess errors)

on powerpc-apple-darwin:

/Volumes/mrs3/net/gcc-4.2-fsf/gcc/gcc/testsuite/g++.old-deja/g+ +.mike/p4736b.C:
In function 'int main()':
/Volumes/mrs3/net/gcc-4.2-fsf/gcc/gcc/testsuite/g++.old-deja/g+ +.mike/p4736b.C:41:
internal compiler error: in convert_memory_address, at explow.c:319


:-(

Fixed by the below. I'll check this in tomorrow unless a maintainer of the code thinks it's not obvious or wrong, pretty sure it's better than the status quo. This fixes it as the mode on the type of the vtbl goes from being BLKmode back to being what it was before (SImode on my machine). The wrong mode on the decl causes convert_memory_address called from memory_address to abort. The mode was taken in expand_one_stack_var_at:


x = gen_rtx_MEM (DECL_MODE (decl), x);

The reason some people didn't see this is the check only happens when ! POINTERS_EXTEND_UNSIGNED.

2007-04-10 Mike Stump <mrs@apple.com>

	* class.c (dfs_accumulate_vtbl_inits): Fix regressions introduced
	by fix for PR 29585.

2007-04-10 Mike Stump <mrs@apple.com>

* g++.dg/tree-ssa/pr29585.C: Don't die on an expected warning.

This is a release blocker for 4.2.0.

Doing diffs in .:
--- ./cp/class.c.~1~	2007-04-04 19:37:15.000000000 -0700
+++ ./cp/class.c	2007-04-10 17:34:46.000000000 -0700
@@ -7108,7 +7108,7 @@ dfs_accumulate_vtbl_inits (tree binfo,
       index = size_binop (MULT_EXPR,
 			  TYPE_SIZE_UNIT (vtable_entry_type),
 			  index);
-      vtbl = build2 (PLUS_EXPR, TREE_TYPE (vtbl), vtbl, index);
+      vtbl = build2 (PLUS_EXPR, vtbl_ptr_type_node, vtbl, index);
     }

if (ctor_vtbl_p)
--- ./testsuite/g++.dg/tree-ssa/pr29585.C.~1~ 2007-04-04 19:37:14.000000000 -0700
+++ ./testsuite/g++.dg/tree-ssa/pr29585.C 2007-04-10 17:44:53.000000000 -0700
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O2 -w" } */


 class ios_base{};
 struct basic_ostream : virtual ios_base{};
--------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]