matrix-reorg.c (analyze_matrix_allocation_site): Avoid referring to an unallocated...
authorRazya Ladelsky <razya@il.ibm.com>
Tue, 31 Jul 2007 08:09:49 +0000 (08:09 +0000)
committerRazya Ladelsky <razya@gcc.gnu.org>
Tue, 31 Jul 2007 08:09:49 +0000 (08:09 +0000)
2007-07-31  Razya Ladelsky  <razya@il.ibm.com>

        * matrix-reorg.c (analyze_matrix_allocation_site): Avoid referring
        to an unallocated space.

From-SVN: r127082

gcc/ChangeLog
gcc/matrix-reorg.c

index 8f7453bf1e9ebd992d2a991ed45ea3a07e56c8d5..ed544bd514ac10604727080232a16c27354f927e 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-31  Razya Ladelsky  <razya@il.ibm.com>
+
+        * matrix-reorg.c (analyze_matrix_allocation_site): Avoid referring 
+       to an unallocated space.
+
 2007-07-30  Jan Sjodin  <jan.sjodin@amd.com>
 
        * tree-data-ref.c
index 946690b280dc5337abb49af5c210c8019eefbd7c..46fd6e25a598fd38894cfe7f8d6bf9cd065e0863 100644 (file)
@@ -818,11 +818,15 @@ analyze_matrix_allocation_site (struct matrix_info *mi, tree stmt,
                  return;
                }
            }
-         /* This is a call to malloc.  Check to see if this is the first
-            call in this indirection level; if so, mark it; if not, mark
-            as escaping.  */
+         /* This is a call to malloc of level 'level'.  
+            mi->max_malloced_level-1 == level  means that we've 
+            seen a malloc statement of level 'level' before.  
+            If the statement is not the same one that we've 
+            seen before, then there's another malloc statement 
+            for the same level, which means that we need to mark 
+            it escaping.  */
          if (mi->malloc_for_level
-             && mi->malloc_for_level[level]
+             && mi->max_malloced_level-1 == level
              && mi->malloc_for_level[level] != stmt)
            {
              mark_min_matrix_escape_level (mi, level, stmt);