public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/33589]  New: [4.3 regression] ICE on valid code at -O2: verify_flow_info failed
@ 2007-09-29 17:56 a dot chavasse at gmail dot com
  2007-09-29 19:05 ` [Bug middle-end/33589] " rguenth at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: a dot chavasse at gmail dot com @ 2007-09-29 17:56 UTC (permalink / raw)
  To: gcc-bugs

g++43 -v output:

Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --program-suffix=43 --disable-multilib
--enable-languages=c,c++
Thread model: posix
gcc version 4.3.0 20070929 (experimental) (GCC)

Built from svn trunk, revision 128885


Compiling this with -O2 or -O3 fails with the following message:

verify_flow_info_failed.cpp: In function 'void somefunction()':
verify_flow_info_failed.cpp:29: error: BB 2 last statement has incorrectly set
region
verify_flow_info_failed.cpp:29: internal compiler error: verify_flow_info
failed


struct base
{
        void somemethod() {}
};

struct derived : public base
{
};

struct smartpointer
{
        ~smartpointer()
        {
        }

        operator derived*() const
        {
                return 0;
        }
};

typedef void ( derived::* methodptr_type )();

methodptr_type getmemberptr()
{
        return &derived::somemethod;
}

void somefunction()
{
        smartpointer pObj;
        ( pObj->*getmemberptr() )();
}


-- 
           Summary: [4.3 regression] ICE on valid code at -O2:
                    verify_flow_info failed
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: a dot chavasse at gmail dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

* [Bug middle-end/33589] [4.3 regression] ICE on valid code at -O2: verify_flow_info failed
  2007-09-29 17:56 [Bug c++/33589] New: [4.3 regression] ICE on valid code at -O2: verify_flow_info failed a dot chavasse at gmail dot com
@ 2007-09-29 19:05 ` rguenth at gcc dot gnu dot org
  2007-10-10 18:06 ` mmitchel at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-09-29 19:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2007-09-29 19:05 -------
Confirmed.  Happens after final_cleanup of the following function:

;; Function void somefunction() (_Z12somefunctionv)

void somefunction() ()
{
  # BLOCK 2 freq:10000
  # PRED: ENTRY [100.0%]  (fallthru,exec)
  somemethod (0B);
  goto <bb 4>;
  # SUCC: 3 (ab,eh,exec) 4 [100.0%]  (fallthru,exec)

  # BLOCK 3
  # PRED: 2 (ab,eh,exec)
<L3>:;
  <<<exception object>>> = <<<exception object>>>;
  <<<filter object>>> = <<<filter object>>>;
  resx 1;
  # SUCC:

  # BLOCK 4 freq:10000
  # PRED: 2 [100.0%]  (fallthru,exec)
  return;
  # SUCC: EXIT [100.0%]

}


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
          Component|c++                         |middle-end
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-09-29 19:05:05
               date|                            |
   Target Milestone|---                         |4.3.0


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


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

* [Bug middle-end/33589] [4.3 regression] ICE on valid code at -O2: verify_flow_info failed
  2007-09-29 17:56 [Bug c++/33589] New: [4.3 regression] ICE on valid code at -O2: verify_flow_info failed a dot chavasse at gmail dot com
  2007-09-29 19:05 ` [Bug middle-end/33589] " rguenth at gcc dot gnu dot org
@ 2007-10-10 18:06 ` mmitchel at gcc dot gnu dot org
  2007-10-19 16:37 ` janis at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-10-10 18:06 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug middle-end/33589] [4.3 regression] ICE on valid code at -O2: verify_flow_info failed
  2007-09-29 17:56 [Bug c++/33589] New: [4.3 regression] ICE on valid code at -O2: verify_flow_info failed a dot chavasse at gmail dot com
  2007-09-29 19:05 ` [Bug middle-end/33589] " rguenth at gcc dot gnu dot org
  2007-10-10 18:06 ` mmitchel at gcc dot gnu dot org
