From mboxrd@z Thu Jan 1 00:00:00 1970 From: hjl@lucon.org (H.J. Lu) To: wilson@cygnus.com (Jim Wilson) Cc: hjl@lucon.org, law@cygnus.com, scox@cygnus.com, crux@pool.informatik.rwth-aachen.de, egcs@cygnus.com Subject: Re: More fp bug in egcs Date: Mon, 04 May 1998 11:17:00 -0000 Message-id: References: <199805032313.QAA08384@rtl.cygnus.com> X-SW-Source: 1998-05/msg00087.html > > One reason for keeping output reloads, even though the register is dead, is > for debugging purposes. With your patch, it looks like debugging of > unoptimized code would not work right. It would be OK to do this > when optimizing, but that would not fix the x86 bug. > If the register is clobbered, isn't the value in it random? If it is tru, how can it help debugging? I changed my patch to omit the output reload if it is in the source and is clobbered. Does it look safe? -- H.J. Lu (hjl@gnu.org) ---- Sun May 3 18:44:40 1998 H.J. Lu (hjl@gnu.org) * reload1.c (emit_reload_insns): Don't output the last reload insn if OLD is the src of INSN and is clobbered by INSN. --- ../../../import/egcs/gcc/reload1.c Mon Apr 20 08:23:47 1998 +++ ./reload1.c Sun May 3 18:57:26 1998 @@ -6730,8 +6730,17 @@ emit_reload_insns (insn) /* Output the last reload insn. */ if (! special) - gen_reload (old, reloadreg, reload_opnum[j], - reload_when_needed[j]); + { + rtx set; + + /* Don't output the last reload if OLD is the src of INSN + and is clobbered by INSN. */ + if (GET_CODE (old) != REG || !(set = single_set (insn)) + || !reg_mentioned_p (old, SET_SRC (set)) + || !regno_clobbered_p (REGNO (old), insn)) + gen_reload (old, reloadreg, reload_opnum[j], + reload_when_needed[j]); + } #ifdef PRESERVE_DEATH_INFO_REGNO_P /* If final will look at death notes for this reg,