OSDN Git Service

2011-02-28 Kai Tietz <kai.tietz@onevision.com>
[pf3gnuchains/gcc-fork.git] / gcc / final.c
index 060a245..1e1424f 100644 (file)
@@ -256,6 +256,13 @@ default_function_pro_epilogue (FILE *file ATTRIBUTE_UNUSED,
 {
 }
 
+void
+default_function_switched_text_sections (FILE *file ATTRIBUTE_UNUSED,
+                                        tree decl ATTRIBUTE_UNUSED,
+                                        bool new_is_cold ATTRIBUTE_UNUSED)
+{
+}
+
 /* Default target hook that outputs nothing to a stream.  */
 void
 no_asm_to_stream (FILE *file ATTRIBUTE_UNUSED)
@@ -1485,7 +1492,7 @@ remap_debug_filename (const char *filename)
   size_t name_len;
 
   for (map = debug_prefix_maps; map; map = map->next)
-    if (strncmp (filename, map->old_prefix, map->old_len) == 0)
+    if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
       break;
   if (!map)
     return filename;
@@ -1841,6 +1848,9 @@ final_scan_insn (rtx insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
            debug_hooks->switch_text_section ();
 
          switch_to_section (current_function_section ());
+         targetm.asm_out.function_switched_text_sections (asm_out_file,
+                                                          current_function_decl,
+                                                          in_cold_section_p);
          break;
 
        case NOTE_INSN_BASIC_BLOCK:
@@ -3620,6 +3630,32 @@ output_addr_const (FILE *file, rtx x)
     }
 }
 \f
+/* Output a quoted string.  */
+
+void
+output_quoted_string (FILE *asm_file, const char *string)
+{
+#ifdef OUTPUT_QUOTED_STRING
+  OUTPUT_QUOTED_STRING (asm_file, string);
+#else
+  char c;
+
+  putc ('\"', asm_file);
+  while ((c = *string++) != 0)
+    {
+      if (ISPRINT (c))
+       {
+         if (c == '\"' || c == '\\')
+           putc ('\\', asm_file);
+         putc (c, asm_file);
+       }
+      else
+       fprintf (asm_file, "\\%03o", (unsigned char) c);
+    }
+  putc ('\"', asm_file);
+#endif
+}
+\f
 /* A poor man's fprintf, with the added features of %I, %R, %L, and %U.
    %R prints the value of REGISTER_PREFIX.
    %L prints the value of LOCAL_LABEL_PREFIX.
@@ -3807,10 +3843,11 @@ split_double (rtx value, rtx *first, rtx *second)
             Sign extend each half to HOST_WIDE_INT.  */
          unsigned HOST_WIDE_INT low, high;
          unsigned HOST_WIDE_INT mask, sign_bit, sign_extend;
+         unsigned bits_per_word = BITS_PER_WORD;
 
          /* Set sign_bit to the most significant bit of a word.  */
          sign_bit = 1;
-         sign_bit <<= BITS_PER_WORD - 1;
+         sign_bit <<= bits_per_word - 1;
 
          /* Set mask so that all bits of the word are set.  We could
             have used 1 << BITS_PER_WORD instead of basing the
@@ -3833,7 +3870,7 @@ split_double (rtx value, rtx *first, rtx *second)
          /* Pick the higher word, shifted to the least significant
             bits, and sign-extend it.  */
          high = INTVAL (value);
-         high >>= BITS_PER_WORD - 1;
+         high >>= bits_per_word - 1;
          high >>= 1;
          high &= mask;
          if (high & sign_bit)
@@ -4365,7 +4402,11 @@ rest_of_clean_state (void)
            if (LABEL_P (insn))
              INSN_UID (insn) = CODE_LABEL_NUMBER (insn);
            else
-             INSN_UID (insn) = 0;
+             {
+               if (NOTE_P (insn))
+                 set_block_for_insn (insn, NULL);
+               INSN_UID (insn) = 0;
+             }
        }
     }
 
@@ -4386,7 +4427,6 @@ rest_of_clean_state (void)
               && NOTE_KIND (insn) != NOTE_INSN_BLOCK_END
               && NOTE_KIND (insn) != NOTE_INSN_CFA_RESTORE_STATE)))
        print_rtl_single (final_output, insn);
-
     }
 
   if (final_output)