This is the mail archive of the 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 rtl-optimization/24812] New: Optimizer creates infinite loop with -fno-strict-aliasing

The following test program goes into an infinite loop when compiled with -O2
and -fno-strict-aliasing but works correctly if -fno-strict-aliasing is

$ g++-3.4 -g -O2 -fno-strict-aliasing -o loop loop.C

// loop.C
class DummyType
    ~DummyType() { }

class Foo
    Foo() : X0(0), X4(0) { }
    int X0, X1, X2, X3, X4;

int main(int, char**)
        Foo f;
        DummyType d;

    Foo f2;

    bool done(false);

    while (!done) {
        if (f2.X4 != 0) f2.X4 = 0;
        else done = true;;

    return 0;


Reading specs from /usr/lib/gcc/i486-linux/3.4.4/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr
--libexecdir=/usr/lib --with-gxx-include-dir=/usr/include/c++/3.4
--enable-shared --with-system-zlib --enable-nls --without-included-gettext
--program-suffix=-3.4 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt
--enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm
--enable-java-awt=gtk --disable-werror i486-linux
Thread model: posix
gcc version 3.4.4 20050314 (prerelease) (Debian 3.4.3-13)

           Summary: Optimizer creates infinite loop with -fno-strict-
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cnewbold at mathworks dot com

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