Re: [PATCH] Fix up emitting VAR_DECLs in ubsan

2013-11-26 Thread Marek Polacek
On Wed, Nov 27, 2013 at 12:31:18AM +0100, Jakub Jelinek wrote: > Please use here: > int z = 2; > if (z & 1) > or similar instead, to make sure it is only early > GIMPLE optimization passes that optimize it away, if already the > front end knows it isn't needed, perhaps in the future it could >

Re: [PATCH] Fix up emitting VAR_DECLs in ubsan

2013-11-26 Thread Jakub Jelinek
On Wed, Nov 27, 2013 at 12:26:08AM +0100, Marek Polacek wrote: > Ran the testsuite on x86_64-linux. Ok for trunk? Ok, with a minor nit. > --- gcc/testsuite/c-c++-common/ubsan/undefined-1.c.mp32013-11-26 > 23:56:42.151624262 +0100 > +++ gcc/testsuite/c-c++-common/ubsan/undefined-1.c2

[PATCH] Fix up emitting VAR_DECLs in ubsan

2013-11-26 Thread Marek Polacek
This patch does two things: 1) The hash table should consume VAR_DECLs rather than ADDR_EXPRs; the latter allegedly cannot be shared between different locations. 2) Sometimes it can happen that some earlier instrumentation (e.g. -fsanitize=shift) creates an .Lubsan_type, but later on varp