Patchwork [gimplefe] patch that fixes the bug for the failure test case

login
register
mail settings
Submitter Sandeep Soni
Date June 9, 2012, 2:25 a.m.
Message ID <CANY-sXW-n_iQ3awBbxTMhuwepYOvkHryMZ7feTkZAj5LzG+u+g@mail.gmail.com>
Download mbox | patch
Permalink /patch/163884/
State New
Headers show

Comments

Sandeep Soni - June 9, 2012, 2:25 a.m.
Hi,

This patch fixes the failure test case that I had submitted the last time.

The changeLog is testsuite/gChangeLog.gimplefe is as follows.

2012-06-09   Sandeep Soni <soni.sandeepb@gmail.com>
              * gimple.dg/20120605-2.gimple : New.

While the changelog in gimple/ChangeLog is as follows
2012-06-09   Sandeep Soni <soni.sandeepb@gmail.com>
              * parser.c (gp_parse_expect_return_var) : Modify to have
correct token consumption.
Diego Novillo - June 12, 2012, 1:27 p.m.
On 12-06-08 22:25 , Sandeep Soni wrote:
> Hi,
>
> This patch fixes the failure test case that I had submitted the last time.
>
> The changeLog is testsuite/gChangeLog.gimplefe is as follows.
>
> 2012-06-09   Sandeep Soni<soni.sandeepb@gmail.com>
>                * gimple.dg/20120605-2.gimple : New.
>
> While the changelog in gimple/ChangeLog is as follows
> 2012-06-09   Sandeep Soni<soni.sandeepb@gmail.com>
>                * parser.c (gp_parse_expect_return_var) : Modify to have
> correct token consumption.

I don't follow how your patch fixes the ICE.  Could you describe it a 
bit more?  How was it failing?

You'll need a blank line after the date line in ChangeLog entries.


Thanks.  Diego.
Sandeep Soni - June 12, 2012, 5:52 p.m.
On Tue, Jun 12, 2012 at 6:57 PM, Diego Novillo <dnovillo@google.com> wrote:
> On 12-06-08 22:25 , Sandeep Soni wrote:
>>
>> Hi,
>>
>> This patch fixes the failure test case that I had submitted the last time.
>>
>> The changeLog is testsuite/gChangeLog.gimplefe is as follows.
>>
>> 2012-06-09   Sandeep Soni<soni.sandeepb@gmail.com>
>>               * gimple.dg/20120605-2.gimple : New.
>>
>> While the changelog in gimple/ChangeLog is as follows
>> 2012-06-09   Sandeep Soni<soni.sandeepb@gmail.com>
>>               * parser.c (gp_parse_expect_return_var) : Modify to have
>> correct token consumption.
>
>
> I don't follow how your patch fixes the ICE.  Could you describe it a bit
> more?  How was it failing?
>

One of the previous versions of the code in gp_parse_call_stmt relied
on gimple_peek_token. But in some subsequent patch that was replaced
with gimple_consume_token in order to avoid excessive peeking. This
caused breaking of the compiler because it consumed more tokens than
required and was left to expect more tokens.

The patch fixes that.

> You'll need a blank line after the date line in ChangeLog entries.
>

Here is the modified ChangeLog entry

2012-06-09   Sandeep Soni<soni.sandeepb@gmail.com>

              * gimple.dg/20120605-2.gimple : New.

While the changelog in gimple/ChangeLog is as follows
2012-06-09   Sandeep Soni<soni.sandeepb@gmail.com>

              * parser.c (gp_parse_expect_return_var) : Modify to have
correct token consumption.
Diego Novillo - June 12, 2012, 6:23 p.m.
On 12-06-12 13:52 , Sandeep Soni wrote:
> On Tue, Jun 12, 2012 at 6:57 PM, Diego Novillo<dnovillo@google.com>  wrote:
>> On 12-06-08 22:25 , Sandeep Soni wrote:
>>>
>>> Hi,
>>>
>>> This patch fixes the failure test case that I had submitted the last time.
>>>
>>> The changeLog is testsuite/gChangeLog.gimplefe is as follows.
>>>
>>> 2012-06-09   Sandeep Soni<soni.sandeepb@gmail.com>
>>>                * gimple.dg/20120605-2.gimple : New.
>>>
>>> While the changelog in gimple/ChangeLog is as follows
>>> 2012-06-09   Sandeep Soni<soni.sandeepb@gmail.com>
>>>                * parser.c (gp_parse_expect_return_var) : Modify to have
>>> correct token consumption.
>>
>>
>> I don't follow how your patch fixes the ICE.  Could you describe it a bit
>> more?  How was it failing?
>>
>
> One of the previous versions of the code in gp_parse_call_stmt relied
> on gimple_peek_token. But in some subsequent patch that was replaced
> with gimple_consume_token in order to avoid excessive peeking. This
> caused breaking of the compiler because it consumed more tokens than
> required and was left to expect more tokens.
>
> The patch fixes that.

Thanks.  The patch is OK.


Diego.

Patch

Index: gcc/testsuite/gimple.dg/20120604-2.gimple
===================================================================
--- gcc/testsuite/gimple.dg/20120604-2.gimple	(revision 0)
+++ gcc/testsuite/gimple.dg/20120604-2.gimple	(revision 0)
@@ -0,0 +1 @@ 
+gimple_cond<modify_expr,a,3,<tlabel>,<flabel>> /* { dg-error
"Unsupported gimple_cond expression" } */
Index: gcc/gimple/parser.c
===================================================================
--- gcc/gimple/parser.c	(revision 188324)
+++ gcc/gimple/parser.c	(working copy)
@@ -634,16 +634,11 @@ 
 static void
 gp_parse_expect_return_var (gimple_parser *parser)
 {
-  const gimple_token *next_token;
-
-  next_token = gl_consume_token (parser->lexer);
-
-  if (next_token->type == CPP_NAME)
-    next_token = gl_consume_token (parser->lexer);
-
   /* There may be no variable in which the return value is collected.
      In that case this field in the tuple will contain NULL. We need
      to handle it too.  */
+  gl_consume_expected_token (parser->lexer, CPP_NAME);
+
 }


@@ -664,7 +659,6 @@ 
       break;

     case CPP_MULT:
-      next_token = gl_consume_token (parser->lexer);
       gl_consume_expected_token (parser->lexer, CPP_NAME);
       break;

@@ -692,7 +686,6 @@ 
 	break;
       else if (next_token->type == CPP_COMMA)
         {
-          next_token = gl_consume_token (parser->lexer);
           gp_parse_expect_argument (parser);
         }
     }