From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30246 invoked by alias); 31 Jul 2009 09:19:30 -0000 Received: (qmail 30223 invoked by alias); 31 Jul 2009 09:19:30 -0000 Date: Fri, 31 Jul 2009 09:19:00 -0000 Message-ID: <20090731091930.30222.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/40867] [4.5 Regression] FAIL: StackTrace2 output - source compiled test In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: java-prs@gcc.gnu.org From: "rguenther at suse dot de" Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org X-SW-Source: 2009-q3/txt/msg00036.txt.bz2 ------- Comment #7 from rguenther at suse dot de 2009-07-31 09:19 ------- Subject: Re: [4.5 Regression] FAIL: StackTrace2 output - source compiled test On Thu, 30 Jul 2009, aph at gcc dot gnu dot org wrote: > ------- Comment #6 from aph at gcc dot gnu dot org 2009-07-30 17:24 ------- > This seems to be happening very early, because the very first tree dump shows: > > StackTrace2$Inner.doCrash(java.lang.Object) (struct StackTrace2$Inner * this, > struct java.lang.Object * o) > [StackTrace2.java : 0:0] { > struct java.lang.Object * #ref#2#2.146; > struct > { > struct java.lang.Class * class; > void * methods[2]; > } * D.1837; > void * * D.1838; > void * D.1839; > struct java.lang.String * java.lang.Object:: (struct java.lang.Object *) > * D.1840; > > [StackTrace2.java : 34:0] { > void * #ref#1#0; > struct java.lang.Object * D.252; > void * #ref#2#2; > > [StackTrace2.java : 33:0] D.252 = o; > [StackTrace2.java : 34:0] #ref#2#2 = D.252; > [StackTrace2.java : 34:0] #ref#2#2.146 = (struct java.lang.Object *) > #ref#2#2; > [StackTrace2.java : 34:0] D.1837 = #ref#2#2.146->vtable; > [StackTrace2.java : 34:0] D.1838 = &D.1837->methods[4]; > ... > > All this code should be marked as Line 33, not line 34. I don't know > why this has changed recently. Could it be now that all the java_replace_references is done at a different time we fail to properly update / copy locations in that function? I don't see that it changed really, and nothing uses locators there before or after the patch, but ... certainly the MODIFY_EXPR doesn't get its location copied from the original one. So, maybe the following would make a difference? (untested) Index: decl.c =================================================================== --- decl.c (revision 150221) +++ decl.c (working copy) @@ -361,9 +361,10 @@ java_replace_references (tree *tp, int * tree new_lhs = java_replace_reference (lhs, /* want_lvalue */ true); tree new_rhs = build1 (NOP_EXPR, TREE_TYPE (new_lhs), TREE_OPERAND (*tp, 1)); - *tp = build2 (MODIFY_EXPR, TREE_TYPE (new_lhs), - new_lhs, new_rhs); - *tp = build1 (NOP_EXPR, TREE_TYPE (lhs), *tp); + tree tem = build2 (MODIFY_EXPR, TREE_TYPE (new_lhs), + new_lhs, new_rhs); + SET_EXPR_LOCATION (tem, EXPR_LOCATION (*tp)); + *tp = build1 (NOP_EXPR, TREE_TYPE (lhs), tem); } } if (TREE_CODE (*tp) == VAR_DECL) Richard. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40867