This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/83553] [6 Regression] compiler removes body of the for-loop, although there is a case label inside
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 25 Jun 2018 17:10:52 +0000
- Subject: [Bug c++/83553] [6 Regression] compiler removes body of the for-loop, although there is a case label inside
- Auto-submitted: auto-generated
- References: <bug-83553-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83553
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Mon Jun 25 17:10:18 2018
New Revision: 262051
URL: https://gcc.gnu.org/viewcvs?rev=262051&root=gcc&view=rev
Log:
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.
Added:
branches/gcc-6-branch/gcc/testsuite/c-c++-common/torture/pr83553.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/fold-const.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog