This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Provide a default definition of CONSTANT_ADDRESS_P


On 10/20/09 02:46, Nick Clifton wrote:
Hi Guys,

   This is a follow up to a comment from Jeff Law about a patch I
   created for the MN10300 port.  We found that for that port that its
   definition of CONSTANT_ADDRESS_P() as just CONSTANT_P() was a little
   bit too permissive.  In particular it was allowing CONST_DOUBLEs to
   be treated as constant addresses which tended to confuse other parts
   of the compiler.

   It turns out that quite a few backends use this definition of
   CONSTANT_ADDRESS_P.  It is suggested in the tm.texi documentation
   which is probably why it has happened.  So I am seeking approval for
   the attached patch to address the problem.  It does two things:
   Firstly it provides a default definition of CONSTANT_ADDRESS_P in
   defaults.h which includes a test to make sure that CONST_DOUBLEs are
   not allowed.  Secondly it updates all of the backends which used to
   define CONSTANT_ADDRESS_P as CONSTANT_P so that they now use this
   default definition.

   Tested by building the following targets: avr-elf, bfin-elf,
   cris-elf, fr30-elf, frv-elf, m32c-elf, m68hc12-elf, mep-elf,
   mn10300-elf, moxie-elf, pdp11-aout, picochip-elf, score-elf,
   xstormy16-elf.

   I also ran an x86 bootstrap just to make sure that the change to
   defaults.h did not break anything - it did not.

OK to apply ?

Cheers
   Nick

gcc/ChangeLog
2009-10-20  Nick Clifton<nickc@redhat.com>

	* defaults.h (CONSTANT_ADDRESS_P): Provide a default definition.
	Make sure that it does not allow CONST_DOUBLEs.
	* doc/tm.texi (CONSTANT_ADDRESS_P): Update description.
	* config/avr/avr.h (CONSTANT_ADDRESS_P): Delete.
	* config/bfin/bfin.h (CONSTANT_ADDRESS_P): Delete.
	* config/cris/cris.h (CONSTANT_ADDRESS_P): Delete.
	* config/fr30/fr30.h (CONSTANT_ADDRESS_P): Delete.
	* config/frv/frv.h (CONSTANT_ADDRESS_P): Delete.
	* config/m32c/m32c.h (CONSTANT_ADDRESS_P): Delete.
	* config/m68hc11/m68hc11.h (CONSTANT_ADDRESS_P): Delete.
	* config/mep/mep.h (CONSTANT_ADDRESS_P): Delete.
	* config/mn10300/mn10300.h (CONSTANT_ADDRESS_P): Delete.
	* config/moxie/moxie.h (CONSTANT_ADDRESS_P): Delete.
	* config/pdp11/pdp11.h (CONSTANT_ADDRESS_P): Delete.
	* config/picochip/picochip.h (CONSTANT_ADDRESS_P): Delete.
	* config/score/score.h (CONSTANT_ADDRESS_P): Delete.
	* config/stormy16/stormy16.h (CONSTANT_ADDRESS_P): Delete.

OK


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]