public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34018]  New: ICE: verify_stmts failed
@ 2007-11-07 19:37 rwgk at yahoo dot com
  2007-11-07 19:40 ` [Bug middle-end/34018] [4.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rwgk at yahoo dot com @ 2007-11-07 19:37 UTC (permalink / raw)
  To: gcc-bugs

Platform:
  Fedora release 7 (Moonshine)
  Linux idle.lbl.gov 2.6.22.9-91.fc7 #1 SMP Thu Sep 27 20:47:39 EDT 2007 x86_64
x86_64 x86_64 GNU/Linux

% g++ -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /net/rosie/scratch2/rwgk/gcc_trunk/configure
--prefix=/net/cci-filer1/vol1/tmp/rwgk/gcc_trunk_129944_x86_64_fc7
--enable-languages=c,c++,fortran --with-mpfr=/usr
Thread model: posix
gcc version 4.3.0 20071106 (experimental) (GCC) 

I'll upload a small standalone reproducer.

To reproduce the problem:

% g++ -c -O1 ~/verify_stmts_failed.cpp
/net/cci/rwgk/verify_stmts_failed.cpp: In constructor
'triangulation::triangulation(const tiny<long unsigned int, 3ul>&)':
/net/cci/rwgk/verify_stmts_failed.cpp:73: error: invalid operand to binary
operator
&this_2(D)->n_cells.elems[0];

/net/cci/rwgk/verify_stmts_failed.cpp:73: 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.


It works with these alternative commands:

  g++ -c -O1 ~/verify_stmts_failed.cpp -DDISABLE_INLINE
  g++ -c ~/verify_stmts_failed.cpp

It also works with many other compilers including all older g++.

Ralf


-- 
           Summary: ICE: verify_stmts failed
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rwgk at yahoo 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=34018


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

* [Bug middle-end/34018] [4.3 Regression] ICE: verify_stmts failed
  2007-11-07 19:37 [Bug c++/34018] New: ICE: verify_stmts failed rwgk at yahoo dot com
@ 2007-11-07 19:40 ` pinskia at gcc dot gnu dot org
  2007-11-07 19:45 ` rwgk at yahoo dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-11-07 19:40 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
          Component|c++                         |middle-end
            Summary|ICE: verify_stmts failed    |[4.3 Regression] ICE:
                   |                            |verify_stmts failed
   Target Milestone|---                         |4.3.0


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


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

* [Bug middle-end/34018] [4.3 Regression] ICE: verify_stmts failed
  2007-11-07 19:37 [Bug c++/34018] New: ICE: verify_stmts failed rwgk at yahoo dot com
  2007-11-07 19:40 ` [Bug middle-end/34018] [4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2007-11-07 19:45 ` rwgk at yahoo dot com
  2007-11-07 21:02 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rwgk at yahoo dot com @ 2007-11-07 19:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rwgk at yahoo dot com  2007-11-07 19:45 -------
Created an attachment (id=14501)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14501&action=view)
reproducer


-- 


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


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

* [Bug middle-end/34018] [4.3 Regression] ICE: verify_stmts failed
  2007-11-07 19:37 [Bug c++/34018] New: ICE: verify_stmts failed rwgk at yahoo dot com
  2007-11-07 19:40 ` [Bug middle-end/34018] [4.3 Regression] " pinskia at gcc dot gnu dot org
  2007-11-07 19:45 ` rwgk at yahoo dot com
@ 2007-11-07 21:02 ` jakub at gcc dot gnu dot org
  2007-11-08 20:09 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-07 21:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2007-11-07 21:01 -------
This stems from the inliner, which changes:
result_end_9 = &<retval>.elems[0] + D.2223_8;
into:
result_end_6 = &this_2(D)->n_cells.elems[0] + D.2233_5;
While the former is valid GIMPLE, as &<retval> is TREE_INVARIANT, this is not
marked so.
copy_bb has:
805               /* With return slot optimization we can end up with
806                  non-gimple (foo *)&this->m, fix that here.  */
807               if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
808                   && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == NOP_EXPR
809                   && !is_gimple_val (TREE_OPERAND (GIMPLE_STMT_OPERAND
(stmt, 1), 0)))
810                 gimplify_stmt (&stmt);
to handle some of the cases of this and copy_phis_for_bb chunk I've recently
added too:
1196                  /* With return slot optimization we can end up with
1197                     non-gimple (foo *)&this->m, fix that here.  */
1198                  if (TREE_CODE (new_arg) != SSA_NAME
1199                      && TREE_CODE (new_arg) != FUNCTION_DECL
1200                      && !is_gimple_val (new_arg))
1201                    {
1202                      tree stmts = NULL_TREE;
1203                      new_arg = force_gimple_operand (new_arg, &stmts,
1204                                                      true, NULL);
1205                      bsi_insert_on_edge_immediate (new_edge, stmts);
(gdb) 
1206                    }

But the copy_bb hunk only handles some cases, particularly where the &<result>
-> this replacement was done on the right side of GIMPLE_MODIFY_STMT.  But as
can be seen on this testcase, it can happen in many other places.
Blindly doing a gimplify_stmt is dangerous though, because VLA types could be
involved somewhere and gimplifying them again perhaps could introduce trouble.
SO I guess we just need to note the replacement of TREE_INVARIANT with
non-invariant and gimplify just it into a new temporary.


-- 


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


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

* [Bug middle-end/34018] [4.3 Regression] ICE: verify_stmts failed
  2007-11-07 19:37 [Bug c++/34018] New: ICE: verify_stmts failed rwgk at yahoo dot com
                   ` (2 preceding siblings ...)
  2007-11-07 21:02 ` jakub at gcc dot gnu dot org
@ 2007-11-08 20:09 ` jakub at gcc dot gnu dot org
  2007-11-10  7:46 ` jakub at gcc dot gnu dot org
  2007-11-10  7:54 ` jakub at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-08 20:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2007-11-08 20:09 -------
Testing a patch.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-11-08 20:09:33
               date|                            |


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


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

* [Bug middle-end/34018] [4.3 Regression] ICE: verify_stmts failed
  2007-11-07 19:37 [Bug c++/34018] New: ICE: verify_stmts failed rwgk at yahoo dot com
                   ` (3 preceding siblings ...)
  2007-11-08 20:09 ` jakub at gcc dot gnu dot org
@ 2007-11-10  7:46 ` jakub at gcc dot gnu dot org
  2007-11-10  7:54 ` jakub at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-10  7:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2007-11-10 07:46 -------
Subject: Bug 34018

Author: jakub
Date: Sat Nov 10 07:46:31 2007
New Revision: 130068

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130068
Log:
        PR middle-end/34018
        * tree-inline.h (copy_body_data): Add regimplify field.
        * tree-inline.c (copy_body_r): Set id->regimplify to true
        if an TREE_INVARIANT ADDR_EXPR is no longer invariant after
        substitutions.
        (copy_bb): Clear id->regimplify before walk_tree, if it is
        set afterwards, regimplify the whole statement.

        * g++.dg/opt/inline14.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/opt/inline14.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-inline.c
    trunk/gcc/tree-inline.h


-- 


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


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

* [Bug middle-end/34018] [4.3 Regression] ICE: verify_stmts failed
  2007-11-07 19:37 [Bug c++/34018] New: ICE: verify_stmts failed rwgk at yahoo dot com
                   ` (4 preceding siblings ...)
  2007-11-10  7:46 ` jakub at gcc dot gnu dot org
@ 2007-11-10  7:54 ` jakub at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-10  7:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2007-11-10 07:53 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-11-10  7:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-07 19:37 [Bug c++/34018] New: ICE: verify_stmts failed rwgk at yahoo dot com
2007-11-07 19:40 ` [Bug middle-end/34018] [4.3 Regression] " pinskia at gcc dot gnu dot org
2007-11-07 19:45 ` rwgk at yahoo dot com
2007-11-07 21:02 ` jakub at gcc dot gnu dot org
2007-11-08 20:09 ` jakub at gcc dot gnu dot org
2007-11-10  7:46 ` jakub at gcc dot gnu dot org
2007-11-10  7:54 ` jakub 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).