------- 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

Reply via email to