re PR c++/89698 (Run-time error due to optimization of field access after cast at...
authorRichard Biener <rguenther@suse.de>
Thu, 14 Mar 2019 09:24:21 +0000 (09:24 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 14 Mar 2019 09:24:21 +0000 (09:24 +0000)
commitea9d9d749c3203e9fb01267fabecad93b7f1c06c
tree8ae68e5a87de5cfccd05b9746dad560357dfe764
parentf54e63dfa34c4c9922a4cb35d2f8c28c92135b8c
re PR c++/89698 (Run-time error due to optimization of field access after cast at -Os/-O2 and higher)

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

PR middle-end/89698
* fold-const.c (operand_equal_p): For INDIRECT_REF check
that the access types are similar.

* g++.dg/torture/pr89698.C: New testcase.

From-SVN: r269677
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr89698.C [new file with mode: 0644]