http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60175

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The incorrect frequencies can be seen even on say -O1 -fsanitize=address
-fdump-rtl-expand-all:
static void *stack_base;

void mark_memory (void **start, void **end);

int
main (void)
{
  void *dummy;
  stack_base = &dummy;
  void *end;
  mark_memory (stack_base, &end);
  return 0;
}

I don't see anything wrong before find_many_sub_blocks is called, there are
just 3 basic blocks at that point, bb3 as entry block successor with freq
10000, which has some asan related branches inside of it, but nothing outside,
then bb2
as the function body block with freq 10000, which ends in an unconditional jump
that jumps to return_label (in bb4 after note + 2 clobbers), and finally bb4 as
the exit block predecessor with freq 10000.  I guess the only weird thing is
that the clobbers are bypassed by the jump, maybe that in the end causes
find_many_sub_blocks to create weird frequencies.  And bb4 contains again some
conditional jumps and labels related to asan, but again only inside that block.
Without asan use-after-return, the exit block predecessor is just merged with
the preceeding basic block, maybe it has a wrong frequency after
find_many_sub_blocks too, but as it is merged with the body block, tha twrong
frequency never shows up anywhere.

Reply via email to