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]
Other format: [Raw text]

Obvious fix applied to reload.h / reload.c to fix execute/20040709-1.c regression



execute/20040709-1.c failed to compile in mainline on sh-elf:
Starting program: /mnt/scratch/nightly/2005-12-07/sh-elf/gcc/cc1 -fpreprocessed 20040709-1.i -quiet -dumpbase 20040709-1.c -m4 -ml -auxbase 20040709-1 -O3 -w -version -fomit-frame-pointer -fno-show-column -o 20040709-1.s
Breakpoint 3 at 0x2bb896
Breakpoint 4 at 0x2ba535
GNU C version 4.2.0 20051207 (experimental) (sh-elf)
        compiled by GNU C version 3.2.3 20030502 (Red Hat Linux 3.2.3-53).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 4627a5e0b1c8e6dc45662c2247271526

Breakpoint 1, fancy_abort (file=0x84af676 "../../srcw/gcc/reload.c", 
    line=6226, function=0x84afcd0 "refers_to_regno_for_reload_p")
    at ../../srcw/gcc/diagnostic.c:602
602       internal_error ("in %s, at %s:%d", function, trim_filename (file), line);
(gdb) bt
#0  fancy_abort (file=0x84af676 "../../srcw/gcc/reload.c", line=6226, 
    function=0x84afcd0 "refers_to_regno_for_reload_p")
    at ../../srcw/gcc/diagnostic.c:602
#1  0x082cace4 in refers_to_regno_for_reload_p (regno=2, endregno=3, 
    x=0xb55cef20, loc=0x0) at ../../srcw/gcc/reload.c:6226
#2  0x082cacad in refers_to_regno_for_reload_p (regno=2, endregno=3, 
    x=0xb55cefb0, loc=0xb564e2f8) at ../../srcw/gcc/reload.c:6222
#3  0x082b94f4 in find_dummy_reload (real_in=0xb57f8228, real_out=0xb55e3350, 
    inloc=0xb564e2f0, outloc=0xb564e2f8, inmode=SImode, outmode=SImode, 
    class=GENERAL_REGS, for_real=-1, earlyclobber=0)
    at ../../srcw/gcc/reload.c:1907
#4  0x082bd496 in find_reloads (insn=0xb5a7d028, replace=0, ind_levels=0, 
    live_known=1, reload_reg_p=0x851e280) at ../../srcw/gcc/reload.c:3090
...
(gdb) call debug_rtx(this_insn)
(insn:HI 318 315 319 0 (set (reg:SI 2 r2 [398])
        (and:SI (reg:SI 340 [+8 ])
            (const_int 0 [0x0]))) 83 {*andsi3_compact} (insn_list:REG_DEP_TRUE 247 (insn_list:REG_DEP_TRUE 228 (nil)))
    (expr_list:REG_DEAD (reg:SI 340 [+8 ])
        (expr_list:REG_EQUAL (and:SI (reg:SI 340 [+8 ])
                (const_int 4095 [0xfff]))
            (nil))))
(gdb) call debug_reload()
Reload 0: reload_in (SI) = (plus:SI (reg/f:SI 15 r15)
                                                    (const_int 64 [0x40]))
        GENERAL_REGS, RELOAD_FOR_INPUT_ADDRESS (opnum = 1)
        reload_in_reg: (plus:SI (reg/f:SI 15 r15)
                                                    (const_int 64 [0x40]))
(gdb) frame 2
#2  0x082cacad in refers_to_regno_for_reload_p (regno=2, endregno=3, 
    x=0xb55c8fb0, loc=0xb56482f8) at ../../srcw/gcc/reload.c:6222
6222                return refers_to_regno_for_reload_p (regno, endregno,
(gdb) l
6217          /* If this is a pseudo, a hard register must not have been allocated.
6218             X must therefore either be a constant or be in memory.  */
6219          if (r >= FIRST_PSEUDO_REGISTER)
6220            {
6221              if (reg_equiv_memory_loc[r])
6222                return refers_to_regno_for_reload_p (regno, endregno,
6223                                                     reg_equiv_memory_loc[r],
6224                                                     (rtx*) 0);
6225
6226              gcc_assert (reg_equiv_constant[r]);
(gdb) call debug_rtx(reg_equiv_memory_loc[r])
(mem/s/c:SI (plus:SI (reg/f:SI 331)
        (const_int 8 [0x8])) [0+8 S4 A32])
(gdb) frame 1
#1  0x082cace4 in refers_to_regno_for_reload_p (regno=2, endregno=3, 
    x=0xb55c8f20, loc=0x0) at ../../srcw/gcc/reload.c:6226
6226              gcc_assert (reg_equiv_constant[r]);
(gdb) call debug_rtx(reg_equiv_invariant[r])
(plus:SI (reg/f:SI 153 sfp)
    (const_int -16 [0xfffffff0]))

Index: reload.h
===================================================================
/usr/bin/diff -dup -F'^(' -u -L reload.h	(revision 108164) -L reload.h	(working copy) .svn/text-base/reload.h.svn-base reload.h
--- reload.h	(revision 108164)
+++ reload.h	(working copy)
@@ -157,6 +157,7 @@ extern int n_reloads;
 
 extern GTY (()) struct varray_head_tag *reg_equiv_memory_loc_varray;
 extern rtx *reg_equiv_constant;
+extern rtx *reg_equiv_invariant;
 extern rtx *reg_equiv_memory_loc;
 extern rtx *reg_equiv_address;
 extern rtx *reg_equiv_mem;

Fixed thus:

2005-12-07  J"orn Rennecke <joern.rennecke@st.com>

	* reload.h (reg_equiv_invariant): Declare.
	* reload.c (refers_to_regno_for_reload_p): Allow R to be a pseudo
	register also when reg_equiv_invariant[R] is set.

Index: reload.c
===================================================================
/usr/bin/diff -dup -F'^(' -u -L reload.c	(revision 108164) -L reload.c	(working copy) .svn/text-base/reload.c.svn-base reload.c
--- reload.c	(revision 108164)
+++ reload.c	(working copy)
@@ -6223,7 +6223,7 @@ refers_to_regno_for_reload_p (unsigned i
 						 reg_equiv_memory_loc[r],
 						 (rtx*) 0);
 
-	  gcc_assert (reg_equiv_constant[r]);
+	  gcc_assert (reg_equiv_constant[r] || reg_equiv_invariant[r]);
 	  return 0;
 	}
 

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