[nhc-bugs] bugfix for gcc-3.x

Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Wed, 5 Feb 2003 15:32:51 +0000


This is a multi-part message in MIME format.

--Multipart_Wed__5_Feb_2003_15:32:51_+0000_082c07f8
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

To any users of nhc98 who have reported faults when trying to build
or use the compiler in conjuction with gcc-3.x.

We have finally found the cause of the fault, and a fix.  A source-code
patch for nhc98-1.14 is attached, and is also available for download from
the website.

Technical details:
    It appears that gcc has changed the way it aligns statically declared
    arrays of pointers, from 4-byte boundaries in (gcc-2.x) to 32-byte
    boundaries (in gcc-3.x).  Unfortunately, nhc98 was relying very
    heavily on the 4-byte alignment.  As it turns out, the alignment can
    be restored to 4-byte boundaries without any ill effects, by using an
    "evil mangler"(TM) on the assembly code.

Regards,
    Malcolm

P.S. The phrase "evil mangler" is trademark of GHC.  :-)

--Multipart_Wed__5_Feb_2003_15:32:51_+0000_082c07f8
Content-Type: text/plain;
 name="patch-1.14-gcc3"
Content-Disposition: attachment;
 filename="patch-1.14-gcc3"
Content-Transfer-Encoding: base64

SW5kZXg6IHNjcmlwdC9uaGM5OC5pbnN0Cj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC91c3Ivc3JjL21h
c3Rlci9uaGMvc2NyaXB0L25oYzk4Lmluc3QsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEuNDAKZGlm
ZiAtdSAtcjEuNDAgbmhjOTguaW5zdAotLS0gc2NyaXB0L25oYzk4Lmluc3QJMjAwMi8xMi8yMiAy
MjoyMjo0NAkxLjQwCisrKyBzY3JpcHQvbmhjOTguaW5zdAkyMDAzLzAyLzA1IDE1OjE3OjQ4CkBA
IC01MzksNyArNTM5LDggQEAKICAgICAgICAgdGhlbgogICAgICAgICAgIGVjaG8gJENQUEFTICRF
TkRJQU4gJENQUEFTRkxBR1M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