This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CARM compiler, long long comparing with 0 (-O1, -O2, -O3)

Hello, Does anyone have any problems with comparing variables of type uint64_t with zero value? In my case it does not work on optimization level more than -O0? (Keil 5.03.0.76)

Parents
  • Part of my code...

    typedef struct xxx_state_s {
            volatile unsigned                       rx_start : 6;
    ...
            uint64_t                                rx_packet;
    ...
    } xxx_state_t;
    
    ...
    if(state->rx_start == 0) {
     if(state->rx_packet != 0) {
      // Pack message from packet
      // Will enter here always under optimization level more than -O0
      ...
     }
    }
    

Reply
  • Part of my code...

    typedef struct xxx_state_s {
            volatile unsigned                       rx_start : 6;
    ...
            uint64_t                                rx_packet;
    ...
    } xxx_state_t;
    
    ...
    if(state->rx_start == 0) {
     if(state->rx_packet != 0) {
      // Pack message from packet
      // Will enter here always under optimization level more than -O0
      ...
     }
    }
    

Children