This is the mail archive of the gcc-bugs@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]

[Bug rtl-optimization/37435] [4.4 regression] ICE with volatiles



------- Comment #3 from vmakarov at redhat dot com  2008-09-09 22:14 -------
  The bug occurs in eliminate_regs_in_insn because it is a first place where
insn generated in caller-save.c is checked.  Caller-save.c tries to save
register in its mode SD but there is no insn for this.  Functions
insert_save/insert_restore tries to use correct mode to save/restore hard
register

(mem/c:SI (plus:SI (reg/f:SI 20 frame)
        (const_int -4 [0xfffffffffffffffc])) [5 S4 A32])

But it is changed by the following code

  if (save_mode [regno] != VOIDmode
      && save_mode [regno] != GET_MODE (mem)
      && numregs == (unsigned int) hard_regno_nregs[regno][save_mode [regno]])
    mem = adjust_address (mem, save_mode[regno], 0);
  else
    mem = copy_rtx (mem);

into

(mem/c:SD (plus:SI (reg/f:SI 20 frame)
        (const_int -4 [0xfffffffffffffffc])) [5 S4 A32])

Additional check of generated insn correctness in the if-stmt

  reg_save_code (regno, save_mode[regno]) >= 0

would solve the problem

I'll submit a patch soon.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37435


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