This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Use correct optab when expanding a binop (PR sanitizer/59503)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 14 Dec 2013 08:46:10 +0100
- Subject: Re: [PATCH] Use correct optab when expanding a binop (PR sanitizer/59503)
- Authentication-results: sourceware.org; auth=none
- References: <20131214013831 dot GR11710 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sat, Dec 14, 2013 at 02:38:31AM +0100, Marek Polacek wrote:
> I noticed this bug a while ago on ppc64 and now I reproduced it even
> on x86_64 with -m32. The problem was that we were using add_optab even
> when dealing with MINUS_EXPR; we should use sub_optab instead.
>
> Regtested on x86_64-linux (with both -m32/-m64), ok for trunk?
>
> 2013-12-14 Marek Polacek <polacek@redhat.com>
>
> PR sanitizer/59503
> * internal-fn.c (ubsan_expand_si_overflow_addsub_check): Call
> expand_binop with correct optab depending on code.
> testsuite/
> * c-c++-common/ubsan/pr59503.c: New test.
Sure.
Jakub