public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96982] New: no assembler error with -O1/O2/O3, but with -O0
@ 2020-09-08 13:19 tangyixuan at mail dot dlut.edu.cn
2020-09-08 14:22 ` [Bug c++/96982] " rguenth at gcc dot gnu.org
2020-09-08 14:31 ` jakub at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: tangyixuan at mail dot dlut.edu.cn @ 2020-09-08 13:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96982
Bug ID: 96982
Summary: no assembler error with -O1/O2/O3, but with -O0
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: tangyixuan at mail dot dlut.edu.cn
Target Milestone: ---
Hi, the following code is compiled with optimizations (-O1/O2/O3), but is not
compiled with -O0.
$ cat s.cpp
class C1 {
static void f1 ();
};
class C2 {
public : static void f2 () __attribute__ (( __section__ ("")));
};
inline void C2 :: f2 (){}
void C1 :: f1 (){
C2 :: f2 ();
}
$ g++ -c -O2 s.cpp
success.
$ g++ -c -O0 s.cpp
/tmp/ccBs5PW9.s: Assembler messages:
/tmp/ccBs5PW9.s:3: Error: missing name
$ g++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc-20200823/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/gcc-20200823/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-11-20200823/configure --prefix=/usr/local/gcc-20200823
--enable-checking=release --enable-languages=c,c++ --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20200823 (experimental) (GCC)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/96982] no assembler error with -O1/O2/O3, but with -O0
2020-09-08 13:19 [Bug c++/96982] New: no assembler error with -O1/O2/O3, but with -O0 tangyixuan at mail dot dlut.edu.cn
@ 2020-09-08 14:22 ` rguenth at gcc dot gnu.org
2020-09-08 14:31 ` jakub at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-09-08 14:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96982
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
there's a duplicate with section("").
*** This bug has been marked as a duplicate of bug 96981 ***
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/96982] no assembler error with -O1/O2/O3, but with -O0
2020-09-08 13:19 [Bug c++/96982] New: no assembler error with -O1/O2/O3, but with -O0 tangyixuan at mail dot dlut.edu.cn
2020-09-08 14:22 ` [Bug c++/96982] " rguenth at gcc dot gnu.org
@ 2020-09-08 14:31 ` jakub at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-09-08 14:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96982
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
And the reason it isn't diagnosed with -O2 etc. is only that it is inlined and
not emitted out of line. Try -O2 -fkeep-inline-functions or take the address
of the static data member function.
section ("") name is like any other invalid section, consider section ("foo bar
baz") or section ("+_*/%^") etc.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-08 14:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-08 13:19 [Bug c++/96982] New: no assembler error with -O1/O2/O3, but with -O0 tangyixuan at mail dot dlut.edu.cn
2020-09-08 14:22 ` [Bug c++/96982] " rguenth at gcc dot gnu.org
2020-09-08 14:31 ` jakub 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).