This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/37435] [4.4 regression] ICE with volatiles
- From: "vmakarov at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Sep 2008 22:14:30 -0000
- Subject: [Bug rtl-optimization/37435] [4.4 regression] ICE with volatiles
- References: <bug-37435-1771@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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