This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Function clobber_return_register


Can somebody explain what this function is for?  There are no comments
in front of this function (or do_clobber_return_reg) saying what it does.

What I have on Alpha is this in 22.postreload:

(insn 300 361 297 (clobber (reg/i:DI 0 $0)) -1 (insn_list:REG_DEP_ANTI 283 (insn_list:REG_DEP_ANTI 286 (nil)))
    (nil))
;; End of basic block 29, registers live:
 15 [$15] 26 [$26] 29 [$29] 30 [$30] 31 [AP] 63 [FP] 69

;; Start of basic block 30, registers live: 15 [$15] 26 [$26] 29 [$29] 30 [$30] 69
(code_label 297 300 341 1 "" "" [1 uses])

(note 341 297 299 [bb 30] NOTE_INSN_BASIC_BLOCK)

(insn 299 341 302 (use (reg/i:DI 0 $0)) -1 (nil)

In 23.flow2, things have been rearranged in a way that I can't follow, but
now there's no label between the CLOBBER and the USE.

The test case is this tiny Ada code:

function Tretcln return Integer is
   S : String := Integer'Image (1);
   function Ret1 return integer is begin return 1; end;
begin
   return Ret1;
end Tretcln;

and the issue is that there is a cleanup (due to the 'Image) for this function.
Due to the CLOBBER and USE now being in the same basic block, that block is
marked as not having $0 live, so the restore of $0 is deleted as a dead insn
and thus the return value of Ret1 is being lost in the return of Tretcln.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]