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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=129157
   Last reconfirmed|                            |2026-11-30
     Ever confirmed|0                           |1

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.


Breakpoint 1, fold_ternary_loc (loc=1037759, code=COND_EXPR,
type=0x7ffff761e930, op0=0x7ffff77cbaa0, op1=0x7ffff77dc5e8,
op2=0x7ffff761d330) at
/home/apinski/src/upstream-gcc/gcc/gcc/fold-const.cc:13016
13016             tree tem2 = TREE_OPERAND (arg0, 0);
(gdb) next
13017             while (tem != tem2)
(gdb) p debug_generic_expr(op0)
<<< Unknown tree: c_maybe_const_expr

  (unsigned char) a >>> < 0
$1 = void
(gdb) p debug_generic_expr(op1)
128
$2 = void


There is a missing check for signed type here.  The only reason why it shows up
4.5.3 is because the C front-end is not folding this case and we didn't expect
`a<0` to show up in generic for COND_EXPR.  Similar fashion to PR 129157 in the
unfolded generic happening.

Reply via email to