summaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-09 15:21:54 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-09 15:21:54 +0000
commit27e0321aadb8c2c656af795612836cf896f0557d (patch)
tree7624fc2d71c047c04fe2c3c927b645f19760fdee /gcc/final.c
parentcf4848768d6fbbbaec367eb8107504f1803091e2 (diff)
downloadgcc-27e0321aadb8c2c656af795612836cf896f0557d.tar.gz
2009-10-09 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 152583 after the LTO merge inside trunk. [during merge with trunk 152583 the version information from GCC is used, not the checksum of the executable!] * gcc/melt-runtime.h (melt_gccversionstr): added extern declaration. * gcc/melt-runtime.c: Moved the #include before everything else. Updated comment NOTE about gengtype - which is now compatible with the trunk's. (melt_gccversionstr): added declaration. (load_checked_dynamic_module_index): use a gcc version string in modules, not a checksum of the executable. (melt_really_initialize): get a second argument for the gcc version string. Initialize melt_gccversionstr with it. (plugin_init): Build the gccversionstr out of gcc_version structure. (melt_initialize): calls melt_really_initialize with version_string. (melt_output_cfile_decl_impl): generates a genversionstr_melt instead of a genchecksum_melt. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@152591 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/gcc/final.c b/gcc/final.c
index 78a698b4484..b8f5e513817 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1399,13 +1399,23 @@ static int
asm_insn_count (rtx body)
{
const char *templ;
- int count = 1;
if (GET_CODE (body) == ASM_INPUT)
templ = XSTR (body, 0);
else
templ = decode_asm_operands (body, NULL, NULL, NULL, NULL, NULL);
+ return asm_str_count (templ);
+}
+#endif
+
+/* Return the number of machine instructions likely to be generated for the
+ inline-asm template. */
+int
+asm_str_count (const char *templ)
+{
+ int count = 1;
+
if (!*templ)
return 0;
@@ -1416,7 +1426,6 @@ asm_insn_count (rtx body)
return count;
}
-#endif
/* ??? This is probably the wrong place for these. */
/* Structure recording the mapping from source file and directory
@@ -2675,6 +2684,26 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
/* Output assembler code from the template. */
output_asm_insn (templ, recog_data.operand);
+ /* Record point-of-call information for ICF debugging. */
+ if (flag_enable_icf_debug && CALL_P (insn))
+ {
+ rtx x = call_from_call_insn (insn);
+ x = XEXP (x, 0);
+ if (x && MEM_P (x))
+ {
+ if (GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
+ {
+ tree t;
+ x = XEXP (x, 0);
+ t = SYMBOL_REF_DECL (x);
+ if (t)
+ (*debug_hooks->direct_call) (t);
+ }
+ else
+ (*debug_hooks->virtual_call) (INSN_UID (insn));
+ }
+ }
+
/* Some target machines need to postscan each insn after
it is output. */
if (targetm.asm_out.final_postscan_insn)