re PR middle-end/67452 (LTO ICE with -fopenmp-simd)

PR middle-end/67452
	* tree-ssa-live.c: Include cfgloop.h.
	(remove_unused_locals): Clear loop->simduid if simduid is about
	to be removed from cfun->local_decls.

	* gcc.dg/lto/pr67452_0.c: New test.

From-SVN: r227498
This commit is contained in:
Jakub Jelinek 2015-09-04 20:32:00 +02:00 committed by Jakub Jelinek
parent b52ec22050
commit 547fba7e1f
4 changed files with 44 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2015-09-04 Jakub Jelinek <jakub@redhat.com>
PR middle-end/67452
* tree-ssa-live.c: Include cfgloop.h.
(remove_unused_locals): Clear loop->simduid if simduid is about
to be removed from cfun->local_decls.
2015-09-02 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
PR target/65210

View File

@ -1,3 +1,8 @@
2015-09-04 Jakub Jelinek <jakub@redhat.com>
PR middle-end/67452
* gcc.dg/lto/pr67452_0.c: New test.
2015-09-02 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
PR target/65210

View File

@ -0,0 +1,23 @@
/* { dg-lto-do link } */
/* { dg-lto-options { { -O2 -flto -fopenmp-simd } } } */
float b[3][3];
__attribute__((used, noinline)) void
foo ()
{
int v1, v2;
#pragma omp simd collapse(2)
for (v1 = 0; v1 < 3; v1++)
for (v2 = 0; v2 < 3; v2++)
b[v1][v2] = 2.5;
}
int
main ()
{
asm volatile ("" : : "g" (b) : "memory");
foo ();
asm volatile ("" : : "g" (b) : "memory");
return 0;
}

View File

@ -50,6 +50,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa.h"
#include "cgraph.h"
#include "ipa-utils.h"
#include "cfgloop.h"
#ifdef ENABLE_CHECKING
static void verify_live_on_entry (tree_live_info_p);
@ -820,6 +821,14 @@ remove_unused_locals (void)
}
}
if (cfun->has_simduid_loops)
{
struct loop *loop;
FOR_EACH_LOOP (loop, 0)
if (loop->simduid && !is_used_p (loop->simduid))
loop->simduid = NULL_TREE;
}
cfun->has_local_explicit_reg_vars = false;
/* Remove unmarked local and global vars from local_decls. */