gas/
authorJan Beulich <jbeulich@novell.com>
Mon, 9 May 2005 15:41:47 +0000 (15:41 +0000)
committerJan Beulich <jbeulich@novell.com>
Mon, 9 May 2005 15:41:47 +0000 (15:41 +0000)
2005-05-09  Jan Beulich  <jbeulich@novell.com>

* config/tc-i386.c (optimize_disp): Discard displacement entirely when zero and
not required by encoding constraints.

gas/testsuite/
2005-05-09  Jan Beulich  <jbeulich@novell.com>

* gas/i386/tlsd.[sd]: Adjust to not assume zero displacement will
actually be present in memory addressing.
* gas/i386/tlspic.[sd]: Likewise.

gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/ChangeLog
gas/testsuite/gas/i386/tlsd.d
gas/testsuite/gas/i386/tlsd.s
gas/testsuite/gas/i386/tlspic.d
gas/testsuite/gas/i386/tlspic.s

index a9a6c5fc5987b7aab65d3cfd09a8e33ba887f06a..a8efca8a82e08d1bfa18fad81133ad5f9b7e0482 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-09  Jan Beulich  <jbeulich@novell.com>
+
+       * config/tc-i386.c (optimize_disp): Discard displacement entirely when zero and
+       not required by encoding constraints.
+
 2005-05-09  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR 936
index baf3583ca1134fb1f334219a75f584e956fa24c1..1e1a11adfba8a8a1e80bc8e271d0a4a1f5e48899 100644 (file)
@@ -2082,7 +2082,13 @@ optimize_disp ()
            disp &= (((offsetT) 2 << 31) - 1);
            disp = (disp ^ ((offsetT) 1 << 31)) - ((addressT) 1 << 31);
          }
-       if (flag_code == CODE_64BIT)
+       if (!disp && (i.types[op] & BaseIndex))
+         {
+           i.types[op] &= ~Disp;
+           i.op[op].disps = 0;
+           i.disp_operands--;
+         }
+       else if (flag_code == CODE_64BIT)
          {
            if (fits_in_signed_long (disp))
              i.types[op] |= Disp32S;
index 96eb8705f30a4e47f9dfa25eb03fac310056846c..e0603e484c38872222e5b41e7399f1696e6e821e 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-09  Jan Beulich  <jbeulich@novell.com>
+
+       * gas/i386/tlsd.[sd]: Adjust to not assume zero displacement will
+       actually be present in memory addressing.
+       * gas/i386/tlspic.[sd]: Likewise.
+
 2005-05-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR 940
index 62efaa34507d100a9a4074b875c98fc3e2fc2131..bbf6fd49cfa9a59828b4b32a74b91a4756b9fdd8 100644 (file)
@@ -22,10 +22,10 @@ Disassembly of section .text:
 [      ]+1f: R_386_TLS_LDM     bar
   23:  e8 fc ff ff ff [        ]*call   24 <fn\+0x24>
 [      ]+24: R_386_PLT32       ___tls_get_addr
-  28:  8d 7f 00 [      ]*lea    0x0\(%edi\),%edi
+  28:  83 c7 00 [      ]*add    \$0x0,%edi
   2b:  8d 90 00 00 00 00 [     ]*lea    0x0\(%eax\),%edx
 [      ]+2d: R_386_TLS_LDO_32  bar
-  31:  8d 76 00 [      ]*lea    0x0\(%esi\),%esi
+  31:  83 c6 00 [      ]*add    \$0x0,%esi
   34:  8d 88 00 00 00 00 [     ]*lea    0x0\(%eax\),%ecx
 [      ]+36: R_386_TLS_LDO_32  baz
   3a:  8b 5d fc [      ]*mov    0xfffffffc\(%ebp\),%ebx
index 9ce01ec708d8e657dbac0141669d64723cddd4c9..f5c2c50e0dd365c537723963658c25a22dd2da47 100644 (file)
@@ -26,13 +26,13 @@ fn:
        call    ___tls_get_addr@PLT
 
        /* Just show that there can be arbitrary instructions here  */
-       leal    0(%edi, 1), %edi
+       addl    $0, %edi
 
        leal    bar@DTPOFF(%eax), %edx
        /* %edx now contains &bar  */
 
        /* Again, arbitrary instructions  */
-       leal    0(%esi, 1), %esi
+       addl    $0, %esi
 
        leal    baz@DTPOFF(%eax), %ecx
        /* %ecx now contains &baz  */
index fbe83a47c4a4700634a738e75768dd59551dee41..bd5dbb7bace9fa0e24b33e07984f1628b457976e 100644 (file)
@@ -1,5 +1,5 @@
 #objdump: -dr
-#name: i386 non-pic tls
+#name: i386 pic tls
 
 .*: +file format .*
 
@@ -15,12 +15,12 @@ Disassembly of section .text:
    b:  81 c3 03 00 00 00 [     ]*add    \$0x3,%ebx
 [      ]+d: R_386_GOTPC        _GLOBAL_OFFSET_TABLE_
   11:  65 a1 00 00 00 00 [     ]*mov    %gs:0x0,%eax
-  17:  8d 76 00 [      ]*lea    0x0\(%esi\),%esi
+  17:  83 c6 00 [      ]*add    \$0x0,%esi
   1a:  2b 83 00 00 00 00 [     ]*sub    0x0\(%ebx\),%eax
 [      ]+1c: R_386_TLS_IE_32   foo
   20:  8b 83 00 00 00 00 [     ]*mov    0x0\(%ebx\),%eax
 [      ]+22: R_386_TLS_GOTIE   foo
-  26:  8d 76 00 [      ]*lea    0x0\(%esi\),%esi
+  26:  83 c6 00 [      ]*add    \$0x0,%esi
   29:  65 8b 00 [      ]*mov    %gs:\(%eax\),%eax
   2c:  65 8b 0d 00 00 00 00 [  ]*mov    %gs:0x0,%ecx
   33:  03 8b 00 00 00 00 [     ]*add    0x0\(%ebx\),%ecx
index c9b97574ab553e88d7c1bc77d9ae1c87b177df0d..bd63fd47b0fa400763127af8711f418734318e08 100644 (file)
@@ -17,7 +17,7 @@ fn:
        movl    %gs:0, %eax
 
        /* Arbitrary instructions in between.  */
-       leal    0(%esi, 1), %esi
+       addl    $0, %esi
 
        subl    foo@GOTTPOFF(%ebx), %eax
        /* %eax now contains &foo  */
@@ -26,7 +26,7 @@ fn:
        movl    foo@GOTNTPOFF(%ebx), %eax
 
        /* Arbitrary instructions in between.  */
-       leal    0(%esi, 1), %esi
+       addl    $0, %esi
 
        movl    %gs:(%eax), %eax
        /* %eax now contains foo  */
This page took 0.035703 seconds and 4 git commands to generate.