i386.c (ix86_decompose_address): Prevent %fs:(%reg) addresses only when %reg is not...
authorUros Bizjak <ubizjak@gmail.com>
Tue, 13 Mar 2012 10:35:19 +0000 (11:35 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Tue, 13 Mar 2012 10:35:19 +0000 (11:35 +0100)
* config/i386/i386.c (ix86_decompose_address): Prevent %fs:(%reg)
addresses only when %reg is not in word mode.

From-SVN: r185327

gcc/ChangeLog
gcc/config/i386/i386.c

index 17aa11f0b782d3dd96f15b77d309195f3be87269..dd02f1864b8c9fa038c44d85bb3a92902de14c19 100644 (file)
@@ -1,3 +1,8 @@
+2012-03-13  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.c (ix86_decompose_address): Prevent %fs:(%reg)
+       addresses only when %reg is not in word mode.
+
 2012-03-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * config/microblaze/microblaze.md: Fix typo.
index e3668927cb6d76536ffd363082ea90b852bf6106..1a18dc7a3f2c8849f217144f9c4f6138284914c2 100644 (file)
@@ -11563,8 +11563,10 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)
        return 0;
     }
 
-  if (seg != SEG_DEFAULT && (base || index)
-      && !TARGET_TLS_INDIRECT_SEG_REFS)
+/* Address override works only on the (%reg) part of %fs:(%reg).  */
+  if (seg != SEG_DEFAULT
+      && ((base && GET_MODE (base) != word_mode)
+         || (index && GET_MODE (index) != word_mode)))
     return 0;
 
   /* Extract the integral value of scale.  */