This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/41031] [4.5 Regression] ICE in insert_value_copy_on_edge preventing bootstrap on sparc64 and s390x, testcase on cris-elf
- From: "laurent at guerby dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Aug 2009 09:13:02 -0000
- Subject: [Bug bootstrap/41031] [4.5 Regression] ICE in insert_value_copy_on_edge preventing bootstrap on sparc64 and s390x, testcase on cris-elf
- References: <bug-41031-507@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from laurent at guerby dot net 2009-08-12 09:13 -------
>From just reading the ChangeLog, a likely candidate:
2009-08-09 Richard Sandiford <rdsandiford@googlemail.com>
* tree-out-of-ssa.c (insert_value_copy_on_edge): If the source
and destination have different modes, Use promote_mode to
determine the signedness of the conversion. Assert that the
promoted source mode matches the destination mode. Don't pass
the destination and destination mode to expand_expr if the source
mode is different. Simplify conversion logic.
--- gcc/tree-outof-ssa.c (revision 150589)
+++ gcc/tree-outof-ssa.c (revision 150648)
@@ -195,7 +195,9 @@
insert_value_copy_on_edge (edge e, int dest, tree src, source_location locus)
{
rtx seq, x;
- enum machine_mode mode;
+ enum machine_mode dest_mode, src_mode;
+ int unsignedp;
+
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file,
@@ -214,14 +216,21 @@
set_curr_insn_source_location (locus);
start_sequence ();
- mode = GET_MODE (SA.partition_to_pseudo[dest]);
- x = expand_expr (src, SA.partition_to_pseudo[dest], mode, EXPAND_NORMAL);
- if (GET_MODE (x) != VOIDmode && GET_MODE (x) != mode)
- x = convert_to_mode (mode, x, TYPE_UNSIGNED (TREE_TYPE (src)));
- if (CONSTANT_P (x) && GET_MODE (x) == VOIDmode
- && mode != TYPE_MODE (TREE_TYPE (src)))
- x = convert_modes (mode, TYPE_MODE (TREE_TYPE (src)),
- x, TYPE_UNSIGNED (TREE_TYPE (src)));
+
+ src_mode = TYPE_MODE (TREE_TYPE (src));
+ unsignedp = TYPE_UNSIGNED (TREE_TYPE (src));
+ dest_mode = promote_mode (TREE_TYPE (src), src_mode, &unsignedp);
+ gcc_assert (dest_mode == GET_MODE (SA.partition_to_pseudo[dest]));
+
+ if (src_mode != dest_mode)
+ {
+ x = expand_expr (src, NULL, src_mode, EXPAND_NORMAL);
+ x = convert_modes (dest_mode, src_mode, x, unsignedp);
+ }
+ else
+ x = expand_expr (src, SA.partition_to_pseudo[dest],
+ dest_mode, EXPAND_NORMAL);
+
if (x != SA.partition_to_pseudo[dest])
emit_move_insn (SA.partition_to_pseudo[dest], x);
seq = get_insns ();
--
laurent at guerby dot net changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |laurent at guerby dot net,
| |rdsandiford at googlemail
| |dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41031