K6 patch (was: -march=k6 broken in 2.96 ?)

Remi Guyomarch rguyom@mail.dotcom.fr
Sun Nov 14 07:49:00 GMT 1999


On Sat, Nov 13, 1999 at 09:36:50PM +0100, Remi Guyomarch wrote:
> On Sat, Nov 13, 1999 at 02:54:49PM +0100, Remi Guyomarch wrote:
> 
> The compiler segfault in this code in gcc/config/i386.c:1839 :
> 
>   /* Special case: on K6, [%esi] makes the instruction vector decoded.
>      Avoid this by transforming to [%esi+0].  */
>   if (ix86_cpu == PROCESSOR_K6 && !optimize_size
>       && base && !index && !disp
>       && REGNO_REG_CLASS (REGNO (base)) == SIREG)
>     disp = const0_rtx;
> 
> REGNO( base) seems to return base->fld[0].rtint if I followed the
> macros correctly. But base->fld[0].rtint == 675986544 which is obviously not
> a good index for regclass_map[].
[...]
> (gdb) print *base
> $2 = {code = SUBREG, mode = SImode, jump = 0, call = 0, unchanging = 0, volatil = 0,
>   in_struct = 0, used = 0, integrated = 0, frame_related = 0, fld = {{
>       rtwint = 675986544, rtint = 675986544, rtstr = 0x284abc70 "R", rtx = 0x284abc70,
>       rtvec = 0x284abc70, rttype = 675986544, rt_addr_diff_vec_flags = {
>         min_align = 112, base_after_vec = 0, min_after_vec = 0, max_after_vec = 1,
>         min_after_base = 1, max_after_base = 1, offset_unsigned = 1, 2, scale = 74},
>       rtbit = 0x284abc70, rttree = 0x284abc70, bb = 0x284abc70}}}

Does this patch makes any sens ? 
With it I can bootstrap the 1999-11-10 snapshot with BOOT_CFLAGS="-O2 -march=k6".
And the compiler still transform, for example, "movl %eax,(%esi)" to 
"movl %eax,0(%esi)".

--- egcs-19991110/gcc/config/i386/i386.c~	Sun Nov 14 15:26:05 1999
+++ egcs-19991110/gcc/config/i386/i386.c	Sun Nov 14 15:47:30 1999
@@ -1838,6 +1838,7 @@
      Avoid this by transforming to [%esi+0].  */
   if (ix86_cpu == PROCESSOR_K6 && !optimize_size
       && base && !index && !disp
+      && GET_CODE (base) == REG
       && REGNO_REG_CLASS (REGNO (base)) == SIREG)
     disp = const0_rtx;


More information about the Gcc-patches mailing list