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] Fix the one entry mem{{,p}cpy,move,set} optimization aliasing issues (PR middle-end/29272)


> I tried:
>
> --- builtins.c.jj       2006-10-04 10:59:46.000000000 +0200
> +++ builtins.c  2006-10-04 11:52:29.000000000 +0200
> @@ -7995,7 +7995,7 @@ fold_builtin_bzero (tree arglist, bool i
>  static tree
>  fold_builtin_memory_op (tree arglist, tree type, bool ignore, int endp)
>  {
> -  tree dest, src, len, destvar, srcvar, expr;
> +  tree dest, src, len, destvar, srcvar, expr, desttype, srctype;
>    unsigned HOST_WIDE_INT length;
>
>    if (! validate_arglist (arglist,
> @@ -8059,6 +8059,18 @@ fold_builtin_memory_op (tree arglist, tr
>              < (int) length)
>         return 0;
>
> +      desttype = build_pointer_type_for_mode (TREE_TYPE (destvar),
> +                                             ptr_mode, true);
> +      destvar = build_fold_addr_expr (destvar);
> +      destvar = fold_convert (desttype, destvar);
> +      destvar = build1 (INDIRECT_REF, TREE_TYPE (desttype), destvar);

What tree do you get at this point?

-- 
Eric Botcazou


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