Several C++ regressions

Andrew Pinski pinskia@physics.uc.edu
Mon Aug 23 17:13:00 GMT 2004


On Aug 23, 2004, at 7:21 AM, Andrew Pinski wrote:

>
> On Aug 23, 2004, at 7:18 AM, Diego Novillo wrote:
>
>>
>> Not sure where the failure is.  They _seem_ to be related to Andrew's
>> changes, but I haven't actually checked.  They are codegen failures.
>
>
> Yes these are all caused by my change, I am trying to figure out how 
> to fix them
> and how I did not see them in my testing.

I still don't understand why this patch works but it is most likely a 
bug
some in the C++ front-end somewhere from in setting up the inheritance 
field
decls.  I don't have time to track down why they are not working 
correctly
so I decided to put a FIXME and a check for if the field is an 
artificial field
decl.

OK?  Tested on powerpc-apple-darwin, this time with no regressions and 
it fixes
the regressions that were caused by my first patch.

Thanks,
Andrew Pinski

ChangeLog:
	* typeck.c (build_unary_op): Do not build &a.b for artificial decl 
fields.

Index: typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/typeck.c,v
retrieving revision 1.568
diff -u -p -r1.568 typeck.c
--- typeck.c	23 Aug 2004 03:12:35 -0000	1.568
+++ typeck.c	23 Aug 2004 16:36:19 -0000
@@ -4125,8 +4125,9 @@ build_unary_op (enum tree_code code, tre
  					     byte_position (field))));

  	    /* If the folded PLUS_EXPR is not a constant address, wrap
-               it in an ADDR_EXPR.  */
-	    if (!TREE_CONSTANT (addr))
+               it in an ADDR_EXPR.  FIXME: artificial field decls do 
not
+	       do the right thing.  */
+	    if (!TREE_CONSTANT (addr) && !DECL_ARTIFICIAL (field))
  	      addr = build_address (arg);
  	  }



More information about the Gcc-patches mailing list