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

Pat Haugen <pthaugen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW

--- Comment #7 from Pat Haugen <pthaugen at gcc dot gnu.org> 2012-04-11 
18:34:55 UTC ---
I observed similar behavior on loads (8-byte loads transformed to sequence of
byte loads/shifts/ors) with r185470, unaligned read patch. This caused some
sizable degradation on a few benchmarks also.-fno-tree-sra had no effect on the
unaligned load case.

Reduced testcase:

// g++ -S -m64 -O2 -mcpu=power7 load.cc
typedef int ggBoolean;
class mrSurface
{
};
template < class T > class ggTrain
{
public:ggBoolean Append (T item);
  T operator[] (int i) const
  {
    return data[i];
  }
private:  T * data;
  int nData;
};

class mrSurfaceList:public mrSurface
{
  virtual void viewingHit () const;
protected:  ggTrain < mrSurface * >surfaces;
};
extern mrSurface *sPtr;
void
mrSurfaceList::viewingHit () const 
{
  sPtr = surfaces[1];
}



150r.expand:

  D.2562_3 = MEM[(const struct ggTrain *)this_1(D) + 8B];
  D.2560_11 = MEM[(struct mrSurface * *)D.2562_3 + 8B];
  sPtr = D.2560_11;


The first MEM[...] gets expanded to the sequence of lbzs/shifts/ors.

Reply via email to