This is the mail archive of the gcc-bugs@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]

Re: Egcs 1.1 produces incorrect ColdFire code


  In message <9809151847.AA23990@moene.indiv.nluug.nl> I wrote:

  > >  obj/gnu/board/t.s: Assembler messages:
  > >  obj/gnu/board/t.s:13: Error: displacement too large for
  > >  this architecture; needs 68020 or higher -- statement
  > >  `move.b %d0,43690(%a0)' ignored
  >
  > Unfortunately, I don't have egcs-1.1 lying around anymore, but it  
  > might be instructive to look into .../gcc/config/m68k/m68k.h and  
  > search for the "TARGET_SWITCHES"; the following is the current  
entry
  > for the m5200 (note the turning off of MASK_68020):
  >
  >     { "5200", -  
(MASK_68060|MASK_68040|MASK_68040_ONLY|MASK_68020       \
  >                 |MASK_BITFIELD|MASK_68881)},                     
        \
  >     { "5200", (MASK_5200)},                                      
        \
  >
  > This bit (TARGET_68020) is used further down in the m68k.h file to  
  > allow large offsets to address registers, so for the m5200 this bit  
  > should *not* be set, as above.

and Jeff replied:

>  I do not think changing TARGET_SWITCHES is the right fix
>  since that will have other effects than just changing
>  the allowable offsets.  It is probably better to fix
>  GO_IF_LEGITIMATE_ADDRESS and friends to test TARGET_5200
>  has needed.

According to my reading of the documentation, the above definition  
turns *off* flags TARGET_68060, TARGET_68040, TARGET_68040_ONLY,  
TARGET_68020, TARGET_BITFIELD and TARGET_68881 when specifying  
-m5200 on the command line.

QUOTE

TARGET_SWITCHES

	...

	Each subgrouping contains a string constant, that defines the
	option name, and a number, which contains the bits to set in
	`target_flags'.  A negative number says to clear these bits
	instead; the negative of the number is which bits to clear.
	The actual option name is made by appending `-m' to the
	specified name [ meant here is `prepending', I think (TM) ]

	...

UNQUOTE

So gcc -m5200 should clear TARGET_68020 (amongst others) and set  
TARGET_5200.  If this interpretation is correct, the backend  
shouldn't generate large offsets, because TARGET_68020 isn't set.

Confusingly yours,
Toon.


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