This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Use correct optab when expanding a binop (PR sanitizer/59503)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]