public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/61493] New: Bug exposed by speculative devirtualizing
@ 2014-06-13 6:42 wmi at google dot com
2014-06-13 6:43 ` [Bug tree-optimization/61493] " wmi at google dot com
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: wmi at google dot com @ 2014-06-13 6:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61493
Bug ID: 61493
Summary: Bug exposed by speculative devirtualizing
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: wmi at google dot com
1.cxx is attached.
$~/workarea/gcc-r211604/build/install/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/google/home/wmi/workarea/gcc-r211604/build/install/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/google/home/wmi/workarea/gcc-r211604/build/install/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../src/configure --enable-languages=c,c++ --disable-bootstrap
--prefix=/usr/local/google/home/wmi/workarea/gcc-r211604/build/install
Thread model: posix
gcc version 4.10.0 20140613 (experimental) (GCC)
$~/workarea/gcc-r211604/build/install/bin/g++ -O2 1.cxx
$./a.out
not equal
$~/workarea/gcc-r211604/build/install/bin/g++ -O2 1.cxx
$./a.out
equal
$~/workarea/gcc-r211604/build/install/bin/g++ -O2
-fno-devirtualize-speculatively 1.cxx
$./a.out
equal
Google ref b/15521306
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/61493] Bug exposed by speculative devirtualizing
2014-06-13 6:42 [Bug tree-optimization/61493] New: Bug exposed by speculative devirtualizing wmi at google dot com
@ 2014-06-13 6:43 ` wmi at google dot com
2014-06-13 9:41 ` [Bug tree-optimization/61493] [4.10 Regression] " rguenth at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: wmi at google dot com @ 2014-06-13 6:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61493
--- Comment #1 from wmi at google dot com ---
Created attachment 32931
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32931&action=edit
testcase
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/61493] [4.10 Regression] Bug exposed by speculative devirtualizing
2014-06-13 6:42 [Bug tree-optimization/61493] New: Bug exposed by speculative devirtualizing wmi at google dot com
2014-06-13 6:43 ` [Bug tree-optimization/61493] " wmi at google dot com
@ 2014-06-13 9:41 ` rguenth at gcc dot gnu.org
2014-06-13 15:22 ` ppluzhnikov at google dot com
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-13 9:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61493
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
CC| |hubicka at gcc dot gnu.org
Target Milestone|--- |4.10.0
Summary|Bug exposed by speculative |[4.10 Regression] Bug
|devirtualizing |exposed by speculative
| |devirtualizing
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/61493] [4.10 Regression] Bug exposed by speculative devirtualizing
2014-06-13 6:42 [Bug tree-optimization/61493] New: Bug exposed by speculative devirtualizing wmi at google dot com
2014-06-13 6:43 ` [Bug tree-optimization/61493] " wmi at google dot com
2014-06-13 9:41 ` [Bug tree-optimization/61493] [4.10 Regression] " rguenth at gcc dot gnu.org
@ 2014-06-13 15:22 ` ppluzhnikov at google dot com
2014-06-13 16:36 ` wmi at google dot com
2014-06-24 16:25 ` wmi at google dot com
4 siblings, 0 replies; 6+ messages in thread
From: ppluzhnikov at google dot com @ 2014-06-13 15:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61493
Paul Pluzhnikov <ppluzhnikov at google dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppluzhnikov at google dot com
--- Comment #2 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
Also broken in 4.9
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/61493] [4.10 Regression] Bug exposed by speculative devirtualizing
2014-06-13 6:42 [Bug tree-optimization/61493] New: Bug exposed by speculative devirtualizing wmi at google dot com
` (2 preceding siblings ...)
2014-06-13 15:22 ` ppluzhnikov at google dot com
@ 2014-06-13 16:36 ` wmi at google dot com
2014-06-24 16:25 ` wmi at google dot com
4 siblings, 0 replies; 6+ messages in thread
From: wmi at google dot com @ 2014-06-13 16:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61493
--- Comment #3 from wmi at google dot com ---
Fix a typo in the first post.
$~/workarea/gcc-r211604/build/install/bin/g++ -O2 1.cxx
$./a.out
not equal
$~/workarea/gcc-r211604/build/install/bin/g++ -O0 1.cxx
$./a.out
equal
$~/workarea/gcc-r211604/build/install/bin/g++ -O2
-fno-devirtualize-speculatively 1.cxx
$./a.out
equal
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/61493] [4.10 Regression] Bug exposed by speculative devirtualizing
2014-06-13 6:42 [Bug tree-optimization/61493] New: Bug exposed by speculative devirtualizing wmi at google dot com
` (3 preceding siblings ...)
2014-06-13 16:36 ` wmi at google dot com
@ 2014-06-24 16:25 ` wmi at google dot com
4 siblings, 0 replies; 6+ messages in thread
From: wmi at google dot com @ 2014-06-24 16:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61493
wmi at google dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #4 from wmi at google dot com ---
This is a source problem. So close the bug.
void foo(FST *fst) {
const PAIR &final_pair = fst->Final().getpair();
if (final_pair == global_pair)
__builtin_printf("equal\n");
else
__builtin_printf("not equal\n");
return;
}
The life time of the temporary object generated by fst->Final() will not be
extended after the statement generating it, according to the following rule :
a temporary bound to a return value of a function in a return statement is not
extended: it is destroyed immediately at the end of the return expression. Such
function always returns a dangling reference.
(http://en.cppreference.com/w/cpp/language/reference_initialization)
So it is meaningless to access final_pair afterwards.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-06-24 16:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-13 6:42 [Bug tree-optimization/61493] New: Bug exposed by speculative devirtualizing wmi at google dot com
2014-06-13 6:43 ` [Bug tree-optimization/61493] " wmi at google dot com
2014-06-13 9:41 ` [Bug tree-optimization/61493] [4.10 Regression] " rguenth at gcc dot gnu.org
2014-06-13 15:22 ` ppluzhnikov at google dot com
2014-06-13 16:36 ` wmi at google dot com
2014-06-24 16:25 ` wmi at google 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).