This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ia64 problem with inlining.
- To: Andrew Macleod <amacleod at cygnus dot com>, gcc-patches at gcc dot gnu dot org
- Subject: Re: ia64 problem with inlining.
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 26 Oct 2001 15:41:21 -0200
- Organization: GCC Team, Red Hat
[Moving to gcc-patches from private conversation]
On Oct 23, 2001, Andrew Macleod <amacleod@cygnus.com> wrote:
> Hey Alexandre, Ive been looking at a problem in mainline egcs that was
> caused/exposed by your change: [tree inlining in C]
Hmm... Interesting. I had run into a similar problem on ia32, but
not quite the same. check_for_label_ref() was putting unreasonable
demands on mark_jump_label()'s adding of REG_LABEL notes. The case I
had caught before was when the checked LABEL_REF contained a deleted
label. In your case, it contains a non-local label, and
mark_jump_label() doesn't add REG_LABEL notes for these either.
[gcc.c-torture/execute/920428-2.c -O3]
> cse then considers this a label reference of interest or something, and
> goes into an infinte loop, or at least it appears to be an infinite loop.
This patch fixes the problem. Richard Henderson already approved it,
and it bootstrapped on athlon-pc-linux-gnu, so I'm checking it in.
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* cse.c (check_for_label_ref): Don't require REG_LABEL notes for
non-local label_refs.
Index: gcc/cse.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cse.c,v
retrieving revision 1.209
diff -u -p -r1.209 cse.c
--- gcc/cse.c 2001/10/11 03:15:26 1.209
+++ gcc/cse.c 2001/10/26 09:24:04
@@ -7362,7 +7362,7 @@ cse_basic_block (from, to, next_branch,
}
/* Called via for_each_rtx to see if an insn is using a LABEL_REF for which
- there isn't a REG_DEAD note. Return one if so. DATA is the insn. */
+ there isn't a REG_LABEL note. Return one if so. DATA is the insn. */
static int
check_for_label_ref (rtl, data)
@@ -7376,6 +7376,7 @@ check_for_label_ref (rtl, data)
LABEL_REF for a CODE_LABEL that isn't in the insn chain, don't do this
since no REG_LABEL will be added. */
return (GET_CODE (*rtl) == LABEL_REF
+ && ! LABEL_REF_NONLOCAL_P (*rtl)
&& LABEL_P (XEXP (*rtl, 0))
&& INSN_UID (XEXP (*rtl, 0)) != 0
&& ! find_reg_note (insn, REG_LABEL, XEXP (*rtl, 0)));
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me