This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/21848] [4.1 Regression] load_mems / replace_loop_mems bug causes miscompilation of jcf-io.c / SEGV while processing java/lang/AbstractMethodError
- From: "amylaar at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 May 2005 20:56:11 -0000
- Subject: [Bug rtl-optimization/21848] [4.1 Regression] load_mems / replace_loop_mems bug causes miscompilation of jcf-io.c / SEGV while processing java/lang/AbstractMethodError
- References: <20050531200902.21848.amylaar@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From amylaar at gcc dot gnu dot org 2005-05-31 20:56 -------
The problem would not arise if the call was neither const nor pure.
cselib_process_insn has this code:
if (CALL_P (insn))
{
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (call_used_regs[i]
|| (REG_VALUES (i) && REG_VALUES (i)->elt
&& HARD_REGNO_CALL_PART_CLOBBERED (i,
GET_MODE (REG_VALUES (i)->elt->u.val_rtx))))
cselib_invalidate_regno (i, reg_raw_mode[i]);
if (! CONST_OR_PURE_CALL_P (insn))
cselib_invalidate_mem (callmem);
}
So, this explains why ordinary calls work.
There is code in load_mems to take the argument of calls into account, but
it requires CALL_INSN_FUNCTION_USAGE to be set. So a possible fix would make
sure that CALL_INSN_FUNCTION_USAGE is set correctly, at least for
CONST_OR_PURE_CALL_P functions.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21848