pro64-contrib
[Top] [All Lists]

Re: Parse error handling error

To: Sterling Augustine <Sterling@xxxxxxxxxxxxx>
Subject: Re: Parse error handling error
From: Chandrasekhar Murthy <murthy@xxxxxxx>
Date: Fri, 02 Mar 2001 10:12:37 -0800
Cc: pro64-contrib@xxxxxxxxxxx
References: <3A9ED822.4A381166@tensilica.com>
Sender: owner-pro64-contrib@xxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>