From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11163 invoked by alias); 7 Mar 2003 01:36:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 11139 invoked by uid 71); 7 Mar 2003 01:36:01 -0000 Resent-Date: 7 Mar 2003 01:36:01 -0000 Resent-Message-ID: <20030307013601.11137.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, dave.anglin@nrc.ca Received: (qmail 10572 invoked by uid 48); 7 Mar 2003 01:35:03 -0000 Message-Id: <20030307013503.10571.qmail@sources.redhat.com> Date: Fri, 07 Mar 2003 01:36:00 -0000 From: dave.anglin@nrc.ca Reply-To: dave.anglin@nrc.ca To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: middle-end/9986: Incorrect transformation of fputs_unlocked to fputc_unlocked X-SW-Source: 2003-03/txt/msg00324.txt.bz2 List-Id: >Number: 9986 >Category: middle-end >Synopsis: Incorrect transformation of fputs_unlocked to fputc_unlocked >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Mar 07 01:36:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Dave Anglin >Release: gcc 3.2 branch and later >Organization: >Environment: hppa1.1-hp-hpux10.20 >Description: 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 >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: