1 /* Test for reload failing to eliminate from argp to sp. */
2 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
3 /* { dg-require-effective-target ilp32 } */
4 /* { dg-skip-if "" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
5 /* { dg-options "-O2 -fomit-frame-pointer" } */
7 static int ustrsize (const char *s
);
8 static int (*ucwidth
) (int c
);
9 static int (*ugetxc
) (const char **s
);
10 static int (*usetc
) (char *s
, int c
);
12 char *ustrzcat(char *dest
, int size
, const char *src
)
14 int pos
= ustrsize(dest
);
17 size
-= pos
+ ucwidth(0);
19 while ((c
= ugetxc(&src
)) != 0) {
24 pos
+= usetc(dest
+pos
, c
);
32 static int __attribute__((noinline
))
33 ustrsize (const char *s
)
45 ugetxc_ (const char **s
)
51 usetc_ (char *s
, int c
)
63 /* ??? It is impossible to explicitly modify the hard frame pointer.
64 This will run afoul of code in flow.c that declines to mark regs
65 in eliminate_regs in regs_ever_used. Apparently, we have to wait
66 for reload to decide that it won't need a frame pointer before a
67 variable can be allocated to %ebp.
69 So save, restore, and clobber %ebp by hand. */
71 asm ("pushl %%ebp\n\t"
79 : : "i"(ustrzcat
) : "memory" );