public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/46233] New: [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls
@ 2010-10-29 20:50 zsojka at seznam dot cz
  2010-10-29 20:56 ` [Bug tree-optimization/46233] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: zsojka at seznam dot cz @ 2010-10-29 20:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46233

           Summary: [4.6 Regression] ICE: verify_flow_info failed: control
                    flow in the middle of basic block 3 with
                    -foptimize-sibling-calls
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz


Created attachment 22200
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22200
reduced testcase

Compiler output:
$ gcc -O -foptimize-sibling-calls pr46233.c 
pr46233.c: In function 'foo':
pr46233.c:5:1: error: control flow in the middle of basic block 3
pr46233.c:5: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.

Tested revisions:
r166029 - crash
r161659 - crash
r159696 - OK


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/46233] [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls
  2010-10-29 20:50 [Bug tree-optimization/46233] New: [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls zsojka at seznam dot cz
@ 2010-10-29 20:56 ` pinskia at gcc dot gnu.org
  2010-10-29 20:57 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-10-29 20:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46233

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-10-29 20:56:43 UTC ---
Here is a simple testcase which shows the problem is not in the tail call
optimization pass:
int
foo ()
{
  int i = 0;
  while (1)
  {
    i += foo ();
  }
}
--- CUT ---

Compile at -O1 -fno-tree-dce.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/46233] [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls
  2010-10-29 20:50 [Bug tree-optimization/46233] New: [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls zsojka at seznam dot cz
  2010-10-29 20:56 ` [Bug tree-optimization/46233] " pinskia at gcc dot gnu.org
@ 2010-10-29 20:57 ` pinskia at gcc dot gnu.org
  2010-10-29 22:42 ` hjl.tools at gmail dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-10-29 20:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46233

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|x86_64-pc-linux-gnu         |
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.10.29 20:57:06
               Host|x86_64-pc-linux-gnu         |
   Target Milestone|---                         |4.6.0
     Ever Confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-10-29 20:57:06 UTC ---
Confirmed ;).


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/46233] [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls
  2010-10-29 20:50 [Bug tree-optimization/46233] New: [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls zsojka at seznam dot cz
  2010-10-29 20:56 ` [Bug tree-optimization/46233] " pinskia at gcc dot gnu.org
  2010-10-29 20:57 ` pinskia at gcc dot gnu.org
@ 2010-10-29 22:42 ` hjl.tools at gmail dot com
  2010-11-03 16:44 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2010-10-29 22:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46233

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2010-10-29 22:42:36 UTC ---
(In reply to comment #0)
> Created attachment 22200 [details]
> reduced testcase
> 
> Compiler output:
> $ gcc -O -foptimize-sibling-calls pr46233.c 
> pr46233.c: In function 'foo':
> pr46233.c:5:1: error: control flow in the middle of basic block 3
> pr46233.c:5: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.

This is caused by revision 160124:

http://gcc.gnu.org/ml/gcc-cvs/2010-06/msg00036.html


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/46233] [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls
  2010-10-29 20:50 [Bug tree-optimization/46233] New: [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2010-10-29 22:42 ` hjl.tools at gmail dot com
@ 2010-11-03 16:44 ` jakub at gcc dot gnu.org
  2010-11-04 10:22 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-03 16:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46233

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-03 16:43:51 UTC ---
The problem here is that we do first noreturn discovery, then call
analyze_function which calls loop_optimizer_finalize which then for
--enable-checking calls verify_flow_info which ICEs, because noreturn calls to
self have not been fixed up.

To fix this, either we could (if possible) move the noreturn discovery right
after the l = analyze_function call (my preference), or if that is not possible
and callgraph states that the function can call itself call execute_fixup_cfg
right after making it noreturn, or somehow make sure verify_flow_info is not
called from loop_optimizer_finalize in this case (i.e. is postponed until we
execute_fixup_cfg later on in local pure const discovery).

Honza?


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/46233] [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls
  2010-10-29 20:50 [Bug tree-optimization/46233] New: [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2010-11-03 16:44 ` jakub at gcc dot gnu.org
@ 2010-11-04 10:22 ` jakub at gcc dot gnu.org
  2010-11-04 10:24 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-04 10:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46233

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-04 10:21:45 UTC ---
Created attachment 22273
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22273
gcc46-pr46233.patch

Fix that just moves noreturn discovery after analyze_function.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/46233] [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls
  2010-10-29 20:50 [Bug tree-optimization/46233] New: [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2010-11-04 10:22 ` jakub at gcc dot gnu.org
@ 2010-11-04 10:24 ` jakub at gcc dot gnu.org
  2010-11-04 14:57 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-04 10:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46233

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-04 10:24:17 UTC ---
Created attachment 22274
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22274
gcc46-pr46233-1.patch

Alternative fix which calls fixup_noreturn_call instead.  I don't think it buys
us anything (nor would calling execute_fixup_cfg after the noreturn discovery),
because the bbs are split, but cfg is not cleaned up and thus I doubt it has
any effect on analyze_function.  We'd need to do real full cfg cleanup at that
point.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/46233] [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls
  2010-10-29 20:50 [Bug tree-optimization/46233] New: [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2010-11-04 10:24 ` jakub at gcc dot gnu.org
@ 2010-11-04 14:57 ` rguenth at gcc dot gnu.org
  2010-11-04 18:45 ` jakub at gcc dot gnu.org
  2010-11-04 19:23 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-04 14:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46233

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-04 14:56:57 UTC ---
I think it's fragile to call verify_flow_info from loop_optimizer_finalize
but your patch in comment #5 looks perfectly reasonable and is ok if it
passed bootstrap & regtest.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/46233] [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls
  2010-10-29 20:50 [Bug tree-optimization/46233] New: [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2010-11-04 14:57 ` rguenth at gcc dot gnu.org
@ 2010-11-04 18:45 ` jakub at gcc dot gnu.org
  2010-11-04 19:23 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-04 18:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46233

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-04 18:45:12 UTC ---
Author: jakub
Date: Thu Nov  4 18:45:06 2010
New Revision: 166324

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166324
Log:
    PR tree-optimization/46233
    * ipa-pure-const.c (local_pure_const): Do noreturn discovery
    after calling analyze_function, not before.

    * gcc.dg/pr46233.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr46233.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-pure-const.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/46233] [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls
  2010-10-29 20:50 [Bug tree-optimization/46233] New: [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2010-11-04 18:45 ` jakub at gcc dot gnu.org
@ 2010-11-04 19:23 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-04 19:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46233

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-04 19:23:51 UTC ---
Fixed.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-11-04 19:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-29 20:50 [Bug tree-optimization/46233] New: [4.6 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block 3 with -foptimize-sibling-calls zsojka at seznam dot cz
2010-10-29 20:56 ` [Bug tree-optimization/46233] " pinskia at gcc dot gnu.org
2010-10-29 20:57 ` pinskia at gcc dot gnu.org
2010-10-29 22:42 ` hjl.tools at gmail dot com
2010-11-03 16:44 ` jakub at gcc dot gnu.org
2010-11-04 10:22 ` jakub at gcc dot gnu.org
2010-11-04 10:24 ` jakub at gcc dot gnu.org
2010-11-04 14:57 ` rguenth at gcc dot gnu.org
2010-11-04 18:45 ` jakub at gcc dot gnu.org
2010-11-04 19:23 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).