[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-25 Thread tejohnson at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #27 from tejohnson at gcc dot gnu.org ---
Author: tejohnson
Date: Tue Nov 26 03:48:06 2013
New Revision: 205378

URL: http://gcc.gnu.org/viewcvs?rev=205378root=gccview=rev
Log:
Backport a variety of profile maintanance fixes from trunk to google/4_8:
r203041 r203126 r203152 r203395 r203823 r203830 r204178 r204704 r204756
r197595 198416 202128


r203041 | law | 2013-09-30 13:09:25 -0700 (Mon, 30 Sep 2013) | 7 lines

2013-09-30  Teresa Johnson  tejohn...@google.com

* tree-ssa-threadupdate.c (ssa_fix_duplicate_block_edges):
Update redirected out edge count in joiner case.
(ssa_redirect_edges): Common the joiner and non-joiner cases
so that joiner case gets profile updates.


r203126 | tejohnson | 2013-10-02 12:18:17 -0700 (Wed, 02 Oct 2013) | 18 lines

2013-10-02  Teresa Johnson  tejohn...@google.com

* dojump.c (do_jump_1): Divide probability between
both conditions of a TRUTH_ORIF_EXPR.



r203152 | tejohnson | 2013-10-02 22:06:05 -0700 (Wed, 02 Oct 2013) | 8 lines

2013-10-02  Teresa Johnson  tejohn...@google.com

* predict.c (probably_never_executed): New function.
(probably_never_executed_bb_p): Invoke probably_never_executed.
(probably_never_executed_edge_p): Ditto.
* bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges):
Treat profile insanities conservatively.



r203395 | tejohnson | 2013-10-10 13:30:08 -0700 (Thu, 10 Oct 2013) | 9 lines

2013-10-10  Teresa Johnson  tejohn...@google.com

* predict.c (tree_estimate_probability): Add new parameter
for estimate_bb_frequencies.
(estimate_bb_frequencies): Add new parameter to force estimation.
(rebuild_frequencies): When max frequency in function is small,
recompute counts from frequencies.
* predict.h (estimate_bb_frequencies): New parameter.



r203823 | tejohnson | 2013-10-18 07:36:53 -0700 (Fri, 18 Oct 2013) | 5 lines

2013-10-18  Teresa Johnson  tejohn...@google.com

* tree-ssa-tail-merge.c (replace_block_by): Update edge
weights during merging.



r203830 | tejohnson | 2013-10-18 10:25:44 -0700 (Fri, 18 Oct 2013) | 6 lines

2013-10-18  Teresa Johnson  tejohn...@google.com

* predict.c (probably_never_executed): Compare frequency-based
count to number of training runs.
* params.def (UNLIKELY_BB_COUNT_FRACTION): New parameter.



r204178 | tejohnson | 2013-10-29 13:39:49 -0700 (Tue, 29 Oct 2013) | 6 lines

2013-10-29  Teresa Johnson  tejohn...@google.com

PR ipa/58862
* tree-ssa-tail-merge.c (replace_block_by): Tolerate profile
insanities when updating probabilities.



r204704 | tejohnson | 2013-11-12 07:03:28 -0800 (Tue, 12 Nov 2013) | 12 lines

2013-11-12  Teresa Johnson  tejohn...@google.com
Jan Hubicka  j...@suse.cz

* predict.c (drop_profile): New function.
(handle_missing_profiles): Ditto.
(counts_to_freqs): Don't overwrite estimated frequencies
when function has no profile counts.
* predict.h (handle_missing_profiles): Declare.
* tree-inline.c (freqs_to_counts): New function.
(copy_cfg_body): Invoke freqs_to_counts as needed.
* tree-profile.c (tree_profiling): Invoke handle_missing_profiles.



r204756 | tejohnson | 2013-11-13 13:51:44 -0800 (Wed, 13 Nov 2013) | 6 lines

2013-11-13  Teresa Johnson  tejohn...@google.com

PR ipa/58862
* predict.c (drop_profile): Error is currently too strict.
(handle_missing_profiles): Pass call_count to drop_profile.



