mips.c (mips_pic_call_symbol_from_set): Check for SYMBOL_REF SET_SRCs.
authorRichard Sandiford <rdsandiford@googlemail.com>
Mon, 27 Aug 2012 16:25:47 +0000 (16:25 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 27 Aug 2012 16:25:47 +0000 (16:25 +0000)
gcc/
* config/mips/mips.c (mips_pic_call_symbol_from_set): Check for
SYMBOL_REF SET_SRCs.

From-SVN: r190717

gcc/ChangeLog
gcc/config/mips/mips.c

index 82c7a3580f923f46ee4cab702339ba0314291a77..ac457722dd4ec8d1c61eb35e46348215c64d8eaf 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-27  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * config/mips/mips.c (mips_pic_call_symbol_from_set): Check for
+       SYMBOL_REF SET_SRCs.
+
 2012-08-27  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * config/mips/mips.c (vr4130_align_insns): Don't simulate
index b20e4ed36369bc65e5ddc8c00e0daed08612a68a..7721a7c1ce10424c17fc5fe82f45ef80aede8984 100644 (file)
@@ -14706,13 +14706,13 @@ mips_pic_call_symbol_from_set (df_ref def, rtx reg, bool recurse_p)
     {
       rtx note, src, symbol;
 
-      /* First, look at REG_EQUAL/EQUIV notes.  */
-      note = find_reg_equal_equiv_note (def_insn);
-      if (note && GET_CODE (XEXP (note, 0)) == SYMBOL_REF)
-       return XEXP (note, 0);
-
-      /* For %call16 references we don't have REG_EQUAL.  */
+      /* First see whether the source is a plain symbol.  This is used
+        when calling symbols that are not lazily bound.  */
       src = SET_SRC (set);
+      if (GET_CODE (src) == SYMBOL_REF)
+       return src;
+
+      /* Handle %call16 references.  */
       symbol = mips_strip_unspec_call (src);
       if (symbol)
        {
@@ -14720,6 +14720,12 @@ mips_pic_call_symbol_from_set (df_ref def, rtx reg, bool recurse_p)
          return symbol;
        }
 
+      /* If we have something more complicated, look for a
+        REG_EQUAL or REG_EQUIV note.  */
+      note = find_reg_equal_equiv_note (def_insn);
+      if (note && GET_CODE (XEXP (note, 0)) == SYMBOL_REF)
+       return XEXP (note, 0);
+
       /* Follow at most one simple register copy.  Such copies are
         interesting in cases like: