[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2015-01-16 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-01-16
 Ever confirmed|0   |1

--- Comment #4 from Markus Trippelsdorf  ---
Happend again today. Honza can you please take a look at Ilya's patch?

https://gcc.gnu.org/ml/gcc-patches/2014-10/msg03089.html


[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2015-01-18 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

--- Comment #5 from Jan Hubicka  ---
I don't seem to be able to make sense of Ilya's logic in the probability
calculation (incrementing the count with bb->count seem wrong). 
Will try to update his patch today.


[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2015-01-19 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

Jan Hubicka  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |hubicka at gcc dot 
gnu.org

--- Comment #6 from Jan Hubicka  ---
mine.


[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2015-01-19 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

--- Comment #7 from Jan Hubicka  ---
Created attachment 34490
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34490&action=edit
Proposed fix

I am going to try build firefox with PDO myself with the attached patch. It is
bit tricky to merge the speculation right becuase both variant may disagree on
speculative target.


[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2015-01-19 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

--- Comment #8 from Jan Hubicka  ---
Markus,
I don't seem to be able to train firefox with current tree because of unrelated
issues.  If you would have chance to test the patch on your setup, it would be
cool.


[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2015-01-19 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

--- Comment #9 from Markus Trippelsdorf  ---
I will give your patch a try.
In case it might help here's the script I use for LTO/PGO
(as you can see it starts the instrumented browser. I then
just visit a couple of webpages to train it):

markus@x4 mozilla-central % cat profile_build
#!/bin/zsh
mv .mozconfig .mozconfig_tmp && 
cp .mozconfig_profile_gen .mozconfig && 
nice -n 19 make -f client.mk && 
killall firefox 
/var/tmp/moz-build-dir/dist/bin/firefox && 
rm  /var/tmp/moz-build-dir/**/Makefile && 
rm  /var/tmp/moz-build-dir/**/*.o && 
rm  /var/tmp/moz-build-dir/**/config.status && 
rm  /var/tmp/moz-build-dir/**/configure.pkl && 
cp .mozconfig_profile_use .mozconfig && 
nice -n 19 make -f client.mk && 
make DESTDIR=/var/tmp/firefox-destdir -C /var/tmp/moz-build-dir install && 
rm -fr /var/tmp/moz-build-dir 
mv .mozconfig_tmp .mozconfig

Where .mozconfig_profile_gen contains:
export CFLAGS="-march=native -fno-semantic-interposition -ffunction-sections
-fdata-sections" 
export CXXFLAGS="-march=native -fno-semantic-interposition -fprofile-generate
-ffunction-sections -fdata-sections"

and .mozconfig_profile_use contains:
export CFLAGS="-march=native -fno-semantic-interposition -ffunction-sections
-fdata-sections"
export CXXFLAGS="-march=native -fno-semantic-interposition -flto=4
-fdevirtualize-at-ltrans -fprofile-use -fprofile-correction -ffunction-sections
-fdata-sections"


[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2015-01-20 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

--- Comment #10 from Markus Trippelsdorf  ---
Unfortunately your patch dosen't work:

lto1: internal compiler error: Segmentation fault
0xa12f6f crash_signal
../../gcc/gcc/toplev.c:381
0x88b190 ipa_merge_profiles(cgraph_node*, cgraph_node*)
../../gcc/gcc/ipa-utils.c:637
0x603722 lto_cgraph_replace_node
../../gcc/gcc/lto/lto-symtab.c:124
0x604cf3 lto_symtab_merge_symbols_1
../../gcc/gcc/lto/lto-symtab.c:619
0x604cf3 lto_symtab_merge_symbols()
../../gcc/gcc/lto/lto-symtab.c:647
0x5fa52e read_cgraph_and_symbols
../../gcc/gcc/lto/lto.c:3109
0x5fa52e lto_main()
../../gcc/gcc/lto/lto.c:3436
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instruction


[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2015-01-20 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

--- Comment #11 from Markus Trippelsdorf  ---
And if I try the obvious fix:

637   else if (e2 && e2->speculative)

I hit the assert in ipa-inline.c later on:

lto1: internal compiler error: in edge_badness, at ipa-inline.c:912
0x100bf73 edge_badness
../../gcc/gcc/ipa-inline.c:912
0x100f005 update_edge_key
../../gcc/gcc/ipa-inline.c:1038
0x100f005 inline_small_functions
../../gcc/gcc/ipa-inline.c:1608
0x10117ba ipa_inline
../../gcc/gcc/ipa-inline.c:2179
0x10117ba execute
../../gcc/gcc/ipa-inline.c:2551
Please submit a full bug report,
with preprocessed source if appropriate.


[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2015-01-20 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

--- Comment #12 from Markus Trippelsdorf  ---
Martin pointed out that the assertion gets also hit in a pure LTO Firefox
build.
See PR64686.

When I comment out that assertion, Firefox LTO/PGO now builds fine with your
patch and the trivial fix from comment 11.


[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2015-01-20 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

--- Comment #13 from Jan Hubicka  ---
Author: hubicka
Date: Tue Jan 20 20:03:23 2015
New Revision: 219910

URL: https://gcc.gnu.org/viewcvs?rev=219910&root=gcc&view=rev
Log:
PR ipa/63576
* ipa-utils.c (ipa_merge_profiles): Merge speculative edges.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-utils.c


[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2015-01-21 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #14 from Markus Trippelsdorf  ---
Fixed. Thanks.


[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2014-10-19 Thread mliska at suse dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

--- Comment #1 from Martin Liška  ---
Do you have Honza an idea how to handle correctly situation, where ipa_profile
is called before IPA ICF and we mark speculative an edge in:

#0  cgraph_edge::make_speculative (this=this@entry=0x769e8c98,
n2=0x76933468, direct_count=1776, direct_frequency=) at
../../gcc/cgraph.c:1027
#1  0x00844d6f in ipa_profile () at ../../gcc/ipa-profile.c:641
#2  (anonymous namespace)::pass_ipa_profile::execute (this=) at
../../gcc/ipa-profile.c:742
#3  0x0091bee2 in execute_one_pass (pass=pass@entry=0x1bc76b0) at
../../gcc/passes.c:2155
#4  0x0091cbc2 in execute_ipa_pass_list (pass=0x1bc76b0) at
../../gcc/passes.c:2545
#5  0x005e222b in do_whole_program_analysis () at
../../gcc/lto/lto.c:3253
#6  0x005e25e6 in lto_main () at ../../gcc/lto/lto.c:3431
#7  0x009d48f2 in compile_file () at ../../gcc/toplev.c:555
#8  0x009d6bdf in do_compile () at ../../gcc/toplev.c:1977
#9  toplev_main (argc=28, argv=0x1ba4970) at ../../gcc/toplev.c:2053
#10 0x012140dc in main (argc=26, argv=0x7fffdd38) at
../../gcc/main.c:36

Thank you,
Martin

[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2014-10-19 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

Jan Hubicka  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #2 from Jan Hubicka  ---
speculative edges come in pairs (direct, indirect edge) that is obtained by
speculative_call_info.  THen you need to sum counts (instead of taking ones
from BB) and turn them back to frequencies (because it is profile only counts
should be non-0)


[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2014-10-20 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |5.0


[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2014-10-27 Thread i.palachev at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

Ilya Palachev  changed:

   What|Removed |Added

 CC||i.palachev at samsung dot com

--- Comment #3 from Ilya Palachev  ---
(In reply to Jan Hubicka from comment #2)
> speculative edges come in pairs (direct, indirect edge) that is obtained by
> speculative_call_info.  THen you need to sum counts (instead of taking ones
> from BB) and turn them back to frequencies (because it is profile only
> counts should be non-0)

Suggested patch https://gcc.gnu.org/ml/gcc-patches/2014-10/msg02764.html

Jan, so you mean that counts from BBs and counts from speculative edges should
be  sumed?


[Bug ipa/63576] [5 Regression] ICE : in ipa_merge_profiles, at ipa-utils.c:540 during Firefox LTO/PGO build

2014-11-20 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63576

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1