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

--- Comment #24 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #23)
> Created attachment 60785 [details]
> Fully reduced testcase
> 
> `./xgcc -B. -O2 -g -fcompare-debug -S t.c -fschedule-insns` is enough now.
> This fails for both C and C++ front-ends.

With the latest patch (attached here) we get:
```
diff -up t.cc.gkd t.gk.cc.gkd |less
--- t.cc.gkd    2025-03-16 21:42:13.762110092 -0700
+++ t.gk.cc.gkd 2025-03-16 21:42:13.909110107 -0700
@@ -108,13 +108,9 @@ Declarations used by l, sorted by DECL_U
 (note # 0 0 NOTE_INSN_PROLOGUE_END)
 (insn # 0 0 (set (reg/f:DI 19 x19 [orig:109 m ] [109])
         (reg:DI 1 x1 [ m ]))# {*movdi_aarch64}
-     (nil))
-(insn:TI # 0 0 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp)
-                (const_int 40 [0x28])) [ %sfp+-24 S8 A64])
-        (reg/f:DI 1 x1 [orig:109 m ] [109]))# {*movdi_aarch64}
-     (expr_list:REG_DEAD (reg/f:DI 1 x1 [orig:109 m ] [109])
+     (expr_list:REG_DEAD (reg:DI 1 x1 [ m ])
         (nil)))
-(call_insn # 0 0 (parallel [
+(call_insn:TI # 0 0 (parallel [
             (call (mem:DI (symbol_ref:DI ("_Z1gv") [flags 0x41] 
<function_decl # g>) [ g S8 A8])
                 (const_int 0 [0]))
             (unspec:DI [


```

The first difference is in LRA:
```
          ))))))))))))))))))))))))))))))))))))))))))))))))
  ----------------------------------
          ((((((((((((((((((((((((((((((((((((((((((((((((
      Creating newreg=112, assigning class NO_REGS to save r112
   14: call [`_Z1gv'] argc:0
      REG_CALL_DECL `_Z1gv'
    Add reg<-save before:
   61: r109:DI=r112:DI

   13: NOTE_INSN_BASIC_BLOCK 3
    Add save<-reg after:
   60: r112:DI=r109:DI
```

Is there for without -g and missing for the -g case.

I hope this helps. Because this is now a small testcase and all.

Reply via email to