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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-09-13
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
Confirmed.

We have this RTX in _.C.358r.dwarf2:

(insn 24 89 25 3 (parallel [
            (set (reg/f:SI 7 sp)
                (plus:SI (reg/f:SI 7 sp)
                    (const_int -4116 [0xffffffffffffefec])))
            (clobber (reg:CC 17 flags))
        ]) "pr116698.C":17:7 282 {*addsi_1}
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (nil)))

and:

(insn 29 91 30 5 (parallel [
            (set (reg/f:SI 7 sp)
                (plus:SI (reg/f:SI 7 sp)
                    (const_int -4096 [0xfffffffffffff000])))
            (clobber (reg:CC 17 flags))
        ]) "pr116698.C":17:7 282 {*addsi_1}
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (nil)))

but ... where are REG_ARGS_SIZE tags?

This leads to the invalid:

(note 149 54 55 6
        .cfi_GNU_args_size -4
         NOTE_INSN_CFI)

before:

(call_insn 55 149 133 6 (parallel [
            (call (mem:QI (symbol_ref:SI ("_ZN1TC1E1S") [flags 0x41] 
<function_decl 0x7f763af9c500 __ct_comp >) [0 __ct_comp  S1 A8])
                (const_int 24 [0x18]))
            (set (reg/f:SI 7 sp)
                (plus:SI (reg/f:SI 7 sp)
                    (const_int 24 [0x18])))
        ]) "pr116698.C":17:10 discrim 1 1412 {*call_pop}
     (expr_list:REG_EH_REGION (const_int 1 [0x1])
        (expr_list:REG_ARGS_SIZE (const_int -24 [0xffffffffffffffe8])
            (nil)))
    (expr_list:SI (use (mem/f:SI (reg/f:SI 7 sp) [0  S4 A32]))
        (expr_list:BLK (use (mem:BLK (plus:SI (reg/f:SI 7 sp)
                        (const_int 4 [0x4])) [0  S20 A32]))
            (nil))))

It looks that the issue is specific to -fstack-check=generic, because already
in _.C.268r.expand, there are no REG_ARGS_SIZE tags on (insn 24) and (insn 29).

Reply via email to