[PATCH] Fix up passing long long in ubsan with -m32 (PR sanitizer/59333)

Jakub Jelinek jakub@redhat.com
Thu Dec 5 17:22:00 GMT 2013


On Thu, Dec 05, 2013 at 06:14:03PM +0100, Marek Polacek wrote:
> 2013-12-05  Marek Polacek  <polacek@redhat.com>
> 
> 	PR sanitizer/59333
> 	PR sanitizer/59397
> 	* ubsan.c: Include rtl.h and expr.h.
> 	(ubsan_encode_value): Add new parameter.  If expanding, assign
> 	a stack slot for DECL_RTL of the temporary and call expand_assignment.
> 	Handle BOOLEAN_TYPE and ENUMERAL_TYPE.
> 	(ubsan_build_overflow_builtin): Adjust ubsan_encode_value call.
> 	* ubsan.h (ubsan_encode_value): Adjust declaration.
> 	* internal-fn.c (ubsan_expand_si_overflow_addsub_check): Move
> 	ubsan_build_overflow_builtin above expand_normal call.  Surround this call
> 	with push_temp_slots and pop_temp_slots.
> 	(ubsan_expand_si_overflow_neg_check): Likewise.
> 	(ubsan_expand_si_overflow_mul_check): Likewise.
> testsuite/
> 	* c-c++-common/ubsan/pr59333.c: New test.
> 	* c-c++-common/ubsan/pr59397.c: New test.

Ok, thanks.

> --- gcc/testsuite/c-c++-common/ubsan/pr59333.c.mp	2013-12-05 11:30:36.984759390 +0100
> +++ gcc/testsuite/c-c++-common/ubsan/pr59333.c	2013-12-05 17:28:07.203743004 +0100
> @@ -0,0 +1,19 @@
> +/* { dg-do run } */
> +/* { dg-options "-fsanitize=undefined" } */
> +/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */

As a follow-up, please see if all the dg-skip-if -flto
ubsan markings can be removed now.

	Jakub



More information about the Gcc-patches mailing list