[PATCH] Use correct optab when expanding a binop (PR sanitizer/59503)
Jakub Jelinek
jakub@redhat.com
Sat Dec 14 07:46:00 GMT 2013
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
More information about the Gcc-patches
mailing list