On Mon, May 1, 2017 at 8:09 PM, Mikhail Maltsev <[email protected]> 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 <[email protected]>
>
> * gcc.dg/gimplefe-error-11.c: New test.
>
>
> gcc/c/ChangeLog:
>
> 2017-05-01 Mikhail Maltsev <[email protected]>
>
> * gimple-parser.c (c_parser_parse_ssa_name): Validate SSA name base.
>
>