[PATCH, PR61191, Cilk+] Fix ICE on syntax error

H.J. Lu hjl.tools@gmail.com
Tue May 20 15:27:00 GMT 2014


On Tue, May 20, 2014 at 7:31 AM, Zamyatin, Igor <igor.zamyatin@intel.com> wrote:
> Hi all!
>
> The following patch fixes the ICE for the cilk code with syntax error.
>
> Regtested on x86_64.
> Ok for trunk and 4.9?
>
> Thanks,
> Igor
>
>
> gcc/c/ChangeLog:
>
> 2014-05-20  Igor Zamyatin  <igor.zamyatin@intel.com>
>
> * c-array-notation.c (fix_builtin_array_notation_fn): Check invalid
> function parameters.
>
>
> diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c
> index 0ac6ba8..127f9a1 100644
> --- a/gcc/c/c-array-notation.c
> +++ b/gcc/c/c-array-notation.c
> @@ -229,6 +229,8 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var)
>    /* Fully fold any EXCESSIVE_PRECISION EXPR that can occur in the function
>       parameter.  */
>    func_parm = c_fully_fold (func_parm, false, NULL);
> +  if (func_parm == error_mark_node)
> +    return error_mark_node;
>
>    location = EXPR_LOCATION (an_builtin_fn);
>

You should include a testcase.


-- 
H.J.



More information about the Gcc-patches mailing list