From: Jakub Jelinek Date: Thu, 21 Jun 2007 12:20:42 +0000 (+0200) Subject: re PR tree-optimization/31866 (ICE with tree check error: expected ssa_name, have... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3521f3cc39a96d9949031cb8ed464ce9ed69e34d;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cabe8b941fa..24b715a74e4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2007-06-21 Jakub Jelinek + 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. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 55549f00289..81721f9db21 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-06-21 Jakub Jelinek + + PR tree-optimization/31866 + * gcc.dg/pr31866.c: New test. + 2007-06-21 Richard Guenther PR tree-optimization/32451 diff --git a/gcc/testsuite/gcc.dg/pr31866.c b/gcc/testsuite/gcc.dg/pr31866.c new file mode 100644 index 00000000000..a2a254a0798 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr31866.c @@ -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; +} diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c index 04f97cf1462..1c82c8d0b91 100644 --- a/gcc/tree-ssa-coalesce.c +++ b/gcc/tree-ssa-coalesce.c @@ -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 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);