This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[GOOGLE] Workaround a bug in AutoFDO which may leads to infinite loop for inlined assembly
- From: Dehao Chen <dehao at google dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: David Li <davidxl at google dot com>
- Date: Sun, 21 Apr 2013 16:51:24 -0700
- Subject: [GOOGLE] Workaround a bug in AutoFDO which may leads to infinite loop for inlined assembly
This patch fixed a bug in getting inline stacks: if there is no
location info attached to a block, we should *not* try to get its
function name because it could result in infinite loop.
Bootstrapped and passed all regression tests.
Ok for gcc-4_7 branch?
Thanks,
Dehao
Index: gcc/auto-profile.c
===================================================================
--- gcc/auto-profile.c (revision 198117)
+++ gcc/auto-profile.c (working copy)
@@ -662,9 +662,10 @@ get_inline_stack_by_stmt (gimple stmt, tree decl,
block && (TREE_CODE (block) == BLOCK);
block = BLOCK_SUPERCONTEXT (block))
{
- tree decl = get_function_decl_from_block (block);
+ tree decl;
if (LOCATION_LOCUS (BLOCK_SOURCE_LOCATION (block)) == UNKNOWN_LOCATION)
continue;
+ decl = get_function_decl_from_block (block);
loc = BLOCK_SOURCE_LOCATION (block);
pos_stack[idx].file = expand_location (loc).file;
pos_stack[idx].line = expand_location (loc).line;