]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
builtins.c (expand_builtin_prefetch): Force op0 pointer to Pmode if POINTERS_EXTEND_U...
authorSteve Ellcey <sje@cup.hp.com>
Wed, 3 Apr 2002 02:33:07 +0000 (02:33 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 3 Apr 2002 02:33:07 +0000 (18:33 -0800)
        * builtins.c (expand_builtin_prefetch): Force op0 pointer to Pmode
        if POINTERS_EXTEND_UNSIGNED is defined.

From-SVN: r51778

gcc/ChangeLog
gcc/builtins.c

index f26b3c8924847d064688a657e765bd5f5aafe1c6..55596999468a64c34cdebdd8b5913c24991dd3f9 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-02  Steve Ellcey  <sje@cup.hp.com>
+
+       * builtins.c (expand_builtin_prefetch): Force op0 pointer to Pmode
+       if POINTERS_EXTEND_UNSIGNED is defined.
+
 2002-04-02  Richard Henderson  <rth@redhat.com>
 
        PR opt/3967
index effd70d43ed30ae9c2fbc592d68d56d199d49f6d..dcbc6dab23e5558c6efa3bb0811f9f5b3e107829 100644 (file)
@@ -787,10 +787,17 @@ expand_builtin_prefetch (arglist)
 #ifdef HAVE_prefetch
   if (HAVE_prefetch)
     {
-      if (! (*insn_data[(int)CODE_FOR_prefetch].operand[0].predicate)
-           (op0,
-            insn_data[(int)CODE_FOR_prefetch].operand[0].mode))
-        op0 = force_reg (Pmode, op0);
+      if ((! (*insn_data[(int)CODE_FOR_prefetch].operand[0].predicate)
+            (op0,
+             insn_data[(int)CODE_FOR_prefetch].operand[0].mode)) ||
+          (GET_MODE(op0) != Pmode))
+        {
+#ifdef POINTERS_EXTEND_UNSIGNED
+         if (GET_MODE(op0) != Pmode)
+           op0 = convert_memory_address (Pmode, op0);
+#endif
+          op0 = force_reg (Pmode, op0);
+        }
       emit_insn (gen_prefetch (op0, op1, op2));
     }
   else