public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49615] New: internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member
@ 2011-07-02 20:30 harald at gigawatt dot nl
  2011-07-02 20:36 ` [Bug c++/49615] " harald at gigawatt dot nl
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: harald at gigawatt dot nl @ 2011-07-02 20:30 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: internal compiler error: verify_stmts failed / LHS in
                    noreturn call with pointer-to-never-returning-member
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: harald@gigawatt.nl


I came across this while reducing another testcase (which I'll report
separately):

$ cat bug.ii
template <class T>
static inline bool Dispatch (T* obj, bool (T::*func) ())
{
    return (obj->*func) ();
}
class C
{
    bool f (int);
    bool g ();
};
bool C::f (int n)
{
    bool b;
    switch (n)
    {
    case 0:
        b = Dispatch (this, &C::g);
    case 1:
        b = Dispatch (this, &C::g);
    }
}
bool C::g ()
{
    for (;;) { }
}
$ gcc -O bug.ii
bug.ii: In member function ‘bool C::f(int)’:
bug.ii:11:6: error: LHS in noreturn call
b_48 = C::g (D.2160_46);

bug.ii:11:6: internal compiler error: verify_stmts failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ gcc -v:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/pkgbuild/sys-devel/gcc-4.6.1/work/gcc-4.6.1/configure
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --prefix=/usr
--libdir='/usr/lib64' --sysconfdir=/etc --enable-languages=c,c++
--enable-checking --enable-build-with-cxx
Thread model: posix
gcc version 4.6.1 (GCC)


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

* [Bug c++/49615] internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member
  2011-07-02 20:30 [Bug c++/49615] New: internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member harald at gigawatt dot nl
@ 2011-07-02 20:36 ` harald at gigawatt dot nl
  2011-07-04  9:58 ` [Bug tree-optimization/49615] [4.6 Regression] " rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: harald at gigawatt dot nl @ 2011-07-02 20:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Harald van Dijk <harald at gigawatt dot nl> 2011-07-02 20:35:39 UTC ---
Actually, I'll include the other slightly different testcase here, since it'll
probably be the same problem. If you prefer me reporting it as a separate bug,
I will do so.

$ cat bug.ii
template <class T>
static inline bool Dispatch (T* obj, void (T::*func) ())
{
    (obj->*func) ();
}
class C
{
    bool f (int);
    void g ();
};
bool C::f (int n)
{
    bool b;
    switch (n)
    {
    case 0:
        b = Dispatch (this, &C::g);
    case 1:
        b = Dispatch (this, &C::g);
    }
}
void C::g ()
{
    for (;;) { }
}
$ gcc -c -O bug.ii # works
$ gcc -c -O bug.ii -g
bug.ii: In member function ‘bool C::f(int)’:
bug.ii:11:6: error: control flow in the middle of basic block 4
bug.ii:11:6: 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.


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

* [Bug c++/49615] internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member
  2011-07-02 20:30 [Bug c++/49615] New: internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member harald at gigawatt dot nl
  2011-07-02 20:36 ` [Bug c++/49615] " harald at gigawatt dot nl
  2011-07-04  9:58 ` [Bug tree-optimization/49615] [4.6 Regression] " rguenth at gcc dot gnu.org
@ 2011-07-04  9:58 ` rguenth at gcc dot gnu.org
  2011-07-04 10:05 ` [Bug tree-optimization/49615] [4.6 Regression] " hubicka at ucw dot cz
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-07-04  9:58 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.07.04 09:57:07
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-04 09:57:07 UTC ---
Confirmed and mine.  forwprop makes the noreturn call direct via cfgcleanup:

<L1>:
  # DEBUG obj => this_2(D)
  # DEBUG func$__pfn => g
  # DEBUG func$__delta => 0
  # DEBUG func$__pfn => g
  # DEBUG func$__delta => 0
  D.2159_33 = (long int) g;
  D.2156_45 = this_2(D);
  C::g (D.2156_45);
  # DEBUG b => D.2148_52(D)

from

<L1>:
  func$__pfn_5 = g;
  # DEBUG obj => this_2(D)
  # DEBUG func$__pfn => g
  # DEBUG func$__delta => 0
  # DEBUG func$__pfn => g
  # DEBUG func$__delta => 0
  D.2159_33 = (long int) g;
  D.2158_34 = D.2159_33 & 1;
  if (D.2158_34 != 0)
    goto <bb 7>;
  else
    goto <bb 8>;

<bb 7>:
  ... DEAD ...

<bb 8>:
  # func$__pfn_46 = PHI <g(6), func$__pfn_43(7)>
  D.2156_45 = this_2(D);
  func$__pfn_46 (D.2156_45);
  # DEBUG b => D.2148_52(D)


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

* [Bug tree-optimization/49615] [4.6 Regression] internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member
  2011-07-02 20:30 [Bug c++/49615] New: internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member harald at gigawatt dot nl
  2011-07-02 20:36 ` [Bug c++/49615] " harald at gigawatt dot nl
