| 1 |
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */ |
| 2 |
/* { dg-options "-fdump-rtl-dfinit" } */ |
| 3 |
|
| 4 |
int __RTL (startwith ("rtl-dfinit")) times_two (int i) |
| 5 |
{ |
| 6 |
/* C function: |
| 7 |
return i * 2; */ |
| 8 |
(function "times_two" |
| 9 |
(insn-chain |
| 10 |
(cnote 1 NOTE_INSN_DELETED) |
| 11 |
(block 2 |
| 12 |
(edge-from entry (flags "FALLTHRU")) |
| 13 |
(cnote 4 [bb 2] NOTE_INSN_BASIC_BLOCK) |
| 14 |
(cinsn 2 (set (mem/c:SI (plus:DI (reg/f:DI frame) |
| 15 |
(const_int -4)) [1 i+0 S4 A32]) |
| 16 |
(reg:SI di [ i ])) "../../src/times-two.c":2) |
| 17 |
(cnote 3 NOTE_INSN_FUNCTION_BEG) |
| 18 |
(cinsn 6 (set (reg:SI <2>) |
| 19 |
(mem/c:SI (plus:DI (reg/f:DI frame) |
| 20 |
(const_int -4)) [1 i+0 S4 A32])) "../../src/times-two.c":3) |
| 21 |
(cinsn 7 (parallel [ |
| 22 |
(set (reg:SI <0> [ _2 ]) |
| 23 |
(ashift:SI (reg:SI <2>) |
| 24 |
(const_int 1))) |
| 25 |
(clobber (reg:CC flags)) |
| 26 |
]) "../../src/times-two.c":3 |
| 27 |
(expr_list:REG_EQUAL (ashift:SI (mem/c:SI (plus:DI (reg/f:DI frame) |
| 28 |
(const_int -4)) [1 i+0 S4 A32]) |
| 29 |
(const_int 1)))) |
| 30 |
(cinsn 10 (set (reg:SI <1> [ <retval> ]) |
| 31 |
(reg:SI <0> [ _2 ])) "../../src/times-two.c":3) |
| 32 |
(cinsn 14 (set (reg/i:SI ax) |
| 33 |
(reg:SI <1> [ <retval> ])) "../../src/times-two.c":4) |
| 34 |
(cinsn 15 (use (reg/i:SI ax)) "../../src/times-two.c":4) |
| 35 |
(edge-to exit (flags "FALLTHRU")) |
| 36 |
) ;; block 2 |
| 37 |
) ;; insn-chain |
| 38 |
(crtl |
| 39 |
(return_rtx |
| 40 |
(reg/i:SI ax) |
| 41 |
) ;; return_rtx |
| 42 |
) ;; crtl |
| 43 |
) ;; function "times_two" |
| 44 |
} |
| 45 |
|
| 46 |
/* Verify that the dataflow information matches what cc1 would have |
| 47 |
generated. In particular, in earlier versions of the RTL |
| 48 |
frontend, the exit block use of reg 0 (ax) wasn't picked up |
| 49 |
on, due to not setting up crtl->return_rtx based on |
| 50 |
DECL_RESULT (fndecl). */ |
| 51 |
|
| 52 |
/* { dg-final { scan-rtl-dump ";; exit block uses.*0 .ax. 6 .bp. 7 .sp. 19 .frame." "dfinit" } } */ |
| 53 |
|
| 54 |
/* { dg-final { scan-rtl-dump ";; regs ever live.*0 .ax. 5 .di. 17 .flags." "dfinit" } } */ |