This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


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

Re: Hitachi SH1 egcs1.1 generating braf instruction.


Hi, I found another bug in the SH1 support...

The 'CPP_SPEC' says that SH1 should be the default target:
  *cpp:
  %{ml:-D__LITTLE_ENDIAN__} %{m1:-D__sh1__} %{m2:-D__sh2__} %{m3:-D__sh3__}
  %{m3e:-D__SH3E__} %{!m1:%{!m2:%{!m3:%{!m3e:-D__sh1__}}}}

(Warning: Using the Courier font under Windoze may hurt your mental health and 
you may see all '1's as 'l's in the previous text...;-)
 
But the 'gcc/config/sh/sh.h' puts:
  #define TARGET_DEFAULT (0)

which simply means 'nothing', the 'TARGET_SH1' will not be defined and 'braf'
instructions will be inserted to the default libraries...

> !   if (TARGET_SH1)
>       {
> !       far = 1;
> !       jump = "mov.l	%O0,%1;jmp	@%1";
>       }
>     else

To fix this, one way could be to put:
  #define TARGET_DEFAULT SH1_BIT

Another way could be to add:
  %{!m1:%{!m2:%{!m3:%{!m3e:-m1}}}}

to the CC1_SPEC and CC1PLUS_SPEC.

Any comments?

Cheers, Kai
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.