[Bug middle-end/64083] [5 Regression] ICE: in fix_loop_structure, at loop-init.c:252 compiling Linux Kernel

2015-03-05 Thread yroux at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64083

--- Comment #6 from Yvan Roux yroux at gcc dot gnu.org ---
Author: yroux
Date: Thu Mar  5 14:28:05 2015
New Revision: 221216

URL: https://gcc.gnu.org/viewcvs?rev=221216root=gccview=rev
Log:
gcc/
2015-03-05  Yvan Roux  yvan.r...@linaro.org

Backport from trunk r212011, r214942, r214957, r215012, r215016, r218115,
r218733, r218746, r220491.
2015-02-06  Sebastian Pop  s@samsung.com
Brian Rzycki  b.rzy...@samsung.com

PR tree-optimization/64878
* tree-ssa-threadedge.c: Include tree-ssa-loop.h.
(fsm_find_control_statement_thread_paths): Add parameter seen_loop_phi.
Stop recursion at loop phi nodes after having visited a loop phi node.

2014-12-15  Richard Biener  rguent...@suse.de

PR middle-end/64246
* cfgloop.c (mark_loop_for_removal): Make safe against multiple
invocations on the same loop.

2014-12-15  Richard Biener  rguent...@suse.de

PR tree-optimization/64284
* tree-ssa-threadupdate.c (duplicate_seme_region): Mark
the loop for removal if we copied the loop header.

2014-11-27  Richard Biener  rguent...@suse.de

PR tree-optimization/64083
* tree-ssa-threadupdate.c (thread_through_all_blocks): Do not
forcibly mark loop for removal the wrong way.

2014-09-08  Richard Biener  rguent...@suse.de

PR ipa/63196
* tree-inline.c (copy_loops): The source loop header should
always be non-NULL.
(tree_function_versioning): If loops need fixup after removing
unreachable blocks fix them.
* omp-low.c (simd_clone_adjust): Do not add incr block to
loop under construction.

2014-09-08  Richard Biener  rguent...@suse.de

PR bootstrap/63204
* cfgloop.c (mark_loop_for_removal): Track former header
unconditionally.
* cfgloop.h (struct loop): Add former_header member unconditionally.
* loop-init.c (fix_loop_structure): Enable bogus loop removal
diagnostic unconditionally.

2014-09-05  Richard Biener  rguent...@suse.de

* cfgloop.c (mark_loop_for_removal): Record former header
when ENABLE_CHECKING.
* cfgloop.h (strut loop): Add former_header member when
ENABLE_CHECKING.
* loop-init.c (fix_loop_structure): Sanity check loops
marked for removal if they re-appeared.

2014-09-05  Richard Biener  rguent...@suse.de

* cfgloop.c (mark_loop_for_removal): New function.
* cfgloop.h (mark_loop_for_removal): Declare.
* cfghooks.c (delete_basic_block): Use mark_loop_for_removal.
(merge_blocks): Likewise.
(duplicate_block): Likewise.
* except.c (sjlj_emit_dispatch_table): Likewise.
* tree-eh.c (cleanup_empty_eh_merge_phis): Likewise.
* tree-ssa-threadupdate.c (ssa_redirect_edges): Likewise.
(thread_through_loop_header): Likewise.

2014-06-26  Richard Biener  rguent...@suse.de

PR tree-optimization/61607
* tree-ssa-threadupdate.c (ssa_redirect_edges): Cancel the
loop if we redirected its latch edge.
(thread_block_1): Do not cancel loops prematurely.

gcc/testsuite/
2015-03-05  Yvan Roux  yvan.r...@linaro.org

Backport from trunk r218115, r218733, r218746, r220491.
2015-02-06  Sebastian Pop  s@samsung.com
Brian Rzycki  b.rzy...@samsung.com

PR tree-optimization/64878
* testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c: New.

2014-12-15  Richard Biener  rguent...@suse.de

PR middle-end/64246
* gnat.dg/opt46.adb: New testcase.
* gnat.dg/opt46.ads: Likewise.
* gnat.dg/opt46_pkg.adb: Likewise.
* gnat.dg/opt46_pkg.ads: Likewise.

2014-12-15  Richard Biener  rguent...@suse.de

PR tree-optimization/64284
* gcc.dg/torture/pr64284.c: New testcase.

2014-11-27  Richard Biener  rguent...@suse.de

PR tree-optimization/64083
* gcc.dg/torture/pr64083.c: New testcase.


Added:
branches/linaro/gcc-4_9-branch/gcc/testsuite/gcc.dg/torture/pr64083.c
branches/linaro/gcc-4_9-branch/gcc/testsuite/gcc.dg/torture/pr64284.c
   
