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

--- Comment #4 from Xiaoguang <xgchenshy at 126 dot com> ---
(In reply to Xiaoguang from comment #2)
> (In reply to Richard Biener from comment #1)
> > Can you provide preprocessed source of the whole translation unit so the
> > testcase is compilable?
> 
> Sure, please see below complete code.
> 
> void CWLCollectReadRegData(u32* dst,u16 reg_start, u32 reg_length,u32*
> total_length, addr_t status_data_base_addr)
> {
>   u32 data_length=0;
>   {
>     //opcode
>     *dst++ = (OPCODE_RREG<<27)|(reg_length<<16)|(reg_start*4);
>     data_length++;
>  
>     //data
>     volatile u32 temp_32 = (u32)status_data_base_addr; // fix compiler
> optimization -O2 bug:  stur  x4, [x0, #4]
>     *dst++ = temp_32;
>     data_length++;
>  
>     if(sizeof(addr_t) == 8) {
>       *dst++ = (u32)(((u64)status_data_base_addr)>>32);
>       data_length++;
>     } else {
>       *dst++ = 0;
>       data_length++;
>     }
>     //alignment
>     *dst = 0;
>     data_length++;
>  
>     *total_length = data_length;
>   }
> }

please ignore this, we added volatile to avoid such issue

Reply via email to