1 March 2005 This is an approved src.alt for 176.gcc in CPU2000 v1.2. It will allow 176.gcc to be built using GCC 4.0.0 or later on 64-bit systems. To apply the src.alt, unpack the tar file in the top level of the CPU2000 directory. The following sequence of commands should accomplish this: $ /bin/sh $ cd $ . ./shrc $ go top $ specgzip -dc | spectar -xvf - Please replace the items in angle brackets ( <> ) as appropriate. To have the src.alt applied during compilation, please add the following stanza to your config file: # Enable 64-bit GCC 4.0.0 src.alt 176.gcc=default=default=default: srcalt=64bitgcc40 This src.alt makes several performance neutral portability-related changes to 176.gcc. Specifically, the value for the OBSTACK_INTERFACE_VERSION is changed from 1 to -1. During initial porting, the value 1 was chosen to avoid conflict with obstack implementations in GCC at the time. Of course, with the development of 64-bit GCC, the developers changed the value to 1 to avoid conflict with 32-bit systems. This src.alt changes the value to -1, which should not conflict with any future revisions of GCC. Additionally, starting with GCC 3.5.0, the cast as lvalue extension is no longer accepted. All places where this extension be used is replaced with one which will compile on versions of GCC 3.5.0 and above. Applying this patch will not affect compilation with older versions of GCC or any other compiler. The 64-bit calling convention on Mac OS X requires int objects shorter than a word to be sign-extended or zero-extended as appropriate at the call site. Compiling exact_log2_wide, the compiler generates the shift based on the assumption that this was done. The call to exact_log2_wide has an int parameter, which is sign extended, as no prototype is in scope and thus no implicit conversion to unsigned int is done. The type mismatch makes this undefined behavior in C89. This patch will work on all versions of GCC and any other compiler. Please address any questions about this src.alt to cpu2000support@spec.org.