From owner-pro64-contrib@oss.sgi.com Thu Mar 1 15:16:16 2001 Received: by oss.sgi.com id ; Thu, 1 Mar 2001 15:16:06 -0800 Received: from [38.170.141.29] ([38.170.141.29]:27123 "EHLO mail-in.hq.tensilica.com") by oss.sgi.com with ESMTP id ; Thu, 1 Mar 2001 15:16:02 -0800 Received: from tensilica.com (sys5.hq.tensilica.com [192.168.11.63]) by mail-in.hq.tensilica.com (8.9.3/8.9.3) with ESMTP id PAA29370 for ; Thu, 1 Mar 2001 15:16:01 -0800 Message-ID: <3A9ED822.4A381166@tensilica.com> Date: Thu, 01 Mar 2001 15:15:46 -0800 From: Sterling Augustine X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.16-3 i686) X-Accept-Language: en MIME-Version: 1.0 To: pro64-contrib@oss.sgi.com Subject: Parse error handling error Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-pro64-contrib@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;pro64-contrib-outgoing The simple test case below reveals an incorrect error. >>>>>>>>> void foo(void) { /*no trailing brace!*/ <<<<<< $ sgicc brace.c brace.c: In function `foo': brace.c:4: parse error at end of input ### Compiler Error during Writing WHIRL file phase: ### Can't write PU headers section in intermediate compiler file /tmp/ccB.e901qW The error does not occur in sgiCC. The problem occurs because WFE_Start_Function is called early in the parse, before you know if you have a valid PU. (gfecc has a substantially different rtl to whirl approach for functions which avoids the problem). The front end later chokes when it tries to write info out for an incomplete PU. Sterling From owner-pro64-contrib@oss.sgi.com Thu Mar 1 16:08:06 2001 Received: by oss.sgi.com id ; Thu, 1 Mar 2001 16:07:56 -0800 Received: from equator.dsl.speakeasy.net ([216.254.12.202]:1268 "EHLO gatekeeper.equator.com") by oss.sgi.com with ESMTP id ; Thu, 1 Mar 2001 16:07:39 -0800 Received: from equator.com (pine.equator.com [204.137.130.129]) by gatekeeper.equator.com (8.9.1a/8.9.1) with ESMTP id QAA06133 for ; Thu, 1 Mar 2001 16:07:37 -0800 (PST) Message-ID: <3A9EE491.C6DEC968@equator.com> Date: Thu, 01 Mar 2001 16:08:49 -0800 From: Sunil Raina Organization: Equator Technologies Inc X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: pro64-contrib@oss.sgi.com Subject: Missing gccfe files Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-pro64-contrib@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;pro64-contrib-outgoing The following files which are part of the original gcc source are missing from the Pro64 gccfe source directory. 1. c-parse.gperf 2. c-parse.in I would appreciate if you could provide them. -sunil From owner-pro64-contrib@oss.sgi.com Fri Mar 2 10:20:12 2001 Received: by oss.sgi.com id ; Fri, 2 Mar 2001 10:20:02 -0800 Received: from sgi.SGI.COM ([192.48.153.1]:25460 "EHLO sgi.com") by oss.sgi.com with ESMTP id ; Fri, 2 Mar 2001 10:19:51 -0800 Received: from gaea.engr.sgi.com ([130.62.180.97]) by sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam: SGI does not authorize the use of its proprietary systems or networks for unsolicited or bulk email from the Internet.) via ESMTP id KAA03889 for ; Fri, 2 Mar 2001 10:19:51 -0800 (PST) mail_from (murthy@sgi.com) Received: from sgi.com (localhost [127.0.0.1]) by gaea.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id KAA29082; Fri, 2 Mar 2001 10:12:37 -0800 (PST) Message-ID: <3A9FE295.29DEDDC4@sgi.com> Date: Fri, 02 Mar 2001 10:12:37 -0800 From: Chandrasekhar Murthy X-Mailer: Mozilla 4.51C-SGI [en] (X11; I; IRIX 6.5 IP32) X-Accept-Language: en MIME-Version: 1.0 To: Sterling Augustine CC: pro64-contrib@oss.sgi.com Subject: Re: Parse error handling error References: <3A9ED822.4A381166@tensilica.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-pro64-contrib@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;pro64-contrib-outgoing Sterling Augustine wrote: > > The simple test case below reveals an incorrect error. > > >>>>>>>>> > > void foo(void) > { > /*no trailing brace!*/ > > <<<<<< > > $ sgicc brace.c > brace.c: In function `foo': > brace.c:4: parse error at end of input > ### Compiler Error during Writing WHIRL file phase: > ### Can't write PU headers section in intermediate compiler file > /tmp/ccB.e901qW > > The error does not occur in sgiCC. > > The problem occurs because WFE_Start_Function is called early in the > parse, before you know if you have a valid PU. (gfecc has a > substantially different rtl to whirl approach for functions which avoids > the problem). The front end later chokes when it tries to write info > out for an incomplete PU. > > Sterling This is bug with how the WHIRL generation is done with the released C frontend. Because of WHIRL generation was done with this frontend, it is possible that there could be other cases where it does not terminate gracefully in the presence of source code errors. We are currently modifying the C frontend to generate WHIRL in the same fashion as what is being done for the C++ frontend. Murthy From owner-pro64-contrib@oss.sgi.com Thu Mar 8 13:34:40 2001 Received: by oss.sgi.com id ; Thu, 8 Mar 2001 13:34:31 -0800 Received: from [38.170.141.29] ([38.170.141.29]:43765 "EHLO heart.hq.tensilica.com") by oss.sgi.com with ESMTP id ; Thu, 8 Mar 2001 13:34:21 -0800 Received: (from goodwin@localhost) by heart.hq.tensilica.com (8.9.3/8.9.3) id NAA27440; Thu, 8 Mar 2001 13:33:56 -0800 X-Authentication-Warning: heart.hq.tensilica.com: goodwin set sender to goodwin@tensilica.com using -f From: David Goodwin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15015.64196.715282.473235@heart.hq.tensilica.com> Date: Thu, 8 Mar 2001 13:33:56 -0800 (PST) To: pro64-contrib@oss.sgi.com Cc: goodwin@tensilica.com Subject: patch for wn_lower.cxx: bad deallocation of map ids X-Mailer: VM 6.75 under Emacs 20.5.1 Reply-to: goodwin@tensilica.com Sender: owner-pro64-contrib@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;pro64-contrib-outgoing Here's a patch for a problem (I think) in wn_lower.cxx. *** wn_lower.cxx.old Thu Mar 8 13:30:47 2001 --- wn_lower.cxx Thu Mar 8 13:31:34 2001 *************** *** 10568,10574 **** if (RID_rwn(rid) == tree) RID_rwn(rid) = n_tree; } ! WN_Delete(tree); tree = n_tree; } } --- 10568,10577 ---- if (RID_rwn(rid) == tree) RID_rwn(rid) = n_tree; } ! /* We can't delete 'tree' since that would free the map id's ! associated with 'tree' even though 'n_tree' is now using ! them. */ ! // WN_Delete(tree); tree = n_tree; } } From owner-pro64-contrib@oss.sgi.com Fri Mar 9 10:23:42 2001 Received: by oss.sgi.com id ; Fri, 9 Mar 2001 10:23:33 -0800 Received: from pneumatic-tube.sgi.com ([204.94.214.22]:44610 "EHLO pneumatic-tube.sgi.com") by oss.sgi.com with ESMTP id ; Fri, 9 Mar 2001 10:23:14 -0800 Received: from gaea.engr.sgi.com (gaea.engr.sgi.com [130.62.180.97]) by pneumatic-tube.sgi.com (980327.SGI.8.8.8-aspam/980310.SGI-aspam) via ESMTP id KAA05890 for ; Fri, 9 Mar 2001 10:33:00 -0800 (PST) mail_from (murthy@sgi.com) Received: from sgi.com (localhost [127.0.0.1]) by gaea.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via ESMTP id KAA94015; Fri, 9 Mar 2001 10:21:57 -0800 (PST) Message-ID: <3AA91F44.8B11F304@sgi.com> Date: Fri, 09 Mar 2001 10:21:56 -0800 From: Chandrasekhar Murthy X-Mailer: Mozilla 4.51C-SGI [en] (X11; I; IRIX 6.5 IP32) X-Accept-Language: en MIME-Version: 1.0 To: goodwin@tensilica.com CC: pro64-contrib@oss.sgi.com Subject: Re: patch for wn_lower.cxx: bad deallocation of map ids References: <15015.64196.715282.473235@heart.hq.tensilica.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-pro64-contrib@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;pro64-contrib-outgoing Hi David, Could you send us the source program along with the commandline options used to reproduce the problem you encountered. Although your fix of commenting out the call to WN_Delete will solve the problem, it will increase the working set as memory will not be freed. Thanks, Murthy From owner-pro64-contrib@oss.sgi.com Fri Mar 9 11:15:32 2001 Received: by oss.sgi.com id ; Fri, 9 Mar 2001 11:15:22 -0800 Received: from [38.170.141.29] ([38.170.141.29]:20217 "EHLO heart.hq.tensilica.com") by oss.sgi.com with ESMTP id ; Fri, 9 Mar 2001 11:15:15 -0800 Received: (from goodwin@localhost) by heart.hq.tensilica.com (8.9.3/8.9.3) id LAA05599; Fri, 9 Mar 2001 11:15:14 -0800 X-Authentication-Warning: heart.hq.tensilica.com: goodwin set sender to goodwin@tensilica.com using -f From: David Goodwin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15017.11202.288207.933019@heart.hq.tensilica.com> Date: Fri, 9 Mar 2001 11:15:14 -0800 (PST) To: Chandrasekhar Murthy Cc: goodwin@tensilica.com, pro64-contrib@oss.sgi.com Subject: Re: patch for wn_lower.cxx: bad deallocation of map ids In-Reply-To: <3AA91F44.8B11F304@sgi.com> References: <15015.64196.715282.473235@heart.hq.tensilica.com> <3AA91F44.8B11F304@sgi.com> X-Mailer: VM 6.75 under Emacs 20.5.1 Reply-to: goodwin@tensilica.com Sender: owner-pro64-contrib@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;pro64-contrib-outgoing I've attached the program, but you won't be able to reproduce the problem with it because exception handling is required (and actually it is easiest to see when eh only partially enabled). It goes something like this: 1. function gslice::stride contains two regions, one for FUNC_ENTRY and one for an EH_CLEANUP of "a". 2. FUNC_ENTRY region assigned RID_map index of 1, EH_CLEANUP region assigned RID_map index of 0. 3. The lower replaces FUNC_ENTRY with another FUNC_ENTRY region, uses RID_map index of 1 for the new FUNC_ENTRY, but then frees index 1. 4. (this part I'm a little fuzzy on). When emitting whirl after optimizing, the optimizer generates a new map index for EH_CLEANUP, and since 1 is free, it uses that. So EH_CLEANUP's RID is stored at index 1. 5. optimizer then emits FUNC_ENTRY region, which has remembered RID_map index or 1, and so FUNC_ENTRY stores it's RID at index 1. So now both EH_CLEANUP and FUNC_ENTRY point to FUNC_ENTRY's RID. 6. Hit an assertion because EH_CLEANUP's RID (which is now incorrectly the same as FUNC_ENTRYs RID) is the wrong type (in region_util.cxx:REGION_is_EH). class valarray { private: int buf[10]; public: valarray(); valarray(const valarray& va); ~valarray(); }; valarray _M_stride; class gslice { public: valarray stride () const; private: bool _M_index; }; valarray gslice::stride () const { valarray a = _M_index ? _M_stride : valarray(); return a; } Chandrasekhar Murthy writes: > Hi David, > > Could you send us the source program along with the commandline > options used to reproduce the problem you encountered. > > Although your fix of commenting out the call to WN_Delete will > solve the problem, it will increase the working set as memory > will not be freed. > > Thanks, > Murthy