]> git.ipfire.org Git - thirdparty/gcc.git/commit
gcov-profile/114715 - missing coverage for switch
authorRichard Biener <rguenther@suse.de>
Mon, 15 Apr 2024 09:09:17 +0000 (11:09 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 15 Apr 2024 11:35:15 +0000 (13:35 +0200)
commit9d573f71e80e9f6f4aac912fc8fc128aa2697e3a
tree803b797b276adf872f2b9c8c4c21be043366bca7
parenta3281dd0f4b46c16ec1192ad411c0a96e6d086eb
gcov-profile/114715 - missing coverage for switch

The following avoids missing coverage for the line of a switch statement
which happens when gimplification emits a BIND_EXPR wrapping the switch
as that prevents us from setting locations on the containing statements
via annotate_all_with_location.  Instead set the location of the GIMPLE
switch directly.

PR gcov-profile/114715
* gimplify.cc (gimplify_switch_expr): Set the location of the
GIMPLE switch.

* gcc.misc-tests/gcov-24.c: New testcase.
gcc/gimplify.cc
gcc/testsuite/gcc.misc-tests/gcov-24.c [new file with mode: 0644]