Commit 080140bc by Martin Liska Committed by Martin Liska

Fix PR sanitizer/78270 (part 2)

	PR sanitizer/78270
	* gimplify.c (gimplify_switch_expr): Always save previous
	gimplify_ctxp->live_switch_vars.
	PR sanitizer/78270
	* gcc.dg/asan/pr78270.c: Update comment style.
	* gcc.dg/asan/pr78270-2.c: New test.

From-SVN: r242485
parent 3e077364
2016-11-16 Martin Liska <mliska@suse.cz>
PR sanitizer/78270
* gimplify.c (gimplify_switch_expr): Always save previous
gimplify_ctxp->live_switch_vars.
2016-11-16 Andrew Burgess <andrew.burgess@embecosm.com>
* config/arc/arc.md (movb peephole2): New peephole2 to merge two
......@@ -2255,11 +2255,11 @@ gimplify_switch_expr (tree *expr_p, gimple_seq *pre_p)
gimplify_ctxp->case_labels.create (8);
/* Do not create live_switch_vars if SWITCH_BODY is not a BIND_EXPR. */
saved_live_switch_vars = gimplify_ctxp->live_switch_vars;
if (TREE_CODE (SWITCH_BODY (switch_expr)) == BIND_EXPR)
{
saved_live_switch_vars = gimplify_ctxp->live_switch_vars;
gimplify_ctxp->live_switch_vars = new hash_set<tree> (4);
}
gimplify_ctxp->live_switch_vars = new hash_set<tree> (4);
else
gimplify_ctxp->live_switch_vars = NULL;
bool old_in_switch_expr = gimplify_ctxp->in_switch_expr;
gimplify_ctxp->in_switch_expr = true;
......
2016-11-16 Martin Liska <mliska@suse.cz>
PR sanitizer/78270
* gcc.dg/asan/pr78270.c: Update comment style.
* gcc.dg/asan/pr78270-2.c: New test.
2016-11-16 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
* c-c++-common/Wlogical-op-1.c: Use __INT{16,32}_TYPE__ instead
......
/* PR sanitizer/78270 */
/* { dg-do compile } */
/* { dg-additional-options "-Wno-switch-unreachable" } */
int a;
void
fn1 ()
{
switch (a)
{
char b;
case 8:
&b;
switch (0)
;
}
}
// { dg-do compile }
// { dg-additional-options "-Wno-switch-unreachable" }
/* PR sanitizer/78270 */
/* { dg-do compile } */
/* { dg-additional-options "-Wno-switch-unreachable" } */
typedef struct
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment