mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 12:00:11 -05:00
middle-end/114681 - condition coverage and inlining
When inlining a gcond it can map to multiple stmts, esp. with non-call EH. The following makes sure to pick up the remapped condition when dealing with condition coverage. PR middle-end/114681 * tree-inline.cc (copy_bb): Key on the remapped stmt to identify gconds to have condition coverage data remapped. * gcc.misc-tests/gcov-pr114681.c: New testcase.
This commit is contained in:
18
gcc/testsuite/gcc.misc-tests/gcov-pr114681.c
Normal file
18
gcc/testsuite/gcc.misc-tests/gcov-pr114681.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O -fnon-call-exceptions -fno-exceptions -fcondition-coverage" } */
|
||||
|
||||
float f, g;
|
||||
|
||||
static void
|
||||
bar ()
|
||||
{
|
||||
if (g < f)
|
||||
for (;;)
|
||||
;
|
||||
}
|
||||
|
||||
void
|
||||
foo ()
|
||||
{
|
||||
bar ();
|
||||
}
|
||||
@@ -2090,7 +2090,7 @@ copy_bb (copy_body_data *id, basic_block bb,
|
||||
/* If -fcondition-coverage is used, register the inlined conditions
|
||||
in the cond->expression mapping of the caller. The expression tag
|
||||
is shifted conditions from the two bodies are not mixed. */
|
||||
if (id->src_cfun->cond_uids && is_a <gcond*> (orig_stmt))
|
||||
if (id->src_cfun->cond_uids && is_a <gcond*> (stmt))
|
||||
{
|
||||
gcond *orig_cond = as_a <gcond*> (orig_stmt);
|
||||
gcond *cond = as_a <gcond*> (stmt);
|
||||
|
||||
Reference in New Issue
Block a user