This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [asan] Patch - fix an ICE in asan.c
Jakub Jelinek <jakub@redhat.com> writes:
> 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 <jakub@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. */
Indeed. I was about to send a similar patch after Tobias' report.
Thanks.
--
Dodji