gcov broken on gcc 4.2.1 (Xcode 3.2.2) with inlines in precompiled headers

Originator:dmaclach
Number:rdar://8049256 Date Originated:06/01/2010
Status:Closed Resolved:
Product:Xcode Product Version:3.2.2
Classification:Serious Bug Reproducible:Always
 
Summary:
the coverage files produced when code coverage is enabled are bad when using gcc 4.2.1 with precompiled headers.

Steps to Reproduce:
1) download and extract attached project
2) go to the extracted folder in the Terminal
3) build it -> xcodebuild -configuration Debug
4) run it -> build/Debug/GCovTest
5) run gcov -> gcov -o build/GCovTest.build/Debug/GCovTest.build/Objects-normal/x86_64 test.m
6) Expect 83.33% of 6 for test.m.gcov
7) Change line 3 of GCovTest_Prefix.pch from #if 0 to #if 1
8) build it -> xcodebuild -configuration Debug
9) run it -> build/Debug/GCovTest
10) run gcov -> gcov -o build/GCovTest.build/Debug/GCovTest.build/Objects-normal/x86_64 test.m

Expected Results:
83.33% of 6 for test.m.gcov

Actual Results:
0.0% of 6 for test.m.gcov

Regression:
Works fine with the GCC 4.0 compiler

(Attachment couldn't be added to openradar)

Comments

Attachment available

The attachment for this bug can be picked up here:

http://coverstory.googlecode.com/files/GCovTest.zip

Not to be fixed

Apple is now focusing on clang. Only P0 bugs in gcc 4.2 are going to be fixed.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!