re PR tree-optimization/31866 (ICE with tree check error: expected ssa_name, have var_decl in create_outofssa_var_map)

PR tree-optimization/31866
	* tree-ssa-coalesce.c (create_outofssa_var_map): Do nothing
	if ASM_EXPR's input is not a SSA_NAME.

	* gcc.dg/pr31866.c: New test.

From-SVN: r125919
This commit is contained in:
Jakub Jelinek 2007-06-21 14:20:42 +02:00 committed by Jakub Jelinek
parent 64964499f4
commit 3521f3cc39
4 changed files with 39 additions and 2 deletions

View File

@ -1,5 +1,9 @@
2007-06-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/31866
* tree-ssa-coalesce.c (create_outofssa_var_map): Do nothing
if ASM_EXPR's input is not a SSA_NAME.
PR middle-end/32362
* omp-low.c (lookup_decl_in_outer_ctx): Don't ICE if t is NULL,
but decl is a global var, instead return decl.

View File

@ -1,3 +1,8 @@
2007-06-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/31866
* gcc.dg/pr31866.c: New test.
2007-06-21 Richard Guenther <rguenther@suse.de>
PR tree-optimization/32451

View File

@ -0,0 +1,28 @@
/* PR tree-optimization/31866 */
/* { dg-do compile { target alpha-*-* cris-*-* i?86-*-* mmix-*-* powerpc*-*-* rs6000-*-* x86_64-*-* } } */
/* { dg-options "-O2" } */
#if defined (__alpha__)
# define REG "$1"
#elif defined (__CRIS__)
# define REG "r10"
#elif defined (__i386__)
# define REG "%eax"
#elif defined (__MMIX__)
# define REG "$8"
#elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) \
|| defined (__POWERPC__) || defined (PPC) || defined (_IBMR2)
# define REG "6"
#elif defined (__x86_64__)
# define REG "rax"
#endif
long int
foo (void)
{
unsigned long int s;
long int a = (long int) 0;
register long int r asm (REG) = a;
asm ("" : "=r" (s) : "0" (r));
return s;
}

View File

@ -1,5 +1,5 @@
/* Coalesce SSA_NAMES together for the out-of-ssa pass.
Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Andrew MacLeod <amacleod@redhat.com>
This file is part of GCC.
@ -1037,7 +1037,7 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy)
char *end;
unsigned long match;
if (TREE_CODE (input) != SSA_NAME && !DECL_P (input))
if (TREE_CODE (input) != SSA_NAME)
continue;
match = strtoul (constraint, &end, 10);