On Tue, Jun 3, 2014 at 9:38 AM, Ilya Enkovich <enkovich....@gmail.com> wrote:
> Hi,
>
> This patch allows BUILT_IN_CHKP_BNDRET as a consumer of a result of 
> BUILT_IN_STACK_SAVE call.
>
> Bootstrapped and tested on linux-x86_64.
>
> Thanks,
> Ilya
> --
> gcc/
>
> 2014-06-03  Ilya Enkovich  <ilya.enkov...@intel.com>
>
>         * tree-ssa-ccp.c (insert_clobber_before_stack_restore): Handle
>         BUILT_IN_CHKP_BNDRET calls.
>
>
> diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
> index eeefeaf..c138337 100644
> --- a/gcc/tree-ssa-ccp.c
> +++ b/gcc/tree-ssa-ccp.c
> @@ -1848,7 +1848,7 @@ insert_clobber_before_stack_restore (tree saved_val, 
> tree var,
>                                      gimple_htab *visited)
>  {
>    gimple stmt, clobber_stmt;
> -  tree clobber;
> +  tree clobber, fndecl;
>    imm_use_iterator iter;
>    gimple_stmt_iterator i;
>    gimple *slot;
> @@ -1880,6 +1880,10 @@ insert_clobber_before_stack_restore (tree saved_val, 
> tree var,
>      else if (gimple_assign_ssa_name_copy_p (stmt))
>        insert_clobber_before_stack_restore (gimple_assign_lhs (stmt), var,
>                                            visited);
> +    else if (gimple_code (stmt) == GIMPLE_CALL
> +            && (fndecl = targetm.builtin_chkp_function 
> (BUILT_IN_CHKP_BNDRET))
> +            && gimple_call_fndecl (stmt) == fndecl)
> +      continue;

Please change this to use the proper abstraction once implemented.  It should
be sth like

    else if (is_gimple_call (stmt)
               && gimple_call_builtin_p (stmt, BUILT_IN_CHKP_BNDRET))
       continue;

I assume now that the builtins are not target builtins but added to
builtins.def.

Richard.

>      else
>        gcc_assert (is_gimple_debug (stmt));
>  }

Reply via email to