On 5/15/24 12:32, Jeff Law wrote:
>
> On 5/15/24 12:55 PM, Vineet Gupta wrote:
>> Saw this little room for improvement in current debugging of
>> prologue/epilogue expansion code.
>>
>> ---
>>
>> Use the following pattern consistently
>>      `RTX_FRAME_RELATED_P (gen_insn (insn)) = 1`
>>
>> vs. calling gen_insn around apriori gen_xxx_insn () calls.
>>
>> This reduces weird indentations which are done inconsistently.
>>
>> And also move the RTX_FRAME_RELATED_P () calls immediately after those
>> gen_xxx_insn () calls.
>>
>> gcc/ChangeLog:
>>      * config/riscv/riscv.cc (riscv_expand_epilogue): Use pattern
>>      described above.
>>      (riscv_expand_prologue): Ditto.
>>      (riscv_for_each_saved_v_reg): Ditto.
> Thanks for cleaning this up.  Just having consistency is helpful.
>
> All this gets scrambled again with stack-clash protection :(  But that's 
> just the nature of the beast.

Apparently it couldn't clear CI - so much for an NFC.
And I can now see why:

-      insn = emit_insn (riscv_gen_gpr_save_insn (frame));
+      insn = riscv_gen_gpr_save_insn (frame);
+      RTX_FRAME_RELATED_P (emit_insn (insn)) = 1;
...
 
-      RTX_FRAME_RELATED_P (insn) = 1;
       REG_NOTES (insn) = dwarf;

The REG_NOTE is being added to older rtx insn lacking the
RTX_FRAME_RELATED_P tagging.

-Vineet

Reply via email to