public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/16920] New: possible generation of broken asm code? (C, C++, gcc 3.4.1)
@ 2004-08-08 16:20 eleven at ludojad dot itpp dot pl
  2004-08-08 16:22 ` [Bug c/16920] " eleven at ludojad dot itpp dot pl
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: eleven at ludojad dot itpp dot pl @ 2004-08-08 16:20 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-08-08 20:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-08 16:20 [Bug c/16920] New: possible generation of broken asm code? (C, C++, gcc 3.4.1) eleven at ludojad dot itpp dot pl
2004-08-08 16:22 ` [Bug c/16920] " eleven at ludojad dot itpp dot pl
2004-08-08 18:16 ` [Bug target/16920] " pinskia at gcc dot gnu dot org
2004-08-08 18:18 ` [Bug c/16920] " eleven at ludojad dot itpp dot pl
2004-08-08 19:42 ` eleven at ludojad dot itpp dot pl
2004-08-08 19:43 ` pinskia at gcc dot gnu dot org
2004-08-08 20:47 ` eleven at ludojad dot itpp dot pl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).