re PR java/20522 (ICE in update_aliases, at java/decl.c:163)
authorAndrew Haley <aph@redhat.com>
Fri, 18 Mar 2005 13:59:06 +0000 (13:59 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Fri, 18 Mar 2005 13:59:06 +0000 (13:59 +0000)
2005-03-18  Andrew Haley  <aph@redhat.com>

        PR java/20522
        * decl.c (update_aliases): Don't update variables that are about
        to die.
        (maybe_poplevels): Add comment.

From-SVN: r96683

gcc/java/ChangeLog
gcc/java/decl.c

index cd374a2d8e9eae1aefee7faf8244c4b98d3201e8..bcf9156598106df30df7387c3f35cef029df12e9 100644 (file)
@@ -1,3 +1,10 @@
+2005-03-18  Andrew Haley  <aph@redhat.com>
+
+       PR java/20522
+       * decl.c (update_aliases): Don't update variables that are about
+       to die.
+       (maybe_poplevels): Add comment.
+
 2005-03-17  Bryce McKinlay  <mckinlay@redhat.com>
 
        PR java/20502
index 720b6322c9935d7501d34e68912e03829b940815..2f9da979733de03e0b30db1f0950e176c62cc9e7 100644 (file)
@@ -149,7 +149,10 @@ update_aliases (tree decl, int index, int pc)
          && LOCAL_SLOT_P (tmp) == 0
          && (pc == -1
              || (pc >= DECL_LOCAL_START_PC (tmp)
-                 && pc <= DECL_LOCAL_END_PC (tmp)))
+                 && pc < DECL_LOCAL_END_PC (tmp)))
+         /* This test is < (rather than <=) because there's no point
+            updating an alias that's about to die at the end of this
+            instruction.  */
          && (tmp_type == decl_type
              || (INTEGRAL_TYPE_P (tmp_type)
                  && INTEGRAL_TYPE_P (decl_type)
@@ -1741,6 +1744,12 @@ maybe_poplevels (int pc)
   current_pc = pc;
 #endif
 
+  /* FIXME: I'm pretty sure that this is wrong.  Variable scopes are
+     inclusive, so a variable is live if pc == end_pc.  Here, we
+     terminate a range if the current pc is equal to the end of the
+     range, and this is *before* we have generated code for the
+     instruction at end_pc.  We're closing a binding level one
+     instruction too early.*/
   while (current_binding_level->end_pc <= pc)
     poplevel (1, 0, 0);
 }