re PR c++/70847 (exponential time in cp_fold for chained virtual function calls)
authorJakub Jelinek <jakub@redhat.com>
Mon, 6 Jun 2016 19:48:22 +0000 (21:48 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 6 Jun 2016 19:48:22 +0000 (21:48 +0200)
commit6f5bcd24004651c3b92af349fcfa56d7328c8ee4
tree0138cff9c5f695765b4a47c8f04722a3d3d06fe5
parent158beb4ab3f6adace5f3c328cba3470eb1cc6357
re PR c++/70847 (exponential time in cp_fold for chained virtual function calls)

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.

Co-Authored-By: Patrick Palka <ppalka@gcc.gnu.org>
From-SVN: r237151
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]