]> git.ipfire.org Git - thirdparty/gcc.git/commit
backport: re PR c++/83553 (compiler removes body of the for-loop, although there...
authorJakub Jelinek <jakub@redhat.com>
Mon, 25 Jun 2018 17:10:18 +0000 (19:10 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 25 Jun 2018 17:10:18 +0000 (19:10 +0200)
commit6ab4012d011f2b783dda63385dd2990a0ffa066c
treed1b33fd32c61c513c73cfd636e2d514fabb150c7
parentdd9f67425f27fe1db8e6a154dc4494bb67208301
backport: re PR c++/83553 (compiler removes body of the for-loop, although there is a case label inside)

Backported from mainline
2017-12-23  Jakub Jelinek  <jakub@redhat.com>

PR c++/83553
* fold-const.c (struct contains_label_data): New type.
(contains_label_1): Return non-NULL even for CASE_LABEL_EXPR, unless
inside of a SWITCH_BODY seen during the walk.
(contains_label_p): Use walk_tree instead of
walk_tree_without_duplicates, prepare data for contains_label_1 and
provide own pset.

* c-c++-common/torture/pr83553.c: New test.

From-SVN: r262051
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/torture/pr83553.c [new file with mode: 0644]