PR c++/70847
commit0406b32fbc445c563cef788e295e13a23c4257a8
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Jun 2016 19:48:22 +0000 (6 19:48 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Jun 2016 19:48:22 +0000 (6 19:48 +0000)
tree0138cff9c5f695765b4a47c8f04722a3d3d06fe5
parentb1445999fa4d469ba43b9ae478843aec33cecd7d
PR c++/70847
PR c++/71330
PR c++/71393
* cp-gimplify.c (cp_fold_r): Set *walk_subtrees = 0 and return NULL
right after cp_fold call if cp_fold has returned the same stmt
already in some earlier cp_fold_r call.
(cp_fold_function): Add pset automatic variable, pass its address
to cp_walk_tree.

* g++.dg/opt/pr70847.C: New test.
* g++.dg/ubsan/pr70847.C: New test.
* g++.dg/ubsan/pr71393.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237151 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/cp-gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr70847.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ubsan/pr70847.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ubsan/pr71393.C [new file with mode: 0644]