re PR c++/89698 (Run-time error due to optimization of field access after cast at...
authorRichard Biener <rguenther@suse.de>
Fri, 3 May 2019 07:07:28 +0000 (07:07 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 3 May 2019 07:07:28 +0000 (07:07 +0000)
commit37f808c4a683a7431b7aa6d49f4c2e385cc0d707
tree17b318f02a0ab1defcde8d90f4cc17251ff68994
parentc0f9d1fd7e54434e4f06b20b9a61a9d35c578223
re PR c++/89698 (Run-time error due to optimization of field access after cast at -Os/-O2 and higher)

2019-05-03  Richard Biener  <rguenther@suse.de>

PR tree-optimization/89698
* gimple-fold.c (canonicalize_constructor_val): Early out
for constants, handle unfolded INTEGER_CSTs as they appear in
C++ virtual table ctors.

* g++.dg/tree-ssa/pr89698.C: New testcase.

From-SVN: r270833
gcc/ChangeLog
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr89698.C [new file with mode: 0644]