expr.c (expand_assignment): Force pointers to proper mode if POINTERS_EXTEND_UNSIGNED...
authorDonn Terry <donn@interix.com>
Thu, 15 Apr 1999 22:52:22 +0000 (22:52 +0000)
committerJeff Law <law@gcc.gnu.org>
Thu, 15 Apr 1999 22:52:22 +0000 (16:52 -0600)
        * expr.c (expand_assignment): Force pointers to proper mode if
        POINTERS_EXTEND_UNSIGNED is defined.

From-SVN: r26484

gcc/ChangeLog
gcc/expr.c

index 4cbf8661ff3380d052cf304dc3a73e4695461d89..12932a10825e444aafef8356072e1e418fdc74cc 100644 (file)
@@ -6,6 +6,9 @@ Thu Apr 15 23:17:33 1999  Jerry Quinn <jquinn@nortelnetworks.com>
 
 Thu Apr 15 20:46:57 1999  Donn Terry (donn@interix.com)
 
+       * expr.c (expand_assignment): Force pointers to proper mode if
+       POINTERS_EXTEND_UNSIGNED is defined.
+
        * xm-alpha.h (alloca.h): Add Interix to list of special machines 
        that don't like alloca.h, pending using autoconf results.
 
index 8d5a540218463b262ce96ad24a453aa6f8e9d202..5b6b2a7dab37713a1c257d24c1895a46fc5ecf68 100644 (file)
@@ -3393,7 +3393,14 @@ expand_assignment (to, from, want_value, suggest_reg)
        emit_block_move (to_rtx, value, expr_size (from),
                         TYPE_ALIGN (TREE_TYPE (from)) / BITS_PER_UNIT);
       else
-       emit_move_insn (to_rtx, value);
+       {
+#ifdef POINTERS_EXTEND_UNSIGNED
+         if (TREE_CODE (to) == REFERENCE_TYPE
+            || TREE_CODE (to) == POINTER_TYPE)
+           value = convert_memory_address (GET_MODE (to_rtx), value);
+#endif
+         emit_move_insn (to_rtx, value);
+       }
       preserve_temp_slots (to_rtx);
       free_temp_slots ();
       pop_temp_slots ();