public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/40081]  New: verify_stmts failed with -O2
@ 2009-05-09 11:07 dcb314 at hotmail dot com
  2009-05-09 11:08 ` [Bug c++/40081] " dcb314 at hotmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2009-05-09 11:07 UTC (permalink / raw)
  To: gcc-bugs

I just tried to compile the Suse Linux package blocxx-2.1.0.342-124.2
with the GNU gcc version 4.5 snapshot 20090507.

The compiler said

dlSharedLibrary.cpp:192: error: invalid rhs for gimple memory store
c$val

c.val;

# .MEM_4 = VDEF <.MEM_2(D)>
c$val ={v} c.val;

dlSharedLibrary.cpp:192: error: invalid rhs for gimple memory store
this_1(D)->m_count.val;

c$val

# .MEM_5 = VDEF <.MEM_4>
this_1(D)->m_count.val ={v} c$val;

dlSharedLibrary.cpp:192: 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.


Preprocessed source code attached. Flag -O2 required.
It compiles fine without -O2.


-- 
           Summary: verify_stmts failed with -O2
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dcb314 at hotmail dot com
  GCC host triplet: x86_64-suse-linux


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


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

* [Bug c++/40081] verify_stmts failed with -O2
  2009-05-09 11:07 [Bug c++/40081] New: verify_stmts failed with -O2 dcb314 at hotmail dot com
@ 2009-05-09 11:08 ` dcb314 at hotmail dot com
  2009-05-09 13:21 ` rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2009-05-09 11:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dcb314 at hotmail dot com  2009-05-09 11:08 -------
Created an attachment (id=17835)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17835&action=view)
C++ source code


-- 


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


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

* [Bug c++/40081] verify_stmts failed with -O2
  2009-05-09 11:07 [Bug c++/40081] New: verify_stmts failed with -O2 dcb314 at hotmail dot com
  2009-05-09 11:08 ` [Bug c++/40081] " dcb314 at hotmail dot com
@ 2009-05-09 13:21 ` rguenth at gcc dot gnu dot org
  2009-05-09 13:34 ` [Bug tree-optimization/40081] " rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-09 13:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2009-05-09 13:21 -------
Reducing.


-- 


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


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

* [Bug tree-optimization/40081] verify_stmts failed with -O2
  2009-05-09 11:07 [Bug c++/40081] New: verify_stmts failed with -O2 dcb314 at hotmail dot com
  2009-05-09 11:08 ` [Bug c++/40081] " dcb314 at hotmail dot com
  2009-05-09 13:21 ` rguenth at gcc dot gnu dot org
@ 2009-05-09 13:34 ` rguenth at gcc dot gnu dot org
  2009-05-09 17:58 ` rguenth at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-09 13:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2009-05-09 13:34 -------
struct Atomic_t {
    Atomic_t(int i) : val(i) { }
    volatile int val;
};
class RefCount {
public:
    RefCount(Atomic_t c) : m_count(c)  { }
    Atomic_t m_count;
};
class IntrusiveCountableBase {
    RefCount m_useCount;
protected:
    IntrusiveCountableBase();
};
IntrusiveCountableBase::IntrusiveCountableBase() : m_useCount(0)  { }


the issue is the volatile qualifier on val for the temporary used for
the RefCount constructor call.  SRA should either drop the qualifier or
not scalarize this.

Martin, please add the testcase to the new SRA (and verify it does things
correct here).  Thx.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mjambor at suse dot cz
             Status|UNCONFIRMED                 |NEW
          Component|c++                         |tree-optimization
     Ever Confirmed|0                           |1
           Keywords|                            |ice-checking, ice-on-valid-
                   |                            |code, wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2009-05-09 13:34:34
               date|                            |


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


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

* [Bug tree-optimization/40081] verify_stmts failed with -O2
  2009-05-09 11:07 [Bug c++/40081] New: verify_stmts failed with -O2 dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2009-05-09 13:34 ` [Bug tree-optimization/40081] " rguenth at gcc dot gnu dot org
@ 2009-05-09 17:58 ` rguenth at gcc dot gnu dot org
  2009-05-09 18:08 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-09 17:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2009-05-09 17:57 -------
Same problem in 4.4, 4.3 and 4.2, just only the type verifier verifies this.
It's not critial (it will be treated the same as struct copies - thus it is
simply inefficient).  I'll see if a fix is simple.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
      Known to fail|                            |4.3.3 4.4.0


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


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

* [Bug tree-optimization/40081] verify_stmts failed with -O2
  2009-05-09 11:07 [Bug c++/40081] New: verify_stmts failed with -O2 dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2009-05-09 17:58 ` rguenth at gcc dot gnu dot org
@ 2009-05-09 18:08 ` rguenth at gcc dot gnu dot org
  2009-05-10 10:16 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-09 18:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2009-05-09 18:07 -------
