This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 5/5][GIMPLE FE] PR testsuite/80580: Handle invalid SSA names
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Mikhail Maltsev <maltsevm at gmail dot com>
- Cc: gcc-patches <gcc-patches at gnu dot org>, Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>
- Date: Tue, 2 May 2017 16:24:58 +0200
- Subject: Re: [PATCH 5/5][GIMPLE FE] PR testsuite/80580: Handle invalid SSA names
- Authentication-results: sourceware.org; auth=none
- References: <f922dfd7-f512-e424-faf9-3d819e031878@gmail.com>
On Mon, May 1, 2017 at 8:09 PM, Mikhail Maltsev <maltsevm@gmail.com> wrote:
> When parsing SSA names, we should check that parent names are scalars.
> In fact, this patch just uses the condition of a 'gcc_assert' in 'make_ssa_name_fn'.
+ if (!(VAR_P (parent)
+ || TREE_CODE (parent) == PARM_DECL
+ || TREE_CODE (parent) == RESULT_DECL
+ || (TYPE_P (parent) && is_gimple_reg_type (parent))))
+ {
+ error ("invalid SSA name %qE", parent);
+ return error_mark_node;
+ }
please drop || (TYPE_P (parent) && is_gimple_reg_type (parent))), that
case isn't valid.
Please also change wording slightly to "invalid base %qE for SSA name".
Ok with that changes.
Thanks,
Richard.
> --
> Regards,
> Mikhail Maltsev
>
>
> gcc/testsuite/ChangeLog:
>
> 2017-05-01 Mikhail Maltsev <maltsevm@gmail.com>
>
> * gcc.dg/gimplefe-error-11.c: New test.
>
>
> gcc/c/ChangeLog:
>
> 2017-05-01 Mikhail Maltsev <maltsevm@gmail.com>
>
> * gimple-parser.c (c_parser_parse_ssa_name): Validate SSA name base.
>
>