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 c/16920] New: possible generation of broken asm code? (C, C++, gcc 3.4.1)


attached example program produces wrong results when compiled as 64 bit binary.
it works ok when compiled with -Os optimization OR into 32 bit binary (forced
with -m32 switch). 

it grabs two timestamps (format: YYYYMMDDHH:MM:SS), converts them with strptime
into tm struct and displays unix epoch time generated with mktime() - when
compiled as 64 bit binary, one timestamp has wrong value (the difference between
original timestamps is 180s, whereas it shows it's 3420 seconds after using
mktime()). it shows proper 180 seconds difference when compiled with -m32 or -Os.

my gcc -v:
Reading specs from /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.1/specs
Configured with: /usr/local/portage/portage/gcc-3.4.1/work/gcc-3.4.1/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/3.4
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.1/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4/info --enable-shared
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-system-zlib
--enable-languages=c,c++,objc --enable-threads=posix --enable-long-long
--disable-checking --disable-libunwind-exceptions --enable-cstdio=stdio
--enable-version-specific-runtime-libs
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.1/include/g++-v3
--with-local-prefix=/usr/local --disable-werror --enable-shared --enable-nls
--without-included-gettext --enable-multilib --enable-__cxa_atexit
--enable-clocale=gnu
Thread model: posix
gcc version 3.4.1  (Gentoo Linux 3.4.1, ssp-3.4-2, pie-8.7.6.3)

-- 
           Summary: possible generation of broken asm code? (C, C++, gcc
                    3.4.1)
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eleven at ludojad dot itpp dot pl
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: x86_64-pc-linux-gnu


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


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