This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/29984] New: [Regression 4.2]: ppc 8540 g++ segfaults on valid C++ code.


The following example is a reduced testcase from icewm. GCC when configured for
ppc-*-linux-gnuspe segfaults.

To reproduce the ICE compile like below 

g++ -c -O2 testcase.C

this works fine on gcc configured with powerpc-*-linux

testcase.C
============================================

class YRect {
public:
    YRect(int x, int y, int w, int h)
        :xx(x), yy(y), ww(w), hh(h)
    { }
    int x() const { return xx; }
    int y() const { return yy; }
    int width() const { return ww; }
    int height() const { return hh; }
private:
    int xx, yy, ww, hh;
};

void setGeometry(const YRect &r);
void resize(int xiscreen) {
    int dx, dy, dw, dh;
    int aWidth =
        (int) dw * 1/3;
    int tWidth=0;
    int w = aWidth;
    int h;
    if (h) {
        if (w >= 0)
            w = 0;
        int step;
        int maxHeight;
        if (h > maxHeight)
            h= maxHeight;
    } else{
        int iWidth;
        if (iWidth > aWidth)
            aWidth = iWidth;
        if (iWidth) {
            if (aWidth > w)
                w = aWidth;
        }
        if (h/*quickSwitchAllIcons*/)
            h += 1;
    }
    setGeometry(YRect(dx + ((dw - w) >> 1),
                      dy + ((dh - h) >> 1),
                      w, h));
}
====================================================


-- 
           Summary: [Regression 4.2]: ppc 8540 g++ segfaults on valid C++
                    code.
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: raj dot khem at gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: powerpc-*-linux-gnuspe


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]