@ 2007-10-19 16:37 ` janis at gcc dot gnu dot org
  2007-10-23  6:10 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janis at gcc dot gnu dot org @ 2007-10-19 16:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from janis at gcc dot gnu dot org  2007-10-19 16:36 -------
The testcase also fails on powerpc-linux, where a regression hunt identified
the following patch:

    http://gcc.gnu.org/viewcvs?view=rev&rev=128701

    r128701 | aaw | 2007-09-23 20:05:40 +0000 (Sun, 23 Sep 2007)


-- 

janis at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aaw at gcc dot gnu dot org


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


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

* [Bug middle-end/33589] [4.3 regression] ICE on valid code at -O2: verify_flow_info failed
  2007-09-29 17:56 [Bug c++/33589] New: [4.3 regression] ICE on valid code at -O2: verify_flow_info failed a dot chavasse at gmail dot com
                   ` (2 preceding siblings ...)
  2007-10-19 16:37 ` janis at gcc dot gnu dot org
@ 2007-10-23  6:10 ` pinskia at gcc dot gnu dot org
  2007-10-23  6:39 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-23  6:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-10-23 06:09 -------
This is most likely just a latent bug that showed up wth Ollie's patch, looking
into it further.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org


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


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

* [Bug middle-end/33589] [4.3 regression] ICE on valid code at -O2: verify_flow_info failed
  2007-09-29 17:56 [Bug c++/33589] New: [4.3 regression] ICE on valid code at -O2: verify_flow_info failed a dot chavasse at gmail dot com
                   ` (3 preceding siblings ...)
  2007-10-23  6:10 ` pinskia at gcc dot gnu dot org
@ 2007-10-23  6:39 ` pinskia at gcc dot gnu dot org
  2007-10-23  6:53 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-23  6:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2007-10-23 06:38 -------
So when out of SSA (TER) combines:
  iftmp.1D.2042_25 = (derivedD.2000:: *) somemethodD.1996;
  # SMT.36D.2106_36 = VDEF <SMT.36D.2106_34(D)> { SMT.36D.2106 }
  iftmp.1_25 (0B);


It does not change the case where it knows it cannot throw now.

Looking into fixing out of SSA.


-- 


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


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

* [Bug middle-end/33589] [4.3 regression] ICE on valid code at -O2: verify_flow_info failed
  2007-09-29 17:56 [Bug c++/33589] New: [4.3 regression] ICE on valid code at -O2: verify_flow_info failed a dot chavasse at gmail dot com
                   ` (4 preceding siblings ...)
  2007-10-23  6:39 ` pinskia at gcc dot gnu dot org
@ 2007-10-23  6:53 ` pinskia at gcc dot gnu dot org
  2007-10-28  1:11 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-23  6:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2007-10-23 06:53 -------
Here is a "semi" undefined case which shows the same issue:
void f(void*) throw();

void somefunction()
{
try {
   void (*g)(void*) = (void (*)(void*))f;
   void (*g2)(int*) = (void (*)(int*))g;
    g2(0);
} catch (...)
{throw;}
}


----------- CUT -----
Janis could you do a regression hunt on this bug with the new testcase?


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janis at gcc dot gnu dot org


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


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

* [Bug middle-end/33589] [4.3 regression] ICE on valid code at -O2: verify_flow_info failed
  2007-09-29 17:56 [Bug c++/33589] New: [4.3 regression] ICE on valid code at -O2: verify_flow_info failed a dot chavasse at gmail dot com
                   ` (5 preceding siblings ...)
  2007-10-23  6:53 ` pinskia at gcc dot gnu dot org
