Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!ig!jade!ucbvax!HNYKUN11.BITNET!U613042 From: U613042@HNYKUN11.BITNET (Olaf Seibert) Newsgroups: comp.sys.amiga Subject: Bug in PDC on Fish disk #110 [Thanx again, Fred!] Message-ID: <8712081915.AA06522@jade.berkeley.edu> Date: Tue, 8-Dec-87 13:55:31 EST Article-I.D.: jade.8712081915.AA06522 Posted: Tue Dec 8 13:55:31 1987 Date-Received: Sun, 13-Dec-87 12:50:37 EST Sender: daemon@ucbvax.BERKELEY.EDU Lines: 28 [ line ] There is a bug in the Public Domain C Compiler. It demonstrates itself in one of the example programs, 'logic.c'. The problem seems to be, that the 'default' case of a switch doesn't get optimized, even if you want optimization (which is default). So, when an automatic variable is reassigned to a register in your function, it isn't in the 'default' case in a switch statement. If you use this variable there, the original stack location gets used, which of course is incorrect. Turn of optimization (option -n) and there is no problem. I have printed out the entire compiler today, so I am going to look into it, if time permits, but I am sure the author of it is more likely to find the problem than I am, due to better familiarity with the code. Apart from this, I really like the compiler. It generates pretty good code for the example programs. It even puts the address of printf() in a register if you call it often enough! --- The opinions possibly reflected herein are my own, and not necessarily those of someone else I might be connected with. They MAY, however, be. >>> I *thought* I was living in a free, modern country.... --- Olaf (Rhialto) Seibert... U613042@HNYKUN11.BITNET USEnet is *almost* an anagram of unsent ... BITnet: Because It's There Computers? Just say *YES*! Customs? Just say *NO*!