1 /* Verify that the scheduler does not discard the lexical block. */
2 /* { dg-do compile } */
3 /* { dg-options "-dA" } */
4 /* On MIPS targets that support conditional moves, the optimal
5 implementation of this function is:
6
7 l[wd] tmp,p
8 li $2,2
9 jr $31
10 movz $2,$0,tmp
11
12 After if-conversion, we have a conditional move into a pseudo P
13 followed a copy of P into the return register ($2). P is associated
14 with xyzzy, so if-conversion is behaving as expected, and has not lost
15 the variable association. The destination of the second instruction
16 is associated with the function return value. Combine then combines
17 these two instructions, removing the last use of P and xyzzy.
18
19 Everything is behaving as expected in this scenario, so we avoid
20 using conditional moves for this test. */
21 /* { dg-options "-dA -fno-if-conversion" { target mips*-*-* } } */
22 /* { dg-final { scan-assembler "xyzzy" } } */
23
24 long p;
25
foo(void)26 long foo(void)
27 {
28 {
29 long xyzzy = 0;
30 if (p)
31 xyzzy = 2;
32 return xyzzy;
33 }
34 }
35