re PR middle-end/44197 ([4.6 Regresssion] varpool SEGV)
authorJan Hubicka <jh@suse.cz>
Thu, 20 May 2010 14:57:27 +0000 (16:57 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 20 May 2010 14:57:27 +0000 (14:57 +0000)
PR middle-end/44197
* varpool.c (varpool_remove_node): Handle in-varpool aliases.
* gcc.c-torture/compile/pr44197.c: New file.

From-SVN: r159629

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr44197.c [new file with mode: 0644]
gcc/varpool.c

index 972f6043908c0c37131e8d70bc856f9c00c44fc9..5f96aa7fe90a2f74f01ca60d4966d217f5c2b126 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-20  Jan Hubicka  <jh@suse.cz>
+
+       PR middle-end/44197
+       * varpool.c (varpool_remove_node): Handle in-varpool aliases.
+
 2010-05-20  Kenneth Zadeck  <zadeck@naturalbridge.com>
 
        PR bootstrap/43870
index e5412e8a9901e8965f39498f814f8d4801603e4d..7272fe5ae4f769ce31dab13d9d6ba1632d3d6b1e 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-20  Jan Hubicka  <jh@suse.cz>
+
+       PR middle-end/44197
+       * gcc.c-torture/compile/pr44197.c: New file.
+
 2010-05-20  Uros Bizjak  <ubizjak@gmail.com>
 
        * gcc.target/i386/i386.exp (check_effective_target_3dnow):
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44197.c b/gcc/testsuite/gcc.c-torture/compile/pr44197.c
new file mode 100644 (file)
index 0000000..9a97d77
--- /dev/null
@@ -0,0 +1,22 @@
+typedef unsigned short int __uint16_t;
+enum
+{
+  _ISupper = (1 << (0)), _ISlower = (1 << (1)), _ISalpha =
+    (1 << (2)), _ISdigit = (1 << (3)), _ISxdigit = (1 << (4)), _ISspace =
+    (1 << (5)), _ISprint = (1 << (6)), _ISgraph = (1 << (7)), _ISblank =
+    (1 << (8)), _IScntrl = (1 << (9)), _ISpunct = (1 << (10)), _ISalnum =
+    (1 << (11))
+};
+typedef __uint16_t __ctype_mask_t;
+extern const __ctype_mask_t *__C_ctype_b;
+extern
+__typeof (__C_ctype_b)
+     __C_ctype_b __asm__ ("" "__GI___C_ctype_b")
+  __attribute__ ((visibility ("hidden")));
+     static const __ctype_mask_t __C_ctype_b_data[] = {
+     };
+
+const __ctype_mask_t *__C_ctype_b = __C_ctype_b_data + 128;
+extern
+__typeof (__C_ctype_b)
+     __EI___C_ctype_b __attribute__ ((alias ("" "__GI___C_ctype_b")));
index c713a7705f6eb7bfa0083824d30f902d5ae9bdaf..7185c853f9fd9017a09f23fceaacf87fc2167531 100644 (file)
@@ -167,7 +167,7 @@ varpool_remove_node (struct varpool_node *node)
     node->prev->next = node->next;
   else
     {
-      if (node->alias)
+      if (node->alias && node->extra_name)
        {
           gcc_assert (node->extra_name->extra_name == node);
          node->extra_name->extra_name = node->next;