branches/linaro/gcc-4_9-branch/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c
branches/linaro/gcc-4_9-branch/gcc/testsuite/gnat.dg/opt46.adb
branches/linaro/gcc-4_9-branch/gcc/testsuite/gnat.dg/opt46.ads
branches/linaro/gcc-4_9-branch/gcc/testsuite/gnat.dg/opt46_pkg.adb
branches/linaro/gcc-4_9-branch/gcc/testsuite/gnat.dg/opt46_pkg.ads
Modified:
branches/linaro/gcc-4_9-branch/gcc/ChangeLog.linaro
branches/linaro/gcc-4_9-branch/gcc/cfghooks.c
branches/linaro/gcc-4_9-branch/gcc/cfgloop.c
branches/linaro/gcc-4_9-branch/gcc/cfgloop.h
branches/linaro/gcc-4_9-branch/gcc/except.c
branches/linaro/gcc-4_9-branch/gcc/loop-init.c
branches/linaro/gcc-4_9-branch/gcc/omp-low.c
branches/linaro/gcc-4_9-branch/gcc/testsuite/ChangeLog.linaro
branches/linaro/gcc-4_9-branch/gcc/tree-eh.c
branches/linaro/gcc-4_9-branch/gcc/tree-inline.c
branches/linaro/gcc-4_9-branch/gcc/tree-ssa-threadedge.c

[Bug middle-end/64083] [5 Regression] ICE: in fix_loop_structure, at loop-init.c:252 compiling Linux Kernel

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

--- Comment #5 from Richard Biener rguenth at gcc dot gnu.org ---
Author: rguenth
Date: Thu Nov 27 09:57:13 2014
New Revision: 218115

URL: https://gcc.gnu.org/viewcvs?rev=218115root=gccview=rev
Log:
2014-11-27  Richard Biener  rguent...@suse.de

PR tree-optimization/64083
* tree-ssa-threadupdate.c (thread_through_all_blocks): Do not
forcibly mark loop for removal the wrong way.

* gcc.dg/torture/pr64083.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr64083.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-threadupdate.c


[Bug middle-end/64083] [5 Regression] ICE: in fix_loop_structure, at loop-init.c:252 compiling Linux Kernel

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

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #4 from Richard Biener rguenth at gcc dot gnu.org ---
Fixed.


[Bug middle-end/64083] [5 Regression] ICE: in fix_loop_structure, at loop-init.c:252 compiling Linux Kernel

2014-11-26 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64083

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-11-26
 CC||trippels at gcc dot gnu.org
  Component|c   |middle-end
   Target Milestone|--- |5.0
Summary|ICE compiling Linux Kernel  |[5 Regression] ICE: in
   |drivers/isdn/i4l/isdn_net.c |fix_loop_structure, at
   ||loop-init.c:252 compiling
   ||Linux Kernel
 Ever confirmed|0   |1

--- Comment #1 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
Reduced:

markus@x4 tmp % cat isdn_net.i
int a, b;
void
fn1 ()
{
  int c = 0;
  while (b)
{
  switch (c)
  case 1:
  fn1 ();
  if (a)
c = 1;
  b = 0;
}
}

markus@x4 tmp % gcc -O2 -c isdn_net.i
isdn_net.i: In function ‘fn1’:
isdn_net.i:3:1: internal compiler error: in fix_loop_structure, at
loop-init.c:263

[Bug middle-end/64083] [5 Regression] ICE: in fix_loop_structure, at loop-init.c:252 compiling Linux Kernel

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

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #2 from Richard Biener rguenth at gcc dot gnu.org ---
Mine.


[Bug middle-end/64083] [5 Regression] ICE: in fix_loop_structure, at loop-init.c:252 compiling Linux Kernel

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

--- Comment #3 from Richard Biener rguenth at gcc dot gnu.org ---
Seems I have an (untested) fix in my dev tree:

Index: gcc/tree-ssa-threadupdate.c
===
--- gcc/tree-ssa-threadupdate.c (revision 218078)
+++ gcc/tree-ssa-threadupdate.c (working copy)
@@ -2431,13 +2431,7 @@ thread_through_all_blocks (bool may_peel
struct loop *loop = (*path)[0]-e-dest-loop_father;

if (thread_block ((*path)[0]-e-dest, false))
- {
-   /* This jump thread likely totally scrambled this loop.
-  So arrange for it to be fixed up.  */
-   loop-header = NULL;
-   loop-latch = NULL;
-   e-aux = NULL;
- }
+ e-aux = NULL;
else
  {
delete_jump_thread_path (path);

or else it should use mark_loop_for_removal (loop).  But the above is of course
prefered.