[Bug target/59443] New: Passing arguments via stack in x86-64

2013-12-09 Thread dennis at yurichev dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59443

Bug ID: 59443
   Summary: Passing arguments via stack in x86-64
   Product: gcc
   Version: 4.7.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dennis at yurichev dot com

Excuse me, but it is correct code generated for x86-64?

#include 

void f1(long long int a, long long int b, long long int c, long long int d,
long long int e, long long int f, long long int g)
{
printf ("%lld %lld %lld %lld %lld %lld %lld\n", a, b, c, d, e, f, g);
};

int main()
{
f1(1L,2L,3L,4L,5L,6L,7L);
};

gcc -S -masm=intel 1.c

I've got:

main:
.LFB1:
pushrbp
mov rbp, rsp
sub rsp, 16
mov QWORD PTR [rsp], 7
mov r9d, 6
mov r8d, 5
mov ecx, 4
mov edx, 3
mov esi, 2
mov edi, 1
callf1
leave
ret

Is it correct to fill only 32-bit parts of x64 registers? The values passed are
long long.


[Bug target/59443] Passing arguments via stack in x86-64

2013-12-09 Thread dennis at yurichev dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59443

--- Comment #1 from Dennis Yurichev  ---
dennis@ubuntu:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.7.3-1ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin
--with-system-zlib --enable-objc-gc --with-cloog --enable-cloog-backend=ppl
--disable-cloog-version-check --disable-ppl-version-check --enable-multiarch
--disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1)