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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE with __builtin_ctzg in  |ICE with __builtin_ctzg and
                   |some cases                  |?:

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
```
        if (fndecl
            && fndecl_built_in_p (fndecl, BUILT_IN_CLZG, BUILT_IN_CTZG)
            && call_expr_nargs (*expr_p) == 2
            && TREE_CODE (CALL_EXPR_ARG (*expr_p, 1)) != INTEGER_CST)
          {
            tree a = save_expr (CALL_EXPR_ARG (*expr_p, 0));
            tree c = build_call_expr_loc (EXPR_LOCATION (*expr_p),
                                          fndecl, 1, a);
            *expr_p = build3_loc (EXPR_LOCATION (*expr_p), COND_EXPR,
                                  integer_type_node,
                                  build2_loc (EXPR_LOCATION (*expr_p),
                                              NE_EXPR, boolean_type_node, a,
                                              build_zero_cst (TREE_TYPE (a))),
                                  c, CALL_EXPR_ARG (*expr_p, 1));
            return GS_OK;
          }
```

And then we go and gimplify this and things go down hill it seems.

Without the const things go ok and we gimplify things just ok.

Reply via email to