re PR tree-optimization/52429 (ICE in separate_decls_in_region_debug, at tree-parloops.c:914 with -ftree-parallelize-loops)

PR tree-optimization/52429
	* tree-parloops.c (separate_decls_in_region_debug): Return early
	if var is LABEL_DECL.

	* gcc.dg/torture/pr52429.c: New test.
	* g++.dg/opt/pr52429.C: New test.

From-SVN: r184665
This commit is contained in:
Jakub Jelinek 2012-02-29 18:43:56 +01:00 committed by Jakub Jelinek
parent bce5e52b26
commit 598e67d7a0
5 changed files with 60 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2012-02-29 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/52429
* tree-parloops.c (separate_decls_in_region_debug): Return early
if var is LABEL_DECL.
2012-02-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/52424

View File

@ -1,3 +1,9 @@
2012-02-29 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/52429
* gcc.dg/torture/pr52429.c: New test.
* g++.dg/opt/pr52429.C: New test.
2012-02-29 Richard Guenther <rguenther@suse.de>
PR testsuite/52297

View File

@ -0,0 +1,23 @@
// PR tree-optimization/52429
// { dg-do compile }
// { dg-require-effective-target pthread }
// { dg-options "-O -g -ftree-parallelize-loops=4" }
struct B
{
B () : b (__null) {}
int *b;
};
void *
operator new (__SIZE_TYPE__, void *p)
{
return p;
}
void
foo (B *x, unsigned y)
{
while (y--)
new (x) B;
}

View File

@ -0,0 +1,24 @@
/* PR tree-optimization/52429 */
/* { dg-do compile } */
/* { dg-require-effective-target pthread } */
/* { dg-options "-g -ftree-parallelize-loops=4" } */
double d[65536], e[65536];
void
foo (void)
{
int i;
double f, g;
for (i = 0; i < 65536; i++)
{
f = e[i];
goto lab1;
lab2:
d[i] = f * g;
continue;
lab1:
g = d[i];
goto lab2;
}
}

View File

@ -909,7 +909,7 @@ separate_decls_in_region_debug (gimple stmt, htab_t name_copies,
var = gimple_debug_source_bind_get_var (stmt);
else
return true;
if (TREE_CODE (var) == DEBUG_EXPR_DECL)
if (TREE_CODE (var) == DEBUG_EXPR_DECL || TREE_CODE (var) == LABEL_DECL)
return true;
gcc_assert (DECL_P (var) && SSA_VAR_P (var));
ielt.uid = DECL_UID (var);