public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/38539] New: inline-asm with labels does not compile at -O3
@ 2008-12-16 5:11 sergio dot pokrovskij at gmail dot com
2008-12-16 6:24 ` [Bug c/38539] " steven at gcc dot gnu dot org
0 siblings, 1 reply; 3+ messages in thread
From: sergio dot pokrovskij at gmail dot com @ 2008-12-16 5:11 UTC (permalink / raw)
To: gcc-bugs
When -O3 key is specified, gcc inlines functions with inline asm
without dismangling the labels in these asm fragments. This occurs in
all flavours of the asm pieces: CONSTRAIN, MASM and plain string:
% cat gas-label.c
f() {
#ifdef CONSTRAIN
asm volatile ("lab:mov %0, %0"::"r"(1.5F));
#elif defined(MASM)
asm{mov eax, 0x3fc00;
lab: mov eax, eax}
#else
asm(" movl $0x3fc, %eax \n"
"lab: mov %eax, %eax");
#endif
}
main() {
f();
f();
}
%
% gcc -pedantic gas-label.c
% gcc -DCONSTRAIN gas-label.c -finline-functions
% gcc -DCONSTRAIN gas-label.c -O3
/tmp/ccd4XxX8.s: Assembler messages:
/tmp/ccd4XxX8.s:28: Error: symbol `lab' is already defined
/tmp/ccd4XxX8.s:29: Error: symbol `lab' is already defined
%
% gcc -v -save-temps -DCONSTRAIN gas-label.c -O3
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1.0/configure
--prefix=/nfs/ins/proj/icl/qa/QA_verification/gnu/local --disable-nls
--enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.1.0
/nfs/ins/proj/icl/qa/QA_verification/gnu/local/libexec/gcc/i686-pc-linux-gnu/4.1.0/cc1
-E -quiet -v -DCONSTRAIN gas-label.c -mtune=pentiumpro -O3 -fpch-preprocess -o
gas-label.i
ignoring nonexistent directory
"/nfs/ins/proj/icl/qa/QA_verification/gnu/local/lib/gcc/i686-pc-linux-gnu/4.1.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/nfs/ins/proj/icl/qa/QA_verification/gnu/local/include
/nfs/ins/proj/icl/qa/QA_verification/gnu/local/lib/gcc/i686-pc-linux-gnu/4.1.0/include
/usr/include
End of search list.
/nfs/ins/proj/icl/qa/QA_verification/gnu/local/libexec/gcc/i686-pc-linux-gnu/4.1.0/cc1
-fpreprocessed gas-label.i -quiet -dumpbase gas-label.c -mtune=pentiumpro
-auxbase gas-label -O3 -version -o gas-label.s
GNU C version 4.1.0 (i686-pc-linux-gnu)
compiled by GNU C version 4.1.0.
GGC heuristics: --param ggc-min-expand=100 --param
ggc-min-heapsize=131072
Compiler executable checksum: 9c14cefcbb08ee412959d25f87b03831
/nfs/ins/proj/icl/qa/QA_verification/gnu/local/lib/gcc/i686-pc-linux-gnu/4.1.0/../../../../i686-pc-linux-gnu/bin/as
-V -Qy -o gas-label.o gas-label.s
GNU assembler version 2.16 (i686-pc-linux-gnu) using BFD version 2.16
gas-label.s: Assembler messages:
gas-label.s:28: Error: symbol `lab' is already defined
gas-label.s:29: Error: symbol `lab' is already defined
%
%
% cat gas-label.i
# 1 "gas-label.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "gas-label.c"
f() {
asm volatile ("lab:mov %0, %0"::"r"(1.5F));
}
main() {
f();
f();
}
%
--
Summary: inline-asm with labels does not compile at -O3
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sergio dot pokrovskij at gmail dot com
GCC host triplet: i386 GNU/Linux
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38539
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/38539] inline-asm with labels does not compile at -O3
2008-12-16 5:11 [Bug c/38539] New: inline-asm with labels does not compile at -O3 sergio dot pokrovskij at gmail dot com
@ 2008-12-16 6:24 ` steven at gcc dot gnu dot org
0 siblings, 0 replies; 3+ messages in thread
From: steven at gcc dot gnu dot org @ 2008-12-16 6:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from steven at gcc dot gnu dot org 2008-12-16 06:22 -------
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20468#c1
--
steven at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38539
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/38539] inline-asm with labels does not compile at -O3
[not found] <bug-38539-4@http.gcc.gnu.org/bugzilla/>
@ 2011-04-06 23:05 ` pinskia at gcc dot gnu.org
0 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-04-06 23:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38539
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|INVALID |DUPLICATE
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-04-06 23:05:03 UTC ---
*** This bug has been marked as a duplicate of bug 20468 ***
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-04-06 23:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-16 5:11 [Bug c/38539] New: inline-asm with labels does not compile at -O3 sergio dot pokrovskij at gmail dot com
2008-12-16 6:24 ` [Bug c/38539] " steven at gcc dot gnu dot org
[not found] <bug-38539-4@http.gcc.gnu.org/bugzilla/>
2011-04-06 23:05 ` pinskia at gcc dot gnu.org
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).