On Mon, Nov 12, 2012 at 04:45:55PM +0100, Tobias Burnus wrote:
> First, I have a small hyphen fix patch, which is on top of your
> merge branch. (The "asan" branch itself is okay.)

This patch is preapproved with appropriate ChangeLog entry.
Thanks.

> --- invoke.texi.orig    2012-11-12 15:41:31.000000000 +0100
> +++ invoke.texi 2012-11-12 15:16:33.856424039 +0100
> @@ -356,5 +356,5 @@ Objective-C and Objective-C++ Dialects}.
>  -falign-labels[=@var{n}] -falign-loops[=@var{n}] -faddress-sanitizer @gol
> ---fassociative-math fauto-inc-dec -fbranch-probabilities @gol
> ---fbranch-target-load-optimize fbranch-target-load-optimize2 @gol
> ---fbtr-bb-exclusive -fcaller-saves @gol
> +-fassociative-math -fauto-inc-dec -fbranch-probabilities @gol
> +-fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
> +-fbtr-bb-exclusive -fcaller-saves @gol
>  -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol

> Secondly, the following code fails on both the asan branch and on
> the merge branch with an ICE:
> 
> void TI_ASM_Pack_Inst (const int *opnd)
> {
>   int bopnd[5];
>   __builtin_bcopy(opnd, bopnd, sizeof (bopnd));
> }

The bug is elsewhere, the following patch should fix this
(and I've reordered the assignments according to the call arg
number, so that it is more readable at the same time).
Ok for trunk?

2012-11-12  Jakub Jelinek  <ja...@redhat.com>

        * asan.c (instrument_builtin_call) <case BUILT_IN_BCOPY>: Fix up
        dest assignment.

--- gcc/asan.c.jj       2012-11-12 17:16:16.000000000 +0100
+++ gcc/asan.c  2012-11-12 17:39:19.673022734 +0100
@@ -1044,16 +1044,16 @@ instrument_builtin_call (gimple_stmt_ite
       /* (s, s, n) style memops.  */
     case BUILT_IN_BCMP:
     case BUILT_IN_MEMCMP:
-      len = gimple_call_arg (call, 2);
       source0 = gimple_call_arg (call, 0);
       source1 = gimple_call_arg (call, 1);
+      len = gimple_call_arg (call, 2);
       break;
 
       /* (src, dest, n) style memops.  */
     case BUILT_IN_BCOPY:
-      len = gimple_call_arg (call, 2);
       source0 = gimple_call_arg (call, 0);
-      dest = gimple_call_arg (call, 2);
+      dest = gimple_call_arg (call, 1);
+      len = gimple_call_arg (call, 2);
       break;
 
       /* (dest, src, n) style memops.  */


        Jakub

Reply via email to