Commit 410a590c by Marek Polacek Committed by Marek Polacek

re PR c++/79672 (ICE with -Wduplicated-branches -fopenmp)

	PR c++/79672
	* tree.c (inchash::add_expr): Handle TREE_VEC.

	* g++.dg/warn/Wduplicated-branches2.C: Fix PR.
	* g++.dg/warn/Wduplicated-branches3.C: New test.

From-SVN: r245996
parent f084a22e
2017-03-09 Marek Polacek <polacek@redhat.com>
PR c++/79672
* tree.c (inchash::add_expr): Handle TREE_VEC.
2017-03-09 Martin Liska <mliska@suse.cz>
PR ipa/79764
......
2017-03-09 Marek Polacek <polacek@redhat.com>
PR c++/79672
* g++.dg/warn/Wduplicated-branches2.C: Fix PR.
* g++.dg/warn/Wduplicated-branches3.C: New test.
2017-03-09 Prachi Godbole <prachi.godbole@imgtec.com>
* gcc.target/mips/msa-bclri.c: Skip the test for -O0.
......
// PR c/6427
// PR c/64279
// { dg-do compile { target c++11 } }
// { dg-options "-Wduplicated-branches" }
......
// PR c++/79672
// { dg-do compile }
// { dg-options "-Wduplicated-branches -fopenmp" }
// { dg-require-effective-target fopenmp }
template<int N> void foo()
{
if (N > 0)
{
#pragma omp parallel for
for (int i = 0; i < 10; ++i) ;
}
}
void bar()
{
foo<0>();
}
......@@ -7865,6 +7865,10 @@ add_expr (const_tree t, inchash::hash &hstate, unsigned int flags)
inchash::add_expr (tsi_stmt (i), hstate, flags);
return;
}
case TREE_VEC:
for (int i = 0; i < TREE_VEC_LENGTH (t); ++i)
inchash::add_expr (TREE_VEC_ELT (t, i), hstate, flags);
return;
case FUNCTION_DECL:
/* When referring to a built-in FUNCTION_DECL, use the __builtin__ form.
Otherwise nodes that compare equal according to operand_equal_p might
......
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