Skip to content

Commit 1036d77

Browse files
committed
better detection of broken -fzero-call-used-regs
gcc 13.2.0 on ppc64le refuses to compile some function, including cipher.c:compression_alg_list() with an error: > sorry, unimplemented: argument ‘used’ is not supportedcw > for ‘-fzero-call-used-regs’ on this target This extends the autoconf will-it-work test with a similarly- structured function that seems to catch this. Spotted/tested by Colin Watson; bz3645
1 parent 8241b9c commit 1036d77

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

m4/openssh.m4

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,24 @@ char *f2(char *s, ...) {
2020
va_end(args);
2121
return strdup(ret);
2222
}
23+
const char *f3(int s) {
24+
return s ? "good" : "gooder";
25+
}
2326
int main(int argc, char **argv) {
24-
(void)argv;
2527
char b[256], *cp;
28+
const char *s;
2629
/* Some math to catch -ftrapv problems in the toolchain */
2730
int i = 123 * argc, j = 456 + argc, k = 789 - argc;
2831
float l = i * 2.1;
2932
double m = l / 0.5;
3033
long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
34+
(void)argv;
3135
f(1);
32-
snprintf(b, sizeof b, "%d %d %d %f %f %lld %lld\n", i,j,k,l,m,n,o);
36+
s = f3(f(2));
37+
snprintf(b, sizeof b, "%d %d %d %f %f %lld %lld %s\n", i,j,k,l,m,n,o,s);
3338
if (write(1, b, 0) == -1) exit(0);
34-
cp = f2("%d %d %d %f %f %lld %lld\n", i,j,k,l,m,n,o);
39+
cp = f2("%d %d %d %f %f %lld %lld %s\n", i,j,k,l,m,n,o,s);
40+
if (write(1, cp, 0) == -1) exit(0);
3541
free(cp);
3642
/*
3743
* Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does

0 commit comments

Comments
 (0)