TECHNICAL INFORMATION DOCUMENT TITLE: PTF230 - Compiler : Optimizer and Code Generator DOCUMENT ID: TID300202 DOCUMENT REVISION: A DATE: 10APR95 ALERT STATUS: Yellow INFORMATION TYPE: Symptom Solution README FOR: ptf230 PRODUCT and VERSION: UnixWare 1.1 ABSTRACT: This PTF fixes three problems with the code generator and the optimizer in the "Optimizing C Compilation System" package. SYMPTOM In some rare cases, the code generator or optimizer produce incorrect output. SOLUTION Apply the ptf230 file. Installation Instructions: DATATYPE: datastream 1. Download the ptf230 and ptf230.txt files to the /tmp directory on your machine. 2. Read the release notes contained in this file and follow the instuctions to add the packages to your system. 3. Now become root, and add the package to your system using the following commands: $ su # pkgadd -d /tmp/ptf230 Solution Specifics PTF230 OVERVIEW --------------- Title ----- PTF230 - Compiler Fixes: Optimizer and Code Generator Version ------- 1.0 Date ---- 04APR95 Information Type ---------------- Symptom Solution Product And Version ------------------- UnixWare 1.1.1 or 1.1.2 or 1.1.3 or 1.1.4 Symptom -------- In some rare cases, the code generator or optimizer produce incorrect output. See the General Description below for more details. General Description. ------------------- Problem 1: There is a problem with the compilation of certain floating point expressions involving the ?: operator. The incorrectly compiled code gives the wrong answer in cases where the same constant appears in both the "true" and the "false" expression of the ?: operator. Problem 2: The optimizer clobbers the value in a register in some rare cases. The result is unpredictable. Problem 3: The optimizer replaces zero with a another (unpredictable) value in some rare cases. The result is unpredictable. New Features. ------------ None. Software Notes and Recommendations. ---------------------------------- This PTF requires that UnixWare 1.1.1, 1.1.2, 1.1.3, or 1.1.4 be installed, as well as the "Optimizing C Compilation System" (ccs) package. If you install the ccs package after you install an Update, you *must* reinstall the Update before installing this PTF. If, after you install this PTF, you decide to install an Update, you must remove this PTF, install the Update, and then reinstall this PTF. Testing of the modified software contained in this package has been conducted only to the extent necessary to confirm that it resolves the problem(s) stated above ("Symptom"). Such testing consists of recreating the problem conditions and verifying that the problem no longer occurs. No other testing of this software has been done. Hardware Notes and Recommendations. ---------------------------------- This PTF is targeted for the i386, i486 and Pentium CPU's. Installation Instructions. ------------------------- This PTF consists of 1 3.5 inch floppy. Insert the floppy into the drive and, while logged in as root, type pkgadd -d diskette1 and follow the instructions output by pkgadd. Troubleshooting. --------------- To verify whether this PTF works after installing it, compile and run the following programs. =============================================================================== /* * The printf should print "3 2", but without this PTF * it prints "3 -2147483648" */ main () { int i1; double d1; d1 = 0.0; i1 = ( d1 > 0) ? 2 + d1 : 3; printf("%d ",i1); d1 = 0.0; i1 = ( d1 > 0) ? 2 + d1 : 2; printf("%d\n",i1); } =============================================================================== /* * The printf in main should print "0 1", but without this PTF * it prints "0 0" when this code is optimized. */ #include int ematch(register char *s, register char *p) { register int scc = *s++; char c; switch(c = *p++) { case '[': while( c = *p++ ) { } case 0: return (1); default: { char c1 = c & 0177; char c2 = (char)scc; c1 = (c1 >= 'a' && c1 <= 'z') ? c1 - 'a' + 'A' : c1; c2 = (c2 >= 'a' && c2 <= 'z') ? c2 - 'a' + 'A' : c2; if( c1 != c2 ) { return( 0 ); } } } return(ematch(s,p)); } main() { printf("%d %d\n", ematch("b", "a"), ematch("a.c", "a.c")); } ===============================================================================