This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/83553] [6/7/8 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: Sat, 23 Dec 2017 08:43:42 +0000
- Subject: [Bug c++/83553] [6/7/8 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 #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Sat Dec 23 08:43:10 2017
New Revision: 255988
URL: https://gcc.gnu.org/viewcvs?rev=255988&root=gcc&view=rev
Log:
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-7-branch/gcc/testsuite/c-c++-common/torture/pr83553.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/fold-const.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog