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

2013-12-05 Thread Marek Polacek
When we're passing ADDR_EXPR of long long int argument in -m32 mode, the ADDR_EXPR's VAR_DECL has to have its DECL_RTL set and corresponding stack slot allocated, it seems. Otherwise we ICE when expanding a function with such argument. This patch does that and adds a testcase for it.

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

2013-12-05 Thread Jakub Jelinek
On Thu, Dec 05, 2013 at 12:26:25PM +0100, Marek Polacek wrote: --- gcc/ubsan.h.mp2013-12-05 11:25:18.979469651 +0100 +++ gcc/ubsan.h 2013-12-05 11:25:28.958507098 +0100 @@ -41,7 +41,7 @@ extern tree ubsan_instrument_unreachable extern tree ubsan_create_data (const char *,

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

2013-12-05 Thread Marek Polacek
On Thu, Dec 05, 2013 at 12:37:27PM +0100, Jakub Jelinek wrote: On Thu, Dec 05, 2013 at 12:26:25PM +0100, Marek Polacek wrote: --- gcc/ubsan.h.mp 2013-12-05 11:25:18.979469651 +0100 +++ gcc/ubsan.h 2013-12-05 11:25:28.958507098 +0100 @@ -41,7 +41,7 @@ extern tree

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

2013-12-05 Thread Jakub Jelinek
On Thu, Dec 05, 2013 at 04:31:20PM +0100, Marek Polacek wrote: + } + t = build_fold_addr_expr (var); + return build2 (COMPOUND_EXPR, TREE_TYPE (t), tem, t); I would expect you want to use this too even if in_expand_p... Unfortunately, this won't be sufficient -- in

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

2013-12-05 Thread Marek Polacek
On Thu, Dec 05, 2013 at 04:44:29PM +0100, Jakub Jelinek wrote: On Thu, Dec 05, 2013 at 04:31:20PM +0100, Marek Polacek wrote: + } + t = build_fold_addr_expr (var); + return build2 (COMPOUND_EXPR, TREE_TYPE (t), tem, t); I would expect you want to use

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

2013-12-05 Thread Jakub Jelinek
On Thu, Dec 05, 2013 at 06:14:03PM +0100, Marek Polacek wrote: 2013-12-05 Marek Polacek pola...@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

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

2013-12-05 Thread Marek Polacek
On Thu, Dec 05, 2013 at 06:22:02PM +0100, Jakub Jelinek wrote: As a follow-up, please see if all the dg-skip-if -flto ubsan markings can be removed now. Unfortunately, not yet. With -flto, we fail with cclAoIBG.o:(.text+0x14): undefined reference to `.Lubsan_data0.2616'^M collect2: error: ld