OSDN Git Service

2008-07-30 Rafael Avila de Espindola <espindola@google.com>
authorespindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Jul 2008 13:59:58 +0000 (13:59 +0000)
committerespindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Jul 2008 13:59:58 +0000 (13:59 +0000)
       * final.c (call_from_call_insn): New.
       (final_scan_insn): Call assemble_external on FUNCTION_DECLs.

2008-07-30  Rafael Avila de Espindola  <espindola@google.com>

* gcc.dg/visibility-14.c: New test.
* gcc.dg/visibility-15.c: New test.
* gcc.dg/visibility-16.c: New test.
* gcc.dg/visibility-17.c: New test.
* gcc.dg/visibility-18.c: New test.
* gcc.dg/visibility-19.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138310 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/final.c
gcc/testsuite/ChangeLog

index ef8fdb0..423ac34 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-30  Rafael Avila de Espindola  <espindola@google.com>
+
+       * final.c (call_from_call_insn): New.
+       (final_scan_insn): Call assemble_external on FUNCTION_DECLs.
+
 2008-07-30  Paolo Bonzini  <bonzini@gnu.org>
 
        * configure.ac: Substitute ADA_CFLAGS.
 2008-07-30  Paolo Bonzini  <bonzini@gnu.org>
 
        * configure.ac: Substitute ADA_CFLAGS.
index 787c43a..2a9d40b 100644 (file)
@@ -1744,6 +1744,31 @@ output_alternate_entry_point (FILE *file, rtx insn)
     }
 }
 
     }
 }
 
+/* Given a CALL_INSN, find and return the nested CALL. */
+static rtx
+call_from_call_insn (rtx insn)
+{
+  rtx x;
+  gcc_assert (CALL_P (insn));
+  x = PATTERN (insn);
+
+  while (GET_CODE (x) != CALL)
+    {
+      switch (GET_CODE (x))
+       {
+       default:
+         gcc_unreachable ();
+       case PARALLEL:
+         x = XVECEXP (x, 0, 0);
+         break;
+       case SET:
+         x = XEXP (x, 1);
+         break;
+       }
+    }
+  return x;
+}
+
 /* The final scan for one insn, INSN.
    Args are same as in `final', except that INSN
    is the insn being scanned.
 /* The final scan for one insn, INSN.
    Args are same as in `final', except that INSN
    is the insn being scanned.
@@ -2609,6 +2634,20 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
        targetm.asm_out.unwind_emit (asm_out_file, insn);
 #endif
 
        targetm.asm_out.unwind_emit (asm_out_file, insn);
 #endif
 
+       if (CALL_P (insn))
+         {
+           rtx x = call_from_call_insn (insn);
+           x = XEXP (x, 0);
+           if (x && MEM_P (x) && GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
+             {
+               tree t;
+               x = XEXP (x, 0);
+               t = SYMBOL_REF_DECL (x);
+               if (t)
+                 assemble_external (t);
+             }
+         }
+
        /* Output assembler code from the template.  */
        output_asm_insn (templ, recog_data.operand);
 
        /* Output assembler code from the template.  */
        output_asm_insn (templ, recog_data.operand);
 
index 95f4d4e..c53755b 100644 (file)
@@ -1,3 +1,12 @@
+2008-07-30  Rafael Avila de Espindola  <espindola@google.com>
+
+       * gcc.dg/visibility-14.c: New test.
+       * gcc.dg/visibility-15.c: New test.
+       * gcc.dg/visibility-16.c: New test.
+       * gcc.dg/visibility-17.c: New test.
+       * gcc.dg/visibility-18.c: New test.
+       * gcc.dg/visibility-19.c: New test.
+
 2008-07-30  Dodji Seketeli  <dseketel@redhat.com>
 
        PR c++/36767
 2008-07-30  Dodji Seketeli  <dseketel@redhat.com>
 
        PR c++/36767