This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: x86 leal quirk


On Mon, Sep 23, 2002 at 04:15:05PM -0700, Richard Henderson wrote:
> I'd warn for _any_ segment override on leal.

That's reasonable since a segment override won't actually do
anything besides take up space in the object.  I'm inclined to
still generate the segment prefix if specified.  Is this what
you want?

	* gas/config/tc-i386.c (process_operands): Warn about "lea"
	segment overrides.

Index: gas/config/tc-i386.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.c,v
retrieving revision 1.131
diff -u -p -r1.131 tc-i386.c
--- gas/config/tc-i386.c	21 Sep 2002 10:39:16 -0000	1.131
+++ gas/config/tc-i386.c	23 Sep 2002 23:57:48 -0000
@@ -2604,9 +2604,8 @@ process_operands ()
   else if (i.tm.opcode_modifier & Modrm)
     {
       /* The opcode is completed (modulo i.tm.extension_opcode which
-	 must be put into the modrm byte).
-	 Now, we make the modrm & index base bytes based on all the
-	 info we've collected.  */
+	 must be put into the modrm byte).  Now, we make the modrm and
+	 index base bytes based on all the info we've collected.  */
 
       default_seg = build_modrm_byte ();
     }
@@ -2633,12 +2632,14 @@ process_operands ()
       default_seg = &ds;
     }
 
-  /* If a segment was explicitly specified,
-     and the specified segment is not the default,
-     use an opcode prefix to select it.
-     If we never figured out what the default segment is,
-     then default_seg will be zero at this point,
-     and the specified segment prefix will always be used.  */
+  if (i.tm.base_opcode == 0x8d /* lea */ && i.seg[0] && !quiet_warnings)
+    as_warn (_("segment override on `lea' is ineffectual"));
+
+  /* If a segment was explicitly specified, and the specified segment
+     is not the default, use an opcode prefix to select it.  If we
+     never figured out what the default segment is, then default_seg
+     will be zero at this point, and the specified segment prefix will
+     always be used.  */
   if ((i.seg[0]) && (i.seg[0] != default_seg))
     {
       if (!add_prefix (i.seg[0]->seg_prefix))


-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]