re PR tree-optimization/31866 (ICE with tree check error: expected ssa_name, have...
authorJakub Jelinek <jakub@redhat.com>
Thu, 21 Jun 2007 12:20:42 +0000 (14:20 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 21 Jun 2007 12:20:42 +0000 (14:20 +0200)
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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr31866.c [new file with mode: 0644]
gcc/tree-ssa-coalesce.c

index cabe8b941faf86707095f4d7ea7d4f665de60888..24b715a74e4f1491cdbe620bc7fd4e7b0fc5a651 100644 (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.
index 55549f00289fd524c445169d95894e6b15b4c724..81721f9db21f12e153aa7c578fb7ced280483151 100644 (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
diff --git a/gcc/testsuite/gcc.dg/pr31866.c b/gcc/testsuite/gcc.dg/pr31866.c
new file mode 100644 (file)
index 0000000..a2a254a
--- /dev/null
@@ -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;
+}
index 04f97cf1462761071e7868b4667db23888e21d94..1c82c8d0b9185497584b7d9a823538409993522c 100644 (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);