@ 2007-10-28  1:11 ` pinskia at gcc dot gnu dot org
  2007-10-28  1:18 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-28  1:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2007-10-28 01:11 -------
A quick patch to fix this:
Index: tree-outof-ssa.c
===================================================================
--- tree-outof-ssa.c    (revision 129686)
+++ tree-outof-ssa.c    (working copy)
@@ -758,7 +758,10 @@ rewrite_trees (var_map map, tree *values
          if (remove)
            bsi_remove (&si, true);
          else
-           bsi_next (&si);
+           {
+             maybe_clean_or_replace_eh_stmt (stmt, stmt);
+             bsi_next (&si);
+           }
        }

       phi = phi_nodes (bb);



----- CUT ----
I don't know if I want to check changed or not, that is the
maybe_cleanup_or_replace_eh_stmt statement be replaced with:
              if (changed)
                maybe_clean_or_replace_eh_stmt (stmt, stmt);


-- 


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


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

* [Bug middle-end/33589] [4.3 regression] ICE on valid code at -O2: verify_flow_info failed
  2007-09-29 17:56 [Bug c++/33589] New: [4.3 regression] ICE on valid code at -O2: verify_flow_info failed a dot chavasse at gmail dot com
                   ` (6 preceding siblings ...)
  2007-10-28  1:11 ` pinskia at gcc dot gnu dot org
@ 2007-10-28  1:18 ` pinskia at gcc dot gnu dot org
  2007-10-28 17:01 ` pinskia at gcc dot gnu dot org
  2007-10-28 17:02 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-28  1:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2007-10-28 01:18 -------
This is the patch which I am going to test (it also deletes the eh edges early
on which should speed up things a little):
Index: tree-outof-ssa.c
===================================================================
--- tree-outof-ssa.c    (revision 129686)
+++ tree-outof-ssa.c    (working copy)
@@ -758,7 +758,12 @@ rewrite_trees (var_map map, tree *values
          if (remove)
            bsi_remove (&si, true);
          else
-           bsi_next (&si);
+           {
+             if (changed)
+               if (maybe_clean_or_replace_eh_stmt (stmt, stmt))
+                 tree_purge_dead_eh_edges (bb);
+             bsi_next (&si);
+           }
        }

       phi = phi_nodes (bb);


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

* [Bug middle-end/33589] [4.3 regression] ICE on valid code at -O2: verify_flow_info failed
  2007-09-29 17:56 [Bug c++/33589] New: [4.3 regression] ICE on valid code at -O2: verify_flow_info failed a dot chavasse at gmail dot com
                   ` (7 preceding siblings ...)
  2007-10-28  1:18 ` pinskia at gcc dot gnu dot org
@ 2007-10-28 17:01 ` pinskia at gcc dot gnu dot org
  2007-10-28 17:02 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-28 17:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2007-10-28 17:01 -------
Subject: Bug 33589

Author: pinskia
Date: Sun Oct 28 17:00:54 2007
New Revision: 129700

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129700
Log:
2007-10-28  Andrew Pinski  <pinskia@gmail.com>

        PR tree-opt/33589
        * tree-outof-ssa.c (rewrite_trees): If the statement changed, cleanup
        the eh information on the statement.
2007-10-28  Andrew Pinski  <pinskia@gmail.com>

        PR tree-opt/33589
        * g++.dg/torture/pr33589-1.C: New testcase.
        * g++.dg/torture/pr33589-2.C: New testcase.



Added:
    trunk/gcc/testsuite/g++.dg/torture/pr33589-1.C
    trunk/gcc/testsuite/g++.dg/torture/pr33589-2.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-outof-ssa.c


-- 


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


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

* [Bug middle-end/33589] [4.3 regression] ICE on valid code at -O2: verify_flow_info failed
  2007-09-29 17:56 [Bug c++/33589] New: [4.3 regression] ICE on valid code at -O2: verify_flow_info failed a dot chavasse at gmail dot com
                   ` (8 preceding siblings ...)
  2007-10-28 17:01 ` pinskia at gcc dot gnu dot org
@ 2007-10-28 17:02 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-28 17:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pinskia at gcc dot gnu dot org  2007-10-28 17:01 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-10-28 17:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-29 17:56 [Bug c++/33589] New: [4.3 regression] ICE on valid code at -O2: verify_flow_info failed a dot chavasse at gmail dot com
2007-09-29 19:05 ` [Bug middle-end/33589] " rguenth at gcc dot gnu dot org
2007-10-10 18:06 ` mmitchel at gcc dot gnu dot org
2007-10-19 16:37 ` janis at gcc dot gnu dot org
2007-10-23  6:10 ` pinskia at gcc dot gnu dot org
2007-10-23  6:39 ` pinskia at gcc dot gnu dot org
2007-10-23  6:53 ` pinskia at gcc dot gnu dot org
2007-10-28  1:11 ` pinskia at gcc dot gnu dot org
2007-10-28  1:18 ` pinskia at gcc dot gnu dot org
2007-10-28 17:01 ` pinskia at gcc dot gnu dot org
2007-10-28 17:02 ` pinskia at gcc dot gnu dot 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).