egcs-1.0.2 Minor bug in sh.h

Ralf Corsepius
Tue Mar 17 04:29:00 GMT 1998


egcs-1.0.2/gcc/config/sh/sh.h still uses the old -m flags rules, which
have changed for the snapshot branch for quile a while.

While egcs-snapshots defines __sh1__ by default, egcs-1.0.2 doesn't,
i.e. if not specifing any -m flags, egcs-snapshots implies sh1, while
egcs-1.0.2 doesn't.

>From egcs-1.0.2:
#define CPP_SPEC "%{ml:-D__LITTLE_ENDIAN__} \
%{m1:-D__sh1__} \
%{m2:-D__sh2__} \
%{m3:-D__sh3__} \

>From egcs-980315:
#define CPP_SPEC "%{ml:-D__LITTLE_ENDIAN__} \
%{m1:-D__sh1__} \
%{m2:-D__sh2__} \
%{m3:-D__sh3__} \
%{m3e:-D__SH3E__} \

Therefore machine dependent sh-asm code (newlib, multilib-ed libraries)
still needs to use the ugly and broken (once a new shXX processor is
released all source code has to be edited - AFAIK sh4 is approaching!):
#if defined(__sh2__) || defined(__sh3__) || defined(__SH3E__)
/* sh[2|3|3e] code */
/* sh1 code */

instead of:
#ifdef __sh1__


Ralf Corsepius 
Forschungsinstitut fuer Anwendungsorientierte Wissensverarbeitung (FAW)
Helmholtzstr. 16, 89089 Ulm, Germany     Tel: +49/731/501-8690           FAX: +49/731/501-999

More information about the Gcc-bugs mailing list