]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libgcj/22084 (Divide_1 test case hangs)
authorAndrew Haley <aph@redhat.com>
Fri, 9 Sep 2005 13:05:20 +0000 (13:05 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Fri, 9 Sep 2005 13:05:20 +0000 (13:05 +0000)
2005-09-08  Andrew Haley  <aph@redhat.com>

PR java/22084
* include/i386-signal.h (HANDLE_DIVIDE_OVERFLOW): Bump IP by 1 if
R/M field in instruction is 100.

From-SVN: r104094

libjava/ChangeLog
libjava/include/i386-signal.h

index 832028e6119453f52963d6acf6327335b29c4615..a167ac4c8c6f66da6b7f12aec79eb63a34855a41 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-08  Andrew Haley  <aph@redhat.com>
+
+       PR java/22084
+       * include/i386-signal.h (HANDLE_DIVIDE_OVERFLOW): Bump IP by 1 if
+       R/M field in instruction is 100.
+
 2005-09-08  Thomas Fitzsimmons  <fitzsim@redhat.com>
 
        PR libgcj/23761
index f7b0edae6225332fbfa0e74a8dc800f773bf23b0..a5c8ae4bf54a55c966f3b7cdcb4db19124616feb 100644 (file)
@@ -64,18 +64,25 @@ do                                                                  \
       if (_regs->eax == 0x80000000                                     \
          && ((_modrm >> 3) & 7) == 7) /* Signed divide */              \
        {                                                               \
+         unsigned char _rm = _modrm & 7;                               \
          _regs->edx = 0; /* the remainder is zero */                   \
          switch (_modrm >> 6)                                          \
            {                                                           \
-           case 0:                                                     \
-             if ((_modrm & 7) == 5)                                    \
-               _eip += 4;                                              \
+           case 0:  /* register indirect */                            \
+             if (_rm == 5)   /* 32-bit displacement */                 \
+               _eip += 4;                                              \
+             if (_rm == 4)  /* A SIB byte follows the ModR/M byte */   \
+               _eip += 1;                                              \
              break;                                                    \
-           case 1:                                                     \
+           case 1:  /* register indirect + 8-bit displacement */       \
              _eip += 1;                                                \
+             if (_rm == 4)  /* A SIB byte follows the ModR/M byte */   \
+               _eip += 1;                                              \
              break;                                                    \
-           case 2:                                                     \
+           case 2:  /* register indirect + 32-bit displacement */      \
              _eip += 4;                                                \
+             if (_rm == 4)  /* A SIB byte follows the ModR/M byte */   \
+               _eip += 1;                                              \
              break;                                                    \
            case 3:                                                     \
              break;                                                    \