在 2023/12/23 下午6:44, Xi Ruoyao 写道: > On Sat, 2023-12-23 at 10:29 +0800, chenglulu wrote: >>> The performance drop has nothing to do with this patch. I found that the h264 performance compiled >>> by r14-6787 compared to r14-6421 dropped by 6.4%. > Then I guess we should create a bug report... The code h264 score in r14-6818 is the same as that of r14-6421. > >>  But there is a problem. My regression test has the following two fail items.(based on r14-6787) >> +FAIL: gcc.dg/cpp/_Pragma3.c (test for excess errors) >> +FAIL: gcc.dg/pr86617.c scan-rtl-dump-times final "mem/v" 6 > Strange. I didn't see them on r14-6650 (with or without the patch). > +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.