Use proper mode for stack save area.
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 1 Jul 2011 12:57:11 +0000 (12:57 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 1 Jul 2011 12:57:11 +0000 (05:57 -0700)
2011-07-01  H.J. Lu  <hongjiu.lu@intel.com>

PR middle-end/48016
* explow.c (update_nonlocal_goto_save_area): Use proper mode
for stack save area.
* function.c (expand_function_start): Likewise.

From-SVN: r175756

gcc/ChangeLog
gcc/explow.c
gcc/function.c

index 165e362f75aace171bb98bc078a108752639b347..bdca0af17fee10477e74bab48c9f2d3cde79c5b1 100644 (file)
@@ -1,3 +1,10 @@
+2011-07-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR middle-end/48016
+       * explow.c (update_nonlocal_goto_save_area): Use proper mode
+       for stack save area.
+       * function.c (expand_function_start): Likewise.
+
 2011-07-01  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/49596
index c7d818380332beceb8c3afb03e496f3327d9098b..a042273ec9443ecd17b2a3f91935d3d1345f5c9f 100644 (file)
@@ -1102,7 +1102,9 @@ update_nonlocal_goto_save_area (void)
      first one is used for the frame pointer save; the rest are sized by
      STACK_SAVEAREA_MODE.  Create a reference to array index 1, the first
      of the stack save area slots.  */
-  t_save = build4 (ARRAY_REF, ptr_type_node, cfun->nonlocal_goto_save_area,
+  t_save = build4 (ARRAY_REF,
+                  TREE_TYPE (TREE_TYPE (cfun->nonlocal_goto_save_area)),
+                  cfun->nonlocal_goto_save_area,
                   integer_one_node, NULL_TREE, NULL_TREE);
   r_save = expand_expr (t_save, NULL_RTX, VOIDmode, EXPAND_WRITE);
 
index 5be018afde77097d73df972a3f56262f6c9e8440..0b2f5aa5c378616a09d150df2b652a3520eafb6c 100644 (file)
@@ -4782,11 +4782,12 @@ expand_function_start (tree subr)
       if (!DECL_RTL_SET_P (var))
        expand_decl (var);
 
-      t_save = build4 (ARRAY_REF, ptr_type_node,
+      t_save = build4 (ARRAY_REF,
+                      TREE_TYPE (TREE_TYPE (cfun->nonlocal_goto_save_area)),
                       cfun->nonlocal_goto_save_area,
                       integer_zero_node, NULL_TREE, NULL_TREE);
       r_save = expand_expr (t_save, NULL_RTX, VOIDmode, EXPAND_WRITE);
-      r_save = convert_memory_address (Pmode, r_save);
+      gcc_assert (GET_MODE (r_save) == Pmode);
 
       emit_move_insn (r_save, targetm.builtin_setjmp_frame_value ());
       update_nonlocal_goto_save_area ();