This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

gen_highpart patch for IA-64 linux bootstrap failure


This is needed to fix an ia64-linux bootstrap failure.  Current sources
fail while compiling libstdc++-v3/src/complex_io.cc with this error:
../../../../gcc/libstdc++-v3/include/bits/std_complex.h:375: Unrecognizable 
   insn:
(insn 178 177 179 (set (mem/s:SF (plus:DI (reg/v/u/f:DI 342)
                (const_int 4 [0x4])) 0)
        (reg:SF 383)) -1 (insn_list 177 (nil))
    (expr_list:REG_DEAD (reg:SF 383)
        (expr_list:REG_DEAD (reg/v/u/f:DI 342)
            (nil))))

This was broken by Jan Hubicka's June 4 change to gen_highpart.  gen_highpart
is a routine that must always return valid RTL for the target, emitting insns
if necessary to achieve this.  After June 4, gen_highpart is now implemented
via simplify_gen_subreg.  This is a routine that does RTL transformations
without emitting insns, and which is not guaranteed to return valid RTL for the
target.  This is particularly a problem for IA-64 which does not have
REG+OFFSET addressing modes, and thus any address change requires loading it
into a temp register.

The following patch fixes this by adding a call to validize_mem to
gen_highpart.  This effectively restores the change_address call that was
lost in the June 4 change.

I am doing an ia64-linux bootstrap to test this, and to see if there are
any other bootstrap failures.  This will take some time.  I plan to check
in this patch when the bootstrap completes or reaches the next bug.

2001-06-27  Jim Wilson  <wilson@redhat.com>

	* emit-rtl.c (gen_highpart): Call validize_mem.

Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.182
diff -p -r1.182 emit-rtl.c
*** emit-rtl.c	2001/06/19 08:34:34	1.182
--- emit-rtl.c	2001/06/27 23:27:15
*************** gen_highpart (mode, x)
*** 1135,1140 ****
--- 1135,1147 ----
  
    result = simplify_gen_subreg (mode, x, GET_MODE (x),
  				subreg_highpart_offset (mode, GET_MODE (x)));
+ 
+   /* simplify_gen_subreg is not guaranteed to return a valid operand for
+      the target if we have a MEM.  gen_highpart must return a valid operand,
+      emitting code if necessary to do so.  */
+   if (GET_CODE (result) == MEM)
+     result = validize_mem (result);
+ 
    if (!result)
      abort ();
    return result;


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