r197595 | tejohnson | 2013-04-08 10:39:10 -0700 (Mon, 08 Apr 2013) | 60 lines

2013-04-08  Teresa Johnson  

[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-13 Thread tejohnson at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #24 from tejohnson at gcc dot gnu.org ---
Author: tejohnson
Date: Wed Nov 13 21:48:59 2013
New Revision: 204755

URL: http://gcc.gnu.org/viewcvs?rev=204755root=gccview=rev
Log:
2013-11-13  Teresa Johnson  tejohn...@google.com

PR ipa/58862
* ipa-inline.c (edge_badness): Fix overflow.

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


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-13 Thread tejohnson at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #25 from tejohnson at gcc dot gnu.org ---
Author: tejohnson
Date: Wed Nov 13 21:51:44 2013
New Revision: 204756

URL: http://gcc.gnu.org/viewcvs?rev=204756root=gccview=rev
Log:
2013-11-13  Teresa Johnson  tejohn...@google.com

PR ipa/58862
* predict.c (drop_profile): Error is currently too strict.
(handle_missing_profiles): Pass call_count to drop_profile.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/predict.c


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-13 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

Uroš Bizjak ubizjak at gmail dot com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #26 from Uroš Bizjak ubizjak at gmail dot com ---
Fixed.

[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-12 Thread tejohnson at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #19 from Teresa Johnson tejohnson at google dot com ---
On Mon, Nov 4, 2013 at 11:11 AM, tejohnson at google dot com
gcc-bugzi...@gcc.gnu.org wrote:
 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

 --- Comment #18 from Teresa Johnson tejohnson at google dot com ---
 Just hit this same error with cpu2006 bzip2. The .i and .gcda are attached.
 Reproduce with:

 gcc -c -fprofile-use -O2 blocksort.i

 blocksort.c:1136:1: internal compiler error: in edge_badness, at
 ipa-inline.c:1011
  }
  ^
 0xe13caa edge_badness
 /usr/local/google/home/tejohnson/gcc_trunk_1/gcc/ipa-inline.c:1011
 0xe16935 update_edge_key
 /usr/local/google/home/tejohnson/gcc_trunk_1/gcc/ipa-inline.c:1024
 0xe16935 inline_small_functions
 /usr/local/google/home/tejohnson/gcc_trunk_1/gcc/ipa-inline.c:1610
 0xe16935 ipa_inline
 /usr/local/google/home/tejohnson/gcc_trunk_1/gcc/ipa-inline.c:2015
 0xe16935 execute
 /usr/local/google/home/tejohnson/gcc_trunk_1/gcc/ipa-inline.c:2385
 Please submit a full bug report,


 Teresa

Since this was blocking my SPEC testing I took a look. The issue is
that the new edge_count variable is declared as an int and is
overflowing. It should be gcov_type. Here is the patch that fixed the
bzip2 failure. I will run regression and lto bootstrap testing on it:

2013-11-12  Teresa Johnson  tejohn...@google.com

PR ipa/58862
* ipa-inline.c (edge_badness): Fix overflow.

Index: ipa-inline.c
===
--- ipa-inline.c(revision 204703)
+++ ipa-inline.c(working copy)
@@ -909,7 +909,7 @@ edge_badness (struct cgraph_edge *edge, bool dump)
   /* Capping edge-count to max_count. edge-count can be larger than
 max_count if an inline adds new edges which increase max_count
 after max_count is computed.  */
-  int edge_count = edge-count  max_count ? max_count : edge-count;
+  gcov_type edge_count = edge-count  max_count ? max_count :
edge-count;

   sreal_init (relbenefit_real, relbenefit, 0);
   sreal_init (growth_real, growth, 0);


Teresa


 --
 You are receiving this mail because:
 You are on the CC list for the bug.


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-12 Thread pa...@matos-sorge.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #20 from Paulo J. Matos pa...@matos-sorge.com ---
Thanks for fixing this.


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-12 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #21 from Uroš Bizjak ubizjak at gmail dot com ---
Created attachment 31200
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=31200action=edit
libiberty patch to push lto-profiledbootstrap further

Additional patch to libiberty to fix some c++ casting warnings/errors.

[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-12 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #22 from Uroš Bizjak ubizjak at gmail dot com ---
(In reply to Teresa Johnson from comment #19)

 Since this was blocking my SPEC testing I took a look. The issue is
 that the new edge_count variable is declared as an int and is
 overflowing. It should be gcov_type. Here is the patch that fixed the
 bzip2 failure. I will run regression and lto bootstrap testing on it:

You will need additional patch to libiberty to push the lto-profiledbootstrap
further.

Unfortunately, the lto profiledbootstrap will later die in stagefeedback with:

  /ssd/uros/gcc-build-profiled/./prev-gcc/xgcc
-B/ssd/uros/gcc-build-profiled/./prev-gcc/
-B/usr/local/x86_64-unknown-linux-gnu/bin/
-B/usr/local/x86_64-unknown-linux-gnu/bin/
-B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem
/usr/local/x86_64-unknown-linux-gnu/include -isystem
/usr/local/x86_64-unknown-linux-gnu/sys-include-c -DHAVE_CONFIG_H -g -O2
-flto=jobserver -frandom-seed=1 -fprofile-use  -I.
-I/home/uros/gcc-svn/trunk/libiberty/../include  -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic  -fpic
/home/uros/gcc-svn/trunk/libiberty/pex-unix.c -o pic/pex-unix.o; \
else true; fi
if [ x-fpic != x ]; then \
/home/uros/gcc-svn/trunk/libiberty/pex-unix.c:790:1: error: Missing counts for
called function pex_child_error.isra.1/75
 }
 ^
gmake[3]: *** [pex-unix.o] Error 1
gmake[3]: *** Waiting for unfinished jobs
gmake[2]: *** [all-stagefeedback-libiberty] Error 2
gmake[2]: *** Waiting for unfinished jobs
gmake[2]: Leaving directory `/ssd/uros/gcc-build-profiled'
gmake[1]: *** [stagefeedback-bubble] Error 2
gmake[1]: Leaving directory `/ssd/uros/gcc-build-profiled'
gmake: *** [profiledbootstrap] Error 2

[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-12 Thread tejohnson at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #23 from Teresa Johnson tejohnson at google dot com ---
On Tue, Nov 12, 2013 at 11:06 AM, ubizjak at gmail dot com
gcc-bugzi...@gcc.gnu.org wrote:
 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

 --- Comment #22 from Uroš Bizjak ubizjak at gmail dot com ---
 (In reply to Teresa Johnson from comment #19)

 Since this was blocking my SPEC testing I took a look. The issue is
 that the new edge_count variable is declared as an int and is
 overflowing. It should be gcov_type. Here is the patch that fixed the
 bzip2 failure. I will run regression and lto bootstrap testing on it:

 You will need additional patch to libiberty to push the lto-profiledbootstrap
 further.

 Unfortunately, the lto profiledbootstrap will later die in stagefeedback with:

   /ssd/uros/gcc-build-profiled/./prev-gcc/xgcc
 -B/ssd/uros/gcc-build-profiled/./prev-gcc/
 -B/usr/local/x86_64-unknown-linux-gnu/bin/
 -B/usr/local/x86_64-unknown-linux-gnu/bin/
 -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem
 /usr/local/x86_64-unknown-linux-gnu/include -isystem
 /usr/local/x86_64-unknown-linux-gnu/sys-include-c -DHAVE_CONFIG_H -g -O2
 -flto=jobserver -frandom-seed=1 -fprofile-use  -I.
 -I/home/uros/gcc-svn/trunk/libiberty/../include  -W -Wall -Wwrite-strings
 -Wc++-compat -Wstrict-prototypes -pedantic  -fpic
 /home/uros/gcc-svn/trunk/libiberty/pex-unix.c -o pic/pex-unix.o; \
 else true; fi
 if [ x-fpic != x ]; then \
 /home/uros/gcc-svn/trunk/libiberty/pex-unix.c:790:1: error: Missing counts for
 called function pex_child_error.isra.1/75
  }
  ^
 gmake[3]: *** [pex-unix.o] Error 1
 gmake[3]: *** Waiting for unfinished jobs
 gmake[2]: *** [all-stagefeedback-libiberty] Error 2
 gmake[2]: *** Waiting for unfinished jobs
 gmake[2]: Leaving directory `/ssd/uros/gcc-build-profiled'
 gmake[1]: *** [stagefeedback-bubble] Error 2
 gmake[1]: Leaving directory `/ssd/uros/gcc-build-profiled'
 gmake: *** [profiledbootstrap] Error 2

Yep, I just hit this myself while testing the badness overflow fix. It
is due to my own patch and I just sent a fix to gcc-patches for it -
this should be made into a warning for now.

Teresa


 --
 You are receiving this mail because:
 You are on the CC list for the bug.

[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-04 Thread tejohnson at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #16 from Teresa Johnson tejohnson at google dot com ---
Created attachment 31154
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=31154action=edit
blocksort.i


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-04 Thread tejohnson at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #17 from Teresa Johnson tejohnson at google dot com ---
Created attachment 31155
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=31155action=edit
blocksort.gcda


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-04 Thread tejohnson at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #18 from Teresa Johnson tejohnson at google dot com ---
Just hit this same error with cpu2006 bzip2. The .i and .gcda are attached.
Reproduce with:

gcc -c -fprofile-use -O2 blocksort.i

blocksort.c:1136:1: internal compiler error: in edge_badness, at
ipa-inline.c:1011
 }
 ^
0xe13caa edge_badness
/usr/local/google/home/tejohnson/gcc_trunk_1/gcc/ipa-inline.c:1011
0xe16935 update_edge_key
/usr/local/google/home/tejohnson/gcc_trunk_1/gcc/ipa-inline.c:1024
0xe16935 inline_small_functions
/usr/local/google/home/tejohnson/gcc_trunk_1/gcc/ipa-inline.c:1610
0xe16935 ipa_inline
/usr/local/google/home/tejohnson/gcc_trunk_1/gcc/ipa-inline.c:2015
0xe16935 execute
/usr/local/google/home/tejohnson/gcc_trunk_1/gcc/ipa-inline.c:2385
Please submit a full bug report,


Teresa


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-03 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #15 from Uroš Bizjak ubizjak at gmail dot com ---
On Sun, Nov 3, 2013 at 6:54 AM, pa...@matos-sorge.com
gcc-bugzi...@gcc.gnu.org wrote:

 --- Comment #14 from Paulo J. Matos pa...@matos-sorge.com ---
 (In reply to Uroš Bizjak from comment #13)
 (In reply to Paulo J. Matos from comment #9)

  Unfortunately running one of these takes a long time so it's a slow process
  to check it out since as far as I am aware it's not possible to use a
  parallel build. Do let me know if there's a fast way to build it.
 
  I will keep investigating.

 Have you been able to trigger the ICE following the instructions in Comment
 12?

 No, not yet. Is that through a profiledbootstrap on HEAD?

Yes, but I was able to trigger the ICE using a couple of days old
normal lto1 on the object files.

[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-02 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #13 from Uroš Bizjak ubizjak at gmail dot com ---
(In reply to Paulo J. Matos from comment #9)

 Unfortunately running one of these takes a long time so it's a slow process
 to check it out since as far as I am aware it's not possible to use a
 parallel build. Do let me know if there's a fast way to build it. 
 
 I will keep investigating.

Have you been able to trigger the ICE following the instructions in Comment 12?

[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-02 Thread pa...@matos-sorge.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #14 from Paulo J. Matos pa...@matos-sorge.com ---
(In reply to Uroš Bizjak from comment #13)
 (In reply to Paulo J. Matos from comment #9)
  
  Unfortunately running one of these takes a long time so it's a slow process
  to check it out since as far as I am aware it's not possible to use a
  parallel build. Do let me know if there's a fast way to build it. 
  
  I will keep investigating.
 
 Have you been able to trigger the ICE following the instructions in Comment
 12?

No, not yet. Is that through a profiledbootstrap on HEAD?

[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-01 Thread pa...@matos-sorge.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #9 from Paulo J. Matos pa...@matos-sorge.com ---
I didn't manage to reproduce the bug yet. With the git sha before my commit
4bc0f16, I get the following on a profiledbootstrap on x64:

insn-opinit.c: In function 'void init_all_optabs(target_optabs*)':
insn-opinit.c:1234:1: error: verify_flow_info: Wrong probability of edge
1437-2606 66380
 init_all_optabs (struct target_optabs *optabs)
 ^
insn-opinit.c:1234:1: error: verify_flow_info: Wrong probability of edge
1427-2598 66380
insn-opinit.c:1234:1: internal compiler error: verify_flow_info failed
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.

Unfortunately running one of these takes a long time so it's a slow process to
check it out since as far as I am aware it's not possible to use a parallel
build. Do let me know if there's a fast way to build it. 

I will keep investigating.


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-01 Thread tejohnson at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #10 from Teresa Johnson tejohnson at google dot com ---
On Fri, Nov 1, 2013 at 10:01 AM, pa...@matos-sorge.com
gcc-bugzi...@gcc.gnu.org wrote:
 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

 --- Comment #9 from Paulo J. Matos pa...@matos-sorge.com ---
 I didn't manage to reproduce the bug yet. With the git sha before my commit
 4bc0f16, I get the following on a profiledbootstrap on x64:

 insn-opinit.c: In function 'void init_all_optabs(target_optabs*)':
 insn-opinit.c:1234:1: error: verify_flow_info: Wrong probability of edge
 1437-2606 66380
  init_all_optabs (struct target_optabs *optabs)
  ^
 insn-opinit.c:1234:1: error: verify_flow_info: Wrong probability of edge
 1427-2598 66380
 insn-opinit.c:1234:1: internal compiler error: verify_flow_info failed
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See http://gcc.gnu.org/bugs.html for instructions.

The above was introduced by r203823, and fixed by r204178. Doesn't
show up with a normal profiledbootstrap, but apparently does with an
lto-profiledbootstrap (going by the above report, haven't confirmed
this myself).

Thanks,
Teresa


 Unfortunately running one of these takes a long time so it's a slow process to
 check it out since as far as I am aware it's not possible to use a parallel
 build. Do let me know if there's a fast way to build it.

 I will keep investigating.

 --
 You are receiving this mail because:
 You are on the CC list for the bug.


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-01 Thread tejohnson at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #11 from Teresa Johnson tejohnson at google dot com ---
On Fri, Nov 1, 2013 at 10:14 AM, Teresa Johnson tejohn...@google.com wrote:
 On Fri, Nov 1, 2013 at 10:01 AM, pa...@matos-sorge.com
 gcc-bugzi...@gcc.gnu.org wrote:
 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

 --- Comment #9 from Paulo J. Matos pa...@matos-sorge.com ---
 I didn't manage to reproduce the bug yet. With the git sha before my commit
 4bc0f16, I get the following on a profiledbootstrap on x64:

 insn-opinit.c: In function 'void init_all_optabs(target_optabs*)':
 insn-opinit.c:1234:1: error: verify_flow_info: Wrong probability of edge
 1437-2606 66380
  init_all_optabs (struct target_optabs *optabs)
  ^
 insn-opinit.c:1234:1: error: verify_flow_info: Wrong probability of edge
 1427-2598 66380
 insn-opinit.c:1234:1: internal compiler error: verify_flow_info failed
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See http://gcc.gnu.org/bugs.html for instructions.

 The above was introduced by r203823, and fixed by r204178. Doesn't
 show up with a normal profiledbootstrap, but apparently does with an
 lto-profiledbootstrap (going by the above report, haven't confirmed
 this myself).

On re-reading this I wasn't very clear. I mean that the current
failure on edge badness doesn't show up with a normal
profiledbootstrap, but apparently does with an lto-profiledbootstrap
(going by the above report, haven't confirmed this myself).

The probability issue occurred even with a normal profiledbootstrap,
but is fixed now.

Teresa


 Thanks,
 Teresa


 Unfortunately running one of these takes a long time so it's a slow process 
 to
 check it out since as far as I am aware it's not possible to use a parallel
 build. Do let me know if there's a fast way to build it.

 I will keep investigating.

 --
 You are receiving this mail because:
 You are on the CC list for the bug.



 --
 Teresa Johnson | Software Engineer | tejohn...@google.com | 408-460-2413


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-11-01 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #12 from Uroš Bizjak ubizjak at gmail dot com ---
Untar the file from the link [1] to a temp dir, go to the gcc directory in the
temp dir and type:

path-to-gcc-build-dir/gcc/lto1 @ccBysEru.args

Reading object files: build/genmddeps.o build/read-md.o build/errors.o
.././libiberty/libiberty.a@0x183c82 .././libiberty/libiberty.a@0x1f8142
.././libiberty/libiberty.a@0x207f4e .././libiberty/libiberty.a@0x22e3be
.././libiberty/libiberty.a@0x286fce .././libiberty/libiberty.a@0x345dbe
.././libiberty/libiberty.a@0x34e386 .././libiberty/libiberty.a@0x3538de
.././libiberty/libiberty.a@0x34394a
Reading the callgraph
Merging declarations
Reading summaries
Materializing decls:
 whole-program profile_estimate cp cdtor inlinelto1: internal
compiler error: in edge_badness, at ipa-inline.c:1011
0xd598ea edge_badness
/home/uros/gcc-svn/trunk/gcc/ipa-inline.c:1011
0xd5c575 update_edge_key
/home/uros/gcc-svn/trunk/gcc/ipa-inline.c:1024
0xd5c575 inline_small_functions
/home/uros/gcc-svn/trunk/gcc/ipa-inline.c:1610
0xd5c575 ipa_inline
/home/uros/gcc-svn/trunk/gcc/ipa-inline.c:2015
0xd5c575 execute
/home/uros/gcc-svn/trunk/gcc/ipa-inline.c:2385
Please submit a full bug report,

Using gdb:

#2  0x00d598eb in edge_badness (edge=0x71a45e38, dump=optimized
out) at /home/uros/gcc-svn/trunk/gcc/ipa-inline.c:1011
1011  gcc_assert (badness = INT_MIN);

(gdb) bt
#0  internal_error (gmsgid=gmsgid@entry=0x114f198 in %s, at %s:%d) at
/home/uros/gcc-svn/trunk/gcc/diagnostic.c:1123
#1  0x00dc7514 in fancy_abort (file=file@entry=0x110da18
/home/uros/gcc-svn/trunk/gcc/ipa-inline.c, line=line@entry=1011, 
function=function@entry=0x110e2ca edge_badness(cgraph_edge*,
bool)::__FUNCTION__ edge_badness) at
/home/uros/gcc-svn/trunk/gcc/diagnostic.c:1183
#2  0x00d598eb in edge_badness (edge=0x71a45e38, dump=optimized
out) at /home/uros/gcc-svn/trunk/gcc/ipa-inline.c:1011
#3  0x00d5c576 in update_edge_key (edge=optimized out,
heap=optimized out) at /home/uros/gcc-svn/trunk/gcc/ipa-inline.c:1024
#4  inline_small_functions () at /home/uros/gcc-svn/trunk/gcc/ipa-inline.c:1610
#5  ipa_inline () at /home/uros/gcc-svn/trunk/gcc/ipa-inline.c:2015
#6  (anonymous namespace)::pass_ipa_inline::execute (this=0x114f198) at
/home/uros/gcc-svn/trunk/gcc/ipa-inline.c:2385
#7  0x007fd2ea in execute_one_pass (pass=pass@entry=0x15cdc00) at
/home/uros/gcc-svn/trunk/gcc/passes.c:2215
#8  0x007fdb7b in execute_ipa_pass_list (pass=0x15cdc00) at
/home/uros/gcc-svn/trunk/gcc/passes.c:2579

(gdb) p badness
$1 = -31503367557611520

[1]
https://drive.google.com/file/d/0BzMiXQxzb9IONVd2UWcxUDBrblE/edit?usp=sharing

[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-10-30 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

Uroš Bizjak ubizjak at gmail dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2013-10-30
 Ever confirmed|0   |1

--- Comment #6 from Uroš Bizjak ubizjak at gmail dot com ---
There is still lto-profiledbootstrap failure reported at r204180+ [1], after
the patch was committed to SVN.

[1] http://gcc.gnu.org/ml/gcc-regression/2013-10/msg00317.html

[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-10-30 Thread tejohnson at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

Teresa Johnson tejohnson at google dot com changed:

   What|Removed |Added

 CC||pmatos at gcc dot gnu.org

--- Comment #7 from Teresa Johnson tejohnson at google dot com ---
This looks like a separate issue from the edge probability issue that I fixed.
The edge probability issue was introduced earlier. Almost certainly due to the
following change, given that you noticed it at r203899 and it is an error about
edge badness:


r203897 | pmatos | 2013-10-21 08:41:46 -0700 (Mon, 21 Oct 2013) | 4 lines
Changed paths:
   M /trunk/gcc/ChangeLog
   M /trunk/gcc/ipa-inline.c

* ipa-inline.c (edge_badness): Cap edge-count at max_count for badness
calculations.




Adding author to cc.

Teresa


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-10-30 Thread pa...@matos-sorge.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

Paulo J. Matos pa...@matos-sorge.com changed:

   What|Removed |Added

 CC||pa...@matos-sorge.com

--- Comment #8 from Paulo J. Matos pa...@matos-sorge.com ---
(In reply to Teresa Johnson from comment #7)
 This looks like a separate issue from the edge probability issue that I
 fixed. The edge probability issue was introduced earlier. Almost certainly
 due to the following change, given that you noticed it at r203899 and it is
 an error about edge badness:
 
 
 r203897 | pmatos | 2013-10-21 08:41:46 -0700 (Mon, 21 Oct 2013) | 4 lines
 Changed paths:
M /trunk/gcc/ChangeLog
M /trunk/gcc/ipa-inline.c
 
 * ipa-inline.c (edge_badness): Cap edge-count at max_count for
 badness
 calculations.
 
 
 
 
 Adding author to cc.
 
 Teresa

Thanks for adding me to CC. I will try to confirm if it was my patch.


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-10-29 Thread tejohnson at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

Teresa Johnson tejohnson at google dot com changed:

   What|Removed |Added

 CC||tejohnson at gcc dot gnu.org,
   ||tejohnson at google dot com

--- Comment #3 from Teresa Johnson tejohnson at google dot com ---
I hit the verify_flow_info: Wrong probability of edge error in a
profiledbootstrap. I triaged this down to the following commit, made by me:


r203823 | tejohnson | 2013-10-18 07:36:53 -0700 (Fri, 18 Oct 2013) | 5 lines
Changed paths:
   M /trunk/gcc/ChangeLog
   M /trunk/gcc/tree-ssa-tail-merge.c

2013-10-18  Teresa Johnson  tejohn...@google.com

* tree-ssa-tail-merge.c (replace_block_by): Update edge
weights during merging.



Investigating right now. Looks like there were profile weight insanities going
into this code, that were magnified by the fixes being performed by my change.
To avoid the error, I need to adjust the change I made to ensure that the
profile insanities don't get propagated into the edge probabilities.

In the case I looked at, the edge weight insanities were originally introduced 
during jump threading. I had previously made a fix to the profile updates being
done by that optimization (r203041, committed by law), but there have been a
number of changes to that code since then so this needs to be revisited.

I will get a fix for the failure though hopefully today.

Thanks,
Teresa


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-10-29 Thread tejohnson at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #4 from Teresa Johnson tejohnson at google dot com ---
On Tue, Oct 29, 2013 at 8:05 AM, tejohnson at google dot com
gcc-bugzi...@gcc.gnu.org wrote:
 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

 Teresa Johnson tejohnson at google dot com changed:

What|Removed |Added
 
  CC||tejohnson at gcc dot gnu.org,
||tejohnson at google dot com

 --- Comment #3 from Teresa Johnson tejohnson at google dot com ---
 I hit the verify_flow_info: Wrong probability of edge error in a
 profiledbootstrap. I triaged this down to the following commit, made by me:

 
 r203823 | tejohnson | 2013-10-18 07:36:53 -0700 (Fri, 18 Oct 2013) | 5 lines
 Changed paths:
M /trunk/gcc/ChangeLog
M /trunk/gcc/tree-ssa-tail-merge.c

 2013-10-18  Teresa Johnson  tejohn...@google.com

 * tree-ssa-tail-merge.c (replace_block_by): Update edge
 weights during merging.

 

 Investigating right now. Looks like there were profile weight insanities going
 into this code, that were magnified by the fixes being performed by my change.
 To avoid the error, I need to adjust the change I made to ensure that the
 profile insanities don't get propagated into the edge probabilities.

 In the case I looked at, the edge weight insanities were originally introduced
 during jump threading. I had previously made a fix to the profile updates 
 being
 done by that optimization (r203041, committed by law), but there have been a
 number of changes to that code since then so this needs to be revisited.

 I will get a fix for the failure though hopefully today.

This patch fixes the profiledbootstrap errors I was looking at.
Testing will a full profiledbootstrap and a regular
bootstrap/regression test run.

2013-10-29  Teresa Johnson  tejohn...@google.com

* tree-ssa-tail-merge.c (replace_block_by): Tolerate profile
insanities when updating probabilities.

Index: tree-ssa-tail-merge.c
===
--- tree-ssa-tail-merge.c   (revision 204166)
+++ tree-ssa-tail-merge.c   (working copy)
@@ -1467,7 +1467,7 @@ static void
 replace_block_by (basic_block bb1, basic_block bb2)
 {
   edge pred_edge;
-  edge e1;
+  edge e1, e2;
   edge_iterator ei;
   unsigned int i;
   gimple bb2_phi;
@@ -1502,16 +1502,22 @@ replace_block_by (basic_block bb1, basic_block bb2
   bb2-count += bb1-count;

   /* Merge the outgoing edge counts from bb1 onto bb2.  */
+  gcov_type out_sum = 0;
   FOR_EACH_EDGE (e1, ei, bb1-succs)
 {
-  edge e2;
   e2 = find_edge (bb2, e1-dest);
   gcc_assert (e2);
   e2-count += e1-count;
-  /* Recompute the probability from the new merged edge count (bb2-count
- was updated above).  */
-  e2-probability = GCOV_COMPUTE_SCALE (e2-count, bb2-count);
+  out_sum += e2-count;
 }
+  /* Recompute the edge probabilities from the new merged edge count.
+ Use the sum of the new merged edge counts computed above instead
+ of bb2's merged count, in case there are profile count insanities
+ making the bb count inconsistent with the edge weights.  */
+  FOR_EACH_EDGE (e2, ei, bb2-succs)
+{
+  e2-probability = GCOV_COMPUTE_SCALE (e2-count, out_sum);
+}

   /* Do updates that use bb1, before deleting bb1.  */
   release_last_vdef (bb1);


 Thanks,
 Teresa

 --
 You are receiving this mail because:
 You are on the CC list for the bug.


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-10-29 Thread tejohnson at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

--- Comment #5 from tejohnson at gcc dot gnu.org ---
Author: tejohnson
Date: Tue Oct 29 20:39:49 2013
New Revision: 204178

URL: http://gcc.gnu.org/viewcvs?rev=204178root=gccview=rev
Log:
2013-10-29  Teresa Johnson  tejohn...@google.com

PR ipa/58862
* tree-ssa-tail-merge.c (replace_block_by): Tolerate profile
insanities when updating probabilities.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-ssa-tail-merge.c


[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-10-24 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

Uroš Bizjak ubizjak at gmail dot com changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org
Summary|LTO profiledbootstrap   |[4.9 Regression] LTO
   |failure: lto1: ICE in   |profiledbootstrap failure:
   |edge_badness, at|lto1: ICE in edge_badness,
   |ipa-inline.c:1008   |at ipa-inline.c:1008

--- Comment #2 from Uroš Bizjak ubizjak at gmail dot com ---
The failure perist as of revision 204007. Adding CC.

[Bug ipa/58862] [4.9 Regression] LTO profiledbootstrap failure: lto1: ICE in edge_badness, at ipa-inline.c:1008

2013-10-24 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58862

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |4.9.0