This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 5/5][GIMPLE FE] PR testsuite/80580: Handle invalid SSA names


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.
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]