https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77750

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Comment on attachment 39694
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39694
Possible patch (correctly formatted magic "fall through" comments)

>Index: gcc/combine.c
>===================================================================
>--- gcc/combine.c      (revision 240520)
>+++ gcc/combine.c      (working copy)
>@@ -11370,6 +11370,8 @@ simplify_compare_const (enum rtx_code code, machin
>       else
>       break;
> 
>+      /* fall through.  */
>+

Yes this is correct  but maybe it is better to rewrite this code slightly:
      if (const_op <= 0)
        break;

      const_op -= 1;
      code = LE;
      /* fall through.  */


>     case LE:
>       /* <= C is equivalent to < (C + 1); we do this for C < 0  */
>       if (const_op < 0)
>@@ -11399,6 +11401,8 @@ simplify_compare_const (enum rtx_code code, machin
>       else
>       break;
> 
>+      /* fall through.  */

Likewise.

>+
>     case GT:
>       /* > C is equivalent to >= (C + 1); we do this for C < 0.  */
>       if (const_op < 0)
>@@ -11927,7 +11931,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0
>         else
>           break;
> 
>-        /* ... fall through ...  */
>+        /* fall through.  */

Likewise.

> 
>       case ZERO_EXTEND:
>         mode = GET_MODE (XEXP (op0, 0));
>@@ -12339,7 +12343,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0
>             continue;
>           }
> 
>-        /* ... fall through ...  */
>+        /* fall through.  */

Do something similar:
          /* If the inner mode is narrower and we are extracting the low part,
             we can treat the SUBREG as if it were a ZERO_EXTEND.  */
          if (!subreg_lowpart_p (op0)
              &|| GET_MODE_PRECISION (GET_MODE (SUBREG_REG (op0))) >=
mode_width)
            break;

          /* fall through  */


>+
>       case LSHIFTRT:
>         /* If we have (compare (xshiftrt FOO N) (const_int C)) and
>            the low order N bits of FOO are known to be zero, we can do this
>Index: gcc/fold-const.c
>===================================================================
>--- gcc/fold-const.c   (revision 240520)
>+++ gcc/fold-const.c   (working copy)
>@@ -6284,7 +6284,7 @@ extract_muldiv_1 (tree t, tree c, enum tree_code c
>         return omit_one_operand (type, integer_zero_node, op0);
>       }
> 
>-      /* ... fall through ...  */
>+      /* fall through.  */

This one is obvious.

> 
>     case TRUNC_DIV_EXPR:  case CEIL_DIV_EXPR:  case FLOOR_DIV_EXPR:
>     case ROUND_DIV_EXPR:  case EXACT_DIV_EXPR:

Reply via email to