Bug 9986 - [HP-UX] [3.4 regression] Incorrect transformation of fputs_unlocked to fputc_unlocked
Summary: [HP-UX] [3.4 regression] Incorrect transformation of fputs_unlocked to fputc_...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 3.2
: P3 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-07 01:36 UTC by dave.anglin
Modified: 2004-01-17 04:22 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-05-27 13:24:43


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dave.anglin 2003-03-07 01:36:00 UTC
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
Comment 1 Dara Hazeghi 2003-05-26 23:34:30 UTC
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
Comment 2 Andrew Pinski 2003-05-27 13:24:43 UTC
See Dara's comment, marking as a regresion.
Comment 3 John David Anglin 2003-06-05 17:17:12 UTC
See: <http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00450.html>.