This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fix alpha c++ failures
- To: rth at redhat dot com (Richard Henderson)
- Subject: Re: fix alpha c++ failures
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Tue, 10 Jul 2001 15:06:30 -0400 (EDT)
- Cc: gcc-patches at gcc dot gnu dot org
> On Mon, Jul 09, 2001 at 03:42:55PM -0400, John David Anglin wrote:
> > Alright. I believe that the code will be be more understandable if we
> > convert HIGH and LOW instead of NEW_BOUND and LOW.
>
> Agreed.
Does this look ok? Bootstrapped and checked with no regressions under
i686-pc-linux-gnu.
I haven't been able to check this on the PA. I have this ICE at the moment:
stage1/xgcc -Bstage1/ -B/usr/local/hppa1.1-hp-hpux10.20/bin/ -c -DIN_GCC -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -DHAVE_CONFIG_H -I. -If -I../../gcc -I../../gcc/f -I../../gcc/config -I../../gcc/../include ../../gcc/f/data.c -o f/data.o
../../gcc/f/data.c: In function `ffedata_gather':
../../gcc/f/data.c:239: Internal compiler error in find_addr_reg, at config/pa/p
a.c:2162
find_addr_reg is choking on this:
(gdb) p debug_rtx (addr)
(lo_sum:SI (reg/f:SI 1 %r1 [103])
(symbol_ref:SI ("ffedata_storage_size_")))
Maybe find_addr_reg now needs to handle LO_SUMs?
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2001-07-09 John David Anglin <dave@hiauly1.hia.nrc.ca>
* stmt.c (emit_case_nodes): Widen high and low instead of new_bound
and low to get correct sign extension in low+high test.
--- stmt.c.orig Mon Jul 9 12:20:51 2001
+++ stmt.c Mon Jul 9 17:14:31 2001
@@ -6317,26 +6317,26 @@
}
else if (!low_bound && !high_bound)
{
- /* Instead of doing two branches, emit
- (index-low) <= (high-low). */
- tree new_bound = fold (build (MINUS_EXPR, index_type, node->high,
- node->low));
- rtx new_index;
-
- new_index = expand_binop (mode, sub_optab, index,
- convert_modes (mode, imode,
- expand_expr (node->low, NULL_RTX,
- mode, 0),
- unsignedp),
+ /* Widen LOW and HIGH to the same width as INDEX. */
+ rtx new_low = convert_modes (mode, imode,
+ expand_expr (node->low, NULL_RTX,
+ VOIDmode, 0),
+ unsignedp);
+ rtx new_high = convert_modes (mode, imode,
+ expand_expr (node->high, NULL_RTX,
+ VOIDmode, 0),
+ unsignedp);
+ rtx new_index, new_bound;
+
+ /* Instead of doing two branches, emit one unsigned branch for
+ (index-low) > (high-low). */
+ new_index = expand_binop (mode, sub_optab, index, new_low,
+ NULL_RTX, unsignedp, OPTAB_WIDEN);
+ new_bound = expand_binop (mode, sub_optab, new_high, new_low,
NULL_RTX, unsignedp, OPTAB_WIDEN);
- emit_cmp_and_jump_insns (new_index,
- convert_modes (mode, imode,
- expand_expr (new_bound, NULL_RTX,
- mode, 0),
- unsignedp),
- GT, NULL_RTX, mode, 1, 0,
- default_label);
+ emit_cmp_and_jump_insns (new_index, new_bound, GT, NULL_RTX,
+ mode, 1, 0, default_label);
}
emit_jump (label_rtx (node->code_label));