@ 2011-07-04  9:58 ` rguenth at gcc dot gnu.org
  2011-07-04  9:58 ` [Bug c++/49615] " rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-07-04  9:58 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |tree-optimization
      Known to work|                            |4.5.3
   Target Milestone|---                         |4.6.2
            Summary|internal compiler error:    |[4.6 Regression] internal
                   |verify_stmts failed / LHS   |compiler error:
                   |in noreturn call with       |verify_stmts failed / LHS
                   |pointer-to-never-returning- |in noreturn call with
                   |member                      |pointer-to-never-returning-
                   |                            |member

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-04 09:58:36 UTC ---
Works on the 4.5 branch and on the trunk, but possibly latent on both.


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

* [Bug tree-optimization/49615] [4.6 Regression] internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member
  2011-07-02 20:30 [Bug c++/49615] New: internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member harald at gigawatt dot nl
                   ` (2 preceding siblings ...)
  2011-07-04  9:58 ` [Bug c++/49615] " rguenth at gcc dot gnu.org
@ 2011-07-04 10:05 ` hubicka at ucw dot cz
  2011-07-04 10:38 ` rguenther at suse dot de
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hubicka at ucw dot cz @ 2011-07-04 10:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jan Hubicka <hubicka at ucw dot cz> 2011-07-04 10:05:10 UTC ---
split_bbs_on_noreturn_calls is supposed to handle this scenario...

Honza


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

* [Bug tree-optimization/49615] [4.6 Regression] internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member
  2011-07-02 20:30 [Bug c++/49615] New: internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member harald at gigawatt dot nl
                   ` (3 preceding siblings ...)
  2011-07-04 10:05 ` [Bug tree-optimization/49615] [4.6 Regression] " hubicka at ucw dot cz
@ 2011-07-04 10:38 ` rguenther at suse dot de
  2011-07-04 12:07 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenther at suse dot de @ 2011-07-04 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from rguenther at suse dot de <rguenther at suse dot de> 2011-07-04 10:37:11 UTC ---
On Mon, 4 Jul 2011, hubicka at ucw dot cz wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49615
> 
> --- Comment #4 from Jan Hubicka <hubicka at ucw dot cz> 2011-07-04 10:05:10 UTC ---
> split_bbs_on_noreturn_calls is supposed to handle this scenario...

Yeah, but it contains a typo ...

            || bb->index >= n_basic_blocks

should be

        || bb->index >= last_basic_block

...

I have a fix.


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

* [Bug tree-optimization/49615] [4.6 Regression] internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member
  2011-07-02 20:30 [Bug c++/49615] New: internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member harald at gigawatt dot nl
                   ` (4 preceding siblings ...)
  2011-07-04 10:38 ` rguenther at suse dot de
@ 2011-07-04 12:07 ` rguenth at gcc dot gnu.org
  2011-07-04 12:09 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-07-04 12:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-04 12:06:22 UTC ---
Author: rguenth
Date: Mon Jul  4 12:06:17 2011
New Revision: 175803

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175803
Log:
2011-07-04  Richard Guenther  <rguenther@suse.de>

    PR tree-optimization/49615
    * tree-cfgcleanup.c (split_bbs_on_noreturn_calls): Fix
    basic-block index check.

    * g++.dg/torture/pr49615.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/torture/pr49615.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-cfgcleanup.c


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

* [Bug tree-optimization/49615] [4.6 Regression] internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member
  2011-07-02 20:30 [Bug c++/49615] New: internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member harald at gigawatt dot nl
                   ` (5 preceding siblings ...)
  2011-07-04 12:07 ` rguenth at gcc dot gnu.org
