public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61674] New: The destructor of a simple class is removed by optimization
@ 2014-07-02 14:58 A.Finch at lancaster dot ac.uk
2014-07-02 15:03 ` [Bug c++/61674] " A.Finch at lancaster dot ac.uk
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: A.Finch at lancaster dot ac.uk @ 2014-07-02 14:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61674
Bug ID: 61674
Summary: The destructor of a simple class is removed by
optimization
Product: gcc
Version: 4.8.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: A.Finch at lancaster dot ac.uk
Created attachment 33046
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33046&action=edit
Log of compilation
In a simple class (LocalGeometryLock) designed to provide a lock the destructor
appears to be removed by optimization. This can be prevented by either adding a
cout to the destructor or adding __attribute__((optimize("-O0"))) after the
destructor definition. This occurs in the code for a large project which it is
not practical to send. Unfortunately it has not proved possible to reproduce
the issue with a simple test program.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/61674] The destructor of a simple class is removed by optimization
2014-07-02 14:58 [Bug c++/61674] New: The destructor of a simple class is removed by optimization A.Finch at lancaster dot ac.uk
@ 2014-07-02 15:03 ` A.Finch at lancaster dot ac.uk
2014-07-02 15:07 ` A.Finch at lancaster dot ac.uk
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: A.Finch at lancaster dot ac.uk @ 2014-07-02 15:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61674
--- Comment #1 from Alex Finch <A.Finch at lancaster dot ac.uk> ---
Created attachment 33047
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33047&action=edit
.ii file zipped to get under 1000 byte limit
added .ii file
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/61674] The destructor of a simple class is removed by optimization
2014-07-02 14:58 [Bug c++/61674] New: The destructor of a simple class is removed by optimization A.Finch at lancaster dot ac.uk
2014-07-02 15:03 ` [Bug c++/61674] " A.Finch at lancaster dot ac.uk
@ 2014-07-02 15:07 ` A.Finch at lancaster dot ac.uk
2014-07-02 15:07 ` A.Finch at lancaster dot ac.uk
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: A.Finch at lancaster dot ac.uk @ 2014-07-02 15:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61674
--- Comment #3 from Alex Finch <A.Finch at lancaster dot ac.uk> ---
Created attachment 33049
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33049&action=edit
header file
header file attached
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/61674] The destructor of a simple class is removed by optimization
2014-07-02 14:58 [Bug c++/61674] New: The destructor of a simple class is removed by optimization A.Finch at lancaster dot ac.uk
2014-07-02 15:03 ` [Bug c++/61674] " A.Finch at lancaster dot ac.uk
2014-07-02 15:07 ` A.Finch at lancaster dot ac.uk
@ 2014-07-02 15:07 ` A.Finch at lancaster dot ac.uk
2014-07-02 15:09 ` A.Finch at lancaster dot ac.uk
2014-07-02 16:54 ` pangbw at gmail dot com
4 siblings, 0 replies; 6+ messages in thread
From: A.Finch at lancaster dot ac.uk @ 2014-07-02 15:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61674
--- Comment #2 from Alex Finch <A.Finch at lancaster dot ac.uk> ---
Created attachment 33048
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33048&action=edit
source file
source file attached
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/61674] The destructor of a simple class is removed by optimization
2014-07-02 14:58 [Bug c++/61674] New: The destructor of a simple class is removed by optimization A.Finch at lancaster dot ac.uk
` (2 preceding siblings ...)
2014-07-02 15:07 ` A.Finch at lancaster dot ac.uk
@ 2014-07-02 15:09 ` A.Finch at lancaster dot ac.uk
2014-07-02 16:54 ` pangbw at gmail dot com
4 siblings, 0 replies; 6+ messages in thread
From: A.Finch at lancaster dot ac.uk @ 2014-07-02 15:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61674
--- Comment #4 from Alex Finch <A.Finch at lancaster dot ac.uk> ---
I should add that this problem was not observed in gcc 4.4.7 and earlier.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/61674] The destructor of a simple class is removed by optimization
2014-07-02 14:58 [Bug c++/61674] New: The destructor of a simple class is removed by optimization A.Finch at lancaster dot ac.uk
` (3 preceding siblings ...)
2014-07-02 15:09 ` A.Finch at lancaster dot ac.uk
@ 2014-07-02 16:54 ` pangbw at gmail dot com
4 siblings, 0 replies; 6+ messages in thread
From: pangbw at gmail dot com @ 2014-07-02 16:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61674
baoshan <pangbw at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pangbw at gmail dot com
--- Comment #5 from baoshan <pangbw at gmail dot com> ---
(In reply to Alex Finch from comment #4)
> I should add that this problem was not observed in gcc 4.4.7 and earlier.
Can you explain why you think it is a bug? Sometimes the code has been
optimized away just because it is not useful for the program running correctly.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-07-02 16:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-02 14:58 [Bug c++/61674] New: The destructor of a simple class is removed by optimization A.Finch at lancaster dot ac.uk
2014-07-02 15:03 ` [Bug c++/61674] " A.Finch at lancaster dot ac.uk
2014-07-02 15:07 ` A.Finch at lancaster dot ac.uk
2014-07-02 15:07 ` A.Finch at lancaster dot ac.uk
2014-07-02 15:09 ` A.Finch at lancaster dot ac.uk
2014-07-02 16:54 ` pangbw 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).