This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [GIMPLE FE] Fix ICE's with default ssa-name parsing in c_parser_gimple_postfix_expression
- From: Richard Biener <rguenther at suse dot de>
- To: Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>
- Cc: gcc Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 17 Feb 2017 14:31:51 +0100 (CET)
- Subject: Re: [GIMPLE FE] Fix ICE's with default ssa-name parsing in c_parser_gimple_postfix_expression
- Authentication-results: sourceware.org; auth=none
- References: <CAAgBjM=m2RWdVN3vH89GND8yL7OFJC2E=AHe2eYJ3pbv2nmLXg@mail.gmail.com>
On Fri, 17 Feb 2017, Prathamesh Kulkarni wrote:
> Hi,
> For the following test-case:
>
> int __GIMPLE () foo (int a)
> {
> return t0_1(D);
> }
>
> The compiler emits the undeclared diagnostic and then ICE's in
> c_parser_gimple_postfix_expression because we don't check if
> c_parser_parse_ssa_name returned error_mark_node.
> ICE: https://gist.github.com/anonymous/45a01338d80faf4f21330bc9ee97ca5f
>
> For this test-case:
> int __GIMPLE() foo(int a)
> {
> int _1;
> return _1(D);
> }
>
> c_parser_gimple_postfix_expression calls set_ssa_default_def which
> crashes with segfault
> because SSA_VAR_P(_1) is NULL and set_ssa_default_def expects it to be non-null.
> ICE: https://gist.github.com/anonymous/1df5a4e8a59eca289e214bbaf07a461a
>
> The patch rejects the above test-case with:
> foo.c: In function ‘foo’:
> foo.c:4:10: error: anonymous SSA name cannot have default definition
> return _1(D);
>
> OK to commit after bootstrap+test ?
Ok.
Thanks,
Richard.