Hi,
This is a simple fix for PR93674.  It adds cand carefully for enumeral type 
iv_use in
case of -fstrict-enums, it also avoids computing, replacing iv_use with the 
candidate
so that no IV of enumeral type is introduced with -fstrict-enums option.

Testcase is also added.  Bootstrap and test on x86_64.  Any comment?

Thanks,
bin
2020-03-02  Bin Cheng  <bin.ch...@linux.alibaba.com>

        PR tree-optimization/93674
        * tree-ssa-loop-ivopts.c (add_iv_candidate_for_use): Add candidate
        for enumeral type iv_use converted from other iv.
        (get_computation_cost, may_eliminate_iv): Avoid compute, eliminate
        iv_use with enumeral type iv_cand in case of -fstrict-enums.

gcc/testsuite
2020-03-02  Bin Cheng  <bin.ch...@linux.alibaba.com>

        PR tree-optimization/93674
        * g++.dg/pr93674.C: New test.

Attachment: pr93674-20200302.txt
Description: Binary data

Reply via email to