Commit 20b11fd4 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/86025 (ICE with -Wduplicated-branches and OpenMP critical)

	PR c++/86025
	* tree.c (inchash::add_expr): Handle IDENTIFIER_NODE.

	* c-c++-common/gomp/pr86025.c: New test.

From-SVN: r261137
parent ea476799
2018-06-04 Jakub Jelinek <jakub@redhat.com>
PR c++/86025
* tree.c (inchash::add_expr): Handle IDENTIFIER_NODE.
2018-06-03 Eric Botcazou <ebotcazou@adacore.com> 2018-06-03 Eric Botcazou <ebotcazou@adacore.com>
PR tree-optimization/86034 PR tree-optimization/86034
......
2018-06-04 Jakub Jelinek <jakub@redhat.com>
PR c++/86025
* c-c++-common/gomp/pr86025.c: New test.
2018-06-03 Andreas Schwab <schwab@linux-m68k.org> 2018-06-03 Andreas Schwab <schwab@linux-m68k.org>
* gcc.target/powerpc/altivec-7.c: Remove extra brace. * gcc.target/powerpc/altivec-7.c: Remove extra brace.
......
/* PR c++/86025 */
/* { dg-do compile } */
/* { dg-additional-options "-Wduplicated-branches" } */
int i;
void
foo (int x)
{
if (x)
{
#pragma omp critical (foo)
i++;
}
else
{
#pragma omp critical
i++;
}
}
...@@ -7360,6 +7360,9 @@ add_expr (const_tree t, inchash::hash &hstate, unsigned int flags) ...@@ -7360,6 +7360,9 @@ add_expr (const_tree t, inchash::hash &hstate, unsigned int flags)
for (i = 0; i < TREE_VEC_LENGTH (t); ++i) for (i = 0; i < TREE_VEC_LENGTH (t); ++i)
inchash::add_expr (TREE_VEC_ELT (t, i), hstate, flags); inchash::add_expr (TREE_VEC_ELT (t, i), hstate, flags);
return; return;
case IDENTIFIER_NODE:
hstate.add_object (IDENTIFIER_HASH_VALUE (t));
return;
case FUNCTION_DECL: case FUNCTION_DECL:
/* When referring to a built-in FUNCTION_DECL, use the __builtin__ form. /* When referring to a built-in FUNCTION_DECL, use the __builtin__ form.
Otherwise nodes that compare equal according to operand_equal_p might 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