On Wed, 2023-12-27 at 11:59 +0800, chenglulu wrote:

> +FAIL: gcc.dg/pr86617.c scan-rtl-dump-times final "mem/v" 6
> 
> In r14-6818 the issue persists. I kind of chased the code and found that the 
> problem is like this:
>   volatile unsigned char u8;
> 
>   void test (void)
>   {
>     u8 = u8 + u8;
>     u8 = u8 - u8;
>   }
> 
> $./gcc/cc1 test.c -o test.s -fdump-rtl-all-all -fdiagnostics-plain-output  
> -Os -fdump-rtl-final -ffat-lto-objects
> 
> test.c.301r.outof_cfglayout
> 
>  (insn 7 6 9 2 (set (reg:DI 80 [ u8.0_1 ])
>         (zero_extend:DI (mem/v/c:QI (symbol_ref:DI ("*.LANCHOR0") [flags 
> 0x182]) [0 u8D.2193+0 S1 A8]))) "volatile.c":5:11 459 {simple_load_uextdiqidi}
>      (nil))
> 
> test.c.302r.split1
> 
> (insn 27 6 28 2 (set (reg:DI 98)
>         (unspec:DI [
>                 (symbol_ref:DI ("*.LANCHOR0") [flags 0x182])
>             ] UNSPEC_PCALAU12I_GR)) "volatile.c":5:11 -1
>      (nil))
> (insn 28 27 9 2 (set (reg:DI 80 [ u8.0_1 ])
>         (zero_extend:DI (mem:QI (lo_sum:DI (reg:DI 98)
>                     (symbol_ref:DI ("*.LANCHOR0") [flags 0x182])) [0  S1 
> A8]))) "volatile.c":5:11 -1
>      (nil))
> 
> The volatile property of the mem here is gone, so the test fails.

Phew.  I guess I couldn't reproduce it because I have Jeff's ext-dce
patch in my local repo, which removed the zero_extend...

I'll rework this patch.

-- 
Xi Ruoyao <xry...@xry111.site>
School of Aerospace Science and Technology, Xidian University

Reply via email to