This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[new-regalloc-branch] Make it compile again.
- To: <gcc-patches at gcc dot gnu dot org>
- Subject: [new-regalloc-branch] Make it compile again.
- From: Michael Matz <matz at kde dot org>
- Date: Fri, 20 Jul 2001 01:04:10 +0200 (MET DST)
- cc: Michael Matz <matzmich at cs dot tu-berlin dot de>
Hi,
this fixes the breakage caused by the SUBREG_WORD-->SUBREG_BYTE change in
the mainline, and makes C and C++ compile again (for C++ I needed to do
the below temporary hack. cp/* is _not_ the same as the mainline, for
whatever reason. Daniel?). I have not done a bootstrap, but given, that
even a normal make already barfs when trying to build gen-num-limits after
the compilers and libiberty was built fine, with:
Adding multilib support to Makefile in ../../../egcs/libstdc++-v3
multidirs=
with_multisubdir=
running mkc++config
running mknumeric_limits
/src/gcc/ra-branch-new/prof/gcc/g++ -B/src/gcc... rc/gen-num-limits.cc ...
/tmp/ccG50uT9.o: In function `__FRAME_BEGIN__':
/tmp/ccG50uT9.o(.eh_frame+0x11): undefined reference to
`__gxx_personality_v0'
collect2: ld returned 1 exit status
gen-num-limits failed to build, exiting.
mknumeric_limits failed to execute properly: exiting
make: *** [configure-target-libstdc++-v3] Error 1
I think the bootstrap would also not be successful. It seems the version
the merge was based on, was not especially stable. Of course it could
also be because the whole libstdc++-v3 directory was not merged at all.
Ah well, I'm to tired to investigate, so I'll wait for the complete merge
to magically happen ;)
Ciao,
Michael.
2001-07-20 Michael Matz <matzmich@cs.tu-berlin.de>
* ra.c : (rtx_to_bits): Use SUBREG_BYTE, instead of calculating
things from SUBREG_WORD.
(defuse_overlap_p, find_subweb): Dito.
(dump_igraph, dump_ra): s/SUBREG_WORD/SUBREG_BYTE/ .
(colorize_one_web): Simulate SUBREG_WORD.
(rewrite_program): Don't emit (subreg(mem ...)).
* cp/optimize.c : (inlinable_size_p): Replace with dummy.
--
Index: ra.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Attic/ra.c,v
retrieving revision 1.1.2.18
diff -u -p -c -p -r1.1.2.18 ra.c
*** ra.c 2001/07/17 19:35:04 1.1.2.18
--- ra.c 2001/07/19 22:31:31
*************** rtx_to_bits (x)
*** 439,450 ****
len = GET_MODE_SIZE (GET_MODE (x));
if (GET_CODE (x) == SUBREG)
{
! if (len < UNITS_PER_WORD)
! /* XXX Is this true? Are narrow subregs with word != 0 allowed?
! What begin-byte are they? */
! beg = len * SUBREG_WORD (x);
! else
! beg = UNITS_PER_WORD * SUBREG_WORD (x);
}
return (((len & 0xFFFF) << 16) | (beg & 0xFFFF));
}
--- 439,445 ----
len = GET_MODE_SIZE (GET_MODE (x));
if (GET_CODE (x) == SUBREG)
{
! beg = SUBREG_BYTE (x);
}
return (((len & 0xFFFF) << 16) | (beg & 0xFFFF));
}
*************** defuse_overlap_p (def, use)
*** 821,827 ****
if (GET_MODE_SIZE (GET_MODE (def)) == GET_MODE_SIZE (GET_MODE (use->x)))
/* If the size of both things is the same, the subreg's overlap
if they refer to the same word. */
! if (SUBREG_WORD (def) == SUBREG_WORD (use->x))
return 1;
/* Now the more difficult part: the same regno is refered, but the
sizes of the references or the words differ. E.g.
--- 816,822 ----
if (GET_MODE_SIZE (GET_MODE (def)) == GET_MODE_SIZE (GET_MODE (use->x)))
/* If the size of both things is the same, the subreg's overlap
if they refer to the same word. */
! if (SUBREG_BYTE (def) == SUBREG_BYTE (use->x))
return 1;
/* Now the more difficult part: the same regno is refered, but the
sizes of the references or the words differ. E.g.
*************** find_subweb (web, reg)
*** 1474,1480 ****
abort ();
for (w = web->subreg_next; GET_CODE (w->orig_x) != REG; w = w->subreg_next)
if (GET_MODE (w->orig_x) == GET_MODE (reg)
! && SUBREG_WORD (w->orig_x) == SUBREG_WORD (reg))
return w;
return NULL;
}
--- 1469,1475 ----
abort ();
for (w = web->subreg_next; GET_CODE (w->orig_x) != REG; w = w->subreg_next)
if (GET_MODE (w->orig_x) == GET_MODE (reg)
! && SUBREG_BYTE (w->orig_x) == SUBREG_BYTE (reg))
return w;
return NULL;
}
*************** add_subweb_2 (web, size, word)
*** 1547,1556 ****
mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0);
if (mode == BLKmode)
abort ();
- if (GET_MODE_SIZE (mode) < UNITS_PER_WORD)
- word = word / GET_MODE_SIZE (mode);
- else
- word = word / UNITS_PER_WORD;
w = add_subweb (web, gen_rtx_SUBREG (mode, web->orig_x, word));
w->artificial = 1;
return w;
--- 1542,1547 ----
*************** dump_igraph (df)
*** 2335,2341 ****
if (SUBWEB_P (id2web[def1]))
debug_msg (0, "%d (SUBREG %d, %d) with ", def1,
id2web[def1]->regno,
! SUBREG_WORD (id2web[def1]->orig_x));
else
debug_msg (0, "%d (REG %d) with ", def1,
id2web[def1]->regno);
--- 2326,2332 ----
if (SUBWEB_P (id2web[def1]))
debug_msg (0, "%d (SUBREG %d, %d) with ", def1,
id2web[def1]->regno,
! SUBREG_BYTE (id2web[def1]->orig_x));
else
debug_msg (0, "%d (REG %d) with ", def1,
id2web[def1]->regno);
*************** dump_igraph (df)
*** 2346,2352 ****
num2++;
if (SUBWEB_P (id2web[def2]))
debug_msg (0, "%d(%d,%d) ", def2, id2web[def2]->regno,
! SUBREG_WORD (id2web[def2]->orig_x));
else
debug_msg (0, "%d(%d) ", def2, id2web[def2]->regno);
}
--- 2337,2343 ----
num2++;
if (SUBWEB_P (id2web[def2]))
debug_msg (0, "%d(%d,%d) ", def2, id2web[def2]->regno,
! SUBREG_BYTE (id2web[def2]->orig_x));
else
debug_msg (0, "%d(%d) ", def2, id2web[def2]->regno);
}
*************** colorize_one_web (web, hard)
*** 3241,3251 ****
if (SUBWEB_P (w)
&& GET_MODE_SIZE (GET_MODE (w->orig_x)) >= UNITS_PER_WORD)
! tofs = SUBREG_WORD (w->orig_x);
if (SUBWEB_P (source)
&& GET_MODE_SIZE (GET_MODE (source->orig_x))
>= UNITS_PER_WORD)
! sofs = SUBREG_WORD (source->orig_x);
c1 = ptarget->color + tofs - sofs - ssize + 1;
c2 = ptarget->color + tofs + tsize - 1 - sofs;
if (c2 >= 0)
--- 3232,3242 ----
if (SUBWEB_P (w)
&& GET_MODE_SIZE (GET_MODE (w->orig_x)) >= UNITS_PER_WORD)
! tofs = (SUBREG_BYTE (w->orig_x) / UNITS_PER_WORD);
if (SUBWEB_P (source)
&& GET_MODE_SIZE (GET_MODE (source->orig_x))
>= UNITS_PER_WORD)
! sofs = (SUBREG_BYTE (source->orig_x) / UNITS_PER_WORD);
c1 = ptarget->color + tofs - sofs - ssize + 1;
c2 = ptarget->color + tofs + tsize - 1 - sofs;
if (c2 >= 0)
*************** rewrite_program (void)
*** 3614,3620 ****
bitmap_clear (b);
for (j = 0; j < web->num_defs; j++)
{
! rtx insns, source;
rtx insn = DF_REF_INSN (web->defs[j]);
rtx following = NEXT_INSN (insn);
basic_block bb = BLOCK_FOR_INSN (insn);
--- 3605,3611 ----
bitmap_clear (b);
for (j = 0; j < web->num_defs; j++)
{
! rtx insns, source, dest;
rtx insn = DF_REF_INSN (web->defs[j]);
rtx following = NEXT_INSN (insn);
basic_block bb = BLOCK_FOR_INSN (insn);
*************** rewrite_program (void)
*** 3626,3636 ****
bitmap_set_bit (b, INSN_UID (insn));
start_sequence ();
source = DF_REF_REG (web->defs[j]);
! emit_insn (
! gen_move_insn (GET_CODE (source) == SUBREG
! ? gen_rtx_SUBREG (GET_MODE (source), slot,
! SUBREG_WORD (source))
! : slot, source));
insns = get_insns ();
end_sequence ();
emit_insns_after (insns, insn);
--- 3617,3630 ----
bitmap_set_bit (b, INSN_UID (insn));
start_sequence ();
source = DF_REF_REG (web->defs[j]);
! dest = slot;
! if (GET_CODE (source) == SUBREG)
! {
! dest = gen_rtx_MEM (GET_MODE (source),
! plus_constant (XEXP (dest, 0),
! SUBREG_BYTE (source)));
! }
! emit_insn (gen_move_insn (dest, source));
insns = get_insns ();
end_sequence ();
emit_insns_after (insns, insn);
*************** rewrite_program (void)
*** 3644,3650 ****
bitmap_clear (b);
for (j = 0; j < web->num_uses; j++)
{
! rtx insns, target;
rtx insn = DF_REF_INSN (web->uses[j]);
rtx prev = PREV_INSN (insn);
basic_block bb = BLOCK_FOR_INSN (insn);
--- 3638,3644 ----
bitmap_clear (b);
for (j = 0; j < web->num_uses; j++)
{
! rtx insns, target, source;
rtx insn = DF_REF_INSN (web->uses[j]);
rtx prev = PREV_INSN (insn);
basic_block bb = BLOCK_FOR_INSN (insn);
*************** rewrite_program (void)
*** 3656,3666 ****
bitmap_set_bit (b, INSN_UID (insn));
start_sequence ();
target = DF_REF_REG (web->uses[j]);
! emit_insn (
! gen_move_insn (target, GET_CODE (target) == SUBREG
! ? gen_rtx_SUBREG (GET_MODE (target), slot,
! SUBREG_WORD (target))
! : slot));
insns = get_insns ();
end_sequence ();
emit_insns_before (insns, insn);
--- 3650,3663 ----
bitmap_set_bit (b, INSN_UID (insn));
start_sequence ();
target = DF_REF_REG (web->uses[j]);
! source = slot;
! if (GET_CODE (target) == SUBREG)
! {
! source = gen_rtx_MEM (GET_MODE (target),
! plus_constant (XEXP (source, 0),
! SUBREG_BYTE (target)));
! }
! emit_insn (gen_move_insn (target, source));
insns = get_insns ();
end_sequence ();
emit_insns_before (insns, insn);
*************** dump_ra (df)
*** 3948,3954 ****
debug_msg (0, " %4d : regno %3d", i, web->regno);
if (SUBWEB_P (web))
{
! debug_msg (0, " sub %d", SUBREG_WORD (web->orig_x));
debug_msg (0, " par %d", find_web_for_subweb (web)->id);
}
debug_msg (0, " +%d (span %d, weight %d) (%s)%s",
--- 3945,3951 ----
debug_msg (0, " %4d : regno %3d", i, web->regno);
if (SUBWEB_P (web))
{
! debug_msg (0, " sub %d", SUBREG_BYTE (web->orig_x));
debug_msg (0, " par %d", find_web_for_subweb (web)->id);
}
debug_msg (0, " +%d (span %d, weight %d) (%s)%s",
Index: cp/optimize.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/optimize.c,v
retrieving revision 1.48.2.2
diff -u -p -c -p -r1.48.2.2 optimize.c
*** optimize.c 2001/07/17 21:42:27 1.48.2.2
--- optimize.c 2001/07/19 22:31:31
*************** static bool
*** 774,783 ****
inlinable_size_p (fn)
tree fn;
{
! return DECL_NUM_STMTS (fn)
< (PARAM_VALUE (PARAM_MAX_INLINE_AST)
+ (PARAM_VALUE (PARAM_ARG_INLINE_AST)
! * type_num_arguments (TREE_TYPE (fn))));
}
/* Called via walk_trees, DATA is an inline_data. If *TP is a call to
--- 774,784 ----
inlinable_size_p (fn)
tree fn;
{
! /* return DECL_NUM_STMTS (fn)
< (PARAM_VALUE (PARAM_MAX_INLINE_AST)
+ (PARAM_VALUE (PARAM_ARG_INLINE_AST)
! * type_num_arguments (TREE_TYPE (fn))));*/
! return DECL_NUM_STMTS (fn) < 100;
}
/* Called via walk_trees, DATA is an inline_data. If *TP is a call to