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
* [Bug c/53005] 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 [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 ` redi at gcc dot gnu.org
2012-04-16 10:18 ` zhao86.scholar at gmail dot com
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2012-04-16 10:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53005
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|c++ |c
Version|unknown |4.2.1
Severity|major |normal
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-16 10:12:41 UTC ---
GCC 4.2 is not supported, please try a current release.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/53005] 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 [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
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: zhao86.scholar at gmail dot com @ 2012-04-16 10:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53005
--- Comment #2 from Lili Zhao <zhao86.scholar at gmail dot com> 2012-04-16 10:17:43 UTC ---
Do you mean we should use a later GCC version?
(In reply to comment #1)
> GCC 4.2 is not supported, please try a current release.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/53005] 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 [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
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2012-04-16 10:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53005
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-16 10:47:15 UTC ---
Yes.
If you got GCC 4.2 from Apple then you could report the bug to Apple, not here.
We do not support GCC 4.2, so it is pointless to report bugs for that version
here, they won't be fixed. If you want support here, you need to use a
supported version.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/53005] 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 [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
` (2 preceding siblings ...)
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
5 siblings, 0 replies; 7+ messages in thread
From: manu at gcc dot gnu.org @ 2012-04-16 11:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53005
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |manu at gcc dot gnu.org
Resolution| |INVALID
--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-16 11:13:28 UTC ---
See: http://gcc.gnu.org/wiki/FAQ#gcc42apple
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/53005] 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 [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
` (3 preceding siblings ...)
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
5 siblings, 0 replies; 7+ messages in thread
From: manu at gcc dot gnu.org @ 2012-04-16 11:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53005
--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-16 11:18:51 UTC ---
Lili Zhao, I forgot to say, but feel free to reopen this if you can reproduce
the bug with GCC 4.7. Thanks for the report anyway, and sorry we cannot help
you.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/53005] 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 [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
` (4 preceding siblings ...)
2012-04-16 11:19 ` manu at gcc dot gnu.org
@ 2012-04-17 2:44 ` zhao86.scholar at gmail dot com
5 siblings, 0 replies; 7+ messages in thread
From: zhao86.scholar at gmail dot com @ 2012-04-17 2:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53005
--- Comment #6 from Lili Zhao <zhao86.scholar at gmail dot com> 2012-04-17 02:43:31 UTC ---
Thanks all the same! I'll try on the latest gcc version to see if the bug
reproduce. Thank you!
2012/4/16 manu at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53005
>
> --- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org>
> 2012-04-16 11:18:51 UTC ---
> Lili Zhao, I forgot to say, but feel free to reopen this if you can
> reproduce
> the bug with GCC 4.7. Thanks for the report anyway, and sorry we cannot
> help
> you.
>
> --
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug.
> You reported the bug.
>
^ 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).