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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-10-12
           Assignee|unassigned at gcc dot gnu.org      |aldyh at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |amacleod at redhat dot com

--- Comment #2 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Confirmed.

operator_rshift::op1_range is creating a range with swapped operand when the
shift amount is >= precision:

     //    LHS                                                                  
      // 0000 0111 = OP1 >> 3                                                   
      //                                                                        
      // OP1 is anything from 0011 1000 to 0011 1111.  That is, a               
      // range from LHS<<3 plus a mask of the 3 bits we shifted on the          
      // right hand side (0x07).                                                
      tree mask = fold_build1 (BIT_NOT_EXPR, type,
                               fold_build2 (LSHIFT_EXPR, type,
                                            build_minus_one_cst (type),
                                            shift));
      int_range_max mask_range (build_zero_cst (type), mask);

Reply via email to