* [Bug gcov-profile/55551] Revision 193999 breaks lto/profiledbootstrap
2012-11-30 17:20 [Bug gcov-profile/55551] New: Revision 193999 breaks lto/profiledbootstrap markus at trippelsdorf dot de
@ 2012-11-30 17:38 ` tejohnson at google dot com
2012-11-30 22:05 ` tejohnson at google dot com
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: tejohnson at google dot com @ 2012-11-30 17:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
--- Comment #1 from Teresa Johnson <tejohnson at google dot com> 2012-11-30 17:38:07 UTC ---
Working on reproducing right now. Teresa
On Fri, Nov 30, 2012 at 9:20 AM, markus at trippelsdorf dot de
<gcc-bugzilla@gcc.gnu.org> wrote:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
>
> Markus Trippelsdorf <markus at trippelsdorf dot de> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> CC| |tejohnson at gcc dot
> | |gnu.org
>
> --
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug gcov-profile/55551] Revision 193999 breaks lto/profiledbootstrap
2012-11-30 17:20 [Bug gcov-profile/55551] New: Revision 193999 breaks lto/profiledbootstrap markus at trippelsdorf dot de
2012-11-30 17:38 ` [Bug gcov-profile/55551] " tejohnson at google dot com
@ 2012-11-30 22:05 ` tejohnson at google dot com
2012-11-30 22:21 ` markus at trippelsdorf dot de
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: tejohnson at google dot com @ 2012-11-30 22:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
--- Comment #2 from Teresa Johnson <tejohnson at google dot com> 2012-11-30 22:05:22 UTC ---
Found the issue. Doing final testing, but the patch is below. FTR, I
couldn't do a slim-lto-bootstrap, it appears this config file is not
yet committed to trunk? Reproduced with just a normal lto bootstrap
though.
Teresa
2012-11-30 Teresa Johnson <tejohnson@google.com>
* lto-cgraph.c (merge_profile_summaries): Handle scaled histogram
entries that map to the same index.
Index: lto-cgraph.c
===================================================================
--- lto-cgraph.c (revision 193999)
+++ lto-cgraph.c (working copy)
@@ -1363,17 +1363,20 @@ merge_profile_summaries (struct lto_file_decl_data
above. Use that to find the new histogram index. */
int scaled_min = RDIV (saved_profile_info->histogram[h_ix].min_value
* saved_scale, REG_BR_PROB_BASE);
+ /* The new index may be shared with another scaled histogram entry,
+ so we need to account for a non-zero histogram entry at new_ix. */
unsigned new_ix = gcov_histo_index (scaled_min);
- lto_gcov_summary.histogram[new_ix].min_value = scaled_min;
+ lto_gcov_summary.histogram[new_ix].min_value
+ = MIN (lto_gcov_summary.histogram[new_ix].min_value, scaled_min);
/* Some of the scaled counter values would ostensibly need to be placed
into different (larger) histogram buckets, but we keep things simple
here and place the scaled cumulative counter value in the bucket
corresponding to the scaled minimum counter value. */
lto_gcov_summary.histogram[new_ix].cum_value
- = RDIV (saved_profile_info->histogram[h_ix].cum_value
- * saved_scale, REG_BR_PROB_BASE);
+ += RDIV (saved_profile_info->histogram[h_ix].cum_value
+ * saved_scale, REG_BR_PROB_BASE);
lto_gcov_summary.histogram[new_ix].num_counters
- = saved_profile_info->histogram[h_ix].num_counters;
+ += saved_profile_info->histogram[h_ix].num_counters;
}
/* Watch roundoff errors. */
On Fri, Nov 30, 2012 at 9:37 AM, Teresa Johnson <tejohnson@google.com> wrote:
> Working on reproducing right now. Teresa
>
> On Fri, Nov 30, 2012 at 9:20 AM, markus at trippelsdorf dot de
> <gcc-bugzilla@gcc.gnu.org> wrote:
>>
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
>>
>> Markus Trippelsdorf <markus at trippelsdorf dot de> changed:
>>
>> What |Removed |Added
>> ----------------------------------------------------------------------------
>> CC| |tejohnson at gcc dot
>> | |gnu.org
>>
>> --
>> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
>> ------- You are receiving this mail because: -------
>> You are on the CC list for the bug.
>
>
>
> --
> Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug gcov-profile/55551] Revision 193999 breaks lto/profiledbootstrap
2012-11-30 17:20 [Bug gcov-profile/55551] New: Revision 193999 breaks lto/profiledbootstrap markus at trippelsdorf dot de
2012-11-30 17:38 ` [Bug gcov-profile/55551] " tejohnson at google dot com
2012-11-30 22:05 ` tejohnson at google dot com
@ 2012-11-30 22:21 ` markus at trippelsdorf dot de
2012-12-01 6:51 ` markus at trippelsdorf dot de
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: markus at trippelsdorf dot de @ 2012-11-30 22:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
--- Comment #3 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-11-30 22:20:43 UTC ---
On 2012.11.30 at 22:05 +0000, tejohnson at google dot com wrote:
> Found the issue. Doing final testing, but the patch is below. FTR, I
> couldn't do a slim-lto-bootstrap, it appears this config file is not
> yet committed to trunk? Reproduced with just a normal lto bootstrap
> though.
Yes, it's a config that I only use locally. Sorry for the confusion.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug gcov-profile/55551] Revision 193999 breaks lto/profiledbootstrap
2012-11-30 17:20 [Bug gcov-profile/55551] New: Revision 193999 breaks lto/profiledbootstrap markus at trippelsdorf dot de
` (2 preceding siblings ...)
2012-11-30 22:21 ` markus at trippelsdorf dot de
@ 2012-12-01 6:51 ` markus at trippelsdorf dot de
2012-12-01 7:12 ` tejohnson at google dot com
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: markus at trippelsdorf dot de @ 2012-12-01 6:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
--- Comment #4 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-12-01 06:51:14 UTC ---
With your patch applied, Firefox fails to build:
/var/tmp/moz-build-dir/_virtualenv/bin/python
/var/tmp/mozilla-central/config/pythonpath.py -I../../../config
/var/tmp/mozilla-central/config/expandlibs_exec.py --depend
.deps/libsoundtouch.so.pp --target libsoundtouch.so --uselist -- c++
-pedantic -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type
-Wtype-limits -Wempty-body -Wno-ctor-dtor-privacy -Wno-overlength-strings
-Wno-invalid-offsetof -Wno-variadic-macros -Wcast-align -Wno-long-long -w
-march=native -fno-exceptions -fno-strict-aliasing -fno-rtti
-ffunction-sections -fdata-sections -fno-exceptions -std=gnu++0x -pthread -pipe
-DNDEBUG -DTRIMMED -flto=4 -fno-fat-lto-objects -fprofile-use
-fprofile-correction -Wcoverage-mismatch -O3 -fomit-frame-pointer -fPIC -shared
-Wl,-z,defs -Wl,--gc-sections -Wl,-h,libsoundtouch.so -o libsoundtouch.so
AAFilter.o cpu_detect_x86.o FIFOSampleBuffer.o FIRFilter.o RateTransposer.o
SoundTouch.o TDStretch.o sse_optimized.o -lpthread -fuse-linker-plugin
-Wl,-O1,--hash-style=gnu -Wl,-z,noexecstack -Wl,--icf=safe -fprofile-use
-Wl,-rpath-link,/var/tmp/moz-build-dir/dist/bin -Wl,-rpath-link,/usr/lib
../../../dist/lib/libmozalloc.a -ldl
lto1: internal compiler error: in merge_profile_summaries, at lto-cgraph.c:1356
I will try to reduce this later.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug gcov-profile/55551] Revision 193999 breaks lto/profiledbootstrap
2012-11-30 17:20 [Bug gcov-profile/55551] New: Revision 193999 breaks lto/profiledbootstrap markus at trippelsdorf dot de
` (3 preceding siblings ...)
2012-12-01 6:51 ` markus at trippelsdorf dot de
@ 2012-12-01 7:12 ` tejohnson at google dot com
2012-12-01 7:15 ` markus at trippelsdorf dot de
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: tejohnson at google dot com @ 2012-12-01 7:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
--- Comment #5 from Teresa Johnson <tejohnson at google dot com> 2012-12-01 07:12:24 UTC ---
Hmm, I'm not sure how that assert can be hit, since we would have
returned earlier if none of the files being merged has any profile
runs. Presumably any profile run should have a sum_all of the counters
> 0, so the saved_profile_info would have to be set in the above loop.
If it is possible somehow that it doesn't, though, the following
additional patch would fix it:
Index: lto-cgraph.c
===================================================================
--- lto-cgraph.c (revision 193999)
+++ lto-cgraph.c (working copy)
@@ -1345,7 +1345,8 @@ merge_profile_summaries (struct lto_file_decl_data
/* Save a pointer to the profile_info with the largest
scaled sum_all and the scale for use in merging the
histogram. */
- if (lto_gcov_summary.sum_all > saved_sum_all)
+ if (!saved_profile_info
+ || lto_gcov_summary.sum_all > saved_sum_all)
{
saved_profile_info = &file_data->profile_info;
saved_sum_all = lto_gcov_summary.sum_all;
Can you try adding this patch and seeing if that fixes the issue? I
will hold off on sending the first fix for review to see if I should
add this one.
Thanks,
Teresa
On Fri, Nov 30, 2012 at 10:51 PM, markus at trippelsdorf dot de
<gcc-bugzilla@gcc.gnu.org> wrote:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
>
> --- Comment #4 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-12-01 06:51:14 UTC ---
> With your patch applied, Firefox fails to build:
>
> /var/tmp/moz-build-dir/_virtualenv/bin/python
> /var/tmp/mozilla-central/config/pythonpath.py -I../../../config
> /var/tmp/mozilla-central/config/expandlibs_exec.py --depend
> .deps/libsoundtouch.so.pp --target libsoundtouch.so --uselist -- c++
> -pedantic -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type
> -Wtype-limits -Wempty-body -Wno-ctor-dtor-privacy -Wno-overlength-strings
> -Wno-invalid-offsetof -Wno-variadic-macros -Wcast-align -Wno-long-long -w
> -march=native -fno-exceptions -fno-strict-aliasing -fno-rtti
> -ffunction-sections -fdata-sections -fno-exceptions -std=gnu++0x -pthread -pipe
> -DNDEBUG -DTRIMMED -flto=4 -fno-fat-lto-objects -fprofile-use
> -fprofile-correction -Wcoverage-mismatch -O3 -fomit-frame-pointer -fPIC -shared
> -Wl,-z,defs -Wl,--gc-sections -Wl,-h,libsoundtouch.so -o libsoundtouch.so
> AAFilter.o cpu_detect_x86.o FIFOSampleBuffer.o FIRFilter.o RateTransposer.o
> SoundTouch.o TDStretch.o sse_optimized.o -lpthread -fuse-linker-plugin
> -Wl,-O1,--hash-style=gnu -Wl,-z,noexecstack -Wl,--icf=safe -fprofile-use
> -Wl,-rpath-link,/var/tmp/moz-build-dir/dist/bin -Wl,-rpath-link,/usr/lib
> ../../../dist/lib/libmozalloc.a -ldl
> lto1: internal compiler error: in merge_profile_summaries, at lto-cgraph.c:1356
>
> I will try to reduce this later.
>
> --
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug gcov-profile/55551] Revision 193999 breaks lto/profiledbootstrap
2012-11-30 17:20 [Bug gcov-profile/55551] New: Revision 193999 breaks lto/profiledbootstrap markus at trippelsdorf dot de
` (4 preceding siblings ...)
2012-12-01 7:12 ` tejohnson at google dot com
@ 2012-12-01 7:15 ` markus at trippelsdorf dot de
2012-12-01 7:16 ` markus at trippelsdorf dot de
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: markus at trippelsdorf dot de @ 2012-12-01 7:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
--- Comment #6 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-12-01 07:14:48 UTC ---
Created attachment 28841
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28841
gcda testfile
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug gcov-profile/55551] Revision 193999 breaks lto/profiledbootstrap
2012-11-30 17:20 [Bug gcov-profile/55551] New: Revision 193999 breaks lto/profiledbootstrap markus at trippelsdorf dot de
` (5 preceding siblings ...)
2012-12-01 7:15 ` markus at trippelsdorf dot de
@ 2012-12-01 7:16 ` markus at trippelsdorf dot de
2012-12-01 9:02 ` markus at trippelsdorf dot de
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: markus at trippelsdorf dot de @ 2012-12-01 7:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
--- Comment #7 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-12-01 07:16:03 UTC ---
Created attachment 28842
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28842
testcase
% c++ -fPIC -fno-exceptions -std=gnu++0x -flto -fprofile-use
-fprofile-correction -O3 test.ii
lto1: internal compiler error: in merge_profile_summaries, at lto-cgraph.c:1356
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug gcov-profile/55551] Revision 193999 breaks lto/profiledbootstrap
2012-11-30 17:20 [Bug gcov-profile/55551] New: Revision 193999 breaks lto/profiledbootstrap markus at trippelsdorf dot de
` (6 preceding siblings ...)
2012-12-01 7:16 ` markus at trippelsdorf dot de
@ 2012-12-01 9:02 ` markus at trippelsdorf dot de
2012-12-01 16:39 ` tejohnson at google dot com
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: markus at trippelsdorf dot de @ 2012-12-01 9:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
--- Comment #8 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-12-01 09:01:33 UTC ---
(In reply to comment #5)
>
> Index: lto-cgraph.c
> ===================================================================
> --- lto-cgraph.c (revision 193999)
> +++ lto-cgraph.c (working copy)
> @@ -1345,7 +1345,8 @@ merge_profile_summaries (struct lto_file_decl_data
> /* Save a pointer to the profile_info with the largest
> scaled sum_all and the scale for use in merging the
> histogram. */
> - if (lto_gcov_summary.sum_all > saved_sum_all)
> + if (!saved_profile_info
> + || lto_gcov_summary.sum_all > saved_sum_all)
> {
> saved_profile_info = &file_data->profile_info;
> saved_sum_all = lto_gcov_summary.sum_all;
>
> Can you try adding this patch and seeing if that fixes the issue? I
> will hold off on sending the first fix for review to see if I should
> add this one.
Yes this fixes the issue. Firefox now builds fine.
Thanks.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug gcov-profile/55551] Revision 193999 breaks lto/profiledbootstrap
2012-11-30 17:20 [Bug gcov-profile/55551] New: Revision 193999 breaks lto/profiledbootstrap markus at trippelsdorf dot de
` (7 preceding siblings ...)
2012-12-01 9:02 ` markus at trippelsdorf dot de
@ 2012-12-01 16:39 ` tejohnson at google dot com
2012-12-02 16:40 ` tejohnson at gcc dot gnu.org
2012-12-03 11:46 ` rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: tejohnson at google dot com @ 2012-12-01 16:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
--- Comment #9 from Teresa Johnson <tejohnson at google dot com> 2012-12-01 16:38:25 UTC ---
On Sat, Dec 1, 2012 at 1:01 AM, markus at trippelsdorf dot de
<gcc-bugzilla@gcc.gnu.org> wrote:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
>
> --- Comment #8 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-12-01 09:01:33 UTC ---
> (In reply to comment #5)
>>
>> Index: lto-cgraph.c
>> ===================================================================
>> --- lto-cgraph.c (revision 193999)
>> +++ lto-cgraph.c (working copy)
>> @@ -1345,7 +1345,8 @@ merge_profile_summaries (struct lto_file_decl_data
>> /* Save a pointer to the profile_info with the largest
>> scaled sum_all and the scale for use in merging the
>> histogram. */
>> - if (lto_gcov_summary.sum_all > saved_sum_all)
>> + if (!saved_profile_info
>> + || lto_gcov_summary.sum_all > saved_sum_all)
>> {
>> saved_profile_info = &file_data->profile_info;
>> saved_sum_all = lto_gcov_summary.sum_all;
>>
>> Can you try adding this patch and seeing if that fixes the issue? I
>> will hold off on sending the first fix for review to see if I should
>> add this one.
>
> Yes this fixes the issue. Firefox now builds fine.
> Thanks.
This is exactly what is happening. From gcov-dump on test.gcda:
test.gcda: a3000000: 22:PROGRAM_SUMMARY checksum=0x01847361
test.gcda: counts=617, runs=5, sum_all=0, run_max=0, sum_max=0
test.gcda: counter histogram:
test.gcda: 0: num counts=617, min counter=0, cum_counter=0
Not sure why there are no non-zero counters when there are >0 runs,
but the above patch handles this situation.
Will send in patch a little later today when bootstrap tests complete.
Teresa
>
> --
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug.
--
Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug gcov-profile/55551] Revision 193999 breaks lto/profiledbootstrap
2012-11-30 17:20 [Bug gcov-profile/55551] New: Revision 193999 breaks lto/profiledbootstrap markus at trippelsdorf dot de
` (8 preceding siblings ...)
2012-12-01 16:39 ` tejohnson at google dot com
@ 2012-12-02 16:40 ` tejohnson at gcc dot gnu.org
2012-12-03 11:46 ` rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: tejohnson at gcc dot gnu.org @ 2012-12-02 16:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
--- Comment #10 from tejohnson at gcc dot gnu.org 2012-12-02 16:40:34 UTC ---
Author: tejohnson
Date: Sun Dec 2 16:40:28 2012
New Revision: 194055
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194055
Log:
2012-12-02 Teresa Johnson <tejohnson@google.com>
PR gcov-profile/55551
* lto-cgraph.c (merge_profile_summaries): Handle scaled histogram
entries that map to the same index.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/lto-cgraph.c
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug gcov-profile/55551] Revision 193999 breaks lto/profiledbootstrap
2012-11-30 17:20 [Bug gcov-profile/55551] New: Revision 193999 breaks lto/profiledbootstrap markus at trippelsdorf dot de
` (9 preceding siblings ...)
2012-12-02 16:40 ` tejohnson at gcc dot gnu.org
@ 2012-12-03 11:46 ` rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-03 11:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55551
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-03 11:45:59 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 12+ messages in thread