This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/83553] [6 Regression] compiler removes body of the for-loop, although there is a case label inside


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]