expr.c (expand_expr_addr_expr): Only accept Pmode or ptr_mode as valid modes to expan...
authorUlrich Weigand <uweigand@de.ibm.com>
Sun, 3 Oct 2004 22:50:18 +0000 (22:50 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Sun, 3 Oct 2004 22:50:18 +0000 (22:50 +0000)
* expr.c (expand_expr_addr_expr): Only accept Pmode or ptr_mode
as valid modes to expand address expressions.

From-SVN: r88464

gcc/ChangeLog
gcc/expr.c

index c934ea5..4744f92 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-03  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * expr.c (expand_expr_addr_expr): Only accept Pmode or ptr_mode
+       as valid modes to expand address expressions.
+
 2004-10-03  Joseph S. Myers  <jsm@polyomino.org.uk>
 
        * c-aux-info.c, c-common.c, c-common.h, c-cppbuiltin.c, c-decl.c,
index 5db2c28..2baea73 100644 (file)
@@ -6201,7 +6201,7 @@ expand_expr_addr_expr (tree exp, rtx target, enum machine_mode tmode,
   /* We can get called with some Weird Things if the user does silliness
      like "(short) &a".  In that case, convert_memory_address won't do
      the right thing, so ignore the given target mode.  */
-  if (!targetm.valid_pointer_mode (tmode))
+  if (tmode != Pmode && tmode != ptr_mode)
     tmode = Pmode;
 
   result = expand_expr_addr_expr_1 (TREE_OPERAND (exp, 0), target,