Mine.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-05-09 13:34:34         |2009-05-09 18:07:58
               date|                            |


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


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

* [Bug tree-optimization/40081] verify_stmts failed with -O2
  2009-05-09 11:07 [Bug c++/40081] New: verify_stmts failed with -O2 dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2009-05-09 18:08 ` rguenth at gcc dot gnu dot org
@ 2009-05-10 10:16 ` rguenth at gcc dot gnu dot org
  2009-05-10 10:29 ` jamborm at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-10 10:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2009-05-10 10:16 -------
Subject: Bug 40081

Author: rguenth
Date: Sun May 10 10:16:01 2009
New Revision: 147330

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147330
Log:
2009-05-10  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/40081
        * tree-sra.c (instantiate_element): Instantiate scalar replacements
        using the main variant of the element type.  Do not fiddle with
        TREE_THIS_VOLATILE or TREE_SIDE_EFFECTS.

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

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


-- 


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


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

* [Bug tree-optimization/40081] verify_stmts failed with -O2
  2009-05-09 11:07 [Bug c++/40081] New: verify_stmts failed with -O2 dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2009-05-10 10:16 ` rguenth at gcc dot gnu dot org
@ 2009-05-10 10:29 ` jamborm at gcc dot gnu dot org
  2009-05-10 16:41 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jamborm at gcc dot gnu dot org @ 2009-05-10 10:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jamborm at gcc dot gnu dot org  2009-05-10 10:29 -------
New SRA handles this fine by not scalarizing anything that has volatile fields
in it. There is already a fortran testcase with a union with a volatile field
that made me aware of this.


-- 


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


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

* [Bug tree-optimization/40081] verify_stmts failed with -O2
  2009-05-09 11:07 [Bug c++/40081] New: verify_stmts failed with -O2 dcb314 at hotmail dot com
                   ` (6 preceding siblings ...)
  2009-05-10 10:29 ` jamborm at gcc dot gnu dot org
@ 2009-05-10 16:41 ` rguenth at gcc dot gnu dot org
  2009-05-11 12:23 ` rguenth at gcc dot gnu dot org
  2009-05-11 12:23 ` rguenth at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-10 16:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from rguenth at gcc dot gnu dot org  2009-05-10 16:41 -------
Subject: Bug 40081

Author: rguenth
Date: Sun May 10 16:40:55 2009
New Revision: 147349

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147349
Log:
2009-05-10  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/40081
        Revert
        * tree-sra.c (instantiate_element): Instantiate scalar replacements
        using the main variant of the element type.  Do not fiddle with
        TREE_THIS_VOLATILE or TREE_SIDE_EFFECTS.

        * tree-sra.c (sra_type_can_be_decomposed_p): Do not decompose
        structs with volatile fields.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-sra.c


-- 


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


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

* [Bug tree-optimization/40081] verify_stmts failed with -O2
  2009-05-09 11:07 [Bug c++/40081] New: verify_stmts failed with -O2 dcb314 at hotmail dot com
                   ` (7 preceding siblings ...)
  2009-05-10 16:41 ` rguenth at gcc dot gnu dot org
@ 2009-05-11 12:23 ` rguenth at gcc dot gnu dot org
  2009-05-11 12:23 ` rguenth at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-11 12:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2009-05-11 12:23 -------
Did I say fixed?


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/40081] verify_stmts failed with -O2
  2009-05-09 11:07 [Bug c++/40081] New: verify_stmts failed with -O2 dcb314 at hotmail dot com
                   ` (8 preceding siblings ...)
  2009-05-11 12:23 ` rguenth at gcc dot gnu dot org
@ 2009-05-11 12:23 ` rguenth at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-11 12:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from rguenth at gcc dot gnu dot org  2009-05-11 12:23 -------
Ok, I simply consider this fixed for 4.5.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.0


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


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

end of thread, other threads:[~2009-05-11 12:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-09 11:07 [Bug c++/40081] New: verify_stmts failed with -O2 dcb314 at hotmail dot com
2009-05-09 11:08 ` [Bug c++/40081] " dcb314 at hotmail dot com
2009-05-09 13:21 ` rguenth at gcc dot gnu dot org
2009-05-09 13:34 ` [Bug tree-optimization/40081] " rguenth at gcc dot gnu dot org
2009-05-09 17:58 ` rguenth at gcc dot gnu dot org
2009-05-09 18:08 ` rguenth at gcc dot gnu dot org
2009-05-10 10:16 ` rguenth at gcc dot gnu dot org
2009-05-10 10:29 ` jamborm at gcc dot gnu dot org
2009-05-10 16:41 ` rguenth at gcc dot gnu dot org
2009-05-11 12:23 ` rguenth at gcc dot gnu dot org
2009-05-11 12:23 ` rguenth 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).