From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2263 invoked by alias); 10 Dec 2010 20:25:17 -0000 Received: (qmail 2223 invoked by uid 22791); 10 Dec 2010 20:25:15 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_IB X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Dec 2010 20:25:09 +0000 Received: by wyb40 with SMTP id 40so4014151wyb.20 for ; Fri, 10 Dec 2010 12:25:07 -0800 (PST) Received: by 10.216.160.136 with SMTP id u8mr1480380wek.20.1292012706357; Fri, 10 Dec 2010 12:25:06 -0800 (PST) Received: from [192.168.2.99] (cpc2-cmbg8-0-0-cust61.5-4.cable.virginmedia.com [82.6.108.62]) by mx.google.com with ESMTPS id x65sm1698971weq.1.2010.12.10.12.25.05 (version=SSLv3 cipher=RC4-MD5); Fri, 10 Dec 2010 12:25:05 -0800 (PST) Message-ID: <4D02925F.2030900@gmail.com> Date: Fri, 10 Dec 2010 20:25:00 -0000 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: "gcc@gcc.gnu.org" , GCC Java Subject: Tree checking failure in jc1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2010-12/txt/msg00001.txt.bz2 Hi lists, I found a couple of new FAILs in my latest libjava testrun: > FAIL: newarray_overflow -O3 compilation from source > FAIL: newarray_overflow -O3 -findirect-dispatch compilation from source These turn out to be tree checking failures: > In file included from :3:0: > newarray_overflow.java:20:0: internal compiler error: tree check: expected class > 'type', have 'declaration' (function_decl) in put_decl_node, at java/lang.c:405 ... happening ... > /* Append to decl_buf a printable name for NODE. > Depending on VERBOSITY, more information about NODE > is printed. Read the comments of decl_printable_name in > langhooks.h for more. */ > > static void > put_decl_node (tree node, int verbosity) > { > int was_pointer = 0; > if (TREE_CODE (node) == POINTER_TYPE) > { > node = TREE_TYPE (node); > was_pointer = 1; > } > if (DECL_P (node) && DECL_NAME (node) != NULL_TREE) > { > if (TREE_CODE (node) == FUNCTION_DECL) > { > if (verbosity == 0 && DECL_NAME (node)) > /* We have been instructed to just print the bare name > of the function. */ > { > put_decl_node (DECL_NAME (node), 0); > return; > } > > /* We want to print the type the DECL belongs to. We don't do > that when we handle constructors. */ > if (! DECL_CONSTRUCTOR_P (node) > && ! DECL_ARTIFICIAL (node) && DECL_CONTEXT (node) > /* We want to print qualified DECL names only > if verbosity is higher than 1. */ > && verbosity >= 1) > { > put_decl_node (TYPE_NAME (DECL_CONTEXT (node)), > verbosity); ... here: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The decl pointed to by 'node' is a function_decl for a builtin: chain > QI size unit size align 8 symtab 0 alias set -1 canonical type 0x7fe52ee0 arg-types chain >> pointer_to_this > addressable public external built-in QI file line 0 col 0 align 8 built-in BUILT_IN_NORMAL:BUILT_IN_PREFETCH context chain > and the DECL_CONTEXT turns out to be another function, one present in the source of the testcase: chain > QI size unit size align 8 symtab 0 alias set -1 canonical type 0x7ff648c0 arg-types > pointer_to_this > addressable public decl_2 QI file newarray_overflow.java line 20 col 0 align 8 context initial result ignored VOID file newarray_overflow.java line 0 col 0 align 1 context > struct-function 0x7ff98df8 chain > ... which is why the TYPE_NAME macro complains. Is it expected for a builtin to appear as if it were a nested function like this? If so, would it make sense to do something like replace this: put_decl_node (TYPE_NAME (DECL_CONTEXT (node)), verbosity); with: put_decl_node (TREE_CODE (DECL_CONTEXT (node)) == FUNCTION_DECL ? DECL_CONTEXT (node) : TYPE_NAME (DECL_CONTEXT (node)), verbosity); so we just treat the builtin as another layer of scope? cheers, DaveK