public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53005] New: GCC moves the called C function address and parameters to the wrong stack position, when making C-style calling of C functions in a C function with inline assembly code.
@ 2012-04-16 10:03 zhao86.scholar at gmail dot com
  2012-04-16 10:12 ` [Bug c/53005] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zhao86.scholar at gmail dot com @ 2012-04-16 10:03 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53005
           Summary: GCC moves the called C function address and parameters
                    to the wrong stack position, when making C-style
                    calling of C functions in a C function with inline
                    assembly code.
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zhao86.scholar@gmail.com


Created attachment 27167
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27167
C code to reproduce the bug.

When making C-style calling of C functions in a C function with inline assembly
code, GCC moves the called C function address and parameters to the wrong stack
position, which is overwriting the values of other variables in the stack.   
The problem can be reproduced using the C code in the attached.

The exact version of GCC:
4.2.1

The system type:
i686-apple-darwin11

The options given when GCC was configured/built:
/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure
--disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2
--mandir=/share/man --enable-languages=c,objc,c++,obj-c++
--program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--with-slibdir=/usr/lib --build=i686-apple-darwin11
--enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/dst-llvmCore/Developer/usr/local
--program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11
--target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1


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

end of thread, other threads:[~2012-04-17  2:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16 10:03 [Bug c++/53005] New: GCC moves the called C function address and parameters to the wrong stack position, when making C-style calling of C functions in a C function with inline assembly code zhao86.scholar at gmail dot com
2012-04-16 10:12 ` [Bug c/53005] " redi at gcc dot gnu.org
2012-04-16 10:18 ` zhao86.scholar at gmail dot com
2012-04-16 10:47 ` redi at gcc dot gnu.org
2012-04-16 11:13 ` manu at gcc dot gnu.org
2012-04-16 11:19 ` manu at gcc dot gnu.org
2012-04-17  2:44 ` zhao86.scholar at gmail dot com

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).