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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization, ra

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Before RA:
```
(call_insn 16 15 44 3 (parallel [
            (set (reg:DI 10 a0)
                (call (mem:SI (symbol_ref:SI ("_Z18esp_timer_get_timev") [flags
0x41]  <function_decl 0x7399a835df00 esp_timer_get_time>) [0 esp_timer_get_time
S4 A32])
                    (const_int 0 [0])))
            (use (unspec:SI [
                        (const_int 0 [0])
                    ] UNSPEC_CALLEE_CC))
            (clobber (reg:SI 1 ra))
        ]) "/app/example.cpp":18:33 355 {call_value_internal}
     (expr_list:REG_CALL_DECL (symbol_ref:SI ("_Z18esp_timer_get_timev") [flags
0x41]  <function_decl 0x7399a835df00 esp_timer_get_time>)
        (nil))
    (nil))
(insn 44 16 45 3 (set (reg:SI 141)
        (reg:SI 10 a0)) "/app/example.cpp":18:33 211 {*movsi_internal}
     (expr_list:REG_DEAD (reg:SI 10 a0)
        (nil)))
(insn 45 44 46 3 (set (reg:SI 142 [+4 ])
        (reg:SI 11 a1 [+4 ])) "/app/example.cpp":18:33 211 {*movsi_internal}
     (expr_list:REG_DEAD (reg:SI 11 a1 [+4 ])
        (nil)))
(insn 46 45 47 3 (set (subreg:SI (reg:DI 136 [ _7 ]) 0)
        (reg:SI 141)) "/app/example.cpp":18:33 211 {*movsi_internal}
     (expr_list:REG_DEAD (reg:SI 141)
        (nil)))
(insn 47 46 18 3 (set (subreg:SI (reg:DI 136 [ _7 ]) 4)
        (reg:SI 142 [+4 ])) "/app/example.cpp":18:33 211 {*movsi_internal}
     (expr_list:REG_DEAD (reg:SI 142 [+4 ])
        (nil)))
```


Afterwards:
```
(call_insn 16 15 46 3 (parallel [
            (set (reg:DI 10 a0)
                (call (mem:SI (symbol_ref:SI ("_Z18esp_timer_get_timev") [flags
0x41]  <function_decl 0x775adc3adc00 esp_timer_get_time>) [0 esp_timer_get_time
S4 A32])
                    (const_int 0 [0])))
            (use (unspec:SI [
                        (const_int 0 [0])
                    ] UNSPEC_CALLEE_CC))
            (clobber (reg:SI 1 ra))
        ]) "/app/example.cpp":18:33 431 {call_value_internal}
     (expr_list:REG_CALL_DECL (symbol_ref:SI ("_Z18esp_timer_get_timev") [flags
0x41]  <function_decl 0x775adc3adc00 esp_timer_get_time>)
        (nil))
    (nil))
(insn 46 16 47 3 (set (reg:SI 18 s2 [orig:136 _7 ] [136])
        (reg:SI 10 a0 [141])) "/app/example.cpp":18:33 276 {*movsi_internal}
     (nil))
(insn 47 46 18 3 (set (reg:SI 19 s3 [ _7+4 ])
        (reg:SI 11 a1 [orig:142+4 ] [142])) "/app/example.cpp":18:33 276
{*movsi_internal}
     (nil))
```

Note in GCC 13 and before there was a clobber of reg pseduo 136 between insn
between insn 45 and 46 (in the before RA) which seems to allow the RA to be
better in this case.

Reply via email to