re PR bootstrap/41031 (ICE in insert_value_copy_on_edge preventing bootstrap on sparc...
authorRichard Sandiford <rdsandiford@googlemail.com>
Wed, 12 Aug 2009 16:28:36 +0000 (16:28 +0000)
committerPaolo Bonzini <bonzini@gcc.gnu.org>
Wed, 12 Aug 2009 16:28:36 +0000 (16:28 +0000)
2009-08-12  Richard Sandiford  <rdsandiford@googlemail.com>

PR tree-optimization/41031
* tree-outof-ssa.c (insert_value_copy_on_edge): Use promote_decl_mode
on the partition variable rather than promote_mode on the source
type.  Assert that the partition variable's type has the same
mode as the source value's.

From-SVN: r150701

gcc/ChangeLog
gcc/tree-outof-ssa.c

index 8cea1ba..9af6c71 100644 (file)
@@ -1,3 +1,11 @@
+2009-08-12  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       PR tree-optimization/41031
+       * tree-outof-ssa.c (insert_value_copy_on_edge): Use promote_decl_mode
+       on the partition variable rather than promote_mode on the source
+       type.  Assert that the partition variable's type has the same
+       mode as the source value's.
+
 2009-08-12  Paolo Bonzini  <bonzini@gnu.org>
 
        * doc/tm.texi (TARGET_PROMOTE_FUNCTION_MODE): Add documentation
index c0826e7..220171c 100644 (file)
@@ -197,6 +197,7 @@ insert_value_copy_on_edge (edge e, int dest, tree src, source_location locus)
   rtx seq, x;
   enum machine_mode dest_mode, src_mode;
   int unsignedp;
+  tree var;
 
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
@@ -217,9 +218,10 @@ insert_value_copy_on_edge (edge e, int dest, tree src, source_location locus)
 
   start_sequence ();
 
+  var = SSA_NAME_VAR (partition_to_var (SA.map, dest));
   src_mode = TYPE_MODE (TREE_TYPE (src));
-  unsignedp = TYPE_UNSIGNED (TREE_TYPE (src));
-  dest_mode = promote_mode (TREE_TYPE (src), src_mode, &unsignedp);
+  dest_mode = promote_decl_mode (var, &unsignedp);
+  gcc_assert (src_mode == TYPE_MODE (TREE_TYPE (var)));
   gcc_assert (dest_mode == GET_MODE (SA.partition_to_pseudo[dest]));
 
   if (src_mode != dest_mode)