diff mbox

[i386] : Increase memory address length only when rip_relative_addr_p returns false.

Message ID CAFULd4YA+TPnDtaZdjrQU-93=V1Y+5diOh0-r962C=-5H9imHg@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak Jan. 11, 2017, 9:59 p.m. UTC
Hello!

Revision 204369 [1] inadvertently reversed the detection of
RIP-relative address, resulting in the incorrect calculation of the
insn length. Attached patch fixes this problem.

2017-01-11  Uros Bizjak  <ubizjak@gmail.com>

    * config/i386/i386.c (memory_address_length): Increase len
    only when rip_relative_addr_p returns false.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Committed to mainline SVN and release branches.

[1] https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=204369

Uros.
diff mbox

Patch

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index e03dadd..bc4325a 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -28738,7 +28738,7 @@  memory_address_length (rtx addr, bool lea)
   else if (disp && !base && !index)
     {
       len += 4;
-      if (rip_relative_addr_p (&parts))
+      if (!rip_relative_addr_p (&parts))
 	len++;
     }
   else