[Bug rtl-optimization/80747] [6/7/8 Regression] gcc.dg/tree-ssa/tailrecursion-4.c fails with ICE when compiled with options "-fprofile-use -freorder-blocks-and-partition"

2017-12-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80747

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Thu Dec 21 19:28:10 2017
New Revision: 255954

URL: https://gcc.gnu.org/viewcvs?rev=255954=gcc=rev
Log:
PR rtl-optimization/80747
PR rtl-optimization/83512
* cfgrtl.c (force_nonfallthru_and_redirect): When splitting
succ edge from ENTRY, copy partition from e->dest to the newly
created bb.
* bb-reorder.c (reorder_basic_blocks_simple): If last_tail is
ENTRY, use BB_PARTITION of its successor block as current_partition.
Don't copy partition when splitting succ edge from ENTRY.

* gcc.dg/pr80747.c: New test.
* gcc.dg/pr83512.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr80747.c
trunk/gcc/testsuite/gcc.dg/pr83512.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/bb-reorder.c
trunk/gcc/cfgrtl.c
trunk/gcc/testsuite/ChangeLog

[Bug rtl-optimization/80747] [6/7/8 Regression] gcc.dg/tree-ssa/tailrecursion-4.c fails with ICE when compiled with options "-fprofile-use -freorder-blocks-and-partition"

2017-12-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80747

Jakub Jelinek  changed:

   What|Removed |Added

 CC||asolokha at gmx dot com

--- Comment #7 from Jakub Jelinek  ---
*** Bug 83512 has been marked as a duplicate of this bug. ***

[Bug rtl-optimization/80747] [6/7/8 Regression] gcc.dg/tree-ssa/tailrecursion-4.c fails with ICE when compiled with options "-fprofile-use -freorder-blocks-and-partition"

2017-12-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80747

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #6 from Jakub Jelinek  ---
Created attachment 42948
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42948=edit
gcc8-pr80747.patch

Untested fix.  I actually think instead of having some magic default we should,
in case we need to ignore the ENTRY succ edge in the greedy algorithm and thus
last_tail remains ENTRY, use the partition of the ENTRY successor bb.

And there is another bug that we don't copy the partition early enough and thus
create EDGE_CROSSING and mark the jump as crossing, then we copy the partition,
but nothing undoes the edge flags set to EDGE_CROSSING or CROSSING_JUMP_P on
the jump.

[Bug rtl-optimization/80747] [6/7/8 Regression] gcc.dg/tree-ssa/tailrecursion-4.c fails with ICE when compiled with options "-fprofile-use -freorder-blocks-and-partition"

2017-12-11 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80747

Jeffrey A. Law  changed:

   What|Removed |Added

 CC||law at redhat dot com

--- Comment #5 from Jeffrey A. Law  ---
Still a problem on the trunk.  The attached patches doesn't seem to actually
fix the problem.

[Bug rtl-optimization/80747] [6/7/8 Regression] gcc.dg/tree-ssa/tailrecursion-4.c fails with ICE when compiled with options "-fprofile-use -freorder-blocks-and-partition"

2017-07-25 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80747

Richard Biener  changed:

   What|Removed |Added

 Target|mips-sde-elf|mips-sde-elf, x86_64-*-*
   Priority|P3  |P2
   Last reconfirmed|2017-05-15 00:00:00 |2017-7-25
 CC||hubicka at gcc dot gnu.org

--- Comment #4 from Richard Biener  ---
Honza?  You were looking into hot/cold partition issues lately.

Re-confirmed on trunk x86_64.

[Bug rtl-optimization/80747] [6/7/8 Regression] gcc.dg/tree-ssa/tailrecursion-4.c fails with ICE when compiled with options "-fprofile-use -freorder-blocks-and-partition"

2017-07-25 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80747

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |6.5

[Bug rtl-optimization/80747] [6/7/8 Regression] gcc.dg/tree-ssa/tailrecursion-4.c fails with ICE when compiled with options "-fprofile-use -freorder-blocks-and-partition"

2017-05-15 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80747

--- Comment #3 from Segher Boessenkool  ---
Hi Zhangwen,

That patch looks correct.  The explanation maybe not: the problem happens
if the earliest "end" is the entry block itself, not a real BB (that is,
if we start the function with a newly inserted jump).  We could detect
just that, and/or we can add some extra asserts; or do as in your patch,
that looks fine to me as well.

A few minor comments for when you submit the patch:

-- It is spelled "default", not "defualt";
-- We don't use "yoda conditions" in GCC ("0 == x");
-- You shouldn't use 0 but instead use BB_UNPARTITIONED.

Thanks for finding the problem and making a patch!

[Bug rtl-optimization/80747] [6/7/8 Regression] gcc.dg/tree-ssa/tailrecursion-4.c fails with ICE when compiled with options "-fprofile-use -freorder-blocks-and-partition"

2017-05-15 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80747

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-05-15
 CC||marxin at gcc dot gnu.org,
   ||segher at gcc dot gnu.org
Summary|gcc.dg/tree-ssa/tailrecursi |[6/7/8 Regression]
   |on-4.c fails with ICE when  |gcc.dg/tree-ssa/tailrecursi
   |compiled with options   |on-4.c fails with ICE when
   |"-fprofile-use  |compiled with options
   |-freorder-blocks-and-partit |"-fprofile-use
   |ion"|-freorder-blocks-and-partit
   ||ion"
 Ever confirmed|0   |1

--- Comment #2 from Martin Liška  ---
Confirmed, started with r228318 and can be reproduced on x86_64-linux-gnu.