The attached program generates the expected output when compiled and run with any of the gcc 3.x, gcc 4.0/4.1/4.2/4.3 compilers, but not with gcc 4.4. The details are as follows:
* gcc version and configuration (built from unmodified GNU sources): ~/gcc-4.4.0/bin/gcc -v Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: /home/bart/software/gcc-4.4.0/configure --disable-linux-futex --disable-mudflap --disable-nls --enable-languages=c,c++ --enable-threads=posix --enable-tls --prefix=/home/bart/gcc-4.4.0 Thread model: posix gcc version 4.4.0 (GCC) * How to compile: /home/bart/gcc-4.4.0/bin/gcc -g -m32 -mmmx -msse -fno-stack-protector -o pushpopseg pushpopseg.i * How to run: ./pushpopseg * Expected output: sp change after push = -2 sp change after pop = 2 fs after push and pop = 0003 sp change after push = -4 sp change after pop = 4 fs after push and pop = 0003 * Output with gcc 4.4.0 (not correct): sp change after push = 141379319 sp change after pop = -141379319 fs after push and pop = 0003 sp change after push = 141379319 sp change after pop = -141379319 fs after push and pop = 0003 -- Summary: gcc generates incorrect code for inline assembly Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bart dot vanassche at gmail dot com GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40795