Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tlug: GCC 2.7.x optimizer bug



--------------------------------------------------------
tlug note from "Stephen J. Turnbull" <turnbull@example.com>
--------------------------------------------------------
Was building a beta version of Ghostscript, and in poking around in
make.txt found a reference to a generic bug in GCC 2.7.x.  It's been
fixed for GCC 2.7.2.1.  If you're using 2.7.x, you may want to
upgrade.

Note that (AFAIK) const does not actually make variables readonly; it
just makes the compiler complain if you try to change them.  So
compiling without the workaround will catch attempts to change
constants, and compiling with it will produce correct code :-)

Regards,
Steve

gcc (all platforms)
-------------------
	There is an optimizer bug in gcc 2.7.0, 2.7.1, and 2.7.2 that causes
these versions of gcc to generate incorrect code.  You can work around this
by adding the switch
		-Dconst=
to the compilation switches (CFLAGS).  Alternatively, you can rebuild gcc
with the following patch:

*** clean-ss-951203/expr.c	Sun Nov 26 08:18:07 1995
--- ss-951203/expr.c	Mon Dec  4 11:41:18 1995
*************** expand_expr (exp, target, tmode, modifie
*** 4582,4587 ****
  	   through a pointer to const does not mean that the value there can
  	   never change.  Languages where it can never change should
  	   also set TREE_STATIC.  */
! 	RTX_UNCHANGING_P (temp) = TREE_READONLY (exp) | TREE_STATIC (exp);
  	return temp;
        }
--- 4582,4588 ----
  	   through a pointer to const does not mean that the value there can
  	   never change.  Languages where it can never change should
  	   also set TREE_STATIC.  */
! 	RTX_UNCHANGING_P (temp) = TREE_READONLY (exp) & TREE_STATIC (exp);
  	return temp;
        }

If possible, compile with gcc 2.5.8, gcc 2.6.3, or gcc 2.7.2.1 or later,
which don't have this bug.
-----------------------------------------------------------------
a word from the sponsor will appear below
-----------------------------------------------------------------
The TLUG mailing list is proudly sponsored by TWICS - Japan's First
Public-Access Internet System.  Now offering 20,000 yen/year flat
rate Internet access with no time charges.  Full line of corporate
Internet and intranet products are available.   info@example.com
Tel: 03-3351-5977   Fax: 03-3353-6096


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links