From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10850 invoked by alias); 27 Nov 2001 03:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 10801 invoked by uid 71); 27 Nov 2001 03:26:01 -0000 Date: Wed, 21 Nov 2001 02:56:00 -0000 Message-ID: <20011127032601.10799.qmail@sourceware.cygnus.com> To: apbianco@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Bryce McKinlay Subject: Re: java/4775 Reply-To: Bryce McKinlay X-SW-Source: 2001-11/txt/msg00638.txt.bz2 List-Id: The following reply was made to PR java/4775; it has been noted by GNATS. From: Bryce McKinlay To: apbianco@cygnus.com Cc: gcc-gnats@gcc.gnu.org, mlhartme@mlhartme.de, gcc-bugs@gcc.gnu.org Subject: Re: java/4775 Date: Tue, 27 Nov 2001 16:25:08 +1300 Alexandre Petit-Bianco wrote: >>I'm curious why the second part of this patch is neccessary >> > >Last time I checked (some time ago, I'd have to re-check,) proper >finals initialization is carried out by checking that at least a ctor >in the chain of call will initialize a final properly. So it's faster >and prevents things from breaking when regular non static methods are >being found invoked in ctor bodies... > But regular method calls can just be ignored, right? They are not allowed to initialize finals anyway. I don't see why TREE_CODE (decl) != FUNCTION_DECL needs to be an error condition. Also it seems fragile to check explicitly the tree structure of the call (eg the NOP_EXPR etc), because that could change, so why not just do this? @@ -12670,8 +12665,10 @@ if (TREE_CODE (decl) != FUNCTION_DECL) decl = TREE_OPERAND (TREE_OPERAND (decl, 0), 0); - if (TREE_CODE (decl) != FUNCTION_DECL) - abort (); + /* Skip something that isn't a call to a ctor */ + if ((TREE_CODE (decl) == FUNCTION_DECL && !DECL_CONSTRUCTOR_P (decl)) + || TREE_CODE (decl) != FUNCTION_DECL) + return -1; if (DECL_FUNCTION_ALL_FINAL_INITIALIZED (decl)) return 1; if (DECL_FINIT_P (decl) || DECL_CONTEXT (decl) != current_class) regards Bryce.