<< Back to previous view

[PCC-169] fprintf fails badly with NetBSD/pmax (MIPS) Created: 22/Sep/10  Updated: 14/Oct/10

Status: Open
Project: pcc
Component/s: pcc backend
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Altamiranus Assignee: Unassigned
Resolution: Unresolved Votes: 0
Environment: NetBSD/pmax 5.0.2 - MIPS emulation under gxemul

File Attachments: File fprintf.E     File fprintf.S    

Using fprintf make simple programs to crash and burn.

--- fprintf.c ---
#include <stdio.h>
int main(void)
   fprintf(stdout, "%s\n", "hello, world");
   return 0;
--- fprintf.c ---
$ pcc -o f fprintf.c
$ ./f
[ warning: LOW reference: vaddr=0x0000000000000110, exception TLBL, pc=0x000000007df0ad3c <(no symbol)> ]
Memory fault (core dumped)

The first line appears to be generated by the emulator.

$ pcc -v -g -E fprintf.c > fprintf.E
/usr/local/libexec/cpp -v -D__PCC__=0 -D__PCC_MINOR__=9 -D__PCC_MINORMINOR__=9 -D__GNUC__=4 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=1 -D__GNUC_STDC_INLINE__=1 -D__REGISTER_PREFIX__= -D__USER_LABEL_PREFIX__= -D__NetBSD__ -D__ELF__ -D__STDC_ISO_10646__=200009L -D__WCHAR_TYPE__=int -D__SIZEOF_WCHAR_T__=4 -D__WCHAR_MAX__=2147483647 -D__WINT_TYPE__=unsigned int -D__SIZE_TYPE__=unsigned long -D__PTRDIFF_TYPE__=int -D__SIZEOF_WINT_T__=4 -D__mips__ -S /usr/local/include/pcc/ -S /usr/include/ -S /usr/local/lib/pcc/mipsel-unknown-netbsd5.0.2/0.9.9/include/ fprintf.c

Attached are the file created by the preprocessor (fprintf.E), and the assembler instructions generated by ccom (fprintf.S).

The program behaves as expected when fprintf is replaced with printf.

Comment by Altamiranus [ 14/Oct/10 12:03 AM ]
May be related to PCC-58.
Generated at Wed Apr 25 14:22:04 CEST 2018 using JIRA Enterprise Edition, Version: 3.13.1-#333.