OSDN Git Service

* tree-ssa-alias.c (create_name_tags): Ignore pointers that
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Jul 2004 15:32:47 +0000 (15:32 +0000)
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Jul 2004 15:32:47 +0000 (15:32 +0000)
don't have PT_VARS nor PT_MALLOC set.
Clear name tag from pointers that have not been dereferenced.
(set_pt_anything, set_pt_malloc): Forward declare.
* tree-ssa-copy.c (may_propagate_copy): Compare alias sets,
not type compatibility when determining if a pointer can be
copy propagated.

testsuite/ChangeLog

* gcc.c-torture/compile/20040727-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85220 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20040727-1.c [new file with mode: 0644]
gcc/tree-ssa-alias.c
gcc/tree-ssa-copy.c

index 6bb0422..5c877bf 100644 (file)
@@ -1,3 +1,13 @@
+2004-07-27  Diego Novillo  <dnovillo@redhat.com>
+
+       * tree-ssa-alias.c (create_name_tags): Ignore pointers that
+       don't have PT_VARS nor PT_MALLOC set.
+       Clear name tag from pointers that have not been dereferenced.
+       (set_pt_anything, set_pt_malloc): Forward declare.
+       * tree-ssa-copy.c (may_propagate_copy): Compare alias sets,
+       not type compatibility when determining if a pointer can be
+       copy propagated.
+
 2004-07-27  Richard Sandiford  <rsandifo@redhat.com>
 
        * expr.h (canonicalize_condition, get_condition): Add an int argument.
 2004-07-27  Richard Sandiford  <rsandifo@redhat.com>
 
        * expr.h (canonicalize_condition, get_condition): Add an int argument.
index 3091bb1..bf23710 100644 (file)
@@ -1,3 +1,7 @@
+2004-07-27  Diego Novillo  <dnovillo@redhat.com>
+
+       * gcc.c-torture/compile/20040727-1.c: New test.
+
 2004-07-26  Eric Christopher  <echristo@redhat.com>
 
        * gcc.c-torture/compile/20040726-2.c: New test.
 2004-07-26  Eric Christopher  <echristo@redhat.com>
 
        * gcc.c-torture/compile/20040726-2.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/20040727-1.c b/gcc/testsuite/gcc.c-torture/compile/20040727-1.c
new file mode 100644 (file)
index 0000000..a46abec
--- /dev/null
@@ -0,0 +1,32 @@
+/* Extracted from boehm-gc/os_dep.c on Darwin.  It caused an ICE when
+   trying to merge alias information from two pointers that had
+   different type memory tags.  */
+typedef int thread_state_flavor_t;
+typedef int exception_behavior_t;
+typedef unsigned int exception_mask_t;
+typedef unsigned int exception_handler_t;
+typedef unsigned int mach_msg_type_number_t;
+static struct {
+   mach_msg_type_number_t count;
+   exception_mask_t masks[16];
+   exception_handler_t ports[16];
+   thread_state_flavor_t flavors[16];
+} GC_old_exc_ports;
+
+typedef exception_handler_t *exception_handler_array_t;
+typedef thread_state_flavor_t *exception_flavor_array_t;
+
+
+int task_get_exception_ports
+(
+  mach_msg_type_number_t *masksCnt,
+  exception_handler_array_t old_handlers,
+  exception_flavor_array_t old_flavors
+);
+
+void GC_dirty_init()
+{
+   task_get_exception_ports(GC_old_exc_ports.masks,
+                           GC_old_exc_ports.ports,
+                           GC_old_exc_ports.flavors);
+}
index fab9e02..033a707 100644 (file)
@@ -157,6 +157,8 @@ static bool ptr_is_dereferenced_by (tree, tree, bool *);
 static void maybe_create_global_var (struct alias_info *ai);
 static void group_aliases (struct alias_info *);
 static struct ptr_info_def *get_ptr_info (tree t);
 static void maybe_create_global_var (struct alias_info *ai);
 static void group_aliases (struct alias_info *);
 static struct ptr_info_def *get_ptr_info (tree t);
+static void set_pt_anything (tree ptr);
+static void set_pt_malloc (tree ptr);
 
 /* Global declarations.  */
 
 
 /* Global declarations.  */
 
@@ -773,7 +775,12 @@ create_name_tags (struct alias_info *ai)
       struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
 
       if (!pi->is_dereferenced)
       struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
 
       if (!pi->is_dereferenced)
-       continue;
+       {
+         /* No name tags for pointers that have not been
+            dereferenced.  */
+         pi->name_mem_tag = NULL_TREE;
+         continue;
+       }
 
       if (pi->pt_vars)
        {
 
       if (pi->pt_vars)
        {
@@ -828,7 +835,8 @@ create_name_tags (struct alias_info *ai)
          /* Only pointers that may point to malloc or other variables
             may receive a name tag.  If the pointer does not point to
             a known spot, we should use type tags.  */
          /* Only pointers that may point to malloc or other variables
             may receive a name tag.  If the pointer does not point to
             a known spot, we should use type tags.  */
-         abort ();
+         set_pt_anything (ptr);
+         continue;
        }
 
       /* Mark the new name tag for renaming.  */
        }
 
       /* Mark the new name tag for renaming.  */
index 0ddfa9c..4dca3a5 100644 (file)
@@ -112,6 +112,9 @@ may_propagate_copy (tree dest, tree orig)
        return false;
       else if (!lang_hooks.types_compatible_p (type_d, type_o))
        return false;
        return false;
       else if (!lang_hooks.types_compatible_p (type_d, type_o))
        return false;
+      else if (!alias_sets_conflict_p (get_alias_set (type_d),
+                                      get_alias_set (type_o)))
+       return false;
     }
 
   /* If the destination is a SSA_NAME for a virtual operand, then we have
     }
 
   /* If the destination is a SSA_NAME for a virtual operand, then we have