HP-UX 10.20 has fputs_unlocked in libc. However, it doesn't have fputc_unlocked. GCC appears to optimize a call to fputs_unlocked with a character count of one to a call to fputc_unlocked. This fails on HP-UX 10.20. Here is a little test program, "fputc_unlocked.c", which demonstates the problem: typedef struct { int __cnt; unsigned char *__ptr; unsigned char *__base; unsigned short __flag; unsigned char __fileL; unsigned char __fileH; } FILE; extern FILE __iob[]; extern char *fgets_unlocked(char *, int, FILE *); int main () { fputs_unlocked ("\n", (&__iob[1])); } 516 (hiauly1)dave> /opt/gnu/bin/gcc -o fputc_unlocked fputc_unlocked.c -O1 /usr/ccs/bin/ld: Unsatisfied symbols: fputc_unlocked (code) collect2: ld returned 1 exit status Release: gcc 3.2 branch and later Environment: hppa1.1-hp-hpux10.20
Hello, on gcc 3.2.3 and 3.3 branch, I do not see the behavior described (the invalid transformation), but on gcc mainline (20030509), this problem does still occur. Dara
See Dara's comment, marking as a regresion.
See: <http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00450.html>.