diff options
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/final.c | 13 | ||||
-rw-r--r-- | gcc/rtl.h | 1 | ||||
-rw-r--r-- | gcc/tree-inline.c | 2 |
4 files changed, 21 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 20000c9..096db82 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2009-10-05 Andrew Pinski <andrew_pinski@playstation.sony.com> + + PR tree-opt/40992 + * final.c (asm_str_count): Split out from asm_insn_count. + * rtl.h (asm_str_count): New prototype. + * tree-inline (estimate_num_insns) <case GIMPLE_ASM>: Call + asm_str_count. + 2009-10-05 Sriraman Tallam <tmsriram@google.com> * doc/plugins.texi: Change plugin_pass to register_pass_info. diff --git a/gcc/final.c b/gcc/final.c index 78a698b..f121da1 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 @@ -2424,6 +2424,7 @@ extern void simplify_using_condition (rtx, rtx *, struct bitmap_head_def *); /* In final.c */ extern unsigned int compute_alignments (void); +extern int asm_str_count (const char *templ); struct rtl_hooks { diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index e38da6d..91ed023 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -3346,7 +3346,7 @@ estimate_num_insns (gimple stmt, eni_weights *weights) return 0; case GIMPLE_ASM: - return 1; + return asm_str_count (gimple_asm_string (stmt)); case GIMPLE_RESX: /* This is either going to be an external function call with one |