This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: INSN_SCOPE changes break mips-elf
- From: Jan Hubicka <jh at suse dot cz>
- To: law at redhat dot com
- Cc: jh at suse dot cz, gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 20 Jun 2002 17:47:23 +0200
- Subject: Re: INSN_SCOPE changes break mips-elf
- References: <21516.1024519373@porcupine.cygnus.com>
>
> mips-elf has had regressions ever since the INSN_SCOPE changes were installed
> into the tree. While the number of regressions has gone down since the
> introduction of the INSN_SCOPE changes one regression still remains.
>
> The remaining regression is gcc.dg/debug/debug-6 where we manage to lose
> all debug information for "xyzzy". I believe the fundamental problem is your
> code in scope_to_insns_initialize does not properly handle SEQUENCEs as
> generated by the delay slot filling pass.
Hi, this patch makes the note re-emitting pass to walk into sequences
and combine scope of all of them. I've made the function combine_scopes
global since I want to make combine/peepholer/ifcvt to use it as well
any time sequence of instructions is replaced by another sequence.
This is left for separate patch.
Unfortunately I can not bootstrap any of machine having dealy slots at
the moment so I can't verify the patch properly. Perhaps later, when it
will be less hot and laboratory re-opened, but I am leaving in 2,5 days.
I've verified that it works on the testcases and that the xyzzy appears
on result at -O2 compilation.
Honza
Thu Jun 20 17:43:58 CEST 2002 Jan Hubicka <jh@suse.cz>
* rtl.h (combine_scopes): Declare.
* cfglayout.c (combine_scopes): New.
(scope_to_insns_finalize): Use combine_scopes for sequences.
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/rtl.h,v
retrieving revision 1.362
diff -c -3 -p -r1.362 rtl.h
*** rtl.h 14 Jun 2002 18:57:36 -0000 1.362
--- rtl.h 20 Jun 2002 15:42:50 -0000
*************** extern rtx next_label PARAMS ((rtx));
*** 1414,1419 ****
--- 1414,1422 ----
extern rtx next_cc0_user PARAMS ((rtx));
extern rtx prev_cc0_setter PARAMS ((rtx));
+ /* In cfglayout.c */
+ extern tree combine_scopes PARAMS ((tree, tree));
+
/* In jump.c */
extern rtx next_nondeleted_insn PARAMS ((rtx));
extern enum rtx_code reverse_condition PARAMS ((enum rtx_code));
Index: cfglayout.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cfglayout.c,v
retrieving revision 1.19
diff -c -3 -p -r1.19 cfglayout.c
*** cfglayout.c 4 Jun 2002 17:32:50 -0000 1.19
--- cfglayout.c 20 Jun 2002 15:42:50 -0000
*************** set_block_levels (block, level)
*** 259,264 ****
--- 259,278 ----
}
}
+ /* Return sope resulting from combination of S1 and S2. */
+ tree
+ combine_scopes (s1, s2)
+ tree s1, s2;
+ {
+ if (!s1)
+ return s2;
+ if (!s2)
+ return s1;
+ if (BLOCK_NUMBER (s1) > BLOCK_NUMBER (s2))
+ return s1;
+ return s2;
+ }
+
/* Emit lexical block notes needed to change scope from S1 to S2. */
static void
*************** scope_to_insns_finalize ()
*** 327,332 ****
--- 341,358 ----
tree this_block;
this_block = INSN_SCOPE (insn);
+ /* For sequences compute scope resulting from merging all scopes
+ of instructions nested inside. */
+ if (GET_CODE (PATTERN (insn)) == SEQUENCE)
+ {
+ int i;
+ rtx body = PATTERN (insn);
+
+ this_block = NULL;
+ for (i = 0; i < XVECLEN (body, 0); i++)
+ this_block = combine_scopes (this_block,
+ INSN_SCOPE (XVECEXP (body, 0, i)));
+ }
if (! this_block)
continue;