[PATCH] Fix expand_builtin_memory_chk (PR middle-end/33423)

Richard Guenther richard.guenther@gmail.com
Sun Sep 16 19:16:00 GMT 2007


On 9/15/07, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> If __builtin___memset_chk is not folded into __builtin_memset during fab
> pass, it might be folded only during expand_builtin_memory_chk right before
> we want to pass that through to expand_expr.  As fold_builtin invoked
> by build_call_expr can return non-GIMPLE, in particular COMPOUND_EXPRs,
> but expand_expr wants to enforce GIMPLE input, we need to handle
> COMPOUND_EXPRs ourselves in expand_builtin_memory_chk.
> This is the same solution as is done e.g. in expand_builtin_memcpy,
> expand_builtin_mempcpy_args, expand_builtin_memmove_args and
> expand_builtin_strncpy.
>
> Tested on x86_64-linux, ok for trunk/4.2?

I don't like this ways of fixing up too much, but I guess this is ok
for stage3 (possibly with tuples there will be a more elegant solution).
For 4.2 please ask Mark or wait until after the 4.2.2 release.

Thanks,
Richard.

> 2007-09-15  Jakub Jelinek  <jakub@redhat.com>
>
>         PR middle-end/33423
>         * builtins.c (expand_builtin_memory_chk): Handle COMPOUND_EXPRs
>         returned by build_call_expr.
>
>         * gcc.c-torture/compile/20070915-1.c: New test.



More information about the Gcc-patches mailing list