This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: fix small emit_case_nodes tweak
- To: gcc-patches at gcc dot gnu dot org
- Subject: PATCH: fix small emit_case_nodes tweak
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Sat, 7 Jul 2001 21:28:33 -0400 (EDT)
This fixes the problem noted here
<http://gcc.gnu.org/ml/gcc-bugs/2001-06/msg01178.html> and here
<http://gcc.gnu.org/ml/gcc-bugs/2001-06/msg01174.html>. It is necessary
to explicitly call convert_modes when index_type is unsigned. Tested
with a bootstrap and check with hppa1.1-hp-hpux10.20.
OK for main?
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2001-07-07 John David Anglin <dave@hiauly1.hia.nrc.ca>
* stmt.c (emit_case_nodes): Convert modes where needed.
--- stmt.c.orig Mon Jun 18 15:05:15 2001
+++ stmt.c Fri Jul 6 16:33:12 2001
@@ -6327,13 +6327,19 @@
rtx new_index;
new_index = expand_binop (mode, sub_optab, index,
- expand_expr (node->low, NULL_RTX,
- VOIDmode, 0),
- NULL_RTX, 0, OPTAB_WIDEN);
+ convert_modes
+ (mode, imode,
+ expand_expr (node->low, NULL_RTX,
+ VOIDmode, 0),
+ unsignedp),
+ NULL_RTX, unsignedp, OPTAB_WIDEN);
emit_cmp_and_jump_insns (new_index,
- expand_expr (new_bound, NULL_RTX,
- VOIDmode, 0),
+ convert_modes
+ (mode, imode,
+ expand_expr (new_bound, NULL_RTX,
+ VOIDmode, 0),
+ 1),
GT, NULL_RTX, mode, 1, 0,
default_label);
}