From: Andrew Pinski Date: Fri, 15 May 2026 22:01:50 +0000 (-0700) Subject: ICF: Remove unneeded check for CASE_LABEL_EXPR X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=3cdc8d7974e9c12aa8a2e585a4e177755ff08010;p=thirdparty%2Fgcc.git ICF: Remove unneeded check for CASE_LABEL_EXPR I noticed there was a check to see gimple_switch_label returns a CASE_LABEL_EXPR after already using CASE_LOW/CASE_HIGH on the same value. This removes the check as it is always true. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * ipa-icf-gimple.cc (func_checker::compare_gimple_switch): Remove the check on CASE_LABEL_EXPR since it is redundant. Signed-off-by: Andrew Pinski --- diff --git a/gcc/ipa-icf-gimple.cc b/gcc/ipa-icf-gimple.cc index 4a95ae0bb9b..0a3508170d4 100644 --- a/gcc/ipa-icf-gimple.cc +++ b/gcc/ipa-icf-gimple.cc @@ -931,17 +931,8 @@ func_checker::compare_gimple_switch (const gswitch *g1, const gswitch *g2) if (!tree_int_cst_equal (high1, high2)) return return_false_with_msg ("case high values are different"); - if (TREE_CODE (label1) == CASE_LABEL_EXPR - && TREE_CODE (label2) == CASE_LABEL_EXPR) - { - label1 = CASE_LABEL (label1); - label2 = CASE_LABEL (label2); - - if (!compare_operand (label1, label2, OP_NORMAL)) - return return_false_with_msg ("switch label_exprs are different"); - } - else if (!tree_int_cst_equal (label1, label2)) - return return_false_with_msg ("switch labels are different"); + if (!compare_operand (CASE_LABEL (label1), CASE_LABEL (label2), OP_NORMAL)) + return return_false_with_msg ("switch label_exprs are different"); } return true;