I looked at the assembler instructions surrounding the call to myFunc function;
They seemed to be erroneous under gcc 4.3, yet correct under gcc 4.1

Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.1-2'
--with-b
ugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran
,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib
--libexecdir=/usr
/lib --without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-i
nclude-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu
--ena
ble-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all
--enable
-cld --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
--ta
rget=i486-linux-gnu
gcc version 4.3.1 (Debian 4.3.1-2)


Result under gcc version 4.3.1:
5

Result under gcc version 4.1.1-21 or 3.4.4:
7


-- 
           Summary: Old value of global variable saved/restored between
                    function call
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lauren dot bedoule at gmail dot com


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

Reply via email to