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 optimization/13869] New: wrong code


Compiling this:
int test() {
        bool my_bool = true;
        for (int i=0; i<10; ++i) {
                if (!my_bool) {
                } else {
                        my_bool = false;
                }
        };
        return my_bool;
};

with optimization enabled, returns 1, though it returns 0 when compiled without
optimization.  Function calls in the else-scope are executed though...

Reading specs from
/esat/firenze/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/specs
Configured with: ../../src/gcc/ssa/configure --prefix=/esat/firenze/install
--program-suffix=-ssa --enable-languages=c,c++
Thread model: posix
gcc version 3.5-tree-ssa 20040126 (merged 20040102)
 /esat/firenze/install/libexec/gcc/i686-pc-linux-gnu/3.5-tree-ssa/cc1plus -quiet
-v -D_GNU_SOURCE test.cpp -quiet -dumpbase test.cpp -mtune=pentiumpro
-auxbase-strip test.s -O9 -version -o test.s
ignoring nonexistent directory
"/esat/firenze/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /esat/firenze/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/../../../../include/c++/3.5-tree-ssa
 /esat/firenze/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/../../../../include/c++/3.5-tree-ssa/i686-pc-linux-gnu
 /esat/firenze/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/../../../../include/c++/3.5-tree-ssa/backward
 /usr/local/include
 /esat/firenze/install/include
 /esat/firenze/install/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/include
 /usr/include
End of search list.
GNU C++ version 3.5-tree-ssa 20040126 (merged 20040102) (i686-pc-linux-gnu)
        compiled by GNU C version 3.3.1.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

-- 
           Summary: wrong code
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: stefaandr at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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