@ 2011-07-04 12:09 ` rguenth at gcc dot gnu.org
  2011-07-04 12:19 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-07-04 12:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-04 12:08:53 UTC ---
Author: rguenth
Date: Mon Jul  4 12:08:50 2011
New Revision: 175804

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175804
Log:
2011-07-04  Richard Guenther  <rguenther@suse.de>

    PR tree-optimization/49615
    * tree-cfgcleanup.c (split_bbs_on_noreturn_calls): Fix
    basic-block index check.

    * g++.dg/torture/pr49615.C: New testcase.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/torture/pr49615.C
Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_6-branch/gcc/tree-cfgcleanup.c


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

* [Bug tree-optimization/49615] [4.6 Regression] internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member
  2011-07-02 20:30 [Bug c++/49615] New: internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member harald at gigawatt dot nl
                   ` (6 preceding siblings ...)
  2011-07-04 12:09 ` rguenth at gcc dot gnu.org
@ 2011-07-04 12:19 ` rguenth at gcc dot gnu.org
  2011-07-04 12:23 ` rguenth at gcc dot gnu.org
  2011-07-04 12:24 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-07-04 12:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-04 12:18:29 UTC ---
Author: rguenth
Date: Mon Jul  4 12:18:22 2011
New Revision: 175805

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175805
Log:
2011-07-04  Richard Guenther  <rguenther@suse.de>

    PR tree-optimization/49615
    * tree-cfgcleanup.c (split_bbs_on_noreturn_calls): Fix
    basic-block index check.

    * g++.dg/torture/pr49615.C: New testcase.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/g++.dg/torture/pr49615.C
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_5-branch/gcc/tree-cfgcleanup.c


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

* [Bug tree-optimization/49615] [4.6 Regression] internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member
  2011-07-02 20:30 [Bug c++/49615] New: internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member harald at gigawatt dot nl
                   ` (7 preceding siblings ...)
  2011-07-04 12:19 ` rguenth at gcc dot gnu.org
@ 2011-07-04 12:23 ` rguenth at gcc dot gnu.org
  2011-07-04 12:24 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-07-04 12:23 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

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

--- Comment #10 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-04 12:22:25 UTC ---
Fixed.


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

* [Bug tree-optimization/49615] [4.6 Regression] internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member
  2011-07-02 20:30 [Bug c++/49615] New: internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member harald at gigawatt dot nl
                   ` (8 preceding siblings ...)
  2011-07-04 12:23 ` rguenth at gcc dot gnu.org
@ 2011-07-04 12:24 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-07-04 12:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-04 12:21:48 UTC ---
Author: rguenth
Date: Mon Jul  4 12:21:45 2011
New Revision: 175808

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175808
Log:
2011-07-04  Richard Guenther  <rguenther@suse.de>

    PR tree-optimization/49615
    * tree-cfgcleanup.c (split_bbs_on_noreturn_calls): Fix
    basic-block index check.

    * g++.dg/torture/pr49615.C: New testcase.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr49615.C
Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_4-branch/gcc/tree-cfgcleanup.c


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

end of thread, other threads:[~2011-07-04 12:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-02 20:30 [Bug c++/49615] New: internal compiler error: verify_stmts failed / LHS in noreturn call with pointer-to-never-returning-member harald at gigawatt dot nl
2011-07-02 20:36 ` [Bug c++/49615] " harald at gigawatt dot nl
2011-07-04  9:58 ` [Bug tree-optimization/49615] [4.6 Regression] " rguenth at gcc dot gnu.org
2011-07-04  9:58 ` [Bug c++/49615] " rguenth at gcc dot gnu.org
2011-07-04 10:05 ` [Bug tree-optimization/49615] [4.6 Regression] " hubicka at ucw dot cz
2011-07-04 10:38 ` rguenther at suse dot de
2011-07-04 12:07 ` rguenth at gcc dot gnu.org
2011-07-04 12:09 ` rguenth at gcc dot gnu.org
2011-07-04 12:19 ` rguenth at gcc dot gnu.org
2011-07-04 12:23 ` rguenth at gcc dot gnu.org
2011-07-04 12:24 ` rguenth 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).