Fix bfd/archive.c miscompilation.
authorJim Wilson <wilson@cygnus.com>
Thu, 24 Aug 2000 20:44:04 +0000 (20:44 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Thu, 24 Aug 2000 20:44:04 +0000 (13:44 -0700)
* config/ia64/ia64.md (movdi): Don't call gen_movdi_symbolic if
we have a SYMBOL_REF with SYMBOL_REF_FLAG set.

From-SVN: r35955

gcc/ChangeLog
gcc/config/ia64/ia64.md

index 29a0c03de9c6ded9ec6052599ef622a420ffd9c5..3a3ed67503feaab52bc00e083fd2e88bc68553be 100644 (file)
@@ -1,3 +1,8 @@
+2000-08-24  Jim Wilson  <wilson@cygnus.com>
+
+       * config/ia64/ia64.md (movdi): Don't call gen_movdi_symbolic if
+       we have a SYMBOL_REF with SYMBOL_REF_FLAG set.
+
 2000-08-24  Jason Merrill  <jason@redhat.com>
 
        * dwarf2out.c (AT_flag, AT_int, AT_unsigned, AT_string, AT_ref,
index 3afddeac929172e09b90cdef4304797031c6ccfb..5057ba08da1bd9857ca687d1669ff6442129b0b4 100644 (file)
         type of PIC address load.  If this function gets deferred, we
         may acquire information that changes the value of the
         sdata_symbolic_operand predicate.  */
-      if (rtx_equal_function_value_matters)
+      /* But don't delay for function pointers.  Loading a function address
+        actually loads the address of the descriptor not the function.
+        If we represent these as SYMBOL_REFs, then they get cse'd with
+        calls, and we end up with calls to the descriptor address instead of
+        calls to the function address.  Functions are not candidates for
+        sdata anyways.  */
+      if (rtx_equal_function_value_matters
+         && ! (GET_CODE (operands[1]) == SYMBOL_REF
+               && SYMBOL_REF_FLAG (operands[1])))
        emit_insn (gen_movdi_symbolic (operands[0], operands[1]));
       else
         ia64_expand_load_address (operands[0], operands[1]);