Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!necntc!necis!mrst!sdti!mjy From: mjy@sdti.UUCP (Michael J. Young) Newsgroups: comp.sys.ibm.pc,comp.unix.xenix Subject: Re: 386 unix (was Re: 386 demand paged virtual memory) Message-ID: <129@sdti.UUCP> Date: Fri, 25-Sep-87 12:24:34 EDT Article-I.D.: sdti.129 Posted: Fri Sep 25 12:24:34 1987 Date-Received: Sun, 27-Sep-87 09:38:02 EDT References: <125@snark.UUCP> <299@nuchat.UUCP> <358@netxcom.UUCP> <158@splut.UUCP> <380@micropen> <98@sdeggo.UUCP> Reply-To: mjy@sdti.UUCP (0000-Michael J. Young) Organization: Software Development Technologies, Sudbury MA Lines: 66 Xref: mnetor comp.sys.ibm.pc:8319 comp.unix.xenix:837 In article <98@sdeggo.UUCP> dave@sdeggo.UUCP (David L. Smith) writes: >In article <380@micropen>, dave@micropen (David F. Carlson) writes: >> Are there any beta sites that can confirm or deny these rather reasonable >> claims? Has anyone *ever* had a demonstrable, verifiable compiler bug >> with the Microport PCC-based compiler? I don't know anything about the 386 compiler, but the following code breaks the 286 compiler: int *alloc(); int kl() { int s; char *am; (am == 0) ? (am = (char *) alloc((long) s)): 0; } Compiling the above function in large memory model causes an internal compiler error : register allocation error. The generated code (up until the compiler aborts) is: .file "t1.c" .data .text .def kl; .val kl; .scl 2; .type 044; .endef .globl kl kl: enter $.F1,$0 test -4(%bp) jne .10000 test -6(%bp) jne .10000 .10001: mov -2(%bp),%ax cwd push %dx push %ax lcall alloc add $4,%sp mov %ax,-6(%bp) mov %dx,-4(%bp) jmp .10002 .10000: xor %ax,%ax xor %dx,%dx .10002: mov %ax,%bx ; oops! mov %bx,%ax I'd be interested to hear if this problem is also present in the 386 compiler. The conditional construct that causes wedges the compiler is frequently generated by C++. In fact, the code fragment I included here was given to us by Bjarne Stroustrup as proof that C++ could not easily be ported to a 286 machine that used the intel pcc-based compiler. (I have heard that other non-pcc-based compilers, such as Metaware's High-C, do not have this problem). Anyone with a beta copy of System V/386 care to try it and see if it works? -- Mike Young - Software Development Technologies, Inc., Sudbury MA 01776 UUCP : {decvax,harvard,linus,mit-eddie}!necntc!necis!mrst!sdti!mjy Internet : mjy%sdti.uucp@harvard.harvard.edu Tel : +1 617 443 5779