--- gcc-2.95-2.95.4.ds15.orig/debian/g77-2.95-doc.doc-base +++ gcc-2.95-2.95.4.ds15/debian/g77-2.95-doc.doc-base @@ -0,0 +1,10 @@ +Document: g77-2.95-doc +Title: The GNU Fortran compiler +Author: Various +Abstract: This manual documents how to run, install and port `g77', as well as + its new features and incompatibilities, and how to report bugs. +Section: Apps/Programming + +Format: info +Index: /usr/share/info/g77-2.95.info.gz +Files: /usr/share/info/g77-2.95* --- gcc-2.95-2.95.4.ds15.orig/debian/README.libg2c.Debian +++ gcc-2.95-2.95.4.ds15/debian/README.libg2c.Debian @@ -0,0 +1,15 @@ +libg2c-pic: libg2c with `pic' objects +===================================== + +Building a dynamically loadable module from objects derived from Fortran 77 +source needs linking with a libg2c, which only contains pic objects. +The g2c library is built only as a static library until version 3.0.x +(the next version g77-3.1 will have a shared g2c library too). + +As a workaround, Debian builds a library `libg2c-pic', which holds pic +objects only. Instead of linking with `-lg2c', you have to link with +`-lg2c-pic', when building dynamically loadable modules (often needed +by Perl, Python or Tcl modules (partly) written in Fortrani 77). + +The modules built will run on other Linux distributions, but not your +build scripts. --- gcc-2.95-2.95.4.ds15.orig/debian/rules +++ gcc-2.95-2.95.4.ds15/debian/rules @@ -0,0 +1,86 @@ +#! /usr/bin/make -f +# -*- makefile -*- +# Build rules for gcc (>= 2.95) and gcc-snapshot +# Targets found in this makefile: +# - unpack tarballs +# - patch sources +# - (re)create the control file +# - create a debian/rules.parameters file, which is included +# by debian/rules2 +# All other targets are passed to the debian/rules2 file + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This is the debhelper compatability version to use. +export DH_COMPAT=2 + +default: build + +include debian/rules.defs +#include debian/rules.unpack +#include debian/rules.patch + +unpack: $(unpack_stamps) +$(unpack_stamp)-%: + $(MAKE) -f debian/rules2 TARGET=$* $@ + +patch: unpack $(patch_stamps) +$(patch_stamp)-%: + $(MAKE) -f debian/rules2 TARGET=$* $@ + +control: patch $(control_stamp) +$(control_stamp): + -mkdir $(stampdir) + $(MAKE) -f debian/rules.conf control + touch $(control_stamp) + +control-file: + $(MAKE) -f debian/rules.conf $@ + +configure: control $(configure_stamps) +$(configure_stamp)-%: + $(MAKE) -f debian/rules2 TARGET=$* $@ + +build: configure $(build_stamps) +$(build_stamp)-%: + $(MAKE) -f debian/rules2 TARGET=$* $@ + +check: + $(MAKE) -f debian/rules2 TARGET=native $@ + +clean: + rm -rf $(stampdir) + -$(MAKE) -f debian/rules2 $@ + rm -rf $(srcdir) $(builddir)* + rm -rf src src-* build build-* + rm -f bootstrap-* first-move-stamp + rm -f debian/*.tmp debian/rules2.hack + dh_clean + +mail-summary: + $(MAKE) -f debian/rules2 $@ + +install: build $(install_stamps) +$(install_stamp)-%: + $(MAKE) -f debian/rules2 TARGET=$* $@ + +binary-indep: install $(binary_stamps) + $(MAKE) -f debian/rules2 TARGET=$* $@ + +binary-arch: install binary-arch-hack $(binary_stamps) + $(MAKE) -f debian/rules2 TARGET=$* $@ + +binary-arch-hack: + echo 'binary_hack = arch' > debian/rules2.hack +binary-indep-hack: + echo 'binary_hack = indep' > debian/rules2.hack + +binary: install $(binary_stamps) +$(binary_stamp)-%: + $(MAKE) -f debian/rules2 TARGET=$* $@ + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +.PHONY: build clean binary-indep binary-arch binary --- gcc-2.95-2.95.4.ds15.orig/debian/gcc-docs.prerm +++ gcc-2.95-2.95.4.ds15/debian/gcc-docs.prerm @@ -0,0 +1,3 @@ +#! /bin/sh -e + +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/gcc-docs ]; then rm -f /usr/doc/gcc-docs; fi --- gcc-2.95-2.95.4.ds15.orig/debian/BUGS.Debian +++ gcc-2.95-2.95.4.ds15/debian/BUGS.Debian @@ -0,0 +1,5 @@ +The results of the egcs testsuite are documented in the file +`test-summary' in the same directory as this file. Other known problems +are dscribed here. + +["bug" #22769 should be described here] --- gcc-2.95-2.95.4.ds15.orig/debian/README +++ gcc-2.95-2.95.4.ds15/debian/README @@ -0,0 +1,21 @@ + The Debian GNU Compiler Collection Setup + ======================================== + +Please see the README.Debian in /usr/share/doc/gcc, contained in the +gcc package for a description of the setup of the different compiler +versions. + + +Maintainers of these packages +----------------------------- + +Matthias Klose +Ray Dassen +Philip Blundell (arm-linux) +Ben Collins (sparc-linux) +Christopher C. Chimelis (alpha-linux) +Dan Jacobowitz (powerpc-linux) +Gerhard Tonn (s390-linux) +Roman Zippel (m68k-linux) + +=============================================================================== --- gcc-2.95-2.95.4.ds15.orig/debian/gcc.postinst.warning +++ gcc-2.95-2.95.4.ds15/debian/gcc.postinst.warning @@ -0,0 +1,39 @@ +#! /bin/sh -e + +update-alternatives \ + --install /usr/bin/cc cc /usr/bin/gcc 20 \ + --slave /usr/share/man/man1/cc.1.gz cc.1.gz /usr/share/man/man1/gcc.1.gz + +if [ "`uname -m`" = sparc ]; then + update-alternatives \ + --install /usr/bin/sparc64-linux-gcc sparc64-linux-gcc /usr/bin/gcc 30 +fi + +case "$1" in + configure) + last_configured_version=$2 + if dpkg --compare-versions "$last_configured_version" lt 2.95; then + + cat - < + #include + + class A {}; + + static + int SortCondition(void const*, void const*) + { + printf("throwing 'sortcondition' exception\n"); + throw A(); + } + + int main(int argc, char *argv[]) + { + int list[2]; + + try { + SortCondition(NULL,NULL); + } catch (A) { + printf("caught test-sortcondition exception\n"); + } + try { + qsort(&list, sizeof(list)/sizeof(list[0]),sizeof(list[0]), + &SortCondition); + } catch (A) { + printf("caught real-sortcondition exception\n"); + } + return 0; +} + +Andrew Macleod responded: + +When compiled with the table driven exception handling, exception can only +be thrown through functions which have been compiled with the table driven EH. +If a function isn't compiled that way, then we do not have the frame +unwinding information required to restore the registers when unwinding. + +I believe the setjmp/longjmp mechanism will throw through things like this, +but its produces much messier code. (-fsjlj-exceptions) + +The C compiler does support exceptions, you just have to turn them on +with -fexceptions. + +Your main options are to: + a) Don't use callbacks, or at least don't throw through them. + b) Get the source and compile the library with -fexceptions (You have to + explicitly turn on exceptions in the C compiler) + c) always use -fsjlj-exceptions (boo, bad choice :-) + + +g++: "undefined reference" to static const array in class +--------------------------------------------------------- + +The following code compiles under GNU C++ 2.7.2 with correct results, +but produces the same linker error with GNU C++ 2.95.2. +Alexandre Oliva responded: + +All of them are correct. A static data member *must* be defined +outside the class body even if it is initialized within the class +body, but no diagnostic is required if the definition is missing. It +turns out that some releases do emit references to the missing symbol, +while others optimize it away. + +#include + +class Test +{ + public: + Test(const char *q); + protected: + static const unsigned char Jam_signature[4] = "JAM"; +}; + +Test::Test(const char *q) +{ + if (memcmp(q, Jam_signature, sizeof(Jam_signature)) != 0) + cerr << "Hello world!\n"; +} + +int main(void) +{ + Test::Test("JAM"); + return 0; +} + + +[EDIT ME: scan Debian bug reports and write some nice summaries ...] --- gcc-2.95-2.95.4.ds15.orig/debian/g77-2.95-doc.postinst +++ gcc-2.95-2.95.4.ds15/debian/g77-2.95-doc.postinst @@ -0,0 +1,10 @@ +#! /bin/sh -e + +case "$1" in + configure) + install-info --quiet --section "Development" "Development" \ + --description="The GNU Fortran 77 compiler." \ + /usr/share/info/g77-2.95.info +esac + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/g77-2.95.postinst +++ gcc-2.95-2.95.4.ds15/debian/g77-2.95.postinst @@ -0,0 +1,3 @@ +#! /bin/sh -e + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/gpc-2.95.preinst +++ gcc-2.95-2.95.4.ds15/debian/gpc-2.95.preinst @@ -0,0 +1,10 @@ +#! /bin/sh -e + +# dpkg cannot handle transistions from symlinks to directories +if [ -L /usr/share/doc/gpc-2.95 ]; then + rm -f /usr/share/doc/gpc-2.95 +else + true +fi + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/gpc-2.95-doc.prerm +++ gcc-2.95-2.95.4.ds15/debian/gpc-2.95-doc.prerm @@ -0,0 +1,5 @@ +#! /bin/sh -e + +install-info --quiet --remove gpc-2.95 + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/c89 +++ gcc-2.95-2.95.4.ds15/debian/c89 @@ -0,0 +1,23 @@ +#! /bin/sh + +# Call the appropriate C compiler with options to accept ANSI/ISO C +# The following options are the same (as of gcc-2.95): +# -ansi +# -std=c89 +# -std=iso9899:1990 + +extra_flag=-std=c89 + +for i; do + case "$i" in + -ansi|-std=c89|-std=iso9899:1990) + extra_flag= + ;; + -std=*) + echo >&2 "`basename $0` called with non ANSI/ISO C option $i" + exit 1 + ;; + esac +done + +exec cc $extra_flag ${1+"$@"} --- gcc-2.95-2.95.4.ds15.orig/debian/libg++-dev.postinst +++ gcc-2.95-2.95.4.ds15/debian/libg++-dev.postinst @@ -0,0 +1,9 @@ +#! /bin/sh -e + +case "$1" in + configure) + install-info --quiet --section "Development" "Development" \ + /usr/share/info/libg++.info.gz +esac + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/gpc-2.95-doc.doc-base +++ gcc-2.95-2.95.4.ds15/debian/gpc-2.95-doc.doc-base @@ -0,0 +1,11 @@ +Document: gpc-2.95-doc +Title: The GNU Pascal compiler +Author: Various +Abstract: This manual documents how to run, install and maintain the GNU Pascal + compiler (GPC), as well as its new features and incompatibilities, and + how to report bugs. +Section: Apps/Programming + +Format: info +Index: /usr/share/info/gpc-2.95.info.gz +Files: /usr/share/info/gpc-2.95* --- gcc-2.95-2.95.4.ds15.orig/debian/watch +++ gcc-2.95-2.95.4.ds15/debian/watch @@ -0,0 +1,3 @@ +version=3 +opts=dversionmangle=s/\.ds\d+$// \ + ftp://gcc.gnu.org/pub/gcc/releases/gcc-(2\.95[\d\.]*) --- gcc-2.95-2.95.4.ds15.orig/debian/dh_doclink +++ gcc-2.95-2.95.4.ds15/debian/dh_doclink @@ -0,0 +1,28 @@ +#! /bin/sh + +pkg=`echo $1 | sed 's/^-p//'` +target=$2 + +ln -sf $target debian/$pkg/usr/share/doc/$pkg + +f=debian/$pkg.postinst.debhelper +if [ ! -e $f ] || [ "`grep -c '^# dh_doclink' $f`" -eq 0 ]; then +cat >> $f <> $f < +Sender: Richard Kettlewell +To: Matthias Klose +Cc: gcc@packages.debian.org +Subject: Bug#46181: c++ error message improvement suggestion +Date: Wed, 29 Sep 1999 11:41:35 +0100 (BST) + +Here is a small example: + +: muskogee; cat t.cc +*/ + +#include + +class foo { +public: + foo(); +}; + +void bar(const string &s) { + foo x(s); +} + +/* +: muskogee; c++ -o t t.cc +t.cc: In function `void bar(const class string &)': +t.cc:9: no matching function for call to `foo::foo (const basic_string,__default_alloc_template > &)' +t.cc:6: candidates are: foo::foo(const foo &) +t.cc:5: foo::foo() +: muskogee; c++ --version +egcs-2.91.60 + +Here the compiler knew (at least originally...) that the user wrote +`const string &' but still expands the typedef when it generates the +error message. + +ttfn/rjk +*/ --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-46720.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-46720.cc @@ -0,0 +1,36 @@ +/* +From: Richard Kettlewell +Sender: Richard Kettlewell +To: submit@bugs.debian.org +Subject: Bug#46720: STL deque implementation generates scads of warnings +Date: Tue, 5 Oct 1999 20:27:40 +0100 (BST) + +Package: libstdc++2.9-dev +Version: + +The implementation of the class generates rather a lot of +compiler warnings if you use `-Wall'. This is bad, as it makes +`-Werror' useless. + +ii libstdc++2.9-de 2.91.60-5 The GNU stdc++ library (development files) +ii g++ 2.91.60-5 The GNU (egcs) C++ compiler. + +lyonesse$ c++ -c -Wall t.cc + +lyonesse$ cat t.cc +*/ + +#include + +template deque; + +/* +lyonesse$ c++ -c -Wall t.cc +/usr/include/g++-2/stl_deque.h: In method `struct __deque_iterator deque,0>::erase(struct __deque_iterator, struct __deque_iterator)': +/usr/include/g++-2/stl_deque.h:420: instantiated from `deque,0>::operator =(const deque,0> &)' +t.cc:3: instantiated from here +/usr/include/g++-2/stl_deque.h:747: warning: comparison between signed and unsigned + +[...] + +*/ --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-47065.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-47065.c @@ -0,0 +1,42 @@ +/* +From: Tyson Dowd +To: submit@bugs.debian.org +Subject: Bug#47065: gcc miscompiles label addresses with -O +Date: Sun, 10 Oct 1999 21:41:44 +1000 + +Package: gcc +Version: 1:2.95.1-2 + +The following code example gives a different result when compiled +with and without -O. The same code works fine under gcc 2.7.2. +*/ + + void *entry_foo_1; + void *entry_bar_1; + void *succip; + int global; + foo() { + entry_foo_1 = && foo_1; + return; + foo_1: + if (global != 42) exit(1); + goto *entry_bar_1; + } + bar() { + entry_bar_1 = && bar_1; + return; + bar_1: + if (global != 42) exit(1); + goto *succip; + } + main() { + global = 42; + foo(); + bar(); + succip = &&last; + goto *entry_foo_1; + exit(1); + last: + if (global != 42) exit(1); + exit(0); + } --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-49186.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-49186.c @@ -0,0 +1,4 @@ +int foo(void) +{ + return '\r' == ' ' ? 1 : 0; +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-51456.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-51456.c @@ -0,0 +1,14 @@ +foo() { + bar(); +} + +bar() { + foo(); +} + +baz() { + bar(); +} +/* +gcc -ggdb -O3 -c +*/ --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-52382.C +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-52382.C @@ -0,0 +1,31 @@ +/* +I notified that doing things like + cout << setw(30) << text; +where text is some std::string does not work. setw setting +is not used while outputting text, instead it is used +while something else is being output later. +Sample program below illustrates the problem. +*/ + +// Sample by Marcin.Kasperski@bigfoot.com +// The program illustrates the fact that setw is ignored +// while outputting string's into iostream. +// setw setting is used on the first const char * instead +// Below one would expect output: +// [ 1111 2222] +// but instead he gets +// [11112222 ] + +#include +#include +#include + +int main() +{ + string text1 = "1111"; + string text2 = "2222"; + + cout << "[" << setw(10) << text1 << setw(10) << text2 << "]" << +endl; +} + --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-53698.C +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-53698.C @@ -0,0 +1,21 @@ +void foobar (void (*)(void *)); + +class Component { +public: + virtual void handler () {} + + template void start_handler (comp_type); +private: + template static void * startup (void *); +}; + +template void Component::start_handler (comp_type data) +{ + foobar (&startup); /* Internal compiler error here. */ +} + +int main () +{ + Component comp; + comp.start_handler (&comp); /* Instantiated here. */ +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-54544.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-54544.c @@ -0,0 +1,51 @@ +/* +Here's the source code, I'm trying to use the printer port as a generic I/O +port: +*/ +/* termwatch.c=20 + 080100 Sigmund Skjelnes + Dette programmet viser om pinne 2 p=E5 /dev/lp0 utgangen skifter status +*/ + +#include +#include + +#define base 0x0378U +#define lp_data base=20 +#define lp_control (base + 2) +#define IRQFLAG 0x10 +#define INIFLAG 4 + +int main( void ){ + int i; + /* sett opp registre */ + ioperm( base, 3, 1 ); /* reserver portadresser */ + i = inb( lp_control ); + i |= INIFLAG; /* INI flag = 1 */ + i &= ~IRQFLAG; /* IRQ flag = 0 IRQ brukes ikke */ + outb( lp_control, (unsigned char) (i & 0xff) ); + outb( lp_data, (unsigned char) 0 ); /* leser data reg */ + + while( 1 ){ //finn en m=E5te =E5 stoppe programmet kontrollert p=E5! + if ( inb( lp_data ) == 1 ){ + printf( "Bryter =E5pen\r\n" ); + } + else { + printf( "Bryter lukket\r\n" ); + } + + sleep( 1 ); /* 1s */ + + } + ioperm( base, 3, 0 ); /* fjern reservasjon */ +} + +/* +Obviously, the code for __outp etc. is missing, hence the linker can't find +the function definition. It's possible the source code should have been +linked to something, but this is unlikely. + +The source are compiled the usual way:=20 +gcc -o termwatch termwatch.c + +*/ --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-55967.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-55967.c @@ -0,0 +1,27 @@ +#include /* for gettimeofday() */ + +#define rdtsc(low,high) \ + __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high)) + +static unsigned long tsc_per_usec = 0, init_tsc_upper = 0; + +static void init_gettime(void) +{ + unsigned long usecs, a1, b1, a2, b2, a3, b3, a4, b4; + struct timeval tv1, tv2; + + usecs = (tv2.tv_usec + ((tv1.tv_sec==tv2.tv_sec) ? 0 : 1e6)) - tv1.tv_usec; + tsc_per_usec = (a3-a2)/usecs; +} + +double +gettime(void) +{ + unsigned long a, b; + + if(tsc_per_usec == 0) + init_gettime(); + + return ((b-init_tsc_upper)*((double)ULONG_MAX+1) + a) / tsc_per_usec / 1e6; +} + --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-57542.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-57542.c @@ -0,0 +1,36 @@ +/* +I'm not sure this is a bug, and whether it's a glibc or gcc problem. + +The following program compiles fine with "cc -O2 string.c": +*/ + +/* string.c: shows a problem with headers in string.h */ + +#include + +main(void) +{ + char D[20]; + + D[0] = '\0'; + strcat(D, "a string"); +} + +/* +However if you try to compile with "cc -O2 -traditional string.c" you +get + +In file included from /usr/include/string.h:346, + from string.c:3: +/usr/include/bits/string2.h:1104: macro or `#include' recursion too deep +/usr/include/bits/string2.h:1171: macro or `#include' recursion too deep +/usr/include/bits/string2.h:1171: macro or `#include' recursion too deep +/usr/include/bits/string2.h:1171: macro or `#include' recursion too deep +/usr/include/bits/string2.h:1171: macro or `#include' recursion too deep +... +until the preprocessor gets a memory error. The same happens with -O +instead of -O2. + +I know -traditional isn't the best thing to use it's sometimes +necessary to compile legacy stuff... +*/ --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-58219.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-58219.c @@ -0,0 +1,23 @@ +typedef union { + long i; + float f; +} union_one; + +typedef struct struct_one { + union_one v; + int x; +} struct_one; + +static long +function_one(struct_one r) +{ + return 0; +} + +int +main() +{ + struct_one second; + second.v.i = second.v.f; + return function_one(second); +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-58758.C +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-58758.C @@ -0,0 +1,27 @@ + #include + #include + + int main() + { + struct tm bdt; + + strptime("2000-01-26 13:24:36","%Y-%m-%d %T", &bdt); + } +/* +gcc compiles this program correctly, but g++ fails to see the +declaration of strptime in time.h: + +Adding "#define _XOPEN_SOURCE" allows g++ to compile it too. + +/usr/include/features.h says: + + _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if + Single Unix conformance is wanted. + ... + _GNU_SOURCE All of the above, plus GNU extensions. + + ... + If none of these are defined, the default is all but _GNU_SOURCE. + +The documented default apparently works in gcc but not g++. +*/ --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-115978.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-115978.cc @@ -0,0 +1,37 @@ +#include +#include + +void +writer(int i) +{ + static stringstream sstr; + + // shove some stuff into the stringstream + sstr << "This is a fubar test. " << i; + sstr.unsetf(ios::skipws); // keep spaces + + char c = 'Q'; // A throwaway that appears nowhere in the message + while (sstr >> c) + { + // print out each character and its hex representation. It + // should stop printing out when the end of the string is + // reached. + cout << c << "[" << hex << static_cast(c) << "] "; + c = 'Q'; + } + cout << "\n----------------" << endl ; + + // reset the stringstream after it has gone out of good state + sstr.clear(); +} + +int +main() +{ + for (int i = 0; i != 2; ++i) + { + writer(i); + } + + return 0; +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-105285.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-105285.cc @@ -0,0 +1,10 @@ +#include +#include + +int main() { + + float a = trunc(3.5); + std::cout << a << std::endl; + + return 0; +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-120333.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-120333.cc @@ -0,0 +1,18 @@ +#include +#include + +class ferror_open { + int a; +public: + ferror_open():a(2){}; + int message(){ + return a; + }; +}; + +int main() +{ + try { + throw ferror_open(); + } catch(ferror_open d){ cout << d.message() << endl;}; +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-46886/gcc-output +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-46886/gcc-output @@ -0,0 +1,19 @@ +Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs +gcc version 2.95.2 19990906 (prerelease) + /usr/lib/gcc-lib/i386-linux/2.95.2/cpp -lang-c -v -I. -I. -I.. -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__OPTIMIZE__ -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di586 -Dpentium -D__i586 -D__i586__ -D__pentium -D__pentium__ -D__PIC__ -D__pic__ -DHAVE_CONFIG_H -DPIC cddb.c cddb.i +GNU CPP version 2.95.2 19990906 (prerelease) (i386 Linux/ELF) +#include "..." search starts here: +#include <...> search starts here: + . + .. + /usr/local/include + /usr/lib/gcc-lib/i386-linux/2.95.2/include + /usr/include +End of search list. +The following default directories have been omitted from the search path: + /usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3 + /usr/lib/gcc-lib/i386-linux/2.95.2/../../../../i386-linux/include +End of omitted list. + /usr/lib/gcc-lib/i386-linux/2.95.2/cc1 cddb.i -mcpu=pentium -quiet -dumpbase cddb.c -mpentium -O3 -version -fPIC -o cddb.s +GNU C version 2.95.2 19990906 (prerelease) (i386-linux) compiled by GNU C version 2.95.2 19990906 (prerelease). +gcc: Internal compiler error: program cc1 got fatal signal 11 --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-46886/cddb.i +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-46886/cddb.i @@ -0,0 +1,13816 @@ +# 1 "cddb.c" + + + + + + + + + + + + + + + + + + + + +# 1 "../config.h" 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 21 "cddb.c" 2 + +# 1 "/usr/include/stdio.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/features.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 137 "/usr/include/features.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 195 "/usr/include/features.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/sys/cdefs.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 71 "/usr/include/sys/cdefs.h" 3 + + + + + + + + + + + + + + +# 103 "/usr/include/sys/cdefs.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 249 "/usr/include/features.h" 2 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/gnu/stubs.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 277 "/usr/include/features.h" 2 3 + + + + +# 27 "/usr/include/stdio.h" 2 3 + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +typedef unsigned int size_t; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 271 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 33 "/usr/include/stdio.h" 2 3 + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stdarg.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +typedef void *__gnuc_va_list; + + + + + +# 122 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stdarg.h" 3 + + + + + + + + + + + + + + + + + + + + +# 209 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stdarg.h" 3 + + + + +# 38 "/usr/include/stdio.h" 2 3 + + +# 1 "/usr/include/bits/types.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + +# 188 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + +# 271 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 29 "/usr/include/bits/types.h" 2 3 + + + +typedef unsigned char __u_char; +typedef unsigned short __u_short; +typedef unsigned int __u_int; +typedef unsigned long __u_long; + +__extension__ typedef unsigned long long int __u_quad_t; +__extension__ typedef long long int __quad_t; +# 48 "/usr/include/bits/types.h" 3 + +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; + +__extension__ typedef signed long long int __int64_t; +__extension__ typedef unsigned long long int __uint64_t; + +typedef __quad_t *__qaddr_t; + +typedef __u_quad_t __dev_t; +typedef __u_int __uid_t; +typedef __u_int __gid_t; +typedef __u_long __ino_t; +typedef __u_int __mode_t; +typedef __u_int __nlink_t; +typedef long int __off_t; +typedef __quad_t __loff_t; +typedef int __pid_t; +typedef int __ssize_t; +typedef long int __rlim_t; +typedef __quad_t __rlim64_t; +typedef __u_int __id_t; + +typedef struct + { + int __val[2]; + } __fsid_t; + + +typedef int __daddr_t; +typedef char *__caddr_t; +typedef long int __time_t; +typedef long int __swblk_t; + +typedef long int __clock_t; + + +typedef unsigned long int __fd_mask; + + + + + + + + + + +typedef struct + { + + + + + + + __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask)) ]; + + + } __fd_set; + + +typedef int __key_t; + + +typedef unsigned short int __ipc_pid_t; + + + + + +typedef long int __blkcnt_t; +typedef __quad_t __blkcnt64_t; + + +typedef __u_long __fsblkcnt_t; +typedef __u_quad_t __fsblkcnt64_t; + + +typedef __u_long __fsfilcnt_t; +typedef __u_quad_t __fsfilcnt64_t; + + +typedef __u_long __ino64_t; + + +typedef __loff_t __off64_t; + + +typedef int __t_scalar_t; +typedef unsigned int __t_uscalar_t; + + +typedef int __intptr_t; + + + + + + + + +# 40 "/usr/include/stdio.h" 2 3 + + + + + + + + +typedef struct _IO_FILE FILE; + + + + + + + + +# 1 "/usr/include/libio.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/_G_config.h" 1 3 + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + +# 188 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +typedef long int wchar_t; + + + + + + + + + + + + + + + + + + + + + + + + +typedef unsigned int wint_t; + + + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 14 "/usr/include/_G_config.h" 2 3 + + + + + + + + + + + + + + + + + + + + + +typedef int _G_int16_t __attribute__ ((__mode__ (__HI__))); +typedef int _G_int32_t __attribute__ ((__mode__ (__SI__))); +typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__))); +typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 30 "/usr/include/libio.h" 2 3 + + + + + + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stdarg.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 122 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stdarg.h" 3 + + + + + + + + + + + + + + + + + + + + +# 209 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stdarg.h" 3 + + + + +# 48 "/usr/include/libio.h" 2 3 + + + + + + + +# 67 "/usr/include/libio.h" 3 + + + + + + + + + + + + + + + + + + + + +# 98 "/usr/include/libio.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +struct _IO_jump_t; struct _IO_FILE; + + + + + + + + + +typedef void _IO_lock_t; + + + + + +struct _IO_marker { + struct _IO_marker *_next; + struct _IO_FILE *_sbuf; + + + + int _pos; +# 186 "/usr/include/libio.h" 3 + +}; + +struct _IO_FILE { + int _flags; + + + + + char* _IO_read_ptr; + char* _IO_read_end; + char* _IO_read_base; + char* _IO_write_base; + char* _IO_write_ptr; + char* _IO_write_end; + char* _IO_buf_base; + char* _IO_buf_end; + + char *_IO_save_base; + char *_IO_backup_base; + char *_IO_save_end; + + struct _IO_marker *_markers; + + struct _IO_FILE *_chain; + + int _fileno; + int _blksize; + __off_t _old_offset; + + + + unsigned short _cur_column; + signed char _vtable_offset; + char _shortbuf[1]; + + + + _IO_lock_t *_lock; + + + + + + + + + __off64_t _offset; + + int _unused2[16]; + +}; + + +typedef struct _IO_FILE _IO_FILE; + + +struct _IO_FILE_plus; +extern struct _IO_FILE_plus _IO_2_1_stdin_; +extern struct _IO_FILE_plus _IO_2_1_stdout_; +extern struct _IO_FILE_plus _IO_2_1_stderr_; + + + + + + + + + + + + + + + +typedef __ssize_t __io_read_fn (void * __cookie, char *__buf, + size_t __nbytes) ; + + + + + + + +typedef __ssize_t __io_write_fn (void * __cookie, __const char *__buf, + size_t __n) ; + + + + + + + +typedef int __io_seek_fn (void * __cookie, __off_t __pos, int __w) ; + + +typedef int __io_close_fn (void * __cookie) ; + + +# 311 "/usr/include/libio.h" 3 + + + + + + + +extern int __underflow (_IO_FILE *) ; +extern int __uflow (_IO_FILE *) ; +extern int __overflow (_IO_FILE *, int) ; + + + + + + + + + + + + + + + + +extern int _IO_getc (_IO_FILE *__fp) ; +extern int _IO_putc (int __c, _IO_FILE *__fp) ; +extern int _IO_feof (_IO_FILE *__fp) ; +extern int _IO_ferror (_IO_FILE *__fp) ; + +extern int _IO_peekc_locked (_IO_FILE *__fp) ; + + + + + +extern void _IO_flockfile (_IO_FILE *) ; +extern void _IO_funlockfile (_IO_FILE *) ; +extern int _IO_ftrylockfile (_IO_FILE *) ; + + + + + + + + + + + + +extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, + __gnuc_va_list , int *__restrict) ; +extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, + __gnuc_va_list ) ; +extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t ) ; +extern size_t _IO_sgetn (_IO_FILE *, void *, size_t ) ; + +extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t , int, int) ; +extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t , int) ; + +extern void _IO_free_backup_area (_IO_FILE *) ; + + + + + + +# 57 "/usr/include/stdio.h" 2 3 + + + + +typedef __off_t fpos_t; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/bits/stdio_lim.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 110 "/usr/include/stdio.h" 2 3 + + + + +extern FILE *stdin; +extern FILE *stdout; +extern FILE *stderr; + + + +extern int remove (__const char *__filename) ; + +extern int rename (__const char *__old, __const char *__new) ; + + + + +extern FILE *tmpfile (void) ; + + + + + + + + + + + +extern char *tmpnam (char *__s) ; + + + + +extern char *tmpnam_r (char *__s) ; + + + + + + + + + + + +extern char *tempnam (__const char *__dir, __const char *__pfx) ; + + + + +extern int fclose (FILE *__stream) ; + +extern int fflush (FILE *__stream) ; + + + +extern int fflush_unlocked (FILE *__stream) ; + + + + + + + + + + +extern FILE *fopen (__const char *__restrict __filename, + __const char *__restrict __modes) ; + +extern FILE *freopen (__const char *__restrict __filename, + __const char *__restrict __modes, + FILE *__restrict __stream) ; +# 197 "/usr/include/stdio.h" 3 + + + + + + + + + + + +extern FILE *fdopen (int __fd, __const char *__modes) ; + + +# 223 "/usr/include/stdio.h" 3 + + + + + +extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) ; + + + +extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, + int __modes, size_t __n) ; + + + + +extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, + size_t __size) ; + + +extern void setlinebuf (FILE *__stream) ; + + + + +extern int fprintf (FILE *__restrict __stream, + __const char *__restrict __format, ...) ; + +extern int printf (__const char *__restrict __format, ...) ; + +extern int sprintf (char *__restrict __s, + __const char *__restrict __format, ...) ; + + +extern int vfprintf (FILE *__restrict __s, + __const char *__restrict __format, + __gnuc_va_list __arg) ; + +extern int vprintf (__const char *__restrict __format, + __gnuc_va_list __arg) ; + +extern int vsprintf (char *__restrict __s, + __const char *__restrict __format, + __gnuc_va_list __arg) ; + + + +extern int snprintf (char *__restrict __s, size_t __maxlen, + __const char *__restrict __format, ...) + __attribute__ ((__format__ (__printf__, 3, 4))); + +extern int __vsnprintf (char *__restrict __s, size_t __maxlen, + __const char *__restrict __format, + __gnuc_va_list __arg) + __attribute__ ((__format__ (__printf__, 3, 0))); +extern int vsnprintf (char *__restrict __s, size_t __maxlen, + __const char *__restrict __format, + __gnuc_va_list __arg) + __attribute__ ((__format__ (__printf__, 3, 0))); + + +# 302 "/usr/include/stdio.h" 3 + + + + +extern int fscanf (FILE *__restrict __stream, + __const char *__restrict __format, ...) ; + +extern int scanf (__const char *__restrict __format, ...) ; + +extern int sscanf (__const char *__restrict __s, + __const char *__restrict __format, ...) ; + +# 330 "/usr/include/stdio.h" 3 + + + + +extern int fgetc (FILE *__stream) ; +extern int getc (FILE *__stream) ; + + +extern int getchar (void) ; + + + + + + + +extern int getc_unlocked (FILE *__stream) ; +extern int getchar_unlocked (void) ; + + + + +extern int fgetc_unlocked (FILE *__stream) ; + + + + +extern int fputc (int __c, FILE *__stream) ; +extern int putc (int __c, FILE *__stream) ; + + +extern int putchar (int __c) ; + + + + + + + +extern int fputc_unlocked (int __c, FILE *__stream) ; + + + + +extern int putc_unlocked (int __c, FILE *__stream) ; +extern int putchar_unlocked (int __c) ; + + + + + +extern int getw (FILE *__stream) ; + + +extern int putw (int __w, FILE *__stream) ; + + + + +extern char *fgets (char *__restrict __s, int __n, + FILE *__restrict __stream) ; + + + + + + + + + +extern char *gets (char *__s) ; + + +# 420 "/usr/include/stdio.h" 3 + + + + +extern int fputs (__const char *__restrict __s, + FILE *__restrict __stream) ; + + + + + + + + +extern int puts (__const char *__s) ; + + + +extern int ungetc (int __c, FILE *__stream) ; + + + +extern size_t fread (void *__restrict __ptr, size_t __size, + size_t __n, FILE *__restrict __stream) ; + +extern size_t fwrite (__const void *__restrict __ptr, size_t __size, + size_t __n, FILE *__restrict __s) ; + + + +extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, + size_t __n, FILE *__restrict __stream) ; +extern size_t fwrite_unlocked (__const void *__restrict __ptr, + size_t __size, size_t __n, + FILE *__restrict __stream) ; + + + + +extern int fseek (FILE *__stream, long int __off, int __whence) ; + +extern long int ftell (FILE *__stream) ; + +extern void rewind (FILE *__stream) ; + + + + + + + + + +typedef __off_t off_t; + + + + + + + + + + + + + + + + + + + + + +extern int fgetpos (FILE *__restrict __stream, + fpos_t *__restrict __pos) ; + +extern int fsetpos (FILE *__stream, __const fpos_t *__pos) ; +# 519 "/usr/include/stdio.h" 3 + + +# 529 "/usr/include/stdio.h" 3 + + + +extern void clearerr (FILE *__stream) ; + +extern int feof (FILE *__stream) ; + +extern int ferror (FILE *__stream) ; + + + +extern void clearerr_unlocked (FILE *__stream) ; +extern int feof_unlocked (FILE *__stream) ; +extern int ferror_unlocked (FILE *__stream) ; + + + + +extern void perror (__const char *__s) ; + + + + +extern int sys_nerr; +extern __const char *__const sys_errlist[]; + + + + + + + + + +extern int fileno (FILE *__stream) ; + + + + +extern int fileno_unlocked (FILE *__stream) ; + + + + + + +extern FILE *popen (__const char *__command, __const char *__modes) ; + + +extern int pclose (FILE *__stream) ; + + + + + +extern char *ctermid (char *__s) ; + + + + + + + + + +# 603 "/usr/include/stdio.h" 3 + + + + + + + +extern void flockfile (FILE *__stream) ; + + + +extern int ftrylockfile (FILE *__stream) ; + + +extern void funlockfile (FILE *__stream) ; + + + + + + + + + + + + + +# 1 "/usr/include/bits/stdio.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +extern __inline int +vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg) +{ + return vfprintf (stdout, __fmt, __arg); +} + + +extern __inline int +getchar (void) +{ + return _IO_getc (stdin); +} + + + + +extern __inline int +getc_unlocked (FILE *__fp) +{ + return (( __fp )->_IO_read_ptr >= ( __fp )->_IO_read_end ? __uflow ( __fp ) : *(unsigned char *) ( __fp )->_IO_read_ptr++) ; +} + + +extern __inline int +getchar_unlocked (void) +{ + return (( stdin )->_IO_read_ptr >= ( stdin )->_IO_read_end ? __uflow ( stdin ) : *(unsigned char *) ( stdin )->_IO_read_ptr++) ; +} + + + + +extern __inline int +putchar (int __c) +{ + return _IO_putc (__c, stdout); +} + + + + +extern __inline int +fputc_unlocked (int __c, FILE *__stream) +{ + return ((( __stream )->_IO_write_ptr >= ( __stream )->_IO_write_end) ? __overflow ( __stream , (unsigned char) ( __c )) : (unsigned char) (*( __stream )->_IO_write_ptr++ = ( __c ))) ; +} + + + + + +extern __inline int +putc_unlocked (int __c, FILE *__stream) +{ + return ((( __stream )->_IO_write_ptr >= ( __stream )->_IO_write_end) ? __overflow ( __stream , (unsigned char) ( __c )) : (unsigned char) (*( __stream )->_IO_write_ptr++ = ( __c ))) ; +} + + +extern __inline int +putchar_unlocked (int __c) +{ + return ((( stdout )->_IO_write_ptr >= ( stdout )->_IO_write_end) ? __overflow ( stdout , (unsigned char) ( __c )) : (unsigned char) (*( stdout )->_IO_write_ptr++ = ( __c ))) ; +} + + + + + + + + + + + + + + + +extern __inline int +feof_unlocked (FILE *__stream) +{ + return ((( __stream )->_flags & 0x10 ) != 0) ; +} + + +extern __inline int +ferror_unlocked (FILE *__stream) +{ + return ((( __stream )->_flags & 0x20 ) != 0) ; +} + + + + + + + + +# 149 "/usr/include/bits/stdio.h" 3 + + +# 165 "/usr/include/bits/stdio.h" 3 + + + + +# 631 "/usr/include/stdio.h" 2 3 + + + + + + + + +# 22 "cddb.c" 2 + +# 1 "/usr/include/stdlib.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + +# 188 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + +# 269 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 33 "/usr/include/stdlib.h" 2 3 + + + + + + + + +typedef struct + { + int quot; + int rem; + } div_t; + + + +typedef struct + { + long int quot; + long int rem; + } ldiv_t; + + + +# 65 "/usr/include/stdlib.h" 3 + + + + + + + + + + + + + + + +extern size_t __ctype_get_mb_cur_max (void) ; + + + +extern double atof (__const char *__nptr) ; + +extern int atoi (__const char *__nptr) ; + +extern long int atol (__const char *__nptr) ; + + + +__extension__ extern long long int atoll (__const char *__nptr) ; + + + +extern double strtod (__const char *__restrict __nptr, + char **__restrict __endptr) ; + + + + + + + + + + + +extern long int strtol (__const char *__restrict __nptr, + char **__restrict __endptr, int __base) ; + +extern unsigned long int strtoul (__const char *__restrict __nptr, + char **__restrict __endptr, + int __base) ; + + + +__extension__ +extern long long int strtoq (__const char *__restrict __nptr, + char **__restrict __endptr, int __base) ; + +__extension__ +extern unsigned long long int strtouq (__const char *__restrict __nptr, + char **__restrict __endptr, + int __base) ; + + + + + + +__extension__ +extern long long int strtoll (__const char *__restrict __nptr, + char **__restrict __endptr, int __base) ; + +__extension__ +extern unsigned long long int strtoull (__const char *__restrict __nptr, + char **__restrict __endptr, + int __base) ; + + + +# 190 "/usr/include/stdlib.h" 3 + + + + + + +extern double __strtod_internal (__const char *__restrict __nptr, + char **__restrict __endptr, + int __group) ; +extern float __strtof_internal (__const char *__restrict __nptr, + char **__restrict __endptr, int __group) ; +extern long double __strtold_internal (__const char * + __restrict __nptr, + char **__restrict __endptr, + int __group) ; + +extern long int __strtol_internal (__const char *__restrict __nptr, + char **__restrict __endptr, + int __base, int __group) ; + + + +extern unsigned long int __strtoul_internal (__const char * + __restrict __nptr, + char **__restrict __endptr, + int __base, int __group) ; + + + + +__extension__ +extern long long int __strtoll_internal (__const char *__restrict __nptr, + char **__restrict __endptr, + int __base, int __group) ; + + + +__extension__ +extern unsigned long long int __strtoull_internal (__const char * + __restrict __nptr, + char ** + __restrict __endptr, + int __base, + int __group) ; + + + + + + + + +extern __inline double +strtod (__const char *__restrict __nptr, char **__restrict __endptr) +{ + return __strtod_internal (__nptr, __endptr, 0); +} +extern __inline long int +strtol (__const char *__restrict __nptr, char **__restrict __endptr, + int __base) +{ + return __strtol_internal (__nptr, __endptr, __base, 0); +} +extern __inline unsigned long int +strtoul (__const char *__restrict __nptr, char **__restrict __endptr, + int __base) +{ + return __strtoul_internal (__nptr, __endptr, __base, 0); +} + +# 271 "/usr/include/stdlib.h" 3 + + + +__extension__ extern __inline long long int +strtoq (__const char *__restrict __nptr, char **__restrict __endptr, + int __base) +{ + return __strtoll_internal (__nptr, __endptr, __base, 0); +} +__extension__ extern __inline unsigned long long int +strtouq (__const char *__restrict __nptr, char **__restrict __endptr, + int __base) +{ + return __strtoull_internal (__nptr, __endptr, __base, 0); +} + + + +__extension__ extern __inline long long int +strtoll (__const char *__restrict __nptr, char **__restrict __endptr, + int __base) +{ + return __strtoll_internal (__nptr, __endptr, __base, 0); +} +__extension__ extern __inline unsigned long long int +strtoull (__const char * __restrict __nptr, char **__restrict __endptr, + int __base) +{ + return __strtoull_internal (__nptr, __endptr, __base, 0); +} + + +extern __inline double +atof (__const char *__nptr) +{ + return strtod (__nptr, (char **) ((void *)0) ); +} +extern __inline int +atoi (__const char *__nptr) +{ + return (int) strtol (__nptr, (char **) ((void *)0) , 10); +} +extern __inline long int +atol (__const char *__nptr) +{ + return strtol (__nptr, (char **) ((void *)0) , 10); +} + + +__extension__ extern __inline long long int +atoll (__const char *__nptr) +{ + return strtoll (__nptr, (char **) ((void *)0) , 10); +} + + + + + + + + +extern char *l64a (long int __n) ; + + +extern long int a64l (__const char *__s) ; + + +# 1 "/usr/include/sys/types.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +typedef __u_char u_char; +typedef __u_short u_short; +typedef __u_int u_int; +typedef __u_long u_long; +typedef __quad_t quad_t; +typedef __u_quad_t u_quad_t; +typedef __fsid_t fsid_t; + + +typedef __loff_t loff_t; + + + +typedef __ino_t ino_t; + + + + + + + + + + +typedef __dev_t dev_t; + + + + +typedef __gid_t gid_t; + + + + +typedef __mode_t mode_t; + + + + +typedef __nlink_t nlink_t; + + + + +typedef __uid_t uid_t; + + + + + + + + + + + + + + + + + +typedef __pid_t pid_t; + + + + +typedef __id_t id_t; + + + +typedef __ssize_t ssize_t; + + + + +typedef __daddr_t daddr_t; +typedef __caddr_t caddr_t; + + + +typedef __key_t key_t; + + + + + + +# 1 "/usr/include/time.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 51 "/usr/include/time.h" 3 + + + +# 62 "/usr/include/time.h" 3 + + + + + + + + + +typedef __time_t time_t; + + + + + +# 89 "/usr/include/time.h" 3 + + + + +# 279 "/usr/include/time.h" 3 + + + +# 121 "/usr/include/sys/types.h" 2 3 + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + +# 188 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + +# 271 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 124 "/usr/include/sys/types.h" 2 3 + + + + +typedef unsigned long int ulong; +typedef unsigned short int ushort; +typedef unsigned int uint; + + + + +# 158 "/usr/include/sys/types.h" 3 + + + + + + + + + + +typedef int int8_t __attribute__ ((__mode__ ( __QI__ ))) ; +typedef int int16_t __attribute__ ((__mode__ ( __HI__ ))) ; +typedef int int32_t __attribute__ ((__mode__ ( __SI__ ))) ; +typedef int int64_t __attribute__ ((__mode__ ( __DI__ ))) ; + + +typedef unsigned int u_int8_t __attribute__ ((__mode__ ( __QI__ ))) ; +typedef unsigned int u_int16_t __attribute__ ((__mode__ ( __HI__ ))) ; +typedef unsigned int u_int32_t __attribute__ ((__mode__ ( __SI__ ))) ; +typedef unsigned int u_int64_t __attribute__ ((__mode__ ( __DI__ ))) ; + +typedef int register_t __attribute__ ((__mode__ (__word__))); + + + + + + + + + + +# 1 "/usr/include/endian.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/bits/endian.h" 1 3 + + + + + + + +# 35 "/usr/include/endian.h" 2 3 + + + + + + + + + + + + + + + + +# 190 "/usr/include/sys/types.h" 2 3 + + + +# 1 "/usr/include/sys/select.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/bits/select.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 36 "/usr/include/bits/select.h" 3 + + + + + + + + + + + + +# 56 "/usr/include/bits/select.h" 3 + +# 72 "/usr/include/bits/select.h" 3 + +# 31 "/usr/include/sys/select.h" 2 3 + + + +# 1 "/usr/include/bits/sigset.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + +typedef int __sig_atomic_t; + + + + +typedef struct + { + unsigned long int __val[(1024 / (8 * sizeof (unsigned long int))) ]; + } __sigset_t; + + + + + + + + + + +# 125 "/usr/include/bits/sigset.h" 3 + +# 34 "/usr/include/sys/select.h" 2 3 + + + + +# 1 "/usr/include/time.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 51 "/usr/include/time.h" 3 + + + +# 62 "/usr/include/time.h" 3 + + + +# 73 "/usr/include/time.h" 3 + + + + + + + + + + +struct timespec + { + long int tv_sec; + long int tv_nsec; + }; + + + + + +# 279 "/usr/include/time.h" 3 + + + +# 38 "/usr/include/sys/select.h" 2 3 + + + + + + + + +struct timeval; + +typedef __fd_mask fd_mask; + + +typedef __fd_set fd_set; + + + + + + + + + + + + + + + + + + + + + + +extern int __select (int __nfds, __fd_set *__readfds, + __fd_set *__writefds, __fd_set *__exceptfds, + struct timeval *__timeout) ; +extern int select (int __nfds, __fd_set *__readfds, + __fd_set *__writefds, __fd_set *__exceptfds, + struct timeval *__timeout) ; + +# 91 "/usr/include/sys/select.h" 3 + + + + + +# 193 "/usr/include/sys/types.h" 2 3 + + + +# 1 "/usr/include/sys/sysmacros.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 47 "/usr/include/sys/sysmacros.h" 3 + + + +# 196 "/usr/include/sys/types.h" 2 3 + + + + + + +typedef __blkcnt_t blkcnt_t; +typedef __fsblkcnt_t fsblkcnt_t; +typedef __fsfilcnt_t fsfilcnt_t; + + + + + + + + + + + + + + + +# 339 "/usr/include/stdlib.h" 2 3 + + + + + + + +extern int32_t random (void) ; + + +extern void srandom (unsigned int __seed) ; + + + + + +extern void * initstate (unsigned int __seed, void * __statebuf, + size_t __statelen) ; + + + +extern void * setstate (void * __statebuf) ; + + + + + + + +struct random_data + { + int32_t *fptr; + int32_t *rptr; + int32_t *state; + int rand_type; + int rand_deg; + int rand_sep; + int32_t *end_ptr; + }; + +extern int random_r (struct random_data *__restrict __buf, + int32_t *__restrict __result) ; + +extern int srandom_r (unsigned int __seed, struct random_data *__buf) ; + +extern int initstate_r (unsigned int __seed, + void * __restrict __statebuf, + size_t __statelen, + struct random_data *__restrict __buf) ; + +extern int setstate_r (void * __restrict __statebuf, + struct random_data *__restrict __buf) ; + + + + + +extern int rand (void) ; + +extern void srand (unsigned int __seed) ; + + + +extern int rand_r (unsigned int *__seed) ; + + + + + + + +extern double drand48 (void) ; +extern double erand48 (unsigned short int __xsubi[3]) ; + + +extern long int lrand48 (void) ; +extern long int nrand48 (unsigned short int __xsubi[3]) ; + + +extern long int mrand48 (void) ; +extern long int jrand48 (unsigned short int __xsubi[3]) ; + + +extern void srand48 (long int __seedval) ; +extern unsigned short int *seed48 (unsigned short int __seed16v[3]) ; +extern void lcong48 (unsigned short int __param[7]) ; + + +struct drand48_data + { + unsigned short int x[3]; + unsigned short int a[3]; + unsigned short int c; + unsigned short int old_x[3]; + int init; + }; + + + +extern int drand48_r (struct drand48_data *__restrict __buffer, + double *__restrict __result) ; +extern int erand48_r (unsigned short int __xsubi[3], + struct drand48_data *__restrict __buffer, + double *__restrict __result) ; + + +extern int lrand48_r (struct drand48_data *__restrict __buffer, + long int *__restrict __result) ; +extern int nrand48_r (unsigned short int __xsubi[3], + struct drand48_data *__restrict __buffer, + long int *__restrict __result) ; + + +extern int mrand48_r (struct drand48_data *__restrict __buffer, + long int *__restrict __result) ; +extern int jrand48_r (unsigned short int __xsubi[3], + struct drand48_data *__restrict __buffer, + long int *__restrict __result) ; + + +extern int srand48_r (long int __seedval, struct drand48_data *__buffer) ; + +extern int seed48_r (unsigned short int __seed16v[3], + struct drand48_data *__buffer) ; + +extern int lcong48_r (unsigned short int __param[7], + struct drand48_data *__buffer) ; + + + + + + + + +extern void * malloc (size_t __size) ; + +extern void * calloc (size_t __nmemb, size_t __size) ; + + + + + +extern void * realloc (void * __ptr, size_t __size) ; + +extern void free (void * __ptr) ; + + + +extern void cfree (void * __ptr) ; + + + +# 1 "/usr/include/alloca.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + +# 188 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + +# 271 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 25 "/usr/include/alloca.h" 2 3 + + + + + + + + +extern void * alloca (size_t __size) ; + + + + + + + + +# 492 "/usr/include/stdlib.h" 2 3 + + + + + +extern void * valloc (size_t __size) ; + + + + +extern void abort (void) __attribute__ ((__noreturn__)); + + + +extern int atexit (void (*__func) (void)) ; + + + + +extern int __on_exit (void (*__func) (int __status, void * __arg), + void * __arg) ; +extern int on_exit (void (*__func) (int __status, void * __arg), + void * __arg) ; + + + + + +extern void exit (int __status) __attribute__ ((__noreturn__)); + + + + + + + + + +extern char *getenv (__const char *__name) ; + + + +extern char *__secure_getenv (__const char *__name) ; + + + + + +extern int putenv (__const char *__string) ; + + + + + +extern int setenv (__const char *__name, __const char *__value, + int __replace) ; + + +extern void unsetenv (__const char *__name) ; + + + + + + +extern int clearenv (void) ; + + + + + + + + +extern char *mktemp (char *__template) ; + + + + + + +extern int mkstemp (char *__template) ; + + + + +extern int system (__const char *__command) ; + + + + + + + + + + + + + + + + +extern char *realpath (__const char *__restrict __name, + char *__restrict __resolved) ; + + + + + + +typedef int (*__compar_fn_t) (__const void * , __const void * ) ; + + + + + + + + +extern void * bsearch (__const void * __key, __const void * __base, + size_t __nmemb, size_t __size, + __compar_fn_t __compar) ; + + + +extern void qsort (void * __base, size_t __nmemb, size_t __size, + __compar_fn_t __compar) ; + + + +extern int abs (int __x) __attribute__ ((__const__)); +extern long int labs (long int __x) __attribute__ ((__const__)); + + + + + + + + + +extern div_t div (int __numer, int __denom) __attribute__ ((__const__)); +extern ldiv_t ldiv (long int __numer, long int __denom) + __attribute__ ((__const__)); + + + + + + + + + + + + + + +extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, + int *__restrict __sign) ; + + + + +extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, + int *__restrict __sign) ; + + + + +extern char *gcvt (double __value, int __ndigit, char *__buf) ; + + +extern char *qecvt (long double __value, int __ndigit, + int *__restrict __decpt, int *__restrict __sign) ; +extern char *qfcvt (long double __value, int __ndigit, + int *__restrict __decpt, int *__restrict __sign) ; +extern char *qgcvt (long double __value, int __ndigit, char *__buf) ; + + + + + +extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, + int *__restrict __sign, char *__restrict __buf, + size_t __len) ; +extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, + int *__restrict __sign, char *__restrict __buf, + size_t __len) ; + +extern int qecvt_r (long double __value, int __ndigit, + int *__restrict __decpt, int *__restrict __sign, + char *__restrict __buf, size_t __len) ; +extern int qfcvt_r (long double __value, int __ndigit, + int *__restrict __decpt, int *__restrict __sign, + char *__restrict __buf, size_t __len) ; + + + + + + +extern int mblen (__const char *__s, size_t __n) ; + + +extern int mbtowc (wchar_t *__restrict __pwc, + __const char *__restrict __s, size_t __n) ; + + +extern int wctomb (char *__s, wchar_t __wchar) ; + + + +extern size_t mbstowcs (wchar_t *__restrict __pwcs, + __const char *__restrict __s, size_t __n) ; + +extern size_t wcstombs (char *__restrict __s, + __const wchar_t *__restrict __pwcs, size_t __n) ; + + + + + + + +extern int rpmatch (__const char *__response) ; + + + +# 732 "/usr/include/stdlib.h" 3 + + + +# 756 "/usr/include/stdlib.h" 3 + + +# 766 "/usr/include/stdlib.h" 3 + + + + + + + + +# 23 "cddb.c" 2 + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stdarg.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +void va_end (__gnuc_va_list); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 175 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stdarg.h" 3 + + + + + + + + + + + + + +typedef __gnuc_va_list va_list; + + + + + + + + + + + + + + + + + + + + + + + + +# 24 "cddb.c" 2 + +# 1 "/usr/include/string.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + +# 188 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + +# 271 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 33 "/usr/include/string.h" 2 3 + + + + +extern void * memcpy (void * __restrict __dest, + __const void * __restrict __src, size_t __n) ; + + +extern void * memmove (void * __dest, __const void * __src, + size_t __n) ; + + + + + +extern void * memccpy (void * __dest, __const void * __src, + int __c, size_t __n) ; + + + + +extern void * memset (void * __s, int __c, size_t __n) ; + + +extern int memcmp (__const void * __s1, __const void * __s2, + size_t __n) ; + + +extern void * memchr (__const void * __s, int __c, size_t __n) ; + + + + + + + + + +extern char *strcpy (char *__restrict __dest, + __const char *__restrict __src) ; + +extern char *strncpy (char *__restrict __dest, + __const char *__restrict __src, size_t __n) ; + + +extern char *strcat (char *__restrict __dest, + __const char *__restrict __src) ; + +extern char *strncat (char *__restrict __dest, + __const char *__restrict __src, size_t __n) ; + + +extern int strcmp (__const char *__s1, __const char *__s2) ; + +extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) ; + + +extern int strcoll (__const char *__s1, __const char *__s2) ; + +extern size_t strxfrm (char *__restrict __dest, + __const char *__restrict __src, size_t __n) ; + +# 107 "/usr/include/string.h" 3 + + + + +extern char *__strdup (__const char *__s) ; +extern char *strdup (__const char *__s) ; + + + + + + + + + +# 143 "/usr/include/string.h" 3 + + + +extern char *strchr (__const char *__s, int __c) ; + +extern char *strrchr (__const char *__s, int __c) ; + + + + + + + + + +extern size_t strcspn (__const char *__s, __const char *__reject) ; + + +extern size_t strspn (__const char *__s, __const char *__accept) ; + +extern char *strpbrk (__const char *__s, __const char *__accept) ; + +extern char *strstr (__const char *__haystack, __const char *__needle) ; + + + + + + + + + + +extern char *strtok (char *__restrict __s, + __const char *__restrict __delim) ; + + + +extern char *__strtok_r (char *__restrict __s, + __const char *__restrict __delim, + char **__restrict __save_ptr) ; + +extern char *strtok_r (char *__restrict __s, + __const char *__restrict __delim, + char **__restrict __save_ptr) ; + + +# 203 "/usr/include/string.h" 3 + + + + +extern size_t strlen (__const char *__s) ; + + + + + + + + + +extern char *strerror (int __errnum) ; + + + +extern char *__strerror_r (int __errnum, char *__buf, size_t __buflen) ; +extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) ; + + + + +extern void __bzero (void * __s, size_t __n) ; + + + +extern void bcopy (__const void * __src, void * __dest, size_t __n) ; + + +extern void bzero (void * __s, size_t __n) ; + + +extern int bcmp (__const void * __s1, __const void * __s2, size_t __n) ; + + +extern char *index (__const char *__s, int __c) ; + + +extern char *rindex (__const char *__s, int __c) ; + + + +extern int __ffs (int __i) __attribute__ ((const)); +extern int ffs (int __i) __attribute__ ((const)); + + + + + + + + + + + + +extern int __strcasecmp (__const char *__s1, __const char *__s2) ; +extern int strcasecmp (__const char *__s1, __const char *__s2) ; + + +extern int strncasecmp (__const char *__s1, __const char *__s2, + size_t __n) ; + + +# 277 "/usr/include/string.h" 3 + + + + + +extern char *strsep (char **__restrict __stringp, + __const char *__restrict __delim) ; + + +# 319 "/usr/include/string.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/bits/string.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 876 "/usr/include/bits/string.h" 3 + +# 343 "/usr/include/string.h" 2 3 + + + +# 1 "/usr/include/bits/string2.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 73 "/usr/include/bits/string2.h" 3 + +# 88 "/usr/include/bits/string2.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + +# 180 "/usr/include/bits/string2.h" 3 + + + + + + + + + + + + + + + + + + + +# 367 "/usr/include/bits/string2.h" 3 + + + + + +extern void * __rawmemchr (const void * __s, int __c); + + + + + + + + + + + + + + + + + + + + + + + +extern __inline char *__strcpy_small (char *, __uint16_t, __uint16_t, + __uint32_t, __uint32_t, size_t); +extern __inline char * +__strcpy_small (char *__dest, + __uint16_t __src0_2, __uint16_t __src4_2, + __uint32_t __src0_4, __uint32_t __src4_4, + size_t __srclen) +{ + union { + __uint32_t __ui; + __uint16_t __usi; + unsigned char __uc; + } *__u = (void *) __dest; + switch (__srclen) + { + case 1: + __u->__uc = '\0'; + break; + case 2: + __u->__usi = __src0_2; + break; + case 3: + __u->__usi = __src0_2; + __u = __extension__ ((void *) __u + 2); + __u->__uc = '\0'; + break; + case 4: + __u->__ui = __src0_4; + break; + case 5: + __u->__ui = __src0_4; + __u = __extension__ ((void *) __u + 4); + __u->__uc = '\0'; + break; + case 6: + __u->__ui = __src0_4; + __u = __extension__ ((void *) __u + 4); + __u->__usi = __src4_2; + break; + case 7: + __u->__ui = __src0_4; + __u = __extension__ ((void *) __u + 4); + __u->__usi = __src4_2; + __u = __extension__ ((void *) __u + 2); + __u->__uc = '\0'; + break; + case 8: + __u->__ui = __src0_4; + __u = __extension__ ((void *) __u + 4); + __u->__ui = __src4_4; + break; + } + return __dest; +} +# 531 "/usr/include/bits/string2.h" 3 + + + + + +# 696 "/usr/include/bits/string2.h" 3 + + + + + +# 711 "/usr/include/bits/string2.h" 3 + + + + + + + + + + + + + +# 732 "/usr/include/bits/string2.h" 3 + + + + + + + + + + + + + + +# 765 "/usr/include/bits/string2.h" 3 + + +# 792 "/usr/include/bits/string2.h" 3 + + +# 814 "/usr/include/bits/string2.h" 3 + + +# 839 "/usr/include/bits/string2.h" 3 + + + + + + + + + + + + + + + + + + + +# 871 "/usr/include/bits/string2.h" 3 + +extern __inline size_t __strcspn_c1 (__const char *__s, char __reject); +extern __inline size_t +__strcspn_c1 (__const char *__s, char __reject) +{ + register size_t __result = 0; + while (__s[__result] != '\0' && __s[__result] != __reject) + ++__result; + return __result; +} + +extern __inline size_t __strcspn_c2 (__const char *__s, char __reject1, + char __reject2); +extern __inline size_t +__strcspn_c2 (__const char *__s, char __reject1, char __reject2) +{ + register size_t __result = 0; + while (__s[__result] != '\0' && __s[__result] != __reject1 + && __s[__result] != __reject2) + ++__result; + return __result; +} + +extern __inline size_t __strcspn_c3 (__const char *__s, char __reject1, + char __reject2, char __reject3); +extern __inline size_t +__strcspn_c3 (__const char *__s, char __reject1, char __reject2, + char __reject3) +{ + register size_t __result = 0; + while (__s[__result] != '\0' && __s[__result] != __reject1 + && __s[__result] != __reject2 && __s[__result] != __reject3) + ++__result; + return __result; +} + + + + + + + +# 926 "/usr/include/bits/string2.h" 3 + +extern __inline size_t __strspn_c1 (__const char *__s, char __accept); +extern __inline size_t +__strspn_c1 (__const char *__s, char __accept) +{ + register size_t __result = 0; + + while (__s[__result] == __accept) + ++__result; + return __result; +} + +extern __inline size_t __strspn_c2 (__const char *__s, char __accept1, + char __accept2); +extern __inline size_t +__strspn_c2 (__const char *__s, char __accept1, char __accept2) +{ + register size_t __result = 0; + + while (__s[__result] == __accept1 || __s[__result] == __accept2) + ++__result; + return __result; +} + +extern __inline size_t __strspn_c3 (__const char *__s, char __accept1, + char __accept2, char __accept3); +extern __inline size_t +__strspn_c3 (__const char *__s, char __accept1, char __accept2, char __accept3) +{ + register size_t __result = 0; + + while (__s[__result] == __accept1 || __s[__result] == __accept2 + || __s[__result] == __accept3) + ++__result; + return __result; +} + + + + + + +# 981 "/usr/include/bits/string2.h" 3 + +extern __inline char *__strpbrk_c2 (__const char *__s, char __accept1, + char __accept2); +extern __inline char * +__strpbrk_c2 (__const char *__s, char __accept1, char __accept2) +{ + + while (*__s != '\0' && *__s != __accept1 && *__s != __accept2) + ++__s; + return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; +} + +extern __inline char *__strpbrk_c3 (__const char *__s, char __accept1, + char __accept2, char __accept3); +extern __inline char * +__strpbrk_c3 (__const char *__s, char __accept1, char __accept2, + char __accept3) +{ + + while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 + && *__s != __accept3) + ++__s; + return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; +} + + + + + + +# 1019 "/usr/include/bits/string2.h" 3 + + + +# 1031 "/usr/include/bits/string2.h" 3 + + + + + + + + + + + + +extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp); +extern __inline char * +__strtok_r_1c (char *__s, char __sep, char **__nextp) +{ + char *__result; + if (__s == ((void *)0) ) + __s = *__nextp; + while (*__s == __sep) + ++__s; + if (*__s == '\0') + __result = ((void *)0) ; + else + { + __result = __s; + while (*__s != '\0' && *__s != __sep) + ++__s; + if (*__s == '\0') + *__nextp = __s; + else + { + *__s = '\0'; + *__nextp = __s + 1; + } + } + return __result; +} + + + + + + + + + +# 1090 "/usr/include/bits/string2.h" 3 + +extern __inline char *__strsep_1c (char **__s, char __reject); +extern __inline char * +__strsep_1c (char **__s, char __reject) +{ + register char *__retval = *__s; + if (__retval == ((void *)0) ) + return *__s = ((void *)0) ; + if (*__retval == __reject) + *(*__s)++ = '\0'; + else + if ((*__s = (__extension__ (__builtin_constant_p ( __reject ) && ( __reject ) == '\0' ? (char *) __rawmemchr ( __retval , __reject ) : strchr ( __retval , __reject ))) ) != ((void *)0) ) + *(*__s)++ = '\0'; + else + *__s = ((void *)0) ; + return __retval; +} + +extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2); +extern __inline char * +__strsep_2c (char **__s, char __reject1, char __reject2) +{ + register char *__retval = *__s; + if (__retval == ((void *)0) ) + return *__s = ((void *)0) ; + if (*__retval == __reject1 || *__retval == __reject2) + *(*__s)++ = '\0'; + else + { + register char *__cp = __retval; + while (*__cp != '\0' && *__cp != __reject1 && *__cp != __reject2) + ++__cp; + if (*__cp != '\0') + { + *__s = __cp; + *(*__s)++ = '\0'; + } + else + *__s = ((void *)0) ; + } + return __retval; +} + +extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2, + char __reject3); +extern __inline char * +__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3) +{ + register char *__retval = *__s; + if (__retval == ((void *)0) ) + return *__s = ((void *)0) ; + if (*__retval == __reject1 || *__retval == __reject2 + || *__retval == __reject3) + *(*__s)++ = '\0'; + else + { + register char *__cp = __retval; + while (*__cp != '\0' && *__cp != __reject1 && *__cp != __reject2 + && *__cp != __reject3) + ++__cp; + if (*__cp != '\0') + { + *__s = __cp; + *(*__s)++ = '\0'; + } + else + *__s = ((void *)0) ; + } + return __retval; +} + +extern __inline char *__strsep_g (char **__s, __const char *__reject); +extern __inline char * +__strsep_g (char **__s, __const char *__reject) +{ + register char *__retval = *__s; + if (__retval == ((void *)0) || *__retval == '\0') + return ((void *)0) ; + if ((*__s = __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p ( __reject ) && ((size_t)(const void *)(( __reject ) + 1) - (size_t)(const void *)( __reject ) == 1) ? ((__a0 = ((__const char *) ( __reject ))[0], __a0 == '\0') ? ((void *)0) : ((__a1 = ((__const char *) ( __reject ))[1], __a1 == '\0') ? (__extension__ (__builtin_constant_p ( __a0 ) && ( __a0 ) == '\0' ? (char *) __rawmemchr ( __retval , __a0 ) : strchr ( __retval , __a0 ))) : ((__a2 = ((__const char *) ( __reject ))[2], __a2 == '\0') ? __strpbrk_c2 ( __retval , __a0, __a1) : (((__const char *) ( __reject ))[3] == '\0' ? __strpbrk_c3 ( __retval , __a0, __a1, __a2) : strpbrk ( __retval , __reject ))))) : strpbrk ( __retval , __reject )); }) ) != ((void *)0) ) + *(*__s)++ = '\0'; + return __retval; +} + + + + + + + + + + + + + + + + + + +# 1199 "/usr/include/bits/string2.h" 3 + + + + + + + + + +# 1225 "/usr/include/bits/string2.h" 3 + + + + + + + + + + + + + +# 346 "/usr/include/string.h" 2 3 + + + + + + + +# 25 "cddb.c" 2 + + +# 1 "/usr/include/sys/socket.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + +# 188 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + +# 271 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 28 "/usr/include/sys/socket.h" 2 3 + + + + + + +# 1 "/usr/include/bits/socket.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + +# 188 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + +# 271 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 29 "/usr/include/bits/socket.h" 2 3 + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/limits.h" 1 3 + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/syslimits.h" 1 3 + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/limits.h" 1 3 + + + + + +# 114 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/limits.h" 3 + + + +# 1 "/usr/include/limits.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/bits/posix1_lim.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/bits/local_lim.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/linux/limits.h" 1 3 + + + + + + + + + + + + + + + + + + + +# 27 "/usr/include/bits/local_lim.h" 2 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 126 "/usr/include/bits/posix1_lim.h" 2 3 + + + + + + + + + + + + + + + + +# 30 "/usr/include/limits.h" 2 3 + + + + +# 1 "/usr/include/bits/posix2_lim.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 34 "/usr/include/limits.h" 2 3 + + + + + + + + + + + + + + + + +# 121 "/usr/include/limits.h" 3 + + + + + + + + + + + + + +# 117 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/limits.h" 2 3 + + + + +# 7 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/syslimits.h" 2 3 + + +# 11 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/limits.h" 2 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 107 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/limits.h" 3 + + + + + + + + + + + + + + +# 31 "/usr/include/bits/socket.h" 2 3 + + + + +typedef unsigned int socklen_t; + + +enum __socket_type +{ + SOCK_STREAM = 1, + + + SOCK_DGRAM = 2, + + + SOCK_RAW = 3, + + SOCK_RDM = 4, + + SOCK_SEQPACKET = 5, + + + SOCK_PACKET = 10 + + + +}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/bits/sockaddr.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +typedef unsigned short int sa_family_t; + + + + + + + + + + + + +extern int __libc_sa_len (sa_family_t __af) ; + + +# 133 "/usr/include/bits/socket.h" 2 3 + + + +struct sockaddr + { + sa_family_t sa_family ; + char sa_data[14]; + }; + + + + + + + + + + + + +struct sockaddr_storage + { + sa_family_t __ss_family ; + __uint32_t __ss_align; + char __ss_padding[(128 - (2 * sizeof (__uint32_t ))) ]; + }; + + + +enum + { + MSG_OOB = 0x01, + + MSG_PEEK = 0x02, + + MSG_DONTROUTE = 0x04, + + + + + + + MSG_CTRUNC = 0x08, + + MSG_PROXY = 0x10, + + MSG_TRUNC = 0x20, + + MSG_DONTWAIT = 0x40, + + MSG_EOR = 0x80, + + MSG_WAITALL = 0x100, + + MSG_FIN = 0x200, + + MSG_SYN = 0x400, + + MSG_URG = 0x800, + + MSG_RST = 0x1000, + + MSG_ERRQUEUE = 0x2000, + + MSG_NOSIGNAL = 0x4000 + + }; + + + + +struct msghdr + { + void * msg_name; + socklen_t msg_namelen; + + struct iovec *msg_iov; + size_t msg_iovlen; + + void * msg_control; + size_t msg_controllen; + + int msg_flags; + }; + + +struct cmsghdr + { + size_t cmsg_len; + + int cmsg_level; + int cmsg_type; + + unsigned char __cmsg_data[0]; + + + }; + + + + + + + + + + + + + + + + + +extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, + struct cmsghdr *__cmsg) ; + + + + +extern __inline struct cmsghdr * +__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) +{ + if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr)) + + return 0; + + __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg + + ((( __cmsg->cmsg_len ) + sizeof (size_t) - 1) & ~(sizeof (size_t) - 1)) ); + if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control + + __mhdr->msg_controllen) + || ((unsigned char *) __cmsg + ((( __cmsg->cmsg_len ) + sizeof (size_t) - 1) & ~(sizeof (size_t) - 1)) + >= ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) + + return 0; + return __cmsg; +} + + + + +enum + { + SCM_RIGHTS = 0x01, + + + SCM_CREDENTIALS = 0x02, + + + __SCM_CONNECT = 0x03 + }; + + + +struct ucred +{ + pid_t pid; + uid_t uid; + gid_t gid; +}; + + +# 1 "/usr/include/asm/socket.h" 1 3 + + + +# 1 "/usr/include/asm/sockios.h" 1 3 + + + + + + + + + + + + +# 4 "/usr/include/asm/socket.h" 2 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 55 "/usr/include/asm/socket.h" 3 + + + +# 295 "/usr/include/bits/socket.h" 2 3 + + + + +struct linger + { + int l_onoff; + int l_linger; + }; + + +# 34 "/usr/include/sys/socket.h" 2 3 + + + + + +struct osockaddr + { + unsigned short int sa_family; + unsigned char sa_data[14]; + }; + + + + +enum +{ + SHUT_RD = 0, + + SHUT_WR, + + SHUT_RDWR + +}; + + + + + + + + + + + + + + + +# 85 "/usr/include/sys/socket.h" 3 + + +typedef union { struct sockaddr *__sockaddr__; struct sockaddr_at *__sockaddr_at__; struct sockaddr_ax25 *__sockaddr_ax25__; struct sockaddr_dl *__sockaddr_dl__; struct sockaddr_eon *__sockaddr_eon__; struct sockaddr_in *__sockaddr_in__; struct sockaddr_in6 *__sockaddr_in6__; struct sockaddr_inarp *__sockaddr_inarp__; struct sockaddr_ipx *__sockaddr_ipx__; struct sockaddr_iso *__sockaddr_iso__; struct sockaddr_ns *__sockaddr_ns__; struct sockaddr_un *__sockaddr_un__; struct sockaddr_x25 *__sockaddr_x25__; + } __SOCKADDR_ARG __attribute__ ((__transparent_union__)); + + +typedef union { __const struct sockaddr *__sockaddr__; __const struct sockaddr_at *__sockaddr_at__; __const struct sockaddr_ax25 *__sockaddr_ax25__; __const struct sockaddr_dl *__sockaddr_dl__; __const struct sockaddr_eon *__sockaddr_eon__; __const struct sockaddr_in *__sockaddr_in__; __const struct sockaddr_in6 *__sockaddr_in6__; __const struct sockaddr_inarp *__sockaddr_inarp__; __const struct sockaddr_ipx *__sockaddr_ipx__; __const struct sockaddr_iso *__sockaddr_iso__; __const struct sockaddr_ns *__sockaddr_ns__; __const struct sockaddr_un *__sockaddr_un__; __const struct sockaddr_x25 *__sockaddr_x25__; + } __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__)); + + + + + + + +extern int socket (int __domain, int __type, int __protocol) ; + + + + + +extern int socketpair (int __domain, int __type, int __protocol, + int __fds[2]) ; + + +extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len) ; + + +extern int getsockname (int __fd, __SOCKADDR_ARG __addr, + socklen_t *__len) ; + + + + + +extern int __connect (int __fd, + __CONST_SOCKADDR_ARG __addr, socklen_t __len) ; +extern int connect (int __fd, + __CONST_SOCKADDR_ARG __addr, socklen_t __len) ; + + + +extern int getpeername (int __fd, __SOCKADDR_ARG __addr, + socklen_t *__len) ; + + + +extern int __send (int __fd, __const void * __buf, size_t __n, + int __flags) ; +extern int send (int __fd, __const void * __buf, size_t __n, + int __flags) ; + + + +extern int recv (int __fd, void * __buf, size_t __n, int __flags) ; + + + +extern int sendto (int __fd, __const void * __buf, size_t __n, + int __flags, __CONST_SOCKADDR_ARG __addr, + socklen_t __addr_len) ; + + + + + +extern int recvfrom (int __fd, void * __buf, size_t __n, int __flags, + __SOCKADDR_ARG __addr, socklen_t *__addr_len) ; + + + + +extern int sendmsg (int __fd, __const struct msghdr *__message, + int __flags) ; + + + +extern int recvmsg (int __fd, struct msghdr *__message, int __flags) ; + + + + + +extern int getsockopt (int __fd, int __level, int __optname, + void * __optval, socklen_t *__optlen) ; + + + + +extern int setsockopt (int __fd, int __level, int __optname, + __const void * __optval, socklen_t __optlen) ; + + + + + +extern int listen (int __fd, unsigned int __n) ; + + + + + + +extern int accept (int __fd, __SOCKADDR_ARG __addr, + socklen_t *__addr_len) ; + + + + + + + +extern int shutdown (int __fd, int __how) ; + + + + + +extern int isfdtype (int __fd, int __fdtype) ; + + + + +# 27 "cddb.c" 2 + +# 1 "/usr/include/sys/stat.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 78 "/usr/include/sys/stat.h" 3 + + + + + + + + + + + +# 1 "/usr/include/bits/stat.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +struct stat + { + __dev_t st_dev; + unsigned short int __pad1; + + __ino_t st_ino; + + + + __mode_t st_mode; + __nlink_t st_nlink; + __uid_t st_uid; + __gid_t st_gid; + __dev_t st_rdev; + unsigned short int __pad2; + + __off_t st_size; + + + + unsigned long int st_blksize; + + + __blkcnt_t st_blocks; + + + + __time_t st_atime; + unsigned long int __unused1; + __time_t st_mtime; + unsigned long int __unused2; + __time_t st_ctime; + unsigned long int __unused3; + unsigned long int __unused4; + unsigned long int __unused5; + }; + +# 99 "/usr/include/bits/stat.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 89 "/usr/include/sys/stat.h" 2 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +extern int stat (__const char *__file, struct stat *__buf) ; + + + +extern int fstat (int __fd, struct stat *__buf) ; +# 195 "/usr/include/sys/stat.h" 3 + + + + + + + + + + +extern int lstat (__const char *__file, struct stat *__buf) ; + + + + + + + + + + + + + + + + +extern int chmod (__const char *__file, __mode_t __mode) ; + + + +extern int fchmod (int __fd, __mode_t __mode) ; + + + + + +extern __mode_t umask (__mode_t __mask) ; + + + + + + + + +extern int mkdir (__const char *__path, __mode_t __mode) ; + + + + + +extern int mknod (__const char *__path, + __mode_t __mode, __dev_t __dev) ; + + + + +extern int mkfifo (__const char *__path, __mode_t __mode) ; + + + + + + + + + + + + + + + + + + + + + + + + + +extern int __fxstat (int __ver, int __fildes, + struct stat *__stat_buf) ; +extern int __xstat (int __ver, __const char *__filename, + struct stat *__stat_buf) ; +extern int __lxstat (int __ver, __const char *__filename, + struct stat *__stat_buf) ; +# 299 "/usr/include/sys/stat.h" 3 + + + + + + + + + + +extern int __xmknod (int __ver, __const char *__path, + __mode_t __mode, __dev_t *__dev) ; + + + + +extern __inline__ int stat (__const char *__path, + struct stat *__statbuf) +{ + return __xstat (3 , __path, __statbuf); +} + + +extern __inline__ int lstat (__const char *__path, + struct stat *__statbuf) +{ + return __lxstat (3 , __path, __statbuf); +} + + +extern __inline__ int fstat (int __fd, struct stat *__statbuf) +{ + return __fxstat (3 , __fd, __statbuf); +} + + +extern __inline__ int mknod (__const char *__path, __mode_t __mode, + __dev_t __dev) +{ + return __xmknod (1 , __path, __mode, &__dev); +} + + +# 361 "/usr/include/sys/stat.h" 3 + + + + + + + + +# 28 "cddb.c" 2 + +# 1 "/usr/include/netinet/in.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/limits.h" 1 3 + + + + + +# 114 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/limits.h" 3 + + + + + + + +# 23 "/usr/include/netinet/in.h" 2 3 + +# 1 "/usr/include/stdint.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 190 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + +# 269 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 28 "/usr/include/stdint.h" 2 3 + +# 1 "/usr/include/bits/wordsize.h" 1 3 + + + + + + + + + + + + + + + + + + + +# 29 "/usr/include/stdint.h" 2 3 + + + + + + + +# 47 "/usr/include/stdint.h" 3 + + + +typedef unsigned char uint8_t; +typedef unsigned short int uint16_t; +typedef unsigned int uint32_t; + + + +__extension__ +typedef unsigned long long int uint64_t; + + + + + + +typedef signed char int_least8_t; +typedef short int int_least16_t; +typedef int int_least32_t; + + + +__extension__ +typedef long long int int_least64_t; + + + +typedef unsigned char uint_least8_t; +typedef unsigned short int uint_least16_t; +typedef unsigned int uint_least32_t; + + + +__extension__ +typedef unsigned long long int uint_least64_t; + + + + + + +typedef signed char int_fast8_t; + + + + + +typedef int int_fast16_t; +typedef int int_fast32_t; +__extension__ +typedef long long int int_fast64_t; + + + +typedef unsigned char uint_fast8_t; + + + + + +typedef unsigned int uint_fast16_t; +typedef unsigned int uint_fast32_t; +__extension__ +typedef unsigned long long int uint_fast64_t; + + + + + + + + + + + + +typedef int intptr_t; + + +typedef unsigned int uintptr_t; + + + + + + + + +__extension__ +typedef long long int intmax_t; +__extension__ +typedef unsigned long long int uintmax_t; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 24 "/usr/include/netinet/in.h" 2 3 + + + + + + + + + +enum + { + IPPROTO_IP = 0, + IPPROTO_HOPOPTS = 0, + IPPROTO_ICMP = 1, + IPPROTO_IGMP = 2, + IPPROTO_IPIP = 4, + IPPROTO_TCP = 6, + IPPROTO_EGP = 8, + IPPROTO_PUP = 12, + IPPROTO_UDP = 17, + IPPROTO_IDP = 22, + IPPROTO_TP = 29, + IPPROTO_IPV6 = 41, + IPPROTO_ROUTING = 43, + IPPROTO_FRAGMENT = 44, + IPPROTO_RSVP = 46, + IPPROTO_GRE = 47, + IPPROTO_ESP = 50, + IPPROTO_AH = 51, + IPPROTO_ICMPV6 = 58, + IPPROTO_NONE = 59, + IPPROTO_DSTOPTS = 60, + IPPROTO_MTP = 92, + IPPROTO_ENCAP = 98, + IPPROTO_PIM = 103, + IPPROTO_COMP = 108, + IPPROTO_RAW = 255, + IPPROTO_MAX + }; + + +enum + { + IPPORT_ECHO = 7, + IPPORT_DISCARD = 9, + IPPORT_SYSTAT = 11, + IPPORT_DAYTIME = 13, + IPPORT_NETSTAT = 15, + IPPORT_FTP = 21, + IPPORT_TELNET = 23, + IPPORT_SMTP = 25, + IPPORT_TIMESERVER = 37, + IPPORT_NAMESERVER = 42, + IPPORT_WHOIS = 43, + IPPORT_MTP = 57, + + IPPORT_TFTP = 69, + IPPORT_RJE = 77, + IPPORT_FINGER = 79, + IPPORT_TTYLINK = 87, + IPPORT_SUPDUP = 95, + + + IPPORT_EXECSERVER = 512, + IPPORT_LOGINSERVER = 513, + IPPORT_CMDSERVER = 514, + IPPORT_EFSSERVER = 520, + + + IPPORT_BIFFUDP = 512, + IPPORT_WHOSERVER = 513, + IPPORT_ROUTESERVER = 520, + + + IPPORT_RESERVED = 1024, + + + IPPORT_USERRESERVED = 5000 + }; + + + +struct in_addr + { + uint32_t s_addr; + }; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +struct in6_addr + { + union + { + uint8_t u6_addr8[16]; + uint16_t u6_addr16[8]; + uint32_t u6_addr32[4]; + + + + } in6_u; + + + + + }; + +extern const struct in6_addr in6addr_any; +extern const struct in6_addr in6addr_loopback; + + + + + + + + + + + +struct sockaddr_in + { + sa_family_t sin_family ; + uint16_t sin_port; + struct in_addr sin_addr; + + + unsigned char sin_zero[sizeof (struct sockaddr) - + (sizeof (unsigned short int)) - + sizeof (uint16_t) - + sizeof (struct in_addr)]; + }; + + +struct sockaddr_in6 + { + sa_family_t sin6_family ; + uint16_t sin6_port; + uint32_t sin6_flowinfo; + struct in6_addr sin6_addr; + }; + + +struct ipv6_mreq + { + + struct in6_addr ipv6mr_multiaddr; + + + unsigned int ipv6mr_interface; + }; + + +# 1 "/usr/include/bits/in.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +struct ip_opts + { + struct in_addr ip_dst; + char ip_opts[40]; + }; + + +struct ip_mreq + { + struct in_addr imr_multiaddr; + struct in_addr imr_interface; + }; + + +struct ip_mreqn + { + struct in_addr imr_multiaddr; + struct in_addr imr_address; + int imr_ifindex; + }; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 225 "/usr/include/netinet/in.h" 2 3 + + + + + + + + + +extern uint32_t ntohl (uint32_t __netlong) ; +extern uint16_t ntohs (uint16_t __netshort) ; +extern uint32_t htonl (uint32_t __hostlong) ; +extern uint16_t htons (uint16_t __hostshort) ; + + + + +# 1 "/usr/include/bits/byteswap.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 40 "/usr/include/bits/byteswap.h" 3 + + + + + + + + + + + + + + +# 68 "/usr/include/bits/byteswap.h" 3 + + +# 79 "/usr/include/bits/byteswap.h" 3 + + + + + + + + + + + + + + + + + +# 242 "/usr/include/netinet/in.h" 2 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) ; + + + + + + + + + + + + + + + + + + + +struct in6_pktinfo + { + struct in6_addr ipi6_addr; + unsigned int ipi6_ifindex; + }; + + + + +# 29 "cddb.c" 2 + +# 1 "/usr/include/arpa/inet.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +extern u_int32_t inet_addr (__const char *__cp) ; + + + +extern int inet_aton (__const char *__cp, struct in_addr *__inp) ; + + +extern u_int32_t inet_lnaof (struct in_addr __in) ; + + + +extern struct in_addr inet_makeaddr (u_int32_t __net, u_int32_t __host) ; + + + +extern char *inet_neta (u_int32_t __net, char *__buf, size_t __len) ; + + +extern u_int32_t inet_netof (struct in_addr __in) ; + + + +extern u_int32_t inet_network (__const char *__cp) ; + + + + +extern char *inet_net_ntop (int __af, __const void *__cp, int __bits, + char *__buf, size_t __len) ; + + + + +extern int inet_net_pton (int __af, __const char *__cp, + void *__buf, size_t __len) ; + + + +extern char *inet_ntoa (struct in_addr __in) ; + + + + +extern int inet_pton (int __af, __const char *__cp, void *__buf) ; + + + + +extern __const char *inet_ntop (int __af, __const void *__cp, + char *__buf, size_t __len) ; + + + + +extern unsigned int inet_nsap_addr (__const char *__cp, + unsigned char *__buf, int __len) ; + + + +extern char *inet_nsap_ntoa (int __len, __const unsigned char *__cp, + char *__buf) ; + + + + +# 30 "cddb.c" 2 + +# 1 "/usr/include/netdb.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/rpc/netdb.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + +# 188 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + +# 271 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 42 "/usr/include/rpc/netdb.h" 2 3 + + + + +struct rpcent +{ + char *r_name; + char **r_aliases; + int r_number; +}; + +extern void setrpcent (int _stayopen) ; +extern void endrpcent (void) ; +extern struct rpcent *getrpcbyname (__const char *__name) ; +extern struct rpcent *getrpcbynumber (int __number) ; +extern struct rpcent *getrpcent (void) ; + + +extern int getrpcbyname_r (__const char *__name, + struct rpcent *__result_buf, char *__buffer, + size_t __buflen, struct rpcent **__result) ; + +extern int getrpcbynumber_r (int __number, struct rpcent *__result_buf, + char *__buffer, size_t __buflen, + struct rpcent **__result) ; + +extern int getrpcent_r (struct rpcent *__result_buf, char *__buffer, + size_t __buflen, struct rpcent **__result) ; + + + + + +# 30 "/usr/include/netdb.h" 2 3 + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + +# 188 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + +# 271 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 33 "/usr/include/netdb.h" 2 3 + + + + + + + + + + + + + + +extern int h_errno; + + +extern int *__h_errno_location (void) __attribute__ ((__const__)); + +# 62 "/usr/include/netdb.h" 3 + + + + + + + + + + + + + + + + + + + + + + + +extern void herror (__const char *__str) ; + + +extern __const char *hstrerror (int __err_num) ; + + + + +struct hostent +{ + char *h_name; + char **h_aliases; + int h_addrtype; + int h_length; + char **h_addr_list; + +}; + + + +extern void sethostent (int __stay_open) ; + + +extern void endhostent (void) ; + + + +extern struct hostent *gethostent (void) ; + + + +extern struct hostent *gethostbyaddr (__const char *__addr, int __len, + int __type) ; + + +extern struct hostent *gethostbyname (__const char *__name) ; + + + + +extern struct hostent *gethostbyname2 (__const char *__name, int __af) ; + + + + + + + +extern int gethostent_r (struct hostent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct hostent **__restrict __result, + int *__restrict __h_errnop) ; + +extern int gethostbyaddr_r (__const char *__restrict __addr, int __len, + int __type, + struct hostent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct hostent **__restrict __result, + int *__restrict __h_errnop) ; + +extern int gethostbyname_r (__const char *__restrict __name, + struct hostent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct hostent **__restrict __result, + int *__restrict __h_errnop) ; + +extern int gethostbyname2_r (__const char *__restrict __name, int __af, + struct hostent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct hostent **__restrict __result, + int *__restrict __h_errnop) ; + + + + + + +extern struct hostent *getnodebyname (__const char *__name, int __af, + int __flags) ; + + + + + + + + + + + +struct netent +{ + char *n_name; + char **n_aliases; + int n_addrtype; + unsigned long int n_net; +}; + + + +extern void setnetent (int __stay_open) ; + + +extern void endnetent (void) ; + + + +extern struct netent *getnetent (void) ; + + + +extern struct netent *getnetbyaddr (unsigned long int __net, + int __type) ; + + +extern struct netent *getnetbyname (__const char *__name) ; + + + + + + + +extern int getnetent_r (struct netent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct netent **__restrict __result, + int *__restrict __h_errnop) ; + +extern int getnetbyaddr_r (unsigned long int __net, int __type, + struct netent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct netent **__restrict __result, + int *__restrict __h_errnop) ; + +extern int getnetbyname_r (__const char *__restrict __name, + struct netent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct netent **__restrict __result, + int *__restrict __h_errnop) ; + + + + +struct servent +{ + char *s_name; + char **s_aliases; + int s_port; + char *s_proto; +}; + + + +extern void setservent (int __stay_open) ; + + +extern void endservent (void) ; + + + +extern struct servent *getservent (void) ; + + + +extern struct servent *getservbyname (__const char *__name, + __const char *__proto) ; + + + +extern struct servent *getservbyport (int __port, __const char *__proto) ; + + + + + +extern int getservent_r (struct servent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct servent **__restrict __result) ; + +extern int getservbyname_r (__const char *__restrict __name, + __const char *__restrict __proto, + struct servent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct servent **__restrict __result) ; + +extern int getservbyport_r (int __port, __const char *__restrict __proto, + struct servent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct servent **__restrict __result) ; + + + + +struct protoent +{ + char *p_name; + char **p_aliases; + int p_proto; +}; + + + +extern void setprotoent (int __stay_open) ; + + +extern void endprotoent (void) ; + + + +extern struct protoent *getprotoent (void) ; + + +extern struct protoent *getprotobyname (__const char *__name) ; + + +extern struct protoent *getprotobynumber (int __proto) ; + + + + + +extern int getprotoent_r (struct protoent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct protoent **__restrict __result) ; + +extern int getprotobyname_r (__const char *__restrict __name, + struct protoent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct protoent **__restrict __result) ; + +extern int getprotobynumber_r (int __proto, + struct protoent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct protoent **__restrict __result) ; + + + + +extern int setnetgrent (__const char *__netgroup) ; + + +extern void endnetgrent (void) ; + + + +extern int getnetgrent (char **__restrict __hostp, + char **__restrict __userp, + char **__restrict __domainp) ; + + +extern int innetgr (__const char *__netgroup, __const char *__host, + __const char *__user, __const char *domain) ; + + + +extern int getnetgrent_r (char **__restrict __hostp, + char **__restrict __userp, + char **__restrict __domainp, + char *__restrict __buffer, size_t __buflen) ; + + + + + + + + + + +extern int rcmd (char **__restrict __ahost, unsigned short int __rport, + __const char *__restrict __locuser, + __const char *__restrict __remuser, + __const char *__restrict __cmd, int *__restrict __fd2p) ; + + + + + + +extern int rexec (char **__restrict __ahost, int __rport, + __const char *__restrict __name, + __const char *__restrict __pass, + __const char *__restrict __cmd, + int *__restrict __fd2p) ; + + + + +extern int ruserok (__const char *__rhost, int __suser, + __const char *__remuser, __const char *__locuser) ; + + + + +extern int rresvport (int *__alport) ; + + + + + + +struct addrinfo +{ + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + int ai_addrlen; + struct sockaddr *ai_addr; + char *ai_canonname; + struct addrinfo *ai_next; +}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +extern int getaddrinfo (__const char *__restrict __name, + __const char *__restrict __service, + __const struct addrinfo *__restrict __req, + struct addrinfo **__restrict __pai) ; + + +extern void freeaddrinfo (struct addrinfo *__ai) ; + + +extern char *gai_strerror (int __ecode) ; + + +extern int getnameinfo (__const struct sockaddr *__restrict __sa, + socklen_t __salen, + char *__restrict __host, size_t __hostlen, + char *__restrict __serv, size_t __servlen, + int __flags) ; + + + + + + +# 31 "cddb.c" 2 + + +# 1 "/usr/include/pwd.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + +# 188 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + +# 271 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 33 "/usr/include/pwd.h" 2 3 + + +# 47 "/usr/include/pwd.h" 3 + + + +struct passwd +{ + char *pw_name; + char *pw_passwd; + __uid_t pw_uid; + __gid_t pw_gid; + char *pw_gecos; + char *pw_dir; + char *pw_shell; +}; + + + + + + + + + + +extern void setpwent (void) ; + + +extern void endpwent (void) ; + + +extern struct passwd *getpwent (void) ; + + + + +extern struct passwd *fgetpwent (FILE *__stream) ; + + +extern int putpwent (__const struct passwd *__restrict __p, + FILE *__restrict __f) ; + + + +extern struct passwd *getpwuid (__uid_t __uid) ; + + +extern struct passwd *getpwnam (__const char *__name) ; + + + + + + + + + + + + + + + + + + +extern int getpwent_r (struct passwd *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct passwd **__restrict __result) ; + + +extern int getpwuid_r (__uid_t __uid, + struct passwd *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct passwd **__restrict __result) ; + +extern int getpwnam_r (__const char *__restrict __name, + struct passwd *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct passwd **__restrict __result) ; + + + + + +extern int fgetpwent_r (FILE *__restrict __stream, + struct passwd *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct passwd **__restrict __result) ; + + + + + + + + + + + + + + +# 33 "cddb.c" 2 + +# 1 "/usr/include/errno.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/bits/errno.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/linux/errno.h" 1 3 + + + +# 1 "/usr/include/asm/errno.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 4 "/usr/include/linux/errno.h" 2 3 + + +# 14 "/usr/include/linux/errno.h" 3 + + + +# 25 "/usr/include/bits/errno.h" 2 3 + + + + + + + + + + + +extern int errno; + + +extern int *__errno_location (void) __attribute__ ((__const__)); + + + + + + + + + + + + + + + + + + + + + +# 36 "/usr/include/errno.h" 2 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 34 "cddb.c" 2 + +# 1 "/usr/include/unistd.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/bits/posix_opt.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 175 "/usr/include/unistd.h" 2 3 + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + +# 188 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + +# 271 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 199 "/usr/include/unistd.h" 2 3 + + +# 231 "/usr/include/unistd.h" 3 + + + + + + + + + + + + + + + + + +extern int access (__const char *__name, int __type) ; + + + + + + + + + + + + + + + + + + + + + + + + + + + + +extern __off_t __lseek (int __fd, __off_t __offset, int __whence) ; + +extern __off_t lseek (int __fd, __off_t __offset, int __whence) ; +# 289 "/usr/include/unistd.h" 3 + + + + + + +extern int __close (int __fd) ; +extern int close (int __fd) ; + + + +extern ssize_t __read (int __fd, void * __buf, size_t __nbytes) ; +extern ssize_t read (int __fd, void * __buf, size_t __nbytes) ; + + +extern ssize_t __write (int __fd, __const void * __buf, size_t __n) ; +extern ssize_t write (int __fd, __const void * __buf, size_t __n) ; + +# 343 "/usr/include/unistd.h" 3 + + + + + + +extern int pipe (int __pipedes[2]) ; + + + + + + + + +extern unsigned int alarm (unsigned int __seconds) ; + + + + + + + + +extern unsigned int sleep (unsigned int __seconds) ; + + + + + + +extern unsigned int ualarm (unsigned int __value, + unsigned int __interval) ; + + + +extern void usleep (unsigned int __useconds) ; + + + + + +extern int pause (void) ; + + + +extern int chown (__const char *__file, __uid_t __owner, + __gid_t __group) ; + + + +extern int fchown (int __fd, __uid_t __owner, __gid_t __group) ; + + + + +extern int lchown (__const char *__file, __uid_t __owner, + __gid_t __group) ; + + + + +extern int chdir (__const char *__path) ; + + + +extern int fchdir (int __fd) ; + + + + + + + + + +extern char *getcwd (char *__buf, size_t __size) ; + + + + + + + + + + + + +extern char *getwd (char *__buf) ; + + + + +extern int dup (int __fd) ; + + +extern int dup2 (int __fd, int __fd2) ; + + +extern char **__environ; + + + + + + + +extern int execve (__const char *__path, char *__const __argv[], + char *__const __envp[]) ; + + + + + + + + + + + +extern int execv (__const char *__path, char *__const __argv[]) ; + + + +extern int execle (__const char *__path, __const char *__arg, ...) ; + + + +extern int execl (__const char *__path, __const char *__arg, ...) ; + + + +extern int execvp (__const char *__file, char *__const __argv[]) ; + + + + +extern int execlp (__const char *__file, __const char *__arg, ...) ; + + + + +extern int nice (int __inc) ; + + + + +extern void _exit (int __status) __attribute__ ((__noreturn__)); + + + + + +# 1 "/usr/include/bits/confname.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + +enum + { + _PC_LINK_MAX, + + _PC_MAX_CANON, + + _PC_MAX_INPUT, + + _PC_NAME_MAX, + + _PC_PATH_MAX, + + _PC_PIPE_BUF, + + _PC_CHOWN_RESTRICTED, + + _PC_NO_TRUNC, + + _PC_VDISABLE, + + _PC_SYNC_IO, + + _PC_ASYNC_IO, + + _PC_PRIO_IO, + + _PC_SOCK_MAXBUF, + + _PC_FILESIZEBITS + + }; + + +enum + { + _SC_ARG_MAX, + + _SC_CHILD_MAX, + + _SC_CLK_TCK, + + _SC_NGROUPS_MAX, + + _SC_OPEN_MAX, + + _SC_STREAM_MAX, + + _SC_TZNAME_MAX, + + _SC_JOB_CONTROL, + + _SC_SAVED_IDS, + + _SC_REALTIME_SIGNALS, + + _SC_PRIORITY_SCHEDULING, + + _SC_TIMERS, + + _SC_ASYNCHRONOUS_IO, + + _SC_PRIORITIZED_IO, + + _SC_SYNCHRONIZED_IO, + + _SC_FSYNC, + + _SC_MAPPED_FILES, + + _SC_MEMLOCK, + + _SC_MEMLOCK_RANGE, + + _SC_MEMORY_PROTECTION, + + _SC_MESSAGE_PASSING, + + _SC_SEMAPHORES, + + _SC_SHARED_MEMORY_OBJECTS, + + _SC_AIO_LISTIO_MAX, + + _SC_AIO_MAX, + + _SC_AIO_PRIO_DELTA_MAX, + + _SC_DELAYTIMER_MAX, + + _SC_MQ_OPEN_MAX, + + _SC_MQ_PRIO_MAX, + + _SC_VERSION, + + _SC_PAGESIZE, + + + _SC_RTSIG_MAX, + + _SC_SEM_NSEMS_MAX, + + _SC_SEM_VALUE_MAX, + + _SC_SIGQUEUE_MAX, + + _SC_TIMER_MAX, + + + + + _SC_BC_BASE_MAX, + + _SC_BC_DIM_MAX, + + _SC_BC_SCALE_MAX, + + _SC_BC_STRING_MAX, + + _SC_COLL_WEIGHTS_MAX, + + _SC_EQUIV_CLASS_MAX, + + _SC_EXPR_NEST_MAX, + + _SC_LINE_MAX, + + _SC_RE_DUP_MAX, + + _SC_CHARCLASS_NAME_MAX, + + + _SC_2_VERSION, + + _SC_2_C_BIND, + + _SC_2_C_DEV, + + _SC_2_FORT_DEV, + + _SC_2_FORT_RUN, + + _SC_2_SW_DEV, + + _SC_2_LOCALEDEF, + + + _SC_PII, + + _SC_PII_XTI, + + _SC_PII_SOCKET, + + _SC_PII_INTERNET, + + _SC_PII_OSI, + + _SC_POLL, + + _SC_SELECT, + + _SC_UIO_MAXIOV, + + _SC_PII_INTERNET_STREAM, + + _SC_PII_INTERNET_DGRAM, + + _SC_PII_OSI_COTS, + + _SC_PII_OSI_CLTS, + + _SC_PII_OSI_M, + + _SC_T_IOV_MAX, + + + + _SC_THREADS, + + _SC_THREAD_SAFE_FUNCTIONS, + + _SC_GETGR_R_SIZE_MAX, + + _SC_GETPW_R_SIZE_MAX, + + _SC_LOGIN_NAME_MAX, + + _SC_TTY_NAME_MAX, + + _SC_THREAD_DESTRUCTOR_ITERATIONS, + + _SC_THREAD_KEYS_MAX, + + _SC_THREAD_STACK_MIN, + + _SC_THREAD_THREADS_MAX, + + _SC_THREAD_ATTR_STACKADDR, + + _SC_THREAD_ATTR_STACKSIZE, + + _SC_THREAD_PRIORITY_SCHEDULING, + + _SC_THREAD_PRIO_INHERIT, + + _SC_THREAD_PRIO_PROTECT, + + _SC_THREAD_PROCESS_SHARED, + + + _SC_NPROCESSORS_CONF, + + _SC_NPROCESSORS_ONLN, + + _SC_PHYS_PAGES, + + _SC_AVPHYS_PAGES, + + _SC_ATEXIT_MAX, + + _SC_PASS_MAX, + + + _SC_XOPEN_VERSION, + + _SC_XOPEN_XCU_VERSION, + + _SC_XOPEN_UNIX, + + _SC_XOPEN_CRYPT, + + _SC_XOPEN_ENH_I18N, + + _SC_XOPEN_SHM, + + + _SC_2_CHAR_TERM, + + _SC_2_C_VERSION, + + _SC_2_UPE, + + + _SC_XOPEN_XPG2, + + _SC_XOPEN_XPG3, + + _SC_XOPEN_XPG4, + + + _SC_CHAR_BIT, + + _SC_CHAR_MAX, + + _SC_CHAR_MIN, + + _SC_INT_MAX, + + _SC_INT_MIN, + + _SC_LONG_BIT, + + _SC_WORD_BIT, + + _SC_MB_LEN_MAX, + + _SC_NZERO, + + _SC_SSIZE_MAX, + + _SC_SCHAR_MAX, + + _SC_SCHAR_MIN, + + _SC_SHRT_MAX, + + _SC_SHRT_MIN, + + _SC_UCHAR_MAX, + + _SC_UINT_MAX, + + _SC_ULONG_MAX, + + _SC_USHRT_MAX, + + + _SC_NL_ARGMAX, + + _SC_NL_LANGMAX, + + _SC_NL_MSGMAX, + + _SC_NL_NMAX, + + _SC_NL_SETMAX, + + _SC_NL_TEXTMAX, + + + _SC_XBS5_ILP32_OFF32, + + _SC_XBS5_ILP32_OFFBIG, + + _SC_XBS5_LP64_OFF64, + + _SC_XBS5_LPBIG_OFFBIG, + + + _SC_XOPEN_LEGACY, + + _SC_XOPEN_REALTIME, + + _SC_XOPEN_REALTIME_THREADS + + }; + + + + + +enum + { + _CS_PATH + + +# 370 "/usr/include/bits/confname.h" 3 + + +# 406 "/usr/include/bits/confname.h" 3 + + }; + +# 497 "/usr/include/unistd.h" 2 3 + + + +extern long int pathconf (__const char *__path, int __name) ; + + +extern long int fpathconf (int __fd, int __name) ; + + +extern long int sysconf (int __name) ; + + + +extern size_t confstr (int __name, char *__buf, size_t __len) ; + + + + +extern __pid_t __getpid (void) ; +extern __pid_t getpid (void) ; + + +extern __pid_t getppid (void) ; + + + + +extern __pid_t getpgrp (void) ; + + + + + + + + + +extern __pid_t __getpgid (__pid_t __pid) ; + + + + + + + + +extern int __setpgid (__pid_t __pid, __pid_t __pgid) ; +extern int setpgid (__pid_t __pid, __pid_t __pgid) ; + + + + + + + + + + + + + + + + +extern int setpgrp (void) ; + +# 573 "/usr/include/unistd.h" 3 + + + + + + +extern __pid_t setsid (void) ; + + + + + + + +extern __uid_t getuid (void) ; + + +extern __uid_t geteuid (void) ; + + +extern __gid_t getgid (void) ; + + +extern __gid_t getegid (void) ; + + + + +extern int getgroups (int __size, __gid_t __list[]) ; + + + + + + + + + + +extern int setuid (__uid_t __uid) ; + + + + +extern int setreuid (__uid_t __ruid, __uid_t __euid) ; + + + + +extern int seteuid (__uid_t __uid) ; + + + + + + +extern int setgid (__gid_t __gid) ; + + + + +extern int setregid (__gid_t __rgid, __gid_t __egid) ; + + + + +extern int setegid (__gid_t __gid) ; + + + + + + +extern __pid_t __fork (void) ; +extern __pid_t fork (void) ; + + + + + + +extern __pid_t vfork (void) ; + + + + + +extern char *ttyname (int __fd) ; + + + +extern int ttyname_r (int __fd, char *__buf, size_t __buflen) ; + + + +extern int isatty (int __fd) ; + + + + +extern int ttyslot (void) ; + + + + +extern int link (__const char *__from, __const char *__to) ; + + + +extern int symlink (__const char *__from, __const char *__to) ; + + + + +extern int readlink (__const char *__path, char *__buf, size_t __len) ; + + + +extern int unlink (__const char *__name) ; + + +extern int rmdir (__const char *__path) ; + + + +extern __pid_t tcgetpgrp (int __fd) ; + + +extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) ; + + + +extern char *getlogin (void) ; + + + + + + + + + +extern int setlogin (__const char *__name) ; + + + + + + + + +# 1 "/usr/include/getopt.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +extern char *optarg; + + + + + + + + + + + + + +extern int optind; + + + + +extern int opterr; + + + +extern int optopt; + +# 102 "/usr/include/getopt.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +extern int getopt (int __argc, char *const *__argv, const char *__shortopts); + + + + +# 151 "/usr/include/getopt.h" 3 + +# 160 "/usr/include/getopt.h" 3 + + + + + + + + + + +# 724 "/usr/include/unistd.h" 2 3 + + + + + + + + + +extern int gethostname (char *__name, size_t __len) ; + + + +extern int sethostname (__const char *__name, size_t __len) ; + + + +extern int sethostid (long int __id) ; + + + + + +extern int getdomainname (char *__name, size_t __len) ; +extern int setdomainname (__const char *__name, size_t __len) ; + + + +extern int fsync (int __fd) ; + + + + + +extern int vhangup (void) ; + + +extern int revoke (__const char *__file) ; + + + + + + + +extern int profil (unsigned short int *__sample_buffer, size_t __size, + size_t __offset, unsigned int __scale) ; + + + + + +extern int acct (__const char *__name) ; + + + +extern int chroot (__const char *__path) ; + + + +extern char *getusershell (void) ; +extern void endusershell (void) ; +extern void setusershell (void) ; + + + + +extern char *getpass (__const char *__prompt) ; + + + + +extern int daemon (int __nochdir, int __noclose) ; + + + + + + + +extern long int gethostid (void) ; + + +extern int sync (void) ; + + + + +extern int __getpagesize (void) ; +extern int getpagesize (void) ; + + + + +extern int truncate (__const char *__file, __off_t __length) ; +# 827 "/usr/include/unistd.h" 3 + + + + + + +extern int __ftruncate (int __fd, __off_t __length) ; + +extern int ftruncate (int __fd, __off_t __length) ; + + + + + + + + + + + + + + + +extern int getdtablesize (void) ; + + + + + + + + +extern int brk (void * __addr) ; + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +typedef int ptrdiff_t; + + + + + + + + + + + + + + + + + + +# 190 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + +# 271 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 863 "/usr/include/unistd.h" 2 3 + + + + + + +extern void * __sbrk (ptrdiff_t __delta) ; +extern void * sbrk (ptrdiff_t __delta) ; + + + + + + + + + + + + + + +extern long int syscall (long int __sysno, ...) ; + + + + + + + + + + + + + + + + + + + +extern int lockf (int __fd, int __cmd, __off_t __len) ; + + + + + + + + + + + + + + +# 940 "/usr/include/unistd.h" 3 + + + + + +extern int fdatasync (int __fildes) ; + + + + + +# 968 "/usr/include/unistd.h" 3 + + + + + +# 983 "/usr/include/unistd.h" 3 + + + + + + + + + + + + + + + + +extern int pthread_atfork (void (*__prepare) (void), + void (*__parent) (void), + void (*__child) (void)) ; + + + + + +# 35 "cddb.c" 2 + +# 1 "/usr/include/time.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 1 3 + + + + + + + + + +# 19 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 61 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 131 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + +# 188 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + +# 271 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + +# 283 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + +# 317 "/usr/lib/gcc-lib/i386-linux/2.95.2/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 38 "/usr/include/time.h" 2 3 + + + + +# 1 "/usr/include/bits/time.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 59 "/usr/include/bits/time.h" 3 + +# 42 "/usr/include/time.h" 2 3 + + + + + + + + + + + + + + + + + + +typedef __clock_t clock_t; + + + + +# 73 "/usr/include/time.h" 3 + + + + +# 89 "/usr/include/time.h" 3 + + + + + + +struct tm +{ + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; + + + long int tm_gmtoff; + __const char *tm_zone; + + + + +}; + + + + +extern clock_t clock (void) ; + + +extern time_t time (time_t *__timer) ; + + +extern double difftime (time_t __time1, time_t __time0) + __attribute__ ((__const__)); + + +extern time_t mktime (struct tm *__tp) ; + + + + + +extern size_t strftime (char *__restrict __s, size_t __maxsize, + __const char *__restrict __format, + __const struct tm *__restrict __tp) ; + + + + + + + + + + + +extern struct tm *gmtime (__const time_t *__timer) ; + + + +extern struct tm *localtime (__const time_t *__timer) ; + + + + +extern struct tm *__gmtime_r (__const time_t *__restrict __timer, + struct tm *__restrict __tp) ; +extern struct tm *gmtime_r (__const time_t *__restrict __timer, + struct tm *__restrict __tp) ; + + + +extern struct tm *localtime_r (__const time_t *__restrict __timer, + struct tm *__restrict __tp) ; + + + + +extern char *asctime (__const struct tm *__tp) ; + + +extern char *ctime (__const time_t *__timer) ; + + + + + + +extern char *asctime_r (__const struct tm *__restrict __tp, + char *__restrict __buf) ; + + +extern char *ctime_r (__const time_t *__restrict __timer, + char *__restrict __buf) ; + + + + +extern char *__tzname[2]; +extern int __daylight; +extern long int __timezone; + + + + +extern char *tzname[2]; + + + +extern void tzset (void) ; + + + +extern int daylight; +extern long int timezone; + + + + + +extern int stime (__const time_t *__when) ; + + + + + + + + + + + + + + +extern time_t timegm (struct tm *__tp) ; + + +extern time_t timelocal (struct tm *__tp) ; + + +extern int dysize (int __year) ; + + + + + +extern int nanosleep (__const struct timespec *__requested_time, + struct timespec *__remaining) ; + + + +# 264 "/usr/include/time.h" 3 + + +# 274 "/usr/include/time.h" 3 + + + + + + + + +# 36 "cddb.c" 2 + + + + + + + + +# 1 "cdaudio.h" 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +struct cddb_entry { + int entry_present; + long entry_timestamp; + unsigned long entry_id; + char entry_cdindex_id[30 ]; + int entry_genre; +}; + + +struct cddb_conf { + int conf_access; + int conf_proxy; +}; + + +struct cddb_server { + char server_name[256]; + int server_port; +}; + + +struct cddb_host { + struct cddb_server host_server; + char host_addressing[256]; + int host_protocol; +}; + + +struct cddb_hello { + char hello_program[256]; + char hello_version[256]; +}; + + +struct query_list_entry { + int list_genre; + int list_id; + char list_title[64]; + char list_artist[64]; +}; + + +struct cddb_query { + + + + int query_match; + int query_matches; + struct query_list_entry query_list[16 ]; +}; + + +struct disc_timeval { + int minutes; + int seconds; + int frames; +}; + + +struct disc_status { + int status_present; + int status_mode; + struct disc_timeval status_disc_time; +}; + + +struct track_info { + struct disc_timeval track_length; + struct disc_timeval track_pos; + int track_lba; + int track_type; +}; + + +struct disc_info { + int disc_present; + int disc_mode; + struct disc_timeval disc_track_time; + struct disc_timeval disc_time; + struct disc_timeval disc_length; + int disc_current_track; + int disc_first_track; + int disc_total_tracks; + struct track_info disc_track[100 ]; +}; + + +struct __volume { + int left; + int right; +}; + + +struct disc_volume { + struct __volume vol_front; + struct __volume vol_back; +}; + +struct art_query_entry { + char list_album[64]; + char list_artist[64]; + struct cddb_host list_host; +}; + + +struct art_query { + int query_match; + int query_matches; + struct art_query_entry query_list[16 ]; +}; + + +struct art_data { + int art_present; + int art_length; + char art_mime_type[16]; + char art_data[32768 ]; +}; + + +struct track_data { + char track_name[256]; + char track_artist[256]; + char track_extended[4096 ]; +}; + + +struct disc_data { + unsigned long data_id; + char data_cdindex_id[30 ]; + int data_revision; + char data_title[256]; + char data_artist[256]; + char data_extended[4096 ]; + int data_genre; + int data_artist_type; + struct track_data data_track[100 ]; +}; + + +struct disc_summary { + int disc_present; + struct disc_timeval disc_length; + int disc_total_tracks; + unsigned long disc_id; + char data_cdindex_id[30 ]; + char disc_info[128]; + struct art_data data_art; +}; + + +struct disc_changer { + int changer_slots; + struct disc_summary changer_disc[100 ]; +}; + + +struct cddb_serverlist { + int list_len; + struct cddb_host list_host[128 ]; +}; + + +void cd_version(char *buffer, int len); +int cd_frames_to_lba(int frames); +int cd_lba_to_frames(int lba); +int cd_msf_to_frames(struct disc_timeval time); +int cd_msf_to_lba(struct disc_timeval time); +void cd_frames_to_msf(struct disc_timeval *time, int frames); +void cd_lba_to_msf(struct disc_timeval *time, int frames); +int cd_init_device(char *device_name); +int cd_finish(int cd_desc); +int cd_stat(int cd_desc, struct disc_info *disc); +int cd_poll(int cd_desc, struct disc_status *status); +int cd_update(struct disc_info *disc, struct disc_status status); +int cd_play_frames(int cd_desc, int startframe, int endframe); +int cd_playctl(int cd_desc, int options, int start_track, ...); +int cd_play_track_pos(int cd_desc, int starttrack, int endtrack, int startpos); +int cd_play_track(int cd_desc, int starttrack, int endtrack); +int cd_play_pos(int cd_desc, int track, int startpos); +int cd_play(int cd_desc, int track); +int cd_track_advance(int cd_desc, int endtrack, struct disc_timeval time); +int cd_advance(int cd_desc, struct disc_timeval time); +int cd_stop(int cd_desc); +int cd_pause(int cd_desc); +int cd_resume(int cd_desc); +int cd_eject(int cd_desc); +int cd_close(int cd_desc); +int cd_set_volume(int cd_desc, struct disc_volume vol); +int cd_get_volume(int cd_desc, struct disc_volume *vol); +unsigned long cddb_discid(int cd_desc); +int cddb_process_url(struct cddb_host *host, const char *url); +int cddb_read_serverlist(struct cddb_conf *conf, struct cddb_serverlist *list, struct cddb_server *proxy); +int cddb_write_serverlist(struct cddb_conf conf, struct cddb_serverlist list, struct cddb_server proxy); +char *cddb_genre(int genre); +int cddb_connect(struct cddb_server *server); +int cddb_connect_server(struct cddb_host host, struct cddb_server *proxy, struct cddb_hello hello, ...); +int cddb_skip_http_header(int sock); +int cddb_read_token(int sock, int token[3]); +int cddb_query(int cd_desc, int sock, int mode, struct cddb_query *query, ...); +int cddb_read(int cd_desc, int sock, int mode, struct cddb_entry entry, struct disc_data *data, ...); +int cddb_quit(int sock); +int cddb_sites(int sock, int mode, struct cddb_serverlist *list, ...); +int cddb_read_data(int desc, struct disc_data *data); +int cddb_generate_unknown_entry(int cd_desc, struct disc_data *data); +int cddb_read_disc_data(int cd_desc, struct disc_data *data); +int cddb_write_disc_data(int cd_desc, struct disc_data data); +int cddb_erase_entry(struct disc_data data); +int cddb_stat_disc_data(int cd_desc, struct cddb_entry *entry); +int cddb_http_query(int cd_desc, struct cddb_host host, struct cddb_hello hello, struct cddb_query *query); +int cddb_http_proxy_query(int cd_desc, struct cddb_host host, struct cddb_server proxy, struct cddb_hello hello, struct cddb_query *query); +int cddb_http_read(int cd_desc, struct cddb_host host, struct cddb_hello hello, struct cddb_entry entry, struct disc_data *data); +int cddb_http_proxy_read(int cd_desc, struct cddb_host host, struct cddb_server proxy, struct cddb_hello hello, struct cddb_entry entry, struct disc_data *data); +int cddb_http_sites(int cd_desc, struct cddb_host host, struct cddb_hello hello, struct cddb_serverlist *list); +int cddb_http_proxy_sites(int cd_desc, struct cddb_host host, struct cddb_server proxy, struct cddb_hello hello, struct cddb_serverlist *list); +int cddb_http_submit(int cd_desc, struct cddb_host host, struct cddb_server *proxy, char *email_address); +int cdindex_discid(int cd_desc, char *discid, int len); +int cdindex_connect_server(struct cddb_host host, struct cddb_server *proxy, char *http_string, int len); +int cdindex_read(int cd_desc, int sock, struct disc_data *data, char *http_string); +int cdindex_write_disc_data(int cd_desc, struct disc_data data); +int coverart_connect_server(struct cddb_host host, struct cddb_server *proxy, char *http_string, int len); +int coverart_query(int cd_desc, int sock, struct art_query *query, char *http_string); +int coverart_name_query(int sock, struct art_query *query, char *http_string, char *album, char *artist); +int coverart_read(struct art_data *art, struct cddb_server *proxy, struct cddb_host host); +int coverart_read_data(int cd_desc, struct art_data *art); +int coverart_write_data(int cd_desc, struct art_data art); +int cd_changer_select_disc(int cd_desc, int disc); +int cd_changer_slots(int cd_desc); +int cd_changer_stat(int cd_desc, struct disc_changer *changer); + + +# 44 "cddb.c" 2 + +# 1 "cddb.h" 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +struct __unprocessed_track_data { + int track_name_index; + char track_name[6 ][80]; + int track_extended_index; + char track_extended[64 ][80]; +}; + +struct __unprocessed_disc_data { + unsigned long data_id; + char data_cdindex_id[30 ]; + int data_revision; + int data_title_index; + char data_title[6 ][80]; + int data_extended_index; + char data_extended[64 ][80]; + int data_genre; + struct art_data data_art; + struct __unprocessed_track_data data_track[100 ]; +}; + +int data_format_input(struct disc_data *outdata, struct __unprocessed_disc_data indata, int tracks); +int data_format_output(struct __unprocessed_disc_data *outdata, struct disc_data indata, int tracks); +unsigned long __internal_cddb_discid(struct disc_info disc); + + +# 45 "cddb.c" 2 + + + +static int cddb_sum(long val); +static int cddb_serverlist_process_line(char *line, struct cddb_conf *conf, struct cddb_serverlist *list, struct cddb_server *proxy); +static int cddb_process_line(char *line, struct __unprocessed_disc_data *data); +static int cddb_sites_process_line(char *line, struct cddb_host *host); + + +char cddb_message[256]; +int parse_disc_artist = 1; +int cddb_submit_method = 1 ; +char *cddb_submit_email_address = "freedb-submit@freedb.org" ; + + +static int + +cddb_sum(long val) + + + + +{ + char *bufptr, buf[16]; + int ret = 0; + + snprintf(buf, 16, "%lu", val); + for(bufptr = buf; *bufptr != '\0'; bufptr++) + ret += (*bufptr - '0'); + + return ret; +} + + +unsigned long + +__internal_cddb_discid(struct disc_info disc) + + + + +{ + int index, tracksum = 0, discid; + + for(index = 0; index < disc.disc_total_tracks; index++) + tracksum += cddb_sum(disc.disc_track[index].track_pos.minutes * 60 + disc.disc_track[index].track_pos.seconds); + + discid = (disc.disc_length.minutes * 60 + disc.disc_length.seconds) - (disc.disc_track[0].track_pos.minutes * 60 + disc.disc_track[0].track_pos.seconds); + + return ((tracksum % 0xFF) << 24 | discid << 8 | disc.disc_total_tracks) & 0xFFFFFFFF; +} + +unsigned long + +cddb_discid(int cd_desc) + + + + +{ + struct disc_info disc; + + if(cd_stat(cd_desc, &disc) < 0) + return -1; + + if(!disc.disc_present) + return -1; + + return __internal_cddb_discid(disc); +} + + +int + +cddb_process_url(struct cddb_host *host, const char *url) + + + + + +{ + int index = 0; + char urltmp[512]; + char hostbuffer[256]; + char portbuffer[256], *portptr; + + if((__extension__ (__builtin_constant_p ( ':' ) && ( ':' ) == '\0' ? (char *) __rawmemchr ( url , ':' ) : strchr ( url , ':' ))) == ((void *)0) ) { + (__extension__ (__builtin_constant_p ( "Invalid URL" ) && __builtin_constant_p ( 256 ) ? (strlen ( "Invalid URL" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , "Invalid URL" , 256 ) : strncpy ( cddb_message , "Invalid URL" , 256 )) : strncpy ( cddb_message , "Invalid URL" , 256 ))) ; + return -1; + } + (__extension__ (__builtin_constant_p ( url ) && __builtin_constant_p ( 512 ) ? (strlen ( url ) + 1 >= ((size_t) ( 512 )) ? (char *) memcpy ( urltmp , url , 512 ) : strncpy ( urltmp , url , 512 )) : strncpy ( urltmp , url , 512 ))) ; + strtok(urltmp, ":"); + if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( urltmp ) && __builtin_constant_p ( "cddbp" ) && (__s1_len = strlen ( urltmp ), __s2_len = strlen ( "cddbp" ), (! ((size_t)(const void *)(( urltmp ) + 1) - (size_t)(const void *)( urltmp ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "cddbp" ) + 1) - (size_t)(const void *)( "cddbp" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( urltmp ), (__const char *) ( "cddbp" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( urltmp ) && ((size_t)(const void *)(( urltmp ) + 1) - (size_t)(const void *)( urltmp ) == 1) && (__s1_len = strlen ( urltmp ), __s1_len < 4) ? (__builtin_constant_p ( "cddbp" ) && ((size_t)(const void *)(( "cddbp" ) + 1) - (size_t)(const void *)( "cddbp" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( urltmp ))[0] - ((__const unsigned char *) (__const char *)( "cddbp" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( urltmp ))[1] - ((__const unsigned char *) (__const char *) ( "cddbp" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( urltmp ))[2] - ((__const unsigned char *) (__const char *) ( "cddbp" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( urltmp ))[3] - ((__const unsigned char *) (__const char *) ( "cddbp" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "cddbp" ); register int __result = (((__const unsigned char *) (__const char *) ( urltmp ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( urltmp ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( urltmp ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( urltmp ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "cddbp" ) && ((size_t)(const void *)(( "cddbp" ) + 1) - (size_t)(const void *)( "cddbp" ) == 1) && (__s2_len = strlen ( "cddbp" ), __s2_len < 4) ? (__builtin_constant_p ( urltmp ) && ((size_t)(const void *)(( urltmp ) + 1) - (size_t)(const void *)( urltmp ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( urltmp ))[0] - ((__const unsigned char *) (__const char *)( "cddbp" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( urltmp ))[1] - ((__const unsigned char *) (__const char *) ( "cddbp" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( urltmp ))[2] - ((__const unsigned char *) (__const char *) ( "cddbp" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( urltmp ))[3] - ((__const unsigned char *) (__const char *) ( "cddbp" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( urltmp ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "cddbp" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "cddbp" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "cddbp" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "cddbp" ))[3]); } } __result; })) ) : strcmp ( urltmp , "cddbp" )))); }) == 0) + host->host_protocol = 0 ; + else if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( urltmp ) && __builtin_constant_p ( "http" ) && (__s1_len = strlen ( urltmp ), __s2_len = strlen ( "http" ), (! ((size_t)(const void *)(( urltmp ) + 1) - (size_t)(const void *)( urltmp ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "http" ) + 1) - (size_t)(const void *)( "http" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( urltmp ), (__const char *) ( "http" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( urltmp ) && ((size_t)(const void *)(( urltmp ) + 1) - (size_t)(const void *)( urltmp ) == 1) && (__s1_len = strlen ( urltmp ), __s1_len < 4) ? (__builtin_constant_p ( "http" ) && ((size_t)(const void *)(( "http" ) + 1) - (size_t)(const void *)( "http" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( urltmp ))[0] - ((__const unsigned char *) (__const char *)( "http" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( urltmp ))[1] - ((__const unsigned char *) (__const char *) ( "http" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( urltmp ))[2] - ((__const unsigned char *) (__const char *) ( "http" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( urltmp ))[3] - ((__const unsigned char *) (__const char *) ( "http" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "http" ); register int __result = (((__const unsigned char *) (__const char *) ( urltmp ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( urltmp ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( urltmp ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( urltmp ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "http" ) && ((size_t)(const void *)(( "http" ) + 1) - (size_t)(const void *)( "http" ) == 1) && (__s2_len = strlen ( "http" ), __s2_len < 4) ? (__builtin_constant_p ( urltmp ) && ((size_t)(const void *)(( urltmp ) + 1) - (size_t)(const void *)( urltmp ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( urltmp ))[0] - ((__const unsigned char *) (__const char *)( "http" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( urltmp ))[1] - ((__const unsigned char *) (__const char *) ( "http" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( urltmp ))[2] - ((__const unsigned char *) (__const char *) ( "http" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( urltmp ))[3] - ((__const unsigned char *) (__const char *) ( "http" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( urltmp ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "http" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "http" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "http" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "http" ))[3]); } } __result; })) ) : strcmp ( urltmp , "http" )))); }) == 0) + host->host_protocol = 1 ; + else { + snprintf(cddb_message, 256, "%s: invalid protocol", urltmp); + return -1; + } + + (__extension__ (__builtin_constant_p ( (char *)(strtok(((void *)0) , ":") + 2) ) && __builtin_constant_p ( 256 ) ? (strlen ( (char *)(strtok(((void *)0) , ":") + 2) ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( hostbuffer , (char *)(strtok(((void *)0) , ":") + 2) , 256 ) : strncpy ( hostbuffer , (char *)(strtok(((void *)0) , ":") + 2) , 256 )) : strncpy ( hostbuffer , (char *)(strtok(((void *)0) , ":") + 2) , 256 ))) ; + if((portptr = strtok(((void *)0) , ":")) != ((void *)0) ) { + (__extension__ (__builtin_constant_p ( hostbuffer ) && __builtin_constant_p ( 256 ) ? (strlen ( hostbuffer ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( host->host_server.server_name , hostbuffer , 256 ) : strncpy ( host->host_server.server_name , hostbuffer , 256 )) : strncpy ( host->host_server.server_name , hostbuffer , 256 ))) ; + index = 0; + do { + portbuffer[index++] = portptr[0]; + portptr++; + } while(portptr[0] != '/' && portptr[0] != '\n' && portptr[0] != '\0'); + portbuffer[index] = '\0'; + host->host_server.server_port = strtol(portbuffer, ((void *)0) , 10); + if(portptr[0] == '/') portptr++; + if(portptr[0] != '\n' && portptr[0] != '\0') + (__extension__ (__builtin_constant_p ( portptr ) && __builtin_constant_p ( 256 ) ? (strlen ( portptr ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( host->host_addressing , portptr , 256 ) : strncpy ( host->host_addressing , portptr , 256 )) : strncpy ( host->host_addressing , portptr , 256 ))) ; + else + (__extension__ (__builtin_constant_p ( "" ) && __builtin_constant_p ( 256 ) ? (strlen ( "" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( host->host_addressing , "" , 256 ) : strncpy ( host->host_addressing , "" , 256 )) : strncpy ( host->host_addressing , "" , 256 ))) ; + } else { + while(hostbuffer[index] != '/' && hostbuffer[index] != '\n' && hostbuffer[index] != '\0') + index++; + if(hostbuffer[index] == '/') + (__extension__ (__builtin_constant_p ( (char *)hostbuffer + index + 1 ) && __builtin_constant_p ( 256 ) ? (strlen ( (char *)hostbuffer + index + 1 ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( host->host_addressing , (char *)hostbuffer + index + 1 , 256 ) : strncpy ( host->host_addressing , (char *)hostbuffer + index + 1 , 256 )) : strncpy ( host->host_addressing , (char *)hostbuffer + index + 1 , 256 ))) ; + else + (__extension__ (__builtin_constant_p ( "" ) && __builtin_constant_p ( 256 ) ? (strlen ( "" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( host->host_addressing , "" , 256 ) : strncpy ( host->host_addressing , "" , 256 )) : strncpy ( host->host_addressing , "" , 256 ))) ; + hostbuffer[index] = '\0'; + (__extension__ (__builtin_constant_p ( hostbuffer ) && __builtin_constant_p ( 256 ) ? (strlen ( hostbuffer ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( host->host_server.server_name , hostbuffer , 256 ) : strncpy ( host->host_server.server_name , hostbuffer , 256 )) : strncpy ( host->host_server.server_name , hostbuffer , 256 ))) ; + if(host->host_protocol == 1 ) + host->host_server.server_port = 80 ; + else + host->host_server.server_port = 888 ; + } + + return 0; +} + + +static int + +cddb_serverlist_process_line(char *line, struct cddb_conf *conf, struct cddb_serverlist *list, struct cddb_server *proxy) + + + + + + + +{ + struct cddb_host proxy_host; + char *var, *value, procbuffer[256]; + + if((__extension__ (__builtin_constant_p ( '=' ) && ( '=' ) == '\0' ? (char *) __rawmemchr ( line , '=' ) : strchr ( line , '=' ))) == ((void *)0) ) + return 0; + + line[strlen(line) - 1] = '\0'; + + var = strtok(line, "="); + if(var == ((void *)0) ) + return 0; + value = strtok(((void *)0) , "="); + + if(value == ((void *)0) ) + value = ""; + + if(strcasecmp(var, "ACCESS") == 0) { + if(strncasecmp(value, "LOCAL", 2) == 0) + conf->conf_access = 0 ; + else + conf->conf_access = 1 ; + } else if(strcasecmp(var, "PROXY") == 0) { + if(cddb_process_url(&proxy_host, value) < 0) + return -1; + conf->conf_proxy = 1 ; + memcpy(proxy, &proxy_host.host_server, sizeof(struct cddb_server)); + } else if(strcasecmp(var, "SERVER") == 0) { + if(list->list_len >= 128 ) + return 0; + (__extension__ (__builtin_constant_p ( value ) && __builtin_constant_p ( 256 ) ? (strlen ( value ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( procbuffer , value , 256 ) : strncpy ( procbuffer , value , 256 )) : strncpy ( procbuffer , value , 256 ))) ; + if((__extension__ (__builtin_constant_p ( ' ' ) && ( ' ' ) == '\0' ? (char *) __rawmemchr ( procbuffer , ' ' ) : strchr ( procbuffer , ' ' ))) != ((void *)0) ) { + strtok(procbuffer, " "); + value = strtok(((void *)0) , " "); + } else + value = ((void *)0) ; + if(cddb_process_url(&list->list_host[list->list_len], procbuffer) != -1) { + if(value != ((void *)0) && __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( value ) && __builtin_constant_p ( "CDI" ) && (__s1_len = strlen ( value ), __s2_len = strlen ( "CDI" ), (! ((size_t)(const void *)(( value ) + 1) - (size_t)(const void *)( value ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "CDI" ) + 1) - (size_t)(const void *)( "CDI" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( value ), (__const char *) ( "CDI" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( value ) && ((size_t)(const void *)(( value ) + 1) - (size_t)(const void *)( value ) == 1) && (__s1_len = strlen ( value ), __s1_len < 4) ? (__builtin_constant_p ( "CDI" ) && ((size_t)(const void *)(( "CDI" ) + 1) - (size_t)(const void *)( "CDI" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( value ))[0] - ((__const unsigned char *) (__const char *)( "CDI" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( value ))[1] - ((__const unsigned char *) (__const char *) ( "CDI" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( value ))[2] - ((__const unsigned char *) (__const char *) ( "CDI" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( value ))[3] - ((__const unsigned char *) (__const char *) ( "CDI" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "CDI" ); register int __result = (((__const unsigned char *) (__const char *) ( value ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( value ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( value ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( value ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "CDI" ) && ((size_t)(const void *)(( "CDI" ) + 1) - (size_t)(const void *)( "CDI" ) == 1) && (__s2_len = strlen ( "CDI" ), __s2_len < 4) ? (__builtin_constant_p ( value ) && ((size_t)(const void *)(( value ) + 1) - (size_t)(const void *)( value ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( value ))[0] - ((__const unsigned char *) (__const char *)( "CDI" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( value ))[1] - ((__const unsigned char *) (__const char *) ( "CDI" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( value ))[2] - ((__const unsigned char *) (__const char *) ( "CDI" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( value ))[3] - ((__const unsigned char *) (__const char *) ( "CDI" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( value ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "CDI" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "CDI" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "CDI" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "CDI" ))[3]); } } __result; })) ) : strcmp ( value , "CDI" )))); }) == 0) + list->list_host[list->list_len].host_protocol = 2 ; + else if(value != ((void *)0) && __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( value ) && __builtin_constant_p ( "COVR" ) && (__s1_len = strlen ( value ), __s2_len = strlen ( "COVR" ), (! ((size_t)(const void *)(( value ) + 1) - (size_t)(const void *)( value ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "COVR" ) + 1) - (size_t)(const void *)( "COVR" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( value ), (__const char *) ( "COVR" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( value ) && ((size_t)(const void *)(( value ) + 1) - (size_t)(const void *)( value ) == 1) && (__s1_len = strlen ( value ), __s1_len < 4) ? (__builtin_constant_p ( "COVR" ) && ((size_t)(const void *)(( "COVR" ) + 1) - (size_t)(const void *)( "COVR" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( value ))[0] - ((__const unsigned char *) (__const char *)( "COVR" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( value ))[1] - ((__const unsigned char *) (__const char *) ( "COVR" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( value ))[2] - ((__const unsigned char *) (__const char *) ( "COVR" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( value ))[3] - ((__const unsigned char *) (__const char *) ( "COVR" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "COVR" ); register int __result = (((__const unsigned char *) (__const char *) ( value ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( value ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( value ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( value ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "COVR" ) && ((size_t)(const void *)(( "COVR" ) + 1) - (size_t)(const void *)( "COVR" ) == 1) && (__s2_len = strlen ( "COVR" ), __s2_len < 4) ? (__builtin_constant_p ( value ) && ((size_t)(const void *)(( value ) + 1) - (size_t)(const void *)( value ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( value ))[0] - ((__const unsigned char *) (__const char *)( "COVR" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( value ))[1] - ((__const unsigned char *) (__const char *) ( "COVR" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( value ))[2] - ((__const unsigned char *) (__const char *) ( "COVR" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( value ))[3] - ((__const unsigned char *) (__const char *) ( "COVR" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( value ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "COVR" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "COVR" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "COVR" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "COVR" ))[3]); } } __result; })) ) : strcmp ( value , "COVR" )))); }) == 0) + list->list_host[list->list_len].host_protocol = 3 ; + list->list_len++; + } + } + + return 0; +} + + +int + +cddb_read_serverlist(struct cddb_conf *conf, struct cddb_serverlist *list, struct cddb_server *proxy) + + + + + + +{ + FILE *cddbconf; + int index; + char inbuffer[256]; + char localconfpath[256]; + struct stat st; + + if(getenv("HOME") == ((void *)0) ) { + (__extension__ (__builtin_constant_p ( "$HOME is not set!" ) && __builtin_constant_p ( 256 ) ? (strlen ( "$HOME is not set!" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , "$HOME is not set!" , 256 ) : strncpy ( cddb_message , "$HOME is not set!" , 256 )) : strncpy ( cddb_message , "$HOME is not set!" , 256 ))) ; + return -1; + } + + list->list_len = 0; + conf->conf_access = 1 ; + conf->conf_proxy = 0 ; + + snprintf(localconfpath, 256, "%s/.cdserverrc", getenv("HOME")); + if(stat(localconfpath, &st) < 0) + return 0; + + cddbconf = fopen(localconfpath, "r"); + + while(!feof(cddbconf)) { + fgets(inbuffer, 256, cddbconf); + inbuffer[255] = '\0'; + + for(index = 0; index < strlen(inbuffer); index++) + if(inbuffer[index] == '#') { + inbuffer[index] = '\0'; + break; + } + + if(cddb_serverlist_process_line(inbuffer, conf, list, proxy) < 0) + return -1; + } + + fclose(cddbconf); + + return 0; +} + + +int + +cddb_write_serverlist(struct cddb_conf conf, struct cddb_serverlist list, struct cddb_server proxy) + + + + + + +{ + FILE *cddbconf; + int index; + time_t timeval; + char localconfpath[256]; + + if(getenv("HOME") == ((void *)0) ) { + (__extension__ (__builtin_constant_p ( "$HOME is not set!" ) && __builtin_constant_p ( 256 ) ? (strlen ( "$HOME is not set!" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , "$HOME is not set!" , 256 ) : strncpy ( cddb_message , "$HOME is not set!" , 256 )) : strncpy ( cddb_message , "$HOME is not set!" , 256 ))) ; + return -1; + } + + snprintf(localconfpath, 256, "%s/.cdserverrc", getenv("HOME")); + cddbconf = fopen(localconfpath, "w"); + + timeval = time(((void *)0) ); + fprintf(cddbconf, "# CD Server configuration file generated by %s %s.\n", "libcdaudio" , "0.99.1" ); + fprintf(cddbconf, "# Created %s\n", ctime(&timeval)); + if(conf.conf_access == 1 ) + fputs("ACCESS=REMOTE\n", cddbconf); + else + fputs("ACCESS=LOCAL\n", cddbconf); + + if(conf.conf_proxy == 1 ) + fprintf(cddbconf, "PROXY=http://%s:%d/\n", proxy.server_name, proxy.server_port); + for(index = 0; index < list.list_len; index++) { + switch(list.list_host[index].host_protocol) { + case 1 : + fprintf(cddbconf, "SERVER=http://%s:%d/%s CDDB\n", list.list_host[index].host_server.server_name, list.list_host[index].host_server.server_port, list.list_host[index].host_addressing); + break; + case 0 : + fprintf(cddbconf, "SERVER=cddbp://%s:%d/ CDDB\n", list.list_host[index].host_server.server_name, list.list_host[index].host_server.server_port); + break; + case 2 : + fprintf(cddbconf, "SERVER=http://%s:%d/%s CDI\n", list.list_host[index].host_server.server_name, list.list_host[index].host_server.server_port, list.list_host[index].host_addressing); + break; + case 3 : + fprintf(cddbconf, "SERVER=http://%s:%s/%s COVR\n", list.list_host[index].host_server.server_name, list.list_host[index].host_server.server_port, list.list_host[index].host_addressing); + } + } + + fclose(cddbconf); + + return 0; +} + + +char + +*cddb_genre(int genre) + + + + +{ + switch(genre) { + case 1 : + return "blues"; + case 2 : + return "classical"; + case 3 : + return "country"; + + case 4 : + return "data"; + case 5 : + return "folk"; + case 6 : + return "jazz"; + case 7 : + return "misc"; + case 8 : + return "newage"; + case 9 : + return "reggae"; + case 10 : + return "rock"; + case 11 : + return "soundtrack"; + } + + return "unknown"; +} + + +int + +cddb_genre_value(char *genre) + + + + +{ + if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( genre ) && __builtin_constant_p ( "blues" ) && (__s1_len = strlen ( genre ), __s2_len = strlen ( "blues" ), (! ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "blues" ) + 1) - (size_t)(const void *)( "blues" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( genre ), (__const char *) ( "blues" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) && (__s1_len = strlen ( genre ), __s1_len < 4) ? (__builtin_constant_p ( "blues" ) && ((size_t)(const void *)(( "blues" ) + 1) - (size_t)(const void *)( "blues" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "blues" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "blues" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "blues" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "blues" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "blues" ); register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "blues" ) && ((size_t)(const void *)(( "blues" ) + 1) - (size_t)(const void *)( "blues" ) == 1) && (__s2_len = strlen ( "blues" ), __s2_len < 4) ? (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "blues" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "blues" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "blues" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "blues" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( genre ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "blues" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "blues" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "blues" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "blues" ))[3]); } } __result; })) ) : strcmp ( genre , "blues" )))); }) == 0) + return 1 ; + else if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( genre ) && __builtin_constant_p ( "classical" ) && (__s1_len = strlen ( genre ), __s2_len = strlen ( "classical" ), (! ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "classical" ) + 1) - (size_t)(const void *)( "classical" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( genre ), (__const char *) ( "classical" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) && (__s1_len = strlen ( genre ), __s1_len < 4) ? (__builtin_constant_p ( "classical" ) && ((size_t)(const void *)(( "classical" ) + 1) - (size_t)(const void *)( "classical" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "classical" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "classical" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "classical" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "classical" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "classical" ); register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "classical" ) && ((size_t)(const void *)(( "classical" ) + 1) - (size_t)(const void *)( "classical" ) == 1) && (__s2_len = strlen ( "classical" ), __s2_len < 4) ? (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "classical" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "classical" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "classical" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "classical" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( genre ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "classical" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "classical" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "classical" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "classical" ))[3]); } } __result; })) ) : strcmp ( genre , "classical" )))); }) == 0) + return 2 ; + else if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( genre ) && __builtin_constant_p ( "country" ) && (__s1_len = strlen ( genre ), __s2_len = strlen ( "country" ), (! ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "country" ) + 1) - (size_t)(const void *)( "country" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( genre ), (__const char *) ( "country" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) && (__s1_len = strlen ( genre ), __s1_len < 4) ? (__builtin_constant_p ( "country" ) && ((size_t)(const void *)(( "country" ) + 1) - (size_t)(const void *)( "country" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "country" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "country" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "country" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "country" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "country" ); register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "country" ) && ((size_t)(const void *)(( "country" ) + 1) - (size_t)(const void *)( "country" ) == 1) && (__s2_len = strlen ( "country" ), __s2_len < 4) ? (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "country" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "country" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "country" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "country" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( genre ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "country" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "country" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "country" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "country" ))[3]); } } __result; })) ) : strcmp ( genre , "country" )))); }) == 0) + return 3 ; + else if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( genre ) && __builtin_constant_p ( "data" ) && (__s1_len = strlen ( genre ), __s2_len = strlen ( "data" ), (! ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "data" ) + 1) - (size_t)(const void *)( "data" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( genre ), (__const char *) ( "data" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) && (__s1_len = strlen ( genre ), __s1_len < 4) ? (__builtin_constant_p ( "data" ) && ((size_t)(const void *)(( "data" ) + 1) - (size_t)(const void *)( "data" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "data" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "data" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "data" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "data" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "data" ); register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "data" ) && ((size_t)(const void *)(( "data" ) + 1) - (size_t)(const void *)( "data" ) == 1) && (__s2_len = strlen ( "data" ), __s2_len < 4) ? (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "data" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "data" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "data" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "data" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( genre ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "data" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "data" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "data" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "data" ))[3]); } } __result; })) ) : strcmp ( genre , "data" )))); }) == 0) + return 4 ; + else if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( genre ) && __builtin_constant_p ( "folk" ) && (__s1_len = strlen ( genre ), __s2_len = strlen ( "folk" ), (! ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "folk" ) + 1) - (size_t)(const void *)( "folk" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( genre ), (__const char *) ( "folk" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) && (__s1_len = strlen ( genre ), __s1_len < 4) ? (__builtin_constant_p ( "folk" ) && ((size_t)(const void *)(( "folk" ) + 1) - (size_t)(const void *)( "folk" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "folk" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "folk" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "folk" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "folk" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "folk" ); register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "folk" ) && ((size_t)(const void *)(( "folk" ) + 1) - (size_t)(const void *)( "folk" ) == 1) && (__s2_len = strlen ( "folk" ), __s2_len < 4) ? (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "folk" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "folk" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "folk" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "folk" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( genre ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "folk" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "folk" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "folk" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "folk" ))[3]); } } __result; })) ) : strcmp ( genre , "folk" )))); }) == 0) + return 5 ; + else if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( genre ) && __builtin_constant_p ( "jazz" ) && (__s1_len = strlen ( genre ), __s2_len = strlen ( "jazz" ), (! ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "jazz" ) + 1) - (size_t)(const void *)( "jazz" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( genre ), (__const char *) ( "jazz" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) && (__s1_len = strlen ( genre ), __s1_len < 4) ? (__builtin_constant_p ( "jazz" ) && ((size_t)(const void *)(( "jazz" ) + 1) - (size_t)(const void *)( "jazz" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "jazz" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "jazz" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "jazz" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "jazz" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "jazz" ); register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "jazz" ) && ((size_t)(const void *)(( "jazz" ) + 1) - (size_t)(const void *)( "jazz" ) == 1) && (__s2_len = strlen ( "jazz" ), __s2_len < 4) ? (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "jazz" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "jazz" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "jazz" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "jazz" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( genre ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "jazz" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "jazz" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "jazz" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "jazz" ))[3]); } } __result; })) ) : strcmp ( genre , "jazz" )))); }) == 0) + return 6 ; + else if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( genre ) && __builtin_constant_p ( "misc" ) && (__s1_len = strlen ( genre ), __s2_len = strlen ( "misc" ), (! ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "misc" ) + 1) - (size_t)(const void *)( "misc" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( genre ), (__const char *) ( "misc" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) && (__s1_len = strlen ( genre ), __s1_len < 4) ? (__builtin_constant_p ( "misc" ) && ((size_t)(const void *)(( "misc" ) + 1) - (size_t)(const void *)( "misc" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "misc" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "misc" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "misc" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "misc" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "misc" ); register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "misc" ) && ((size_t)(const void *)(( "misc" ) + 1) - (size_t)(const void *)( "misc" ) == 1) && (__s2_len = strlen ( "misc" ), __s2_len < 4) ? (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "misc" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "misc" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "misc" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "misc" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( genre ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "misc" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "misc" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "misc" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "misc" ))[3]); } } __result; })) ) : strcmp ( genre , "misc" )))); }) == 0) + return 7 ; + else if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( genre ) && __builtin_constant_p ( "newage" ) && (__s1_len = strlen ( genre ), __s2_len = strlen ( "newage" ), (! ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "newage" ) + 1) - (size_t)(const void *)( "newage" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( genre ), (__const char *) ( "newage" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) && (__s1_len = strlen ( genre ), __s1_len < 4) ? (__builtin_constant_p ( "newage" ) && ((size_t)(const void *)(( "newage" ) + 1) - (size_t)(const void *)( "newage" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "newage" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "newage" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "newage" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "newage" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "newage" ); register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "newage" ) && ((size_t)(const void *)(( "newage" ) + 1) - (size_t)(const void *)( "newage" ) == 1) && (__s2_len = strlen ( "newage" ), __s2_len < 4) ? (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "newage" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "newage" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "newage" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "newage" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( genre ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "newage" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "newage" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "newage" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "newage" ))[3]); } } __result; })) ) : strcmp ( genre , "newage" )))); }) == 0) + return 8 ; + else if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( genre ) && __builtin_constant_p ( "reggae" ) && (__s1_len = strlen ( genre ), __s2_len = strlen ( "reggae" ), (! ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "reggae" ) + 1) - (size_t)(const void *)( "reggae" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( genre ), (__const char *) ( "reggae" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) && (__s1_len = strlen ( genre ), __s1_len < 4) ? (__builtin_constant_p ( "reggae" ) && ((size_t)(const void *)(( "reggae" ) + 1) - (size_t)(const void *)( "reggae" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "reggae" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "reggae" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "reggae" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "reggae" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "reggae" ); register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "reggae" ) && ((size_t)(const void *)(( "reggae" ) + 1) - (size_t)(const void *)( "reggae" ) == 1) && (__s2_len = strlen ( "reggae" ), __s2_len < 4) ? (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "reggae" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "reggae" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "reggae" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "reggae" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( genre ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "reggae" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "reggae" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "reggae" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "reggae" ))[3]); } } __result; })) ) : strcmp ( genre , "reggae" )))); }) == 0) + return 9 ; + else if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( genre ) && __builtin_constant_p ( "rock" ) && (__s1_len = strlen ( genre ), __s2_len = strlen ( "rock" ), (! ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "rock" ) + 1) - (size_t)(const void *)( "rock" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( genre ), (__const char *) ( "rock" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) && (__s1_len = strlen ( genre ), __s1_len < 4) ? (__builtin_constant_p ( "rock" ) && ((size_t)(const void *)(( "rock" ) + 1) - (size_t)(const void *)( "rock" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "rock" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "rock" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "rock" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "rock" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "rock" ); register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "rock" ) && ((size_t)(const void *)(( "rock" ) + 1) - (size_t)(const void *)( "rock" ) == 1) && (__s2_len = strlen ( "rock" ), __s2_len < 4) ? (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "rock" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "rock" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "rock" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "rock" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( genre ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "rock" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "rock" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "rock" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "rock" ))[3]); } } __result; })) ) : strcmp ( genre , "rock" )))); }) == 0) + return 10 ; + else if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( genre ) && __builtin_constant_p ( "soundtrack" ) && (__s1_len = strlen ( genre ), __s2_len = strlen ( "soundtrack" ), (! ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "soundtrack" ) + 1) - (size_t)(const void *)( "soundtrack" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( genre ), (__const char *) ( "soundtrack" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) && (__s1_len = strlen ( genre ), __s1_len < 4) ? (__builtin_constant_p ( "soundtrack" ) && ((size_t)(const void *)(( "soundtrack" ) + 1) - (size_t)(const void *)( "soundtrack" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "soundtrack" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "soundtrack" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "soundtrack" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "soundtrack" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "soundtrack" ); register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "soundtrack" ) && ((size_t)(const void *)(( "soundtrack" ) + 1) - (size_t)(const void *)( "soundtrack" ) == 1) && (__s2_len = strlen ( "soundtrack" ), __s2_len < 4) ? (__builtin_constant_p ( genre ) && ((size_t)(const void *)(( genre ) + 1) - (size_t)(const void *)( genre ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( genre ))[0] - ((__const unsigned char *) (__const char *)( "soundtrack" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[1] - ((__const unsigned char *) (__const char *) ( "soundtrack" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( genre ))[2] - ((__const unsigned char *) (__const char *) ( "soundtrack" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( genre ))[3] - ((__const unsigned char *) (__const char *) ( "soundtrack" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( genre ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "soundtrack" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "soundtrack" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "soundtrack" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "soundtrack" ))[3]); } } __result; })) ) : strcmp ( genre , "soundtrack" )))); }) == 0) + return 11 ; + else + return 0 ; +} + +int + +cddb_connect(struct cddb_server *server) + + + + +{ + int sock; + struct sockaddr_in sin; + struct hostent *host; + + sin.sin_family = 2 ; + sin.sin_port = (__extension__ ({ register unsigned short int __v; if (__builtin_constant_p ( server->server_port )) __v = (((( server->server_port ) >> 8) & 0xff) | ((( server->server_port ) & 0xff) << 8)) ; else __asm__ __volatile__ ("rorw $8, %w0" : "=r" (__v) : "0" ((unsigned short int) ( server->server_port )) : "cc"); __v; })) ; + + if((sin.sin_addr.s_addr = inet_addr(server->server_name)) == ((uint32_t) 0xffffffff) ) { + if((host = gethostbyname(server->server_name)) == ((void *)0) ) { + (__extension__ (__builtin_constant_p ( strerror((*__errno_location ()) ) ) && __builtin_constant_p ( 256 ) ? (strlen ( strerror((*__errno_location ()) ) ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , strerror((*__errno_location ()) ) , 256 ) : strncpy ( cddb_message , strerror((*__errno_location ()) ) , 256 )) : strncpy ( cddb_message , strerror((*__errno_location ()) ) , 256 ))) ; + return -1; + } + + memcpy(&sin.sin_addr, host-> h_addr_list[0] , host->h_length); + } + + if((sock = socket(2 , SOCK_STREAM , 0)) < 0) { + (__extension__ (__builtin_constant_p ( strerror((*__errno_location ()) ) ) && __builtin_constant_p ( 256 ) ? (strlen ( strerror((*__errno_location ()) ) ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , strerror((*__errno_location ()) ) , 256 ) : strncpy ( cddb_message , strerror((*__errno_location ()) ) , 256 )) : strncpy ( cddb_message , strerror((*__errno_location ()) ) , 256 ))) ; + return -1; + } + + if(connect(sock, (struct sockaddr *) &sin, sizeof(sin)) < 0) { + (__extension__ (__builtin_constant_p ( strerror((*__errno_location ()) ) ) && __builtin_constant_p ( 256 ) ? (strlen ( strerror((*__errno_location ()) ) ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , strerror((*__errno_location ()) ) , 256 ) : strncpy ( cddb_message , strerror((*__errno_location ()) ) , 256 )) : strncpy ( cddb_message , strerror((*__errno_location ()) ) , 256 ))) ; + return -1; + } + + return sock; +} + + + +int + +cddb_connect_server(struct cddb_host host, struct cddb_server *proxy, struct cddb_hello hello, ...) + + + + + + + +{ + int sock, token[3], http_string_len; + char *http_string, syshostname[256], sysdomainname[256], outbuffer[256]; + struct passwd *pw; + va_list arglist; + + ( arglist = ((__gnuc_va_list) __builtin_next_arg ( hello ))) ; + + if(proxy != ((void *)0) ) { + if((sock = cddb_connect(proxy)) < 0) + return -1; + } else { + if((sock = cddb_connect(&host.host_server)) < 0) + return -1; + } + + pw = getpwuid(getuid()); + gethostname(syshostname, 256); + getdomainname(sysdomainname, 256); + + if(host.host_protocol == 1 ) { + http_string = ( arglist = (__gnuc_va_list) ((char *) ( arglist ) + (((sizeof ( char * ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ), *(( char * *) (void *) ((char *) ( arglist ) - (((sizeof ( char * ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ))) ; + http_string_len = ( arglist = (__gnuc_va_list) ((char *) ( arglist ) + (((sizeof ( int ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ), *(( int *) (void *) ((char *) ( arglist ) - (((sizeof ( int ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ))) ; + if(proxy != ((void *)0) ) + snprintf(http_string, http_string_len, "GET http://%s:%d/%s?hello=%s+%s.%s+%s+%s&proto=%d HTTP/1.0\n\n", host.host_server.server_name, host.host_server.server_port, host.host_addressing, pw->pw_name, syshostname, sysdomainname, hello.hello_program, hello.hello_version, 3 ); + else + snprintf(http_string, http_string_len, "GET /%s?hello=%s+%s.%s+%s+%s&proto=%d HTTP/1.0\n\n", host.host_addressing, pw->pw_name, syshostname, sysdomainname, hello.hello_program, hello.hello_version, 3 ); + } else { + if(cddb_read_token(sock, token) < 0) { + ((void)0) ; + return -1; + } + + if(token[0] != 2) { + ((void)0) ; + return -1; + } + + snprintf(outbuffer, 256, "cddb hello %s %s.%s %s %s\n", pw->pw_name, syshostname, sysdomainname, hello.hello_program, hello.hello_version); + write(sock, outbuffer, strlen(outbuffer)); + + if(cddb_read_token(sock, token) < 0) { + ((void)0) ; + return -1; + } + + if(token[0] != 2) { + ((void)0) ; + return -1; + } + + snprintf(outbuffer, 256, "proto %d\n", 3 ); + write(sock, outbuffer, strlen(outbuffer)); + + if(cddb_read_token(sock, token) < 0) { + ((void)0) ; + return -1; + } + } + + ((void)0) ; + return sock; +} + + +static int + +cddb_generate_http_request(char *outbuffer, const char *cmd, char *http_string, int outbuffer_len) + + + + + + + +{ + char getstring[512]; + char reqstring[512]; + + if((__extension__ (__builtin_constant_p ( '?' ) && ( '?' ) == '\0' ? (char *) __rawmemchr ( http_string , '?' ) : strchr ( http_string , '?' ))) == ((void *)0) ) + return -1; + + (__extension__ (__builtin_constant_p ( http_string ) && __builtin_constant_p ( 512 ) ? (strlen ( http_string ) + 1 >= ((size_t) ( 512 )) ? (char *) memcpy ( getstring , http_string , 512 ) : strncpy ( getstring , http_string , 512 )) : strncpy ( getstring , http_string , 512 ))) ; + strtok(getstring, "?"); + (__extension__ (__builtin_constant_p ( strtok(((void *)0) , "?") ) && __builtin_constant_p ( 512 ) ? (strlen ( strtok(((void *)0) , "?") ) + 1 >= ((size_t) ( 512 )) ? (char *) memcpy ( reqstring , strtok(((void *)0) , "?") , 512 ) : strncpy ( reqstring , strtok(((void *)0) , "?") , 512 )) : strncpy ( reqstring , strtok(((void *)0) , "?") , 512 ))) ; + + snprintf(outbuffer, outbuffer_len, "%s?cmd=%s&%s\n", getstring, cmd, reqstring); + + return 0; +} + + +int + +cddb_skip_http_header(int sock) + + + + +{ + char inchar; + int len; + + do { + len = 0; + + do { + if(read(sock, &inchar, 1) < 1) { + (__extension__ (__builtin_constant_p ( "Unexpected socket closure" ) && __builtin_constant_p ( 256 ) ? (strlen ( "Unexpected socket closure" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , "Unexpected socket closure" , 256 ) : strncpy ( cddb_message , "Unexpected socket closure" , 256 )) : strncpy ( cddb_message , "Unexpected socket closure" , 256 ))) ; + return -1; + } + len++; + } while(inchar != '\n'); + } while(len > 2); + + return 0; +} + + +static int + +cddb_read_line(int sock, char *inbuffer, int len) + + + + + + +{ + int index; + char inchar; + + for(index = 0; index < len; index++) { + read(sock, &inchar, 1); + if(inchar == '\n') { + inbuffer[index] = '\0'; + if(inbuffer[0] == '.') + return 1; + return 0; + } + inbuffer[index] = inchar; + } + + return index; +} + + + + +int + +cddb_query(int cd_desc, int sock, int mode, struct cddb_query *query, ...) + + + + + + + +{ + unsigned long discid; + int index, slashed = 0, token[3]; + struct disc_info disc; + char offsetbuffer[1024], offsettmp[1024], outbuffer[1024], outtemp[1024], inbuffer[256], tmpbuffer[256], procbuffer[256], proctemp[256], artistbuffer[256]; + char *tmptr, *http_string, idtext[16]; + va_list arglist; + + ( arglist = ((__gnuc_va_list) __builtin_next_arg ( query ))) ; + query->query_matches = 0; + if(cd_stat(cd_desc, &disc) < 0) + return -1; + + if((discid = __internal_cddb_discid(disc)) < 0) + return -1; + + if(mode == 1 ) { + http_string = ( arglist = (__gnuc_va_list) ((char *) ( arglist ) + (((sizeof ( char * ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ), *(( char * *) (void *) ((char *) ( arglist ) - (((sizeof ( char * ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ))) ; + + snprintf(offsetbuffer, 1024, "%d", disc.disc_total_tracks); + for(index = 0; index < disc.disc_total_tracks; index++) { + snprintf(offsettmp, 1024, "%s+%d", offsetbuffer, (disc.disc_track[index].track_pos.minutes * 60 + disc.disc_track[index].track_pos.seconds) * 75 + disc.disc_track[index].track_pos.frames); + (__extension__ (__builtin_constant_p ( offsettmp ) && __builtin_constant_p ( 1024 ) ? (strlen ( offsettmp ) + 1 >= ((size_t) ( 1024 )) ? (char *) memcpy ( offsetbuffer , offsettmp , 1024 ) : strncpy ( offsetbuffer , offsettmp , 1024 )) : strncpy ( offsetbuffer , offsettmp , 1024 ))) ; + } + snprintf(outtemp, 1024, "cddb+query+%08lx+%s+%d", discid, offsetbuffer, disc.disc_length.minutes * 60 + disc.disc_length.seconds); + cddb_generate_http_request(outbuffer, outtemp, http_string, 1024); + } else { + snprintf(offsetbuffer, 1024, "%d", disc.disc_total_tracks); + for(index = 0; index < disc.disc_total_tracks; index++) { + snprintf(offsettmp, 1024, "%s %d", offsetbuffer, (disc.disc_track[index].track_pos.minutes * 60 + disc.disc_track[index].track_pos.seconds) * 75 + disc.disc_track[index].track_pos.frames); + (__extension__ (__builtin_constant_p ( offsettmp ) && __builtin_constant_p ( 1024 ) ? (strlen ( offsettmp ) + 1 >= ((size_t) ( 1024 )) ? (char *) memcpy ( offsetbuffer , offsettmp , 1024 ) : strncpy ( offsetbuffer , offsettmp , 1024 )) : strncpy ( offsetbuffer , offsettmp , 1024 ))) ; + } + snprintf(outbuffer, 1024, "cddb query %08lx %s %d\n", discid, offsetbuffer, disc.disc_length.minutes * 60 + disc.disc_length.seconds); + } + + ((void)0) ; + write(sock, outbuffer, strlen(outbuffer)); + + if(mode == 1 ) + cddb_skip_http_header(sock); + + if(cddb_read_line(sock, inbuffer, 256) < 0) + return -1; + (__extension__ (__builtin_constant_p ( inbuffer ) && __builtin_constant_p ( 256 ) ? (strlen ( inbuffer ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( tmpbuffer , inbuffer , 256 ) : strncpy ( tmpbuffer , inbuffer , 256 )) : strncpy ( tmpbuffer , inbuffer , 256 ))) ; + token[0] = inbuffer[0] - 48; + token[1] = inbuffer[1] - 48; + token[2] = inbuffer[2] - 48; + + (__extension__ (__builtin_constant_p ( (char *)inbuffer + 4 ) && __builtin_constant_p ( 256 ) ? (strlen ( (char *)inbuffer + 4 ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , (char *)inbuffer + 4 , 256 ) : strncpy ( cddb_message , (char *)inbuffer + 4 , 256 )) : strncpy ( cddb_message , (char *)inbuffer + 4 , 256 ))) ; + + if(token[0] != 2) + return -1; + + if(token[1] == 0) { + if(token[2] != 0) { + query->query_match = 0 ; + return 0; + } + + query->query_match = 1 ; + query->query_matches = 1; + slashed = 0; + if((__extension__ (__builtin_constant_p ( '/' ) && ( '/' ) == '\0' ? (char *) __rawmemchr ( tmpbuffer , '/' ) : strchr ( tmpbuffer , '/' ))) != ((void *)0) && parse_disc_artist) { + strtok(tmpbuffer, "/"); + (__extension__ (__builtin_constant_p ( strtok(((void *)0) , "/") + 1 ) && __builtin_constant_p ( 64 ) ? (strlen ( strtok(((void *)0) , "/") + 1 ) + 1 >= ((size_t) ( 64 )) ? (char *) memcpy ( query->query_list[0].list_title , strtok(((void *)0) , "/") + 1 , 64 ) : strncpy ( query->query_list[0].list_title , strtok(((void *)0) , "/") + 1 , 64 )) : strncpy ( query->query_list[0].list_title , strtok(((void *)0) , "/") + 1 , 64 ))) ; + slashed = 1; + } + + strtok(tmpbuffer, " "); + query->query_list[0].list_genre = cddb_genre_value(strtok(((void *)0) , " ")); + (__extension__ (__builtin_constant_p ( strtok(((void *)0) , " ") ) && __builtin_constant_p ( 16 ) ? (strlen ( strtok(((void *)0) , " ") ) + 1 >= ((size_t) ( 16 )) ? (char *) memcpy ( idtext , strtok(((void *)0) , " ") , 16 ) : strncpy ( idtext , strtok(((void *)0) , " ") , 16 )) : strncpy ( idtext , strtok(((void *)0) , " ") , 16 ))) ; + sscanf(idtext, "%xd", &query->query_list[0].list_id); + (__extension__ (__builtin_constant_p ( strtok(((void *)0) , " ") ) && __builtin_constant_p ( 256 ) ? (strlen ( strtok(((void *)0) , " ") ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( artistbuffer , strtok(((void *)0) , " ") , 256 ) : strncpy ( artistbuffer , strtok(((void *)0) , " ") , 256 )) : strncpy ( artistbuffer , strtok(((void *)0) , " ") , 256 ))) ; + while((tmptr = strtok(((void *)0) , " ")) != ((void *)0) ) { + snprintf(procbuffer, 256, "%s %s", artistbuffer, tmptr); + (__extension__ (__builtin_constant_p ( procbuffer ) && __builtin_constant_p ( 256 ) ? (strlen ( procbuffer ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( artistbuffer , procbuffer , 256 ) : strncpy ( artistbuffer , procbuffer , 256 )) : strncpy ( artistbuffer , procbuffer , 256 ))) ; + } + if(slashed) + (__extension__ (__builtin_constant_p ( procbuffer ) && __builtin_constant_p ( 64 ) ? (strlen ( procbuffer ) + 1 >= ((size_t) ( 64 )) ? (char *) memcpy ( query->query_list[0].list_artist , procbuffer , 64 ) : strncpy ( query->query_list[0].list_artist , procbuffer , 64 )) : strncpy ( query->query_list[0].list_artist , procbuffer , 64 ))) ; + else { + (__extension__ (__builtin_constant_p ( procbuffer ) && __builtin_constant_p ( 64 ) ? (strlen ( procbuffer ) + 1 >= ((size_t) ( 64 )) ? (char *) memcpy ( query->query_list[0].list_title , procbuffer , 64 ) : strncpy ( query->query_list[0].list_title , procbuffer , 64 )) : strncpy ( query->query_list[0].list_title , procbuffer , 64 ))) ; + (__extension__ (__builtin_constant_p ( "" ) && __builtin_constant_p ( 64 ) ? (strlen ( "" ) + 1 >= ((size_t) ( 64 )) ? (char *) memcpy ( query->query_list[0].list_artist , "" , 64 ) : strncpy ( query->query_list[0].list_artist , "" , 64 )) : strncpy ( query->query_list[0].list_artist , "" , 64 ))) ; + } + } else if(token[1] == 1) { + if(token[2] == 0) + query->query_match = 1 ; + else if(token[2] == 1) + query->query_match = 2 ; + else { + query->query_match = 0 ; + return 0; + } + + query->query_matches = 0; + while(!cddb_read_line(sock, inbuffer, 256)) { + slashed = 0; + if((__extension__ (__builtin_constant_p ( '/' ) && ( '/' ) == '\0' ? (char *) __rawmemchr ( inbuffer , '/' ) : strchr ( inbuffer , '/' ))) != ((void *)0) ) { + strtok(inbuffer, "/"); + (__extension__ (__builtin_constant_p ( strtok(((void *)0) , "/") + 1 ) && __builtin_constant_p ( 64 ) ? (strlen ( strtok(((void *)0) , "/") + 1 ) + 1 >= ((size_t) ( 64 )) ? (char *) memcpy ( query->query_list[query->query_matches].list_title , strtok(((void *)0) , "/") + 1 , 64 ) : strncpy ( query->query_list[query->query_matches].list_title , strtok(((void *)0) , "/") + 1 , 64 )) : strncpy ( query->query_list[query->query_matches].list_title , strtok(((void *)0) , "/") + 1 , 64 ))) ; + slashed = 1; + } + query->query_list[query->query_matches].list_genre = cddb_genre_value(strtok(inbuffer, " ")); + (__extension__ (__builtin_constant_p ( strtok(((void *)0) , " ") ) && __builtin_constant_p ( 16 ) ? (strlen ( strtok(((void *)0) , " ") ) + 1 >= ((size_t) ( 16 )) ? (char *) memcpy ( idtext , strtok(((void *)0) , " ") , 16 ) : strncpy ( idtext , strtok(((void *)0) , " ") , 16 )) : strncpy ( idtext , strtok(((void *)0) , " ") , 16 ))) ; + sscanf(idtext, "%xd", &query->query_list[query->query_matches].list_id); + (__extension__ (__builtin_constant_p ( strtok(((void *)0) , " ") ) && __builtin_constant_p ( 256 ) ? (strlen ( strtok(((void *)0) , " ") ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( procbuffer , strtok(((void *)0) , " ") , 256 ) : strncpy ( procbuffer , strtok(((void *)0) , " ") , 256 )) : strncpy ( procbuffer , strtok(((void *)0) , " ") , 256 ))) ; + while((tmptr = strtok(((void *)0) , " ")) != ((void *)0) ) { + snprintf(proctemp, 256, "%s %s", procbuffer, tmptr); + (__extension__ (__builtin_constant_p ( proctemp ) && __builtin_constant_p ( 256 ) ? (strlen ( proctemp ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( procbuffer , proctemp , 256 ) : strncpy ( procbuffer , proctemp , 256 )) : strncpy ( procbuffer , proctemp , 256 ))) ; + } + if(slashed) + (__extension__ (__builtin_constant_p ( procbuffer ) && __builtin_constant_p ( 64 ) ? (strlen ( procbuffer ) + 1 >= ((size_t) ( 64 )) ? (char *) memcpy ( query->query_list[query->query_matches++].list_artist , procbuffer , 64 ) : strncpy ( query->query_list[query->query_matches++].list_artist , procbuffer , 64 )) : strncpy ( query->query_list[query->query_matches++].list_artist , procbuffer , 64 ))) ; + else { + (__extension__ (__builtin_constant_p ( procbuffer ) && __builtin_constant_p ( 64 ) ? (strlen ( procbuffer ) + 1 >= ((size_t) ( 64 )) ? (char *) memcpy ( query->query_list[query->query_matches].list_title , procbuffer , 64 ) : strncpy ( query->query_list[query->query_matches].list_title , procbuffer , 64 )) : strncpy ( query->query_list[query->query_matches].list_title , procbuffer , 64 ))) ; + (__extension__ (__builtin_constant_p ( "" ) && __builtin_constant_p ( 64 ) ? (strlen ( "" ) + 1 >= ((size_t) ( 64 )) ? (char *) memcpy ( query->query_list[query->query_matches++].list_artist , "" , 64 ) : strncpy ( query->query_list[query->query_matches++].list_artist , "" , 64 )) : strncpy ( query->query_list[query->query_matches++].list_artist , "" , 64 ))) ; + } + } + } else { + query->query_match = 0 ; + return 0; + } + + return 0; +} + +static int + +cddb_process_line(char *line, struct __unprocessed_disc_data *data) + + + + + +{ + char *var, *value; + + line[strlen(line) - 1] = '\0'; + if((__extension__ (__builtin_constant_p ( "Revision" ) && ((size_t)(const void *)(( "Revision" ) + 1) - (size_t)(const void *)( "Revision" ) == 1) ? (((__const char *) ( "Revision" ))[0] == '\0' ? (char *) (size_t) ( line ) : (((__const char *) ( "Revision" ))[1] == '\0' ? (__extension__ (__builtin_constant_p ( ((__const char *) ( "Revision" ))[0] ) && ( ((__const char *) ( "Revision" ))[0] ) == '\0' ? (char *) __rawmemchr ( line , ((__const char *) ( "Revision" ))[0] ) : strchr ( line , ((__const char *) ( "Revision" ))[0] ))) : strstr ( line , "Revision" ))) : strstr ( line , "Revision" ))) != ((void *)0) ) { + strtok(line, ":"); + data->data_revision = strtol(strtok(((void *)0) , ":") + 1, ((void *)0) , 10); + return 0; + } + + if((__extension__ (__builtin_constant_p ( '=' ) && ( '=' ) == '\0' ? (char *) __rawmemchr ( line , '=' ) : strchr ( line , '=' ))) == ((void *)0) ) + return 0; + + var = strtok(line, "="); + if(var == ((void *)0) ) + return 0; + value = strtok(((void *)0) , "="); + + if(value == ((void *)0) ) + value = ""; + + if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( var ) && __builtin_constant_p ( "DTITLE" ) && (__s1_len = strlen ( var ), __s2_len = strlen ( "DTITLE" ), (! ((size_t)(const void *)(( var ) + 1) - (size_t)(const void *)( var ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "DTITLE" ) + 1) - (size_t)(const void *)( "DTITLE" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( var ), (__const char *) ( "DTITLE" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( var ) && ((size_t)(const void *)(( var ) + 1) - (size_t)(const void *)( var ) == 1) && (__s1_len = strlen ( var ), __s1_len < 4) ? (__builtin_constant_p ( "DTITLE" ) && ((size_t)(const void *)(( "DTITLE" ) + 1) - (size_t)(const void *)( "DTITLE" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( var ))[0] - ((__const unsigned char *) (__const char *)( "DTITLE" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[1] - ((__const unsigned char *) (__const char *) ( "DTITLE" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[2] - ((__const unsigned char *) (__const char *) ( "DTITLE" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( var ))[3] - ((__const unsigned char *) (__const char *) ( "DTITLE" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "DTITLE" ); register int __result = (((__const unsigned char *) (__const char *) ( var ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( var ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "DTITLE" ) && ((size_t)(const void *)(( "DTITLE" ) + 1) - (size_t)(const void *)( "DTITLE" ) == 1) && (__s2_len = strlen ( "DTITLE" ), __s2_len < 4) ? (__builtin_constant_p ( var ) && ((size_t)(const void *)(( var ) + 1) - (size_t)(const void *)( var ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( var ))[0] - ((__const unsigned char *) (__const char *)( "DTITLE" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[1] - ((__const unsigned char *) (__const char *) ( "DTITLE" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[2] - ((__const unsigned char *) (__const char *) ( "DTITLE" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( var ))[3] - ((__const unsigned char *) (__const char *) ( "DTITLE" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( var ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "DTITLE" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "DTITLE" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "DTITLE" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "DTITLE" ))[3]); } } __result; })) ) : strcmp ( var , "DTITLE" )))); }) == 0) { + if(data->data_title_index >= 6 ) + return 0; + (__extension__ (__builtin_constant_p ( value ) && __builtin_constant_p ( 80 ) ? (strlen ( value ) + 1 >= ((size_t) ( 80 )) ? (char *) memcpy ( data->data_title[data->data_title_index++] , value , 80 ) : strncpy ( data->data_title[data->data_title_index++] , value , 80 )) : strncpy ( data->data_title[data->data_title_index++] , value , 80 ))) ; + } else if((__extension__ (__builtin_constant_p ( 6 ) && ((__builtin_constant_p ( var ) && strlen ( var ) < ((size_t) ( 6 ))) || (__builtin_constant_p ( "TTITLE" ) && strlen ( "TTITLE" ) < ((size_t) ( 6 )))) ? __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( var ) && __builtin_constant_p ( "TTITLE" ) && (__s1_len = strlen ( var ), __s2_len = strlen ( "TTITLE" ), (! ((size_t)(const void *)(( var ) + 1) - (size_t)(const void *)( var ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "TTITLE" ) + 1) - (size_t)(const void *)( "TTITLE" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( var ), (__const char *) ( "TTITLE" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( var ) && ((size_t)(const void *)(( var ) + 1) - (size_t)(const void *)( var ) == 1) && (__s1_len = strlen ( var ), __s1_len < 4) ? (__builtin_constant_p ( "TTITLE" ) && ((size_t)(const void *)(( "TTITLE" ) + 1) - (size_t)(const void *)( "TTITLE" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( var ))[0] - ((__const unsigned char *) (__const char *)( "TTITLE" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[1] - ((__const unsigned char *) (__const char *) ( "TTITLE" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[2] - ((__const unsigned char *) (__const char *) ( "TTITLE" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( var ))[3] - ((__const unsigned char *) (__const char *) ( "TTITLE" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "TTITLE" ); register int __result = (((__const unsigned char *) (__const char *) ( var ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( var ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "TTITLE" ) && ((size_t)(const void *)(( "TTITLE" ) + 1) - (size_t)(const void *)( "TTITLE" ) == 1) && (__s2_len = strlen ( "TTITLE" ), __s2_len < 4) ? (__builtin_constant_p ( var ) && ((size_t)(const void *)(( var ) + 1) - (size_t)(const void *)( var ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( var ))[0] - ((__const unsigned char *) (__const char *)( "TTITLE" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[1] - ((__const unsigned char *) (__const char *) ( "TTITLE" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[2] - ((__const unsigned char *) (__const char *) ( "TTITLE" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( var ))[3] - ((__const unsigned char *) (__const char *) ( "TTITLE" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( var ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "TTITLE" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "TTITLE" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "TTITLE" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "TTITLE" ))[3]); } } __result; })) ) : strcmp ( var , "TTITLE" )))); }) : strncmp ( var , "TTITLE" , 6 ))) == 0) { + if(data->data_track[strtol((char *)var + 6, ((void *)0) , 10)].track_name_index >= 6 ) + return 0; + (__extension__ (__builtin_constant_p ( value ) && __builtin_constant_p ( 80 ) ? (strlen ( value ) + 1 >= ((size_t) ( 80 )) ? (char *) memcpy ( data->data_track[strtol((char *)var + 6, ((void *)0) , 10)].track_name[data->data_track[strtol((char *)var + 6, ((void *)0) , 10)].track_name_index++] , value , 80 ) : strncpy ( data->data_track[strtol((char *)var + 6, ((void *)0) , 10)].track_name[data->data_track[strtol((char *)var + 6, ((void *)0) , 10)].track_name_index++] , value , 80 )) : strncpy ( data->data_track[strtol((char *)var + 6, ((void *)0) , 10)].track_name[data->data_track[strtol((char *)var + 6, ((void *)0) , 10)].track_name_index++] , value , 80 ))) ; + } else if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( var ) && __builtin_constant_p ( "EXTD" ) && (__s1_len = strlen ( var ), __s2_len = strlen ( "EXTD" ), (! ((size_t)(const void *)(( var ) + 1) - (size_t)(const void *)( var ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "EXTD" ) + 1) - (size_t)(const void *)( "EXTD" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( var ), (__const char *) ( "EXTD" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( var ) && ((size_t)(const void *)(( var ) + 1) - (size_t)(const void *)( var ) == 1) && (__s1_len = strlen ( var ), __s1_len < 4) ? (__builtin_constant_p ( "EXTD" ) && ((size_t)(const void *)(( "EXTD" ) + 1) - (size_t)(const void *)( "EXTD" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( var ))[0] - ((__const unsigned char *) (__const char *)( "EXTD" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[1] - ((__const unsigned char *) (__const char *) ( "EXTD" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[2] - ((__const unsigned char *) (__const char *) ( "EXTD" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( var ))[3] - ((__const unsigned char *) (__const char *) ( "EXTD" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "EXTD" ); register int __result = (((__const unsigned char *) (__const char *) ( var ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( var ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "EXTD" ) && ((size_t)(const void *)(( "EXTD" ) + 1) - (size_t)(const void *)( "EXTD" ) == 1) && (__s2_len = strlen ( "EXTD" ), __s2_len < 4) ? (__builtin_constant_p ( var ) && ((size_t)(const void *)(( var ) + 1) - (size_t)(const void *)( var ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( var ))[0] - ((__const unsigned char *) (__const char *)( "EXTD" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[1] - ((__const unsigned char *) (__const char *) ( "EXTD" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[2] - ((__const unsigned char *) (__const char *) ( "EXTD" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( var ))[3] - ((__const unsigned char *) (__const char *) ( "EXTD" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( var ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "EXTD" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "EXTD" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "EXTD" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "EXTD" ))[3]); } } __result; })) ) : strcmp ( var , "EXTD" )))); }) == 0) { + if(data->data_extended_index >= 64 ) + return 0; + (__extension__ (__builtin_constant_p ( value ) && __builtin_constant_p ( 80 ) ? (strlen ( value ) + 1 >= ((size_t) ( 80 )) ? (char *) memcpy ( data->data_extended[data->data_extended_index++] , value , 80 ) : strncpy ( data->data_extended[data->data_extended_index++] , value , 80 )) : strncpy ( data->data_extended[data->data_extended_index++] , value , 80 ))) ; + } else if((__extension__ (__builtin_constant_p ( 4 ) && ((__builtin_constant_p ( var ) && strlen ( var ) < ((size_t) ( 4 ))) || (__builtin_constant_p ( "EXTT" ) && strlen ( "EXTT" ) < ((size_t) ( 4 )))) ? __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( var ) && __builtin_constant_p ( "EXTT" ) && (__s1_len = strlen ( var ), __s2_len = strlen ( "EXTT" ), (! ((size_t)(const void *)(( var ) + 1) - (size_t)(const void *)( var ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "EXTT" ) + 1) - (size_t)(const void *)( "EXTT" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( var ), (__const char *) ( "EXTT" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( var ) && ((size_t)(const void *)(( var ) + 1) - (size_t)(const void *)( var ) == 1) && (__s1_len = strlen ( var ), __s1_len < 4) ? (__builtin_constant_p ( "EXTT" ) && ((size_t)(const void *)(( "EXTT" ) + 1) - (size_t)(const void *)( "EXTT" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( var ))[0] - ((__const unsigned char *) (__const char *)( "EXTT" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[1] - ((__const unsigned char *) (__const char *) ( "EXTT" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[2] - ((__const unsigned char *) (__const char *) ( "EXTT" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( var ))[3] - ((__const unsigned char *) (__const char *) ( "EXTT" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "EXTT" ); register int __result = (((__const unsigned char *) (__const char *) ( var ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( var ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "EXTT" ) && ((size_t)(const void *)(( "EXTT" ) + 1) - (size_t)(const void *)( "EXTT" ) == 1) && (__s2_len = strlen ( "EXTT" ), __s2_len < 4) ? (__builtin_constant_p ( var ) && ((size_t)(const void *)(( var ) + 1) - (size_t)(const void *)( var ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( var ))[0] - ((__const unsigned char *) (__const char *)( "EXTT" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[1] - ((__const unsigned char *) (__const char *) ( "EXTT" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( var ))[2] - ((__const unsigned char *) (__const char *) ( "EXTT" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( var ))[3] - ((__const unsigned char *) (__const char *) ( "EXTT" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( var ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "EXTT" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "EXTT" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "EXTT" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "EXTT" ))[3]); } } __result; })) ) : strcmp ( var , "EXTT" )))); }) : strncmp ( var , "EXTT" , 4 ))) == 0) { + if(data->data_track[strtol((char *)var + 4, ((void *)0) , 10)].track_extended_index >= 64 ) + return 0; + (__extension__ (__builtin_constant_p ( value ) && __builtin_constant_p ( 80 ) ? (strlen ( value ) + 1 >= ((size_t) ( 80 )) ? (char *) memcpy ( data->data_track[strtol((char *)var + 4, ((void *)0) , 10)].track_extended[data->data_track[strtol((char *)var + 4, ((void *)0) , 10)].track_extended_index++] , value , 80 ) : strncpy ( data->data_track[strtol((char *)var + 4, ((void *)0) , 10)].track_extended[data->data_track[strtol((char *)var + 4, ((void *)0) , 10)].track_extended_index++] , value , 80 )) : strncpy ( data->data_track[strtol((char *)var + 4, ((void *)0) , 10)].track_extended[data->data_track[strtol((char *)var + 4, ((void *)0) , 10)].track_extended_index++] , value , 80 ))) ; + } + + return 0; +} + + +int + +cddb_read(int cd_desc, int sock, int mode, struct cddb_entry entry, struct disc_data *data, ...) + + + + + + +{ + int index, token[3]; + char outbuffer[512], outtemp[512], inbuffer[512], *http_string; + struct disc_info disc; + struct __unprocessed_disc_data indata; + va_list arglist; + + if(cd_stat(cd_desc, &disc) < 0) + return -1; + + if((indata.data_id = __internal_cddb_discid(disc)) < 0) + return -1; + + ( arglist = ((__gnuc_va_list) __builtin_next_arg ( data ))) ; + indata.data_genre = entry.entry_genre; + indata.data_title_index = 0; + indata.data_extended_index = 0; + for(index = 0; index < disc.disc_total_tracks; index++) { + indata.data_track[index].track_name_index = 0; + indata.data_track[index].track_extended_index = 0; + } + + if(mode == 1 ) { + http_string = ( arglist = (__gnuc_va_list) ((char *) ( arglist ) + (((sizeof ( char * ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ), *(( char * *) (void *) ((char *) ( arglist ) - (((sizeof ( char * ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ))) ; + snprintf(outtemp, 512, "cddb+read+%s+%08lx", cddb_genre(entry.entry_genre), entry.entry_id); + cddb_generate_http_request(outbuffer, outtemp, http_string, 512); + } else + snprintf(outbuffer, 512, "cddb read %s %08lx\n", cddb_genre(entry.entry_genre), entry.entry_id); + + ((void)0) ; + + write(sock, outbuffer, strlen(outbuffer)); + + if(mode == 1 ) + cddb_skip_http_header(sock); + + if(cddb_read_token(sock, token) < 0) + return -1; + + if(token[0] != 2 && token[1] != 1) + return -1; + + while(!cddb_read_line(sock, inbuffer, 512)) + cddb_process_line(inbuffer, &indata); + + data_format_input(data, indata, disc.disc_total_tracks); + data->data_revision++; + + return 0; +} + + +static int + +cddb_sites_process_line(char *line, struct cddb_host *host) + + + + + +{ + char *ptr; + + (__extension__ (__builtin_constant_p ( strtok(line, " ") ) && __builtin_constant_p ( 256 ) ? (strlen ( strtok(line, " ") ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( host->host_server.server_name , strtok(line, " ") , 256 ) : strncpy ( host->host_server.server_name , strtok(line, " ") , 256 )) : strncpy ( host->host_server.server_name , strtok(line, " ") , 256 ))) ; + + ptr = strtok(((void *)0) , " "); + if(strcasecmp(ptr, "cddbp") == 0) + host->host_protocol = 0 ; + else if(strcasecmp(ptr, "http") == 0) + host->host_protocol = 1 ; + else return -1; + + host->host_server.server_port = strtol(strtok(((void *)0) , " "), ((void *)0) , 10); + + ptr = strtok(((void *)0) , " "); + if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( ptr ) && __builtin_constant_p ( "-" ) && (__s1_len = strlen ( ptr ), __s2_len = strlen ( "-" ), (! ((size_t)(const void *)(( ptr ) + 1) - (size_t)(const void *)( ptr ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "-" ) + 1) - (size_t)(const void *)( "-" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( ptr ), (__const char *) ( "-" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( ptr ) && ((size_t)(const void *)(( ptr ) + 1) - (size_t)(const void *)( ptr ) == 1) && (__s1_len = strlen ( ptr ), __s1_len < 4) ? (__builtin_constant_p ( "-" ) && ((size_t)(const void *)(( "-" ) + 1) - (size_t)(const void *)( "-" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( ptr ))[0] - ((__const unsigned char *) (__const char *)( "-" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( ptr ))[1] - ((__const unsigned char *) (__const char *) ( "-" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( ptr ))[2] - ((__const unsigned char *) (__const char *) ( "-" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( ptr ))[3] - ((__const unsigned char *) (__const char *) ( "-" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "-" ); register int __result = (((__const unsigned char *) (__const char *) ( ptr ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( ptr ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( ptr ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( ptr ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "-" ) && ((size_t)(const void *)(( "-" ) + 1) - (size_t)(const void *)( "-" ) == 1) && (__s2_len = strlen ( "-" ), __s2_len < 4) ? (__builtin_constant_p ( ptr ) && ((size_t)(const void *)(( ptr ) + 1) - (size_t)(const void *)( ptr ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( ptr ))[0] - ((__const unsigned char *) (__const char *)( "-" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( ptr ))[1] - ((__const unsigned char *) (__const char *) ( "-" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( ptr ))[2] - ((__const unsigned char *) (__const char *) ( "-" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( ptr ))[3] - ((__const unsigned char *) (__const char *) ( "-" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( ptr ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "-" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "-" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "-" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "-" ))[3]); } } __result; })) ) : strcmp ( ptr , "-" )))); }) != 0) + (__extension__ (__builtin_constant_p ( ptr + 1 ) && __builtin_constant_p ( 256 ) ? (strlen ( ptr + 1 ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( host->host_addressing , ptr + 1 , 256 ) : strncpy ( host->host_addressing , ptr + 1 , 256 )) : strncpy ( host->host_addressing , ptr + 1 , 256 ))) ; + else + (__extension__ (__builtin_constant_p ( "" ) && __builtin_constant_p ( 256 ) ? (strlen ( "" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( host->host_addressing , "" , 256 ) : strncpy ( host->host_addressing , "" , 256 )) : strncpy ( host->host_addressing , "" , 256 ))) ; + + return 0; +} + + +int + +cddb_sites(int sock, int mode, struct cddb_serverlist *list, ...) + + + + + + +{ + int token[3], http_string_len; + char outbuffer[512], inbuffer[256], *http_string; + va_list arglist; + + ( arglist = ((__gnuc_va_list) __builtin_next_arg ( list ))) ; + if(mode == 1 ) { + http_string = ( arglist = (__gnuc_va_list) ((char *) ( arglist ) + (((sizeof ( char * ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ), *(( char * *) (void *) ((char *) ( arglist ) - (((sizeof ( char * ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ))) ; + http_string_len = ( arglist = (__gnuc_va_list) ((char *) ( arglist ) + (((sizeof ( int ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ), *(( int *) (void *) ((char *) ( arglist ) - (((sizeof ( int ) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) ))) ; + cddb_generate_http_request(outbuffer, "sites", http_string, 512); + } else + (__extension__ (__builtin_constant_p ( "sites\n" ) ? (((size_t)(const void *)(( "sites\n" ) + 1) - (size_t)(const void *)( "sites\n" ) == 1) && strlen ( "sites\n" ) + 1 <= 8 ? __strcpy_small ( outbuffer , __extension__ (((__const unsigned char *) (__const char *) ( "sites\n" ))[ 0 + 1] << 8 | ((__const unsigned char *) (__const char *) ( "sites\n" ))[ 0 ]) , __extension__ (((__const unsigned char *) (__const char *) ( "sites\n" ))[ 4 + 1] << 8 | ((__const unsigned char *) (__const char *) ( "sites\n" ))[ 4 ]) , __extension__ (((((__const unsigned char *) (__const char *) ( "sites\n" ))[ 0 + 3] << 8 | ((__const unsigned char *) (__const char *) ( "sites\n" ))[ 0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ( "sites\n" ))[ 0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ( "sites\n" ))[ 0 ]) , __extension__ (((((__const unsigned char *) (__const char *) ( "sites\n" ))[ 4 + 3] << 8 | ((__const unsigned char *) (__const char *) ( "sites\n" ))[ 4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ( "sites\n" ))[ 4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ( "sites\n" ))[ 4 ]) , strlen ( "sites\n" ) + 1) : (char *) memcpy ( outbuffer , "sites\n" , strlen ( "sites\n" ) + 1)) : strcpy ( outbuffer , "sites\n" ))) ; + + write(sock, outbuffer, strlen(outbuffer)); + + if(mode == 1 ) + cddb_skip_http_header(sock); + + if(cddb_read_token(sock, token) < 0) + return -1; + + if(token[0] != 2) + return -1; + + list->list_len = 0; + + while(!cddb_read_line(sock, inbuffer, 256)) + if(cddb_sites_process_line(inbuffer, &list->list_host[list->list_len]) != -1) + list->list_len++; + + return 0; +} + + +int + +cddb_quit(int sock) + + + + +{ + char outbuffer[8]; + + (__extension__ (__builtin_constant_p ( "quit\n" ) ? (((size_t)(const void *)(( "quit\n" ) + 1) - (size_t)(const void *)( "quit\n" ) == 1) && strlen ( "quit\n" ) + 1 <= 8 ? __strcpy_small ( outbuffer , __extension__ (((__const unsigned char *) (__const char *) ( "quit\n" ))[ 0 + 1] << 8 | ((__const unsigned char *) (__const char *) ( "quit\n" ))[ 0 ]) , __extension__ (((__const unsigned char *) (__const char *) ( "quit\n" ))[ 4 + 1] << 8 | ((__const unsigned char *) (__const char *) ( "quit\n" ))[ 4 ]) , __extension__ (((((__const unsigned char *) (__const char *) ( "quit\n" ))[ 0 + 3] << 8 | ((__const unsigned char *) (__const char *) ( "quit\n" ))[ 0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ( "quit\n" ))[ 0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ( "quit\n" ))[ 0 ]) , __extension__ (((((__const unsigned char *) (__const char *) ( "quit\n" ))[ 4 + 3] << 8 | ((__const unsigned char *) (__const char *) ( "quit\n" ))[ 4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ( "quit\n" ))[ 4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ( "quit\n" ))[ 4 ]) , strlen ( "quit\n" ) + 1) : (char *) memcpy ( outbuffer , "quit\n" , strlen ( "quit\n" ) + 1)) : strcpy ( outbuffer , "quit\n" ))) ; + write(sock, outbuffer, strlen(outbuffer)); + + shutdown(sock, 2); + close(sock); + + return 0; +} + + + +int + +cddb_read_token(int sock, int token[3]) + + + + + +{ + char inbuffer[512]; + + if(cddb_read_line(sock, inbuffer, 512) < 0) + return -1; + + if((__extension__ (__builtin_constant_p ( 5 ) && ((__builtin_constant_p ( inbuffer ) && strlen ( inbuffer ) < ((size_t) ( 5 ))) || (__builtin_constant_p ( "= 4) && (! ((size_t)(const void *)(( "= 4)) ? memcmp ((__const char *) ( inbuffer ), (__const char *) ( " 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( inbuffer ))[1] - ((__const unsigned char *) (__const char *) ( " 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( inbuffer ))[2] - ((__const unsigned char *) (__const char *) ( " 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( inbuffer ))[3] - ((__const unsigned char *) (__const char *) ( " 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( inbuffer ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( inbuffer ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( inbuffer ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( " 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( inbuffer ))[1] - ((__const unsigned char *) (__const char *) ( " 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( inbuffer ))[2] - ((__const unsigned char *) (__const char *) ( " 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( inbuffer ))[3] - ((__const unsigned char *) (__const char *) ( " 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( " 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( " 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , "404 CDDB CGI not found" , 256 ) : strncpy ( cddb_message , "404 CDDB CGI not found" , 256 )) : strncpy ( cddb_message , "404 CDDB CGI not found" , 256 ))) ; + return -1; + } + + token[0] = inbuffer[0] - 48; + token[1] = inbuffer[1] - 48; + token[2] = inbuffer[2] - 48; + + (__extension__ (__builtin_constant_p ( (char *)inbuffer + 4 ) && __builtin_constant_p ( 256 ) ? (strlen ( (char *)inbuffer + 4 ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , (char *)inbuffer + 4 , 256 ) : strncpy ( cddb_message , (char *)inbuffer + 4 , 256 )) : strncpy ( cddb_message , (char *)inbuffer + 4 , 256 ))) ; + + return 0; +} + + +int + +cddb_read_data(int cd_desc, struct disc_data *data) + + + + + +{ + int sock = -1, index; + char http_string[512]; + struct disc_info disc; + struct cddb_entry entry; + struct cddb_hello hello; + struct cddb_query query; + struct cddb_conf conf; + struct cddb_server *proxy_ptr; + struct cddb_serverlist list; + + if(cd_stat(cd_desc, &disc) < 0) + return -1; + + if(!disc.disc_present) + return -1; + + proxy_ptr = (struct cddb_server *)malloc(sizeof(struct cddb_server)); + cddb_read_serverlist(&conf, &list, proxy_ptr); + if(!conf.conf_access) { + free(proxy_ptr); + return -1; + } + if(!conf.conf_proxy) { + free(proxy_ptr); + proxy_ptr = ((void *)0) ; + } + + if(list.list_len < 1) + return -1; + + (__extension__ (__builtin_constant_p ( "libcdaudio" ) && __builtin_constant_p ( 256 ) ? (strlen ( "libcdaudio" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( hello.hello_program , "libcdaudio" , 256 ) : strncpy ( hello.hello_program , "libcdaudio" , 256 )) : strncpy ( hello.hello_program , "libcdaudio" , 256 ))) ; + (__extension__ (__builtin_constant_p ( "0.99.1" ) && __builtin_constant_p ( 256 ) ? (strlen ( "0.99.1" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( hello.hello_version , "0.99.1" , 256 ) : strncpy ( hello.hello_version , "0.99.1" , 256 )) : strncpy ( hello.hello_version , "0.99.1" , 256 ))) ; + + index = 0; + + + do { + switch(list.list_host[index].host_protocol) { + case 0 : + sock = cddb_connect_server(list.list_host[index++], proxy_ptr, hello); + break; + case 1 : + sock = cddb_connect_server(list.list_host[index++], proxy_ptr, hello, http_string, 512); + break; + case 2 : + sock = cdindex_connect_server(list.list_host[index++], proxy_ptr, http_string, 512); + } + } while(index < list.list_len && sock == -1); + + if(sock < 0) { + if(conf.conf_proxy) free(proxy_ptr); + return -1; + } + + index--; + + + switch(list.list_host[index].host_protocol) { + case 0 : + if(cddb_query(cd_desc, sock, 0 , &query) < 0) { + if(conf.conf_proxy) free(proxy_ptr); + return -1; + } + break; + case 1 : + if(cddb_query(cd_desc, sock, 1 , &query, http_string) < 0) { + if(conf.conf_proxy) free(proxy_ptr); + return -1; + } + shutdown(sock, 2); + close(sock); + + + if((sock = cddb_connect_server(list.list_host[index], proxy_ptr, hello, http_string, 512)) < 0) + return -1; + + break; + } + + if(conf.conf_proxy) free(proxy_ptr); + + + + + entry.entry_id = query.query_list[0].list_id; + entry.entry_genre = query.query_list[0].list_genre; + + + switch(list.list_host[index].host_protocol) { + case 0 : + if(cddb_read(cd_desc, sock, 0 , entry, data) < 0) + return -1; + + cddb_quit(sock); + break; + case 1 : + if(cddb_read(cd_desc, sock, 1 , entry, data, http_string) < 0) + return -1; + + shutdown(sock, 2); + close(sock); + break; + case 2 : + if(cdindex_read(cd_desc, sock, data, http_string) < 0) + return -1; + + shutdown(sock, 2); + close(sock); + } + + return 0; +} + + +int + +cddb_generate_unknown_entry(int cd_desc, struct disc_data *data) + + + + + +{ + int index; + struct disc_info disc; + + if(cd_stat(cd_desc, &disc) < 0) + return -1; + + if((data->data_id = __internal_cddb_discid(disc)) < 0) + return -1; + + if(__internal_cdindex_discid(disc, data->data_cdindex_id, 30 ) < 0) + return -1; + + (__extension__ (__builtin_constant_p ( "Unknown" ) ? (((size_t)(const void *)(( "Unknown" ) + 1) - (size_t)(const void *)( "Unknown" ) == 1) && strlen ( "Unknown" ) + 1 <= 8 ? __strcpy_small ( data->data_title , __extension__ (((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 + 1] << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 ]) , __extension__ (((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 + 1] << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 ]) , __extension__ (((((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 + 3] << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 ]) , __extension__ (((((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 + 3] << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 ]) , strlen ( "Unknown" ) + 1) : (char *) memcpy ( data->data_title , "Unknown" , strlen ( "Unknown" ) + 1)) : strcpy ( data->data_title , "Unknown" ))) ; + (__extension__ (__builtin_constant_p ( "Unknown" ) ? (((size_t)(const void *)(( "Unknown" ) + 1) - (size_t)(const void *)( "Unknown" ) == 1) && strlen ( "Unknown" ) + 1 <= 8 ? __strcpy_small ( data->data_artist , __extension__ (((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 + 1] << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 ]) , __extension__ (((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 + 1] << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 ]) , __extension__ (((((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 + 3] << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 ]) , __extension__ (((((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 + 3] << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 ]) , strlen ( "Unknown" ) + 1) : (char *) memcpy ( data->data_artist , "Unknown" , strlen ( "Unknown" ) + 1)) : strcpy ( data->data_artist , "Unknown" ))) ; + data->data_genre = 0 ; + for(index = 0; index < disc.disc_total_tracks; index++) { + (__extension__ (__builtin_constant_p ( "Unknown" ) ? (((size_t)(const void *)(( "Unknown" ) + 1) - (size_t)(const void *)( "Unknown" ) == 1) && strlen ( "Unknown" ) + 1 <= 8 ? __strcpy_small ( data->data_track[index].track_name , __extension__ (((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 + 1] << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 ]) , __extension__ (((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 + 1] << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 ]) , __extension__ (((((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 + 3] << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 + 2]) << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 + 1]) << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 0 ]) , __extension__ (((((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 + 3] << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 + 2]) << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 + 1]) << 8 | ((__const unsigned char *) (__const char *) ( "Unknown" ))[ 4 ]) , strlen ( "Unknown" ) + 1) : (char *) memcpy ( data->data_track[index].track_name , "Unknown" , strlen ( "Unknown" ) + 1)) : strcpy ( data->data_track[index].track_name , "Unknown" ))) ; + } + + return 0; +} + + +int + +cddb_generate_new_entry(int cd_desc, struct disc_data *data) + + + + + +{ + struct disc_data outdata; + + if(cddb_read_data(cd_desc, data) < 0) + cddb_generate_unknown_entry(cd_desc, data); + + memcpy(&outdata, data, sizeof(struct disc_data)); + cddb_write_disc_data(cd_desc, outdata); + + return 0; +} + + +int + +cddb_read_disc_data(int cd_desc, struct disc_data *outdata) + + + + + +{ + FILE *cddb_data; + int index; + char root_dir[256], file[256], inbuffer[512]; + struct disc_info disc; + struct stat st; + struct __unprocessed_disc_data data; + + if(getenv("HOME") == ((void *)0) ) { + (__extension__ (__builtin_constant_p ( "$HOME is not set!" ) && __builtin_constant_p ( 256 ) ? (strlen ( "$HOME is not set!" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , "$HOME is not set!" , 256 ) : strncpy ( cddb_message , "$HOME is not set!" , 256 )) : strncpy ( cddb_message , "$HOME is not set!" , 256 ))) ; + return -1; + } + + snprintf(root_dir, 256, "%s/.cddb", getenv("HOME")); + + if(stat(root_dir, &st) < 0) { + if((*__errno_location ()) != 2 ) + return -1; + else { + cddb_generate_new_entry(cd_desc, outdata); + + return 0; + } + } else { + if(! ((( ( st.st_mode ) ) & 0170000 ) == ( 0040000 )) ) { + (*__errno_location ()) = 20 ; + return -1; + } + } + + if(cd_stat(cd_desc, &disc) < 0) + return -1; + + if((data.data_id = __internal_cddb_discid(disc)) < 0) + return -1; + + if(cdindex_discid(cd_desc, data.data_cdindex_id, 30 ) < 0) + return -1; + + data.data_art.art_present = 0; + data.data_title_index = 0; + data.data_extended_index = 0; + for(index = 0; index < disc.disc_total_tracks; index++) { + data.data_track[index].track_name_index = 0; + data.data_track[index].track_extended_index = 0; + } + + for(index = 0; index < 12; index++) { + snprintf(file, 256, "%s/%s/%08lx", root_dir, cddb_genre(index), data.data_id); + if(stat(file, &st) == 0) { + cddb_data = fopen(file, "r"); + while(!feof(cddb_data)) { + fgets(inbuffer, 512, cddb_data); + cddb_process_line(inbuffer, &data); + } + + data.data_genre = index; + fclose(cddb_data); + + data_format_input(outdata, data, disc.disc_total_tracks); + + return 0; + } + } + + if(cddb_read_data(cd_desc, outdata) < 0) + cddb_generate_new_entry(cd_desc, outdata); + + return 0; +} + + +int + +cddb_write_disc_data(int cd_desc, struct disc_data indata) + + + + + +{ + FILE *cddb_data; + int index, tracks; + char root_dir[256], genre_dir[256], file[256]; + struct stat st; + struct disc_info disc; + struct __unprocessed_disc_data data; + + if(getenv("HOME") == ((void *)0) ) { + (__extension__ (__builtin_constant_p ( "$HOME is not set!" ) && __builtin_constant_p ( 256 ) ? (strlen ( "$HOME is not set!" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , "$HOME is not set!" , 256 ) : strncpy ( cddb_message , "$HOME is not set!" , 256 )) : strncpy ( cddb_message , "$HOME is not set!" , 256 ))) ; + return -1; + } + + if(cd_stat(cd_desc, &disc) < 0) + return -1; + + data_format_output(&data, indata, disc.disc_total_tracks); + + snprintf(root_dir, 256, "%s/.cddb", getenv("HOME")); + snprintf(genre_dir, 256, "%s/%s", root_dir, cddb_genre(data.data_genre)); + snprintf(file, 256, "%s/%08lx", genre_dir, data.data_id); + + if(stat(root_dir, &st) < 0) { + if((*__errno_location ()) != 2 ) + return -1; + else + mkdir(root_dir, 0755); + } else { + if(! ((( ( st.st_mode ) ) & 0170000 ) == ( 0040000 )) ) { + (*__errno_location ()) = 20 ; + return -1; + } + } + + if(stat(genre_dir, &st) < 0) { + if((*__errno_location ()) != 2 ) + return -1; + else + mkdir(genre_dir, 0755); + } else { + if(! ((( ( st.st_mode ) ) & 0170000 ) == ( 0040000 )) ) { + (*__errno_location ()) = 20 ; + return -1; + } + } + + if((cddb_data = fopen(file, "w")) == ((void *)0) ) + return -1; + + fprintf(cddb_data, "# xmcd CD database file generated by %s %s\n", "libcdaudio" , "0.99.1" ); + fputs("# \n", cddb_data); + fputs("# Track frame offsets:\n", cddb_data); + for(index = 0; index < disc.disc_total_tracks; index++) + fprintf(cddb_data, "# %d\n", (disc.disc_track[index].track_pos.minutes * 60 + disc.disc_track[index].track_pos.seconds) * 75 + disc.disc_track[index].track_pos.frames); + fputs("# \n", cddb_data); + fprintf(cddb_data, "# Disc length: %d seconds\n", disc.disc_length.minutes * 60 + disc.disc_length.seconds); + fputs("# \n", cddb_data); + fprintf(cddb_data, "# Revision: %d\n", data.data_revision); + fprintf(cddb_data, "# Submitted via: %s %s\n", "libcdaudio" , "0.99.1" ); + fputs("# \n", cddb_data); + fprintf(cddb_data, "DISCID=%08lx\n", data.data_id); + for(index = 0; index < data.data_title_index; index++) + fprintf(cddb_data, "DTITLE=%s\n", data.data_title[index]); + for(tracks = 0; tracks < disc.disc_total_tracks; tracks++) { + for(index = 0; index < data.data_track[tracks].track_name_index; index++) + fprintf(cddb_data, "TTITLE%d=%s\n", tracks, data.data_track[tracks].track_name[index]); + } + if(data.data_extended_index == 0) + fputs("EXTD=\n", cddb_data); + else { + for(index = 0; index < data.data_extended_index; index++) + fprintf(cddb_data, "EXTD=%s\n", data.data_extended[index]); + } + + for(tracks = 0; tracks < disc.disc_total_tracks; tracks++) { + if(data.data_track[tracks].track_extended_index == 0) + fprintf(cddb_data, "EXTT%d=\n", tracks); + else { + for(index = 0; index < data.data_track[tracks].track_extended_index; index++) + fprintf(cddb_data, "EXTT%d=%s\n", tracks, data.data_track[tracks].track_extended[index]); + } + } + + fputs("PLAYORDER=", cddb_data); + + fclose(cddb_data); + + return 0; +} + + +int + +cddb_erase_entry(struct disc_data data) + + + + +{ + char root_dir[256], genre_dir[256], file[256]; + struct stat st; + + if(getenv("HOME") == ((void *)0) ) { + (__extension__ (__builtin_constant_p ( "$HOME is not set!" ) && __builtin_constant_p ( 256 ) ? (strlen ( "$HOME is not set!" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , "$HOME is not set!" , 256 ) : strncpy ( cddb_message , "$HOME is not set!" , 256 )) : strncpy ( cddb_message , "$HOME is not set!" , 256 ))) ; + return -1; + } + + snprintf(root_dir, 256, "%s/.cddb", getenv("HOME")); + snprintf(genre_dir, 256, "%s/%s", root_dir, cddb_genre(data.data_genre)); + snprintf(file, 256, "%s/%08lx", genre_dir, data.data_id); + + if(stat(root_dir, &st) < 0) { + if((*__errno_location ()) != 2 ) + return -1; + else + return 0; + } else { + if(! ((( ( st.st_mode ) ) & 0170000 ) == ( 0040000 )) ) + return 0; + } + + if(stat(genre_dir, &st) < 0) { + if((*__errno_location ()) != 2 ) + return -1; + else + return 0; + } else { + if(! ((( ( st.st_mode ) ) & 0170000 ) == ( 0040000 )) ) + return 0; + } + + if(unlink(file) < 0) { + if((*__errno_location ()) != 2 ) + return -1; + } + + return 0; +} + + +int + +cddb_stat_disc_data(int cd_desc, struct cddb_entry *entry) + + + + + +{ + int index; + struct disc_info disc; + struct stat st; + char root_dir[256], file[256]; + + if(getenv("HOME") == ((void *)0) ) { + (__extension__ (__builtin_constant_p ( "$HOME is not set!" ) && __builtin_constant_p ( 256 ) ? (strlen ( "$HOME is not set!" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , "$HOME is not set!" , 256 ) : strncpy ( cddb_message , "$HOME is not set!" , 256 )) : strncpy ( cddb_message , "$HOME is not set!" , 256 ))) ; + return -1; + } + + if(cd_stat(cd_desc, &disc) < 0) + return -1; + + if((entry->entry_id = __internal_cddb_discid(disc)) < 0) + return -1; + + if(cdindex_discid(cd_desc, entry->entry_cdindex_id, 30 ) < 0) + return -1; + + snprintf(root_dir, 256, "%s/.cddb", getenv("HOME")); + + if(stat(root_dir, &st) < 0) { + if((*__errno_location ()) != 2 ) + return -1; + else { + entry->entry_present = 0; + return 0; + } + } else { + if(! ((( ( st.st_mode ) ) & 0170000 ) == ( 0040000 )) ) { + (*__errno_location ()) = 20 ; + return -1; + } + } + + for(index = 0; index < 12; index++) { + snprintf(file, 256, "%s/%s/%08lx", root_dir, cddb_genre(index), entry->entry_id); + if(stat(file, &st) == 0) { + entry->entry_timestamp = st.st_mtime; + entry->entry_present = 1; + entry->entry_genre = index; + + return 0; + } + } + + entry->entry_present = 0; + + return 0; +} + + +int + +cddb_http_query(int cd_desc, struct cddb_host host, struct cddb_hello hello, struct cddb_query *query) + + + + + + + +{ + int sock; + char http_string[512]; + + if((sock = cddb_connect_server(host, ((void *)0) , hello, http_string, 512)) < 0) + return -1; + + if(cddb_query(cd_desc, sock, 1 , query, http_string) < 0) + return -1; + + shutdown(sock, 2); + close(sock); + + return 0; +} + + +int + +cddb_http_proxy_query(int cd_desc, struct cddb_host host, struct cddb_server proxy, struct cddb_hello hello, struct cddb_query *query) + + + + + + + + +{ + int sock; + char http_string[512]; + + if((sock = cddb_connect_server(host, &proxy, hello, http_string, 512)) < 0) + return -1; + + if(cddb_query(cd_desc, sock, 1 , query, http_string) < 0) + return -1; + + shutdown(sock, 2); + close(sock); + + return 0; +} + + +int + +cddb_http_read(int cd_desc, struct cddb_host host, struct cddb_hello hello, struct cddb_entry entry, struct disc_data *data) + + + + + + + + +{ + int sock; + char http_string[512]; + + if((sock = cddb_connect_server(host, ((void *)0) , hello, http_string, 512)) < 0) + return -1; + + if(cddb_read(cd_desc, sock, 1 , entry, data, http_string) < 0) + return -1; + + shutdown(sock, 2); + close(sock); + + return 0; +} + + +int + + + +cddb_http_proxy_read(cd_desc, host, proxy, hello, entry, data) + int cd_desc; + struct cddb_host host; + struct cddb_server proxy; + struct cddb_hello hello; + struct cddb_entry entry; + struct disc_data *data; + +{ + int sock; + char http_string[512]; + + if((sock = cddb_connect_server(host, &proxy, hello, http_string, 512)) < 0) + return -1; + + if(cddb_read(cd_desc, sock, 1 , entry, data, http_string) < 0) + return -1; + + shutdown(sock, 2); + close(sock); + + return 0; +} + +int + +cddb_http_sites(int cd_desc, struct cddb_host host, struct cddb_hello hello, struct cddb_serverlist *list) + + + + + + + +{ + int sock; + char http_string[512]; + + if((sock = cddb_connect_server(host, ((void *)0) , hello, http_string, 512)) < 0) + return -1; + + if(cddb_sites(cd_desc, 1 , list, http_string) < 0) + return -1; + + shutdown(sock, 2); + close(sock); + + return 0; +} + +int + +cddb_http_proxy_sites(int cd_desc, struct cddb_host host, struct cddb_server proxy, struct cddb_hello hello, struct cddb_serverlist *list) + + + + + + + + +{ + int sock; + char http_string[512]; + + if((sock = cddb_connect_server(host, &proxy, hello, http_string, 512)) < 0) + return -1; + + if(cddb_sites(cd_desc, 1 , list, http_string) < 0) + return -1; + + shutdown(sock, 2); + close(sock); + + return 0; +} + +int + +cddb_http_submit(int cd_desc, struct cddb_host host, struct cddb_server *proxy, char *email_address) + + + + + + + +{ + FILE *cddb_entry; + int sock, index, changed_artist = 0, changed_track[100 ], token[3], error = 0; + char inbuffer[512], outbuffer[512], cddb_file[512], *home; + struct stat st; + struct cddb_entry entry; + struct disc_info disc; + struct disc_data data; + + if((home = getenv("HOME")) == ((void *)0) ) { + (__extension__ (__builtin_constant_p ( "$HOME is not set!" ) && __builtin_constant_p ( 256 ) ? (strlen ( "$HOME is not set!" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , "$HOME is not set!" , 256 ) : strncpy ( cddb_message , "$HOME is not set!" , 256 )) : strncpy ( cddb_message , "$HOME is not set!" , 256 ))) ; + return -1; + } + + if(cd_stat(cd_desc, &disc) < 0) + return -1; + + if(!disc.disc_present) + return -1; + + if(cddb_stat_disc_data(cd_desc, &entry) < 0) + return -1; + + if(entry.entry_present) { + if(cddb_read_disc_data(cd_desc, &data) < 0) + return -1; + } else { + (__extension__ (__builtin_constant_p ( "No CDDB entry present in cache" ) && __builtin_constant_p ( 256 ) ? (strlen ( "No CDDB entry present in cache" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , "No CDDB entry present in cache" , 256 ) : strncpy ( cddb_message , "No CDDB entry present in cache" , 256 )) : strncpy ( cddb_message , "No CDDB entry present in cache" , 256 ))) ; + return -1; + } + + if(proxy != ((void *)0) ) { + if((sock = cddb_connect(proxy)) < 0) { + (__extension__ (__builtin_constant_p ( strerror((*__errno_location ()) ) ) && __builtin_constant_p ( 256 ) ? (strlen ( strerror((*__errno_location ()) ) ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , strerror((*__errno_location ()) ) , 256 ) : strncpy ( cddb_message , strerror((*__errno_location ()) ) , 256 )) : strncpy ( cddb_message , strerror((*__errno_location ()) ) , 256 ))) ; + return -1; + } + } else { + if((sock = cddb_connect(&host.host_server)) < 0) { + (__extension__ (__builtin_constant_p ( strerror((*__errno_location ()) ) ) && __builtin_constant_p ( 256 ) ? (strlen ( strerror((*__errno_location ()) ) ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , strerror((*__errno_location ()) ) , 256 ) : strncpy ( cddb_message , strerror((*__errno_location ()) ) , 256 )) : strncpy ( cddb_message , strerror((*__errno_location ()) ) , 256 ))) ; + return -1; + } + } + + if(strlen(data.data_title) < 1 || __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( data.data_title ) && __builtin_constant_p ( "Unknown" ) && (__s1_len = strlen ( data.data_title ), __s2_len = strlen ( "Unknown" ), (! ((size_t)(const void *)(( data.data_title ) + 1) - (size_t)(const void *)( data.data_title ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "Unknown" ) + 1) - (size_t)(const void *)( "Unknown" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( data.data_title ), (__const char *) ( "Unknown" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( data.data_title ) && ((size_t)(const void *)(( data.data_title ) + 1) - (size_t)(const void *)( data.data_title ) == 1) && (__s1_len = strlen ( data.data_title ), __s1_len < 4) ? (__builtin_constant_p ( "Unknown" ) && ((size_t)(const void *)(( "Unknown" ) + 1) - (size_t)(const void *)( "Unknown" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( data.data_title ))[0] - ((__const unsigned char *) (__const char *)( "Unknown" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_title ))[1] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_title ))[2] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( data.data_title ))[3] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "Unknown" ); register int __result = (((__const unsigned char *) (__const char *) ( data.data_title ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_title ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_title ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( data.data_title ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "Unknown" ) && ((size_t)(const void *)(( "Unknown" ) + 1) - (size_t)(const void *)( "Unknown" ) == 1) && (__s2_len = strlen ( "Unknown" ), __s2_len < 4) ? (__builtin_constant_p ( data.data_title ) && ((size_t)(const void *)(( data.data_title ) + 1) - (size_t)(const void *)( data.data_title ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( data.data_title ))[0] - ((__const unsigned char *) (__const char *)( "Unknown" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_title ))[1] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_title ))[2] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( data.data_title ))[3] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( data.data_title ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[3]); } } __result; })) ) : strcmp ( data.data_title , "Unknown" )))); }) == 0) { + (__extension__ (__builtin_constant_p ( "Edit the disc title before submission." ) && __builtin_constant_p ( 256 ) ? (strlen ( "Edit the disc title before submission." ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , "Edit the disc title before submission." , 256 ) : strncpy ( cddb_message , "Edit the disc title before submission." , 256 )) : strncpy ( cddb_message , "Edit the disc title before submission." , 256 ))) ; + return -1; + } + + if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( data.data_artist ) && __builtin_constant_p ( "Unknown" ) && (__s1_len = strlen ( data.data_artist ), __s2_len = strlen ( "Unknown" ), (! ((size_t)(const void *)(( data.data_artist ) + 1) - (size_t)(const void *)( data.data_artist ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "Unknown" ) + 1) - (size_t)(const void *)( "Unknown" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( data.data_artist ), (__const char *) ( "Unknown" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( data.data_artist ) && ((size_t)(const void *)(( data.data_artist ) + 1) - (size_t)(const void *)( data.data_artist ) == 1) && (__s1_len = strlen ( data.data_artist ), __s1_len < 4) ? (__builtin_constant_p ( "Unknown" ) && ((size_t)(const void *)(( "Unknown" ) + 1) - (size_t)(const void *)( "Unknown" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( data.data_artist ))[0] - ((__const unsigned char *) (__const char *)( "Unknown" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_artist ))[1] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_artist ))[2] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( data.data_artist ))[3] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "Unknown" ); register int __result = (((__const unsigned char *) (__const char *) ( data.data_artist ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_artist ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_artist ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( data.data_artist ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "Unknown" ) && ((size_t)(const void *)(( "Unknown" ) + 1) - (size_t)(const void *)( "Unknown" ) == 1) && (__s2_len = strlen ( "Unknown" ), __s2_len < 4) ? (__builtin_constant_p ( data.data_artist ) && ((size_t)(const void *)(( data.data_artist ) + 1) - (size_t)(const void *)( data.data_artist ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( data.data_artist ))[0] - ((__const unsigned char *) (__const char *)( "Unknown" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_artist ))[1] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_artist ))[2] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( data.data_artist ))[3] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( data.data_artist ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[3]); } } __result; })) ) : strcmp ( data.data_artist , "Unknown" )))); }) == 0) { + (__extension__ (__builtin_constant_p ( "" ) && __builtin_constant_p ( 256 ) ? (strlen ( "" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( data.data_artist , "" , 256 ) : strncpy ( data.data_artist , "" , 256 )) : strncpy ( data.data_artist , "" , 256 ))) ; + changed_artist = 1; + } + + for(index = 0; index < disc.disc_total_tracks; index++) { + changed_track[index] = 0; + if(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( data.data_track[index].track_name ) && __builtin_constant_p ( "Unknown" ) && (__s1_len = strlen ( data.data_track[index].track_name ), __s2_len = strlen ( "Unknown" ), (! ((size_t)(const void *)(( data.data_track[index].track_name ) + 1) - (size_t)(const void *)( data.data_track[index].track_name ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "Unknown" ) + 1) - (size_t)(const void *)( "Unknown" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( data.data_track[index].track_name ), (__const char *) ( "Unknown" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( data.data_track[index].track_name ) && ((size_t)(const void *)(( data.data_track[index].track_name ) + 1) - (size_t)(const void *)( data.data_track[index].track_name ) == 1) && (__s1_len = strlen ( data.data_track[index].track_name ), __s1_len < 4) ? (__builtin_constant_p ( "Unknown" ) && ((size_t)(const void *)(( "Unknown" ) + 1) - (size_t)(const void *)( "Unknown" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( data.data_track[index].track_name ))[0] - ((__const unsigned char *) (__const char *)( "Unknown" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_track[index].track_name ))[1] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_track[index].track_name ))[2] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( data.data_track[index].track_name ))[3] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "Unknown" ); register int __result = (((__const unsigned char *) (__const char *) ( data.data_track[index].track_name ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_track[index].track_name ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_track[index].track_name ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( data.data_track[index].track_name ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "Unknown" ) && ((size_t)(const void *)(( "Unknown" ) + 1) - (size_t)(const void *)( "Unknown" ) == 1) && (__s2_len = strlen ( "Unknown" ), __s2_len < 4) ? (__builtin_constant_p ( data.data_track[index].track_name ) && ((size_t)(const void *)(( data.data_track[index].track_name ) + 1) - (size_t)(const void *)( data.data_track[index].track_name ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( data.data_track[index].track_name ))[0] - ((__const unsigned char *) (__const char *)( "Unknown" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_track[index].track_name ))[1] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( data.data_track[index].track_name ))[2] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( data.data_track[index].track_name ))[3] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( data.data_track[index].track_name ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "Unknown" ))[3]); } } __result; })) ) : strcmp ( data.data_track[index].track_name , "Unknown" )))); }) == 0) { + snprintf(data.data_track[index].track_name, 256, "Track %d", index); + changed_track[index] = 1; + } + } + + cddb_write_disc_data(cd_desc, data); + + if(cddb_submit_method == 1 ) { + snprintf(outbuffer, 512, "cat %s/.cddb/%s/%08lx | mail -s \"cddb %s %08lx\" %s", home, cddb_genre(data.data_genre), data.data_id, cddb_genre(data.data_genre), data.data_id, cddb_submit_email_address); + if(system(outbuffer) != 0) + return -1; + return 0; + } + + if(proxy != ((void *)0) ) + snprintf(outbuffer, 512, "POST http://%s:%d%s HTTP/1.0\n", host.host_server.server_name, host.host_server.server_port, "/~cddb/submit.cgi" ); + else + snprintf(outbuffer, 512, "POST %s HTTP/1.0\n", "/~cddb/submit.cgi" ); + write(sock, outbuffer, strlen(outbuffer)); + + snprintf(outbuffer, 512, "Category: %s\n", cddb_genre(data.data_genre)); + write(sock, outbuffer, strlen(outbuffer)); + + snprintf(outbuffer, 512, "Discid: %08lx\n", data.data_id); + write(sock, outbuffer, strlen(outbuffer)); + + snprintf(outbuffer, 512, "User-Email: %s\n", email_address); + write(sock, outbuffer, strlen(outbuffer)); + + snprintf(outbuffer, 512, "Submit-Mode: %s\n", 0 ? "submit" : "test"); + write(sock, outbuffer, strlen(outbuffer)); + + (__extension__ (__builtin_constant_p ( "X-Cddbd-Note: Submission problems? E-mail libcdaudio@gjhsnews.mesa.k12.co.us\n" ) && __builtin_constant_p ( 512 ) ? (strlen ( "X-Cddbd-Note: Submission problems? E-mail libcdaudio@gjhsnews.mesa.k12.co.us\n" ) + 1 >= ((size_t) ( 512 )) ? (char *) memcpy ( outbuffer , "X-Cddbd-Note: Submission problems? E-mail libcdaudio@gjhsnews.mesa.k12.co.us\n" , 512 ) : strncpy ( outbuffer , "X-Cddbd-Note: Submission problems? E-mail libcdaudio@gjhsnews.mesa.k12.co.us\n" , 512 )) : strncpy ( outbuffer , "X-Cddbd-Note: Submission problems? E-mail libcdaudio@gjhsnews.mesa.k12.co.us\n" , 512 ))) ; + write(sock, outbuffer, strlen(outbuffer)); + + snprintf(cddb_file, 512, "%s/.cddb/%s/%08lx", getenv("HOME"), cddb_genre(data.data_genre), data.data_id); + stat(cddb_file, &st); + + snprintf(outbuffer, 512, "Content-Length: %d\n\n", (int) st.st_size); + write(sock, outbuffer, strlen(outbuffer)); + + cddb_entry = fopen(cddb_file, "r"); + while(!feof(cddb_entry)) { + fgets(outbuffer, 512, cddb_entry); + write(sock, outbuffer, strlen(outbuffer)); + } + + cddb_read_line(sock, inbuffer, 512); + if((__extension__ (__builtin_constant_p ( 3 ) && ((__builtin_constant_p ( inbuffer + 9 ) && strlen ( inbuffer + 9 ) < ((size_t) ( 3 ))) || (__builtin_constant_p ( "200" ) && strlen ( "200" ) < ((size_t) ( 3 )))) ? __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( inbuffer + 9 ) && __builtin_constant_p ( "200" ) && (__s1_len = strlen ( inbuffer + 9 ), __s2_len = strlen ( "200" ), (! ((size_t)(const void *)(( inbuffer + 9 ) + 1) - (size_t)(const void *)( inbuffer + 9 ) == 1) || __s1_len >= 4) && (! ((size_t)(const void *)(( "200" ) + 1) - (size_t)(const void *)( "200" ) == 1) || __s2_len >= 4)) ? memcmp ((__const char *) ( inbuffer + 9 ), (__const char *) ( "200" ), (__s1_len < __s2_len ? __s1_len : __s2_len) + 1) : (__builtin_constant_p ( inbuffer + 9 ) && ((size_t)(const void *)(( inbuffer + 9 ) + 1) - (size_t)(const void *)( inbuffer + 9 ) == 1) && (__s1_len = strlen ( inbuffer + 9 ), __s1_len < 4) ? (__builtin_constant_p ( "200" ) && ((size_t)(const void *)(( "200" ) + 1) - (size_t)(const void *)( "200" ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( inbuffer + 9 ))[0] - ((__const unsigned char *) (__const char *)( "200" ))[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( inbuffer + 9 ))[1] - ((__const unsigned char *) (__const char *) ( "200" ))[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( inbuffer + 9 ))[2] - ((__const unsigned char *) (__const char *) ( "200" ))[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( inbuffer + 9 ))[3] - ((__const unsigned char *) (__const char *) ( "200" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ( "200" ); register int __result = (((__const unsigned char *) (__const char *) ( inbuffer + 9 ))[0] - __s2[0]); if ( __s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( inbuffer + 9 ))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( inbuffer + 9 ))[2] - __s2[2]); if ( __s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( inbuffer + 9 ))[3] - __s2[3]); } } __result; })) ) : (__builtin_constant_p ( "200" ) && ((size_t)(const void *)(( "200" ) + 1) - (size_t)(const void *)( "200" ) == 1) && (__s2_len = strlen ( "200" ), __s2_len < 4) ? (__builtin_constant_p ( inbuffer + 9 ) && ((size_t)(const void *)(( inbuffer + 9 ) + 1) - (size_t)(const void *)( inbuffer + 9 ) == 1) ? (__extension__ ({ register int __result = (((__const unsigned char *) (__const char *) ( inbuffer + 9 ))[0] - ((__const unsigned char *) (__const char *)( "200" ))[0]); if ( __s2_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( inbuffer + 9 ))[1] - ((__const unsigned char *) (__const char *) ( "200" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ( inbuffer + 9 ))[2] - ((__const unsigned char *) (__const char *) ( "200" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ( inbuffer + 9 ))[3] - ((__const unsigned char *) (__const char *) ( "200" ))[3]); } } __result; })) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ( inbuffer + 9 ); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ( "200" ))[0]; if ( __s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ( "200" ))[1]); if ( __s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ( "200" ))[2]); if ( __s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ( "200" ))[3]); } } __result; })) ) : strcmp ( inbuffer + 9 , "200" )))); }) : strncmp ( inbuffer + 9 , "200" , 3 ))) != 0) { + (__extension__ (__builtin_constant_p ( inbuffer ) && __builtin_constant_p ( 256 ) ? (strlen ( inbuffer ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( cddb_message , inbuffer , 256 ) : strncpy ( cddb_message , inbuffer , 256 )) : strncpy ( cddb_message , inbuffer , 256 ))) ; + return -1; + } + + cddb_skip_http_header(sock); + + if(cddb_read_token(sock, token) < 0) + error = 1; + + if(token[0] != 2) + error = 1; + + shutdown(sock, 2); + close(sock); + + if(changed_artist) + (__extension__ (__builtin_constant_p ( "Unknown" ) && __builtin_constant_p ( 256 ) ? (strlen ( "Unknown" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( data.data_artist , "Unknown" , 256 ) : strncpy ( data.data_artist , "Unknown" , 256 )) : strncpy ( data.data_artist , "Unknown" , 256 ))) ; + + for(index = 0; index < disc.disc_total_tracks; index++) + if(changed_track[index]) + (__extension__ (__builtin_constant_p ( "Unknown" ) && __builtin_constant_p ( 256 ) ? (strlen ( "Unknown" ) + 1 >= ((size_t) ( 256 )) ? (char *) memcpy ( data.data_track[index].track_name , "Unknown" , 256 ) : strncpy ( data.data_track[index].track_name , "Unknown" , 256 )) : strncpy ( data.data_track[index].track_name , "Unknown" , 256 ))) ; + + data.data_revision++; + cddb_write_disc_data(cd_desc, data); + + if(error) + return -1; + + return 0; +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-46886/cddb.s +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-46886/cddb.s @@ -0,0 +1,2355 @@ + .file "cddb.c" + .version "01.01" +gcc2_compiled.: +.globl parse_disc_artist +.data + .align 4 + .type parse_disc_artist,@object + .size parse_disc_artist,4 +parse_disc_artist: + .long 1 +.globl cddb_submit_method + .align 4 + .type cddb_submit_method,@object + .size cddb_submit_method,4 +cddb_submit_method: + .long 1 +.globl cddb_submit_email_address +.section .rodata +.LC0: + .string "freedb-submit@freedb.org" +.data + .align 4 + .type cddb_submit_email_address,@object + .size cddb_submit_email_address,4 +cddb_submit_email_address: + .long .LC0 +.section .rodata +.LC1: + .string "%lu" +.text + .align 4 +.globl __internal_cddb_discid + .type __internal_cddb_discid,@function +__internal_cddb_discid: + pushl %ebp + movl %esp,%ebp + subl $44,%esp + pushl %edi + pushl %esi + pushl %ebx + call .L199 +.L199: + popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-.L199],%ebx + movl 60(%ebp),%esi + xorl %edi,%edi + movl %edi,-20(%ebp) + cmpl %esi,%edi + jge .L188 + leal 80(%ebp),%eax + movl %eax,-24(%ebp) + leal -16(%ebp),%ecx + movl %ecx,-28(%ebp) + .p2align 4,,7 +.L190: + movl -20(%ebp),%eax + movl -24(%ebp),%ecx + sall $5,%eax + xorl %esi,%esi + movl 76(%eax,%ebp),%edx + sall $4,%edx + subl 76(%eax,%ebp),%edx + movl (%eax,%ecx),%eax + leal (%eax,%edx,4),%edx + pushl %edx + leal .LC1@GOTOFF(%ebx),%eax + pushl %eax + pushl $16 + movl -28(%ebp),%eax + pushl %eax + call snprintf@PLT + movl -28(%ebp),%edx + movl -20(%ebp),%ecx + addl $16,%esp + incl %ecx + cmpb $0,-16(%ebp) + je .L195 + .p2align 4,,7 +.L193: + movsbl (%edx),%eax + incl %edx + leal -48(%eax,%esi),%esi + cmpb $0,(%edx) + jne .L193 +.L195: + addl %esi,%edi + movl 60(%ebp),%esi + movl %ecx,-20(%ebp) + cmpl %esi,%ecx + jl .L190 +.L188: + movl 40(%ebp),%ecx + movl 44(%ebp),%eax + sall $4,%ecx + subl 40(%ebp),%ecx + leal (%eax,%ecx,4),%ecx + movl 76(%ebp),%eax + movl 80(%ebp),%edx + sall $4,%eax + subl 76(%ebp),%eax + leal (%edx,%eax,4),%eax + subl %eax,%ecx + movl $-2139062143,%edx + movl %edx,%eax + imull %edi + sall $8,%ecx + addl %edi,%edx + sarl $7,%edx + movl %edi,%eax + sarl $31,%eax + subl %eax,%edx + movl %edx,%eax + sall $8,%eax + subl %edx,%eax + subl %eax,%edi + sall $24,%edi + orl %ecx,%edi + orl %esi,%edi + movl %edi,%eax + leal -56(%ebp),%esp + popl %ebx + popl %esi + popl %edi + movl %ebp,%esp + popl %ebp + ret +.Lfe1: + .size __internal_cddb_discid,.Lfe1-__internal_cddb_discid +.section .rodata +.LC2: + .string "Invalid URL" +.LC3: + .string ":" +.LC4: + .string "cddbp" +.LC5: + .string "http" +.LC6: + .string "%s: invalid protocol" +.LC7: + .string "" +.text + .align 4 +.globl cddb_process_url + .type cddb_process_url,@function +cddb_process_url: + pushl %ebp + movl %esp,%ebp + subl $1052,%esp + pushl %edi + pushl %esi + pushl %ebx + call .L321 +.L321: + popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-.L321],%ebx + movl 12(%ebp),%esi + movl $0,-1028(%ebp) + addl $-8,%esp + pushl $58 + pushl %esi + call strchr@PLT + addl $16,%esp + testl %eax,%eax + jne .L211 + addl $-4,%esp + pushl $256 + leal .LC2@GOTOFF(%ebx),%eax + pushl %eax + movl cddb_message@GOT(%ebx),%eax + pushl %eax + call strncpy@PLT + movl $-1,%eax + jmp .L203 + .p2align 4,,7 +.L211: + addl $-4,%esp + pushl $512 + pushl %esi + leal -512(%ebp),%eax + movl %eax,-1044(%ebp) + pushl %eax + call strncpy@PLT + addl $16,%esp + addl $-8,%esp + leal .LC3@GOTOFF(%ebx),%edx + movl %edx,-1032(%ebp) + pushl %edx + movl -1044(%ebp),%ecx + pushl %ecx + call strtok@PLT + movl -1044(%ebp),%esi + leal .LC4@GOTOFF(%ebx),%edx + movl %edx,%edi + movl -1032(%ebp),%edx + addl $16,%esp + movl $6,%ecx + cld + xorl %eax,%eax + repz + cmpsb + je .L322 + sbbl %eax,%eax + orb $1,%al +.L322: + movl %edx,-1040(%ebp) + testl %eax,%eax + jne .L261 + movl 8(%ebp),%ecx + movl $0,516(%ecx) + jmp .L267 + .p2align 4,,7 +.L261: + movl -1044(%ebp),%esi + leal .LC5@GOTOFF(%ebx),%eax + movl %eax,%edi + movl $5,%ecx + cld + testb $0,%al + repz + cmpsb + je .L265 + movl -1044(%ebp),%eax + pushl %eax + leal .LC6@GOTOFF(%ebx),%eax + pushl %eax + movl cddb_message@GOT(%ebx),%eax + pushl $256 + pushl %eax + call snprintf@PLT + movl $-1,%eax + jmp .L318 + .p2align 4,,7 +.L265: + movl 8(%ebp),%edx + movl $1,516(%edx) +.L267: + addl $-4,%esp + pushl $256 + movl -1040(%ebp),%ecx + addl $-8,%esp + pushl %ecx + pushl $0 + call strtok@PLT + addl $16,%esp + addl $2,%eax + pushl %eax + leal -768(%ebp),%edi + movl %edi,-1036(%ebp) + pushl %edi + call strncpy@PLT + movl -1040(%ebp),%eax + addl $16,%esp + addl $-8,%esp + pushl %eax + pushl $0 + call strtok@PLT + movl %eax,%edi + addl $16,%esp + testl %edi,%edi + je .L271 + addl $-4,%esp + pushl $256 + leal -768(%ebp),%edx + pushl %edx + movl 8(%ebp),%ecx + pushl %ecx + call strncpy@PLT + movl 8(%ebp),%esi + addl $16,%esp + movl $0,-1028(%ebp) + leal -1024(%ebp),%edx + addl $260,%esi + .p2align 4,,7 +.L279: + movl -1028(%ebp),%ecx + movb (%edi),%al + movb %al,-1024(%ecx,%ebp) + incl %ecx + incl %edi + movl %ecx,-1028(%ebp) + movb (%edi),%al + cmpb $47,%al + je .L277 + cmpb $10,%al + je .L277 + testb %al,%al + jne .L279 +.L277: + movl -1028(%ebp),%eax + movb $0,(%eax,%edx) + pushl $0 + pushl $10 + pushl $0 + pushl %edx + call __strtol_internal@PLT + movl 8(%ebp),%edx + addl $16,%esp + movl %eax,256(%edx) + cmpb $47,(%edi) + jne .L282 + incl %edi +.L282: + movb (%edi),%al + cmpb $10,%al + je .L291 + testb %al,%al + je .L291 + addl $-4,%esp + pushl $256 + pushl %edi + jmp .L319 + .p2align 4,,7 +.L291: + addl $-4,%esp + pushl $256 + leal .LC7@GOTOFF(%ebx),%eax + pushl %eax +.L319: + pushl %esi + call strncpy@PLT + jmp .L293 + .p2align 4,,7 +.L271: + movl 8(%ebp),%esi + movb -768(%ebp),%al + addl $260,%esi + cmpb $47,%al + je .L316 + cmpb $10,%al + je .L295 + testb %al,%al + je .L295 + leal -768(%ebp),%edx + .p2align 4,,7 +.L296: + incl -1028(%ebp) + movl -1028(%ebp),%ecx + movb (%ecx,%edx),%al + cmpb $47,%al + je .L316 + cmpb $10,%al + je .L295 + testb %al,%al + jne .L296 +.L295: + movl -1028(%ebp),%edi + cmpb $47,-768(%edi,%ebp) + jne .L307 +.L316: + addl $-4,%esp + pushl $256 + movl -1028(%ebp),%edx + leal -767(%edx,%ebp),%eax + jmp .L320 + .p2align 4,,7 +.L307: + addl $-4,%esp + pushl $256 + leal .LC7@GOTOFF(%ebx),%eax +.L320: + pushl %eax + pushl %esi + call strncpy@PLT + addl $16,%esp + movl -1028(%ebp),%ecx + movb $0,-768(%ecx,%ebp) + addl $-4,%esp + pushl $256 + leal -768(%ebp),%edi + pushl %edi + movl 8(%ebp),%eax + pushl %eax + call strncpy@PLT + movl 8(%ebp),%edx + cmpl $1,516(%edx) + jne .L313 + movl $80,256(%edx) + jmp .L293 + .p2align 4,,7 +.L313: + movl 8(%ebp),%ecx + movl $888,256(%ecx) +.L293: + xorl %eax,%eax +.L318: +.L203: + leal -1064(%ebp),%esp + popl %ebx + popl %esi + popl %edi + movl %ebp,%esp + popl %ebp + ret +.Lfe2: + .size cddb_process_url,.Lfe2-cddb_process_url +.section .rodata +.LC8: + .string "=" +.LC9: + .string "ACCESS" +.LC10: + .string "LOCAL" +.LC11: + .string "PROXY" +.LC12: + .string "SERVER" +.LC13: + .string " " +.LC14: + .string "CDI" +.LC15: + .string "COVR" +.text + .align 4 + .type cddb_serverlist_process_line,@function +cddb_serverlist_process_line: + pushl %ebp + movl %esp,%ebp + subl $796,%esp + pushl %edi + pushl %esi + pushl %ebx + call .L398 +.L398: + popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-.L398],%ebx + movl 8(%ebp),%edi + addl $-8,%esp + pushl $61 + pushl %edi + call strchr@PLT + addl $16,%esp + testl %eax,%eax + je .L332 + movl %edi,%edx + movl %edi,%eax + addl $-8,%esp + leal .LC8@GOTOFF(%ebx),%esi + andl $3,%edx + je .L399 + jp .L404 + cmpl $2,%edx + je .L405 + cmpb %dh,(%eax) + je .L403 + incl %eax +.L405: + cmpb %dh,(%eax) + je .L403 + incl %eax +.L404: + cmpb %dh,(%eax) + je .L403 + incl %eax +.L399: + movl (%eax),%edx + testb %dh,%dl + jne .L400 + testb %dl,%dl + je .L403 + testb %dh,%dh + je .L402 +.L400: + testl $16711680,%edx + je .L401 + addl $4,%eax + testl $-16777216,%edx + jne .L399 + subl $3,%eax +.L401: + incl %eax +.L402: + incl %eax +.L403: + movb $0,-1(%eax) + pushl %esi + pushl %edi + call strtok@PLT + movl %eax,%edi + addl $16,%esp + testl %edi,%edi + je .L332 + addl $-8,%esp + pushl %esi + pushl $0 + call strtok@PLT + movl %eax,%esi + addl $16,%esp + testl %esi,%esi + jne .L328 + leal .LC7@GOTOFF(%ebx),%esi +.L328: + addl $-8,%esp + leal .LC9@GOTOFF(%ebx),%eax + pushl %eax + pushl %edi + call strcasecmp@PLT + addl $16,%esp + testl %eax,%eax + jne .L329 + addl $-4,%esp + pushl $2 + leal .LC10@GOTOFF(%ebx),%eax + pushl %eax + pushl %esi + call strncasecmp@PLT + testl %eax,%eax + jne .L330 + movl 12(%ebp),%eax + movl $0,(%eax) + jmp .L332 + .p2align 4,,7 +.L330: + movl 12(%ebp),%edx + movl $1,(%edx) + jmp .L332 + .p2align 4,,7 +.L329: + addl $-8,%esp + leal .LC11@GOTOFF(%ebx),%eax + pushl %eax + pushl %edi + call strcasecmp@PLT + addl $16,%esp + testl %eax,%eax + jne .L333 + addl $-8,%esp + pushl %esi + leal -520(%ebp),%esi + pushl %esi + call cddb_process_url@PLT + testl %eax,%eax + jge .L334 + movl $-1,%eax + jmp .L396 + .p2align 4,,7 +.L334: + movl 12(%ebp),%ecx + movl 20(%ebp),%edi + movl $1,4(%ecx) + cld + movl $65,%ecx + rep + movsl + jmp .L332 + .p2align 4,,7 +.L333: + addl $-8,%esp + leal .LC12@GOTOFF(%ebx),%eax + pushl %eax + pushl %edi + call strcasecmp@PLT + addl $16,%esp + testl %eax,%eax + jne .L332 + movl 16(%ebp),%eax + cmpl $127,(%eax) + jg .L332 + addl $-4,%esp + pushl $256 + pushl %esi + leal -776(%ebp),%esi + pushl %esi + call strncpy@PLT + addl $16,%esp + addl $-8,%esp + pushl $32 + pushl %esi + call strchr@PLT + addl $16,%esp + movl %esi,%edi + testl %eax,%eax + je .L342 + addl $-8,%esp + leal .LC13@GOTOFF(%ebx),%esi + pushl %esi + pushl %edi + call strtok@PLT + addl $-8,%esp + pushl %esi + pushl $0 + call strtok@PLT + movl %eax,%esi + addl $32,%esp + jmp .L345 + .p2align 4,,7 +.L342: + xorl %esi,%esi +.L345: + addl $-8,%esp + pushl %edi + movl 16(%ebp),%edx + movl (%edx),%eax + sall $6,%eax + addl (%edx),%eax + leal 4(%edx,%eax,8),%eax + pushl %eax + call cddb_process_url@PLT + cmpl $-1,%eax + je .L332 + testl %esi,%esi + je .L371 + xorl %eax,%eax + movb (%esi),%al + addl $-67,%eax + jne .L356 + xorl %eax,%eax + movb 1(%esi),%al + addl $-68,%eax + jne .L356 + xorl %eax,%eax + movb 2(%esi),%al + addl $-73,%eax + jne .L356 + xorl %eax,%eax + movb 3(%esi),%al +.L356: + testl %eax,%eax + jne .L370 + movl 16(%ebp),%ecx + movl %ecx,%edx + addl $520,%edx + movl (%ecx),%eax + sall $6,%eax + addl (%ecx),%eax + movl $2,(%edx,%eax,8) + jmp .L371 + .p2align 4,,7 +.L370: + testl %esi,%esi + je .L371 + leal .LC15@GOTOFF(%ebx),%edi + movl $5,%ecx + cld + testb $0,%al + repz + cmpsb + jne .L371 + movl 16(%ebp),%edx + movl (%edx),%eax + sall $6,%eax + addl (%edx),%eax + addl $520,%edx + movl $3,(%edx,%eax,8) +.L371: + movl 16(%ebp),%ecx + incl (%ecx) +.L332: + xorl %eax,%eax +.L396: + leal -808(%ebp),%esp + popl %ebx + popl %esi + popl %edi + movl %ebp,%esp + popl %ebp + ret +.Lfe3: + .size cddb_serverlist_process_line,.Lfe3-cddb_serverlist_process_line +.section .rodata +.LC16: + .string "HOME" +.LC17: + .string "$HOME is not set!" +.LC18: + .string "%s/.cdserverrc" +.LC19: + .string "r" +.text + .align 4 +.globl cddb_read_serverlist + .type cddb_read_serverlist,@function +cddb_read_serverlist: + pushl %ebp + movl %esp,%ebp + subl $620,%esp + pushl %edi + pushl %esi + pushl %ebx + call .L429 +.L429: + popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-.L429],%ebx + addl $-12,%esp + leal .LC16@GOTOFF(%ebx),%esi + pushl %esi + call getenv@PLT + addl $16,%esp + testl %eax,%eax + jne .L407 + addl $-4,%esp + pushl $256 + leal .LC17@GOTOFF(%ebx),%eax + pushl %eax + movl cddb_message@GOT(%ebx),%eax + pushl %eax + call strncpy@PLT + movl $-1,%eax + jmp .L406 + .p2align 4,,7 +.L407: + movl 12(%ebp),%eax + movl 8(%ebp),%ecx + movl $0,(%eax) + movl $1,(%ecx) + movl $0,4(%ecx) + addl $-12,%esp + pushl %esi + call getenv@PLT + pushl %eax + leal .LC18@GOTOFF(%ebx),%eax + pushl %eax + pushl $256 + leal -512(%ebp),%esi + pushl %esi + call snprintf@PLT + leal -600(%ebp),%eax + addl $32,%esp + addl $-4,%esp + pushl %eax + pushl %esi + pushl $3 + call __xstat@PLT + addl $16,%esp + testl %eax,%eax + jge .L412 + xorl %eax,%eax + jmp .L406 + .p2align 4,,7 +.L412: + addl $-8,%esp + leal .LC19@GOTOFF(%ebx),%eax + pushl %eax + pushl %esi + call fopen@PLT + movl %eax,-604(%ebp) + addl $16,%esp + leal -256(%ebp),%edi + jmp .L414 + .p2align 4,,7 +.L416: + movl -604(%ebp),%eax + addl $-4,%esp + pushl %eax + pushl $256 + pushl %edi + call fgets@PLT + movl -608(%ebp),%ecx + movb $0,-1(%ebp) + xorl %edx,%edx + movl %edi,%eax + addl $16,%esp +.L430: + movl (%eax),%ecx + testb %ch,%cl + jne .L431 + testb %cl,%cl + je .L434 + testb %ch,%ch + je .L433 +.L431: + testl $16711680,%ecx + je .L432 + addl $4,%eax + testl $-16777216,%ecx + jne .L430 + subl $3,%eax +.L432: + incl %eax +.L433: + incl %eax +.L434: + subl %edi,%eax + cmpl %eax,%esi + jae .L418 + cmpb $35,-256(%ebp) + jne .L419 + movb $0,-256(%ebp) + jmp .L418 + .p2align 4,,7 +.L419: + movl -608(%ebp),%ecx + leal -256(%ebp),%eax + incl %edx +.L435: + movl (%eax),%ecx + testb %ch,%cl + jne .L436 + testb %cl,%cl + je .L439 + testb %ch,%ch + je .L438 +.L436: + testl $16711680,%ecx + je .L437 + addl $4,%eax + testl $-16777216,%ecx + jne .L435 + subl $3,%eax +.L437: + incl %eax +.L438: + incl %eax +.L439: + leal -256(%ebp),%ecx + subl %ecx,%eax + cmpl %eax,%edx + jae .L418 + cmpb $35,-256(%edx,%ebp) + jne .L419 + movb $0,-256(%edx,%ebp) +.L418: + movl 16(%ebp),%eax + pushl %eax + movl 12(%ebp),%ecx + pushl %ecx + movl 8(%ebp),%eax + pushl %eax + leal -256(%ebp),%ecx + pushl %ecx + call cddb_serverlist_process_line + addl $16,%esp + testl %eax,%eax + jl .L426 +.L414: + movl -604(%ebp),%eax + addl $-12,%esp + pushl %eax + call feof@PLT + movl %eax,%esi + addl $16,%esp + testl %esi,%esi + je .L416 + movl -604(%ebp),%ecx + addl $-12,%esp + pushl %ecx + call fclose@PLT + xorl %eax,%eax + jmp .L428 + .p2align 4,,7 +.L426: + movl $-1,%eax +.L428: +.L406: + leal -632(%ebp),%esp + popl %ebx + popl %esi + popl %edi + movl %ebp,%esp + popl %ebp + ret +.Lfe4: + .size cddb_read_serverlist,.Lfe4-cddb_read_serverlist +.section .rodata +.LC20: + .string "w" +.LC21: + .string "0.99.1" +.LC22: + .string "libcdaudio" + .align 32 +.LC23: + .string "# CD Server configuration file generated by %s %s.\n" +.LC24: + .string "# Created %s\n" +.LC25: + .string "ACCESS=REMOTE\n" +.LC26: + .string "ACCESS=LOCAL\n" +.LC27: + .string "PROXY=http://%s:%d/\n" +.LC28: + .string "SERVER=http://%s:%d/%s CDDB\n" +.LC29: + .string "SERVER=cddbp://%s:%d/ CDDB\n" +.LC30: + .string "SERVER=http://%s:%d/%s CDI\n" +.LC31: + .string "SERVER=http://%s:%s/%s COVR\n" +.text + .align 4 +.globl cddb_write_serverlist + .type cddb_write_serverlist,@function +cddb_write_serverlist: + pushl %ebp + movl %esp,%ebp + subl $300,%esp + pushl %edi + pushl %esi + pushl %ebx + call .L465 +.L465: + popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-.L465],%ebx + addl $-12,%esp + leal .LC16@GOTOFF(%ebx),%esi + pushl %esi + call getenv@PLT + addl $16,%esp + testl %eax,%eax + jne .L441 + addl $-4,%esp + pushl $256 + leal .LC17@GOTOFF(%ebx),%eax + pushl %eax + movl cddb_message@GOT(%ebx),%eax + pushl %eax + call strncpy@PLT + movl $-1,%eax + jmp .L440 + .p2align 4,,7 +.L441: + addl $-12,%esp + pushl %esi + call getenv@PLT + pushl %eax + leal .LC18@GOTOFF(%ebx),%eax + pushl %eax + pushl $256 + leal -256(%ebp),%esi + pushl %esi + call snprintf@PLT + addl $32,%esp + addl $-8,%esp + leal .LC20@GOTOFF(%ebx),%eax + pushl %eax + pushl %esi + call fopen@PLT + movl %eax,-264(%ebp) + addl $-12,%esp + pushl $0 + call time@PLT + movl %eax,-260(%ebp) + addl $32,%esp + leal .LC21@GOTOFF(%ebx),%eax + pushl %eax + leal .LC22@GOTOFF(%ebx),%eax + pushl %eax + leal .LC23@GOTOFF(%ebx),%eax + pushl %eax + movl -264(%ebp),%eax + pushl %eax + call fprintf@PLT + addl $-4,%esp + addl $-12,%esp + leal -260(%ebp),%eax + pushl %eax + call ctime@PLT + pushl %eax + leal .LC24@GOTOFF(%ebx),%eax + pushl %eax + movl -264(%ebp),%edx + pushl %edx + call fprintf@PLT + addl $48,%esp + cmpl $1,8(%ebp) + jne .L446 + movl -264(%ebp),%eax + addl $-8,%esp + pushl %eax + leal .LC25@GOTOFF(%ebx),%eax + jmp .L463 + .p2align 4,,7 +.L446: + movl -264(%ebp),%edx + addl $-8,%esp + pushl %edx + leal .LC26@GOTOFF(%ebx),%eax +.L463: + pushl %eax + call fputs@PLT + addl $16,%esp + cmpl $1,12(%ebp) + jne .L448 + movl 66836(%ebp),%eax + pushl %eax + leal 66580(%ebp),%eax + pushl %eax + leal .LC27@GOTOFF(%ebx),%eax + pushl %eax + movl -264(%ebp),%eax + pushl %eax + call fprintf@PLT + addl $16,%esp +.L448: + movl $0,-268(%ebp) + movl -268(%ebp),%edx + cmpl 16(%ebp),%edx + jge .L450 + leal 280(%ebp),%edi + leal 20(%ebp),%esi + movl $0,-272(%ebp) + movl %edi,-280(%ebp) + movl %edi,-276(%ebp) + .p2align 4,,7 +.L452: + movl -272(%ebp),%edx + movl 536(%edx,%ebp),%eax + cmpl $3,%eax + ja .L451 + movl %ebx,%edx + subl .L458@GOTOFF(%ebx,%eax,4),%edx + jmp *%edx + .align 16 + .p2align 2 + .align 4 +.L458: + .long _GLOBAL_OFFSET_TABLE_+[.-.L455] + .long _GLOBAL_OFFSET_TABLE_+[.-.L454] + .long _GLOBAL_OFFSET_TABLE_+[.-.L456] + .long _GLOBAL_OFFSET_TABLE_+[.-.L457] + .p2align 4,,7 +.L454: + movl -280(%ebp),%eax + addl $-12,%esp + pushl %eax + movl -272(%ebp),%edx + movl 276(%ebp,%edx),%eax + pushl %eax + pushl %esi + leal .LC28@GOTOFF(%ebx),%eax + jmp .L464 + .p2align 4,,7 +.L455: + movl -272(%ebp),%edx + movl 276(%ebp,%edx),%eax + pushl %eax + pushl %esi + leal .LC29@GOTOFF(%ebx),%eax + pushl %eax + movl -264(%ebp),%eax + pushl %eax + call fprintf@PLT + addl $16,%esp + jmp .L451 + .p2align 4,,7 +.L456: + movl -276(%ebp),%edx + addl $-12,%esp + pushl %edx + movl -272(%ebp),%edx + movl 276(%ebp,%edx),%eax + pushl %eax + pushl %esi + leal .LC30@GOTOFF(%ebx),%eax + jmp .L464 + .p2align 4,,7 +.L457: + addl $-12,%esp + pushl %edi + movl -272(%ebp),%edx + movl 276(%ebp,%edx),%eax + pushl %eax + pushl %esi + leal .LC31@GOTOFF(%ebx),%eax +.L464: + pushl %eax + movl -264(%ebp),%eax + pushl %eax + call fprintf@PLT + addl $32,%esp +.L451: + incl -268(%ebp) + movl -268(%ebp),%edx + addl $520,%edi + addl $520,%esi + addl $520,-272(%ebp) + addl $520,-276(%ebp) + addl $520,-280(%ebp) + cmpl 16(%ebp),%edx + jl .L452 +.L450: + movl -264(%ebp),%eax + addl $-12,%esp + pushl %eax + call fclose@PLT + xorl %eax,%eax +.L440: + leal -312(%ebp),%esp + popl %ebx + popl %esi + popl %edi + movl %ebp,%esp + popl %ebp + ret +.Lfe5: + .size cddb_write_serverlist,.Lfe5-cddb_write_serverlist +.section .rodata +.LC32: + .string "blues" +.LC33: + .string "classical" +.LC34: + .string "country" +.LC35: + .string "data" +.LC36: + .string "folk" +.LC37: + .string "jazz" +.LC38: + .string "misc" +.LC39: + .string "newage" +.LC40: + .string "reggae" +.LC41: + .string "rock" +.LC42: + .string "soundtrack" +.LC43: + .string "unknown" +.text + .align 4 +.globl cddb_genre_value + .type cddb_genre_value,@function +cddb_genre_value: + pushl %ebp + movl %esp,%ebp + pushl %edi + pushl %esi + pushl %ebx + call .L759 +.L759: + popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-.L759],%ebx + movl 8(%ebp),%eax + movl %eax,%esi + leal .LC32@GOTOFF(%ebx),%edi + movl $6,%ecx + cld + testb $0,%al + repz + cmpsb + jne .L526 + movl $1,%eax + jmp .L757 + .p2align 4,,7 +.L526: + movl %eax,%esi + leal .LC33@GOTOFF(%ebx),%edi + movl $10,%ecx + cld + testb $0,%al + repz + cmpsb + jne .L551 + movl $2,%eax + jmp .L757 + .p2align 4,,7 +.L551: + movl %eax,%esi + leal .LC34@GOTOFF(%ebx),%edi + movl $8,%ecx + cld + testb $0,%al + repz + cmpsb + jne .L576 + movl $3,%eax + jmp .L757 + .p2align 4,,7 +.L576: + movl %eax,%esi + leal .LC35@GOTOFF(%ebx),%edi + movl $5,%ecx + cld + testb $0,%al + repz + cmpsb + jne .L601 + movl $4,%eax + jmp .L757 + .p2align 4,,7 +.L601: + movl %eax,%esi + leal .LC36@GOTOFF(%ebx),%edi + movl $5,%ecx + cld + testb $0,%al + repz + cmpsb + jne .L626 + movl $5,%eax + jmp .L757 + .p2align 4,,7 +.L626: + movl %eax,%esi + leal .LC37@GOTOFF(%ebx),%edi + movl $5,%ecx + cld + testb $0,%al + repz + cmpsb + jne .L651 + movl $6,%eax + jmp .L757 + .p2align 4,,7 +.L651: + movl %eax,%esi + leal .LC38@GOTOFF(%ebx),%edi + movl $5,%ecx + cld + testb $0,%al + repz + cmpsb + jne .L676 + movl $7,%eax + jmp .L757 + .p2align 4,,7 +.L676: + movl %eax,%esi + leal .LC39@GOTOFF(%ebx),%edi + movl $7,%ecx + cld + testb $0,%al + repz + cmpsb + jne .L701 + movl $8,%eax + jmp .L757 + .p2align 4,,7 +.L701: + movl %eax,%esi + leal .LC40@GOTOFF(%ebx),%edi + movl $7,%ecx + cld + testb $0,%al + repz + cmpsb + jne .L726 + movl $9,%eax + jmp .L757 + .p2align 4,,7 +.L726: + movl %eax,%esi + leal .LC41@GOTOFF(%ebx),%edi + movl $5,%ecx + cld + testb $0,%al + repz + cmpsb + jne .L751 + movl $10,%eax + jmp .L757 + .p2align 4,,7 +.L751: + movl %eax,%esi + leal .LC42@GOTOFF(%ebx),%edi + movl $11,%ecx + cld + testb $0,%al + repz + cmpsb + je .L755 + xorl %eax,%eax + jmp .L757 + .p2align 4,,7 +.L755: + movl $11,%eax +.L757: + popl %ebx + popl %esi + popl %edi + movl %ebp,%esp + popl %ebp + ret +.Lfe6: + .size cddb_genre_value,.Lfe6-cddb_genre_value + .align 4 +.globl cddb_connect + .type cddb_connect,@function +cddb_connect: + pushl %ebp + movl %esp,%ebp + subl $28,%esp + pushl %edi + pushl %esi + pushl %ebx + call .L781 +.L781: + popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-.L781],%ebx + movl 8(%ebp),%esi + movw $2,-16(%ebp) + movw 256(%esi),%ax +#APP + rorw $8, %ax +#NO_APP + movw %ax,-14(%ebp) + addl $-12,%esp + pushl %esi + call inet_addr@PLT + movl %eax,%edi + movl %edi,-12(%ebp) + addl $16,%esp + cmpl $-1,%edi + jne .L763 + addl $-12,%esp + pushl %esi + call gethostbyname@PLT + movl %eax,%esi + addl $16,%esp + testl %esi,%esi + je .L774 + movl 16(%esi),%eax + leal -12(%ebp),%ecx + addl $-4,%esp + movl (%eax),%edx + movl 12(%esi),%eax + pushl %eax + pushl %edx + pushl %ecx + call memcpy@PLT + addl $16,%esp +.L763: + addl $-4,%esp + pushl $0 + pushl $1 + pushl $2 + call socket@PLT + movl %eax,%esi + addl $16,%esp + testl %esi,%esi + jl .L774 + addl $-4,%esp + pushl $16 + leal -16(%ebp),%eax + pushl %eax + pushl %esi + call connect@PLT + addl $16,%esp + testl %eax,%eax + jl .L774 + movl %esi,%eax + jmp .L779 + .p2align 4,,7 +.L774: + addl $-4,%esp + pushl $256 + addl $-12,%esp + call __errno_location@PLT + movl (%eax),%eax + pushl %eax + call strerror@PLT + addl $16,%esp + pushl %eax + movl cddb_message@GOT(%ebx),%eax + pushl %eax + call strncpy@PLT + movl $-1,%eax +.L779: + leal -40(%ebp),%esp + popl %ebx + popl %esi + popl %edi + movl %ebp,%esp + popl %ebp + ret +.Lfe7: + .size cddb_connect,.Lfe7-cddb_connect +.section .rodata + .align 32 +.LC44: + .string "GET http://%s:%d/%s?hello=%s+%s.%s+%s+%s&proto=%d HTTP/1.0\n\n" + .align 32 +.LC45: + .string "GET /%s?hello=%s+%s.%s+%s+%s&proto=%d HTTP/1.0\n\n" +.LC46: + .string "cddb hello %s %s.%s %s %s\n" +.LC47: + .string "proto %d\n" +.text + .align 4 +.globl cddb_connect_server + .type cddb_connect_server,@function +cddb_connect_server: + pushl %ebp + movl %esp,%ebp + subl $812,%esp + pushl %edi + pushl %esi + pushl %ebx + call .L800 +.L800: + popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-.L800],%ebx + leal 1044(%ebp),%edi + cmpl $0,528(%ebp) + je .L783 + movl 528(%ebp),%eax + addl $-12,%esp + pushl %eax + jmp .L798 + .p2align 4,,7 +.L783: + addl $-12,%esp + leal 8(%ebp),%edx + pushl %edx +.L798: + call cddb_connect@PLT + movl %eax,-784(%ebp) + addl $16,%esp + testl %eax,%eax + jl .L799 + addl $-12,%esp + call getuid@PLT + pushl %eax + call getpwuid@PLT + movl %eax,-792(%ebp) + addl $-8,%esp + pushl $256 + leal -268(%ebp),%eax + movl %eax,-796(%ebp) + pushl %eax + call gethostname@PLT + addl $32,%esp + addl $-8,%esp + pushl $256 + leal -524(%ebp),%esi + pushl %esi + call getdomainname@PLT + addl $16,%esp + cmpl $1,524(%ebp) + jne .L787 + addl $4,%edi + movl -4(%edi),%edx + movl %edx,-788(%ebp) + movl (%edi),%ecx + cmpl $0,528(%ebp) + je .L788 + pushl $3 + leal 532(%ebp),%edx + leal 788(%ebp),%eax + pushl %eax + pushl %edx + pushl %esi + movl -796(%ebp),%eax + pushl %eax + movl -792(%ebp),%edx + movl (%edx),%eax + pushl %eax + leal 268(%ebp),%eax + pushl %eax + movl 264(%ebp),%eax + pushl %eax + leal 8(%ebp),%eax + pushl %eax + leal .LC44@GOTOFF(%ebx),%eax + pushl %eax + pushl %ecx + movl -788(%ebp),%edx + pushl %edx + call snprintf@PLT + jmp .L790 + .p2align 4,,7 +.L788: + addl $-8,%esp + pushl $3 + leal 532(%ebp),%edx + leal 788(%ebp),%eax + pushl %eax + pushl %edx + pushl %esi + movl -796(%ebp),%eax + pushl %eax + movl -792(%ebp),%edx + movl (%edx),%eax + pushl %eax + leal 268(%ebp),%eax + pushl %eax + leal .LC45@GOTOFF(%ebx),%eax + pushl %eax + pushl %ecx + movl -788(%ebp),%eax + pushl %eax + call snprintf@PLT + jmp .L790 + .p2align 4,,7 +.L787: + addl $-8,%esp + leal -12(%ebp),%edi + pushl %edi + movl -784(%ebp),%edx + pushl %edx + call cddb_read_token@PLT + addl $16,%esp + testl %eax,%eax + jl .L799 + cmpl $2,-12(%ebp) + jne .L799 + leal 532(%ebp),%edx + leal 788(%ebp),%eax + pushl %eax + pushl %edx + pushl %esi + movl -796(%ebp),%eax + pushl %eax + movl -792(%ebp),%edx + leal -780(%ebp),%esi + movl (%edx),%eax + pushl %eax + leal .LC46@GOTOFF(%ebx),%eax + pushl %eax + pushl $256 + pushl %esi + call snprintf@PLT + movl -800(%ebp),%edx + addl $32,%esp + movl %esi,%eax + addl $-4,%esp +.L801: + movl (%eax),%edx + testb %dh,%dl + jne .L802 + testb %dl,%dl + je .L805 + testb %dh,%dh + je .L804 +.L802: + testl $16711680,%edx + je .L803 + addl $4,%eax + testl $-16777216,%edx + jne .L801 + subl $3,%eax +.L803: + incl %eax +.L804: + incl %eax +.L805: + subl %esi,%eax + pushl %eax + pushl %esi + movl -784(%ebp),%eax + pushl %eax + call write@PLT + addl $-8,%esp + pushl %edi + movl -784(%ebp),%edx + pushl %edx + call cddb_read_token@PLT + addl $32,%esp + testl %eax,%eax + jl .L799 + cmpl $2,-12(%ebp) + jne .L799 + pushl $3 + leal .LC47@GOTOFF(%ebx),%eax + pushl %eax + pushl $256 + pushl %esi + call snprintf@PLT + movl -804(%ebp),%edx + movl %esi,%eax + addl $-4,%esp +.L806: + movl (%eax),%edx + testb %dh,%dl + jne .L807 + testb %dl,%dl + je .L810 + testb %dh,%dh + je .L809 +.L807: + testl $16711680,%edx + je .L808 + addl $4,%eax + testl $-16777216,%edx + jne .L806 + subl $3,%eax +.L808: + incl %eax +.L809: + incl %eax +.L810: + subl %esi,%eax + pushl %eax + pushl %esi + movl -784(%ebp),%eax + pushl %eax + call write@PLT + addl $32,%esp + addl $-8,%esp + pushl %edi + movl -784(%ebp),%edx + pushl %edx + call cddb_read_token@PLT + testl %eax,%eax + jge .L790 +.L799: + movl $-1,%eax + jmp .L796 + .p2align 4,,7 +.L790: + movl -784(%ebp),%eax +.L796: + leal -824(%ebp),%esp + popl %ebx + popl %esi + popl %edi + movl %ebp,%esp + popl %ebp + ret +.Lfe8: + .size cddb_connect_server,.Lfe8-cddb_connect_server +.section .rodata +.LC48: + .string "?" +.LC49: + .string "%s?cmd=%s&%s\n" +.text + .align 4 + .type cddb_generate_http_request,@function +cddb_generate_http_request: + pushl %ebp + movl %esp,%ebp + subl $1036,%esp + pushl %edi + pushl %esi + pushl %ebx + call .L826 +.L826: + popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-.L826],%ebx + movl 16(%ebp),%esi + addl $-8,%esp + pushl $63 + pushl %esi + call strchr@PLT + addl $16,%esp + testl %eax,%eax + je .L815 + addl $-4,%esp + pushl $512 + pushl %esi + leal -512(%ebp),%edi + pushl %edi + call strncpy@PLT + addl $16,%esp + addl $-8,%esp + leal .LC48@GOTOFF(%ebx),%esi + pushl %esi + pushl %edi + call strtok@PLT + addl $16,%esp + addl $-4,%esp + pushl $512 + addl $-8,%esp + pushl %esi + pushl $0 + call strtok@PLT + addl $16,%esp + pushl %eax + leal -1024(%ebp),%esi + pushl %esi + call strncpy@PLT + addl $16,%esp + addl $-8,%esp + pushl %esi + movl 12(%ebp),%eax + pushl %eax + pushl %edi + leal .LC49@GOTOFF(%ebx),%eax + pushl %eax + movl 20(%ebp),%eax + pushl %eax + movl 8(%ebp),%eax + pushl %eax + call snprintf@PLT + xorl %eax,%eax + jmp .L825 + .p2align 4,,7 +.L815: + movl $-1,%eax +.L825: + leal -1048(%ebp),%esp + popl %ebx + popl %esi + popl %edi + movl %ebp,%esp + popl %ebp + ret +.Lfe9: + .size cddb_generate_http_request,.Lfe9-cddb_generate_http_request +.section .rodata +.LC50: + .string "Unexpected socket closure" +.LC51: + .string "%d" +.LC52: + .string "%s+%d" +.LC53: + .string "cddb+query+%08lx+%s+%d" +.LC54: + .string "%s %d" +.LC55: + .string "cddb query %08lx %s %d\n" +.LC56: + .string "/" +.LC57: + .string "%xd" +.LC58: + .string "%s %s" +.text + .align 4 +.globl cddb_query + .type cddb_query,@function +cddb_query: + pushl %ebp + movl %esp,%ebp + subl $8732,%esp + pushl %edi + pushl %esi + pushl %ebx + call .L1006 +.L1006: + popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-.L1006],%ebx + movl 8(%ebp),%eax + movl 20(%ebp),%edx + movl $0,-8672(%ebp) + movl $0,4(%edx) + addl $-8,%esp + leal -3268(%ebp),%esi + pushl %esi + pushl %eax + call cd_stat@PLT + addl $16,%esp + testl %eax,%eax + jl .L1004 + addl $-8,%esp + addl $-3256,%esp + movl %esp,%edi + cld + movl $814,%ecx + rep + movsl + call __internal_cddb_discid@PLT + movl %eax,-8668(%ebp) + addl $3264,%esp + cmpl $1,16(%ebp) + jne .L852 + movl 24(%ebp),%eax + movl %eax,-8676(%ebp) + movl -3216(%ebp),%eax + pushl %eax + leal .LC51@GOTOFF(%ebx),%eax + pushl %eax + pushl $1024 + leal -4292(%ebp),%esi + pushl %esi + call snprintf@PLT + leal -6340(%ebp),%eax + movl %eax,-8720(%ebp) + movl -8672(%ebp),%eax + xorl %edi,%edi + addl $16,%esp + leal .LC53@GOTOFF(%ebx),%edx + movl %edx,-8708(%ebp) + leal -7364(%ebp),%ecx + movl %ecx,-8704(%ebp) + leal -7620(%ebp),%edx + movl %edx,-8716(%ebp) + leal -8662(%ebp),%ecx + movl %ecx,-8700(%ebp) + cmpl -3216(%ebp),%eax + jge .L854 + leal -5316(%ebp),%esi + .p2align 4,,7 +.L856: + movl %edi,%ecx + sall $5,%ecx + addl $-12,%esp + movl -3200(%ecx,%ebp),%edx + movl -3196(%ecx,%ebp),%eax + sall $4,%edx + subl -3200(%ecx,%ebp),%edx + leal (%eax,%edx,4),%edx + leal (%edx,%edx,4),%edx + movl %edx,%eax + sall $4,%eax + subl %edx,%eax + addl -3192(%ecx,%ebp),%eax + pushl %eax + leal -4292(%ebp),%edx + pushl %edx + leal .LC52@GOTOFF(%ebx),%eax + pushl %eax + pushl $1024 + pushl %esi + call snprintf@PLT + addl $32,%esp + addl $-4,%esp + pushl $1024 + pushl %esi + leal -4292(%ebp),%ecx + pushl %ecx + call strncpy@PLT + addl $16,%esp + incl %edi + cmpl -3216(%ebp),%edi + jl .L856 +.L854: + movl -3236(%ebp),%eax + movl -3232(%ebp),%edx + addl $-8,%esp + sall $4,%eax + subl -3236(%ebp),%eax + leal (%edx,%eax,4),%eax + pushl %eax + leal -4292(%ebp),%eax + pushl %eax + movl -8668(%ebp),%edx + pushl %edx + movl -8708(%ebp),%ecx + pushl %ecx + pushl $1024 + movl -8704(%ebp),%eax + pushl %eax + call snprintf@PLT + addl $32,%esp + pushl $1024 + movl -8676(%ebp),%edx + pushl %edx + movl -8704(%ebp),%ecx + pushl %ecx + movl -8720(%ebp),%eax + pushl %eax + call cddb_generate_http_request + addl $16,%esp + jmp .L862 + .p2align 4,,7 +.L1000: + addl $-4,%esp + pushl $256 + leal .LC50@GOTOFF(%ebx),%eax + pushl %eax + movl cddb_message@GOT(%ebx),%eax + pushl %eax + call strncpy@PLT + addl $16,%esp + jmp .L872 + .p2align 4,,7 +.L1001: + movl -8716(%ebp),%edx + movb $0,(%esi,%edx) + cmpb $46,-7620(%ebp) + sete %al + andl $255,%eax + jmp .L893 + .p2align 4,,7 +.L852: + movl -3216(%ebp),%eax + pushl %eax + leal .LC51@GOTOFF(%ebx),%eax + pushl %eax + pushl $1024 + leal -4292(%ebp),%esi + pushl %esi + call snprintf@PLT + leal .LC55@GOTOFF(%ebx),%eax + movl %eax,-8712(%ebp) + movl -8672(%ebp),%eax + xorl %edi,%edi + addl $16,%esp + leal -6340(%ebp),%ecx + movl %ecx,-8720(%ebp) + leal -7620(%ebp),%edx + movl %edx,-8716(%ebp) + leal -8662(%ebp),%ecx + movl %ecx,-8700(%ebp) + cmpl -3216(%ebp),%eax + jge .L864 + leal -5316(%ebp),%esi + .p2align 4,,7 +.L866: + movl %edi,%ecx + sall $5,%ecx + addl $-12,%esp + movl -3200(%ecx,%ebp),%edx + movl -3196(%ecx,%ebp),%eax + sall $4,%edx + subl -3200(%ecx,%ebp),%edx + leal (%eax,%edx,4),%edx + leal (%edx,%edx,4),%edx + movl %edx,%eax + sall $4,%eax + subl %edx,%eax + addl -3192(%ecx,%ebp),%eax + pushl %eax + leal -4292(%ebp),%edx + pushl %edx + leal .LC54@GOTOFF(%ebx),%eax + pushl %eax + pushl $1024 + pushl %esi + call snprintf@PLT + addl $32,%esp + addl $-4,%esp + pushl $1024 + pushl %esi + leal -4292(%ebp),%ecx + pushl %ecx + call strncpy@PLT + addl $16,%esp + incl %edi + cmpl -3216(%ebp),%edi + jl .L866 +.L864: + movl -3236(%ebp),%eax + movl -3232(%ebp),%edx + addl $-8,%esp + sall $4,%eax + subl -3236(%ebp),%eax + leal (%edx,%eax,4),%eax + pushl %eax + leal -4292(%ebp),%eax + pushl %eax + movl -8668(%ebp),%edx + pushl %edx + movl -8712(%ebp),%ecx + pushl %ecx + pushl $1024 + movl -8720(%ebp),%eax + pushl %eax + call snprintf@PLT + addl $32,%esp +.L862: + movl -8720(%ebp),%eax + movl -8680(%ebp),%edx + addl $-4,%esp +.L1007: + movl (%eax),%edx + testb %dh,%dl + jne .L1008 + testb %dl,%dl + je .L1011 + testb %dh,%dh + je .L1010 +.L1008: + testl $16711680,%edx + je .L1009 + addl $4,%eax + testl $-16777216,%edx + jne .L1007 + subl $3,%eax +.L1009: + incl %eax +.L1010: + incl %eax +.L1011: + subl -8720(%ebp),%eax + pushl %eax + movl -8720(%ebp),%ecx + pushl %ecx + movl 12(%ebp),%eax + pushl %eax + call write@PLT + addl $16,%esp + cmpl $1,16(%ebp) + jne .L872 + leal -8661(%ebp),%edi + .p2align 4,,7 +.L874: + xorl %esi,%esi + .p2align 4,,7 +.L876: + addl $-4,%esp + pushl $1 + pushl %edi + movl 12(%ebp),%edx + pushl %edx + call read@PLT + addl $16,%esp + testl %eax,%eax + jle .L1000 + incl %esi + cmpb $10,-8661(%ebp) + jne .L876 + cmpl $2,%esi + jg .L874 +.L872: + xorl %esi,%esi + .p2align 4,,7 +.L890: + addl $-4,%esp + pushl $1 + movl -8700(%ebp),%ecx + pushl %ecx + movl 12(%ebp),%eax + pushl %eax + call read@PLT + movb -8662(%ebp),%al + addl $16,%esp + cmpb $10,%al + je .L1001 + movl -8716(%ebp),%edx + movb %al,(%esi,%edx) + incl %esi + cmpl $256,%esi + jl .L890 + movl %esi,%eax +.L893: + testl %eax,%eax + jl .L1004 + addl $-4,%esp + pushl $256 + movl -8716(%ebp),%ecx + pushl %ecx + leal -7876(%ebp),%esi + pushl %esi + call strncpy@PLT + addl $16,%esp + movsbl -7620(%ebp),%eax + addl $-48,%eax + movl %eax,-12(%ebp) + movsbl -7619(%ebp),%eax + addl $-48,%eax + movl %eax,-8(%ebp) + movsbl -7618(%ebp),%eax + addl $-48,%eax + movl %eax,-4(%ebp) + addl $-4,%esp + pushl $256 + leal -7616(%ebp),%eax + pushl %eax + movl cddb_message@GOT(%ebx),%eax + pushl %eax + call strncpy@PLT + addl $16,%esp + cmpl $2,-12(%ebp) + je .L904 +.L1004: + movl $-1,%eax + jmp .L999 + .p2align 4,,7 +.L904: + movl -8(%ebp),%eax + testl %eax,%eax + jne .L905 + cmpl $0,-4(%ebp) + jne .L945 + movl 20(%ebp),%edx + movl $1,(%edx) + movl $1,4(%edx) + movl $0,-8672(%ebp) + addl $-8,%esp + pushl $47 + leal -7876(%ebp),%ecx + pushl %ecx + call strchr@PLT + addl $16,%esp + testl %eax,%eax + je .L907 + movl parse_disc_artist@GOT(%ebx),%eax + cmpl $0,(%eax) + je .L907 + addl $-8,%esp + leal .LC56@GOTOFF(%ebx),%esi + pushl %esi + leal -7876(%ebp),%eax + pushl %eax + call strtok@PLT + addl $16,%esp + addl $-4,%esp + pushl $64 + addl $-8,%esp + pushl %esi + pushl $0 + call strtok@PLT + addl $16,%esp + incl %eax + pushl %eax + movl 20(%ebp),%eax + addl $16,%eax + pushl %eax + call strncpy@PLT + addl $16,%esp + movl $1,-8672(%ebp) +.L907: + addl $-8,%esp + leal .LC13@GOTOFF(%ebx),%edi + pushl %edi + leal -7876(%ebp),%edx + pushl %edx + call strtok@PLT + addl $-12,%esp + addl $-8,%esp + pushl %edi + pushl $0 + call strtok@PLT + pushl %eax + call cddb_genre_value@PLT + movl 20(%ebp),%ecx + movl %eax,8(%ecx) + addl $48,%esp + addl $-4,%esp + pushl $16 + addl $-8,%esp + pushl %edi + pushl $0 + call strtok@PLT + addl $16,%esp + pushl %eax + leal -8660(%ebp),%esi + pushl %esi + call strncpy@PLT + movl 20(%ebp),%eax + addl $16,%esp + addl $-4,%esp + addl $12,%eax + pushl %eax + leal .LC57@GOTOFF(%ebx),%eax + pushl %eax + pushl %esi + call sscanf@PLT + addl $16,%esp + addl $-4,%esp + pushl $256 + addl $-8,%esp + pushl %edi + pushl $0 + call strtok@PLT + addl $16,%esp + pushl %eax + leal -8644(%ebp),%esi + pushl %esi + call strncpy@PLT + addl $16,%esp + movl %edi,-8688(%ebp) + movl 20(%ebp),%eax + leal -8132(%ebp),%edi + addl $80,%eax + movl %eax,-8692(%ebp) + jmp .L922 + .p2align 4,,7 +.L924: + addl $-12,%esp + pushl %eax + pushl %esi + leal .LC58@GOTOFF(%ebx),%eax + pushl %eax + pushl $256 + pushl %edi + call snprintf@PLT + addl $32,%esp + addl $-4,%esp + pushl $256 + pushl %edi + pushl %esi + call strncpy@PLT + addl $16,%esp +.L922: + movl -8688(%ebp),%edx + addl $-8,%esp + pushl %edx + pushl $0 + call strtok@PLT + addl $16,%esp + testl %eax,%eax + jne .L924 + cmpl $0,-8672(%ebp) + je .L936 + addl $-4,%esp + pushl $64 + pushl %edi + movl -8692(%ebp),%ecx + pushl %ecx + call strncpy@PLT + jmp .L944 + .p2align 4,,7 +.L936: + addl $-4,%esp + pushl $64 + pushl %edi + movl 20(%ebp),%eax + addl $16,%eax + pushl %eax + call strncpy@PLT + addl $16,%esp + addl $-4,%esp + pushl $64 + leal .LC7@GOTOFF(%ebx),%eax + pushl %eax + movl -8692(%ebp),%eax + pushl %eax + call strncpy@PLT + jmp .L944 + .p2align 4,,7 +.L905: + cmpl $1,%eax + jne .L945 + movl -4(%ebp),%eax + testl %eax,%eax + jne .L946 + movl 20(%ebp),%edx + movl $1,(%edx) + jmp .L947 + .p2align 4,,7 +.L946: + cmpl $1,%eax + je .L948 + movl 20(%ebp),%ecx + movl $0,(%ecx) + jmp .L944 + .p2align 4,,7 +.L948: + movl 20(%ebp),%eax + movl $2,(%eax) +.L947: + movl 20(%ebp),%edx + movl $0,4(%edx) + leal -8663(%ebp),%ecx + movl %ecx,-8696(%ebp) + leal -8660(%ebp),%eax + movl %eax,-8684(%ebp) + .p2align 4,,7 +.L950: + xorl %esi,%esi + .p2align 4,,7 +.L955: + addl $-4,%esp + pushl $1 + movl -8696(%ebp),%edx + pushl %edx + movl 12(%ebp),%ecx + pushl %ecx + call read@PLT + movb -8663(%ebp),%al + addl $16,%esp + cmpb $10,%al + je .L1002 + movl -8716(%ebp),%edx + movb %al,(%esi,%edx) + incl %esi + cmpl $256,%esi + jl .L955 + movl %esi,%eax +.L958: + testl %eax,%eax + jne .L944 + movl $0,-8672(%ebp) + addl $-8,%esp + pushl $47 + movl -8716(%ebp),%ecx + pushl %ecx + call strchr@PLT + addl $16,%esp + testl %eax,%eax + je .L961 + addl $-8,%esp + leal .LC56@GOTOFF(%ebx),%esi + pushl %esi + movl -8716(%ebp),%eax + pushl %eax + call strtok@PLT + addl $16,%esp + addl $-4,%esp + pushl $64 + addl $-8,%esp + pushl %esi + pushl $0 + call strtok@PLT + addl $16,%esp + incl %eax + pushl %eax + movl 20(%ebp),%edx + movl 4(%edx),%eax + sall $4,%eax + addl 4(%edx),%eax + leal 16(%edx,%eax,8),%eax + pushl %eax + call strncpy@PLT + addl $16,%esp + movl $1,-8672(%ebp) +.L961: + addl $-12,%esp + addl $-8,%esp + leal .LC13@GOTOFF(%ebx),%edi + pushl %edi + movl -8716(%ebp),%ecx + pushl %ecx + call strtok@PLT + pushl %eax + call cddb_genre_value@PLT + movl 20(%ebp),%edx + movl %eax,%ecx + addl $32,%esp + addl $-4,%esp + movl 4(%edx),%eax + sall $4,%eax + addl 4(%edx),%eax + addl $8,%edx + movl %ecx,(%edx,%eax,8) + pushl $16 + addl $-8,%esp + pushl %edi + pushl $0 + call strtok@PLT + addl $16,%esp + pushl %eax + movl -8684(%ebp),%ecx + pushl %ecx + call strncpy@PLT + movl 20(%ebp),%edx + addl $16,%esp + addl $-4,%esp + movl 4(%edx),%eax + sall $4,%eax + addl 4(%edx),%eax + leal 12(%edx,%eax,8),%eax + pushl %eax + leal .LC57@GOTOFF(%ebx),%eax + pushl %eax + movl -8684(%ebp),%ecx + pushl %ecx + call sscanf@PLT + addl $16,%esp + addl $-4,%esp + pushl $256 + addl $-8,%esp + pushl %edi + pushl $0 + call strtok@PLT + addl $16,%esp + pushl %eax + leal -8132(%ebp),%esi + pushl %esi + call strncpy@PLT + addl $16,%esp + movl %edi,-8688(%ebp) + movl %esi,%edi + jmp .L976 + .p2align 4,,7 +.L978: + addl $-12,%esp + pushl %eax + pushl %edi + leal .LC58@GOTOFF(%ebx),%eax + pushl %eax + pushl $256 + leal -8388(%ebp),%esi + pushl %esi + call snprintf@PLT + addl $32,%esp + addl $-4,%esp + pushl $256 + pushl %esi + pushl %edi + call strncpy@PLT + addl $16,%esp +.L976: + movl -8688(%eb \ No newline at end of file --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-46886/make +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-46886/make @@ -0,0 +1,2 @@ +gcc -DHAVE_CONFIG_H -I. -mpentium -O3 -pipe -c -fPIC -DPIC cddb.i +gcc -DHAVE_CONFIG_H -I. -mpentium -O3 -c -fPIC -DPIC cddb.i --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/Makefile +++ gcc-2.95-2.95.4.ds15/debian/bugs/Makefile @@ -0,0 +1,2 @@ +clean: + rm -f `file * | awk -F: '/ELF/ {print $$1}'` gmon.out --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-02910.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-02910.c @@ -0,0 +1,4 @@ +void spong(void) { + (void)"this is a string + with missing stuff"; +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-12253-2.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-12253-2.c @@ -0,0 +1 @@ +static void f(void) __attribute__((noreturn)) {}; --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-12253-3.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-12253-3.c @@ -0,0 +1 @@ +static void f(void) __attribute__((noreturn)) { int x = 1 }; --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-12253.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-12253.c @@ -0,0 +1,2 @@ +static void f(void) __attribute__((noreturn)); +static void f(void) { } --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-13917.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-13917.cc @@ -0,0 +1,2 @@ +#include +#include --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-21255-1.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-21255-1.cc @@ -0,0 +1,45 @@ +template +class Matrix { + Type Values[Height][Width]; + +public: + Type const& operator()(unsigned row, unsigned col) const { return Values[row][col]; } + Type& operator()(unsigned row, unsigned col) { return Values[row][col]; } + + template + Matrix operator* (Matrix const& rhs) const; +}; + + + +template +inline +Matrix Matrix::operator*(Matrix const& rhs) const +{ + Matrix result; + + for (unsigned w=0; w < Width; w++) { + for (unsigned s=0; s < Size; s++) { + for (unsigned h=0; h < Height; h++) { + result(s,w) += Values[h][w] * rhs(h,s); + } + } + } + + return result; +} + + +int main(int, char**) +{ + Matrix transform; + Matrix input; + Matrix output; + + /* ... initialize matricies ... */ + + output = input * transform; + + return 1; +} + --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-21255-2.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-21255-2.cc @@ -0,0 +1,46 @@ +template +class Matrix { + Type Values[Height][Width]; + +public: + Type const& operator()(unsigned row, unsigned col) const { return Values[row][col]; } + Type& operator()(unsigned row, unsigned col) { return Values[row][col]; } + + template + Matrix operator* (Matrix const& rhs) const; +}; + + + +template +template +inline +Matrix Matrix::operator*(Matrix const& rhs) const +{ + Matrix result; + + for (unsigned w=0; w < Width; w++) { + for (unsigned s=0; s < Size; s++) { + for (unsigned h=0; h < Height; h++) { + result(s,w) += Values[h][w] * rhs(h,s); + } + } + } + + return result; +} + + + +int main(int, char**) +{ + Matrix transform; + Matrix input; + Matrix output; + + /* ... initialize matricies ... */ + + output = input * transform; + + return 1; +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-34876.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-34876.cc @@ -0,0 +1,135 @@ +/* +Package: g++ +Version: 2.91.63-1.1 + +Please see the following URL for details on the problem and a possible +fix: + +http://www.cygnus.com/ml/egcs-bugs/1998-Aug/0409.html + +Below is code which demonstrates the bug (provided by John Lindal +) when vtable thunks are turned on: + + B + / \ +A D - E + \ / + C + +In the above inheritance tree, B and C inherit virtually from A. When an +object of type E is constructed, D's constructor calls a function in A +which in turn calls a +virtual function overridden by D. This requires a downcast from type A +to type D, and egcs incorrectly adjusts the object pointer, forgetting +the size of E's member data. + +The correct output, produced by g++ 2.7.2, is: + +starting test +A::foo 0xbffffb30 1 +B::foo 0xbffffb18 1 +C::foo 0xbffffb20 1 +D::foo 0xbffffb18 1 +E::foo 0xbffffb18 1 +object constructed +E::foo 0xbffffb18 1 +test finished + +egcs 1.0.3 and 1.1.0 produce the incorrect output shown in bold: + +starting test +A::foo 0xbffffb40 1 +B::foo 0xbffffb38 1073783288 +C::foo 0xbffffb38 1073783288 +D::foo 0xbffffb2c 1073783288 +E::foo 0xbffffb28 1 +object constructed +E::foo 0xbffffb28 1 +test finished + +The minimal source code required to reproduce the problem is listed +below. Changing the size of E's member data changes the difference +between the pointer printed by +D::foo() and E::foo() by exactly the same amount. + +----------------------------- +*/ + +#include + +class A +{ +public: + + A() { a=1; bar(); }; + virtual void foo() { + cout << "A::foo " << this << ' ' << a << endl; }; + void bar() { foo(); }; + +private: + + int a; +}; + +class B : virtual public A +{ +public: + + B() { b=1; bar(); }; + virtual void foo() { + cout << "B::foo " << this << ' ' << b << endl; }; + +private: + + int b; +}; + +class C : virtual public A +{ +public: + + C() { c=1; bar(); }; + virtual void foo() { + cout << "C::foo " << this << ' ' << c << endl; }; + +private: + + int c; +}; + +class D : public B, public C +{ +public: + + D() { d=1; bar(); }; + virtual void foo() { + cout << "D::foo " << this << ' ' << d << endl; }; + +private: + + int d; +}; + +class E : public D +{ +public: + + E() { e=1; bar(); }; + virtual void foo() { + cout << "E::foo " << this << ' ' << e << endl; }; + +private: + + int e; +}; + +int +main() +{ + cout << "starting test" << endl; + E e; + cout << "object constructed" << endl; + e.bar(); + cout << "test finished" << endl; + return 0; +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-35477.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-35477.cc @@ -0,0 +1,78 @@ +#include + +class A +{ +public: + + A() { a=1; bar(); }; + virtual void foo() { + cout << "A::foo " << this << ' ' << a << endl; }; + void bar() { foo(); }; + +private: + + int a; +}; + +class B : virtual public A +{ +public: + + B() { b=1; bar(); }; + virtual void foo() { + cout << "B::foo " << this << ' ' << b << endl; }; + +private: + + int b; +}; + +class C : virtual public A +{ +public: + + C() { c=1; bar(); }; + virtual void foo() { + cout << "C::foo " << this << ' ' << c << endl; }; + +private: + + int c; +}; + +class D : public B, public C +{ +public: + + D() { d=1; bar(); }; + virtual void foo() { + cout << "D::foo " << this << ' ' << d << endl; }; + +private: + + int d; +}; + +class E : public D +{ +public: + + E() { e=1; bar(); }; + virtual void foo() { + cout << "E::foo " << this << ' ' << e << endl; }; + +private: + + int e; +}; + +int +main() +{ + cout << "starting test" << endl; + E e; + cout << "object constructed" << endl; + e.bar(); + cout << "test finished" << endl; + return 0; +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-35628.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-35628.cc @@ -0,0 +1,10 @@ +#include + +int main(void) { + ifstream ifs("/etc/issue",ios::in|ios::bin|ios::ate); + cout << "Length: " << ifs.tellg() << endl; + ifs.seekg(0,ios::end); + cout << "Length: " << ifs.tellg() << endl; + cout << "isGood? " << ifs.good() << endl; + return 0; +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-36410.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-36410.c @@ -0,0 +1,15 @@ +typedef struct { + char *s1, *s2; +} compressor; + +compressor compressors[] = +{ + { "z", "gzip -d -c"}, + { "Z", "gzip -d -c"}, + { "gz", "gzip -d -c"}, + { "GZ", "gzip -d -c"}, + { "bz2", "bzip2 -d -c" }, + { (char *) 0 } +}; + +int a[100] = { 0 }; --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-36600.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-36600.cc @@ -0,0 +1,37 @@ +/* +This is a C++ program that, by my +understanding, should compile cleanly but does not. I don't have +another compiler to test it with, unfortnately (eg. the Sun compiler). +I'd try it on gcc-2.95 but I can't risk installing a non-stable +version of g++ at this time. Hopefully you can try it. +*/ + +#include + +int main(void) +{ + multiset > x; + x.insert(5); + multiset >::iterator iter = x.begin(); + int& y __attribute__((unused)) = *iter; +} +/* +[patricia:~]g++ test.cpp +test.cpp: In function `int main(...)': +test.cpp:8: warning: conversion from `const int' to `int &' discards const +[patricia:~] + +: > Package: libstdc++2.9-dev +: > Version: 2.91.60-5 +: > +: > The Dec 2, 1996 draft of the "Working Paper for Draft Proposed +: > International Standard for Information Systems Programming Language +: > C++" says that the multiset must support forward iterators. A forward +: > iterator's operator* must return a reference (T&). The implementation +: > in libstdc++2.9-dev multiset.h returns a const reference (const T&). +: > This is not correct. +: > +: > I believe this problem also exists in version 2.91.66-1 as the +: > relevant source code hasn't changed. However, I haven't compiled +: > anything with the newer version. +*/ --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-36876.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-36876.c @@ -0,0 +1,22 @@ +# include + +main(argc, argv) +int argc; +char **argv ; + +{ + double q, q0, x, factor, shift; + + factor = 100000000.000001L ; /* Choose any typical fraction */ + shift = 0.0L ; + + for(x = 0.0L; x < 257.0L; x = x + 1.0L ) { + q0 = (factor)*x ; + q = q0 - factor*x + shift ; + if( q == shift ) + printf(" TRUE:\t%20.8E%20.8E%20.8E\n", x, q0, q); + else + printf("FALSE:\t%20.8E%20.8E%20.8E\n", x, q0, q); + } +} + --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-40189-2.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-40189-2.c @@ -0,0 +1,40 @@ +#include +#include + + +int +main() { + + double a[4] = { 0.006776, 2.5, 3.0, 0.006776 }, + w[4] = { 0.000030, 3.7, 3.0, 0.000030 }, + t, amin; + int ir, i, nr = 4; + double tol = 9.31322574615479e-10*3.0; + + for (i=0, ir=-1, amin=DBL_MAX; i < nr; i++) { + printf("amin=%17g; ir=%d; w=%17g, a=%17g; t=%17g\n", + amin, ir, w[i], a[i], w[i] / a[i]); + if (a[i] > tol) { + t = w[i] / a[i]; + if (t < amin || ir == -1) { + amin = t; + ir = i; + } + } + } + + printf("amin=%g; ir=%d\n", amin, ir); + + for (i=0, ir=-1, amin=DBL_MAX; i < nr; i++) { + printf("amin=%17g; ir=%d; w=%17g, a=%17g; t=%17g\n", + amin, ir, w[i], a[i], w[i] / a[i]); + if (a[i] > tol && ((t=w[i]/a[i]) < amin || ir == -1)) { + amin = t; + ir = i; + } + } + + printf("amin=%g; ir=%d\n", amin, ir); + + exit(0); +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-40189.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-40189.c @@ -0,0 +1,33 @@ +#include +#include + + +int +main() { + + double a[4]={0.006776,2.5,3.0,0.006776},w[4]={0.000030,3.7,3.0,0.000030},t,amin; + int ir,i,nr=4; + double tol=9.31322574615479e-10*3.0; + + for (i=0,ir=-1,amin=DBL_MAX;itol) { + t=w[i]/a[i]; + if (ttol && ((t=w[i]/a[i]) +#include + +string do_foo(const string& a) return ret; +{ + ret = "foo" + a; +} + +struct foo +{ + string do_foo2(const string& a); +#ifdef BUG + string do_foo(const string& a) return ret; { + ret = "foo" + a; + } +#endif +}; + +string foo::do_foo2(const string& a) return ret; { + ret = "foo" + a; +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-44446.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-44446.cc @@ -0,0 +1,2 @@ +include +include --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-44554.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-44554.cc @@ -0,0 +1,21 @@ +#include + +class Test +{ + public: + Test(const char *q); + protected: + static const unsigned char Jam_signature[4] = "JAM"; +}; + +Test::Test(const char *q) +{ + if (memcmp(q, Jam_signature, sizeof(Jam_signature)) != 0) + cerr << "Hello world!\n"; +} + +int main(void) +{ + Test::Test("JAM"); + return 0; +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-44554.ii +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-44554.ii @@ -0,0 +1,2370 @@ +# 1 "bug-44554.cc" +# 1 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/../../../../include/g++-3/iostream" 1 3 + + + + + +# 1 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/../../../../include/g++-3/iostream.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +#pragma interface + + + +# 1 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/../../../../include/g++-3/streambuf.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + +#pragma interface + + + + + + +extern "C" { +# 1 "/usr/include/libio.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/_G_config.h" 1 3 + + + + + + + + +# 1 "/usr/include/bits/types.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/features.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 137 "/usr/include/features.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 195 "/usr/include/features.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/sys/cdefs.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 71 "/usr/include/sys/cdefs.h" 3 + + + + + + + + + + + + + + +# 103 "/usr/include/sys/cdefs.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 249 "/usr/include/features.h" 2 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 1 "/usr/include/gnu/stubs.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 277 "/usr/include/features.h" 2 3 + + + + +# 26 "/usr/include/bits/types.h" 2 3 + + + +# 1 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stddef.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 48 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 90 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 160 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +typedef unsigned int size_t; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 300 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stddef.h" 3 + + +# 312 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stddef.h" 3 + + + + + +# 345 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 29 "/usr/include/bits/types.h" 2 3 + + + +typedef unsigned char __u_char; +typedef unsigned short __u_short; +typedef unsigned int __u_int; +typedef unsigned long __u_long; + +__extension__ typedef unsigned long long int __u_quad_t; +__extension__ typedef long long int __quad_t; +# 48 "/usr/include/bits/types.h" 3 + +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; + +__extension__ typedef signed long long int __int64_t; +__extension__ typedef unsigned long long int __uint64_t; + +typedef __quad_t *__qaddr_t; + +typedef __u_quad_t __dev_t; +typedef __u_int __uid_t; +typedef __u_int __gid_t; +typedef __u_long __ino_t; +typedef __u_int __mode_t; +typedef __u_int __nlink_t; +typedef long int __off_t; +typedef __quad_t __loff_t; +typedef int __pid_t; +typedef int __ssize_t; +typedef long int __rlim_t; +typedef __quad_t __rlim64_t; +typedef __u_int __id_t; + +typedef struct + { + int __val[2]; + } __fsid_t; + + +typedef int __daddr_t; +typedef char *__caddr_t; +typedef long int __time_t; +typedef long int __swblk_t; + +typedef long int __clock_t; + + +typedef unsigned long int __fd_mask; + + + + + + + + + + +typedef struct + { + + + + + + + __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask)) ]; + + + } __fd_set; + + +typedef int __key_t; + + +typedef unsigned short int __ipc_pid_t; + + + + + +typedef long int __blkcnt_t; +typedef __quad_t __blkcnt64_t; + + +typedef __u_long __fsblkcnt_t; +typedef __u_quad_t __fsblkcnt64_t; + + +typedef __u_long __fsfilcnt_t; +typedef __u_quad_t __fsfilcnt64_t; + + +typedef __u_long __ino64_t; + + +typedef __loff_t __off64_t; + + +typedef int __t_scalar_t; +typedef unsigned int __t_uscalar_t; + + +typedef int __intptr_t; + + + + + + + + +# 9 "/usr/include/_G_config.h" 2 3 + + + + + +# 1 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stddef.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 48 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stddef.h" 3 + + + + + + + + + + + + + + + +# 90 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 160 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stddef.h" 3 + + + + + + + +# 217 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +typedef unsigned int wint_t; + + + + + + + +# 345 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stddef.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + +# 14 "/usr/include/_G_config.h" 2 3 + + + + + + + + + + + + + + + + + + + + + +typedef int _G_int16_t __attribute__ ((__mode__ (__HI__))); +typedef int _G_int32_t __attribute__ ((__mode__ (__SI__))); +typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__))); +typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 30 "/usr/include/libio.h" 2 3 + + + + + + + + + + + + + + + + + + +# 1 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stdarg.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +typedef __builtin_va_list __gnuc_va_list; + + + + +# 126 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stdarg.h" 3 + + + + +# 48 "/usr/include/libio.h" 2 3 + + + + + + + +# 67 "/usr/include/libio.h" 3 + + + + + + + + + + + + + + + + + + + + +# 98 "/usr/include/libio.h" 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +struct _IO_jump_t; struct _IO_FILE; + + + + + + + + + +typedef void _IO_lock_t; + + + + + +struct _IO_marker { + struct _IO_marker *_next; + struct _IO_FILE *_sbuf; + + + + int _pos; +# 186 "/usr/include/libio.h" 3 + +}; + +struct _IO_FILE { + int _flags; + + + + + char* _IO_read_ptr; + char* _IO_read_end; + char* _IO_read_base; + char* _IO_write_base; + char* _IO_write_ptr; + char* _IO_write_end; + char* _IO_buf_base; + char* _IO_buf_end; + + char *_IO_save_base; + char *_IO_backup_base; + char *_IO_save_end; + + struct _IO_marker *_markers; + + struct _IO_FILE *_chain; + + int _fileno; + int _blksize; + __off_t _old_offset; + + + + unsigned short _cur_column; + signed char _vtable_offset; + char _shortbuf[1]; + + + + _IO_lock_t *_lock; + + + + + + + + + __off64_t _offset; + + int _unused2[16]; + +}; + + + + + +struct _IO_FILE_plus; +extern struct _IO_FILE_plus _IO_2_1_stdin_; +extern struct _IO_FILE_plus _IO_2_1_stdout_; +extern struct _IO_FILE_plus _IO_2_1_stderr_; + + + + + + + + + + + + + + + +typedef __ssize_t __io_read_fn (void * __cookie, char *__buf, + size_t __nbytes) ; + + + + + + + +typedef __ssize_t __io_write_fn (void * __cookie, __const char *__buf, + size_t __n) ; + + + + + + + +typedef int __io_seek_fn (void * __cookie, __off_t __pos, int __w) ; + + +typedef int __io_close_fn (void * __cookie) ; + + +# 311 "/usr/include/libio.h" 3 + + + + +extern "C" { + + +extern int __underflow (_IO_FILE *) throw () ; +extern int __uflow (_IO_FILE *) throw () ; +extern int __overflow (_IO_FILE *, int) throw () ; + + + + + + + + + + + + + + + + +extern int _IO_getc (_IO_FILE *__fp) throw () ; +extern int _IO_putc (int __c, _IO_FILE *__fp) throw () ; +extern int _IO_feof (_IO_FILE *__fp) throw () ; +extern int _IO_ferror (_IO_FILE *__fp) throw () ; + +extern int _IO_peekc_locked (_IO_FILE *__fp) throw () ; + + + + + +extern void _IO_flockfile (_IO_FILE *) throw () ; +extern void _IO_funlockfile (_IO_FILE *) throw () ; +extern int _IO_ftrylockfile (_IO_FILE *) throw () ; + + + + + + + + + + + + +extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, + __gnuc_va_list , int *__restrict) throw () ; +extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, + __gnuc_va_list ) throw () ; +extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t ) throw () ; +extern size_t _IO_sgetn (_IO_FILE *, void *, size_t ) throw () ; + +extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t , int, int) throw () ; +extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t , int) throw () ; + +extern void _IO_free_backup_area (_IO_FILE *) throw () ; + + +} + + + +# 36 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/../../../../include/g++-3/streambuf.h" 2 3 + +} + + +# 1 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stdarg.h" 1 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 92 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/include/stdarg.h" 3 + + + + + + + + + + + + + +typedef __gnuc_va_list va_list; + + + + + + + + + + + + + + + + + + + + + + + + +# 40 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/../../../../include/g++-3/streambuf.h" 2 3 + + + + + + + + + + + + + + + + + + + + + + + + + +extern "C++" { +class istream; +class ostream; class streambuf; + + + + + + +typedef __off64_t streamoff; +typedef __off64_t streampos; + + + + +typedef __ssize_t streamsize; + +typedef unsigned long __fmtflags; +typedef unsigned char __iostate; + +struct _ios_fields +{ + streambuf *_strbuf; + ostream* _tie; + int _width; + __fmtflags _flags; + wchar_t _fill; + __iostate _state; + __iostate _exceptions; + int _precision; + + void *_arrays; +}; + + + + + + + + + + + + + + + +# 124 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/../../../../include/g++-3/streambuf.h" 3 + + +class ios : public _ios_fields { + ios& operator=(ios&); + ios (const ios&); + public: + typedef __fmtflags fmtflags; + typedef int iostate; + typedef int openmode; + typedef __ssize_t streamsize; + enum io_state { + goodbit = 0 , + eofbit = 1 , + failbit = 2 , + badbit = 4 }; + enum open_mode { + in = 1 , + out = 2 , + ate = 4 , + app = 8 , + trunc = 16 , + nocreate = 32 , + noreplace = 64 , + bin = 128 , + binary = 128 }; + enum seek_dir { beg, cur, end}; + typedef enum seek_dir seekdir; + + enum { skipws= 01 , + left= 02 , right= 04 , internal= 010 , + dec= 020 , oct= 040 , hex= 0100 , + showbase= 0200 , showpoint= 0400 , + uppercase= 01000 , showpos= 02000 , + scientific= 04000 , fixed= 010000 , + unitbuf= 020000 , stdio= 040000 + + + + }; + enum { + basefield=dec+oct+hex, + floatfield = scientific+fixed, + adjustfield = left+right+internal + }; + +# 177 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/../../../../include/g++-3/streambuf.h" 3 + + + ostream* tie() const { return _tie; } + ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; } + + + wchar_t fill() const { return _fill; } + wchar_t fill(wchar_t newf) + {wchar_t oldf = _fill; _fill = newf; return oldf;} + fmtflags flags() const { return _flags; } + fmtflags flags(fmtflags new_val) { + fmtflags old_val = _flags; _flags = new_val; return old_val; } + int precision() const { return _precision; } + int precision(int newp) { + unsigned short oldp = _precision; _precision = (unsigned short)newp; + return oldp; } + fmtflags setf(fmtflags val) { + fmtflags oldbits = _flags; + _flags |= val; return oldbits; } + fmtflags setf(fmtflags val, fmtflags mask) { + fmtflags oldbits = _flags; + _flags = (_flags & ~mask) | (val & mask); return oldbits; } + fmtflags unsetf(fmtflags mask) { + fmtflags oldbits = _flags; + _flags &= ~mask; return oldbits; } + int width() const { return _width; } + int width(int val) { int save = _width; _width = val; return save; } + + + + + void _throw_failure() const { } + + void clear(iostate state = 0) { + _state = _strbuf ? state : state|badbit; + if (_state & _exceptions) _throw_failure(); } + void set(iostate flag) { _state |= flag; + if (_state & _exceptions) _throw_failure(); } + void setstate(iostate flag) { _state |= flag; + if (_state & _exceptions) _throw_failure(); } + int good() const { return _state == 0; } + int eof() const { return _state & ios::eofbit; } + int fail() const { return _state & (ios::badbit|ios::failbit); } + int bad() const { return _state & ios::badbit; } + iostate rdstate() const { return _state; } + operator void*() const { return fail() ? (void*)0 : (void*)(-1); } + int operator!() const { return fail(); } + iostate exceptions() const { return _exceptions; } + void exceptions(iostate enable) { + _exceptions = enable; + if (_state & _exceptions) _throw_failure(); } + + streambuf* rdbuf() const { return _strbuf; } + streambuf* rdbuf(streambuf *_s) { + streambuf *_old = _strbuf; _strbuf = _s; clear (); return _old; } + + static int sync_with_stdio(int on); + static void sync_with_stdio() { sync_with_stdio(1); } + static fmtflags bitalloc(); + static int xalloc(); + void*& pword(int); + void* pword(int) const; + long& iword(int); + long iword(int) const; + + + + + + + + + + + class Init { + public: + Init () { } + }; + + protected: + inline ios(streambuf* sb = 0, ostream* tie_to = 0); + inline virtual ~ios(); + inline void init(streambuf* sb, ostream* tie = 0); +}; + + + + +typedef ios::seek_dir _seek_dir; + + + + + + + + + + +class streammarker : private _IO_marker { + friend class streambuf; + void set_offset(int offset) { _pos = offset; } + public: + streammarker(streambuf *sb); + ~streammarker(); + int saving() { return 1; } + int delta(streammarker&); + int delta(); +}; + +struct streambuf : public _IO_FILE { + friend class ios; + friend class istream; + friend class ostream; + friend class streammarker; + const void *&_vtable() { return *(const void**)((_IO_FILE*)this + 1); } + protected: + static streambuf* _list_all; + _IO_FILE*& xchain() { return _chain; } + void _un_link(); + void _link_in(); + char* gptr() const + { return _flags & 0x100 ? _IO_save_base : _IO_read_ptr; } + char* pptr() const { return _IO_write_ptr; } + char* egptr() const + { return _flags & 0x100 ? _IO_save_end : _IO_read_end; } + char* epptr() const { return _IO_write_end; } + char* pbase() const { return _IO_write_base; } + char* eback() const + { return _flags & 0x100 ? _IO_save_base : _IO_read_base;} + char* base() const { return _IO_buf_base; } + char* ebuf() const { return _IO_buf_end; } + int blen() const { return _IO_buf_end - _IO_buf_base; } + void xput_char(char c) { *_IO_write_ptr++ = c; } + int xflags() { return _flags ; } + int xflags(int f) {int fl = _flags ; _flags = f; return fl;} + void xsetflags(int f) { _flags |= f; } + void xsetflags(int f, int mask) + { _flags = (_flags & ~mask) | (f & mask); } + void gbump(int n) + { _flags & 0x100 ? (_IO_save_base+=n):(_IO_read_ptr+=n);} + void pbump(int n) { _IO_write_ptr += n; } + void setb(char* b, char* eb, int a=0); + void setp(char* p, char* ep) + { _IO_write_base=_IO_write_ptr=p; _IO_write_end=ep; } + void setg(char* eb, char* g, char *eg) { + if (_flags & 0x100 ) _IO_free_backup_area(this); + _IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; } + char *shortbuf() { return _shortbuf; } + + int in_backup() { return _flags & 0x100 ; } + + char *Gbase() { return in_backup() ? _IO_save_base : _IO_read_base; } + + char *eGptr() { return in_backup() ? _IO_save_end : _IO_read_end; } + + char *Bbase() { return in_backup() ? _IO_read_base : _IO_save_base; } + char *Bptr() { return _IO_backup_base; } + + char *eBptr() { return in_backup() ? _IO_read_end : _IO_save_end; } + char *Nbase() { return _IO_save_base; } + char *eNptr() { return _IO_save_end; } + int have_backup() { return _IO_save_base != __null ; } + int have_markers() { return _markers != __null ; } + void free_backup_area(); + void unsave_markers(); + int put_mode() { return _flags & 0x800 ; } + int switch_to_get_mode(); + + streambuf(int flags=0); + public: + static int flush_all(); + static void flush_all_linebuffered(); + virtual ~streambuf(); + virtual int overflow(int c = (-1) ); + virtual int underflow(); + virtual int uflow(); + virtual int pbackfail(int c); + + virtual streamsize xsputn(const char* s, streamsize n); + virtual streamsize xsgetn(char* s, streamsize n); + virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); + virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out); + + streampos pubseekoff(streamoff o, _seek_dir d, int mode=ios::in|ios::out) + { return _IO_seekoff (this, o, d, mode); } + streampos pubseekpos(streampos pos, int mode = ios::in|ios::out) + { return _IO_seekpos (this, pos, mode); } + streampos sseekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); + streampos sseekpos(streampos pos, int mode = ios::in|ios::out); + virtual streambuf* setbuf(char* p, int len); + virtual int sync(); + virtual int doallocate(); + + int seekmark(streammarker& mark, int delta = 0); + int sputbackc(char c); + int sungetc(); + int unbuffered() { return _flags & 2 ? 1 : 0; } + int linebuffered() { return _flags & 0x200 ? 1 : 0; } + void unbuffered(int i) + { if (i) _flags |= 2 ; else _flags &= ~2 ; } + void linebuffered(int i) + { if (i) _flags |= 0x200 ; else _flags &= ~0x200 ; } + int allocate() { + if (base() || unbuffered()) return 0; + else return doallocate(); } + + void allocbuf() { if (base() == __null ) doallocbuf(); } + void doallocbuf(); + int in_avail() { return _IO_read_end - _IO_read_ptr; } + int out_waiting() { return _IO_write_ptr - _IO_write_base; } + streamsize sputn(const char* s, streamsize n) { return xsputn(s, n); } + streamsize padn(char pad, streamsize n) { return _IO_padn(this, pad, n); } + streamsize sgetn(char* s, streamsize n) { return _IO_sgetn(this, s, n); } + int ignore(int); + int get_column(); + int set_column(int); + long sgetline(char* buf, size_t n, char delim, int putback_delim); + int sputc(int c) { return _IO_putc(c, this); } + int sbumpc() { return _IO_getc(this); } + int sgetc() { return (( this )->_IO_read_ptr >= ( this )->_IO_read_end && __underflow ( this ) == (-1) ? (-1) : *(unsigned char *) ( this )->_IO_read_ptr) ; } + int snextc() { + if (_IO_read_ptr >= _IO_read_end && __underflow(this) == (-1) ) + return (-1) ; + else return _IO_read_ptr++, sgetc(); } + void stossc() { if (_IO_read_ptr < _IO_read_end) _IO_read_ptr++; } + int vscan(char const *fmt0, __gnuc_va_list ap, ios* stream = __null ); + int scan(char const *fmt0 ...); + int vform(char const *fmt0, __gnuc_va_list ap); + int form(char const *fmt0 ...); + + + + + virtual streamsize sys_read(char* buf, streamsize size); + virtual streamsize sys_write(const char*, streamsize); + virtual streampos sys_seek(streamoff, _seek_dir); + virtual int sys_close(); + virtual int sys_stat(void*); + + virtual int showmanyc(); + virtual void imbue(void *); + +}; + + + + +class filebuf : public streambuf { + protected: + void init(); + public: + static const int openprot; + filebuf(); + filebuf(int fd); + filebuf(int fd, char* p, int len); + + + + ~filebuf(); + filebuf* attach(int fd); + filebuf* open(const char *filename, const char *mode); + filebuf* open(const char *filename, ios::openmode mode, int prot = 0664); + virtual int underflow(); + virtual int overflow(int c = (-1) ); + int is_open() const { return _fileno >= 0; } + int fd() const { return is_open() ? _fileno : (-1) ; } + filebuf* close(); + virtual int doallocate(); + virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); + virtual streambuf* setbuf(char* p, int len); + streamsize xsputn(const char* s, streamsize n); + streamsize xsgetn(char* s, streamsize n); + virtual int sync(); + protected: + + int is_reading() { return eback() != egptr(); } + char* cur_ptr() { return is_reading() ? gptr() : pptr(); } + + char* file_ptr() { return eGptr(); } + + virtual streamsize sys_read(char* buf, streamsize size); + virtual streampos sys_seek(streamoff, _seek_dir); + virtual streamsize sys_write(const char*, streamsize); + virtual int sys_stat(void*); + virtual int sys_close(); + + + + +}; + +inline void ios::init(streambuf* sb, ostream* tie_to) { + _state = sb ? ios::goodbit : ios::badbit; _exceptions=0; + _strbuf=sb; _tie = tie_to; _width=0; _fill=' '; + + _flags=ios::skipws|ios::dec; + + + + _precision=6; _arrays = 0; } + +inline ios::ios(streambuf* sb, ostream* tie_to) { init(sb, tie_to); } + +inline ios::~ios() { + + + + + + operator delete[] (_arrays); +} +} + +# 31 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/../../../../include/g++-3/iostream.h" 2 3 + + +extern "C++" { +class istream; class ostream; +typedef ios& (*__manip)(ios&); +typedef istream& (*__imanip)(istream&); +typedef ostream& (*__omanip)(ostream&); + +extern istream& ws(istream& ins); +extern ostream& flush(ostream& outs); +extern ostream& endl(ostream& outs); +extern ostream& ends(ostream& outs); + +class ostream : virtual public ios +{ + + void do_osfx(); + public: + ostream() { } + ostream(streambuf* sb, ostream* tied= __null ); + int opfx() { + if (!good()) return 0; + else { if (_tie) _tie->flush(); ; return 1;} } + void osfx() { ; + if (flags() & (ios::unitbuf|ios::stdio)) + do_osfx(); } + ostream& flush(); + ostream& put(char c) { _strbuf->sputc(c); return *this; } + + + + + + ostream& write(const char *s, streamsize n); + ostream& write(const unsigned char *s, streamsize n) + { return write((const char*)s, n);} + ostream& write(const signed char *s, streamsize n) + { return write((const char*)s, n);} + ostream& write(const void *s, streamsize n) + { return write((const char*)s, n);} + ostream& seekp(streampos); + ostream& seekp(streamoff, _seek_dir); + streampos tellp(); + ostream& form(const char *format ...); + ostream& vform(const char *format, __gnuc_va_list args); + + ostream& operator<<(char c); + ostream& operator<<(unsigned char c) { return (*this) << (char)c; } + ostream& operator<<(signed char c) { return (*this) << (char)c; } + ostream& operator<<(const char *s); + ostream& operator<<(const unsigned char *s) + { return (*this) << (const char*)s; } + ostream& operator<<(const signed char *s) + { return (*this) << (const char*)s; } + ostream& operator<<(const void *p); + ostream& operator<<(int n); + ostream& operator<<(unsigned int n); + ostream& operator<<(long n); + ostream& operator<<(unsigned long n); + + __extension__ ostream& operator<<(long long n); + __extension__ ostream& operator<<(unsigned long long n); + + ostream& operator<<(short n) {return operator<<((int)n);} + ostream& operator<<(unsigned short n) {return operator<<((unsigned int)n);} + + ostream& operator<<(bool b) { return operator<<((int)b); } + + ostream& operator<<(double n); + ostream& operator<<(float n) { return operator<<((double)n); } + + ostream& operator<<(long double n); + + + + ostream& operator<<(__omanip func) { return (*func)(*this); } + ostream& operator<<(__manip func) {(*func)(*this); return *this;} + ostream& operator<<(streambuf*); + + + +}; + +class istream : virtual public ios +{ + +protected: + size_t _gcount; + + int _skip_ws(); + public: + istream(): _gcount (0) { } + istream(streambuf* sb, ostream*tied= __null ); + istream& get(char* ptr, int len, char delim = '\n'); + istream& get(unsigned char* ptr, int len, char delim = '\n') + { return get((char*)ptr, len, delim); } + istream& get(char& c); + istream& get(unsigned char& c) { return get((char&)c); } + istream& getline(char* ptr, int len, char delim = '\n'); + istream& getline(unsigned char* ptr, int len, char delim = '\n') + { return getline((char*)ptr, len, delim); } + istream& get(signed char& c) { return get((char&)c); } + istream& get(signed char* ptr, int len, char delim = '\n') + { return get((char*)ptr, len, delim); } + istream& getline(signed char* ptr, int len, char delim = '\n') + { return getline((char*)ptr, len, delim); } + istream& read(char *ptr, streamsize n); + istream& read(unsigned char *ptr, streamsize n) + { return read((char*)ptr, n); } + istream& read(signed char *ptr, streamsize n) + { return read((char*)ptr, n); } + istream& read(void *ptr, streamsize n) + { return read((char*)ptr, n); } + istream& get(streambuf& sb, char delim = '\n'); + istream& gets(char **s, char delim = '\n'); + int ipfx(int need = 0) { + if (!good()) { set(ios::failbit); return 0; } + else { + ; + if (_tie && (need == 0 || rdbuf()->in_avail() < need)) _tie->flush(); + if (!need && (flags() & ios::skipws)) return _skip_ws(); + else return 1; + } + } + int ipfx0() { + if (!good()) { set(ios::failbit); return 0; } + else { + ; + if (_tie) _tie->flush(); + if (flags() & ios::skipws) return _skip_ws(); + else return 1; + } + } + int ipfx1() { + if (!good()) { set(ios::failbit); return 0; } + else { + ; + if (_tie && rdbuf()->in_avail() == 0) _tie->flush(); + return 1; + } + } + void isfx() { ; } + int get() { if (!ipfx1()) return (-1) ; + else { int ch = _strbuf->sbumpc(); + if (ch == (-1) ) set(ios::eofbit); + isfx(); + return ch; + } } + int peek(); + size_t gcount() { return _gcount; } + istream& ignore(int n=1, int delim = (-1) ); + int sync (); + istream& seekg(streampos); + istream& seekg(streamoff, _seek_dir); + streampos tellg(); + istream& putback(char ch) { + if (good() && _strbuf->sputbackc(ch) == (-1) ) clear(ios::badbit); + return *this;} + istream& unget() { + if (good() && _strbuf->sungetc() == (-1) ) clear(ios::badbit); + return *this;} + istream& scan(const char *format ...); + istream& vscan(const char *format, __gnuc_va_list args); + + + + + + + istream& operator>>(char*); + istream& operator>>(unsigned char* p) { return operator>>((char*)p); } + istream& operator>>(signed char*p) { return operator>>((char*)p); } + istream& operator>>(char& c); + istream& operator>>(unsigned char& c) {return operator>>((char&)c);} + istream& operator>>(signed char& c) {return operator>>((char&)c);} + istream& operator>>(int&); + istream& operator>>(long&); + + __extension__ istream& operator>>(long long&); + __extension__ istream& operator>>(unsigned long long&); + + istream& operator>>(short&); + istream& operator>>(unsigned int&); + istream& operator>>(unsigned long&); + istream& operator>>(unsigned short&); + + istream& operator>>(bool&); + + istream& operator>>(float&); + istream& operator>>(double&); + istream& operator>>(long double&); + istream& operator>>( __manip func) {(*func)(*this); return *this;} + istream& operator>>(__imanip func) { return (*func)(*this); } + istream& operator>>(streambuf*); +}; + +class iostream : public istream, public ostream +{ + public: + iostream() { } + iostream(streambuf* sb, ostream*tied= __null ); +}; + +class _IO_istream_withassign : public istream { +public: + _IO_istream_withassign& operator=(istream&); + _IO_istream_withassign& operator=(_IO_istream_withassign& rhs) + { return operator= (static_cast (rhs)); } +}; + +class _IO_ostream_withassign : public ostream { +public: + _IO_ostream_withassign& operator=(ostream&); + _IO_ostream_withassign& operator=(_IO_ostream_withassign& rhs) + { return operator= (static_cast (rhs)); } +}; + +extern _IO_istream_withassign cin; + +extern _IO_ostream_withassign cout, cerr; + +extern _IO_ostream_withassign clog + + + +; + +extern istream& lock(istream& ins); +extern istream& unlock(istream& ins); +extern ostream& lock(ostream& outs); +extern ostream& unlock(ostream& outs); + +struct Iostream_init { } ; + +inline ios& dec(ios& i) +{ i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; } +inline ios& hex(ios& i) +{ i.setf(ios::hex, ios::dec|ios::hex|ios::oct); return i; } +inline ios& oct(ios& i) +{ i.setf(ios::oct, ios::dec|ios::hex|ios::oct); return i; } +} + + +# 6 "/usr/lib/gcc-ss/lib/gcc-lib/i386-linux/2.96/../../../../include/g++-3/iostream" 2 3 + + +# 1 "bug-44554.cc" 2 + + + +#pragma pack(1) + + + typedef unsigned char UINT8; + typedef signed char SINT8; + +class Test +{ +public: + Test(const char *q); +protected: + static const UINT8 Jam_signature[4] = "JAM"; +}; + +Test::Test(const char *q) +{ + if (memcmp(q, Jam_signature, sizeof(Jam_signature)) != 0) + cerr << "Hello world!\n"; +} + +int main(void) +{ + Test::Test("JAM"); + + return 0; +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-45041.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-45041.cc @@ -0,0 +1,84 @@ +/* +From: David Marwood +To: submit@bugs.debian.org +Subject: Bug#45041: pthread/throw causes abort() +Date: Mon, 13 Sep 1999 16:50:28 -0700 (PDT) + + +Package: g++ +Version: 2.91.60-5 + + +I have a problem with pthreads and C++ exceptions interacting badly. +The attached program incorrectly aborts after several seconds of +execution when compiled with: + g++ -o main -DREENTRANT main.cpp -lpthread + +Here's some machine info, followed by the results of the execution. +Removing the multi-threading or removing the throw fixes the problem +(obviously at reduced functionality). Adding "while (true);" right +before the lats close-brace causes the program to behave correctly. +If you are unable to reproduce the problem then I'm very interested as +it probably indicates a very strange problem with my setup. + +[patricia:~]dpkg --list | grep libstdc +ii libstdc++2.8 2.90.29-2 The GNU stdc++ library (old egcs version) +ii libstdc++2.9 2.91.60-5 The GNU stdc++ library (egcs version) +ii libstdc++2.9-de 2.91.60-5 The GNU stdc++ library (development files) +[patricia:~]dpkg --list | grep 'g++' +ii g++ 2.91.60-5 The GNU (egcs) C++ compiler. +ii libg++27 2.7.2.1-14.4 The GNU C++ libraries (ELF version). +ii libg++272 2.7.2.8-0.1 The GNU C++ libraries (libc6 version). +[patricia:~]uname -a +Linux patricia 2.0.34 #52 Wed Sep 23 16:47:48 PDT 1998 i586 unknown +[patricia:~]./main +Aborted +[patricia:~] + + +I don't get the problem on my Solaris box. Oddly, the program seems +to be using only one of the box's two cpus, although I don't see how +that's relevant. Here's the info: + +[farrah:~]g++ -v +Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/specs +gcc version 2.8.1 +[farrah:~]uname -a +SunOS farrah 5.6 Generic_105181-05 sun4u sparc SUNW,Ultra-250 +[farrah:~]g++ -D_REENTRANT -o main main.cpp -lpthread +[farrah:~]./main +[farrah:~] + +David + +---------------------------------------------------------------- +*/ + +#include + + +class MyException +{ +}; + + +void* newthread(void*) +{ + while (true) + { + try { + throw MyException(); + } catch (MyException) { + } + } +} + + +void main(void) +{ + for (int i = 0; i < 20; i++) + { + pthread_t tid; + pthread_create(&tid, NULL, newthread, NULL); + } +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-46444.cc +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-46444.cc @@ -0,0 +1,30 @@ +/* +From: joost witteveen +To: submit@bugs.debian.org +Subject: Bug#46444: libstdc++2.10-dev: warning: base init. will be reordered, when just including "rope.h" +Date: Sat, 2 Oct 1999 11:22:46 +0200 + +Package: libstdc++2.10-dev +Version: 1:2.95.2-0pre2 +Severity: normal + +All I need to do to get tons of warning messages from g++ is include rope.h +(or rope, or whatever) is this: + +$ cat > r.cc +*/ + +#include + +/* +$ g++ -Wall r.cc -o r.o +In file included from /usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3/rope.h:18, + from r.cc:1: +/usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3/stl_rope.h: In method `_Rope_RopeRep<_CharT,_Alloc>::_Rope_RopeRep(_Rope_RopeRep<_CharT,_Alloc>::_Tag, int, bool, unsigned int, typename _Rope_rep_base<_CharT,_Alloc>::allocator_type)': +/usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3/stl_rope.h:390: warning: base initializer for `_Rope_rep_base<_CharT,_Alloc>' +/usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3/stl_rope.h:390: warning: will be re-ordered to precede member initializations +/usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3/stl_rope.h: In method `_Rope_RopeLeaf<_CharT,_Alloc>::_Rope_RopeLeaf(_CharT *, unsigned int, typename _Rope_rep_base<_CharT,_Alloc>::allocator_type)': +/usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3/stl_rope.h:566: warning: base initializer for `_Rope_RopeRep<_CharT,_Alloc>' +/usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3/stl_rope.h:566: warning: will be re-ordered to precede member initializations +[...] +*/ --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-46963.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-46963.c @@ -0,0 +1,40 @@ +/* +From: Falk Hueffner +To: Debian Bug Tracking System +Subject: Bug#46963: Internal compiler error in `int_mode_for_mode' on alpha +Date: Fri, 08 Oct 1999 22:20:48 +0200 + +Package: gcc +Version: 1:2.95.2-0pre2 +Severity: normal + +This problem doesn't occur on i386, and not if using g++, or if using +a larger type. I don't know if the double declaration is valid C, but +it shouldn't give an internal error in any case. + + Falk + + +% uname -a +Linux borkum 2.2.5 #2 Mon Apr 12 09:16:55 CEST 1999 alpha unknown + +% gcc -v +Reading specs from /usr/lib/gcc-lib/alpha-linux/2.95.2/specs +gcc version 2.95.2 19990906 (prerelease) + +% gcc -c automap.c +automap.c: In function `add_segment_edges': +automap.c:9: Internal compiler error in `int_mode_for_mode', at stor-layout.c:202 +Please submit a full bug report. +See for instructions. + + +----- automap.c --------------------------------------------------- +*/ + +extern short Player_init[10]; +extern short Player_init[]; + +void add_segment_edges() { + short foo = Player_init[5]; +} --- gcc-2.95-2.95.4.ds15.orig/debian/bugs/bug-47743.c +++ gcc-2.95-2.95.4.ds15/debian/bugs/bug-47743.c @@ -0,0 +1,90 @@ +/* +From: Zdenek Kabelac +To: Debian Bug Tracking System +Subject: Bug#47743: Miscompilation with -mpentiumpro & -funroll-loop +Date: Mon, 18 Oct 1999 20:57:35 +0200 + +Package: gcc +Version: 1:2.95.2-0pre2 +Severity: normal + +Hello + +I was trying to compile bytemark benchmark - and I found out that this +part is being miscompiled by latest gcc. + +here is demo makefile: +-- +CFLAGS = -O3 -fomit-frame-pointer -Wall -mpentiumpro -fforce-addr \ + -funroll-all-loops -inline-functions\ + +all: test + +test: test.o + $(CC) -g -o $@ test.o + +--- + +and here is the stripped code itself: + +--- +*/ + +#include + +#define MAXPATS 10 +#define IN_SIZE 35 +#define OUT_SIZE 8 +#define MID_SIZE 8 + +double out_wt_change[OUT_SIZE][MID_SIZE]; +double mid_wt_change[MID_SIZE][IN_SIZE]; +double out_wt_cum_change[OUT_SIZE][MID_SIZE]; +double mid_wt_cum_change[MID_SIZE][IN_SIZE]; + +int numpats; +int n; + +void testerr(void) +{ + int i, j; + + printf("n: %d %d\n", numpats, n); + + for (i = 0; i. It can be found at the +following locations (this list was last updated on 2000/11/19): + +USA: http://www.cerfnet.com/~mpcline/c++-faq-lite/ + +Canada: http://new-brunswick.net/workshop/c++/faq + +Finland: http://www.utu.fi/~sisasa/oasis/cppfaq/ + +France: http://caor.ensmp.fr/FAQ/c++-faq-lite/ + +Germany: http://www.informatik.uni-konstanz.de/~kuehl/cpp/cppfaq.htm + +Spain: http://geneura.ugr.es/~jmerelo/c++-faq/ + +Taiwan: http://www.cis.nctu.edu.tw/c++/C++FAQ-English/ + +U.K.: http://www.cs.bham.ac.uk/~jdm/CPP/index.html + + +Please send updates to this list as bug report for the g++ package. --- gcc-2.95-2.95.4.ds15.orig/debian/README.java +++ gcc-2.95-2.95.4.ds15/debian/README.java @@ -0,0 +1,194 @@ +[Information taken from http://sourceware.cygnus.com/java/ on 21 August 1999. + Not updated on a regular basis] + +What is it? +----------- + +GCJ is a front end to the GCC compiler which can natively compile both +Java(tm) source and bytecode files. The compiler can also generate class +files. This new front end is integrated into the GCC project. + +What you get +------------ + +The currently available code consists of several programs: + + * gcj + A front end to gcc which is able to read Java ``.class'' files and + generate assembly code. gcj is also a convenient front end to jvgenmain. + Finally, gcj can read ``.java'' files and generate assembly code or + Java bytecode. + * jvgenmain + A small program to generate an appropriate ``main'' for a Java class. + * gcjh + A program to generate C++ header files corresponding to Java .class + files. + * jcf-dump + Reads a ``.class'' file and prints out all sorts of useful information. + * jv-scan + Reads a ``.java'' file and prints some useful information. For instance, + it can tell you which classes are defined in that file. + +What it doesn't do +------------------ + +Currently the compiler source parser does not understand JDK 1.1 extensions to +the Java programming language. For instance, it does not support inner classes. + +Making executables +------------------ + +In order to make full executables, you'll need to link the output of gcj +with the appropriate runtime code. See the libgcj page for details on +downloading and installing this runtime. + +There are also more detailed instructions on compiling Java programs. + +How to get it +------------- + +The new Java front end is very easy to download and install. Since it is it +fully integrated into GCC, you can simply follow the GCC download and build +instructions. Note that you'll want to configure GCC to use the appropriate +threads system; see the libgcj page for details. + +How to try it +------------- + +Once you've downloaded and installed gcj and libgcj, it is very easy to try +a small Java program of your own: + + gcj --main=HelloWorld -o HelloWorld HelloWorld.java + ./HelloWorld + +Compiling with GCJ +------------------ + +GCJ works in three ways: First GCJ can take .java files as input and compile +architecture-specific object files. Second, by using the -C option, GCJ can +take .java files as input, and generate .class files. Third, GCJ can take +.class files as input to create architecture-specific object files. + +GCJ offers two run-time support libraries, libgcj and libgcjgc. libgcj is a +clean-room implementation of the core Java libraries. libgcjgc is the garbage +collector, which is responsible for automatic memory management. This +collector is based on the Boehm-Weiser conservative collector, but it scans +Java objects precisely and has changes to work with the cooperative +threads-package. It uses a basic mark-sweep algorithm to perform the actual +collections, stopping all threads as it works. + +Compiling Java Programs +----------------------- + +If you are working with Java, we recommend you use the gcj program instead of +using GCC directly. + +Java-specific file extensions +----------------------------- + +GCJ (GNU Compiler for Java) deals with the following Java-specific file +extensions, and you can specify any of these as an input file: + +.java + A source file in the Java language, consisting of one or more class + definitions. +.class + A binary file containing bytecode instructions and information + pertaining to a single class. It can be loaded into and executed by a + Java Virtual Machine. Compiling a .java source file results in one or + more .class files, one for each class definition in the source file. The + .class file format was designed as a portable and secure representation + of Java classes, but there also exist tools for compiling program written + in other languages (such as Ada, Scheme, and ML) into .class files. +.zip + The .zip file format is a file archival and compression format popular in + the PC world. In the Java world it is mainly used to bundle a collection + of .class files. When specified on the gcj command line, gcj compiles all + the .class files in the .zip archive. The result is a single assembly + file, object file, or executable, depending on the options you specify. +.jar + A .jar (Java ARchive) file is file in .zip format, but following + certainly extra conventions. (Certain extra files should also be + included.) GCJ treats it the same as a .zip file. + +GCJ command-line options +------------------------ + +In addition to the normal GCC options, GCJ recognizes the following +options: + +-C + The input file(s) must be all be .java source files. They are compiled + into portable .class files. No machine code (.o files or executable) is + generated. + +--output-class-dir=OUTPUTDIR + When used with -C, specifies which directory the generated .class should + be written to. A class A.B (whose input file is usually A/B.java) would + be written to OUTPUTDIR/A/B.class. + +-d OUTPUTDIR + Synonym for --output-class-directory, for compatibility with Suns javac. + +--bounds-check + When compiling to machine code, emit instructions to check that array + indexes are within bounds, and to throw an exception if they are not. + This is the default. + +--no-bounds-check + When compiling to machine code, do not emit instructions to check + that array indexes are within bounds. + +-M +-MM +-MD +-MMD + These options work as with the C compiler. For GCJs purposes, a system + header is any .zip file installed as part of the compiler system. + +--main=CLASSNAME + When linking an application, generate a stub so the application starts + executing with the main method of the class named. (This option is + ignored if you are only compiling and not linking.) Path searching + options At compile time, GCJ uses a list of paths to search for classes + and packages that it needs to find. This list is called the + classpath. Each element of the classpath can be either a directory or the + name of a .zip or .jar file. In the latter case, GCJ searches the + contents of the file for the required information. GCJ has a built-in + classpath, which includes the directory ., and the system libgcj.zip + file, which holds classes from the standard Java class libraries, such as + java.lang. There are several ways to set or augment the classpath. + +-I directory + A directory (or file) specified using -I are prepended to the classpath. + -I options are never overridden by the other options listed below. + +--classpath=path +-classpath path + If specified, the option to --classpath (or -classpath; the two spellings + are synonymous) overrides the built-in classpath, and suppresses + recognition of --CLASSPATH and the CLASSPATH environment variable. + +--CLASSPATH=path -CLASSPATH path + If specified, the option to --CLASSPATH (or -CLASSPATH; the two spellings + are synonymous) is appended to the built-in classpath, but suppresses + recognition of the CLASSPATH environment variable. + +CLASSPATH + The CLASSPATH environment-variable can be set to a path. This path is + appended to the compiler-supplied default path. In the above, a path is a + colon-separated (on Windows, semicolon-separated) list of directories or + file names. + +Here are some other points worth noting: + + * If there is no -g or -O option (and no options starting with those + letters), the default is -g1. This is different from gcc, where the + default is -g0. Making -g1 the default causes line number information to + be generated, but not the other information necessary for source-level + debugging. The reason for this change is partly for compatibility with + Sun's tools, and partly because it is helpful when printing an exceptions + stack trace. + + * When an application is linked, gcj will also link in the standard Java + run-time libraries (libgcj, and possibly others). --- gcc-2.95-2.95.4.ds15.orig/debian/chill-2.95.postinst +++ gcc-2.95-2.95.4.ds15/debian/chill-2.95.postinst @@ -0,0 +1,10 @@ +#! /bin/sh -e + +#DEBHELPER# + +case "$1" in + configure) + install-info --quiet --section "Development" "Development" \ + --description="The GNU Chill compiler." \ + /usr/share/info/chill-2.95.info +esac --- gcc-2.95-2.95.4.ds15.orig/debian/libstdc++-dev.prerm +++ gcc-2.95-2.95.4.ds15/debian/libstdc++-dev.prerm @@ -0,0 +1,5 @@ +#! /bin/sh -e + +#DEBHELPER# + +install-info --quiet --remove iostream-2.95 --- gcc-2.95-2.95.4.ds15.orig/debian/libstdc++.postinst +++ gcc-2.95-2.95.4.ds15/debian/libstdc++.postinst @@ -0,0 +1,12 @@ +#! /bin/sh -e + +if [ "$1" = "configure" ]; then + # remove a dangling symlink probably left over from the libstdc++2.9 package + if [ -L /usr/lib/libstdc++.so.2.9 -a ! -e /usr/lib/libstdc++.so.2.9 ]; then + rm /usr/lib/libstdc++.so.2.9 + fi + + ldconfig +fi + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/protoize.1 +++ gcc-2.95-2.95.4.ds15/debian/protoize.1 @@ -0,0 +1,42 @@ +.TH PROTOIZE 1 +.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection +.\" other parms are allowed: see man(7), man(1) +.SH NAME +protoize, unprotoize \- create/remove ANSI prototypes from C code +.SH SYNOPSIS +.B protoize +.I "[options] files ...." +.br +.B unprotoize +.I "[options] files ...." +.SH "DESCRIPTION" +This manual page documents briefly the +.BR protoize , +and +.B unprotoize +commands. +This manual page was written for the Debian GNU/Linux distribution +(but may be used by others), because the original program does not +have a manual page. +Instead, it has documentation in the GNU Info format; see below. +.PP +.B protoize +is an optional part of GNU C. You can use it to add prototypes to a +program, thus converting the program to ANSI C in one respect. The companion +program `unprotoize' does the reverse: it removes argument types from +any prototypes that are found. +.PP +When you run these programs, you must specify a set of source files +as command line arguments. +.SH OPTIONS +These programs are non-trivial to operate, and it is neither possible nor +desirable to properly summarize options in this man page. Read the info +documentation for more information. +.SH "SEE ALSO" +The programs are documented fully by +.IR "Gcc: The use and the internals of the GNU compiler", +available via the Info system. The documentation for protoize/unprotoize +can be found in the subsection "Invoking GCC", under "Running Protoize." +.SH AUTHOR +This manual page was written by Galen Hazelwood, +for the Debian GNU/Linux system. --- gcc-2.95-2.95.4.ds15.orig/debian/gcc-2.95.prerm +++ gcc-2.95-2.95.4.ds15/debian/gcc-2.95.prerm @@ -0,0 +1,3 @@ +#! /bin/sh -e + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/gcc-docs.postinst +++ gcc-2.95-2.95.4.ds15/debian/gcc-docs.postinst @@ -0,0 +1,3 @@ +#! /bin/sh -e + +if [ "$1" = "configure" ]; then if [ -d /usr/doc -a ! -e /usr/doc/gcc-docs -a -d /usr/share/doc/gcc-docs ]; then ln -sf ../share/doc/gcc-docs /usr/doc/gcc-docs; fi; fi --- gcc-2.95-2.95.4.ds15.orig/debian/gpc-run.1 +++ gcc-2.95-2.95.4.ds15/debian/gpc-run.1 @@ -0,0 +1,36 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.24. +.TH GPC-RUN "1" "November 2002" "gpc-run 20021111" FSF +.SH NAME +gpc-run \- manual page for gpc-run 20021111 +.SH SYNOPSIS +.B gpc-run +[\fIoptions\fR] \fIcommand arguments\fR +.SH DESCRIPTION +gpc-run: Run programs compiled with GPC and translate runtime error +messages to a more human readable format. +.SH OPTIONS +.TP +\fB\-\-help\fR +Display this help and exit +.TP +\fB\-\-version\fR +Display this help and exit +.TP +\fB\-r\fR RUNNER +Run executable with RUNNER +.TP +\fB\-e\fR FILE +Redirect stderr of program to FILE +(if FILE is `-', leave stderr; by default, stderr is redirected +to stdout, and only the stack dump etc. appears on stderr) +.TP +\fB\-E\fR FILE +Append stderr of program to FILE +.SH COPYRIGHT +Copyright \(co 2001-2002 Free Software Foundation, Inc. +.PP +This program is part of GPC. GPC is free software; see the source +for copying conditions. There is NO warranty; not even for +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +.PP +Copyright \(co 2001-2002 Free Software Foundation, Inc. --- gcc-2.95-2.95.4.ds15.orig/debian/gpc-2.95-doc.postinst +++ gcc-2.95-2.95.4.ds15/debian/gpc-2.95-doc.postinst @@ -0,0 +1,7 @@ +#! /bin/sh -e + +install-info --quiet --section "Development" "Development" \ + --description="The GNU Pascal compiler." \ + /usr/share/info/gpc-2.95.info + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/g++-2.95.preinst +++ gcc-2.95-2.95.4.ds15/debian/g++-2.95.preinst @@ -0,0 +1,9 @@ +#! /bin/sh -e + +# get rid off dangling symlinks report in #52359 + +for i in /etc/alternatives/c++.1.gz /usr/man/man1/c++.1.gz; do + if [ -L $i -a ! -r $i ]; then + rm -f $i + fi +done --- gcc-2.95-2.95.4.ds15.orig/debian/libg++-dbg.prerm +++ gcc-2.95-2.95.4.ds15/debian/libg++-dbg.prerm @@ -0,0 +1,3 @@ +#! /bin/sh -e + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/libg++.prerm +++ gcc-2.95-2.95.4.ds15/debian/libg++.prerm @@ -0,0 +1,3 @@ +#! /bin/sh -e + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/README.patches +++ gcc-2.95-2.95.4.ds15/debian/README.patches @@ -0,0 +1,30 @@ +Patches applied to the Debian version of egcs +--------------------------------------------- + +Debian specific patches can be found in the debian/patches directory. +Each patch is accompanied by a shell script to apply and unapply the +patch: + +- The script can be found in the debian/patches directory and is called + .dpatch. +- The shell script is called by the debian/rules file with the option + '-patch' to apply the patch and and with '-unpatch' to unapply + the patch. The working directory is the source directory. +- The shell script returns 0 on success and 1 on failure when + (un)applying the patch. The patch program itself should be called with + --force to prevent questions. +- debian/rules creates a file patched- in the source + directory when applying the patch and removes this file when + unapplying the patch. + +Besides the patches, the following add-ons were included: + +- gpc (unpacked from gpc-19990118.tar.gz) + ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/beta/gpc-19990118.tar.gz + +If these package(s) aren't found in the gcc source directory, it's +assumed that the tarball(s) can be found in the parent directory. See +debian/rules for more details. + +Before making a source package, these packages need to be unpacked. +You can use "debian/rules unpack-addons". --- gcc-2.95-2.95.4.ds15.orig/debian/README.snapshot +++ gcc-2.95-2.95.4.ds15/debian/README.snapshot @@ -0,0 +1,41 @@ +The snapshot packages come in two varieties. Those ending in -ss are +snapshots which can coexist with a stable compiler. Those ending in +-snap-main conflict with the standard versions and function as a system's +primary compiler. + +To create a snapshot source package you need a gpc snapshot (URL below), a +recent libg++, and an gcc snapshot direct from CVS. Then goto the directory +where you unpacked gcc and call "debian/rules unpack-addons". More details +on those two steps are in the bottom of debian/rules. +This is your .orig.tar.gz - just gcc from CVS, gpc, and libg++ untarred. +Save it. + +Apply the patches in debian/patches (debian/rules has debatably function +stubs to do this). Patch gcc for gpc (see gcc/p/diffs for details). Add +the debian directory. If the snapshot has not changed too greatly from the +last one, all three of these steps can be accomplished by applying the +previous diff.gz. + +The current patch to enable GPC will be in the debian/patches directory if +it was not included with the gpc snapshot. + +All packages: +============= + +- Derived from the gcc CVS archive, main branch. +- Results of the testsuite in /usr/doc//test-summary +- You find all gcc-ss files in /usr/lib/gcc-ss, e.g. all binaries + in /usr/lib/gcc-ss/bin, etc ... +- No info files are updated for the -ss packages. See /usr/lib/gcc-ss/info. + +C++: +==== + +- You must explicitly set LD_LIBRARY_PATH that it contains /usr/lib/gcc-ss/lib. + +Pascal: +======= + +- Derived from the gpc-19990118 snapshot, from: + ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/beta/gpc-19990118.tar.gz +- The gpc testsuite fails with dejagnu-971222; use dejagnu-1.3 instead. --- gcc-2.95-2.95.4.ds15.orig/debian/g77-2.95-doc.prerm +++ gcc-2.95-2.95.4.ds15/debian/g77-2.95-doc.prerm @@ -0,0 +1,5 @@ +#! /bin/sh -e + +install-info --quiet --remove g77-2.95 + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/gcc-2.95-doc.doc-base +++ gcc-2.95-2.95.4.ds15/debian/gcc-2.95-doc.doc-base @@ -0,0 +1,10 @@ +Document: gcc-2.95-doc +Title: The GNU C and C++ compiler +Author: Various +Abstract: This manual documents how to run, install and port the GNU compiler, + as well as its new features and incompatibilities, and how to report bugs. +Section: Apps/Programming + +Format: info +Index: /usr/share/info/gcc-2.95.info.gz +Files: /usr/share/info/gcc-2.95* --- gcc-2.95-2.95.4.ds15.orig/debian/protoize-2.95.prerm +++ gcc-2.95-2.95.4.ds15/debian/protoize-2.95.prerm @@ -0,0 +1,9 @@ +#! /bin/sh -e + +#DEBHELPER# + +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/protoize ]; then rm -f /usr/doc/protoize; fi + +#if [ $1 != "upgrade" -a -n "$pkg_ver" ]; then +# update-alternatives --remove protoize /usr/bin/protoize$pkg_ver +#fi --- gcc-2.95-2.95.4.ds15.orig/debian/gpc-2.95.prerm +++ gcc-2.95-2.95.4.ds15/debian/gpc-2.95.prerm @@ -0,0 +1,3 @@ +#! /bin/sh -e + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/libg++-dbg.postinst +++ gcc-2.95-2.95.4.ds15/debian/libg++-dbg.postinst @@ -0,0 +1,3 @@ +#! /bin/sh -e + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/libstdc++-dev-config +++ gcc-2.95-2.95.4.ds15/debian/libstdc++-dev-config @@ -0,0 +1,40 @@ +#! /bin/sh + +PATH=/usr/bin:/bin:/sbin + +case "$1" in + --debian|-d) + kind=debian + newlink=../../../libstdc++-libc6.0-1.so.2;; + --compatible|-c) + kind=compatible + newlink=../../../libstdc++.so.2.9;; + *) + echo >&2 "Usage: `basename $0` -d|--debian|-c|--compatible" + exit 1 +esac + +ARCH="`uname -m`" +case "$ARCH" in i?86) ARCH=i486; esac +gcclib=/usr/lib/gcc-lib/$ARCH-linux/egcs-2.91.63/libstdc++.so + +link="`ls -l $gcclib | awk '{print $NF}'`" + +if [ "$link" = "$newlink" ]; then + echo >&2 "The $kind libstdc++-dev version is already used." + exit 0 +fi + +case "$link" in + ../../../libstdc++-libc6.0-1.so.2) + echo rm -f $gcclib + echo ln -s $newlink $gcclib + ;; + ../../../libstdc++.so.2.9) + echo rm -f $gcclib + echo ln -s $newlink $gcclib + ;; + *) + echo >&2 "A glibc-2.1 based libstdc++-dev already is used." + exit 1 +esac --- gcc-2.95-2.95.4.ds15.orig/debian/g++-2.95.prerm +++ gcc-2.95-2.95.4.ds15/debian/g++-2.95.prerm @@ -0,0 +1,3 @@ +#! /bin/sh -e + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/gcc.postinst.bisparc +++ gcc-2.95-2.95.4.ds15/debian/gcc.postinst.bisparc @@ -0,0 +1,15 @@ +#! /bin/sh -e + +update-alternatives \ + --install /usr/bin/cc cc /usr/bin/gcc 20 \ + --slave /usr/share/man/man1/cc.1.gz cc.1.gz /usr/share/man/man1/gcc.1.gz + +if [ "`uname -m`" = sparc ]; then + # Remove the old incorrect alternative + update-alternatives --remove sparc64-linux-gcc /usr/bin/gcc || true + update-alternatives \ + --install /usr/bin/sparc64-linux-gcc sparc64-linux-gcc \ + /usr/bin/sparc64-linux-gcc-wrapper 30 +fi + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/cpp-2.95-doc.doc-base +++ gcc-2.95-2.95.4.ds15/debian/cpp-2.95-doc.doc-base @@ -0,0 +1,12 @@ +Document: cpp-2.95-doc +Title: The GNU C preprocessor +Author: Various +Abstract: The C preprocessor is a "macro processor" that is used automatically + by the C compiler to transform your program before actual compilation. + It is called a macro processor because it allows you to define "macros", + which are brief abbreviations for longer constructs. +Section: Apps/Programming + +Format: info +Index: /usr/share/info/cpp-2.95.info.gz +Files: /usr/share/info/cpp-2.95* --- gcc-2.95-2.95.4.ds15.orig/debian/genclass.1 +++ gcc-2.95-2.95.4.ds15/debian/genclass.1 @@ -0,0 +1,43 @@ +.TH GENCLASS 1 +.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection +.\" other parms are allowed: see man(7), man(1) +.SH NAME +genclass \- generate classes from prototypes +.SH SYNOPSIS +.B genclass +.I "-list [proto ...]" +.br +.B genclass +.I "-catalog [proto ...]" +.br +.B genclass +.I "type1 {ref|val} proto [out_prefix]" +.br +.B genclass +.I "-2 type1 {ref|val} type2 {ref, val} proto [out_prefix]" +.br +.SH "DESCRIPTION" +This manual page documents briefly the +.BR genclass +command. +This manual page was written for the Debian GNU/Linux distribution +(but may be used by others), because the original program does not +have a manual page. +Instead, it has documentation in the GNU Info format; see below. +.PP +.B genclass +is a part of the GNU libg++ library to generate classes from +prototypes and was used as a temporary mechanism enabling the support +of generic classes in libg++. The libg++ package is no longer supported +upstream (as most of its functionality is now in the standard C++ +library) - do not use this for development of new software; use +libstdc++ instead. +.SH "SEE ALSO" +The program is documented fully by +.IR "Libg++: The g++ class library.", +available via the Info system. The documentation for genclass can be +found in the subsection "Proto", under "Introduction to container +class prototypes" +.SH AUTHOR +This manual page was written by the egcs maintainers for the Debian +GNU/Linux system. --- gcc-2.95-2.95.4.ds15.orig/debian/glibcver.sh +++ gcc-2.95-2.95.4.ds15/debian/glibcver.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +ver=`ls -1 /lib/libc-*.so | sed -e 's|/.*-||' -e 's|\.so||'` + +major=`echo $ver | awk -F. '{print $1}'` +minor=`echo $ver | awk -F. '{print $2}'` +rev=`echo $ver | awk -F. '{print $3}'` + +if [ -z "$rev" ]; then + version=$ver +else + if [ "$rev" -ge 90 ]; then + minor=`expr $minor + 1` + fi + + version="${major}.${minor}" +fi + +if [ "$version" = 2.3 ]; then + version=2.2 +fi +echo -n $version +exit --- gcc-2.95-2.95.4.ds15.orig/debian/gobjc-2.95.postinst +++ gcc-2.95-2.95.4.ds15/debian/gobjc-2.95.postinst @@ -0,0 +1,3 @@ +#! /bin/sh -e + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/libstdc++.prerm +++ gcc-2.95-2.95.4.ds15/debian/libstdc++.prerm @@ -0,0 +1,3 @@ +#! /bin/sh -e + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/build +++ gcc-2.95-2.95.4.ds15/debian/build @@ -0,0 +1,4 @@ +#!/bin/sh +date >> ../egcs.start +dpkg-buildpackage -rfakeroot +date >> ../egcs.end --- gcc-2.95-2.95.4.ds15.orig/debian/c89.1 +++ gcc-2.95-2.95.4.ds15/debian/c89.1 @@ -0,0 +1,68 @@ +.\" $NetBSD: c89.1,v 1.5 1999/04/10 15:22:27 kleink Exp $ +.\" +.\" Copyright (c) 1999 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the NetBSD +.\" Foundation, Inc. and its contributors. +.\" 4. Neither the name of The NetBSD Foundation nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.TH C89 1 +.SH NAME +c89 \- ANSI (1989) C compiler +.SH SYNOPSIS +.B c89 +.I +.RB "[\-pedantic]" +.RB "[\-pedantic-errors]" +.RB "[\-D_ANSI_SOURCE]" +options ... +.SH DESCRIPTION +Calls the C compiler (cc) with the given +.B options , +using a C language environment compatible with the +-ansiC specification. +.PP +This includes proper handling of trigraphs, +disabling non-ANSI compiler features (such as +.B asm , +.B inline , +.B typeof , +and the $ character in identifiers), +and definition of the preprocessor symbol +__STRICT_ANSI__ . +.SH SEE ALSO +cc(1) for a description of all options. +.SH HISTORY +Appeared in +NetBSD 1.4 . +.SH BUGS +Since +.B c89 +is a shell wrapper script to +.B cc , +compile errors are prefixed by "cc:". --- gcc-2.95-2.95.4.ds15.orig/debian/gobjc-2.95.prerm +++ gcc-2.95-2.95.4.ds15/debian/gobjc-2.95.prerm @@ -0,0 +1,3 @@ +#! /bin/sh -e + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/gpc-2.95.postinst +++ gcc-2.95-2.95.4.ds15/debian/gpc-2.95.postinst @@ -0,0 +1,3 @@ +#! /bin/sh -e + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/rules.defs.save +++ gcc-2.95-2.95.4.ds15/debian/rules.defs.save @@ -0,0 +1,67 @@ +# -*- makefile -*- +# definitions used in more than one Makefile / rules file + +SHELL := /bin/bash -e # brace expansion used in rules file +PWD := $(shell pwd) +srcdir = $(PWD)/src +builddir = $(PWD)/build +stampdir = stamps + +# architecture dependent variables +DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) +DEB_HOST_GNU_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) +DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM) +DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) + +# --------------------------------------------------------------------------- +# which binary packages are built? + +# The name of the source package // better: set SNAPSHOT explicitely +PKGSOURCE := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2;exit 0}') + +# There are three classes of packages this can build: gcc, gcc-ss, and +# gcc-snap-main are the types. These are SNAPSHOT=no, yes, and fake +# respectively. gcc-snap-main produces a package named gcc, but of a +# snapshot version. +# This is all controlled by the environment variable BUILDFAKE=yes +ifeq ($(PKGSOURCE),gcc) + SNAPSHOT = no +else + ifneq ($(BUILDFAKE),yes) + SNAPSHOT=yes + else + SNAPSHOT=fake + endif +endif + +# debugging versions of libstdc++ (and libg++, if built) +with_debug := yes + +# build the libg++ library (deprecated, but needed for groff) +with_libgpp := yes + +# See, if the GNU pascal compiler is found +with_pascal := yes +# if pascal doesn't build on some target, disable it ... +ifeq ($(DEB_HOST_ARCH), $(findstring $(DEB_HOST_ARCH),enabled-for-all)) + with_pascal := disabled for architecture $(DEB_HOST_ARCH) +endif +# disable the GNU pascal compiler by hand +#with_pascal := disabled by hand + +# the ObjC runtime with garbage collection enabled needs the Boehm GC +with_objc_gc := yes +# disable ObjC garbage collection library (needs libgc4) +ifeq ($(DEB_HOST_ARCH), $(findstring $(DEB_HOST_ARCH),alpha arm powerpc m68k)) + with_objc_gc := disabled for architecture $(DEB_HOST_ARCH) +endif + +unpack_stamp := $(stampdir)/01-unpack-stamp +patch_stamp := $(stampdir)/02-patch-stamp +control_stamp := $(stampdir)/03-control-stamp +configure_stamp := $(stampdir)/04-configure-stamp +build_stamp := $(stampdir)/05-build-stamp +install_stamp := $(stampdir)/06-install-stamp + +stamp-dir: + @[ -d $(stampdir) ] || mkdir $(stampdir) --- gcc-2.95-2.95.4.ds15.orig/debian/copyright +++ gcc-2.95-2.95.4.ds15/debian/copyright @@ -0,0 +1,52 @@ +This is the Debian GNU/Linux prepackaged version of the GCC compiler collection, +containing C, C++, Objective-C, Fortran-77, Java, Chill and Pascal compilers, +and the libstdc++ support library. The EGCS steering comittee became +maintainer of the GNU gcc compiler suite in March 1999. + +The compilers are split into several binary packages: gcc (which +has support for C, g++ (which supports C++), gobjc (which supports +Objective C), g77 (supports Fortran), gcj (supports Java), chill (supports +Chill) and gpc (supports standard, extended and Borland Pascal). +A version of libstdc++-v2 and libg++ are also provided. +Documentation is provided in the packages gcc-doc, g77-doc and gpc-doc. + +This package was put together by the Debian GCC maintainers +, with sources obtained from: + + [NOTE: the current prereleases obtained from the CVS archive] + ftp://gcc.gnu.org/pub/gcc/releases/gcc-2.95.3.tar.gz + ftp://gcc.gnu.org/pub/gcc/infrastructure/libg++-2.8.1.3.tar.gz + ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/alpha/gpc-20011202.tar.gz + +where yyyymmdd corresponds to the Debian package version. + +Changes: see changelog.Debian.gz + +GCC is Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, +1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + +libg++ is copyright Free Software Foundation, and is licensed under +the GNU Library General Public License which on Debian GNU/Linux +systems can be found as `/usr/share/common-licenses/LGPL'. + +gpc is copyright Free Software Foundation, and is licensed under the +GNU General Public License which on Debian GNU/Linux systems can be +found as `/usr/share/common-licenses/GPL'. --- gcc-2.95-2.95.4.ds15.orig/debian/rules.unpack +++ gcc-2.95-2.95.4.ds15/debian/rules.unpack @@ -0,0 +1,118 @@ +# -*- makefile -*- +# rules to unpack the source tarballs in $(srcdir); if the source dir already +# exists, the rule exits with an error to prevent deletion of modified +# source files. It has to be deleted manually. + +gcc_srcdir := gcc-2.95.4 +gcc_tarball := $(gcc_srcdir).tar.gz +gcc_srcdir := gcc-20011006 +gcc_tarball := $(gcc_srcdir).tar.bz2 + +libgpp_srcdir := libg++-2.8.1.3 +libgpp_tarball := $(libgpp_srcdir).tar.gz + +gpc_srcdir := gpc-20030830 +gpc_tarball := gpc-2.1.tar.gz +gpc_tarball := gpc-20030830.tar.gz + +testsuite_srcdir := gcc-20001127 +testsuite_tarball := gcc-tests-20001127.tar.gz + +testsuite_srcdir := gcc-3.0.3 +testsuite_tarball := gcc-testsuite-3.0.3.tar.bz2 + +tarballs = $(gcc_tarball) $(instdoc_tarball) +#ifeq ($(with_check),yes) +# tarballs += $(testsuite_tarball) +#endif +ifeq ($(with_libgpp),yes) + tarballs += $(libgpp_tarball) +endif +ifeq ($(with_pascal),yes) + tarballs += $(gpc_tarball) +endif + +unpack_stamps = $(foreach i,$(tarballs),$(unpack_stamp)-$(TARGET)-$(i)) + +unpack: stamp-dir $(unpack_stamp)-$(TARGET) +$(unpack_stamp)-$(TARGET): $(unpack_stamps) +$(unpack_stamp)-$(TARGET): $(foreach p,$(debian_tarballs),unpacked-$(TARGET)-$(p)) + echo -e "\nBuilt from Debian source package $(PKGSOURCE)-$(DPKGVER)" \ + > pxxx + echo -e "Integrated upstream packages in this version:\n" >> pxxx + for i in $(tarballs); do echo " $$i" >> pxxx; done + mv -f pxxx $@ + +# --------------------------------------------------------------------------- +$(unpack_stamp)-$(TARGET)-$(gcc_tarball): $(gcc_tarball) + @echo ===== $@ + : # unpack gcc tarball + -mkdir $(stampdir) + if [ -d $(srcdir) ]; then \ + echo >&2 "Source directory $(srcdir) exists. Delete by hand"; \ + false; \ + fi + rm -rf $(gcc_srcdir) + case $(gcc_tarball) in \ + *.bz2) tar -x -p --bzip2 -f $(gcc_tarball);; \ + *.gz) tar -x -p --gzip -f $(gcc_tarball);; \ + *) false; \ + esac + mv $(gcc_srcdir) $(srcdir) + echo "$(gcc_tarball) unpacked." > $@ + +# --------------------------------------------------------------------------- +$(unpack_stamp)-%-$(libgpp_tarball): $(libgpp_tarball) + @echo ===== $@ + : # unpack libg++ tarball + -mkdir $(stampdir) + if [ -d $(srcdir)/libg++ -o -d $(srcdir)/librx ]; then \ + echo >&2 "Source directory $(srcdir)/libg++ exists. Delete by hand";\ + false; \ + fi + rm -rf libg++ + case $(libgpp_tarball) in \ + *.bz2) tar -x -p --bzip2 -f $(libgpp_tarball);; \ + *.gz) tar -x -p --gzip -f $(libgpp_tarball);; \ + *) false; \ + esac + mv $(libgpp_srcdir)/{README.libg++,libg++,librx} $(srcdir)/.; \ + rmdir $(libgpp_srcdir) + echo "$(libgpp_tarball) unpacked." > $@ + +# --------------------------------------------------------------------------- +$(unpack_stamp)-%-$(gpc_tarball): $(gpc_tarball) + @echo ===== $@ + : # unpack gpc tarball + -mkdir $(stampdir) + if [ -d $(srcdir)/gcc/p ]; then \ + echo >&2 "Source directory $(srcdir)/gcc/p exists. Delete by hand";\ + false; \ + fi + rm -rf $(gpc_srcdir) + case $(gpc_tarball) in \ + *.bz2) tar -x -p --bzip2 -f $(gpc_tarball);; \ + *.gz) tar -x -p --gzip -f $(gpc_tarball);; \ + *) false; \ + esac + mv $(gpc_srcdir)/p $(srcdir)/gcc/.; \ + rmdir $(gpc_srcdir) + : # fixme + -chmod 755 $(srcdir)/gcc/p/script/make-library-interface + echo "$(gpc_tarball) unpacked." > $@ + +# --------------------------------------------------------------------------- +$(unpack_stamp)-$(TARGET)-$(testsuite_tarball): $(testsuite_tarball) + @echo ===== $@ + : # unpack testsuite tarball + -mkdir $(stampdir) + rm -rf $(testsuite_srcdir) + case $(testsuite_tarball) in \ + *.bz2) tar -x -p --bzip2 -f $(testsuite_tarball);; \ + *.gz) tar -x -p --gzip -f $(testsuite_tarball);; \ + *) false; \ + esac + rm -rf $(srcdir)/gcc/testsuite + mv $(testsuite_srcdir)/gcc/testsuite $(srcdir)/gcc/. + rm -rf $(testsuite_srcdir) + echo "$(testsuite_tarball) unpacked." > $@ --- gcc-2.95-2.95.4.ds15.orig/debian/shlibs.local +++ gcc-2.95-2.95.4.ds15/debian/shlibs.local @@ -0,0 +1 @@ +libstdc++-libc6.2-2 3 libstdc++2.10-glibc2.2 (>= 1:2.95.4-15) --- gcc-2.95-2.95.4.ds15.orig/debian/chill-2.95.prerm +++ gcc-2.95-2.95.4.ds15/debian/chill-2.95.prerm @@ -0,0 +1,5 @@ +#! /bin/sh -e + +#DEBHELPER# + +install-info --quiet --remove chill-2.95 --- gcc-2.95-2.95.4.ds15.orig/debian/rename-pkgs.sh +++ gcc-2.95-2.95.4.ds15/debian/rename-pkgs.sh @@ -0,0 +1,24 @@ +#! /bin/bash + +rename_pkg() +{ + src=$1 + dest=$2 + for ext in preinst postinst prerm postrm doc-base; do + if [ -f $src.$ext ]; then + if [ -f $dest.ext ]; then + echo already exists: $dest.$ext + else + mv $src.$ext $dest.$ext + fi + fi + done +} + +for p in chill cpp gcc g++ g77 gpc gcj gobjc protoize; do + rename_pkg $p $p-2.95 +done + +for p in cpp gcc g77 gpc; do + rename_pkg $p-doc $p-2.95-doc +done --- gcc-2.95-2.95.4.ds15.orig/debian/g77-2.95.prerm +++ gcc-2.95-2.95.4.ds15/debian/g77-2.95.prerm @@ -0,0 +1,3 @@ +#! /bin/sh -e + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/libstdc++-dbg.postinst +++ gcc-2.95-2.95.4.ds15/debian/libstdc++-dbg.postinst @@ -0,0 +1,3 @@ +#! /bin/sh -e + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/libstdc++-dbg.prerm +++ gcc-2.95-2.95.4.ds15/debian/libstdc++-dbg.prerm @@ -0,0 +1,3 @@ +#! /bin/sh -e + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/libstdc++-dev.postinst +++ gcc-2.95-2.95.4.ds15/debian/libstdc++-dev.postinst @@ -0,0 +1,9 @@ +#! /bin/sh -e + +#DEBHELPER# + +case "$1" in + configure) + install-info --quiet --section "Development" "Development" \ + /usr/share/info/iostream-2.95.info.gz +esac --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gpc-update-makefile.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gpc-update-makefile.dpatch @@ -0,0 +1,75 @@ +#! /bin/sh -e + +dir= +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + dir="$3/" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p0 < $0 + #cd ${dir}gcc && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 + #rm ${dir}gcc/configure + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- gcc/p/Make-lang.in.old 2004-03-08 08:59:41.000000000 +0100 ++++ gcc/p/Make-lang.in 2004-03-08 09:02:18.000000000 +0100 +@@ -562,9 +562,10 @@ + # files (mostly language independent, but some parts require GPC specific + # patches and are rebuilt with -DGPC). + GPC_OBJS=p/parse.o p/declarations.o p/expressions.o p/gpc-lex.o p/lang.o \ +- p/module.o p/objects.o p/options.o p/predef.o p/statements.o p/typecheck.o \ +- p/types.o p/convert.o p/dbxout.o p/dwarf2out.o p/expr.o p/fold-const.o \ +- p/function.o p/integrate.o p/optabs.o p/stor-layout.o p/toplev.o p/tree.o ++ p/module.o p/objects.o p/options.o p/predef.o p/statements.o \ ++ p/typecheck.o p/types.o p/convert.o p/dbxout.o p/dwarf2out.o \ ++ p/expr.o p/fold-const.o p/function.o p/integrate.o p/optabs.o \ ++ p/stor-layout.o p/toplev.o p/tree.o p/stmt.o p/emit-rtl.o + + # Exclude patched files from language-independent object file list. + # Not necessary for gcc-3 since for a library (libbackend.a), the linker does this automatically. +@@ -573,11 +574,13 @@ + s: convert.o::g;\ + s: dbxout.o::g;\ + s: dwarf2out.o::g;\ ++ s: emit-rtl.o::g;\ + s: expr.o::g;\ + s: fold-const.o::g;\ + s: function.o::g;\ + s: integrate.o::g;\ + s: optabs.o::g;\ ++ s: stmt.o::g;\ + s: stor-layout.o::g;\ + s: toplev.o::g;\ + s: tree.o::g' "$<" > "$@" || { rm -f "$@"; false; } +@@ -638,6 +641,9 @@ + p/diagnostic.o: diagnostic.c $(GPC_BE_H) + $(CC) -o $@ -c $(ALL_GPC_GBE_FLAGS) $< + ++p/emit-rtl.o: emit-rtl.c $(GPC_BE_H) ++ $(CC) -o $@ -c $(ALL_GPC_GBE_FLAGS) $< ++ + p/expr.o: expr.c $(GPC_BE_H) + $(CC) -o $@ -c $(ALL_GPC_GBE_FLAGS) $< + +@@ -653,6 +659,9 @@ + p/optabs.o: optabs.c $(GPC_BE_H) + $(CC) -o $@ -c $(ALL_GPC_GBE_FLAGS) $< + ++p/stmt.o: stmt.c $(GPC_BE_H) ++ $(CC) -o $@ -c $(ALL_GPC_GBE_FLAGS) $< ++ + p/stor-layout.o: stor-layout.c $(GPC_BE_H) + $(CC) -o $@ -c $(ALL_GPC_GBE_FLAGS) $< + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/builtin-apply.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/builtin-apply.dpatch @@ -0,0 +1,80 @@ +#! /bin/sh -e + +# DP: On Sparc, message forwarding in the GNUstep framework +# DP: (gstep-base) relies on this patch. I didn't experience any side +# DP: effects of this "workaround" on a sparc Solaris platform. However +# DP: this workaround affects the all compilers of the egcs package. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +From: Richard Henderson +To: Matthias.Klose@cs.tu-berlin.de, scottc@net-community.com +Subject: Re: patch for expand_builtin_apply for sparc architecture +Date: Mon, 16 Feb 1998 05:11:32 -0800 + +In article <199802160833.JAA11275.cygnus.egcs.bugs@gargleblaster.cs.tu-berlin.de>, +Matthias Klose wrote: +>The following patch fixes the generation of an 'unimp 4095' +>instruction for the expansion of __builtin_apply on the sparc +>architecture; fix by Scott Christley (), but +>doesn't seem to be submitted to the the egcs list. + +You'll have to submit a test case and an explanation of why you think +this is correct. The Sparc32 ABI calls for an unimp instruction to +be emitted following calls to functions that return structures. The +0-4095 immediate is commentary, but that's all the room in that field +so we cannot simply remove the mask. + +My guess is that it is yet another example of why __builtin_apply +is inadequate for the needs of all but completely stack-based calling +conventions and should not be used. + + +r~ + +diff -c gcc/config/sparc/sparc.md~ gcc/config/sparc/sparc.md +*** gcc/config/sparc/sparc.md~ Mon Nov 16 12:31:32 1998 +--- gcc/config/sparc/sparc.md Mon Nov 16 12:35:56 1998 +*************** +*** 7294,7299 **** +--- 7294,7300 ---- + Why cannot we have delay slots filled if it were a CALL? */ + + if (! TARGET_ARCH64 && INTVAL (operands[3]) != 0) ++ #if 0 + emit_jump_insn + (gen_rtx_PARALLEL (VOIDmode, + gen_rtvec (3, +*************** +*** 7302,7307 **** +--- 7303,7318 ---- + GEN_INT (INTVAL (operands[3]) & 0xfff), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_REG (Pmode, 15))))); ++ #else ++ emit_jump_insn ++ (gen_rtx_PARALLEL (VOIDmode, ++ gen_rtvec (3, ++ gen_rtx_SET (VOIDmode, pc_rtx, ++ XEXP (operands[0], 0)), ++ operands[3], ++ gen_rtx_CLOBBER (VOIDmode, ++ gen_rtx_REG (Pmode, 15))))); ++ #endif + else + emit_jump_insn + (gen_rtx_PARALLEL (VOIDmode, --- gcc-2.95-2.95.4.ds15.orig/debian/patches/protoize.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/protoize.dpatch @@ -0,0 +1,31 @@ +#! /bin/sh -e + +# DP: build protoize/unprotoize by default + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- gcc/Makefile.in~ Tue Apr 25 16:52:30 2000 ++++ gcc/Makefile.in Wed Apr 26 11:41:08 2000 +@@ -44,7 +44,7 @@ + # Selection of languages to be made. + # This is overridden by configure. + CONFIG_LANGUAGES = @all_languages@ +-LANGUAGES = c gcov$(exeext) $(CONFIG_LANGUAGES) ++LANGUAGES = c proto gcov$(exeext) $(CONFIG_LANGUAGES) + + + # Languages should create dependencies of $(INTL_TARGETS) on generated + # sources in Make-lang.in. Example: --- gcc-2.95-2.95.4.ds15.orig/debian/patches/arm-various.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/arm-various.dpatch @@ -0,0 +1,131 @@ +#! /bin/sh -e + +# DP: Some fixes for ARM from Philip Blundell + +src=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + src=$3/gcc +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p1 --fuzz 10 < $0 + cd $src && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p1 --fuzz 10 < $0 + cd $src && autoconf + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +diff -urpN src.orig/gcc/config/arm/arm.c src/gcc/config/arm/arm.c +--- src.orig/gcc/config/arm/arm.c Thu Nov 16 15:54:36 2000 ++++ src/gcc/config/arm/arm.c Thu Nov 16 16:01:51 2000 +@@ -5339,7 +5339,13 @@ output_return_instruction (operand, real + if (frame_pointer_needed) + live_regs += 4; + +- if (live_regs) ++ if (live_regs == 1 && regs_ever_live[LR_REGNUM] ++ && ! lr_save_eliminated && ! really_return) ++ { ++ output_asm_insn (reverse ? "ldr%?%D0\t%|lr, [%|sp}, #4" ++ : "ldr%?%d0\t%|lr, [%|sp], #4", &operand); ++ } ++ else if (live_regs) + { + if (lr_save_eliminated || ! regs_ever_live[14]) + live_regs++; +diff -urpN src.orig/gcc/config/arm/arm.h src/gcc/config/arm/arm.h +--- src.orig/gcc/config/arm/arm.h Thu Nov 16 15:54:36 2000 ++++ src/gcc/config/arm/arm.h Thu Nov 16 16:01:52 2000 +@@ -600,14 +600,20 @@ extern int arm_is_6_or_7; + (TREE_CODE (EXP) == STRING_CST \ + && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) + ++#ifndef STRUCTURE_SIZE_BOUNDARY + /* Every structures size must be a multiple of 32 bits. */ + /* This is for compatibility with ARMCC. ARM SDT Reference Manual + (ARM DUI 0020D) page 2-20 says "Structures are aligned on word + boundaries". */ +-#ifndef STRUCTURE_SIZE_BOUNDARY +-#define STRUCTURE_SIZE_BOUNDARY 32 ++/* Setting this to 32 produces more efficient code, but the value set in previous ++ versions of this toolchain was 8, which produces more compact structures. The ++ command line option -mstructure_size_boundary= can be used to change this ++ value. */ ++#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary + #endif + ++extern int arm_structure_size_boundary; ++ + /* Used when parsing command line option -mstructure_size_boundary. */ + extern const char * structure_size_string; + +@@ -766,6 +772,9 @@ extern const char * structure_size_strin + + /* Specify the registers used for certain standard purposes. + The values of these macros are register numbers. */ ++ ++/* Register which holds return address from a subroutine call. */ ++#define LR_REGNUM 14 + + /* Define this if the program counter is overloaded on a register. */ + #define PC_REGNUM 15 +diff -urpN src.orig/gcc/config/arm/arm.md src/gcc/config/arm/arm.md +--- src.orig/gcc/config/arm/arm.md Thu Nov 16 15:54:36 2000 ++++ src/gcc/config/arm/arm.md Thu Nov 16 16:01:52 2000 +@@ -6179,15 +6187,20 @@ + abort (); + return \"\"; + } +- strcpy (pattern, \"stmfd\\t%m0!, {%1\"); +- for (i = 1; i < XVECLEN (operands[2], 0); i++) ++ if (XVECLEN (operands[2], 0) > 1) + { +- strcat (pattern, \", %|\"); +- strcat (pattern, reg_names[REGNO (XEXP (XVECEXP (operands[2], 0, i), ++ strcpy (pattern, \"stmfd\\t%m0!, {%1\"); ++ for (i = 1; i < XVECLEN (operands[2], 0); i++) ++ { ++ strcat (pattern, \", %|\"); ++ strcat (pattern, reg_names[REGNO (XEXP (XVECEXP (operands[2], 0, i), + 0))]); ++ } ++ strcat (pattern, \"}\"); ++ output_asm_insn (pattern, operands); + } +- strcat (pattern, \"}\"); +- output_asm_insn (pattern, operands); ++ else ++ output_asm_insn (\"str\\t%1, [%m0, #-4]!\", operands); + return \"\"; + }" + [(set_attr "type" "store4")]) +diff -urpN src.orig/gcc/config/arm/elf.h src/gcc/config/arm/elf.h +--- src.orig/gcc/config/arm/elf.h Mon May 31 09:21:53 1999 ++++ src/gcc/config/arm/elf.h Thu Nov 16 16:01:52 2000 +@@ -167,15 +167,6 @@ do { \ + #define MULTILIB_DEFAULTS { "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" } + #endif + +-/* Setting this to 32 produces more efficient code, but the value set in previous +- versions of this toolchain was 8, which produces more compact structures. The +- command line option -mstructure_size_boundary= can be used to change this +- value. */ +-#undef STRUCTURE_SIZE_BOUNDARY +-#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary +- +-extern int arm_structure_size_boundary; +- + /* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS + is a valid machine specific attribute for DECL. + The attributes in ATTRIBUTES have previously been assigned to DECL. */ + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-alpha-complex-float.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-alpha-complex-float.dpatch @@ -0,0 +1,160 @@ +#! /bin/sh -e + +# All lines beginning with `# DP:' are a description of the patch. +# DP: Fix for complex math on alpha + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +(from Joel Klecker's original message): + + I've tested this patch with building glibc and it enables it to compile, I + haven't been able to test the resulting binaries yet, however. I assume + this will fix the g77 problems too. + + * flow.c (insn_dead_p): Don't kill part of a complex number. + * emit-rtl.c (gen_lowpart_common): Handle narrow complex reg values. + (gen_highpart): Likewise. + * calls.c (expand_call): Narrow complex variable uses two regs. + * alpha/alpha.h (ALPHA_ARG_SIZE): Likewise. + (HARD_REGNO_NREGS): Likewise. + +diff -ur gcc-2.95.2/gcc/calls.c gcc-2.95.2.patched/gcc/calls.c +--- gcc-2.95.2/gcc/calls.c Fri May 7 21:58:39 1999 ++++ gcc-2.95.2.patched/gcc/calls.c Sat Feb 19 14:26:21 2000 +@@ -1499,6 +1499,11 @@ + validize_mem (args[i].value), nregs, + args[i].mode); + ++ /* Indicate two regs used to hold a short complex arg. */ ++ if (GET_MODE_CLASS (args[i].mode) == MODE_COMPLEX_FLOAT ++ && GET_MODE_SIZE (args[i].mode) <= UNITS_PER_WORD) ++ nregs = 2; ++ + /* Handle calls that pass values in multiple non-contiguous + locations. The Irix 6 ABI has examples of this. */ + if (GET_CODE (reg) == PARALLEL) +diff -ur gcc-2.95.2/gcc/config/alpha/alpha.h gcc-2.95.2.patched/gcc/config/alpha/alpha.h +--- gcc-2.95.2/gcc/config/alpha/alpha.h Fri Jun 25 01:09:12 1999 ++++ gcc-2.95.2.patched/gcc/config/alpha/alpha.h Sat Feb 19 14:28:45 2000 +@@ -622,7 +622,10 @@ + but can be less for certain modes in special long registers. */ + + #define HARD_REGNO_NREGS(REGNO, MODE) \ +- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) ++ ((GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT \ ++ && GET_MODE_SIZE (MODE) <= UNITS_PER_WORD) \ ++ ? 2 \ ++ : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) + + /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. + On Alpha, the integer registers can hold any mode. The floating-point +@@ -1070,12 +1073,16 @@ + #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) (CUM) = 0 + + /* Define intermediate macro to compute the size (in registers) of an argument +- for the Alpha. */ ++ for the Alpha. ++ A short complex arg takes two registers. */ + + #define ALPHA_ARG_SIZE(MODE, TYPE, NAMED) \ +-((MODE) != BLKmode \ +- ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \ +- : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) ++ ((GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT \ ++ && GET_MODE_SIZE (MODE) <= UNITS_PER_WORD) \ ++ ? 2 \ ++ : ((MODE) != BLKmode \ ++ ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \ ++ : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)) + + /* Update the data in CUM to advance over an argument + of mode MODE and data type TYPE. +diff -ur gcc-2.95.2/gcc/emit-rtl.c gcc-2.95.2.patched/gcc/emit-rtl.c +--- gcc-2.95.2/gcc/emit-rtl.c Wed Aug 11 03:28:52 1999 ++++ gcc-2.95.2.patched/gcc/emit-rtl.c Sat Feb 19 14:31:19 2000 +@@ -749,6 +749,15 @@ + && ! HARD_REGNO_MODE_OK (REGNO (x) + word, mode) + && HARD_REGNO_MODE_OK (REGNO (x), GET_MODE (x))) + return 0; ++ else if (GET_MODE_CLASS (GET_MODE (x)) == MODE_COMPLEX_FLOAT ++ && GET_MODE_SIZE (GET_MODE (x)) <= UNITS_PER_WORD ++ && REGNO (x) < FIRST_PSEUDO_REGISTER) ++ { ++ if (REG_FUNCTION_VALUE_P (x)) ++ return gen_rtx (SUBREG, mode, x, 0); ++ else ++ return gen_rtx (REG, mode, REGNO (x)); ++ } + else if (REGNO (x) < FIRST_PSEUDO_REGISTER + /* integrate.c can't handle parts of a return value register. */ + && (! REG_FUNCTION_VALUE_P (x) +@@ -972,11 +981,6 @@ + { + if (GET_CODE (x) == CONCAT && GET_MODE (XEXP (x, 0)) == mode) + return XEXP (x, 0); +- else if (WORDS_BIG_ENDIAN +- && GET_MODE_BITSIZE (mode) < BITS_PER_WORD +- && REG_P (x) +- && REGNO (x) < FIRST_PSEUDO_REGISTER) +- fatal ("Unable to access real part of complex value in a hard register on this target"); + else if (WORDS_BIG_ENDIAN) + return gen_highpart (mode, x); + else +@@ -995,11 +999,6 @@ + return XEXP (x, 1); + else if (WORDS_BIG_ENDIAN) + return gen_lowpart (mode, x); +- else if (!WORDS_BIG_ENDIAN +- && GET_MODE_BITSIZE (mode) < BITS_PER_WORD +- && REG_P (x) +- && REGNO (x) < FIRST_PSEUDO_REGISTER) +- fatal ("Unable to access imaginary part of complex value in a hard register on this target"); + else + return gen_highpart (mode, x); + } +@@ -1134,6 +1133,16 @@ + word = ((GET_MODE_SIZE (GET_MODE (x)) + - MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD)) + / UNITS_PER_WORD); ++ ++ if (GET_MODE_CLASS (GET_MODE (x)) == MODE_COMPLEX_FLOAT ++ && GET_MODE_SIZE (GET_MODE (x)) <= UNITS_PER_WORD ++ && REGNO (x) < FIRST_PSEUDO_REGISTER) ++ { ++ if (REG_FUNCTION_VALUE_P (x)) ++ return gen_rtx (SUBREG, mode, x, 1); ++ else ++ return gen_rtx (REG, mode, REGNO (x) + 1); ++ } + + if (REGNO (x) < FIRST_PSEUDO_REGISTER + /* integrate.c can't handle parts of a return value register. */ +diff -ur gcc-2.95.2/gcc/flow.c gcc-2.95.2.patched/gcc/flow.c +--- gcc-2.95.2/gcc/flow.c Wed Aug 4 03:09:48 1999 ++++ gcc-2.95.2.patched/gcc/flow.c Sat Feb 19 14:34:02 2000 +@@ -2995,6 +2995,10 @@ + while (--n > 0) + if (REGNO_REG_SET_P (needed, regno+n)) + return 0; ++ ++ /* Don't allow part of a complex number to be deleted. */ ++ if (GET_MODE_CLASS (GET_MODE (r)) == MODE_COMPLEX_FLOAT) ++ return 0; + } + + return 1; + + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/arm-profile.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/arm-profile.dpatch @@ -0,0 +1,36 @@ +#! /bin/sh -e + +# DP: ARM profiling fix + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 --fuzz 10 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 --fuzz 10 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- gcc/config/arm/linux-elf.h.old Tue Jul 30 23:19:59 2002 ++++ gcc/config/arm/linux-elf.h Tue Jul 30 23:20:47 2002 +@@ -304,3 +304,14 @@ + #undef FP_DEFAULT + #define FP_DEFAULT FP_SOFT3 + #endif ++ ++/* Call the function profiler with a given profile label. */ ++#undef FUNCTION_PROFILER ++#define FUNCTION_PROFILER(STREAM, LABELNO) \ ++{ \ ++ fprintf (STREAM, "\tbl\tmcount%s\n", NEED_PLT_GOT ? "(PLT)" : ""); \ ++} ++ ++#undef CC1_SPEC ++#define CC1_SPEC "%{profile:-p}" ++ --- gcc-2.95-2.95.4.ds15.orig/debian/patches/arm-nested-func.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/arm-nested-func.dpatch @@ -0,0 +1,171 @@ +#! /bin/sh -e + +# DP: ARM patch for nested functions + +src=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + src=$3/gcc +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p1 --fuzz 10 < $0 + cd $src && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p1 --fuzz 10 < $0 + cd $src && autoconf + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- src/gcc/config/arm/arm.c Wed Dec 20 21:21:31 2000 ++++ src/gcc/config/arm/arm.c Sat Dec 23 12:26:00 2000 +@@ -5837,6 +5850,9 @@ + int store_arg_regs = 0; + int volatile_func = (optimize > 0 + && TREE_THIS_VOLATILE (current_function_decl)); ++ rtx ip_rtx; ++ int fp_offset = 0; ++ rtx insn; + + /* Naked functions don't have prologues. */ + if (arm_naked_function_p (current_function_decl)) +@@ -5858,11 +5874,59 @@ + live_regs_mask |= 0x4000; + } + ++ ip_rtx = gen_rtx_REG (SImode, IP_REGNUM); ++ + if (frame_pointer_needed) + { ++ if (current_function_needs_context) ++ { ++ /* The Static chain register is the same as the IP register ++ used as a scratch register during stack frame creation. ++ To get around this need to find somewhere to store IP ++ whilst the frame is being created. We try the following ++ places in order: ++ ++ 1. An unused argument register. ++ 2. A slot on the stack above the frame. (This only ++ works if the function is not a varargs function). ++ ++ If neither of these places is available, we abort (for now). */ ++ if (regs_ever_live[3] == 0) ++ { ++ insn = gen_rtx_REG (SImode, 3); ++ insn = gen_rtx_SET (SImode, insn, ip_rtx); ++ insn = emit_insn (insn); ++ RTX_FRAME_RELATED_P (insn) = 1; ++ } ++ else if (current_function_pretend_args_size == 0) ++ { ++ insn = gen_rtx_PRE_DEC (SImode, stack_pointer_rtx); ++ insn = gen_rtx_MEM (SImode, insn); ++ insn = gen_rtx_SET (VOIDmode, insn, ip_rtx); ++ insn = emit_insn (insn); ++ RTX_FRAME_RELATED_P (insn) = 1; ++ fp_offset = 4; ++ } ++ else ++ /* FIXME - the way to handle this situation is to allow ++ the pretend args to be dumped onto the stack, then ++ reuse r3 to save IP. This would involve moving the ++ copying os SP into IP until after the pretend args ++ have been dumped, but this is not too hard. */ ++ error ("Unable to find a temporary location for static chanin register"); ++ } ++ + live_regs_mask |= 0xD800; +- emit_insn (gen_movsi (gen_rtx_REG (SImode, 12), +- stack_pointer_rtx)); ++ if (fp_offset) ++ { ++ insn = gen_rtx_PLUS (SImode, stack_pointer_rtx, GEN_INT (fp_offset)); ++ insn = gen_rtx_SET (SImode, ip_rtx, insn); ++ } ++ else ++ insn = gen_movsi (ip_rtx, stack_pointer_rtx); ++ ++ insn = emit_insn (insn); ++ RTX_FRAME_RELATED_P (insn) = 1; + } + + if (current_function_pretend_args_size) +@@ -5926,9 +5990,31 @@ + } + + if (frame_pointer_needed) +- emit_insn (gen_addsi3 (hard_frame_pointer_rtx, gen_rtx_REG (SImode, 12), +- (GEN_INT +- (-(4 + current_function_pretend_args_size))))); ++ { ++ insn = GEN_INT (-(4 + current_function_pretend_args_size + fp_offset)); ++ insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx, ip_rtx, insn)); ++ RTX_FRAME_RELATED_P (insn) = 1; ++ ++ if (current_function_needs_context) ++ { ++ /* Recover the static chain register. */ ++ if (regs_ever_live [3] == 0) ++ { ++ insn = gen_rtx_REG (SImode, 3); ++ insn = gen_rtx_SET (SImode, ip_rtx, insn); ++ insn = emit_insn (insn); ++ RTX_FRAME_RELATED_P (insn) = 1; ++ } ++ else /* if (current_function_pretend_args_size == 0) */ ++ { ++ insn = gen_rtx_PLUS (SImode, hard_frame_pointer_rtx, GEN_INT (4)); ++ insn = gen_rtx_MEM (SImode, insn); ++ insn = gen_rtx_SET (SImode, ip_rtx, insn); ++ insn = emit_insn (insn); ++ RTX_FRAME_RELATED_P (insn) = 1; ++ } ++ } ++ } + + if (amount != const0_rtx) + { +--- src/gcc/config/arm/arm.h Wed Dec 20 21:21:41 2000 ++++ src/gcc/config/arm/arm.h Wed Dec 20 21:27:08 2000 +@@ -776,6 +776,9 @@ + /* Base register for access to local variables of the function. */ + #define FRAME_POINTER_REGNUM 25 + ++/* Scratch register - used in all kinds of places, eg trampolines. */ ++#define IP_REGNUM 12 ++ + /* Define this to be where the real frame pointer is if it is not possible to + work out the offset between the frame pointer and the automatic variables + until after register allocation has taken place. FRAME_POINTER_REGNUM +@@ -797,7 +800,7 @@ + /* The native (Norcroft) Pascal compiler for the ARM passes the static chain + as an invisible last argument (possible since varargs don't exist in + Pascal), so the following is not true. */ +-#define STATIC_CHAIN_REGNUM 8 ++#define STATIC_CHAIN_REGNUM 12 + + /* Register in which address to store a structure value + is passed to a function. */ +@@ -1247,7 +1250,12 @@ + { \ + int volatile_func = arm_volatile_func (); \ + if ((FROM) == ARG_POINTER_REGNUM && (TO) == HARD_FRAME_POINTER_REGNUM)\ +- (OFFSET) = 0; \ ++ { \ ++ if (! current_function_needs_context || ! frame_pointer_needed) \ ++ (OFFSET) = 0; \ ++ else \ ++ (OFFSET) = 4; \ ++ } \ + else if ((FROM) == FRAME_POINTER_REGNUM \ + && (TO) == STACK_POINTER_REGNUM) \ + (OFFSET) = (current_function_outgoing_args_size \ --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-default-arch.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-default-arch.dpatch @@ -0,0 +1,48 @@ +#! /bin/sh -e + +# All lines beginning with `# DPATCH:' are a description of the patch. +# DP: set the default architecture to i386; even if gcc is configured +# DP: with i386-linux, it builds with Pentium instructions, tuned for i386. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +From: Joel Klecker +To: Matthias Klose +Subject: Re: gcc: forwarded message from Markus F.X.J. Oberhumer +Date: Wed, 11 Aug 1999 08:48:54 -0700 + +Found it, and fixed it. + +--- gcc/config/i386/i386.c~ Sat Aug 14 19:35:24 1999 ++++ gcc/config/i386/i386.c Sat Aug 14 19:37:00 1999 +@@ -291,7 +291,7 @@ + + if (ix86_arch_string == 0) + { +- ix86_arch_string = PROCESSOR_PENTIUM_STRING; ++ ix86_arch_string = PROCESSOR_I386_STRING; + if (ix86_cpu_string == 0) + ix86_cpu_string = PROCESSOR_DEFAULT_STRING; + } +@@ -308,7 +308,7 @@ + if (i == ptt_size) + { + error ("bad value (%s) for -march= switch", ix86_arch_string); +- ix86_arch_string = PROCESSOR_PENTIUM_STRING; ++ ix86_arch_string = PROCESSOR_I386_STRING; + ix86_arch = PROCESSOR_DEFAULT; + } + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/libg++-update.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/libg++-update.dpatch @@ -0,0 +1,355 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# DP: 2000-03-12 Manfred Hollstein +# DP: +# DP: * Fix.h (Fix::Rep): Move definition into public context. + +diff -rup libg++-2.8.1.3/libg++/src/ChangeLog libg++-2.8.1.3-20000312/libg++/src/ChangeLog +--- libg++-2.8.1.3/libg++/src/ChangeLog Thu Dec 17 15:34:11 1998 ++++ libg++-2.8.1.3-20000312/libg++/src/ChangeLog Sun Mar 12 17:46:46 2000 +@@ -1,3 +1,7 @@ ++2000-03-12 Manfred Hollstein ++ ++ * Fix.h (Fix::Rep): Move definition into public context. ++ + 1998-12-17 Manfred Hollstein + + * String.cc (Scapitalize): Initialize `at_word' at definition to +diff -rup libg++-2.8.1.3/libg++/src/Fix.h libg++-2.8.1.3-20000312/libg++/src/Fix.h +--- libg++-2.8.1.3/libg++/src/Fix.h Mon Aug 31 12:12:25 1998 ++++ libg++-2.8.1.3-20000312/libg++/src/Fix.h Sun Mar 12 17:43:58 2000 +@@ -16,6 +16,8 @@ + + class Fix + { ++public: ++ + struct Rep // internal Fix representation + { + _G_uint16_t len; // length in bits +@@ -23,8 +25,6 @@ class Fix + _G_int16_t ref; // reference count + _G_uint16_t s[1]; // start of ushort array represention + }; +- +-public: + + typedef void (*PEH)(Rep*); + + +2000-04-18 Manfred Hollstein + Alexandre Oliva + + * BitSet.h (and, or, xor): Do not define. + * Integer.cc (complem): Renamed from compl. + * Integer.h (complem): Likewise. + (and, or, xor): Do not define. + + * BitString.h, BitString.cc (and, or, xor): Rename to and_f, + or_f, xor_f to avoid conflicts with ISO-C++ defined operator + names. + +diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el libg++-2.8.1.3.orig/libg++/src/BitSet.h libg++-2.8.1.3/libg++/src/BitSet.h +--- libg++-2.8.1.3.orig/libg++/src/BitSet.h Sun Nov 24 10:16:48 1996 ++++ libg++-2.8.1.3/libg++/src/BitSet.h Wed Apr 19 14:43:56 2000 +@@ -1,6 +1,6 @@ + // This may look like C code, but it is really -*- C++ -*- + /* +-Copyright (C) 1988 Free Software Foundation ++Copyright (C) 1988, 2000 Free Software Foundation + written by Doug Lea (dl@rocky.oswego.edu) + + This file is part of the GNU C++ Library. This library is free +@@ -171,11 +171,13 @@ public: + #ifndef __STRICT_ANSI__ + // procedural versions of operators + ++#if 0 + // The first three of these are incompatible with ANSI C++ digraphs. + // In any case, it's not a great interface. + friend void and(const BitSet& x, const BitSet& y, BitSet& r); + friend void or(const BitSet& x, const BitSet& y, BitSet& r); + friend void xor(const BitSet& x, const BitSet& y, BitSet& r); ++#endif + friend void diff(const BitSet& x, const BitSet& y, BitSet& r); + friend void complement(const BitSet& x, BitSet& r); + #endif +@@ -220,6 +222,7 @@ inline int operator > (const BitSet& x, + inline int operator >= (const BitSet& x, const BitSet& y) { return y <= x; } + + #ifndef __STRICT_ANSI__ ++#if 0 + inline void and(const BitSet& x, const BitSet& y, BitSet& r) + { + r.rep = BitSetop(x.rep, y.rep, r.rep, '&'); +@@ -234,6 +237,7 @@ inline void xor(const BitSet& x, const B + { + r.rep = BitSetop(x.rep, y.rep, r.rep, '^'); + } ++#endif + + inline void diff(const BitSet& x, const BitSet& y, BitSet& r) + { +diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el libg++-2.8.1.3.orig/libg++/src/BitString.cc libg++-2.8.1.3/libg++/src/BitString.cc +--- libg++-2.8.1.3.orig/libg++/src/BitString.cc Thu Dec 17 15:34:11 1998 ++++ libg++-2.8.1.3/libg++/src/BitString.cc Wed Apr 19 14:43:56 2000 +@@ -1,5 +1,5 @@ + /* +-Copyright (C) 1988 Free Software Foundation ++Copyright (C) 1988, 2000 Free Software Foundation + written by Doug Lea (dl@rocky.oswego.edu) + + This file is part of the GNU C++ Library. This library is free +@@ -333,7 +333,7 @@ BitStrRep* cmpl(const BitStrRep* src, Bi + } + + +-BitStrRep* and(const BitStrRep* x, const BitStrRep* y, BitStrRep* r) ++BitStrRep* and_f(const BitStrRep* x, const BitStrRep* y, BitStrRep* r) + { + int xrsame = x == r; + int yrsame = y == r; +@@ -354,7 +354,7 @@ BitStrRep* and(const BitStrRep* x, const + return r; + } + +-BitStrRep* or(const BitStrRep* x, const BitStrRep* y, BitStrRep* r) ++BitStrRep* or_f(const BitStrRep* x, const BitStrRep* y, BitStrRep* r) + { + _G_uint32_t xl = x->len; + _G_uint32_t yl = y->len; +@@ -385,7 +385,7 @@ BitStrRep* or(const BitStrRep* x, const + } + + +-BitStrRep* xor(const BitStrRep* x, const BitStrRep* y, BitStrRep* r) ++BitStrRep* xor_f(const BitStrRep* x, const BitStrRep* y, BitStrRep* r) + { + _G_uint32_t xl = x->len; + _G_uint32_t yl = y->len; +diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el libg++-2.8.1.3.orig/libg++/src/BitString.h libg++-2.8.1.3/libg++/src/BitString.h +--- libg++-2.8.1.3.orig/libg++/src/BitString.h Mon Aug 31 12:12:25 1998 ++++ libg++-2.8.1.3/libg++/src/BitString.h Wed Apr 19 14:43:56 2000 +@@ -1,6 +1,6 @@ + // This may look like C code, but it is really -*- C++ -*- + /* +-Copyright (C) 1988 Free Software Foundation ++Copyright (C) 1988, 2000 Free Software Foundation + written by Doug Lea (dl@rocky.oswego.edu) + + This file is part of the GNU C++ Library. This library is free +@@ -43,9 +43,9 @@ extern BitStrRep* BStr_alloc(BitStrRep* + extern BitStrRep* BStr_resize(BitStrRep*, _G_int32_t); + extern BitStrRep* BStr_copy(BitStrRep*, const BitStrRep*); + extern BitStrRep* cmpl(const BitStrRep*, BitStrRep*); +-extern BitStrRep* and(const BitStrRep*, const BitStrRep*, BitStrRep*); +-extern BitStrRep* or(const BitStrRep*, const BitStrRep*, BitStrRep*); +-extern BitStrRep* xor(const BitStrRep*, const BitStrRep*, BitStrRep*); ++extern BitStrRep* and_f(const BitStrRep*, const BitStrRep*, BitStrRep*); ++extern BitStrRep* or_f(const BitStrRep*, const BitStrRep*, BitStrRep*); ++extern BitStrRep* xor_f(const BitStrRep*, const BitStrRep*, BitStrRep*); + extern BitStrRep* diff(const BitStrRep*, const BitStrRep*, BitStrRep*); + extern BitStrRep* cat(const BitStrRep*, const BitStrRep*, BitStrRep*); + extern BitStrRep* cat(const BitStrRep*, unsigned int, BitStrRep*); +@@ -130,9 +130,9 @@ public: + // procedural versions of operators + + +- friend void and(const BitString&, const BitString&, BitString&); +- friend void or(const BitString&, const BitString&, BitString&); +- friend void xor(const BitString&, const BitString&, BitString&); ++ friend void and_f(const BitString&, const BitString&, BitString&); ++ friend void or_f(const BitString&, const BitString&, BitString&); ++ friend void xor_f(const BitString&, const BitString&, BitString&); + friend void diff(const BitString&, const BitString&, BitString&); + friend void cat(const BitString&, const BitString&, BitString&); + friend void cat(const BitString&, unsigned int, BitString&); +@@ -397,19 +397,19 @@ inline BitPattern::~BitPattern() {} + + // procedural versions of operators + +-inline void and(const BitString& x, const BitString& y, BitString& r) ++inline void and_f(const BitString& x, const BitString& y, BitString& r) + { +- r.rep = and(x.rep, y.rep, r.rep); ++ r.rep = and_f(x.rep, y.rep, r.rep); + } + +-inline void or(const BitString& x, const BitString& y, BitString& r) ++inline void or_f(const BitString& x, const BitString& y, BitString& r) + { +- r.rep = or(x.rep, y.rep, r.rep); ++ r.rep = or_f(x.rep, y.rep, r.rep); + } + +-inline void xor(const BitString& x, const BitString& y, BitString& r) ++inline void xor_f(const BitString& x, const BitString& y, BitString& r) + { +- r.rep = xor(x.rep, y.rep, r.rep); ++ r.rep = xor_f(x.rep, y.rep, r.rep); + } + + inline void diff(const BitString& x, const BitString& y, BitString& r) +@@ -447,20 +447,20 @@ inline void complement(const BitString& + + inline BitString& BitString::operator &= (const BitString& y) + { +- and(*this, y, *this); ++ and_f(*this, y, *this); + return *this; + } + + + inline BitString& BitString::operator |= (const BitString& y) + { +- or(*this, y, *this); ++ or_f(*this, y, *this); + return *this; + } + + inline BitString& BitString::operator ^= (const BitString& y) + { +- xor(*this, y, *this); ++ xor_f(*this, y, *this); + return *this; + } + +@@ -503,17 +503,17 @@ inline void BitString::complement() + + inline BitString operator & (const BitString& x, const BitString& y) return r + { +- and(x, y, r); ++ and_f(x, y, r); + } + + inline BitString operator | (const BitString& x, const BitString& y) return r + { +- or(x, y, r); ++ or_f(x, y, r); + } + + inline BitString operator ^ (const BitString& x, const BitString& y) return r + { +- xor(x, y, r); ++ xor_f(x, y, r); + } + + inline BitString operator << (const BitString& x, _G_int32_t y) return r +diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el libg++-2.8.1.3.orig/libg++/src/Integer.cc libg++-2.8.1.3/libg++/src/Integer.cc +--- libg++-2.8.1.3.orig/libg++/src/Integer.cc Thu Dec 17 15:34:11 1998 ++++ libg++-2.8.1.3/libg++/src/Integer.cc Wed Apr 19 14:43:56 2000 +@@ -1,5 +1,5 @@ + /* +-Copyright (C) 1988 Free Software Foundation ++Copyright (C) 1988, 2000 Free Software Foundation + written by Doug Lea (dl@rocky.oswego.edu) + + This file is part of the GNU C++ Library. This library is free +@@ -1664,7 +1664,7 @@ IntRep* bitop(const IntRep* x, long y, I + + + +-IntRep* compl(const IntRep* src, IntRep* r) ++IntRep* complem(const IntRep* src, IntRep* r) + { + nonnil(src); + r = Icopy(r, src); +diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el libg++-2.8.1.3.orig/libg++/src/Integer.h libg++-2.8.1.3/libg++/src/Integer.h +--- libg++-2.8.1.3.orig/libg++/src/Integer.h Mon Aug 31 12:12:25 1998 ++++ libg++-2.8.1.3/libg++/src/Integer.h Wed Apr 19 18:07:57 2000 +@@ -1,7 +1,7 @@ + // This may look like C code, but it is really -*- C++ -*- + + /* +-Copyright (C) 1988 Free Software Foundation ++Copyright (C) 1988, 2000 Free Software Foundation + written by Doug Lea (dl@rocky.oswego.edu) + + This file is part of the GNU C++ Library. This library is free +@@ -59,7 +59,7 @@ extern IntRep* div(const IntRep*, const + extern IntRep* mod(const IntRep*, const IntRep*, IntRep*); + extern IntRep* div(const IntRep*, long, IntRep*); + extern IntRep* mod(const IntRep*, long, IntRep*); +-extern IntRep* compl(const IntRep*, IntRep*); ++extern IntRep* complem(const IntRep*, IntRep*); + extern IntRep* abs(const IntRep*, IntRep*); + extern IntRep* negate(const IntRep*, IntRep*); + extern IntRep* pow(const IntRep*, long); +@@ -164,7 +164,7 @@ public: + friend void mod(const Integer& x, const Integer& y, Integer& dest); + friend void divide(const Integer& x, const Integer& y, + Integer& q, Integer& r); +-#ifndef __STRICT_ANSI__ ++#if 0 + friend void and(const Integer& x, const Integer& y, Integer& dest); + friend void or(const Integer& x, const Integer& y, Integer& dest); + friend void xor(const Integer& x, const Integer& y, Integer& dest); +@@ -181,7 +181,7 @@ public: + friend void div(const Integer& x, long y, Integer& dest); + friend void mod(const Integer& x, long y, Integer& dest); + friend void divide(const Integer& x, long y, Integer& q, long& r); +-#ifndef __STRICT_ANSI__ ++#if 0 + friend void and(const Integer& x, long y, Integer& dest); + friend void or(const Integer& x, long y, Integer& dest); + friend void xor(const Integer& x, long y, Integer& dest); +@@ -195,7 +195,7 @@ public: + friend void add(long x, const Integer& y, Integer& dest); + friend void sub(long x, const Integer& y, Integer& dest); + friend void mul(long x, const Integer& y, Integer& dest); +-#ifndef __STRICT_ANSI__ ++#if 0 + friend void and(long x, const Integer& y, Integer& dest); + friend void or(long x, const Integer& y, Integer& dest); + friend void xor(long x, const Integer& y, Integer& dest); +@@ -373,7 +373,7 @@ inline void mod(const Integer& x, const + dest.rep = mod(x.rep, y.rep, dest.rep); + } + +-#ifndef __STRICT_ANSI__ ++#if 0 + inline void and(const Integer& x, const Integer& y, Integer& dest) + { + dest.rep = bitop(x.rep, y.rep, dest.rep, '&'); +@@ -430,7 +430,7 @@ inline void mod(const Integer& x, long + dest.rep = mod(x.rep, y, dest.rep); + } + +-#ifndef __STRICT_ANSI__ ++#if 0 + inline void and(const Integer& x, long y, Integer& dest) + { + dest.rep = bitop(x.rep, y, dest.rep, '&'); +@@ -474,7 +474,7 @@ inline void negate(const Integer& x, Int + + inline void complement(const Integer& x, Integer& dest) + { +- dest.rep = compl(x.rep, dest.rep); ++ dest.rep = complem(x.rep, dest.rep); + } + + inline void add(long x, const Integer& y, Integer& dest) +@@ -492,7 +492,7 @@ inline void mul(long x, const Integer& + dest.rep = multiply(y.rep, x, dest.rep); + } + +-#ifndef __STRICT_ANSI__ ++#if 0 + inline void and(long x, const Integer& y, Integer& dest) + { + dest.rep = bitop(y.rep, x, dest.rep, '&'); --- gcc-2.95-2.95.4.ds15.orig/debian/patches/m68k-reload.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/m68k-reload.dpatch @@ -0,0 +1,327 @@ +#! /bin/sh -e + +# DP: + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- gcc/reload.c.org Sun Aug 26 19:41:02 2001 ++++ gcc/reload.c Sun Aug 26 20:59:59 2001 +@@ -2451,6 +2451,7 @@ + char this_alternative_earlyclobber[MAX_RECOG_OPERANDS]; + int this_alternative_matches[MAX_RECOG_OPERANDS]; + int swapped; ++ int n_swapped; + int goal_alternative[MAX_RECOG_OPERANDS]; + int this_alternative_number; + int goal_alternative_number; +@@ -2462,7 +2463,8 @@ + char goal_alternative_earlyclobber[MAX_RECOG_OPERANDS]; + int goal_alternative_swapped; + int best; +- int commutative; ++ int commutative[MAX_RECOG_OPERANDS]; ++ int commutative_op[MAX_RECOG_OPERANDS/2]; + int changed; + char operands_match[MAX_RECOG_OPERANDS][MAX_RECOG_OPERANDS]; + rtx substed_operand[MAX_RECOG_OPERANDS]; +@@ -2479,6 +2481,7 @@ + n_reloads = 0; + n_replacements = 0; + n_earlyclobbers = 0; ++ n_swapped = 0; + replace_reloads = replace; + hard_regs_live_known = live_known; + static_reload_reg_p = reload_reg_p; +@@ -2532,14 +2535,12 @@ + bcopy ((char *) recog_constraints, (char *) constraints, + noperands * sizeof (char *)); + +- commutative = -1; +- + /* If we will need to know, later, whether some pair of operands + are the same, we must compare them now and save the result. + Reloading the base and index registers will clobber them + and afterward they will fail to match. */ + +- for (i = 0; i < noperands; i++) ++ for (i = 0, j = 0; i < noperands; i++) + { + register char *p; + register int c; +@@ -2547,6 +2548,7 @@ + substed_operand[i] = recog_operand[i]; + p = constraints[i]; + ++ commutative[i] = i; + modified[i] = RELOAD_READ; + + /* Scan this operand's constraint to see if it is an output operand, +@@ -2560,11 +2562,14 @@ + modified[i] = RELOAD_READ_WRITE; + else if (c == '%') + { +- /* The last operand should not be marked commutative. */ +- if (i == noperands - 1) ++ /* The last and the next operand should not be marked commutative. */ ++ if (i == noperands - 1 || commutative[i] != i) + abort (); + +- commutative = i; ++ n_swapped = n_swapped ? n_swapped * 2 : 2; ++ commutative_op[j++] = i; ++ commutative[i] = i + 1; ++ commutative[i + 1] = i; + } + else if (c >= '0' && c <= '9') + { +@@ -2576,26 +2581,21 @@ + if (c == i) + abort (); + ++ if (commutative[i] != i) ++ operands_match[c][commutative[i]] ++ = operands_match_p (recog_operand[c], ++ recog_operand[commutative[i]]); ++ + /* If C can be commuted with C+1, and C might need to match I, + then C+1 might also need to match I. */ +- if (commutative >= 0) +- { +- if (c == commutative || c == commutative + 1) +- { +- int other = c + (c == commutative ? 1 : -1); +- operands_match[other][i] +- = operands_match_p (recog_operand[other], recog_operand[i]); +- } +- if (i == commutative || i == commutative + 1) +- { +- int other = i + (i == commutative ? 1 : -1); +- operands_match[c][other] +- = operands_match_p (recog_operand[c], recog_operand[other]); +- } +- /* Note that C is supposed to be less than I. +- No need to consider altering both C and I because in +- that case we would alter one into the other. */ +- } ++ if (commutative[c] != c) ++ operands_match[commutative[c]][i] ++ = operands_match_p (recog_operand[commutative[c]], ++ recog_operand[i]); ++ if (commutative[i] != i && commutative[c] != c) ++ operands_match[commutative[c]][commutative[i]] ++ = operands_match_p (recog_operand[commutative[c]], ++ recog_operand[commutative[i]]); + } + } + } +@@ -2756,6 +2756,8 @@ + + swapped = 0; + goal_alternative_swapped = 0; ++ for (i = 0; i < noperands; i++) ++ commutative[i] = i; + try_swapped: + + /* The constraints are made of several alternatives. +@@ -2910,12 +2912,7 @@ + case '=': + case '+': + case '*': +- break; +- + case '%': +- /* The last operand should not be marked commutative. */ +- if (i != noperands - 1) +- commutative = i; + break; + + case '?': +@@ -2946,19 +2943,10 @@ + only a single reload insn will be needed to make + the two operands win. As a result, this alternative + may be rejected when it is actually desirable.) */ +- if ((swapped && (c != commutative || i != commutative + 1)) +- /* If we are matching as if two operands were swapped, +- also pretend that operands_match had been computed +- with swapped. +- But if I is the second of those and C is the first, +- don't exchange them, because operands_match is valid +- only on one side of its diagonal. */ +- ? (operands_match +- [(c == commutative || c == commutative + 1) +- ? 2*commutative + 1 - c : c] +- [(i == commutative || i == commutative + 1) +- ? 2*commutative + 1 - i : i]) +- : operands_match[c][i]) ++ /* If we are matching as if two operands were swapped, ++ also pretend that operands_match had been computed ++ with swapped. */ ++ if (operands_match[commutative[c]][commutative[i]]) + { + /* If we are matching a non-offsettable address where an + offsettable address was expected, then we must reject +@@ -3438,11 +3426,22 @@ + if (losers == 0) + { + /* Unswap these so that they are never swapped at `finish'. */ +- if (commutative >= 0) ++ if (swapped) + { +- recog_operand[commutative] = substed_operand[commutative]; +- recog_operand[commutative + 1] +- = substed_operand[commutative + 1]; ++ int s = swapped; ++ s ^= s >> 1; ++ ++ for (i = 0; s; i++, s >>= 1) ++ { ++ register int c; ++ ++ if (!(s & 1)) ++ continue; ++ c = commutative_op[i]; ++ ++ recog_operand[c] = substed_operand[c]; ++ recog_operand[c + 1] = substed_operand[c + 1]; ++ } + } + for (i = 0; i < noperands; i++) + { +@@ -3492,37 +3491,48 @@ + as if we had exchanged them. + To do this, really exchange them in operands. + +- If we have just tried the alternatives the second time, ++ We try all the possible alternatives and after we tried the last one, + return operands to normal and drop through. */ + +- if (commutative >= 0) ++ if (++swapped <= n_swapped) + { +- swapped = !swapped; +- if (swapped) ++ int s, t; ++ rtx x; ++ ++ s = swapped - 1; ++ if (swapped < n_swapped) ++ s ^= swapped; ++ s ^= s >> 1; ++ ++ for (i = 0; s; i++, s >>= 1) ++ if (s & 1) ++ break; ++ i = commutative_op[i]; ++ ++ t = commutative[i]; ++ commutative[i] = commutative[i + 1]; ++ commutative[i + 1] = t; ++ ++ x = recog_operand[i]; ++ recog_operand[i] = recog_operand[i + 1]; ++ recog_operand[i + 1] = x; ++ ++ if (swapped < n_swapped) + { + register enum reg_class tclass; +- register int t; +- +- recog_operand[commutative] = substed_operand[commutative + 1]; +- recog_operand[commutative + 1] = substed_operand[commutative]; + +- tclass = preferred_class[commutative]; +- preferred_class[commutative] = preferred_class[commutative + 1]; +- preferred_class[commutative + 1] = tclass; +- +- t = pref_or_nothing[commutative]; +- pref_or_nothing[commutative] = pref_or_nothing[commutative + 1]; +- pref_or_nothing[commutative + 1] = t; ++ tclass = preferred_class[i]; ++ preferred_class[i] = preferred_class[i + 1]; ++ preferred_class[i + 1] = tclass; ++ ++ t = pref_or_nothing[i]; ++ pref_or_nothing[i] = pref_or_nothing[i + 1]; ++ pref_or_nothing[i + 1] = t; + + bcopy ((char *) recog_constraints, (char *) constraints, + noperands * sizeof (char *)); + goto try_swapped; + } +- else +- { +- recog_operand[commutative] = substed_operand[commutative]; +- recog_operand[commutative + 1] = substed_operand[commutative + 1]; +- } + } + + /* The operands don't meet the constraints. +@@ -3566,25 +3576,38 @@ + + if (goal_alternative_swapped) + { +- register rtx tem; ++ int s = goal_alternative_swapped; ++ s ^= s >> 1; + +- tem = substed_operand[commutative]; +- substed_operand[commutative] = substed_operand[commutative + 1]; +- substed_operand[commutative + 1] = tem; +- tem = recog_operand[commutative]; +- recog_operand[commutative] = recog_operand[commutative + 1]; +- recog_operand[commutative + 1] = tem; +- tem = *recog_operand_loc[commutative]; +- *recog_operand_loc[commutative] = *recog_operand_loc[commutative+1]; +- *recog_operand_loc[commutative+1] = tem; ++ for (i = 0; s; i++, s >>= 1) ++ { ++ register int c; ++ register rtx tem; ++ ++ if (!(s & 1)) ++ continue; ++ c = commutative_op[i]; ++ ++ tem = substed_operand[c]; ++ substed_operand[c] = substed_operand[c + 1]; ++ substed_operand[c + 1] = tem; ++ ++ tem = recog_operand[c]; ++ recog_operand[c] = recog_operand[c + 1]; ++ recog_operand[c + 1] = tem; ++ ++ tem = *recog_operand_loc[c]; ++ *recog_operand_loc[c] = *recog_operand_loc[c + 1]; ++ *recog_operand_loc[c + 1] = tem; + +- for (i = 0; i < n_reloads; i++) +- { +- if (reload_opnum[i] == commutative) +- reload_opnum[i] = commutative + 1; +- else if (reload_opnum[i] == commutative + 1) +- reload_opnum[i] = commutative; +- } ++ for (j = 0; j < n_reloads; j++) ++ { ++ if (reload_opnum[j] == c) ++ reload_opnum[j] = c + 1; ++ else if (reload_opnum[j] == c + 1) ++ reload_opnum[j] = c; ++ } ++ } + } + + for (i = 0; i < noperands; i++) --- gcc-2.95-2.95.4.ds15.orig/debian/patches/g77-names.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/g77-names.dpatch @@ -0,0 +1,110 @@ +#! /bin/sh -e + +# DP: versioned g77 names + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- src-old/gcc/f/g77.texi Mon Jun 21 13:58:54 1999 ++++ src-native/gcc/f/g77.texi Tue Dec 19 21:04:58 2000 +@@ -73,7 +73,7 @@ + @ifinfo + @dircategory Programming + @direntry +-* g77: (g77). The GNU Fortran compiler. ++* g77-2.95: (g77-2.95). The GNU Fortran compiler (Version 2.95.x). + @end direntry + @ifset INTERNALS + @ifset USING + +--- ../cvs/egcs/gcc/f/Make-lang.in Mon Jun 7 08:44:57 1999 ++++ src-native/gcc/f/Make-lang.in Tue Dec 19 23:20:45 2000 +@@ -215,11 +215,11 @@ + f77.start.encap: g77$(exeext) + f77.rest.encap: + +-f77.info: f/g77.info ++f77.info: f/g77-2.95.info + f77.dvi: f/g77.dvi + + # g77 documentation. +-f/g77.info: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \ ++f/g77-2.95.info: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \ + $(srcdir)/f/ffe.texi \ + $(srcdir)/f/g77install.texi $(srcdir)/f/news.texi \ + $(srcdir)/f/intdoc.texi $(srcdir)/f/root.texi +@@ -228,8 +228,8 @@ + *) rm -f lang-f77;; \ + esac + if [ -f lang-f77 ]; then \ +- rm -f $(srcdir)/f/g77.info-*; \ +- $(MAKEINFO) -I$(srcdir)/f -o f/g77.info $(srcdir)/f/g77.texi; \ ++ rm -f $(srcdir)/f/g77-2.95.info-*; \ ++ $(MAKEINFO) -I$(srcdir)/f -o f/g77-2.95.info $(srcdir)/f/g77.texi; \ + else true; fi + + f/g77.dvi: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \ +@@ -297,7 +297,7 @@ + cd $(srcdir)/f; $(MAKEINFO) -D NEWSONLY --no-header --no-split \ + --no-validate -o NEWS news0.texi + +-f77.rebuilt: f/g77.info $(srcdir)/f/BUGS $(srcdir)/f/INSTALL \ ++f77.rebuilt: f/g77-2.95.info $(srcdir)/f/BUGS $(srcdir)/f/INSTALL \ + $(srcdir)/f/NEWS + + # +@@ -346,18 +346,18 @@ + *[fF]77*) touch $(libsubdir)/lang-f77;; \ + *) rm -f $(libsubdir)/lang-f77;; \ + esac +- if [ -f $(libsubdir)/lang-f77 -a -f f/g77.info ] ; then \ +- rm -f $(infodir)/g77.info*; \ +- for f in f/g77.info*; do \ ++ if [ -f $(libsubdir)/lang-f77 -a -f f/g77-2.95.info ] ; then \ ++ rm -f $(infodir)/g77-2.95.info*; \ ++ for f in f/g77-2.95.info*; do \ + realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ + $(INSTALL_DATA) $$f $(infodir)/$$realfile; \ + done; \ +- chmod a-x $(infodir)/g77.info*; \ ++ chmod a-x $(infodir)/g77-2.95.info*; \ + else true; fi +- @if [ -f $(libsubdir)/lang-f77 -a -f $(srcdir)/f/g77.info ] ; then \ ++ @if [ -f $(libsubdir)/lang-f77 -a -f $(srcdir)/f/g77-2.95.info ] ; then \ + if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ +- echo " install-info --info-dir=$(infodir) $(infodir)/g77.info"; \ +- install-info --info-dir=$(infodir) $(infodir)/g77.info || : ; \ ++ echo " install-info --info-dir=$(infodir) $(infodir)/g77-2.95.info"; \ ++ install-info --info-dir=$(infodir) $(infodir)/g77-2.95.info || : ; \ + else : ; fi; \ + else : ; fi + rm -f $(libsubdir)/lang-f77 +@@ -401,6 +401,7 @@ + rm -rf $(man1dir)/$(G77_INSTALL_NAME)$(manext); \ + rm -rf $(man1dir)/$(G77_CROSS_NAME)$(manext); \ + rm -rf $(infodir)/g77.info*; \ ++ rm -rf $(infodir)/g77-2.95.info*; \ + fi + rm -f $(libsubdir)/lang-f77 + # +@@ -420,7 +421,7 @@ + -rm -f lang-f77 f/Makefile + f77.extraclean: + f77.maintainer-clean: +- -rm -f f/g77.info* f/g77.*aux f/TAGS f/BUGS f/INSTALL f/NEWS f/intdoc.texi ++ -rm -f f/g77*.info* f/g77.*aux f/TAGS f/BUGS f/INSTALL f/NEWS f/intdoc.texi + # + # Stage hooks: + # The main makefile has already created stage?/f. --- gcc-2.95-2.95.4.ds15.orig/debian/patches/sparc32-rfi.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/sparc32-rfi.dpatch @@ -0,0 +1,42 @@ +#! /bin/sh -e + +# All lines beginning with `# DPATCH:' are a description of the patch. +# DP: Makes it so sparc32 remains binary compatible with older releases + + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# append the patch here and adjust the -p? flag in the patch calls. + +--- gcc/crtstuff.c.orig Mon Apr 26 20:11:08 1999 ++++ gcc/crtstuff.c Mon Apr 26 20:12:28 1999 +@@ -89,11 +89,12 @@ + + /* References to __register_frame_info and __deregister_frame_info should + be weak in this file if at all possible. */ +-extern void __register_frame_info (void *, struct object *) +- TARGET_ATTRIBUTE_WEAK; ++extern void __register_frame_info (void *, struct object *); + +-extern void *__deregister_frame_info (void *) +- TARGET_ATTRIBUTE_WEAK; ++extern void *__deregister_frame_info (void *); ++/* DEBIAN/SPARC - Changed the references to the ++ * previous for binary compatibility reasons ++ */ + + /* Provide default definitions for the pseudo-ops used to switch to the + .ctors and .dtors sections. --- gcc-2.95-2.95.4.ds15.orig/debian/patches/template.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/template.dpatch @@ -0,0 +1,25 @@ +#! /bin/sh -e + +# All lines beginning with `# DPATCH:' are a description of the patch. +# DP: + +# remove the next line +exit 0 + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# append the patch here and adjust the -p? flag in the patch calls. + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-mips-linux.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-mips-linux.dpatch @@ -0,0 +1,288 @@ +#! /bin/sh -e + +src=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + src=$3/gcc +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p1 < $0 + cd $src && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p1 < $0 + cd $src && autoconf + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +diff -up --recursive --new-file gcc-2.95.2.macro/gcc/config/mips/linux.h gcc-2.95.2/gcc/config/mips/linux.h +--- gcc-2.95.2.macro/gcc/config/mips/linux.h Wed Apr 14 10:46:45 1999 ++++ gcc-2.95.2/gcc/config/mips/linux.h Thu Nov 16 07:25:03 2000 +@@ -1,5 +1,5 @@ + /* Definitions for MIPS running Linux-based GNU systems with ELF format. +- Copyright (C) 1998 Free Software Foundation, Inc. ++ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + + This file is part of GNU CC. + +@@ -18,16 +18,106 @@ along with GNU CC; see the file COPYING. + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +-/* Required to keep collect2.c happy */ +-#undef OBJECT_FORMAT_COFF ++#undef TARGET_VERSION ++#if TARGET_ENDIAN_DEFAULT == 0 ++#define TARGET_VERSION fprintf (stderr, " (MIPSel GNU/Linux with ELF)"); ++#else ++#define TARGET_VERSION fprintf (stderr, " (MIPS GNU/Linux with ELF)"); ++#endif ++ ++#undef MD_EXEC_PREFIX ++#undef MD_STARTFILE_PREFIX ++ ++/* Output at beginning of assembler file. */ ++/* The .file command should always begin the output. */ ++#undef ASM_FILE_START ++#define ASM_FILE_START(FILE) \ ++ do { \ ++ mips_asm_file_start (FILE); \ ++ fprintf (FILE, "\t.version\t\"01.01\"\n"); \ ++ } while (0) ++ + +-#define HAVE_ATEXIT ++/* Required to keep collect2.c happy */ ++#undef OBJECT_FORMAT_COFF + + /* If we don't set MASK_ABICALLS, we can't default to PIC. */ + #undef TARGET_DEFAULT + #define TARGET_DEFAULT (MASK_ABICALLS|MASK_GAS) + + ++/* Handle #pragma weak and #pragma pack. */ ++#define HANDLE_SYSV_PRAGMA 1 ++ ++/* Use more efficient ``thunks'' to implement C++ vtables. */ ++#undef DEFAULT_VTABLE_THUNKS ++#define DEFAULT_VTABLE_THUNKS 1 ++ ++/* Don't assume anything about the header files. */ ++#define NO_IMPLICIT_EXTERN_C ++ ++/* Generate calls to memcpy, etc., not bcopy, etc. */ ++#define TARGET_MEM_FUNCTIONS ++ ++/* Specify predefined symbols in preprocessor. */ ++#undef CPP_PREDEFINES ++#if TARGET_ENDIAN_DEFAULT == 0 ++#define CPP_PREDEFINES "-DMIPSEL -D_MIPSEL -Dunix -Dmips -D_mips \ ++-DR3000 -D_R3000 -Dlinux -Asystem(posix) -Acpu(mips) \ ++-Amachine(mips) -D__ELF__ -D__PIC__ -D__pic__" ++#else ++#define CPP_PREDEFINES "-DMIPSEB -D_MIPSEB -Dunix -Dmips -D_mips \ ++-DR3000 -D_R3000 -Dlinux -Asystem(posix) -Acpu(mips) \ ++-Amachine(mips) -D__ELF__ -D__PIC__ -D__pic__" ++#endif ++ ++#undef SUBTARGET_CPP_SIZE_SPEC ++#define SUBTARGET_CPP_SIZE_SPEC "\ ++%{mabi=32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ++%{mabi=n32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \ ++%{mabi=64: -D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \ ++%{!mabi*: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}" ++ ++/* We must make -mips3 do what -mlong64 used to do. */ ++/* ??? If no mipsX option given, but a mabi=X option is, then should set ++ _MIPS_ISA based on the mabi=X option. */ ++/* ??? If no mabi=X option give, but a mipsX option is, then should set ++ _MIPS_SIM based on the mipsX option. */ ++/* ??? Same for _MIPS_SZINT. */ ++/* ??? Same for _MIPS_SZPTR. */ ++/* ??? Same for __SIZE_TYPE and __PTRDIFF_TYPE. */ ++#undef SUBTARGET_CPP_SPEC ++#define SUBTARGET_CPP_SPEC "\ ++%{mfp32: -D_MIPS_FPSET=16} \ ++%{mfp64: -D_MIPS_FPSET=32} \ ++%{!mfp*: -D_MIPS_FPSET=32} \ ++%{mips1: -D_MIPS_ISA=_MIPS_ISA_MIPS1} \ ++%{mips2: -D_MIPS_ISA=_MIPS_ISA_MIPS2} \ ++%{mips3: -D_MIPS_ISA=_MIPS_ISA_MIPS3} \ ++%{mips4: -D_MIPS_ISA=_MIPS_ISA_MIPS4} \ ++%{!mips*: -D_MIPS_ISA=_MIPS_ISA_MIPS1} \ ++%{mabi=32: -D_MIPS_SIM=_MIPS_SIM_ABI32} \ ++%{mabi=n32: -D_ABIN32=2 -D_MIPS_SIM=_ABIN32} \ ++%{mabi=64: -D_ABI64=3 -D_MIPS_SIM=_ABI64} \ ++%{!mabi*: -D_ABIN32=2 -D_MIPS_SIM=_ABIN32} \ ++%{!mint64: -D_MIPS_SZINT=32}%{mint64: -D_MIPS_SZINT=64} \ ++%{mabi=32: -D_MIPS_SZLONG=32} \ ++%{mabi=n32: -D_MIPS_SZLONG=32} \ ++%{mabi=64: -D_MIPS_SZLONG=64} \ ++%{!mabi*: -D_MIPS_SZLONG=32} \ ++%{mabi=32: -D_MIPS_SZPTR=32} \ ++%{mabi=n32: -D_MIPS_SZPTR=32} \ ++%{mabi=64: -D_MIPS_SZPTR=64} \ ++%{!mabi*: -D_MIPS_SZPTR=32} \ ++%{!mips*: -U__mips -D__mips} \ ++%{mabi=32: -U__mips64} \ ++%{mabi=n32: -D__mips64} \ ++%{mabi=64: -U__mips64} \ ++%{!mabi*: -U__mips64} \ ++%{fno-PIC:-U__PIC__ -U__pic__} %{fno-pic:-U__PIC__ -U__pic__} \ ++%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \ ++%{pthread:-D_REENTRANT}" ++ + /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add + the GNU/Linux magical crtbegin.o file (see crtstuff.c) which + provides part of the support for getting C++ file-scope static +@@ -55,9 +145,18 @@ Boston, MA 02111-1307, USA. */ + #undef MIPS_DEFAULT_GVALUE + #define MIPS_DEFAULT_GVALUE 0 + ++#undef LIB_SPEC ++/* Taken from sparc/linux.h. */ ++#define LIB_SPEC \ ++ "%{shared: -lc} \ ++ %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \ ++ %{profile:-lc_p} %{!profile: -lc}}" ++ + /* Borrowed from sparc/linux.h */ + #undef LINK_SPEC +-#define LINK_SPEC "-Y P,/usr/lib %{shared:-shared} \ ++#define LINK_SPEC \ ++ "%(endian_spec) \ ++ %{shared:-shared} \ + %{!shared: \ + %{!ibcs: \ + %{!static: \ +@@ -67,33 +166,7 @@ Boston, MA 02111-1307, USA. */ + + + #undef SUBTARGET_ASM_SPEC +-#define SUBTARGET_ASM_SPEC "-KPIC" +- +-/* Undefine the following which were defined in elf.h. This will cause the linux +- port to continue to use collect2 for constructors/destructors. These may be removed +- when .ctor/.dtor section support is desired. */ +- +-#undef CTORS_SECTION_ASM_OP +-#undef DTORS_SECTION_ASM_OP +- +-#undef EXTRA_SECTIONS +-#define EXTRA_SECTIONS in_sdata, in_rdata +- +-#undef INVOKE__main +-#undef NAME__MAIN +-#undef SYMBOL__MAIN +- +-#undef EXTRA_SECTION_FUNCTIONS +-#define EXTRA_SECTION_FUNCTIONS \ +- SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP) \ +- SECTION_FUNCTION_TEMPLATE(rdata_section, in_rdata, RDATA_SECTION_ASM_OP) +- +-#undef ASM_OUTPUT_CONSTRUCTOR +-#undef ASM_OUTPUT_DESTRUCTOR +- +-#undef CTOR_LIST_BEGIN +-#undef CTOR_LIST_END +-#undef DTOR_LIST_BEGIN +-#undef DTOR_LIST_END +- +-/* End of undefines to turn off .ctor/.dtor section support */ ++#define SUBTARGET_ASM_SPEC "\ ++%{mabi=64: -64} \ ++%{!fno-PIC:%{!fno-pic:-KPIC}} \ ++%{fno-PIC:-non_shared} %{fno-pic:-non_shared}" +diff -up --recursive --new-file gcc-2.95.2.macro/gcc/config/mips/mips.h gcc-2.95.2/gcc/config/mips/mips.h +--- gcc-2.95.2.macro/gcc/config/mips/mips.h Wed May 19 23:05:45 1999 ++++ gcc-2.95.2/gcc/config/mips/mips.h Tue Aug 15 18:40:42 2000 +@@ -599,11 +599,11 @@ extern void mips_select_section (); + linker will default to using big-endian output files. The OUTPUT_FORMAT + line must be in the linker script, otherwise -EB/-EL will not work. */ + +-#ifndef LINKER_ENDIAN_SPEC ++#ifndef ENDIAN_SPEC + #if TARGET_ENDIAN_DEFAULT == 0 +-#define LINKER_ENDIAN_SPEC "%{!EB:%{!meb:-EL}}" ++#define ENDIAN_SPEC "%{!EB:%{!meb:-EL}} %{EL} %{EB}" + #else +-#define LINKER_ENDIAN_SPEC "" ++#define ENDIAN_SPEC "%{!EL:%{!mel:-EB}} %{EB} %{EL}" + #endif + #endif + +@@ -871,7 +871,8 @@ while (0) + /* ASM_SPEC is the set of arguments to pass to the assembler. */ + + #define ASM_SPEC "\ +-%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \ ++%(endian_spec) \ ++%{G*} %{mips1} %{mips2} %{mips3} %{mips4} \ + %{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} \ + %(subtarget_asm_optimizing_spec) \ + %(subtarget_asm_debugging_spec) \ +@@ -925,9 +926,9 @@ while (0) + + #ifndef LINK_SPEC + #define LINK_SPEC "\ +-%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \ +-%{bestGnum} %{shared} %{non_shared} \ +-%(linker_endian_spec)" ++%(endian_spec) \ ++%{G*} %{mips1} %{mips2} %{mips3} %{mips4} \ ++%{bestGnum} %{shared} %{non_shared}" + #endif /* LINK_SPEC defined */ + + /* Specs for the compiler proper */ +@@ -1035,7 +1036,7 @@ while (0) + { "subtarget_asm_optimizing_spec", SUBTARGET_ASM_OPTIMIZING_SPEC }, \ + { "subtarget_asm_debugging_spec", SUBTARGET_ASM_DEBUGGING_SPEC }, \ + { "subtarget_asm_spec", SUBTARGET_ASM_SPEC }, \ +- { "linker_endian_spec", LINKER_ENDIAN_SPEC }, \ ++ { "endian_spec", ENDIAN_SPEC }, \ + SUBTARGET_EXTRA_SPECS + + #ifndef SUBTARGET_EXTRA_SPECS +diff -up --recursive --new-file gcc-2.95.2.macro/gcc/configure.in gcc-2.95.2/gcc/configure.in +--- gcc-2.95.2.macro/gcc/configure.in Wed Oct 13 07:58:02 1999 ++++ gcc-2.95.2/gcc/configure.in Mon May 29 22:16:31 2000 +@@ -2356,16 +2356,23 @@ changequote([,])dnl + # On NetBSD, the headers are already okay, except for math.h. + tmake_file=t-netbsd + ;; +- mips*-*-linux*) # Linux MIPS, either endian. ++ mips*-*-linux*) # Linux MIPS, either endian. + xmake_file=x-linux +- xm_file="xm-siglist.h ${xm_file}" +- case $machine in +- mipsel-*) tm_file="mips/elfl.h mips/linux.h" ;; +- *) tm_file="mips/elf.h mips/linux.h" ;; +- esac +- extra_parts="crtbegin.o crtend.o" ++ case $machine in ++ mips*el-*) ++ tm_file="mips/elfl.h mips/linux.h" ++ ;; ++ *) ++ tm_file="mips/elf.h mips/linux.h" ++ ;; ++ esac ++ tmake_file=t-linux ++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" + gnu_ld=yes + gas=yes ++ if test x$enable_threads = xyes; then ++ thread_file='posix' ++ fi + ;; + mips*el-*-openbsd*) # mips little endian + target_cpu_default="MASK_GAS|MASK_ABICALLS" --- gcc-2.95-2.95.4.ds15.orig/debian/patches/g77-m68k-pic.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/g77-m68k-pic.dpatch @@ -0,0 +1,47 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# DP: From: Phil Blundell +To: 129573@bugs.debian.org, control@bugs.debian.org +# DP: Subject: Bug#129573: g77 crash with -fPIC, m68k +# DP: Date: 15 Feb 2002 12:41:50 +0000 + +tags 129573 patch +thanks + +# DP: +# DP: Well, I think this patch will fix the immediate problem at hand. I've +# DP: no idea why CONST_DOUBLEs were being rejected previously, so it's +# DP: possible that this isn't a safe thing to do. I guess someone needs to +# DP: take it up with the upstream gcc folk. + +p. + +--- gcc/config/m68k/linux.h~ Wed Feb 20 00:44:07 2002 ++++ gcc/config/m68k/linux.h Wed Feb 20 23:33:37 2002 +@@ -306,10 +306,7 @@ + an operand of a function call. */ + #undef LEGITIMATE_PIC_OPERAND_P + #define LEGITIMATE_PIC_OPERAND_P(X) \ +- ((! symbolic_operand (X, VOIDmode) \ +- && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X) \ +- && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM \ +- && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0), VOIDmode))) \ ++ (! symbolic_operand (X, VOIDmode) \ + || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X))) + + /* Turn off function cse if we are doing PIC. We always want function --- gcc-2.95-2.95.4.ds15.orig/debian/patches/libobjc.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/libobjc.dpatch @@ -0,0 +1,38 @@ +#! /bin/sh -e + +# DP: Find header file for Boehm garbage collector. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +*** libobjc/Makefile.in~ Tue Nov 10 15:25:36 1998 +--- libobjc/Makefile.in Tue Nov 10 13:16:08 1998 +*************** +*** 65,71 **** + -I$(srcdir)/$(MULTISRCTOP)../gcc/config -I$(MULTIBUILDTOP)../../gcc \ + -I$(srcdir)/$(MULTISRCTOP)../include + +! OBJC_GCFLAGS=-DOBJC_WITH_GC=1 + OBJC_THREAD_FILE=thr-@OBJC_THREAD_FILE@ + + .SUFFIXES: +--- 65,71 ---- + -I$(srcdir)/$(MULTISRCTOP)../gcc/config -I$(MULTIBUILDTOP)../../gcc \ + -I$(srcdir)/$(MULTISRCTOP)../include + +! OBJC_GCFLAGS=-I/usr/include/gc -DOBJC_WITH_GC=1 + OBJC_THREAD_FILE=thr-@OBJC_THREAD_FILE@ + + .SUFFIXES: --- gcc-2.95-2.95.4.ds15.orig/debian/patches/libstdc++-out-of-mem.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/libstdc++-out-of-mem.dpatch @@ -0,0 +1,75 @@ +#! /bin/sh -e + +# All lines beginning with `# DPATCH:' are a description of the patch. +# DP: Throw exception instead of aborting when out of memory + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +From: inaky@peloncho.fis.ucm.es +To: submit@bugs.debian.org +Subject: Bug#42622: libstdc++2.10-dev: stl_alloc.h: malloc_alloc out of memory handling abort()s instead of using exceptions +Date: Sat, 7 Aug 1999 04:31:58 +0200 + +Package: libstdc++2.10-dev +Version: 1:2.95-2 +Severity: important + + Hi + + While coding some proof-of-concepts I've come around using a +vector<> of a big lot of elements. Wanted to push the limits and try +to recover possible failures. No way. The program was aborting on the +library's own. + + That should not do. You want exceptions to be able to dictate +how the program should behave on error situations. The thing is at +stl_alloc.h, instead of throwing an exception on OOM, it was printing +the message "out of memory" to stderr and aborting. It is also +prepared for doing it via exceptions, so I think it should be the +default way. + + I think that behaviour should be made extensible to the whole +libstdc++ library, as as far as I know, exception support in GCC is +mature enough as to handle it [and I hope so :)]. That's the only way +to fully control a program's flow. Libraries should not dictate what +to do on error [I'm sure I'm not telling you anything new]. + + The changes to make stl_alloc work ok with exceptions are: + +--- libstdc++/stl/stl_alloc.h~ Fri May 7 12:13:28 1999 ++++ libstdc++/stl/stl_alloc.h Sat Aug 7 04:16:22 1999 +@@ -38,7 +38,7 @@ + // The allocation primitives are intended to allocate individual objects, + // not larger arenas as with the original STL allocators. + +-#if 0 ++#ifdef __STL_USE_EXCEPTIONS + # include + # define __THROW_BAD_ALLOC throw bad_alloc() + #elif !defined(__THROW_BAD_ALLOC) + + Thanks, anyway, for such nice packages for GCC & Co. + + Your happy Debian user, + +-- System Information +Debian Release: potato +Kernel Version: Linux jovian 2.2.7 #1 mar ago 3 02:24:40 CEST 1999 i586 unknown + +Versions of the packages libstdc++2.10-dev depends on: +ii g++ 2.95-2 The GNU C++ compiler. +ii libc6-dev 2.1.2-0pre4 GNU C Library: Development libraries and hea +ii libstdc++2.10 2.95-2 The GNU stdc++ library --- gcc-2.95-2.95.4.ds15.orig/debian/patches/testsuite-3.0.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/testsuite-3.0.dpatch @@ -0,0 +1,81 @@ +#! /bin/sh -e + +# DP: patch to run the current gcc testsuite (20001207) with the release. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -l -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -l -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +diff --width=160 -du lib/objc.exp lib.1/objc.exp +--- gcc/testsuite/lib/objc.exp Sun Aug 6 19:41:49 2000 ++++ gcc/testsuite/lib/objc.exp Thu Nov 30 11:02:03 2000 +@@ -120,7 +120,7 @@ + global ld_library_path + + set ld_library_path ".:${rootme}" +- lappend options "libs=-lobjc" ++ lappend options "libs=-lobjc -lpthread" + + if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } { + lappend options "libs=${gluefile}" +@@ -143,7 +143,7 @@ + lappend options "additional_flags=-DNO_VARARGS" + } + set objcpath "[get_multilibs]" +- set libobjc_dir [lookfor_file ${objcpath} libobjc/.libs/libobjc.a] ++ set libobjc_dir [lookfor_file ${objcpath} libobjc/libobjc.a] + if { $libobjc_dir != "" } { + set libobjc_dir [file dirname ${libobjc_dir}] + set objc_link_flags "-L${libobjc_dir}" +@@ -271,4 +271,3 @@ + + return $text + } +- + +diff --width=160 -du lib/g++.exp lib.1/g++.exp +--- gcc/testsuite/lib/g++.exp.org Mon Jul 2 14:42:04 2001 ++++ gcc/testsuite/lib/g++.exp Mon Jul 2 14:43:40 2001 +@@ -65,7 +65,6 @@ + # + proc g++_include_flags { paths } { + global srcdir +- global HAVE_LIBSTDCXX_V3 + + set flags "" + +@@ -80,14 +79,9 @@ + + set gccpath ${paths} + +- if { ${HAVE_LIBSTDCXX_V3} } { +- set odir_v3 [lookfor_file ${gccpath} libstdc++-v3] +- append flags [exec sh ${odir_v3}/testsuite_flags --build-includes] +- } else { + set odir_v2 [lookfor_file ${gccpath} libstdc++] + set sdir_v2 [lookfor_file ${srcdir} libstdc++] + append flags "-I${sdir_v2} -I${sdir_v2}/stl " +- } + + return "$flags" + } +@@ -226,7 +220,7 @@ + + # Make sure that lines are not wrapped. That can confuse the + # error-message parsing machinery. +- lappend ALWAYS_CXXFLAGS "additional_flags=-fmessage-length=0" ++ # lappend ALWAYS_CXXFLAGS "additional_flags=-fmessage-length=0" + + verbose -log "ALWAYS_CXXFLAGS set to $ALWAYS_CXXFLAGS" + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcj-vs-iconv.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcj-vs-iconv.dpatch @@ -0,0 +1,733 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 -l < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 -l < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +Patch: gcj -vs- iconv + +To: Gcc Patch List +Subject: Patch: gcj -vs- iconv +From: Tom Tromey +Date: 06 Mar 2000 14:39:01 -0700 +Reply-To: tromey at cygnus dot com + +# DP: This patch changes gcj to use iconv(), when available, to read Java +# DP: source files. It adds a new `--encoding' option that lets the user +# DP: choose what encoding to use. For systems without iconv(), gcj still +# DP: assumes that the input is UTF-8, but it no longer ignores encoding +# DP: errors. +# DP: +# DP: This patch does have one minor problem, which is that if --encoding is +# DP: not specified we default to UTF-8 instead of the encoding the user has +# DP: chosen (as part of his locale). I don't know how to find that +# DP: information. Anyway, that is an addition which shouldn't affect +# DP: whether or not this patch goes in, since this patch doesn't make the +# DP: situation any worse than it is right now. + +Alex, I'm not sure I really understand how the parser context stack +works, so it is possible that some of my changes there are wrong. +Could you look at it? Is this ok to check in? +# DP: +# DP: This fixes PR gcj/33; I can now compile a Latin-1 encoded file on my +# DP: PPC Linux box with `gcj --encoding=Latin1 ...'. + +2000-03-06 Tom Tromey + + Fix for PR gcj/33: + * jv-scan.c (help): Document --encoding. + (options): Added `encoding' entry. + (OPT_ENCODING): New define. + (main): Handle --encoding. + * lang-options.h: Document --classpath, --CLASSPATH, --main, and + --encoding. + * jcf-parse.c (parse_source_file): Correctly call java_init_lex. + Added `finput' argument. + * java-tree.h (current_encoding): Declare. + * parse.y (java_parser_context_restore_global): Don't restore + `finput'. + (java_parser_context_save_global): Don't set `finput' field. + (java_pop_parser_context): Don't restore `finput'. Free old lexer + if required. + * lang.c (current_encoding): New global. + (lang_decode_option): Recognize `-fencoding='. + (finish_parse): Don't close finput. + * parse.h (struct parser_ctxt): Removed `finput' and + `unget_utf8_value' fields. Added `lexer' field. + (java_init_lex): Fixed declaration. + * lex.c (java_new_lexer): New function. + (java_destroy_lexer): Likewise. + (java_read_char): Added `lex' argument. Handle iconv case. + (java_read_unicode): Added `lex' argument. Count backslashes in + lexer structure. + (java_init_lex): Added `finput' and `encoding' arguments. Set + `lexer' field in ctxp. + (BAD_UTF8_VALUE): Removed. + * lex.h: Include if HAVE_ICONV defined. + (java_lexer): New structure. + (UNGETC): Removed. + (GETC): Removed. + (DEFAULT_ENCODING): New define. + (java_destroy_lexer): Declare. + +Tom + +--- gcc/java/java-tree.h.orig Sat Apr 8 23:03:03 2000 ++++ gcc/java/java-tree.h Sat Apr 8 23:03:56 2000 +@@ -141,6 +141,9 @@ + extern int flag_not_overriding; + extern int flag_static_local_jdk1_1; + ++/* Encoding used for source files. */ ++extern char *current_encoding; ++ + /* The Java .class file that provides main_class; the main input file. */ + extern struct JCF *current_jcf; + +--- gcc/java/jcf-parse.c.orig Sat Apr 8 23:03:03 2000 ++++ gcc/java/jcf-parse.c Sat Apr 8 23:05:39 2000 +@@ -84,7 +84,7 @@ + static tree give_name_to_class PROTO ((JCF *jcf, int index)); + static void parse_zip_file_entries PROTO ((void)); + static void process_zip_dir PROTO ((void)); +-static void parse_source_file PROTO ((tree)); ++static void parse_source_file PARAMS ((tree, FILE *)); + static void jcf_parse_source PROTO ((void)); + static int jcf_figure_file_type PROTO ((JCF *)); + static int find_in_current_zip PROTO ((char *, struct JCF **)); +@@ -570,6 +570,7 @@ + jcf_parse_source () + { + tree file; ++ FILE *finput; + + java_parser_context_save_global (); + java_push_parser_context (); +@@ -580,7 +581,7 @@ + if (!(finput = fopen (input_filename, "r"))) + fatal ("input file `%s' just disappeared - jcf_parse_source", + input_filename); +- parse_source_file (file); ++ parse_source_file (file, finput); + if (fclose (finput)) + fatal ("can't close input file `%s' stream - jcf_parse_source", + input_filename); +@@ -741,8 +742,9 @@ + /* Parse a source file, as pointed by the current value of INPUT_FILENAME. */ + + static void +-parse_source_file (file) ++parse_source_file (file, finput) + tree file; ++ FILE *finput; + { + int save_error_count = java_error_count; + /* Mark the file as parsed */ +@@ -750,7 +752,9 @@ + + lang_init_source (1); /* Error msgs have no method prototypes */ + +- java_init_lex (); /* Initialize the parser */ ++ /* Initialize the parser */ ++ java_init_lex (finput, ++ current_encoding ? current_encoding : DEFAULT_ENCODING); + java_parse_abort_on_error (); + + java_parse (); /* Parse and build partial tree nodes. */ +@@ -778,6 +782,7 @@ + int several_files = 0; + char *list = strdup (input_filename), *next; + tree node, current_file_list = NULL_TREE; ++ FILE *finput; + + do + { +@@ -888,7 +893,7 @@ + case JCF_SOURCE: + java_push_parser_context (); + java_parser_context_save_global (); +- parse_source_file (name); ++ parse_source_file (name, finput); + java_parser_context_restore_global (); + java_pop_parser_context (1); + break; +--- gcc/java/jv-scan.c.orig Sat Apr 8 23:03:03 2000 ++++ gcc/java/jv-scan.c Sat Apr 8 23:11:41 2000 +@@ -53,6 +53,7 @@ + { + int i = 1; + char *output_file = NULL; ++ char *encoding = NULL; + long ft; + + exec_name = argv[0]; +@@ -73,6 +74,14 @@ + argv [i] = NULL; + } + ++ /* file encoding */ ++ else if (!strcmp (argv [i], "--encoding") && i+1 < argc) ++ { ++ argv [i] = NULL; ++ encoding = argv [++i]; ++ argv [i] = NULL; ++ } ++ + /* Print the name of the class that contains main */ + else if (!strcmp (argv [i], "--print-main")) + flag_find_main = 1; +@@ -116,7 +125,7 @@ + input_filename = argv [i]; + if ( (finput = fopen (argv [i], "r")) ) + { +- java_init_lex (); ++ java_init_lex (finput, encoding ? encoding : DEFAULT_ENCODING); + yyparse (); + if (ftell (out) != ft) + fputc ('\n', out); +--- gcc/java/lang-options.h.orig Sat Apr 8 23:03:03 2000 ++++ gcc/java/lang-options.h Sat Apr 8 23:03:56 2000 +@@ -39,8 +39,10 @@ + { "-M", "Print dependencies to stdout" }, + { "-MM", "Print dependencies to stdout" }, + #endif /* ! USE_CPPLIB */ +- { "-fclasspath", "Set class path and suppress system path" }, +- { "-fCLASSPATH", "Set class path" }, ++ { "--classpath", "Set class path and suppress system path" }, ++ { "--CLASSPATH", "Set class path" }, ++ { "--main", "Choose class whose main method should be used" }, ++ { "--encoding", "Choose input encoding (default is UTF-8)" }, + { "-I", "Add directory to class path" }, + { "-foutput-class-dir", "Directory where class files should be written" }, + { "-Wredundant-modifiers", +--- gcc/java/lang.c.orig Sat Apr 8 23:03:03 2000 ++++ gcc/java/lang.c Sat Apr 8 23:03:56 2000 +@@ -105,6 +105,9 @@ + /* When non zero, warns that final local are treated as non final. */ + int flag_static_local_jdk1_1 = 0; + ++/* The encoding of the source file. */ ++char *current_encoding = NULL; ++ + /* From gcc/flags.h, and indicates if exceptions are turned on or not. */ + + extern int flag_new_exceptions; +@@ -172,6 +175,13 @@ + return 1; + } + #undef ARG ++#define ARG "-fencoding=" ++ if (strncmp (p, ARG, sizeof (ARG) - 1) == 0) ++ { ++ current_encoding = p + sizeof (ARG) - 1; ++ return 1; ++ } ++#undef ARG + + if (p[0] == '-' && p[1] == 'f') + { +@@ -252,7 +262,9 @@ + return 0; + } + ++/* Global open file. */ + FILE *finput; ++ + char * + init_parse (filename) + char *filename; +@@ -313,7 +326,6 @@ + void + finish_parse () + { +- fclose (finput); + jcf_dependency_write (); + } + +--- gcc/java/lex.c.orig Sat Apr 8 23:03:03 2000 ++++ gcc/java/lex.c Sat Apr 8 23:14:41 2000 +@@ -24,15 +24,15 @@ + The Free Software Foundation is independent of Sun Microsystems, Inc. */ + + /* It defines java_lex (yylex) that reads a Java ASCII source file +-possibly containing Unicode escape sequence or utf8 encoded characters +-and returns a token for everything found but comments, white spaces +-and line terminators. When necessary, it also fills the java_lval +-(yylval) union. It's implemented to be called by a re-entrant parser +-generated by Bison. +- +-The lexical analysis conforms to the Java grammar described in "The +-Java(TM) Language Specification. J. Gosling, B. Joy, G. Steele. +-Addison Wesley 1996" (http://java.sun.com/docs/books/jls/html/3.doc.html) */ ++ possibly containing Unicode escape sequence or utf8 encoded ++ characters and returns a token for everything found but comments, ++ white spaces and line terminators. When necessary, it also fills ++ the java_lval (yylval) union. It's implemented to be called by a ++ re-entrant parser generated by Bison. ++ ++ The lexical analysis conforms to the Java grammar described in "The ++ Java(TM) Language Specification. J. Gosling, B. Joy, G. Steele. ++ Addison Wesley 1996" (http://java.sun.com/docs/books/jls/html/3.doc.html) */ + + #include "keyword.h" + +@@ -55,15 +55,18 @@ + static int java_parse_doc_section PROTO ((unicode_t)); + static void java_parse_end_comment PROTO ((unicode_t)); + static unicode_t java_get_unicode PROTO (()); +-static unicode_t java_read_unicode PROTO ((int, int *)); +-static void java_store_unicode PROTO ((struct java_line *, unicode_t, int)); +-static unicode_t java_read_char PROTO (()); ++static unicode_t java_read_unicode PARAMS ((java_lexer *, int, int *)); ++static void java_store_unicode PARAMS ((struct java_line *, unicode_t, int)); ++static unicode_t java_read_char PARAMS ((java_lexer *)); + static void java_allocate_new_line PROTO (()); + static void java_unget_unicode PROTO (()); + static unicode_t java_sneak_unicode PROTO (()); ++java_lexer *java_new_lexer PARAMS ((FILE *, const char *)); + + void +-java_init_lex () ++java_init_lex (finput, encoding) ++ FILE *finput; ++ const char *encoding; + { + #ifndef JC1_LITE + int java_lang_imported = 0; +@@ -108,9 +111,9 @@ + ctxp->lineno = lineno = 0; + ctxp->p_line = NULL; + ctxp->c_line = NULL; +- ctxp->unget_utf8_value = 0; + ctxp->minus_seen = 0; + ctxp->java_error_flag = 0; ++ ctxp->lexer = java_new_lexer (finput, encoding); + } + + static char * +@@ -188,22 +191,142 @@ + ctxp->c_line->white_space_only = 1; + } + +-#define BAD_UTF8_VALUE 0xFFFE ++/* Create a new lexer object. */ ++java_lexer * ++java_new_lexer (finput, encoding) ++ FILE *finput; ++ const char *encoding; ++{ ++ java_lexer *lex = (java_lexer *) xmalloc (sizeof (java_lexer)); ++ int enc_error = 0; ++ ++ lex->finput = finput; ++ lex->bs_count = 0; ++ lex->unget_value = 0; ++ ++#ifdef HAVE_ICONV ++ lex->handle = iconv_open ("UCS-2", encoding); ++ if (lex->handle == (iconv_t) -1) ++ { ++ /* FIXME: we should give a nice error based on errno here. */ ++ enc_error = 1; ++ } ++ lex->first = -1; ++ lex->last = -1; ++#else /* HAVE_ICONV */ ++ if (strcmp (encoding, DEFAULT_ENCODING)) ++ enc_error = 1; ++#endif /* HAVE_ICONV */ ++ ++ if (enc_error) ++ fatal ("unknown encoding: `%s'", encoding); ++ ++ return lex; ++} ++ ++void ++java_destroy_lexer (lex) ++ java_lexer *lex; ++{ ++ fclose (lex->finput); ++#ifdef HAVE_ICONV ++ iconv_close (lex->handle); ++#endif ++ free (lex); ++} + + static unicode_t +-java_read_char () ++java_read_char (lex) ++ java_lexer *lex; + { +- int c; +- int c1, c2; ++ if (lex->unget_value) ++ { ++ unicode_t r = lex->unget_value; ++ lex->unget_value = 0; ++ return r; ++ } ++ ++#ifdef HAVE_ICONV ++ { ++ char out[2]; ++ size_t ir, inbytesleft, in_save, out_count; ++ char *inp, *outp; + +- if (ctxp->unget_utf8_value) ++ while (1) + { +- int to_return = ctxp->unget_utf8_value; +- ctxp->unget_utf8_value = 0; +- return (to_return); ++ /* See if we need to read more data. If FIRST == 0 then the ++ previous conversion attempt ended in the middle of a ++ character at the end of the buffer. Otherwise we only have ++ to read if the buffer is empty. */ ++ if (lex->first == 0 || lex->first >= lex->last) ++ { ++ int r; ++ ++ if (lex->first >= lex->last) ++ { ++ lex->first = 0; ++ lex->last = 0; ++ } ++ if (feof (lex->finput)) ++ return UEOF; ++ r = fread (&lex->buffer[lex->last], 1, ++ sizeof (lex->buffer) - lex->last, ++ lex->finput); ++ lex->last += r; + } + +- c = GETC (); ++ inbytesleft = lex->last - lex->first; ++ ++ if (inbytesleft == 0) ++ { ++ /* We've tried to read and there is nothing left. */ ++ return UEOF; ++ } ++ ++ in_save = inbytesleft; ++ out_count = 2; ++ inp = &lex->buffer[lex->first]; ++ outp = out; ++ ir = iconv (lex->handle, (const char **) &inp, &inbytesleft, ++ &outp, &out_count); ++ lex->first += in_save - inbytesleft; ++ ++ if (out_count == 0) ++ { ++ /* Success. We assume that UCS-2 is big-endian. This ++ appears to be an ok assumption. */ ++ unicode_t result; ++ result = (((unsigned char) out[0]) << 8) | (unsigned char) out[1]; ++ return result; ++ } ++ ++ if (ir == (size_t) -1) ++ { ++ if (errno == EINVAL) ++ { ++ /* This is ok. This means that the end of our buffer ++ is in the middle of a character sequence. We just ++ move the valid part of the buffer to the beginning ++ to force a read. */ ++ /* We use bcopy() because it should work for ++ overlapping strings. Use memmove() instead... */ ++ bcopy (&lex->buffer[lex->first], &lex->buffer[0], ++ lex->last - lex->first); ++ lex->last -= lex->first; ++ lex->first = 0; ++ } ++ else ++ { ++ /* A more serious error. */ ++ java_lex_error ("unrecognized character in input stream", 0); ++ } ++ } ++ } ++ } ++#else /* HAVE_ICONV */ ++ { ++ int c, c1, c2; ++ c = getc (lex->finput); + + if (c < 128) + return (unicode_t)c; +@@ -213,17 +336,17 @@ + { + if ((c & 0xe0) == 0xc0) + { +- c1 = GETC (); ++ c1 = getc (lex->finput); + if ((c1 & 0xc0) == 0x80) + return (unicode_t)(((c &0x1f) << 6) + (c1 & 0x3f)); + c = c1; + } + else if ((c & 0xf0) == 0xe0) + { +- c1 = GETC (); ++ c1 = getc (lex->finput); + if ((c1 & 0xc0) == 0x80) + { +- c2 = GETC (); ++ c2 = getc (lex->finput); + if ((c2 & 0xc0) == 0x80) + return (unicode_t)(((c & 0xf) << 12) + + (( c1 & 0x3f) << 6) + (c2 & 0x3f)); +@@ -233,14 +356,15 @@ + else + c = c1; + } +- /* We looked for a UTF8 multi-byte sequence (since we saw an initial +- byte with the high bit set), but found invalid bytes instead. +- If the most recent byte was Ascii (and not EOF), we should +- unget it, in case it was a comment terminator or other delimitor. */ +- if ((c & 0x80) == 0) +- UNGETC (c); +- return BAD_UTF8_VALUE; ++ ++ /* We simply don't support invalid characters. */ ++ java_lex_error ("malformed UTF-8 character", 0); ++ } + } ++#endif /* HAVE_ICONV */ ++ ++ /* We only get here on error. */ ++ return UEOF; + } + + static void +@@ -261,56 +385,54 @@ + } + + static unicode_t +-java_read_unicode (term_context, unicode_escape_p) ++java_read_unicode (lex, term_context, unicode_escape_p) ++ java_lexer *lex; + int term_context; + int *unicode_escape_p; + { + unicode_t c; +- long i, base; + +- c = java_read_char (); ++ c = java_read_char (lex); + *unicode_escape_p = 0; + + if (c != '\\') +- return ((term_context ? c : +- java_lineterminator (c) ? '\n' : (unicode_t)c)); +- +- /* Count the number of preceeding '\' */ +- for (base = ftell (finput), i = base-2; c == '\\';) + { +- fseek (finput, i--, SEEK_SET); +- c = java_read_char (); /* Will fail if reading utf8 stream. FIXME */ ++ lex->bs_count = 0; ++ return (term_context ? c : (java_lineterminator (c) ++ ? '\n' ++ : (unicode_t) c)); + } +- fseek (finput, base, SEEK_SET); +- if ((base-i-3)%2 == 0) /* If odd number of \ seen */ ++ ++ ++lex->bs_count; ++ if ((lex->bs_count) % 2 == 1) + { +- c = java_read_char (); ++ /* Odd number of \ seen. */ ++ c = java_read_char (lex); + if (c == 'u') + { +- unsigned short unicode = 0; ++ unicode_t unicode = 0; + int shift = 12; + /* Next should be 4 hex digits, otherwise it's an error. + The hex value is converted into the unicode, pushed into + the Unicode stream. */ + for (shift = 12; shift >= 0; shift -= 4) + { +- if ((c = java_read_char ()) == UEOF) ++ if ((c = java_read_char (lex)) == UEOF) + return UEOF; + if (c >= '0' && c <= '9') + unicode |= (unicode_t)((c-'0') << shift); + else if ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) + unicode |= (unicode_t)((10+(c | 0x20)-'a') << shift); + else +- java_lex_error +- ("Non hex digit in Unicode escape sequence", 0); ++ java_lex_error ("Non hex digit in Unicode escape sequence", 0); + } + *unicode_escape_p = 1; +- return (term_context ? unicode : +- (java_lineterminator (c) ? '\n' : unicode)); ++ return (term_context ++ ? unicode : (java_lineterminator (c) ? '\n' : unicode)); + } +- ctxp->unget_utf8_value = c; ++ lex->unget_value = c; + } +- return (unicode_t)'\\'; ++ return (unicode_t) '\\'; + } + + static unicode_t +@@ -325,7 +447,7 @@ + for (;;) + { + int unicode_escape_p; +- c = java_read_unicode (0, &unicode_escape_p); ++ c = java_read_unicode (ctxp->lexer, 0, &unicode_escape_p); + java_store_unicode (ctxp->c_line, c, unicode_escape_p); + if (ctxp->c_line->white_space_only + && !JAVA_WHITE_SPACE_P (c) && c!='\n') +@@ -346,7 +468,7 @@ + int unicode_escape_p; + if (c == '\n') /* CR */ + { +- if ((c = java_read_unicode (1, &unicode_escape_p)) != '\r') ++ if ((c = java_read_unicode (ctxp->lexer, 1, &unicode_escape_p)) != '\r') + { + ctxp->c_line->ahead [0] = c; + ctxp->c_line->unicode_escape_ahead_p = unicode_escape_p; +@@ -355,7 +477,7 @@ + } + else if (c == '\r') /* LF */ + { +- if ((c = java_read_unicode (1, &unicode_escape_p)) != '\n') ++ if ((c = java_read_unicode (ctxp->lexer, 1, &unicode_escape_p)) != '\n') + { + ctxp->c_line->ahead [0] = c; + ctxp->c_line->unicode_escape_ahead_p = unicode_escape_p; +--- gcc/java/lex.h.orig Sat Apr 8 23:03:03 2000 ++++ gcc/java/lex.h Sat Apr 8 23:03:56 2000 +@@ -35,6 +35,13 @@ + /* A Unicode character, as read from the input file */ + typedef unsigned short unicode_t; + ++#ifdef HAVE_ICONV ++#include ++#endif /* HAVE_ICONV */ ++ ++/* Default encoding to use if no encoding is specified. */ ++#define DEFAULT_ENCODING "UTF-8" ++ + /* Debug macro to print-out what we match */ + #ifdef JAVA_LEX_DEBUG + #ifdef JAVA_LEX_DEBUG_CHAR +@@ -96,12 +103,38 @@ + int col; + } java_lc; + ++typedef struct java_lexer ++{ ++ /* The file from which we're reading. */ ++ FILE *finput; ++ ++ /* Number of consecutive backslashes we've read. */ ++ int bs_count; ++ ++ /* If nonzero, a value that was pushed back. */ ++ unicode_t unget_value; ++ ++#ifdef HAVE_ICONV ++ /* The handle for the iconv converter we're using. */ ++ iconv_t handle; ++ ++ /* Bytes we've read from the file but have not sent to iconv. */ ++ char buffer[1024]; ++ ++ /* Index of first valid character in buffer, -1 if no valid ++ characters. */ ++ int first; ++ ++ /* Index of last valid character in buffer, plus one. -1 if no ++ valid characters in buffer. */ ++ int last; ++#endif /* HAVE_ICONV */ ++} java_lexer; + +-#define JAVA_LINE_MAX 80 ++/* Destroy a lexer object. */ ++extern void java_destroy_lexer PARAMS ((java_lexer *)); + +-/* Macro to read and unread bytes */ +-#define UNGETC(c) ungetc(c, finput) +-#define GETC() getc(finput) ++#define JAVA_LINE_MAX 80 + + /* Build a location compound integer */ + #define BUILD_LOCATION() ((ctxp->elc.line << 12) | (ctxp->elc.col & 0xfff)) +--- gcc/java/parse.h.orig Sat Apr 8 23:03:03 2000 ++++ gcc/java/parse.h Sat Apr 8 23:15:36 2000 +@@ -586,12 +586,11 @@ + struct parser_ctxt { + + char *filename; /* Current filename */ +- FILE *finput; /* Current file input stream */ + struct parser_ctxt *next; + ++ java_lexer *lexer; /* Current lexer state */ + struct java_line *p_line, *c_line; /* Previous and current line */ + java_lc elc; /* Error's line column info */ +- unicode_t unget_utf8_value; /* An unget utf8 value */ + int ccb_indent; /* Keep track of {} indent, lexer */ + int first_ccb_indent1; /* First { at ident level 1 */ + int last_ccb_indent1; /* Last } at ident level 1 */ +@@ -668,7 +667,7 @@ + /* Always in use, no matter what you compile */ + void java_push_parser_context PROTO ((void)); + void java_pop_parser_context PROTO ((int)); +-void java_init_lex PROTO ((void)); ++void java_init_lex PARAMS ((FILE *, const char *)); + extern void java_parser_context_save_global PROTO ((void)); + extern void java_parser_context_restore_global PROTO ((void)); + int yyparse PROTO ((void)); +--- gcc/java/parse.y.orig Sat Apr 8 23:03:03 2000 ++++ gcc/java/parse.y Sat Apr 8 23:03:56 2000 +@@ -2347,7 +2347,6 @@ + java_push_parser_context (); + extra_ctxp_pushed_p = 1; + } +- ctxp->finput = finput; + ctxp->lineno = lineno; + ctxp->current_class = current_class; + ctxp->filename = input_filename; +@@ -2357,7 +2356,6 @@ + void + java_parser_context_restore_global () + { +- finput = ctxp->finput; + lineno = ctxp->lineno; + current_class = ctxp->current_class; + input_filename = ctxp->filename; +@@ -2386,9 +2384,12 @@ + next->incomplete_class = ctxp->incomplete_class; + next->gclass_list = ctxp->gclass_list; + lineno = ctxp->lineno; +- finput = ctxp->finput; + current_class = ctxp->current_class; + } ++ ++ /* If the old and new lexers differ, then free the old one. */ ++ if (ctxp->lexer && next && ctxp->lexer != next->lexer) ++ java_destroy_lexer (ctxp->lexer); + + /* Set the single import class file flag to 0 for the current list + of imported things */ --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-2.95.diff +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-2.95.diff @@ -0,0 +1,746 @@ +Changes for GCC version 2.95 for GNU Pascal + +Before applying these diffs, go to the directory gcc-2.95/gcc +and use the command + + patch -p1 + +feeding it the following diffs as input. + +*** gcc/expr.c.orig Thu Jul 1 00:59:55 1999 +--- gcc/expr.c Mon Aug 21 01:33:04 2000 +*************** +*** 4505,4510 **** +--- 4505,4517 ---- + + domain_min = convert (sizetype, TYPE_MIN_VALUE (domain)); + domain_max = convert (sizetype, TYPE_MAX_VALUE (domain)); ++ ++ #ifdef GPC ++ /* Align the set. */ ++ if (set_alignment) ++ domain_min = size_binop (BIT_AND_EXPR, domain_min, size_int (-set_alignment)); ++ #endif /* GPC */ ++ + bitlength = size_binop (PLUS_EXPR, + size_binop (MINUS_EXPR, domain_max, domain_min), + size_one_node); +*************** +*** 4519,4525 **** +--- 4526,4534 ---- + if (GET_MODE (target) != BLKmode || nbits <= 2 * BITS_PER_WORD + || (nbytes <= 32 && TREE_CHAIN (elt) != NULL_TREE)) + { ++ #ifndef GPC + int set_word_size = TYPE_ALIGN (TREE_TYPE (exp)); ++ #endif /* not GPC */ + enum machine_mode mode = mode_for_size (set_word_size, MODE_INT, 1); + char *bit_buffer = (char *) alloca (nbits); + HOST_WIDE_INT word = 0; +*************** +*** 4531,4540 **** + { + if (bit_buffer[ibit]) + { + if (BYTES_BIG_ENDIAN) +! word |= (1 << (set_word_size - 1 - bit_pos)); + else +! word |= 1 << bit_pos; + } + bit_pos++; ibit++; + if (bit_pos >= set_word_size || ibit == nbits) +--- 4540,4553 ---- + { + if (bit_buffer[ibit]) + { ++ #ifdef GPC ++ if (set_words_big_endian) ++ #else /* not GPC */ + if (BYTES_BIG_ENDIAN) +! #endif /* not GPC */ +! word |= ((HOST_WIDE_INT) 1 << (set_word_size - 1 - bit_pos)); + else +! word |= (HOST_WIDE_INT) 1 << bit_pos; + } + bit_pos++; ibit++; + if (bit_pos >= set_word_size || ibit == nbits) +*************** +*** 4645,4650 **** +--- 4658,4669 ---- + else + #endif + { ++ #ifdef GPC ++ /* The language-specific run time library must provide ++ a suitable `__setbits()' function whose action coincides ++ with the values of `set_word_size', `set_alignment', and ++ `set_words_big_endian'. */ ++ #endif /* GPC */ + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__setbits"), + 0, VOIDmode, 4, XEXP (targetx, 0), Pmode, + bitlength_rtx, TYPE_MODE (sizetype), +*** gcc/fold-const.c.orig Mon Aug 21 01:32:54 2000 +--- gcc/fold-const.c Mon Aug 21 01:33:35 2000 +*************** +*** 1462,1469 **** +--- 1462,1473 ---- + } + + TREE_OVERFLOW (t) ++ #ifdef GPC ++ = ((notrunc ? overflow : force_fit_type (t, overflow)) ++ #else /* not GPC */ + = ((notrunc ? (!uns || forsize) && overflow + : force_fit_type (t, (!uns || forsize) && overflow) && ! no_overflow) ++ #endif /* not GPC */ + | TREE_OVERFLOW (arg1) + | TREE_OVERFLOW (arg2)); + /* If we're doing a size calculation, unsigned arithmetic does overflow. +*************** +*** 4720,4729 **** + TREE_TYPE (TREE_TYPE (arg0)), + TREE_OPERAND (arg0, 1)))); + else if (TREE_CODE (arg0) == COMPLEX_CST) +! return build_complex (type, TREE_OPERAND (arg0, 0), + fold (build1 (NEGATE_EXPR, + TREE_TYPE (TREE_TYPE (arg0)), +! TREE_OPERAND (arg0, 1)))); + else if (TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) == MINUS_EXPR) + return fold (build (TREE_CODE (arg0), type, + fold (build1 (CONJ_EXPR, type, +--- 4724,4733 ---- + TREE_TYPE (TREE_TYPE (arg0)), + TREE_OPERAND (arg0, 1)))); + else if (TREE_CODE (arg0) == COMPLEX_CST) +! return build_complex (type, TREE_REALPART (arg0), + fold (build1 (NEGATE_EXPR, + TREE_TYPE (TREE_TYPE (arg0)), +! TREE_IMAGPART (arg0)))); + else if (TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) == MINUS_EXPR) + return fold (build (TREE_CODE (arg0), type, + fold (build1 (CONJ_EXPR, type, +*** gcc/stor-layout.c.orig Thu Mar 11 14:56:20 1999 +--- gcc/stor-layout.c Mon Aug 21 01:33:04 2000 +*************** +*** 19,24 **** +--- 19,26 ---- + Boston, MA 02111-1307, USA. */ + + ++ /* @@ PATCHED FOR GPC 20030218 @@ */ ++ + #include "config.h" + #include "system.h" + +*************** +*** 53,58 **** +--- 55,73 ---- + May be overridden by front-ends. */ + int set_alignment = 0; + ++ #ifdef GPC ++ /* The word size of a bitstring or (power-)set value, in bits. ++ Must be non-zero. ++ May be overridden by front-ends. */ ++ int set_word_size = BITS_PER_UNIT; ++ ++ /* If non-zero, bits in (power-)sets start with the highest bit. ++ May be overridden by front-ends. ++ In order to be backward-compatible, the Chill frontend should ++ initialize this to BYTES_BIG_ENDIAN. */ ++ int set_words_big_endian = 0; ++ #endif /* GPC */ ++ + static tree layout_record PROTO((tree)); + static void layout_union PROTO((tree)); + +*************** +*** 1040,1045 **** +--- 1055,1074 ---- + abort(); + else + { ++ #ifdef GPC ++ int alignment = set_alignment ? set_alignment : set_word_size; ++ int lower_bound = TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (type))); ++ int upper_bound = TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (type))); ++ int size_in_bits, rounded_size; ++ if (set_alignment) ++ size_in_bits = upper_bound - (lower_bound & (-alignment)) + 1; ++ else ++ size_in_bits ++ = (TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) ++ - TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) + 1); ++ rounded_size ++ = ((size_in_bits + alignment - 1) / alignment) * alignment; ++ #else /* not GPC */ + #ifndef SET_WORD_SIZE + #define SET_WORD_SIZE BITS_PER_WORD + #endif +*************** +*** 1049,1054 **** +--- 1078,1084 ---- + - TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) + 1); + int rounded_size + = ((size_in_bits + alignment - 1) / alignment) * alignment; ++ #endif /* not GPC */ + if (rounded_size > alignment) + TYPE_MODE (type) = BLKmode; + else +*** gcc/tree.c.orig Mon Aug 2 07:07:23 1999 +--- gcc/tree.c Mon Aug 21 01:33:04 2000 +*************** +*** 637,642 **** +--- 637,659 ---- + = (char *) obstack_alloc (function_maybepermanent_obstack, 0); + } + ++ #ifdef GPC ++ /* When building a type copy or something similar, and the original ++ type (whose obstack is used, which is done by the caller) is ++ placed on the function_maybepermanent_obstack *before* its limit ++ (maybepermanent_firstobj), the new type must be there as well ++ because it is kept as a variant of the original type, i.e. we ++ must set the limit here. */ ++ static void ++ check_type_obstack (type) ++ tree type; ++ { ++ if (TYPE_OBSTACK (type) == function_maybepermanent_obstack ++ && (char *) type < maybepermanent_firstobj) ++ preserve_data (); ++ } ++ #endif ++ + void + preserve_initializer () + { +*************** +*** 3379,3384 **** +--- 3396,3404 ---- + then type_hash_add calls oballoc expecting to get something permanent + back. */ + current_obstack = ambient_obstack; ++ #ifdef GPC ++ check_type_obstack (ttype); ++ #endif + } + + return ttype; +*************** +*** 3695,3700 **** +--- 3715,3723 ---- + current_obstack = TYPE_OBSTACK (type); + t = copy_node (type); + current_obstack = ambient_obstack; ++ #ifdef GPC ++ check_type_obstack (type); ++ #endif + + TYPE_POINTER_TO (t) = 0; + TYPE_REFERENCE_TO (t) = 0; +*************** +*** 4155,4160 **** +--- 4178,4186 ---- + push_obstacks (TYPE_OBSTACK (to_type), TYPE_OBSTACK (to_type)); + t = make_node (POINTER_TYPE); + pop_obstacks (); ++ #ifdef GPC ++ check_type_obstack (to_type); ++ #endif + + TREE_TYPE (t) = to_type; + +*************** +*** 4190,4195 **** +--- 4216,4224 ---- + push_obstacks (TYPE_OBSTACK (itype), TYPE_OBSTACK (itype)); + TYPE_MAX_VALUE (itype) = convert (sizetype, maxval); + pop_obstacks (); ++ #ifdef GPC ++ check_type_obstack (itype); ++ #endif + + TYPE_MODE (itype) = TYPE_MODE (sizetype); + TYPE_SIZE (itype) = TYPE_SIZE (sizetype); +*************** +*** 4230,4235 **** +--- 4259,4267 ---- + TYPE_MIN_VALUE (itype) = convert (type, lowval); + TYPE_MAX_VALUE (itype) = highval ? convert (type, highval) : NULL; + pop_obstacks (); ++ #ifdef GPC ++ check_type_obstack (itype); ++ #endif + + TYPE_PRECISION (itype) = TYPE_PRECISION (type); + TYPE_MODE (itype) = TYPE_MODE (type); +*************** +*** 4397,4402 **** +--- 4429,4437 ---- + push_obstacks (TYPE_OBSTACK (to_type), TYPE_OBSTACK (to_type)); + t = make_node (REFERENCE_TYPE); + pop_obstacks (); ++ #ifdef GPC ++ check_type_obstack (to_type); ++ #endif + + TREE_TYPE (t) = to_type; + +*************** +*** 5025,5030 **** +--- 5060,5074 ---- + HOST_WIDE_INT domain_min + = TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (init)))); + tree non_const_bits = NULL_TREE; ++ ++ #ifdef GPC ++ /* Align the set. */ ++ if (set_alignment) ++ /* Note: `domain_min -= domain_min % set_alignment' would be wrong for negative ++ numbers (rounding towards 0, while we have to round towards -inf). */ ++ domain_min &= -set_alignment; ++ #endif /* GPC */ ++ + for (i = 0; i < bit_size; i++) + buffer[i] = 0; + +*************** +*** 5044,5051 **** + HOST_WIDE_INT hi_index + = TREE_INT_CST_LOW (TREE_VALUE (vals)) - domain_min; + if (lo_index < 0 || lo_index >= bit_size +! || hi_index < 0 || hi_index >= bit_size) +! abort (); + for ( ; lo_index <= hi_index; lo_index++) + buffer[lo_index] = 1; + } +--- 5088,5098 ---- + HOST_WIDE_INT hi_index + = TREE_INT_CST_LOW (TREE_VALUE (vals)) - domain_min; + if (lo_index < 0 || lo_index >= bit_size +! || hi_index < 0 || hi_index >= bit_size) +! { +! error ("invalid set initializer"); +! return NULL_TREE; +! } + for ( ; lo_index <= hi_index; lo_index++) + buffer[lo_index] = 1; + } +*************** +*** 5056,5062 **** + = TREE_INT_CST_LOW (TREE_VALUE (vals)) - domain_min; + if (index < 0 || index >= bit_size) + { +! error ("invalid initializer for bit string"); + return NULL_TREE; + } + buffer[index] = 1; +--- 5103,5109 ---- + = TREE_INT_CST_LOW (TREE_VALUE (vals)) - domain_min; + if (index < 0 || index >= bit_size) + { +! error ("invalid set initializer"); + return NULL_TREE; + } + buffer[index] = 1; +*************** +*** 5077,5084 **** +--- 5124,5135 ---- + int wd_size; + { + int i; ++ #ifdef GPC ++ int bit_size = wd_size * BITS_PER_UNIT; ++ #else /* not GPC */ + int set_word_size = BITS_PER_UNIT; + int bit_size = wd_size * set_word_size; ++ #endif /* not GPC */ + int bit_pos = 0; + unsigned char *bytep = buffer; + char *bit_buffer = (char *) alloca(bit_size); +*************** +*** 5089,5094 **** +--- 5140,5163 ---- + + for (i = 0; i < bit_size; i++) + { ++ #ifdef GPC ++ if (bit_buffer[i]) ++ { ++ int k = bit_pos / BITS_PER_UNIT; ++ if (WORDS_BIG_ENDIAN) ++ k = set_word_size / BITS_PER_UNIT - 1 - k; ++ if (set_words_big_endian) ++ bytep[k] |= (1 << (BITS_PER_UNIT - 1 - bit_pos % BITS_PER_UNIT)); ++ else ++ bytep[k] |= (1 << (bit_pos % BITS_PER_UNIT)); ++ } ++ bit_pos++; ++ if (bit_pos >= set_word_size) ++ { ++ bit_pos = 0; ++ bytep += set_word_size / BITS_PER_UNIT; ++ } ++ #else /* not GPC */ + if (bit_buffer[i]) + { + if (BYTES_BIG_ENDIAN) +*************** +*** 5099,5104 **** +--- 5168,5174 ---- + bit_pos++; + if (bit_pos >= set_word_size) + bit_pos = 0, bytep++; ++ #endif /* not GPC */ + } + return non_const_bits; + } +*** gcc/tree.h.orig Sun May 2 19:43:32 1999 +--- gcc/tree.h Mon Aug 21 01:33:04 2000 +*************** +*** 1133,1139 **** + /* Nonzero for any sort of ..._DECL node means this decl node represents + an inline instance of some original (abstract) decl from an inline function; + suppress any warnings about shadowing some other variable. */ +! #define DECL_FROM_INLINE(NODE) (DECL_ABSTRACT_ORIGIN (NODE) != (tree) 0) + + /* Nonzero if a _DECL means that the name of this decl should be ignored + for symbolic debug purposes. */ +--- 1133,1140 ---- + /* Nonzero for any sort of ..._DECL node means this decl node represents + an inline instance of some original (abstract) decl from an inline function; + suppress any warnings about shadowing some other variable. */ +! #define DECL_FROM_INLINE(NODE) (DECL_ABSTRACT_ORIGIN (NODE) != NULL_TREE \ +! && DECL_ABSTRACT_ORIGIN (NODE) != (NODE)) + + /* Nonzero if a _DECL means that the name of this decl should be ignored + for symbolic debug purposes. */ +*************** +*** 1631,1636 **** +--- 1632,1645 ---- + /* If non-zero, the alignment of a bitstring or (power-)set value, in bits. */ + extern int set_alignment; + ++ #ifdef GPC ++ /* The word size of a bitstring or (power-)set value, in bits. */ ++ extern int set_word_size; ++ ++ /* If non-zero, bits in (power-)sets start with the highest bit. */ ++ extern int set_words_big_endian; ++ #endif /* GPC */ ++ + /* Concatenate two lists (chains of TREE_LIST nodes) X and Y + by making the last node in X point to Y. + Returns X, except if X is 0 returns Y. */ +*** gcc/tree.def.orig Mon May 17 09:21:12 1999 +--- gcc/tree.def Mon Aug 21 01:33:04 2000 +*************** +*** 490,528 **** + DEFTREECODE (CLEANUP_POINT_EXPR, "cleanup_point_expr", 'e', 1) + + /* The following two codes are used in languages that have types where +! the position and/or sizes of fields vary from object to object of the +! same type, i.e., where some other field in the object contains a value +! that is used in the computation of another field's offset or size. +! +! For example, a record type with a discriminant in Ada is such a type. +! This mechanism is also used to create "fat pointers" for unconstrained +! array types in Ada; the fat pointer is a structure one of whose fields is +! a pointer to the actual array type and the other field is a pointer to a +! template, which is a structure containing the bounds of the array. The +! bounds in the type pointed to by the first field in the fat pointer refer +! to the values in the template. +! +! These "self-references" are doing using a PLACEHOLDER_EXPR. This is a +! node that will later be replaced with the object being referenced. Its type +! is that of the object and selects which object to use from a chain of +! references (see below). +! +! When we wish to evaluate a size or offset, we check it is contains a +! placeholder. If it does, we construct a WITH_RECORD_EXPR that contains +! both the expression we wish to evaluate and an expression within which the +! object may be found. The latter expression is the object itself in +! the simple case of an Ada record with discriminant, but it can be the +! array in the case of an unconstrained array. +! +! In the latter case, we need the fat pointer, because the bounds of the +! array can only be accessed from it. However, we rely here on the fact that +! the expression for the array contains the dereference of the fat pointer +! that obtained the array pointer. + + Accordingly, when looking for the object to substitute in place of + a PLACEHOLDER_EXPR, we look down the first operand of the expression +! passed as the second operand to WITH_RECORD_EXPR until we find something +! of the desired type or reach a constant. */ + + /* Denotes a record to later be supplied with a WITH_RECORD_EXPR when + evaluating this expression. The type of this expression is used to +--- 490,547 ---- + DEFTREECODE (CLEANUP_POINT_EXPR, "cleanup_point_expr", 'e', 1) + + /* The following two codes are used in languages that have types where +! some field in an object of the type contains a value that is used in +! the computation of another field's offset or size and/or the size of +! the type. The positions and/or sizes of fields can vary from object +! to object of the same type or even for one and the same object within +! its scope. +! +! Record types with discriminants in Ada or schema types in Pascal are +! examples of such types. This mechanism is also used to create "fat +! pointers" for unconstrained array types in Ada; the fat pointer is a +! structure one of whose fields is a pointer to the actual array type +! and the other field is a pointer to a template, which is a structure +! containing the bounds of the array. The bounds in the type pointed +! to by the first field in the fat pointer refer to the values in the +! template. +! +! When you wish to construct such a type you need "self-references" +! that allow you to reference the object having this type from the +! TYPE node, i.e. without having a variable instantiating this type. +! +! Such a "self-references" is done using a PLACEHOLDER_EXPR. This is +! a node that will later be replaced with the object being referenced. +! Its type is that of the object and selects which object to use from +! a chain of references (see below). No other slots are used in the +! PLACEHOLDER_EXPR. +! +! For example, if your type FOO is a RECORD_TYPE with a field BAR, +! and you need the value of .BAR to calculate TYPE_SIZE +! (FOO), just substitute above with a PLACEHOLDER_EXPR +! whose TREE_TYPE is FOO. Then construct your COMPONENT_REF with +! the PLACEHOLDER_EXPR as the first operand (which has the correct +! type). Later, when the size is needed in the program, the back-end +! will find this PLACEHOLDER_EXPR and generate code to calculate the +! actual size at run-time. In the following, we describe how this +! calculation is done. +! +! When we wish to evaluate a size or offset, we check whether it +! contains a PLACEHOLDER_EXPR. If it does, we construct a +! WITH_RECORD_EXPR that contains both the expression we wish to +! evaluate and an expression within which the object may be found. +! The latter expression is the object itself in the simple case of an +! Ada record with discriminant, but it can be the array in the case of +! an unconstrained array. +! +! In the latter case, we need the fat pointer, because the bounds of +! the array can only be accessed from it. However, we rely here on the +! fact that the expression for the array contains the dereference of +! the fat pointer that obtained the array pointer. + + Accordingly, when looking for the object to substitute in place of + a PLACEHOLDER_EXPR, we look down the first operand of the expression +! passed as the second operand to WITH_RECORD_EXPR until we find +! something of the desired type or reach a constant. */ + + /* Denotes a record to later be supplied with a WITH_RECORD_EXPR when + evaluating this expression. The type of this expression is used to +*** gcc/dbxout.c.orig Tue Jan 15 00:41:26 2002 +--- gcc/dbxout.c Sat Nov 2 04:24:37 2002 +*************** +*** 1160,1165 **** +--- 1160,1169 ---- + HOST_BITS_PER_WIDE_INT. That is wrong since gdb uses a + long (it has no concept of HOST_BITS_PER_WIDE_INT). */ + else if (use_gnu_debug_info_extensions ++ #ifdef GPC ++ && TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST ++ && TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST ++ #endif + && (TYPE_PRECISION (type) > TYPE_PRECISION (integer_type_node) + || TYPE_PRECISION (type) >= HOST_BITS_PER_LONG)) + { +*************** +*** 1296,1301 **** +--- 1300,1306 ---- + dbxout_type (TYPE_DOMAIN (type), 0, 0); + break; + } ++ + /* Output "a" followed by a range type definition + for the index type of the array + followed by a reference to the target-type. +*** gcc/dwarf2out.c.orig Mon Apr 9 11:27:08 2001 +--- gcc/dwarf2out.c Tue Oct 8 12:02:53 2002 +*************** +*** 6264,6272 **** + || TREE_CODE (type) == VOID_TYPE) + return 0; + +! if (TREE_CODE (name) == TYPE_DECL) +! name = DECL_NAME (name); +! type_name = IDENTIFIER_POINTER (name); + + switch (TREE_CODE (type)) + { +--- 6264,6278 ---- + || TREE_CODE (type) == VOID_TYPE) + return 0; + +! if (name) +! { +! if (TREE_CODE (name) == TYPE_DECL) +! name = DECL_NAME (name); +! +! type_name = IDENTIFIER_POINTER (name); +! } +! else +! type_name = "__unknown__"; + + switch (TREE_CODE (type)) + { +*************** +*** 7372,7386 **** + /* Else leave out the attribute. */ + break; + +- case MAX_EXPR: + case VAR_DECL: + case COMPONENT_REF: +! /* ??? These types of bounds can be created by the Ada front end, +! and it isn't clear how to emit debug info for them. */ + break; + + default: +! abort (); + } + } + +--- 7378,7394 ---- + /* Else leave out the attribute. */ + break; + + case VAR_DECL: + case COMPONENT_REF: +! case PARM_DECL: +! /* ??? These types of bounds as well as all kinds of expressions +! can be created by the Ada and Pascal front ends, +! and it isn't clear how to emit debug info for them. */ + break; + + default: +! if (!IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (bound)))) +! abort (); + } + } + +*************** +*** 7797,7803 **** + + if (i < 0) + { +! if (TREE_CODE_CLASS (TREE_CODE (containing_scope)) != 't') + abort (); + if (debug_info_level > DINFO_LEVEL_TERSE + && !TREE_ASM_WRITTEN (containing_scope)) +--- 7805,7812 ---- + + if (i < 0) + { +! if (TREE_CODE_CLASS (TREE_CODE (containing_scope)) != 't' +! && TREE_CODE_CLASS (TREE_CODE (containing_scope)) != 'd') + abort (); + if (debug_info_level > DINFO_LEVEL_TERSE + && !TREE_ASM_WRITTEN (containing_scope)) +*************** +*** 9525,9531 **** + /* Don't output any DIEs to represent mere function declarations, + unless they are class members or explicit block externs. */ + if (DECL_INITIAL (decl) == NULL_TREE && DECL_CONTEXT (decl) == NULL_TREE +! && (current_function_decl == NULL_TREE || ! DECL_ARTIFICIAL (decl))) + break; + + if (debug_info_level > DINFO_LEVEL_TERSE) +--- 9534,9540 ---- + /* Don't output any DIEs to represent mere function declarations, + unless they are class members or explicit block externs. */ + if (DECL_INITIAL (decl) == NULL_TREE && DECL_CONTEXT (decl) == NULL_TREE +! && (current_function_decl == NULL_TREE || DECL_ARTIFICIAL (decl))) + break; + + if (debug_info_level > DINFO_LEVEL_TERSE) +*** gcc/function.c.orig Sun Nov 21 17:48:49 1999 +--- gcc/function.c Sat Nov 9 03:47:16 2002 +*************** +*** 1572,1578 **** + + /* If this is a variable-size object with a pseudo to address it, + put that pseudo into the stack, if the var is nonlocal. */ +! if (DECL_NONLOCAL (decl) + && GET_CODE (reg) == MEM + && GET_CODE (XEXP (reg, 0)) == REG + && REGNO (XEXP (reg, 0)) > LAST_VIRTUAL_REGISTER) +--- 1572,1578 ---- + + /* If this is a variable-size object with a pseudo to address it, + put that pseudo into the stack, if the var is nonlocal. */ +! if (TREE_CODE (decl) != SAVE_EXPR && DECL_NONLOCAL (decl) + && GET_CODE (reg) == MEM + && GET_CODE (XEXP (reg, 0)) == REG + && REGNO (XEXP (reg, 0)) > LAST_VIRTUAL_REGISTER) +*** gcc/configure.orig Sun Nov 21 17:48:49 1999 +--- gcc/configure Thu Nov 14 16:40:14 2002 +*************** +*** 8379,8385 **** + echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2 + exit 1 + fi +! all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Make-lang.in ${srcdir}/$s/Makefile.in" + all_languages="$all_languages $language" + if test "x$boot_language" = xyes + then +--- 8379,8388 ---- + echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2 + exit 1 + fi +! all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Make-lang.in" +! if test -f ${srcdir}/$s/Makefile.in +! then all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Makefile.in" +! fi + all_languages="$all_languages $language" + if test "x$boot_language" = xyes + then + +*** gcc/configure.lang.orig Wed Dec 16 21:54:24 1998 +--- gcc/configure.lang Thu Nov 14 17:08:12 2002 +*************** +*** 50,55 **** +--- 50,56 ---- + test -d $subdir || mkdir $subdir + cd $subdir + ++ if test -f "$srcdir/Makefile.in"; then + # Create Makefile.tem from Makefile.in. + # Make it set VPATH if necessary so that the sources are found. + # Also change its value of srcdir. +*************** +*** 157,162 **** +--- 158,164 ---- + mv Makefile.xx Makefile.tem + rm -f Makefile.ll + fi ++ fi + + # If the host supports + # symlinks, point stage[123] at ../stage[123] so bootstrapping and the +*************** +*** 169,174 **** +--- 171,177 ---- + $symbolic_link ../$t $t 2>/dev/null + done + ++ if test -f "$srcdir/Makefile.in"; then + # Remove all formfeeds, since some Makes get confused by them. + # Also arrange to give the variables `target', `target_alias', + # `host_xmake_file', `tmake_file', `prefix', `local_prefix', +*************** +*** 225,230 **** +--- 228,234 ---- + rm -f Makefile + mv Makefile.tem Makefile + echo "Created \`$subdir/Makefile'." ++ fi + + cd $STARTDIR + done # end of current-dir SUBDIRS loop + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-version.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-version.dpatch @@ -0,0 +1,31 @@ +#! /bin/sh -e + +dir=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + dir=$3/gcc +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +date=`dpkg-parsechangelog | sed -n '/^Version:/s/.*\.\([0-9]*\)$/20\1/p'` +date=20011002 + +case "$1" in + -patch) + sed -e "s/200[0-9]*/$date/" -e 's/(\(.*\))/(Debian \1)/' \ + $dir/version.c > $dir/version.c.new \ + && mv -f $dir/version.c.new $dir/version.c + ;; + -unpatch) + sed -e 's/Debian *//' $dir/version.c > $dir/version.c.new \ + && mv -f $dir/version.c.new $dir/version.c + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# append the patch here and adjust the -p? flag in the patch calls. + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/testsuite-current.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/testsuite-current.dpatch @@ -0,0 +1,84 @@ +#! /bin/sh -e + +# DP: patch to run the current gcc testsuite (20001207) with the release. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +diff --width=160 -du lib/g++.exp lib.1/g++.exp +--- gcc/testsuite/lib/g++.exp Sun Nov 26 12:20:50 2000 ++++ gcc/testsuite/lib/g++.exp Thu Nov 30 11:02:19 2000 +@@ -68,7 +68,6 @@ + # + proc g++_include_flags { args } { + global srcdir +- global HAVE_LIBSTDCXX_V3 + + set flags "" + +@@ -83,15 +82,9 @@ + + set gccpath [get_multilibs] + +- if { ${HAVE_LIBSTDCXX_V3} } { +- set odir_v3 [lookfor_file ${gccpath} libstdc++-v3] +- set sdir_v3 [lookfor_file ${srcdir} libstdc++-v3] +- append flags [exec ${odir_v3}/tests_flags --compiler ${odir_v3} ${sdir_v3}] +- } else { +- set odir_v2 [lookfor_file ${gccpath} libstdc++] +- set sdir_v2 [lookfor_file ${srcdir} libstdc++] +- append flags "-I${sdir_v2} -I${sdir_v2}/stl " +- } ++ set odir_v2 [lookfor_file ${gccpath} libstdc++] ++ set sdir_v2 [lookfor_file ${srcdir} libstdc++] ++ append flags "-I${sdir_v2} -I${sdir_v2}/stl " + + return "$flags" + } +@@ -223,7 +216,7 @@ + + # Make sure that lines are not wrapped. That can confuse the + # error-message parsing machinery. +- lappend ALWAYS_CXXFLAGS "additional_flags=-fmessage-length=0" ++ # lappend ALWAYS_CXXFLAGS "additional_flags=-fmessage-length=0" + + verbose -log "ALWAYS_CXXFLAGS set to $ALWAYS_CXXFLAGS" + +diff --width=160 -du lib/objc.exp lib.1/objc.exp +--- gcc/testsuite/lib/objc.exp Sun Aug 6 19:41:49 2000 ++++ gcc/testsuite/lib/objc.exp Thu Nov 30 11:02:03 2000 +@@ -120,7 +120,7 @@ + global ld_library_path + + set ld_library_path "." +- lappend options "libs=-lobjc" ++ lappend options "libs=-lobjc -lpthread" + + if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } { + lappend options "libs=${gluefile}" +@@ -143,7 +143,7 @@ + lappend options "additional_flags=-DNO_VARARGS" + } + set objcpath "[get_multilibs]" +- set libobjc_dir [lookfor_file ${objcpath} libobjc/.libs/libobjc.a] ++ set libobjc_dir [lookfor_file ${objcpath} libobjc/libobjc.a] + if { $libobjc_dir != "" } { + set libobjc_dir [file dirname ${libobjc_dir}] + set objc_link_flags "-L${libobjc_dir}" +@@ -271,4 +271,3 @@ + + return $text + } +- --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcj-debian-policy.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcj-debian-policy.dpatch @@ -0,0 +1,50 @@ +#! /bin/sh -e + +# All lines beginning with `# DPATCH:' are a description of the patch. +# DP: Comply with the Debian java policy in the java-common package +# DP: Stephane Bortzmeyer +# DP: search gcj.jar in /usr/share/java (doko@cs.tu-berlin.de) + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# append the patch here and adjust the -p? flag in the patch calls. + +*** gcc/java/jcf-path.c.orig Thu Sep 9 13:21:30 1999 +--- gcc/java/jcf-path.c Thu Sep 9 13:22:10 1999 +*************** +*** 220,225 **** +--- 220,226 ---- + char *cp; + + add_entry (&sys_dirs, ".", 0); ++ add_entry (&sys_dirs, "/usr/share/java/repository", 0); + add_entry (&sys_dirs, LIBGCJ_ZIP_FILE, 1); + + GET_ENV_PATH_LIST (cp, "CLASSPATH"); + +--==_Exmh_16123349800-- + +--- gcc/java/Makefile.in~ Sun May 9 11:53:41 1999 ++++ gcc/java/Makefile.in Sat Sep 11 12:04:31 1999 +@@ -102,7 +102,7 @@ + # Directory holding libgcj.zip. + prefix = @prefix@ + datadir = @datadir@ +-libgcj_zip = $(datadir)/libgcj.zip ++libgcj_zip = $(datadir)/java/libgcj.zip + + # Additional system libraries to link with. + CLIB= --- gcc-2.95-2.95.4.ds15.orig/debian/patches/vendor.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/vendor.dpatch @@ -0,0 +1,47 @@ +#! /bin/sh -e + +# DP: Set vendor field in canonical system name to `debian'. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +*** config.guess~ Fri Oct 23 23:26:33 1998 +--- config.guess Wed Dec 16 13:55:55 1998 +*************** +*** 628,636 **** +--- 628,638 ---- + case "${UNAME_MACHINE}" in + i?86) + VENDOR=pc; ++ if [ -f /etc/debian_version ]; then VENDOR=debian; fi; + ;; + *) + VENDOR=unknown; ++ if [ -f /etc/debian_version ]; then VENDOR=debian; fi; + ;; + esac + # Determine whether the default compiler is a.out or elf +*** config.sub~ Fri Apr 3 18:21:57 1998 +--- config.sub Wed Dec 16 14:17:33 1998 +*************** +*** 1201,1204 **** +--- 1201,1207 ---- + ;; + esac + ++ if [ -f /etc/debian_version ]; then ++ basic_machine=`echo $basic_machine | sed -e 's/-pc/-debian/' -e 's/-unknown/-debian/'` ++ fi + echo $basic_machine$os --- gcc-2.95-2.95.4.ds15.orig/debian/patches/m68k-md.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/m68k-md.dpatch @@ -0,0 +1,56 @@ +#! /bin/sh -e + +dir= +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + dir="$3/" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p0 < $0 + #cd ${dir}gcc && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 + #rm ${dir}gcc/configure + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# DP: From: Roman Zippel +# DP: m68k md fix (#105622). + +From: Roman Zippel +Sender: roman@cs.tu-berlin.de +To: Matt Zimmerman , 105622@bugs.debian.org, + Matthias Klose +Subject: Bug#105622: Test case +Date: Sat, 21 Jul 2001 01:33:39 +0200 + +--- gcc/config/m68k/m68k.md.org Sat Jul 21 01:17:42 2001 ++++ gcc/config/m68k/m68k.md Sat Jul 21 01:18:53 2001 +@@ -2116,7 +2116,7 @@ + ;; (plus:DI (match_operand:DI 2 "general_operand" "%0") + ;; (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro") + ;; (const_int 32))))] +- (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro,r") ++ (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro,d") + (const_int 32)) + (match_operand:DI 2 "general_operand" "0,0")))] + "" +@@ -2135,7 +2135,7 @@ + ;; (plus:DI (match_operand:DI 2 "general_operand" "%0") + ;; (ashift:DI (match_operand:DI 1 "general_operand" "ro") + ;; (const_int 32))))] +- (plus:DI (ashift:DI (match_operand:DI 1 "general_operand" "ro,r") ++ (plus:DI (ashift:DI (match_operand:DI 1 "general_operand" "ro,d") + (const_int 32)) + (match_operand:DI 2 "general_operand" "0,0")))] + "" + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/strength-red.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/strength-red.dpatch @@ -0,0 +1,278 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# DP: From: Alan Modra +Sender: gcc-patches-owner@gcc.gnu.org +# DP: To: gcc-patches@gcc.gnu.org +Cc: Paul Mackerras , Olaf Hering +# DP: Subject: gcc-2.95 strength reduction fix +# DP: Date: Mon, 3 Dec 2001 14:51:31 +1030 + +This test case, extracted from lomount.c, fails for powerpc-linux with +current 2.95 CVS at -O2. + +--- +#define SIZE(a) (sizeof(a)/sizeof(a[0])) + +static char *loop_formats[] = { "/dev/loop%d", "/dev/loop/%d" }; +static char statbuf[20]; + +extern void exit (int); +extern void abort (void); +int sprintf (char *, const char *, ...); +int printf (const char *, ...); +int stat (char *, char *); +int open (char *); + +char * +find_unused_loop_device (void) +{ + char dev[20]; + int i, j, fd; + + for (j = 0; j < SIZE (loop_formats); j++) + { + for (i = 0; i < 256; i++) + { + sprintf (dev, loop_formats[j], i); + printf ("dev=%s i=%d j=%d\n", dev, i, j); + if (stat (dev, statbuf) != 0 || statbuf[0] != 0) + break; + fd = foo2 ("blah"); + if (fd >= 0) + return "blah"; + } + } + return 0; +} + +int sprintf (char *buf, const char *fmt, ...) +{ + if (fmt != loop_formats[0] && fmt != loop_formats[1]) + abort (); + return 0; +} + +int printf (const char *fmt, ...) +{ + return 0; +} + +int stat (char *x, char *y) +{ + y[0] = 0; + return 0; +} + +int open (char *x) +{ + return -1; +} + +int main (void) +{ + find_unused_loop_device (); + exit (0); +} +--- + +# DP: This particular problem was fixed on the mainline by +# DP: http://gcc.gnu.org/ml/gcc-patches/2000-04/msg00576.html, which is a +# DP: much nicer fix than the following but a minimal change may be preferred +# DP: for the 2.95 branch. +# DP: +# DP: * loop.c (strength_reduce ): Set up maybe_multiple for givs. +# DP: (record_giv): Pass in maybe_multiple. +# DP: (find_mem_givs): Likewise. + +Index: loop.c +=================================================================== +RCS file: /cvs/gcc/gcc/gcc/loop.c,v +retrieving revision 1.156.4.21 +diff -u -p -r1.156.4.21 loop.c +--- gcc/loop.c 2001/04/03 12:09:42 1.156.4.21 ++++ gcc/loop.c 2001/12/03 02:44:40 +@@ -320,11 +320,12 @@ static int count_nonfixed_reads PROTO((r + static void strength_reduce PROTO((rtx, rtx, rtx, int, rtx, rtx, rtx, int, int)); + static void find_single_use_in_loop PROTO((rtx, rtx, varray_type)); + static int valid_initial_value_p PROTO((rtx, rtx, int, rtx)); +-static void find_mem_givs PROTO((rtx, rtx, int, rtx, rtx)); ++static void find_mem_givs PROTO((rtx, rtx, int, int, rtx, rtx)); + static void record_biv PROTO((struct induction *, rtx, rtx, rtx, rtx, rtx *, int, int)); + static void check_final_value PROTO((struct induction *, rtx, rtx, + unsigned HOST_WIDE_INT)); +-static void record_giv PROTO((struct induction *, rtx, rtx, rtx, rtx, rtx, int, enum g_types, int, rtx *, rtx, rtx)); ++static void record_giv PROTO((struct induction *, rtx, rtx, rtx, rtx, rtx, ++ int, enum g_types, int, int, rtx *, rtx, rtx)); + static void update_giv_derive PROTO((rtx)); + static int basic_induction_var PROTO((rtx, enum machine_mode, rtx, rtx, rtx *, rtx *, rtx **)); + static rtx simplify_giv_expr PROTO((rtx, int *)); +@@ -4426,6 +4427,7 @@ strength_reduce (scan_start, end, loop_t + biv and a constant (or invariant), and it is not a biv. */ + + not_every_iteration = 0; ++ maybe_multiple = 0; + loop_depth = 0; + p = scan_start; + while (1) +@@ -4445,6 +4446,40 @@ strength_reduce (scan_start, end, loop_t + break; + } + ++ if (GET_CODE (p) == CODE_LABEL) ++ { ++ rtx insn = p; ++ ++ maybe_multiple = 0; ++ ++ while (1) ++ { ++ insn = NEXT_INSN (insn); ++ if (insn == scan_start) ++ break; ++ if (insn == end) ++ { ++ if (loop_top != 0) ++ insn = loop_top; ++ else ++ break; ++ if (insn == scan_start) ++ break; ++ } ++ ++ if (GET_CODE (insn) == JUMP_INSN ++ && GET_CODE (PATTERN (insn)) != RETURN ++ && (! condjump_p (insn) ++ || (JUMP_LABEL (insn) != 0 ++ && JUMP_LABEL (insn) != scan_start ++ && ! loop_insn_first_p (p, JUMP_LABEL (insn))))) ++ { ++ maybe_multiple = 1; ++ break; ++ } ++ } ++ } ++ + /* Look for a general induction variable in a register. */ + if (GET_CODE (p) == INSN + && (set = single_set (p)) +@@ -4495,8 +4530,8 @@ strength_reduce (scan_start, end, loop_t + p = last_consec_insn; + + record_giv (v, p, src_reg, dest_reg, mult_val, add_val, benefit, +- DEST_REG, not_every_iteration, NULL_PTR, loop_start, +- loop_end); ++ DEST_REG, not_every_iteration, maybe_multiple, ++ NULL_PTR, loop_start, loop_end); + + } + } +@@ -4506,8 +4541,8 @@ strength_reduce (scan_start, end, loop_t + /* This resulted in worse code on a VAX 8600. I wonder if it + still does. */ + if (GET_CODE (p) == INSN) +- find_mem_givs (PATTERN (p), p, not_every_iteration, loop_start, +- loop_end); ++ find_mem_givs (PATTERN (p), p, not_every_iteration, maybe_multiple, ++ loop_start, loop_end); + #endif + + /* Update the status of whether giv can derive other givs. This can +@@ -5246,10 +5285,12 @@ valid_initial_value_p (x, insn, call_see + every loop iteration. */ + + static void +-find_mem_givs (x, insn, not_every_iteration, loop_start, loop_end) ++find_mem_givs (x, insn, not_every_iteration, maybe_multiple, ++ loop_start, loop_end) + rtx x; + rtx insn; + int not_every_iteration; ++ int maybe_multiple; + rtx loop_start, loop_end; + { + register int i, j; +@@ -5297,7 +5338,7 @@ find_mem_givs (x, insn, not_every_iterat + + record_giv (v, insn, src_reg, addr_placeholder, mult_val, + add_val, benefit, DEST_ADDR, not_every_iteration, +- &XEXP (x, 0), loop_start, loop_end); ++ maybe_multiple, &XEXP (x, 0), loop_start, loop_end); + + v->mem_mode = GET_MODE (x); + } +@@ -5313,12 +5354,12 @@ find_mem_givs (x, insn, not_every_iterat + fmt = GET_RTX_FORMAT (code); + for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) + if (fmt[i] == 'e') +- find_mem_givs (XEXP (x, i), insn, not_every_iteration, loop_start, +- loop_end); ++ find_mem_givs (XEXP (x, i), insn, not_every_iteration, maybe_multiple, ++ loop_start, loop_end); + else if (fmt[i] == 'E') + for (j = 0; j < XVECLEN (x, i); j++) + find_mem_givs (XVECEXP (x, i, j), insn, not_every_iteration, +- loop_start, loop_end); ++ maybe_multiple, loop_start, loop_end); + } + + /* Fill in the data about one biv update. +@@ -5440,7 +5481,8 @@ record_biv (v, insn, dest_reg, inc_val, + + static void + record_giv (v, insn, src_reg, dest_reg, mult_val, add_val, benefit, +- type, not_every_iteration, location, loop_start, loop_end) ++ type, not_every_iteration, maybe_multiple, ++ location, loop_start, loop_end) + struct induction *v; + rtx insn; + rtx src_reg; +@@ -5449,6 +5491,7 @@ record_giv (v, insn, src_reg, dest_reg, + int benefit; + enum g_types type; + int not_every_iteration; ++ int maybe_multiple; + rtx *location; + rtx loop_start, loop_end; + { +@@ -5466,7 +5509,7 @@ record_giv (v, insn, src_reg, dest_reg, + v->location = location; + v->cant_derive = 0; + v->combined_with = 0; +- v->maybe_multiple = 0; ++ v->maybe_multiple = maybe_multiple; + v->maybe_dead = 0; + v->derive_adjustment = 0; + v->same = 0; + +In-Reply-To: <20011203145131.C1047@bubble.sa.bigpond.net.au>; from amodra@bigpond.net.au on Mon, Dec 03, 2001 at 02:51:31PM +1030 +From: Alan Modra +Sender: gcc-patches-owner@gcc.gnu.org +To: gcc-patches@gcc.gnu.org, Paul Mackerras , + Olaf Hering +Subject: Re: gcc-2.95 strength reduction fix +Date: Mon, 3 Dec 2001 17:17:11 +1030 + +On Mon, Dec 03, 2001 at 02:51:31PM +1030, Alan Modra wrote: +> +> * loop.c (strength_reduce ): Set up maybe_multiple for givs. +> (record_giv): Pass in maybe_multiple. +> (find_mem_givs): Likewise. + +Sorry, needs this hunk too. + +[inserted above] --- gcc-2.95-2.95.4.ds15.orig/debian/patches/arm-exception.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/arm-exception.dpatch @@ -0,0 +1,207 @@ +#! /bin/sh -e + +# DP: ARM patch for PIC exception handlers + +src=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + src=$3/gcc +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p1 --fuzz 10 < $0 + cd $src && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p1 --fuzz 10 < $0 + cd $src && autoconf + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +Index: varasm.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/varasm.c,v +retrieving revision 1.59.4.4 +diff -u -p -u -r1.59.4.4 varasm.c +--- src/gcc/varasm.c 1999/06/09 12:13:49 1.59.4.4 ++++ src/gcc/varasm.c 2001/01/16 07:41:57 +@@ -3285,7 +3285,10 @@ decode_rtx_const (mode, x, value) + value->un.addr.offset = - INTVAL (XEXP (x, 1)); + } + else +- abort (); ++ { ++ value->un.addr.base = x; ++ value->un.addr.offset = 0; ++ } + break; + + default: +Index: config/arm/arm.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/arm/arm.c,v +retrieving revision 1.43.4.7 +diff -u -p -u -r1.43.4.7 arm.c +--- src/gcc/config/arm/arm.c 2000/12/05 19:55:48 1.43.4.7 ++++ src/gcc/config/arm/arm.c 2001/01/16 07:42:21 +@@ -1533,22 +1533,16 @@ legitimize_pic_address (orig, mode, reg) + return orig; + } + +-static rtx pic_rtx; +- +-int +-is_pic(x) +- rtx x; +-{ +- if (x == pic_rtx) +- return 1; +- return 0; +-} +- ++/* Generate code to load the PIC register. PROLOGUE is true if ++ called from arm_expand_prologue (in which case we want the ++ generated insns at the start of the function); false if called ++ by an exception receiver that needs the PIC register reloaded ++ (in which case the insns are just dumped at the current location). */ + void +-arm_finalize_pic () ++arm_finalize_pic (int prologue) + { + #ifndef AOF_ASSEMBLER +- rtx l1, pic_tmp, pic_tmp2, seq; ++ rtx l1, pic_tmp, pic_tmp2, seq, pic_rtx; + rtx global_offset_table; + + if (current_function_uses_pic_offset_table == 0) +@@ -1577,7 +1571,10 @@ arm_finalize_pic () + + seq = gen_sequence (); + end_sequence (); +- emit_insn_after (seq, get_insns ()); ++ if (prologue) ++ emit_insn_after (seq, get_insns ()); ++ else ++ emit_insn (seq); + + /* Need to emit this whether or not we obey regdecls, + since setjmp/longjmp can cause life info to screw up. */ +Index: config/arm/arm.h +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/arm/arm.h,v +retrieving revision 1.34.4.4 +diff -u -p -u -r1.34.4.4 arm.h +--- src/gcc/config/arm/arm.h 2000/12/05 19:55:49 1.34.4.4 ++++ src/gcc/config/arm/arm.h 2001/01/16 07:42:46 +@@ -1811,7 +1811,7 @@ extern int arm_pic_register; + data addresses in memory. */ + #define PIC_OFFSET_TABLE_REGNUM arm_pic_register + +-#define FINALIZE_PIC arm_finalize_pic () ++#define FINALIZE_PIC arm_finalize_pic (1) + + /* We can't directly access anything that contains a symbol, + nor can we indirect via the constant pool. */ +@@ -2045,17 +2045,9 @@ extern struct rtx_def *arm_compare_op0, + else output_addr_const(STREAM, X); \ + } + +-/* Handles PIC addr specially */ + #define OUTPUT_INT_ADDR_CONST(STREAM,X) \ + { \ +- if (flag_pic && GET_CODE(X) == CONST && is_pic(X)) \ +- { \ +- output_addr_const(STREAM, XEXP (XEXP (XEXP (X, 0), 0), 0)); \ +- fputs(" - (", STREAM); \ +- output_addr_const(STREAM, XEXP (XEXP (XEXP (X, 0), 1), 0)); \ +- fputs(")", STREAM); \ +- } \ +- else output_addr_const(STREAM, X); \ ++ output_addr_const(STREAM, X); \ + \ + /* Mark symbols as position independent. We only do this in the \ + .text segment, not in the .data segment. */ \ +@@ -2169,8 +2161,7 @@ Rcode arm_canonicalize_comparison RTX_C + int arm_return_in_memory PROTO ((Tree)); + int legitimate_pic_operand_p PROTO ((Rtx)); + Rtx legitimize_pic_address PROTO ((Rtx, Mmode, Rtx)); +-int is_pic PROTO ((Rtx)); +-void arm_finalize_pic PROTO ((void)); ++void arm_finalize_pic PROTO ((int)); + int arm_rtx_costs RTX_CODE_PROTO ((Rtx, Rcode)); + int arm_adjust_cost PROTO ((Rtx, Rtx, Rtx, int)); + int const_double_rtx_ok_for_fpu PROTO ((Rtx)); +Index: config/arm/arm.md +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/arm/arm.md,v +retrieving revision 1.27.4.4 +diff -u -p -u -r1.27.4.4 arm.md +--- src/gcc/config/arm/arm.md 2000/12/05 19:48:09 1.27.4.4 ++++ src/gcc/config/arm/arm.md 2001/01/16 07:43:05 +@@ -2720,6 +2720,15 @@ + return \"add%?\\t%0, %|pc, %0\"; + ") + ++(define_expand "builtin_setjmp_receiver" ++ [(label_ref (match_operand 0 "" ""))] ++ "flag_pic" ++ " ++{ ++ arm_finalize_pic (0); ++ DONE; ++}") ++ + ;; If copying one reg to another we can set the condition codes according to + ;; its value. Such a move is common after a return from subroutine and the + ;; result is being tested against zero. +Index: config/arm/linux-gas.h +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/arm/linux-gas.h,v +retrieving revision 1.4 +diff -u -p -u -r1.4 linux-gas.h +--- src/gcc/config/arm/linux-gas.h 1999/02/22 16:47:57 1.4 ++++ src/gcc/config/arm/linux-gas.h 2001/01/16 07:43:12 +@@ -1,6 +1,6 @@ + /* Definitions of target machine for GNU compiler. + ARM Linux-based GNU systems version. +- Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. ++ Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by Russell King . + + This file is part of GNU CC. +@@ -79,5 +79,7 @@ Boston, MA 02111-1307, USA. */ + register unsigned long _beg __asm ("a1") = (unsigned long) (BEG); \ + register unsigned long _end __asm ("a2") = (unsigned long) (END); \ + register unsigned long _flg __asm ("a3") = 0; \ +- __asm __volatile ("swi 0x9f0002"); \ ++ __asm __volatile ("swi 0x9f0002 @ sys_cacheflush" \ ++ : "=r" (_beg) \ ++ : "0" (_beg), "r" (_end), "r" (_flg)); \ + } +Index: final.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/final.c,v +retrieving revision 1.77.4.1 +diff -u -p -u -r1.77.4.1 final.c +--- src/gcc/final.c 1999/06/21 23:21:23 1.77.4.1 ++++ src/gcc/final.c 2001/01/21 17:13:56 +@@ -3652,8 +3652,9 @@ output_addr_const (file, x) + + output_addr_const (file, XEXP (x, 0)); + fprintf (file, "-"); +- if (GET_CODE (XEXP (x, 1)) == CONST_INT +- && INTVAL (XEXP (x, 1)) < 0) ++ if ((GET_CODE (XEXP (x, 1)) == CONST_INT ++ && INTVAL (XEXP (x, 1)) < 0) ++ || GET_CODE (XEXP (x, 1)) != CONST_INT) + { + fprintf (file, ASM_OPEN_PAREN); + output_addr_const (file, XEXP (x, 1)); + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-mips-linux-abi.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-mips-linux-abi.dpatch @@ -0,0 +1,50 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + + +From ralf@gnu.org Mon Oct 30 11:51:34 2000 +Message-ID: <20001029163828.A18989@bacchus.dhis.org> +Date: Sun, 29 Oct 2000 16:38:28 +0100 +From: Ralf Baechle +To: gcc@gcc.gnu.org +Cc: "Maciej W. Rozycki" , Andreas Jaeger , + Keith M Wesolowski , + Ulf Carlsson +Subject: PATCH: Linux/MIPS CPP_SPECs fix. + +mips{,el}-linux default to the 32 bit ABI but we were predefining _ABIN32 +indicating we're N32. Below patch fixes this. Please apply, + + Ralf + +2000-10-29 Ralf Baechle + + * config/mips/linux.h (SUBTARGET_CPP_SPEC): Default ABI is 32; change + SUBTARGET_CPP_SPEC apropriatly. + +diff -urN gcc-cygnus/gcc/config/mips/linux.h gcc/gcc/config/mips/linux.h +--- gcc-cygnus/gcc/config/mips/linux.h Tue Aug 29 02:46:28 2000 ++++ gcc/gcc/config/mips/linux.h Sun Oct 29 16:32:55 2000 +@@ -99,7 +99,7 @@ + %{mabi=32: -D_MIPS_SIM=_MIPS_SIM_ABI32} \ + %{mabi=n32: -D_ABIN32=2 -D_MIPS_SIM=_ABIN32} \ + %{mabi=64: -D_ABI64=3 -D_MIPS_SIM=_ABI64} \ +-%{!mabi*: -D_ABIN32=2 -D_MIPS_SIM=_ABIN32} \ ++%{!mabi*: -D_MIPS_SIM=_MIPS_SIM_ABI32} \ + %{!mint64: -D_MIPS_SZINT=32}%{mint64: -D_MIPS_SZINT=64} \ + %{mabi=32: -D_MIPS_SZLONG=32} \ + %{mabi=n32: -D_MIPS_SZLONG=32} \ --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-mips-linux-ctors.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-mips-linux-ctors.dpatch @@ -0,0 +1,67 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +diff -up --recursive --new-file gcc-2.95.2.macro/gcc/config/mips/linux.h gcc-2.95.2/gcc/config/mips/linux.h +--- gcc-2.95.2.macro/gcc/config/mips/linux.h Thu Nov 16 07:25:03 2000 ++++ gcc-2.95.2/gcc/config/mips/linux.h Sat Nov 18 20:22:42 2000 +@@ -170,3 +170,20 @@ Boston, MA 02111-1307, USA. */ + %{mabi=64: -64} \ + %{!fno-PIC:%{!fno-pic:-KPIC}} \ + %{fno-PIC:-non_shared} %{fno-pic:-non_shared}" ++ ++/* On svr4, we *do* have support for the .init and .fini sections, and we ++ can put stuff in there to be executed before and after `main'. We let ++ crtstuff.c and other files know this by defining the following symbols. ++ The definitions say how to change sections to the .init and .fini ++ sections. This is the same for all known svr4 assemblers. */ ++ ++#define INIT_SECTION_ASM_OP "\t.section\t.init" ++#define FINI_SECTION_ASM_OP "\t.section\t.fini" ++ ++/* Undef junk imported from mips/elf.h. */ ++#undef CTOR_LIST_BEGIN ++#undef CTOR_LIST_END ++#undef DTOR_LIST_BEGIN ++#undef DTOR_LIST_END ++ ++#undef INVOKE__main +diff -up --recursive --new-file gcc-2.95.2.macro/gcc/config/mips/mips.h gcc-2.95.2/gcc/config/mips/mips.h +--- gcc-2.95.2.macro/gcc/config/mips/mips.h Tue Aug 15 18:40:42 2000 ++++ gcc-2.95.2/gcc/config/mips/mips.h Sat Nov 18 17:53:39 2000 +@@ -1935,7 +1935,7 @@ extern enum reg_class mips_regno_to_clas + + extern enum reg_class mips_char_to_class[]; + +-#define REG_CLASS_FROM_LETTER(C) mips_char_to_class[ (C) ] ++#define REG_CLASS_FROM_LETTER(C) mips_char_to_class[(unsigned char)(C)] + + /* The letters I, J, K, L, M, N, O, and P in a register constraint + string can be used to stand for particular ranges of immediate +diff -up --recursive --new-file gcc-2.95.2.macro/gcc/gcse.c gcc-2.95.2/gcc/gcse.c +--- gcc-2.95.2.macro/gcc/gcse.c Sat Oct 16 21:20:32 1999 ++++ gcc-2.95.2/gcc/gcse.c Sat Nov 18 17:42:50 2000 +@@ -1856,7 +1856,9 @@ hash_scan_set (pat, insn, set_p) + /* Don't GCSE something if we can't do a reg/reg copy. */ + && can_copy_p [GET_MODE (dest)] + /* Is SET_SRC something we want to gcse? */ +- && want_to_gcse_p (src)) ++ && want_to_gcse_p (src) ++ /* Copy between modes is prohibited */ ++ && GET_MODE (src) == GET_MODE (dest)) + { + /* An expression is not anticipatable if its operands are + modified before this insn. */ --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-mips-mad.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-mips-mad.dpatch @@ -0,0 +1,40 @@ +#! /bin/sh -e + +# DP: These patches change one small thing in gcc (%{mmad:-m4650} becomes %{mmad} +# DP: in the invocation of GAS; we no longer lie about what the processor is) and +# DP: add a -mmad flag to binutils. + + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +From: "Christopher C. Chimelis" +To: Debian GCC maintainers +cc: debian-toolchain@lists.debian.org +Subject: -mmad patches for binutils/gcc (fwd) +Date: Fri, 16 Mar 2001 09:25:41 -0500 (EST) + +--- gcc-2.95.3/gcc/config/mips/mips.h.orig Thu Mar 15 19:39:16 2001 ++++ gcc-2.95.3/gcc/config/mips/mips.h Thu Mar 15 19:39:53 2001 +@@ -821,7 +821,7 @@ + /* GAS_ASM_SPEC is passed when using gas, rather than the MIPS + assembler. */ + +-#define GAS_ASM_SPEC "%{mcpu=*} %{m4650} %{mmad:-m4650} %{m3900} %{v}" ++#define GAS_ASM_SPEC "%{mcpu=*} %{m4650} %{mmad} %{m3900} %{v}" + + /* TARGET_ASM_SPEC is used to select either MIPS_AS_ASM_SPEC or + GAS_ASM_SPEC as the default, depending upon the value of + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/chill-names.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/chill-names.dpatch @@ -0,0 +1,67 @@ +#! /bin/sh -e + +# DP: versioned gcc names + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- src-native/gcc/ch/chill.texi~ Wed Dec 16 21:59:05 1998 ++++ src-native/gcc/ch/chill.texi Tue Dec 19 21:49:54 2000 +@@ -6,7 +6,7 @@ + @ifinfo + @format + START-INFO-DIR-ENTRY +-* Chill:: Chill compiler ++* Chill-2.95:: Chill compiler (Version 2.95.x). + END-INFO-DIR-ENTRY + @end format + @end ifinfo + +--- src-native/gcc/ch/Make-lang.in~ Fri Jun 25 10:26:19 1999 ++++ src-native/gcc/ch/Make-lang.in Tue Dec 19 21:49:33 2000 +@@ -107,10 +107,10 @@ + CHILL.rest.encap: + CHILL.dvi: chill.dvi + +-CHILL.info: ch/chill.info ++CHILL.info: ch/chill-2.95.info + +-ch/chill.info: $(srcdir)/ch/chill.texi +- $(MAKEINFO) -I$(srcdir)/ch -o ch/chill.info $(srcdir)/ch/chill.texi ++ch/chill-2.95.info: $(srcdir)/ch/chill.texi ++ $(MAKEINFO) -I$(srcdir)/ch -o ch/chill-2.95.info $(srcdir)/ch/chill.texi + + chill.dvi: $(srcdir)/ch/chill.texi $(srcdir)/extend.texi $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi $(srcdir)/tm.texi + cd ch ; \ +@@ -144,8 +144,8 @@ + # Don't delete $(infodir)/ch.info* unless there's actually new + # docs to install (in case LANGUAGES didn't contain chill earlier). + CHILL.install-info: +- -for i in ch/chill.info*; do \ +- rm -f $(infodir)/chill.info*; \ ++ -for i in ch/chill-2.95.info*; do \ ++ rm -f $(infodir)/chill-2.95.info*; \ + realfile=`echo $$i | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ + $(INSTALL_DATA) $$i $(infodir)/$$realfile; \ + done +@@ -168,7 +168,7 @@ + CHILL.extraclean: + CHILL.maintainer-clean: + -rm -f ch/TAGS +- -rm -f ch/chill.info* ch/chill.dvi ch/chill.??s ch/chill.*aux ++ -rm -f ch/chill*.info* ch/chill.dvi ch/chill.??s ch/chill.*aux + # CYGNUS LOCAL: Delete locally created file. + -rm -f ch/hash.h + # --- gcc-2.95-2.95.4.ds15.orig/debian/patches/objc-data-references.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/objc-data-references.dpatch @@ -0,0 +1,58 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +To: gcc-patches at gcc dot gnu dot org +# DP: Subject: PATCH: use non-readonly data section for objc references +# DP: From: Todd Vierling +Date: Thu, 10 Aug 2000 17:16:35 -0400 (EDT) + +When compiling Objective-C code -fPIC, readonly data references are created +that produce absolute relocs--something frowned upon by the linker (and +resulting in Many warnings by the linker, not to mention runtime overhead +with the dynamic linker). This was found on NetBSD when attempting to make +libobjc a shared library. + +The following patch (against 2.95.2) will use a writable data section when +compiling PIC code. And the answer to the original comment: "This is why +not." 8^) + +========== +*** gcc/objc/objc-act.c 2000/07/26 00:19:06 +--- gcc/objc/objc-act.c 2000/08/10 21:06:50 +*************** +*** 8399,8406 **** + pushdecl (decl); + rest_of_decl_compilation (decl, 0, 0, 0); + +! /* Make following constant read-only (why not)? */ +! readonly_data_section (); + + exp = build1 (ADDR_EXPR, string_type_node, decl); + +--- 8399,8409 ---- + pushdecl (decl); + rest_of_decl_compilation (decl, 0, 0, 0); + +! /* Make following constant read-only, if not compiling PIC. */ +! if (flag_pic) +! data_section(); +! else +! readonly_data_section (); + + exp = build1 (ADDR_EXPR, string_type_node, decl); + +========== --- gcc-2.95-2.95.4.ds15.orig/debian/patches/objc-testsuite.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/objc-testsuite.dpatch @@ -0,0 +1,30 @@ +#! /bin/sh -e + +# DP: Run objc tests with -lpthread. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- gcc/testsuite/lib/objc.exp~ Thu Dec 24 01:28:19 1998 ++++ gcc/testsuite/lib/objc.exp Wed Jun 2 15:53:12 1999 +@@ -118,7 +118,7 @@ + global OBJC_UNDER_TEST + global TOOL_OPTIONS + +- lappend options "libs=-lobjc" ++ lappend options "libs=-lobjc -lpthread" + if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } { + lappend options "libs=${gluefile}" + lappend options "ldflags=$wrap_flags" --- gcc-2.95-2.95.4.ds15.orig/debian/patches/patch-kit.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/patch-kit.dpatch @@ -0,0 +1,29 @@ +#! /bin/sh -e + +# DP: patch kit 20001221 + +src=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + src=$3/gcc +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +case "$1" in + -patch) + patch $pdir -l -f --no-backup-if-mismatch -p0 < $0 + cd $src && autoconf + ;; + -unpatch) + patch $pdir -l -f --no-backup-if-mismatch -R -p0 < $0 + cd $src && autoconf + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +nothing ... --- gcc-2.95-2.95.4.ds15.orig/debian/patches/ppc-fsirl-updates.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/ppc-fsirl-updates.dpatch @@ -0,0 +1,1551 @@ +#! /bin/sh -e + +# DP: Various updates from Franz Sirl, including DWARF EH support. +# DP: ftp://devel.linuxppc.org/users/fsirl/ +# DP: this patch includes the following Debian patches: +# DP: - gcc-weaksym +# DP: excluded: +# DP: - gcc/version.c +# DP: - objc-testsuite + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + + +Index: configure.in +=================================================================== +RCS file: /cvs/gcc/egcs/configure.in,v +retrieving revision 1.36.4.1 +diff -u -p -r1.36.4.1 configure.in +--- configure.in 1999/06/22 22:44:40 1.36.4.1 ++++ configure.in 2001/05/01 17:11:16 +@@ -50,7 +50,11 @@ fi + # these tools are built for the host environment + # Note, the powerpc-eabi build depends on sim occurring before gdb in order to + # know that we are building the simulator. +-host_tools="texinfo byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext zip" ++host_tools="byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext zip" ++ ++if [ "${enable_subdir_texinfo}" != "no" ] ; then ++ host_tools="texinfo ${host_tools}" ++fi + + + # these libraries are built for the target environment, and are built after +Index: gcc/ChangeLog +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/ChangeLog,v +retrieving revision 1.3667.4.355 +diff -u -p -r1.3667.4.355 ChangeLog +--- gcc/ChangeLog 2001/04/06 13:41:22 1.3667.4.355 ++++ gcc/ChangeLog 2001/05/01 17:11:21 +@@ -565,6 +565,60 @@ Fri Mar 16 12:46:19 GMT 2001 Bernd Schmi + * expmed.c (emit_store_flag): Prevent losing a pending stack + adjust the same way we prevent losing queued increments. + ++2001-04-07 Franz Sirl ++ ++ * rtl.h (SYMBOL_REF_WEAK): New macro. ++ * rtlanal.h (rtx_addr_can_trap): Use it, a weak SYMBOL_REF can trap. ++ * varasm.c (make_decl_rtl): Mark SYMBOL_REF weak if necessary. ++ * c-decl.c (duplicate_decls): Mirror weak status into RTL. ++ ++2001-03-01 Franz Sirl ++ ++ 2001-02-24 Franz Sirl ++ * loop.c (check_dbra_loop): A biv has uses besides counting if it is ++ used to set another biv. ++ ++2000-12-04 Franz Sirl ++ ++ 2000-08-24 Jim Wilson ++ * c-common.c (decl_attributes, case A_ALIGN): Revert last change. ++ Copy type in a TYPE_DECL, just like pushdecl does. ++ ++2000-10-17 Franz Sirl ++ ++ 1999-12-06 Jakub Jelinek ++ * calls.c (save_fixed_argument_area): If save_mode is BLKmode, ++ always use move_by_pieces to avoid infinite recursion. ++ (restore_fixed_argument_area): Likewise. ++ ++2000-10-14 Franz Sirl ++ ++ 2000-03-17 Martin v. Löwis ++ * calls.c (special_function_p): It is only malloc if it returns ++ Pmode. ++ ++ Tue Sep 14 01:33:15 1999 Andreas Schwab ++ * loop.c (strength_reduce): Don't call reg_used_between_p if the ++ insn from BL2 is after the insn from BL. ++ ++ Tue Dec 14 18:13:32 1999 J"orn Rennecke ++ * loop.c (strength_reduce): Fix sign of giv lifetime calculation ++ for givs made from biv increments. ++ ++ Mon Feb 28 11:34:43 2000 J"orn Rennecke ++ * loop.c (reg_in_basic_block_p): Don't abort when falling through ++ to the end of the function. ++ ++ Sat Apr 22 22:35:38 MET DST 2000 Jan Hubicka ++ * loop.c (strength_reduce): Fix biv removal code. ++ ++ Thu Oct 14 03:59:57 1999 Stephane Carrez ++ * stor-layout.c (layout_union): Use HOST_WIDE_INT for const_size; ++ check for member bit-size overflow and use var_size if it occurs. ++ (layout_record): Use bitsize_int() to define the type size in bits. ++ Likewise for computation and assignment to DECL_FIELD_BITPOS. ++ (layout_decl): Likewise when assigning to DECL_SIZE. ++ + 2000-10-27 Bernd Schmidt + + * expr.c (expand_expr, case INDIRECT_REF): If the address is a +Index: gcc/c-common.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/c-common.c,v +retrieving revision 1.56.4.3 +diff -u -p -r1.56.4.3 c-common.c +--- gcc/c-common.c 2001/03/19 14:13:01 1.56.4.3 ++++ gcc/c-common.c 2001/05/01 17:11:21 +@@ -697,7 +697,23 @@ decl_attributes (node, attributes, prefi + if (exact_log2 (align) == -1) + error ("requested alignment is not a power of 2"); + else if (is_type) +- TYPE_ALIGN (type) = align; ++ { ++ /* If we have a TYPE_DECL, then copy the type, so that we ++ don't accidentally modify a builtin type. See pushdecl. */ ++ if (decl && TREE_TYPE (decl) != error_mark_node ++ && DECL_ORIGINAL_TYPE (decl) == NULL_TREE) ++ { ++ tree tt = TREE_TYPE (decl); ++ DECL_ORIGINAL_TYPE (decl) = tt; ++ tt = build_type_copy (tt); ++ TYPE_NAME (tt) = decl; ++ TREE_USED (tt) = TREE_USED (decl); ++ TREE_TYPE (decl) = tt; ++ type = tt; ++ } ++ ++ TYPE_ALIGN (type) = align; ++ } + else if (TREE_CODE (decl) != VAR_DECL + && TREE_CODE (decl) != FIELD_DECL) + error_with_decl (decl, +Index: gcc/c-decl.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/c-decl.c,v +retrieving revision 1.61.4.2 +diff -u -p -r1.61.4.2 c-decl.c +--- gcc/c-decl.c 2001/01/25 14:02:59 1.61.4.2 ++++ gcc/c-decl.c 2001/05/01 17:11:23 +@@ -1,6 +1,6 @@ + /* Process declarations and variables for C compiler. +- Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +- Free Software Foundation, Inc. ++ Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, ++ 2001 Free Software Foundation, Inc. + + This file is part of GNU CC. + +@@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */ + + #include "config.h" + #include "system.h" ++#include "rtl.h" + #include "tree.h" + #include "flags.h" + #include "output.h" +@@ -41,6 +42,8 @@ Boston, MA 02111-1307, USA. */ + extern cpp_reader parse_in; + #endif + ++extern void declare_weak PARAMS ((tree)); ++ + /* In grokdeclarator, distinguish syntactic contexts of declarators. */ + enum decl_context + { NORMAL, /* Ordinary declaration */ +@@ -2028,7 +2031,15 @@ duplicate_decls (newdecl, olddecl, diffe + } + + /* Merge the storage class information. */ +- DECL_WEAK (newdecl) |= DECL_WEAK (olddecl); ++ if (!DECL_WEAK (newdecl) && DECL_WEAK (olddecl)) ++ declare_weak (newdecl); ++ if (DECL_WEAK (newdecl) && !DECL_WEAK (olddecl)) ++ declare_weak (olddecl); ++ if (DECL_WEAK (newdecl) && DECL_RTL (newdecl) ++ && GET_CODE (DECL_RTL (newdecl)) == MEM ++ && XEXP (DECL_RTL (newdecl), 0) ++ && GET_CODE (XEXP (DECL_RTL (newdecl), 0)) == SYMBOL_REF) ++ SYMBOL_REF_WEAK (XEXP (DECL_RTL (newdecl), 0)) = 1; + /* For functions, static overrides non-static. */ + if (TREE_CODE (newdecl) == FUNCTION_DECL) + { +Index: gcc/calls.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/calls.c,v +retrieving revision 1.57.4.2 +diff -u -p -r1.57.4.2 calls.c +--- gcc/calls.c 2001/01/25 14:03:00 1.57.4.2 ++++ gcc/calls.c 2001/05/01 17:11:23 +@@ -599,9 +599,10 @@ special_function_p (name, fndecl, return + *is_longjmp = 1; + /* XXX should have "malloc" attribute on functions instead + of recognizing them by name. */ +- else if (! strcmp (tname, "malloc") +- || ! strcmp (tname, "calloc") +- || ! strcmp (tname, "realloc") ++ else if ((TYPE_MODE (TREE_TYPE (TREE_TYPE (fndecl))) == Pmode ++ && (! strcmp (tname, "malloc") ++ || ! strcmp (tname, "calloc") ++ || ! strcmp (tname, "realloc"))) + /* Note use of NAME rather than TNAME here. These functions + are only reserved when preceded with __. */ + || ! strcmp (name, "__vn") /* mangled __builtin_vec_new */ +@@ -734,9 +735,11 @@ save_fixed_argument_area (reg_parm_stack + if (save_mode == BLKmode) + { + save_area = assign_stack_temp (BLKmode, num_to_save, 0); +- emit_block_move (validize_mem (save_area), stack_area, +- GEN_INT (num_to_save), +- PARM_BOUNDARY / BITS_PER_UNIT); ++ /* Cannot use emit_block_move here because it can be done by a library ++ call which in turn gets into this place again and deadly infinite ++ recursion happens. */ ++ move_by_pieces (validize_mem (save_area), stack_area, num_to_save, ++ PARM_BOUNDARY / BITS_PER_UNIT); + } + else + { +@@ -772,9 +775,12 @@ restore_fixed_argument_area (save_area, + if (save_mode != BLKmode) + emit_move_insn (stack_area, save_area); + else +- emit_block_move (stack_area, validize_mem (save_area), +- GEN_INT (high_to_save - low_to_save + 1), +- PARM_BOUNDARY / BITS_PER_UNIT); ++ /* Cannot use emit_block_move here because it can be done by a library ++ call which in turn gets into this place again and deadly infinite ++ recursion happens. */ ++ move_by_pieces (stack_area, validize_mem (save_area), ++ high_to_save - low_to_save + 1, ++ PARM_BOUNDARY / BITS_PER_UNIT); + } + #endif + +Index: gcc/collect2.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/collect2.c,v +retrieving revision 1.72.4.4 +diff -u -p -r1.72.4.4 collect2.c +--- gcc/collect2.c 2001/01/25 14:03:01 1.72.4.4 ++++ gcc/collect2.c 2001/05/01 17:11:23 +@@ -2961,11 +2961,22 @@ scan_prog_file (prog_name, which_pass) + add_to_list (&destructors, name); + break; + #endif +- + case 5: + if (! is_shared) + add_to_list (&frame_tables, name); ++#ifdef COLLECT_EXPORT_LIST ++ if (which_pass == PASS_OBJ) ++ add_to_list (&exports, name); ++ /* If this symbol was undefined and we are building ++ an import list, we should add a symbol to this ++ list. */ ++ else ++ if (import_flag ++ && is_in_list (name, undefined.first)) ++ add_to_list (&imports, name); ++#endif + break; ++ + + default: /* not a constructor or destructor */ + #ifdef COLLECT_EXPORT_LIST +Index: gcc/cse.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/cse.c,v +retrieving revision 1.72.4.7 +diff -u -p -r1.72.4.7 cse.c +--- gcc/cse.c 2001/04/06 11:37:48 1.72.4.7 ++++ gcc/cse.c 2001/05/01 17:11:24 +@@ -5476,6 +5476,7 @@ fold_rtx (x, insn) + /* This is the same as calling equiv_constant; it is duplicated + here for speed. */ + if (REGNO_QTY_VALID_P (REGNO (arg)) ++ && REGNO (arg) >= FIRST_PSEUDO_REGISTER + && qty_const[REG_QTY (REGNO (arg))] != 0 + && GET_CODE (qty_const[REG_QTY (REGNO (arg))]) != REG + && GET_CODE (qty_const[REG_QTY (REGNO (arg))]) != PLUS) +@@ -6037,6 +6038,7 @@ equiv_constant (x) + { + if (GET_CODE (x) == REG + && REGNO_QTY_VALID_P (REGNO (x)) ++ && REGNO (x) >= FIRST_PSEUDO_REGISTER + && qty_const[REG_QTY (REGNO (x))]) + x = gen_lowpart_if_possible (GET_MODE (x), qty_const[REG_QTY (REGNO (x))]); + +Index: gcc/dwarfout.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/dwarfout.c,v +retrieving revision 1.35.4.4 +diff -u -p -r1.35.4.4 dwarfout.c +--- gcc/dwarfout.c 1999/08/13 07:32:07 1.35.4.4 ++++ gcc/dwarfout.c 2001/05/01 17:11:25 +@@ -880,7 +880,7 @@ static int is_redundant_typedef PROTO(( + ASM_OUTPUT_ASCII ((FILE), P, strlen (P)+1) + #else + #define ASM_OUTPUT_DWARF_STRING_NEWLINE(FILE,P) \ +- ASM_OUTPUT_DWARF_STRING (FILE,P), ASM_OUTPUT_DWARF_STRING (FILE,"\n") ++ do { ASM_OUTPUT_DWARF_STRING (FILE,P); ASM_OUTPUT_DWARF_STRING (FILE,"\n"); } while (0) + #endif + + +Index: gcc/except.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/except.c,v +retrieving revision 1.82.4.4 +diff -u -p -r1.82.4.4 except.c +--- gcc/except.c 2001/03/19 13:37:23 1.82.4.4 ++++ gcc/except.c 2001/05/01 17:11:26 +@@ -2728,7 +2728,7 @@ eh_regs (pcontext, psp, pra, outgoing) + rtx *pcontext, *psp, *pra; + int outgoing; + { +- rtx rcontext, rsp, rra; ++ rtx rcontext, rsp, rra = NULL_RTX; + int i; + + #ifdef FUNCTION_OUTGOING_VALUE +@@ -2740,6 +2740,16 @@ eh_regs (pcontext, psp, pra, outgoing) + rcontext = FUNCTION_VALUE (build_pointer_type (void_type_node), + current_function_decl); + ++/* If we've specified the register to communicate the stack offset or ++ return address, use it instead of picking one */ ++ ++#ifdef DWARF2_EH_RA_REG ++ rra = gen_rtx_REG (Pmode, DWARF2_EH_RA_REG); ++#endif ++ ++#ifdef DWARF2_EH_SP_REG ++ rsp = gen_rtx_REG (Pmode, DWARF2_EH_SP_REG); ++#else + #ifdef STATIC_CHAIN_REGNUM + if (outgoing) + rsp = static_chain_incoming_rtx; +@@ -2748,6 +2758,7 @@ eh_regs (pcontext, psp, pra, outgoing) + if (REGNO (rsp) == REGNO (rcontext)) + #endif /* STATIC_CHAIN_REGNUM */ + rsp = NULL_RTX; ++#endif + + if (rsp == NULL_RTX) + { +@@ -2760,14 +2771,16 @@ eh_regs (pcontext, psp, pra, outgoing) + rsp = gen_rtx_REG (Pmode, i); + } + +- for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i) +- if (call_used_regs[i] && ! fixed_regs[i] +- && i != REGNO (rcontext) && i != REGNO (rsp)) +- break; +- if (i == FIRST_PSEUDO_REGISTER) +- abort(); +- +- rra = gen_rtx_REG (Pmode, i); ++ if (rra == NULL_RTX) ++ { ++ for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i) ++ if (call_used_regs[i] && ! fixed_regs[i] ++ && i != REGNO (rcontext) && i != REGNO (rsp)) ++ break; ++ if (i == FIRST_PSEUDO_REGISTER) ++ abort(); ++ rra = gen_rtx_REG (Pmode, i); ++ } + + *pcontext = rcontext; + *psp = rsp; +@@ -2832,7 +2845,8 @@ expand_eh_return () + #ifdef HAVE_eh_epilogue + if (HAVE_eh_epilogue) + { +- emit_insn (gen_eh_epilogue (reg1, reg2, reg3)); ++ emit_insn (gen_eh_epilogue (eh_return_context, eh_return_stack_adjust, ++ eh_return_handler)); + return; + } + #endif +@@ -2857,6 +2871,12 @@ expand_eh_return () + if (tmp != ra) + emit_move_insn (ra, tmp); + ++ eh_regs (®1, ®2, ®3, 1); ++ ++ emit_move_insn (reg1, eh_return_context); ++ emit_move_insn (reg2, eh_return_stack_adjust); ++ emit_move_insn (reg3, eh_return_handler); ++ + /* Indicate that the registers are in fact used. */ + emit_insn (gen_rtx_USE (VOIDmode, reg1)); + emit_insn (gen_rtx_USE (VOIDmode, reg2)); +Index: gcc/longlong.h +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/longlong.h,v +retrieving revision 1.8 +diff -u -p -r1.8 longlong.h +--- gcc/longlong.h 1999/01/06 20:44:39 1.8 ++++ gcc/longlong.h 2001/05/01 17:11:26 +@@ -665,7 +665,7 @@ UDItype __umulsidi3 (USItype, USItype); + (r) = __xx.__i.__l; (q) = __xx.__i.__h; }) + #endif /* __ns32000__ */ + +-#if (defined (_ARCH_PPC) || defined (_IBMR2)) && W_TYPE_SIZE == 32 ++#if (defined (_ARCH_PPC) || defined (_IBMR2)) + #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ + do { \ + if (__builtin_constant_p (bh) && (bh) == 0) \ +Index: gcc/loop.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/loop.c,v +retrieving revision 1.156.4.21 +diff -u -p -r1.156.4.21 loop.c +--- gcc/loop.c 2001/04/03 12:09:42 1.156.4.21 ++++ gcc/loop.c 2001/05/01 17:11:27 +@@ -1311,8 +1311,12 @@ reg_in_basic_block_p (insn, reg) + } + } + +- /* The "last use" doesn't follow the "first use"?? */ +- abort (); ++ /* The "last use" that was recorded can't be found after the first ++ use. This can happen when the last use was deleted while ++ processing an inner loop, this inner loop was then completely ++ unrolled, and the outer loop is always exited after the inner loop, ++ so that everything after the first use becomes a single basic block. */ ++ return 1; + } + + /* Compute the benefit of eliminating the insns in the block whose +@@ -4109,11 +4113,11 @@ strength_reduce (scan_start, end, loop_t + in-between when biv_toal_increment returns nonzero both times + but we test it here in case some day some real cfg analysis + gets used to set always_computable. */ +- && ((loop_insn_first_p (bl2->biv->insn, bl->biv->insn) +- && no_labels_between_p (bl2->biv->insn, bl->biv->insn)) +- || (! reg_used_between_p (bl->biv->src_reg, bl->biv->insn, +- bl2->biv->insn) +- && no_jumps_between_p (bl->biv->insn, bl2->biv->insn))) ++ && (loop_insn_first_p (bl2->biv->insn, bl->biv->insn) ++ ? no_labels_between_p (bl2->biv->insn, bl->biv->insn) ++ : (! reg_used_between_p (bl->biv->src_reg, bl->biv->insn, ++ bl2->biv->insn) ++ && no_jumps_between_p (bl->biv->insn, bl2->biv->insn))) + && validate_change (bl->biv->insn, + &SET_SRC (single_set (bl->biv->insn)), + copy_rtx (src), 0)) +@@ -4178,13 +4182,7 @@ strength_reduce (scan_start, end, loop_t + INSN_LUID (p)); + } + /* Remove this biv from the chain. */ +- if (bl->next) +- *bl = *bl->next; +- else +- { +- *backbl = 0; +- break; +- } ++ *backbl = bl->next; + } + + /* If we can't make it a giv, +@@ -4404,7 +4402,7 @@ strength_reduce (scan_start, end, loop_t + } + + v->last_use = last_use_insn; +- v->lifetime = INSN_LUID (v->insn) - INSN_LUID (last_use_insn); ++ v->lifetime = INSN_LUID (last_use_insn) - INSN_LUID (v->insn); + /* If the lifetime is zero, it means that this register is really + a dead store. So mark this as a giv that can be ignored. + This will not prevent the biv from being eliminated. */ +@@ -7835,6 +7833,7 @@ check_dbra_loop (loop_end, insn_count, l + && ! loop_number_exit_count[uid_loop_num[INSN_UID (loop_start)]]) + { + rtx bivreg = regno_reg_rtx[bl->regno]; ++ struct iv_class *blt; + + /* If there are no givs for this biv, and the only exit is the + fall through at the end of the loop, then +@@ -7870,6 +7869,14 @@ check_dbra_loop (loop_end, insn_count, l + no_use_except_counting = 0; + break; + } ++ } ++ ++ /* A biv has uses besides counting if it is used to set another biv. */ ++ for (blt = loop_iv_list; blt; blt = blt->next) ++ if (blt->init_set && reg_mentioned_p (bivreg, SET_SRC (blt->init_set))) ++ { ++ no_use_except_counting = 0; ++ break; + } + } + +Index: gcc/rtl.h +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/rtl.h,v +retrieving revision 1.105.4.4 +diff -u -p -r1.105.4.4 rtl.h +--- gcc/rtl.h 2001/04/06 11:37:50 1.105.4.4 ++++ gcc/rtl.h 2001/05/01 17:11:27 +@@ -162,7 +162,8 @@ typedef struct rtx_def + unsigned int used : 1; + /* Nonzero if this rtx came from procedure integration. + In a REG, nonzero means this reg refers to the return value +- of the current function. */ ++ of the current function. ++ 1 in a SYMBOL_REF if the symbol is weak. */ + unsigned integrated : 1; + /* 1 in an INSN or a SET if this rtx is related to the call frame, + either changing how we compute the frame address or saving and +@@ -660,6 +661,9 @@ extern char *note_insn_name[]; + + /* 1 means a SYMBOL_REF has been the library function in emit_library_call. */ + #define SYMBOL_REF_USED(RTX) ((RTX)->used) ++ ++/* 1 means a SYMBOL_REF is weak. */ ++#define SYMBOL_REF_WEAK(RTX) ((RTX)->integrated) + + /* For an INLINE_HEADER rtx, FIRST_FUNCTION_INSN is the first insn + of the function that is not involved in copying parameters to +Index: gcc/rtlanal.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/rtlanal.c,v +retrieving revision 1.36.4.2 +diff -u -p -r1.36.4.2 rtlanal.c +--- gcc/rtlanal.c 2001/01/25 14:03:22 1.36.4.2 ++++ gcc/rtlanal.c 2001/05/01 17:11:27 +@@ -136,11 +136,9 @@ rtx_addr_can_trap_p (x) + switch (code) + { + case SYMBOL_REF: ++ return SYMBOL_REF_WEAK (x); ++ + case LABEL_REF: +- /* SYMBOL_REF is problematic due to the possible presence of +- a #pragma weak, but to say that loads from symbols can trap is +- *very* costly. It's not at all clear what's best here. For +- now, we ignore the impact of #pragma weak. */ + return 0; + + case REG: +Index: gcc/stor-layout.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/stor-layout.c,v +retrieving revision 1.25 +diff -u -p -r1.25 stor-layout.c +--- gcc/stor-layout.c 1999/03/11 13:56:20 1.25 ++++ gcc/stor-layout.c 2001/05/01 17:11:28 +@@ -264,8 +264,8 @@ layout_decl (decl, known_align) + if (spec_size == 0 && DECL_NAME (decl) != 0) + abort (); + +- /* Size is specified number of bits. */ +- DECL_SIZE (decl) = size_int (spec_size); ++ /* Size is specified in number of bits. */ ++ DECL_SIZE (decl) = bitsize_int (spec_size, 0); + } + /* Force alignment required for the data type. + But if the decl itself wants greater alignment, don't override that. +@@ -301,7 +301,7 @@ layout_decl (decl, known_align) + DECL_ALIGN (decl) = MAX ((unsigned) GET_MODE_ALIGNMENT (xmode), + DECL_ALIGN (decl)); + DECL_MODE (decl) = xmode; +- DECL_SIZE (decl) = size_int (GET_MODE_BITSIZE (xmode)); ++ DECL_SIZE (decl) = bitsize_int (GET_MODE_BITSIZE (xmode), 0); + /* This no longer needs to be accessed as a bit field. */ + DECL_BIT_FIELD (decl) = 0; + } +@@ -520,7 +520,7 @@ layout_record (rec) + DECL_FIELD_BITPOS (field) = var_size; + else + { +- DECL_FIELD_BITPOS (field) = size_int (const_size); ++ DECL_FIELD_BITPOS (field) = bitsize_int (const_size, 0L); + + /* If this field ended up more aligned than we thought it + would be (we approximate this by seeing if its position +@@ -562,7 +562,7 @@ layout_record (rec) + + if (var_size == 0) + { +- TYPE_SIZE (rec) = size_int (const_size); ++ TYPE_SIZE (rec) = bitsize_int (const_size, 0L); + } + else + { +@@ -610,7 +610,7 @@ layout_union (rec) + /* The size of the union, based on the fields scanned so far, + is max (CONST_SIZE, VAR_SIZE). + VAR_SIZE may be null; then CONST_SIZE by itself is the size. */ +- register int const_size = 0; ++ register HOST_WIDE_INT const_size = 0; + register tree var_size = 0; + + #ifdef STRUCTURE_SIZE_BOUNDARY +@@ -627,6 +627,8 @@ layout_union (rec) + + for (field = TYPE_FIELDS (rec); field; field = TREE_CHAIN (field)) + { ++ tree dsize; ++ + /* Enums which are local to this class need not be laid out. */ + if (TREE_CODE (field) == CONST_DECL || TREE_CODE (field) == TYPE_DECL) + continue; +@@ -645,19 +647,22 @@ layout_union (rec) + union_align = MAX (union_align, TYPE_ALIGN (TREE_TYPE (field))); + #endif + ++ dsize = DECL_SIZE (field); + if (TREE_CODE (rec) == UNION_TYPE) + { + /* Set union_size to max (decl_size, union_size). + There are more and less general ways to do this. + Use only CONST_SIZE unless forced to use VAR_SIZE. */ + +- if (TREE_CODE (DECL_SIZE (field)) == INTEGER_CST) ++ if (TREE_CODE (dsize) == INTEGER_CST ++ && ! TREE_CONSTANT_OVERFLOW (dsize) ++ && TREE_INT_CST_HIGH (dsize) == 0) + const_size +- = MAX (const_size, TREE_INT_CST_LOW (DECL_SIZE (field))); ++ = MAX (const_size, TREE_INT_CST_LOW (dsize)); + else if (var_size == 0) +- var_size = DECL_SIZE (field); ++ var_size = dsize; + else +- var_size = size_binop (MAX_EXPR, var_size, DECL_SIZE (field)); ++ var_size = size_binop (MAX_EXPR, var_size, dsize); + } + else if (TREE_CODE (rec) == QUAL_UNION_TYPE) + var_size = fold (build (COND_EXPR, sizetype, DECL_QUALIFIER (field), +Index: gcc/toplev.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/toplev.c,v +retrieving revision 1.185.4.8 +diff -u -p -r1.185.4.8 toplev.c +--- gcc/toplev.c 2001/04/06 11:37:50 1.185.4.8 ++++ gcc/toplev.c 2001/05/01 17:11:28 +@@ -1466,6 +1466,8 @@ fatal_insn VPROTO((const char *msgid, rt + #endif + va_list ap; + ++ error ("Internal compiler error:"); ++ + VA_START (ap, insn); + + #ifndef ANSI_PROTOTYPES +@@ -1942,6 +1944,8 @@ fatal VPROTO((const char *msgid, ...)) + const char *msgid; + #endif + va_list ap; ++ ++ error ("Internal compiler error:"); + + VA_START (ap, msgid); + +Index: gcc/varasm.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/varasm.c,v +retrieving revision 1.59.4.8 +diff -u -p -r1.59.4.8 varasm.c +--- gcc/varasm.c 2001/03/28 09:02:17 1.59.4.8 ++++ gcc/varasm.c 2001/05/01 17:11:28 +@@ -118,6 +118,8 @@ struct constant_descriptor; + struct rtx_const; + struct pool_constant; + ++void declare_weak PROTO ((tree)); ++ + static const char *strip_reg_name PROTO((const char *)); + static int contains_pointers_p PROTO((tree)); + static void decode_addr_const PROTO((tree, struct addr_const *)); +@@ -143,6 +145,7 @@ static int output_addressed_constants PR + static void output_after_function_constants PROTO((void)); + static void output_constructor PROTO((tree, int)); + static void remove_from_pending_weak_list PROTO ((char *)); ++static int is_on_pending_weak_list PROTO ((char *)); + #ifdef ASM_OUTPUT_BSS + static void asm_output_bss PROTO((FILE *, tree, char *, int, int)); + #endif +@@ -755,6 +758,9 @@ make_decl_rtl (decl, asmspec, top_level) + DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl), + gen_rtx_SYMBOL_REF (Pmode, name)); + MEM_ALIAS_SET (DECL_RTL (decl)) = get_alias_set (decl); ++ if (is_on_pending_weak_list (name)) ++ declare_weak (decl); ++ SYMBOL_REF_WEAK (XEXP (DECL_RTL (decl), 0)) = DECL_WEAK (decl); + + /* If this variable is to be treated as volatile, show its + tree node has side effects. If it has side effects, either +@@ -4344,8 +4350,15 @@ declare_weak (decl) + { + if (! TREE_PUBLIC (decl)) + error_with_decl (decl, "weak declaration of `%s' must be public"); ++#if 0 ++ /* Due to a bug this error was never active, enabling it now would break ++ glibc. */ + else if (TREE_ASM_WRITTEN (decl)) + error_with_decl (decl, "weak declaration of `%s' must precede definition"); ++ /* This would be a new error, but it would break glibc too :-(. */ ++ else if (TREE_USED (decl)) ++ error_with_decl (decl, "weak declaration of `%s' must precede its uses"); ++#endif + else if (SUPPORTS_WEAK) + DECL_WEAK (decl) = 1; + #ifdef HANDLE_PRAGMA_WEAK +@@ -4397,6 +4410,24 @@ remove_from_pending_weak_list (name) + } + } + #endif ++} ++ ++static int ++is_on_pending_weak_list (name) ++ char *name; ++{ ++#ifdef HANDLE_PRAGMA_WEAK ++ if (HANDLE_PRAGMA_WEAK) ++ { ++ struct weak_syms *t; ++ for (t = weak_decls; t; t = t->next) ++ { ++ if (t->name && strcmp (name, t->name) == 0) ++ return 1; ++ } ++ } ++#endif ++ return 0; + } + + void +Index: gcc/config/rs6000/aix31.h +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/rs6000/aix31.h,v +retrieving revision 1.2 +diff -u -p -r1.2 aix31.h +--- gcc/config/rs6000/aix31.h 1998/12/16 21:11:43 1.2 ++++ gcc/config/rs6000/aix31.h 2001/05/01 17:11:28 +@@ -22,6 +22,7 @@ Boston, MA 02111-1307, USA. */ + + + #include "rs6000/rs6000.h" ++#include "aix-dwarf.h" + + /* AIX 3.2 defined _AIX32, but older versions do not. */ + #undef CPP_PREDEFINES +Index: gcc/config/rs6000/aix3newas.h +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/rs6000/aix3newas.h,v +retrieving revision 1.2 +diff -u -p -r1.2 aix3newas.h +--- gcc/config/rs6000/aix3newas.h 1998/12/16 21:11:44 1.2 ++++ gcc/config/rs6000/aix3newas.h 2001/05/01 17:11:28 +@@ -30,6 +30,7 @@ Boston, MA 02111-1307, USA. */ + {"no-xl-call", - MASK_XL_CALL}, + + #include "rs6000/rs6000.h" ++#include "aix-dwarf.h" + + /* Tell the assembler to assume that all undefined names are external. */ + +Index: gcc/config/rs6000/aix41.h +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/rs6000/aix41.h,v +retrieving revision 1.6 +diff -u -p -r1.6 aix41.h +--- gcc/config/rs6000/aix41.h 1999/03/27 18:21:29 1.6 ++++ gcc/config/rs6000/aix41.h 2001/05/01 17:11:28 +@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */ + {"pe", 0}, + + #include "rs6000/rs6000.h" ++#include "aix-dwarf.h" + + #undef ASM_SPEC + #define ASM_SPEC "-u %(asm_cpu)" +Index: gcc/config/rs6000/aix43.h +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/rs6000/aix43.h,v +retrieving revision 1.5 +diff -u -p -r1.5 aix43.h +--- gcc/config/rs6000/aix43.h 1999/05/03 20:10:05 1.5 ++++ gcc/config/rs6000/aix43.h 2001/05/01 17:11:28 +@@ -58,6 +58,7 @@ do { \ + } while (0); + + #include "rs6000/rs6000.h" ++#include "aix-dwarf.h" + + #undef ASM_SPEC + #define ASM_SPEC "-u %{maix64:-a64 -mppc64} %(asm_cpu)" +Index: gcc/config/rs6000/eabi-ci.asm +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/rs6000/eabi-ci.asm,v +retrieving revision 1.2 +diff -u -p -r1.2 eabi-ci.asm +--- gcc/config/rs6000/eabi-ci.asm 1998/12/16 21:11:50 1.2 ++++ gcc/config/rs6000/eabi-ci.asm 2001/05/01 17:11:29 +@@ -102,6 +102,11 @@ __SBSS2_START__: + .type __EXCEPT_START__,@object + __EXCEPT_START__: + ++ .section ".eh_frame","aw" ++ .globl __EH_FRAME_BEGIN__ ++ .type __EH_FRAME_BEGIN__,@object ++__EH_FRAME_BEGIN__: ++ + # Head of __init function used for static constructors in Solaris + .section ".init","ax" + .align 2 +Index: gcc/config/rs6000/eabi-cn.asm +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/rs6000/eabi-cn.asm,v +retrieving revision 1.2 +diff -u -p -r1.2 eabi-cn.asm +--- gcc/config/rs6000/eabi-cn.asm 1998/12/16 21:11:51 1.2 ++++ gcc/config/rs6000/eabi-cn.asm 2001/05/01 17:11:29 +@@ -94,6 +94,12 @@ __SBSS2_END__: + .type __EXCEPT_END__,@object + __EXCEPT_END__: + ++ .section ".eh_frame","aw" ++ .globl __EH_FRAME_END__ ++ .type __EH_FRAME_END__,@object ++__EH_FRAME_END__: ++ .long 0 ++ + # Tail of __init used for static constructors in Solaris + .section ".init","ax" + lwz 0,12(1) +Index: gcc/config/rs6000/eabi-ctors.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/rs6000/Attic/eabi-ctors.c,v +retrieving revision 1.2.8.1 +diff -u -p -r1.2.8.1 eabi-ctors.c +--- gcc/config/rs6000/eabi-ctors.c 2000/03/08 05:05:06 1.2.8.1 ++++ gcc/config/rs6000/eabi-ctors.c 2001/05/01 17:11:29 +@@ -40,7 +40,24 @@ extern func_ptr __CTOR_LIST__[]; + extern func_ptr __CTOR_END__ []; + extern func_ptr __DTOR_LIST__[]; + extern func_ptr __DTOR_END__ []; ++extern char __EH_FRAME_BEGIN__ []; + ++struct object { ++ void *pc_begin; ++ void *pc_end; ++ struct dwarf_fde *fde_begin; ++ struct dwarf_fde **fde_array; ++ long count; ++ struct object *next; ++}; ++ ++extern void __register_frame_info (void *, struct object *); ++extern void __register_frame_info_table (void *, struct object *); ++extern void __deregister_frame_info (void *); ++ ++ ++#define EH_FRAME_SECTION_ASM_OP ".section\t.eh_frame,\"aw\"" ++ + extern void __do_global_ctors (void); + extern void __do_global_dtors (void); + +@@ -61,6 +78,11 @@ __do_global_ctors (void) + func_ptr *ptr = &__CTOR_END__[0] - 1; + func_ptr *start = &__CTOR_LIST__[0]; + ++#ifdef EH_FRAME_SECTION_ASM_OP ++ static struct object object; ++ __register_frame_info (__EH_FRAME_BEGIN__, &object); ++#endif ++ + if (__atexit) + __atexit (__do_global_dtors); + +@@ -88,5 +110,8 @@ __do_global_dtors (void) + for ( ; ptr < end; ptr++) + if (*ptr) + (*ptr)(); +-} + ++#ifdef EH_FRAME_SECTION_ASM_OP ++ __deregister_frame_info (__EH_FRAME_BEGIN__); ++#endif ++} +Index: gcc/config/rs6000/rs6000.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.c,v +retrieving revision 1.70.4.17 +diff -u -p -r1.70.4.17 rs6000.c +--- gcc/config/rs6000/rs6000.c 2001/01/25 14:03:34 1.70.4.17 ++++ gcc/config/rs6000/rs6000.c 2001/05/01 17:11:29 +@@ -78,6 +78,11 @@ static int common_mode_defined; + rtx rs6000_compare_op0, rs6000_compare_op1; + int rs6000_compare_fp_p; + ++/* If we've defined this, we need a counter for the fixup labels */ ++#ifdef ASM_OUTPUT_DWARF_ADDR ++int dwarflabelno = 0; ++#endif ++ + #ifdef USING_SVR4_H + /* Label number of label created for -mrelocatable, to call to so we can + get the address of the GOT section */ +@@ -105,6 +110,10 @@ enum rs6000_abi rs6000_current_abi; + int rs6000_fpmem_offset; + int rs6000_fpmem_size; + ++static rtx rs6000_ra_rtx; ++static int rs6000_ra_0_used; ++static int rs6000_ra_n_used; ++ + /* Debug flags */ + const char *rs6000_debug_name; + int rs6000_debug_stack; /* debug stack applications */ +@@ -2678,6 +2687,9 @@ struct machine_function + int save_toc_p; + int fpmem_size; + int fpmem_offset; ++ rtx ra_rtx; ++ int ra_0_used; ++ int ra_n_used; + }; + + /* Functions to save and restore rs6000_fpmem_size. +@@ -2695,6 +2707,9 @@ rs6000_save_machine_status (p) + machine->sysv_varargs_p = rs6000_sysv_varargs_p; + machine->fpmem_size = rs6000_fpmem_size; + machine->fpmem_offset = rs6000_fpmem_offset; ++ machine->ra_rtx = rs6000_ra_rtx; ++ machine->ra_0_used = rs6000_ra_0_used; ++ machine->ra_n_used = rs6000_ra_n_used; + } + + void +@@ -2706,6 +2721,9 @@ rs6000_restore_machine_status (p) + rs6000_sysv_varargs_p = machine->sysv_varargs_p; + rs6000_fpmem_size = machine->fpmem_size; + rs6000_fpmem_offset = machine->fpmem_offset; ++ rs6000_ra_rtx = machine->ra_rtx; ++ rs6000_ra_0_used = machine->ra_0_used; ++ rs6000_ra_n_used = machine->ra_n_used; + + free (machine); + p->machine = (struct machine_function *)0; +@@ -2721,6 +2739,10 @@ rs6000_init_expanders () + rs6000_fpmem_size = 0; + rs6000_fpmem_offset = 0; + ++ rs6000_ra_rtx = 0; ++ rs6000_ra_0_used = 0; ++ rs6000_ra_n_used = 0; ++ + /* Arrange to save and restore machine status around nested functions. */ + save_machine_status = rs6000_save_machine_status; + restore_machine_status = rs6000_restore_machine_status; +@@ -3654,7 +3676,7 @@ rs6000_stack_info () + info_ptr->fp_size = 8 * (64 - info_ptr->first_fp_reg_save); + + /* Does this function call anything? */ +- info_ptr->calls_p = rs6000_makes_calls (); ++ info_ptr->calls_p = rs6000_makes_calls () || rs6000_ra_n_used; + + /* Allocate space to save the toc. */ + if (abi == ABI_NT && info_ptr->calls_p) +@@ -3976,6 +3998,42 @@ debug_stack_info (info) + fprintf (stderr, "\n"); + } + ++ ++rtx ++rs6000_return_addr (count, frame) ++ int count; ++ rtx frame; ++{ ++ rtx init, reg; ++ ++ if (1) ++ { ++ rs6000_ra_n_used = 1; ++ return gen_rtx_MEM (Pmode, ++ memory_address (Pmode, ++ plus_constant (copy_to_reg (gen_rtx_MEM (Pmode, ++ memory_address (Pmode, frame))), ++ RETURN_ADDRESS_OFFSET))); ++ } ++ ++ reg = rs6000_ra_rtx; ++ if (reg == NULL) ++ { ++ /* No rtx yet. Invent one, and initialize it from LR in ++ the prologue. */ ++ reg = gen_reg_rtx (Pmode); ++ rs6000_ra_rtx = reg; ++ init = gen_rtx_SET (VOIDmode, reg, gen_rtx_REG (Pmode, 65)); ++ ++ /* Emit the insn to the prologue with the other argument copies. */ ++ push_topmost_sequence (); ++ emit_insn_after (init, get_insns ()); ++ pop_topmost_sequence (); ++ } ++ ++ return reg; ++} ++ + /* Write out an instruction to load the TOC_TABLE address into register 30. + This is only needed when TARGET_TOC, TARGET_MINIMAL_TOC, and there is + a constant pool. */ +@@ -4114,6 +4172,9 @@ rs6000_allocate_stack_space (file, size, + } + } + ++#define SET_DWARF_LABEL(X) (X = ((X == NULL) ? \ ++ (char *) dwarf2out_cfi_label () : X )) ++ + + /* Write function prologue. */ + void +@@ -4127,6 +4188,7 @@ output_prolog (file, size) + const char *load_reg; + int sp_reg = 1; + int sp_offset = 0; ++ char *dw2_label = NULL; + + if (TARGET_32BIT) + { +@@ -4202,6 +4264,19 @@ output_prolog (file, size) + asm_fprintf (file, "\tbl %s%d%s\n", SAVE_FP_PREFIX, + info->first_fp_reg_save - 32, SAVE_FP_SUFFIX); + ++ /* Regardless of whether its inlined or not, the net effect at this point ++ is that the FPRs have been saved from first to the end.*/ ++ if (dwarf2out_do_frame () && info->first_fp_reg_save != 64) ++ { ++ int regno = info->first_fp_reg_save; ++ int loc = info->fp_save_offset; ++ SET_DWARF_LABEL (dw2_label); ++ for ( ; regno < 64; regno++, loc += 8) ++ { ++ dwarf2out_reg_save (dw2_label, regno, loc); ++ } ++ } ++ + /* Now save gpr's. */ + if (! TARGET_MULTIPLE || info->first_gp_reg_save == 31 || TARGET_64BIT) + { +@@ -4218,6 +4293,19 @@ output_prolog (file, size) + info->gp_save_offset + sp_offset, + reg_names[sp_reg]); + ++ /* Regardless of whether its inlined or not, the net effect at this point ++ is that the GPRs have been saved from first to the end.*/ ++ if (dwarf2out_do_frame () && info->first_gp_reg_save != 32) ++ { ++ int regno = info->first_gp_reg_save; ++ int loc = info->gp_save_offset; ++ SET_DWARF_LABEL (dw2_label); ++ for ( ; regno < 32; regno++, loc += reg_size) ++ { ++ dwarf2out_reg_save (dw2_label, regno, loc); ++ } ++ } ++ + /* Save main's arguments if we need to call a function */ + #ifdef NAME__MAIN + if (info->main_save_p) +@@ -4236,6 +4324,11 @@ output_prolog (file, size) + asm_fprintf (file, store_reg, reg_names[0], info->lr_save_offset + sp_offset, + reg_names[sp_reg]); + ++ if (dwarf2out_do_frame () && info->lr_save_p) ++ { ++ SET_DWARF_LABEL (dw2_label); ++ dwarf2out_return_save (dw2_label, info->lr_save_offset); ++ } + /* Save CR if we use any that must be preserved. */ + if (info->cr_save_p) + { +@@ -4249,6 +4342,13 @@ output_prolog (file, size) + else + asm_fprintf (file, store_reg, reg_names[12], info->cr_save_offset + sp_offset, + reg_names[sp_reg]); ++ /* we save all the condition registers as if they are a single ++ register. The are physically, so this should work fine. */ ++ if (dwarf2out_do_frame ()) ++ { ++ SET_DWARF_LABEL (dw2_label); ++ dwarf2out_reg_save (dw2_label, 70, info->cr_save_offset); ++ } + } + + /* If we need PIC_OFFSET_TABLE_REGNUM, initialize it now */ +@@ -4308,9 +4408,24 @@ output_prolog (file, size) + if (info->push_p && DEFAULT_ABI != ABI_V4 && DEFAULT_ABI != ABI_SOLARIS) + rs6000_allocate_stack_space (file, info->total_size, FALSE); + ++ /* Update the stack frame by size, We update it for all targets here ++ at the end since we saved everything relative to the incoming value. */ ++ ++ if (dwarf2out_do_frame () && info->push_p) ++ { ++ SET_DWARF_LABEL (dw2_label); ++ dwarf2out_def_cfa (dw2_label, 1, info->total_size); ++ } + /* Set frame pointer, if needed. */ + if (frame_pointer_needed) +- asm_fprintf (file, "\tmr %s,%s\n", reg_names[31], reg_names[1]); ++ { ++ asm_fprintf (file, "\tmr %s,%s\n", reg_names[31], reg_names[1]); ++ if (dwarf2out_do_frame () && info->push_p) ++ { ++ SET_DWARF_LABEL (dw2_label); ++ dwarf2out_def_cfa (dw2_label, 31, info->total_size); ++ } ++ } + + #ifdef NAME__MAIN + /* If we need to call a function to set things up for main, do so now +@@ -5842,14 +5957,17 @@ rs6000_select_section (decl, reloc) + else + data_section (); + } +- else if (TREE_CODE (decl) == VAR_DECL) ++ else if (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == CONSTRUCTOR) + { + if ((flag_pic && reloc) +- || !TREE_READONLY (decl) ++ || ! TREE_READONLY (decl) + || TREE_SIDE_EFFECTS (decl) +- || !DECL_INITIAL (decl) +- || (DECL_INITIAL (decl) != error_mark_node +- && !TREE_CONSTANT (DECL_INITIAL (decl)))) ++ || (TREE_CODE (decl) == VAR_DECL ++ && (! DECL_INITIAL (decl) ++ || (DECL_INITIAL (decl) != error_mark_node ++ && ! TREE_CONSTANT (DECL_INITIAL (decl))))) ++ || (TREE_CODE (decl) == CONSTRUCTOR ++ && ! TREE_CONSTANT (decl))) + { + if (rs6000_sdata != SDATA_NONE && (size > 0) && (size <= g_switch_value)) + sdata_section (); +Index: gcc/config/rs6000/rs6000.h +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.h,v +retrieving revision 1.49.4.6 +diff -u -p -r1.49.4.6 rs6000.h +--- gcc/config/rs6000/rs6000.h 2000/03/22 18:54:05 1.49.4.6 ++++ gcc/config/rs6000/rs6000.h 2001/05/01 17:11:29 +@@ -352,46 +352,81 @@ extern int target_flags; + #endif + + #define TARGET_SWITCHES \ +- {{"power", MASK_POWER | MASK_MULTIPLE | MASK_STRING}, \ ++ {{"power", MASK_POWER | MASK_MULTIPLE | MASK_STRING, \ ++ "Use POWER instruction set"}, \ + {"power2", (MASK_POWER | MASK_MULTIPLE | MASK_STRING \ +- | MASK_POWER2)}, \ +- {"no-power2", - MASK_POWER2}, \ ++ | MASK_POWER2), \ ++ "Use POWER2 instruction set"}, \ ++ {"no-power2", - MASK_POWER2, \ ++ "Do not use POWER2 instruction set"}, \ + {"no-power", - (MASK_POWER | MASK_POWER2 | MASK_MULTIPLE \ +- | MASK_STRING)}, \ +- {"powerpc", MASK_POWERPC}, \ ++ | MASK_STRING), \ ++ "Do not use POWER instruction set"}, \ ++ {"powerpc", MASK_POWERPC, \ ++ "Use PowerPC instruction set"}, \ + {"no-powerpc", - (MASK_POWERPC | MASK_PPC_GPOPT \ +- | MASK_PPC_GFXOPT | MASK_POWERPC64)}, \ +- {"powerpc-gpopt", MASK_POWERPC | MASK_PPC_GPOPT}, \ +- {"no-powerpc-gpopt", - MASK_PPC_GPOPT}, \ +- {"powerpc-gfxopt", MASK_POWERPC | MASK_PPC_GFXOPT}, \ +- {"no-powerpc-gfxopt", - MASK_PPC_GFXOPT}, \ +- {"powerpc64", MASK_POWERPC64}, \ +- {"no-powerpc64", - MASK_POWERPC64}, \ +- {"new-mnemonics", MASK_NEW_MNEMONICS}, \ +- {"old-mnemonics", -MASK_NEW_MNEMONICS}, \ ++ | MASK_PPC_GFXOPT | MASK_POWERPC64), \ ++ "Do not use PowerPC instruction set"}, \ ++ {"powerpc-gpopt", MASK_POWERPC | MASK_PPC_GPOPT, \ ++ "Use PowerPC General Purpose group optional instructions"},\ ++ {"no-powerpc-gpopt", - MASK_PPC_GPOPT, \ ++ "Don't use PowerPC General Purpose group optional instructions"},\ ++ {"powerpc-gfxopt", MASK_POWERPC | MASK_PPC_GFXOPT, \ ++ "Use PowerPC Graphics group optional instructions"},\ ++ {"no-powerpc-gfxopt", - MASK_PPC_GFXOPT, \ ++ "Don't use PowerPC Graphics group optional instructions"},\ ++ {"powerpc64", MASK_POWERPC64, \ ++ "Use PowerPC-64 instruction set"}, \ ++ {"no-powerpc64", - MASK_POWERPC64, \ ++ "Don't use PowerPC-64 instruction set"}, \ ++ {"new-mnemonics", MASK_NEW_MNEMONICS, \ ++ "Use new mnemonics for PowerPC architecture"}, \ ++ {"old-mnemonics", -MASK_NEW_MNEMONICS, \ ++ "Use old mnemonics for PowerPC architecture"}, \ + {"full-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC \ +- | MASK_MINIMAL_TOC)}, \ +- {"fp-in-toc", - MASK_NO_FP_IN_TOC}, \ +- {"no-fp-in-toc", MASK_NO_FP_IN_TOC}, \ +- {"sum-in-toc", - MASK_NO_SUM_IN_TOC}, \ +- {"no-sum-in-toc", MASK_NO_SUM_IN_TOC}, \ +- {"minimal-toc", MASK_MINIMAL_TOC}, \ +- {"minimal-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC)}, \ +- {"no-minimal-toc", - MASK_MINIMAL_TOC}, \ +- {"hard-float", - MASK_SOFT_FLOAT}, \ +- {"soft-float", MASK_SOFT_FLOAT}, \ +- {"multiple", MASK_MULTIPLE | MASK_MULTIPLE_SET}, \ +- {"no-multiple", - MASK_MULTIPLE}, \ +- {"no-multiple", MASK_MULTIPLE_SET}, \ +- {"string", MASK_STRING | MASK_STRING_SET}, \ +- {"no-string", - MASK_STRING}, \ +- {"no-string", MASK_STRING_SET}, \ +- {"update", - MASK_NO_UPDATE}, \ +- {"no-update", MASK_NO_UPDATE}, \ +- {"fused-madd", - MASK_NO_FUSED_MADD}, \ +- {"no-fused-madd", MASK_NO_FUSED_MADD}, \ ++ | MASK_MINIMAL_TOC), \ ++ "no description yet"}, \ ++ {"fp-in-toc", - MASK_NO_FP_IN_TOC, \ ++ "Place floating point constants in TOC"}, \ ++ {"no-fp-in-toc", MASK_NO_FP_IN_TOC, \ ++ "Don't place floating point constants in TOC"}, \ ++ {"sum-in-toc", - MASK_NO_SUM_IN_TOC, \ ++ "Place symbol+offset constants in TOC"}, \ ++ {"no-sum-in-toc", MASK_NO_SUM_IN_TOC, \ ++ "Don't place symbol+offset constants in TOC"}, \ ++ {"minimal-toc", MASK_MINIMAL_TOC, \ ++ "no description yet"}, \ ++ {"minimal-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC), \ ++ "no description yet"}, \ ++ {"no-minimal-toc", - MASK_MINIMAL_TOC, \ ++ "no description yet"}, \ ++ {"hard-float", - MASK_SOFT_FLOAT, \ ++ "Use hardware fp"}, \ ++ {"soft-float", MASK_SOFT_FLOAT, \ ++ "Do not use hardware fp"}, \ ++ {"multiple", MASK_MULTIPLE | MASK_MULTIPLE_SET, \ ++ "Generate load/store multiple instructions"}, \ ++ {"no-multiple", - MASK_MULTIPLE, \ ++ "Do not generate load/store multiple instructions"},\ ++ {"no-multiple", MASK_MULTIPLE_SET, \ ++ "Do not generate load/store multiple instructions"},\ ++ {"string", MASK_STRING | MASK_STRING_SET, \ ++ "Generate string instructions for block moves"},\ ++ {"no-string", - MASK_STRING, \ ++ "Do not generate string instructions for block moves"},\ ++ {"no-string", MASK_STRING_SET, \ ++ "Do not generate string instructions for block moves"},\ ++ {"update", - MASK_NO_UPDATE, \ ++ "Generate load/store with update instructions"},\ ++ {"no-update", MASK_NO_UPDATE, \ ++ "Do not generate load/store with update instructions"},\ ++ {"fused-madd", - MASK_NO_FUSED_MADD, \ ++ "Generate fused multiply/add instructions"}, \ ++ {"no-fused-madd", MASK_NO_FUSED_MADD, \ ++ "Don't generate fused multiply/add instructions"},\ + SUBTARGET_SWITCHES \ +- {"", TARGET_DEFAULT}} ++ {"", TARGET_DEFAULT, \ ++ ""}} + + #define TARGET_DEFAULT (MASK_POWER | MASK_MULTIPLE | MASK_STRING) + +@@ -449,13 +484,13 @@ extern enum processor_type rs6000_cpu; + #define SUBTARGET_OPTIONS + #endif + +-#define TARGET_OPTIONS \ +-{ \ +- {"cpu=", &rs6000_select[1].string}, \ +- {"tune=", &rs6000_select[2].string}, \ +- {"debug-", &rs6000_debug_name}, \ +- {"debug=", &rs6000_debug_name}, \ +- SUBTARGET_OPTIONS \ ++#define TARGET_OPTIONS \ ++{ \ ++ {"cpu=", &rs6000_select[1].string, "Use features of and schedule code for given CPU" },\ ++ {"tune=", &rs6000_select[2].string, "Schedule code for given CPU" }, \ ++ {"debug-", &rs6000_debug_name, "Enable debug output" }, \ ++ {"debug=", &rs6000_debug_name, "Enable debug output" }, \ ++ SUBTARGET_OPTIONS \ + } + + /* rs6000_select[0] is reserved for the default cpu defined via --with-cpu */ +@@ -1436,7 +1471,7 @@ extern int rs6000_sysv_varargs_p; + have prototype types for. + + For ABI_V4, we treat these slightly differently -- `sysv_gregno' is +- the next availible GP register, `fregno' is the next available FP ++ the next available GP register, `fregno' is the next available FP + register, and `words' is the number of words used on the stack. + + The varargs/stdarg support requires that this structure's size +@@ -1713,14 +1748,11 @@ typedef struct rs6000_args + /* The current return address is in link register (65). The return address + of anything farther back is accessed normally at an offset of 8 from the + frame pointer. */ +-#define RETURN_ADDR_RTX(count, frame) \ +- ((count == -1) \ +- ? gen_rtx_REG (Pmode, 65) \ +- : gen_rtx_MEM (Pmode, \ +- memory_address (Pmode, \ +- plus_constant (copy_to_reg (gen_rtx_MEM (Pmode, \ +- memory_address (Pmode, frame))), \ +- RETURN_ADDRESS_OFFSET)))) ++#define RETURN_ADDR_RTX(COUNT, FRAME) \ ++ (rs6000_return_addr (COUNT, FRAME)) ++ ++extern struct rtx_def* rs6000_return_addr (int, struct rtx_def *rtx); ++ + + /* Definitions for register eliminations. + +@@ -3145,6 +3177,55 @@ do { \ + + #define ASM_OPEN_PAREN "(" + #define ASM_CLOSE_PAREN ")" ++ ++#define ASM_OUTPUT_DWARF_STRING(FILE,P) \ ++ do { \ ++ register int slen = strlen(P); \ ++ register char *p = (P); \ ++ register int i; \ ++ fprintf (FILE, "\t.asciz \""); \ ++ for (i = 0; i < slen; i++) \ ++ { \ ++ register int c = p[i]; \ ++ if (c == '\"' || c == '\\') \ ++ putc ('\\', FILE); \ ++ if (c >= ' ' && c < 0177) \ ++ putc (c, FILE); \ ++ else \ ++ { \ ++ fprintf (FILE, "\\%o", c); \ ++ } \ ++ } \ ++ fprintf (FILE, "\""); \ ++ } \ ++ while (0) ++ ++ ++/* We can't communicate with the epilogue directly via the eh_epilogue ++ pattern, because we need to adjust the stack pointer JUST before ++ returning. If the floating point registers are restored via a ++ function call (instead of being inlined), we can't adjust the stack ++ before the callor the floating point registers will be restored from ++ the wrong address (its based of the SP.) Control never returns ++ from these routines since the return address is adjusted such that ++ when they return, they go to the target location. We leave the stub ++ mechanism in place, let the function or FP routines return to the stub ++ and do things the normal way. We have to tell the stub mechanism ++ whiuch registers to use however, since the general mechanism ++ in eh_regs (except.c) will end up choosing r0 (which is overwritten ++ by the epilogue, and R11, which is used by the epilogue for system V ++ targets. We'll just always use R4 and R5. Thats good for all targets. */ ++ ++#define DWARF2_EH_SP_REG 4 ++#define DWARF2_EH_RA_REG 5 ++ ++ ++/* Pick up the return address upon entry to a procedure. Used for ++ dwarf2 unwind information. This also enables the table driven mechanism. */ ++ ++#define INCOMING_RETURN_ADDR_RTX gen_rtx (REG, Pmode, 65) ++#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (65) ++ + + /* Define results of standard character escape sequences. */ + #define TARGET_BELL 007 +Index: gcc/config/rs6000/rs6000.md +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.md,v +retrieving revision 1.55.4.18 +diff -u -p -r1.55.4.18 rs6000.md +--- gcc/config/rs6000/rs6000.md 2001/04/06 11:37:52 1.55.4.18 ++++ gcc/config/rs6000/rs6000.md 2001/05/01 17:11:30 +@@ -7867,7 +7867,7 @@ + + (define_insn "nonlocal_goto_receiver" + [(unspec_volatile [(const_int 0)] 1)] +- "TARGET_TOC && TARGET_MINIMAL_TOC" ++ "TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0" + "* + { + rs6000_output_load_toc_table (asm_out_file, 30); +Index: gcc/config/rs6000/sysv4.h +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/config/rs6000/sysv4.h,v +retrieving revision 1.19.4.3 +diff -u -p -r1.19.4.3 sysv4.h +--- gcc/config/rs6000/sysv4.h 2001/01/25 14:03:37 1.19.4.3 ++++ gcc/config/rs6000/sysv4.h 2001/05/01 17:11:30 +@@ -66,39 +66,39 @@ extern enum rs6000_sdata_type rs6000_sda + the same as -mminimal-toc. */ + #undef SUBTARGET_SWITCHES + #define SUBTARGET_SWITCHES \ +- { "bit-align", -MASK_NO_BITFIELD_TYPE }, \ +- { "no-bit-align", MASK_NO_BITFIELD_TYPE }, \ +- { "strict-align", MASK_STRICT_ALIGN }, \ +- { "no-strict-align", -MASK_STRICT_ALIGN }, \ +- { "relocatable", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC }, \ +- { "no-relocatable", -MASK_RELOCATABLE }, \ +- { "relocatable-lib", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC }, \ +- { "no-relocatable-lib", -MASK_RELOCATABLE }, \ +- { "little-endian", MASK_LITTLE_ENDIAN }, \ +- { "little", MASK_LITTLE_ENDIAN }, \ +- { "big-endian", -MASK_LITTLE_ENDIAN }, \ +- { "big", -MASK_LITTLE_ENDIAN }, \ +- { "no-toc", 0 }, \ +- { "toc", MASK_MINIMAL_TOC }, \ +- { "full-toc", MASK_MINIMAL_TOC }, \ +- { "prototype", MASK_PROTOTYPE }, \ +- { "no-prototype", -MASK_PROTOTYPE }, \ +- { "no-traceback", 0 }, \ +- { "eabi", MASK_EABI }, \ +- { "no-eabi", -MASK_EABI }, \ +- { "regnames", MASK_REGNAMES }, \ +- { "no-regnames", -MASK_REGNAMES }, \ +- { "sdata", 0 }, \ +- { "no-sdata", 0 }, \ +- { "sim", 0 }, \ +- { "ads", 0 }, \ +- { "yellowknife", 0 }, \ +- { "mvme", 0 }, \ +- { "emb", 0 }, \ +- { "solaris-cclib", 0 }, \ +- { "shlib", 0 }, \ +- EXTRA_SUBTARGET_SWITCHES \ +- { "newlib", 0 }, ++ { "bit-align", -MASK_NO_BITFIELD_TYPE, "Align to the base type of the bitfield." },\ ++ { "no-bit-align", MASK_NO_BITFIELD_TYPE, "Don't align to the base type of the bitfield." },\ ++ { "strict-align", MASK_STRICT_ALIGN, "Don't assume that unaligned accesses are handled by the system" },\ ++ { "no-strict-align", -MASK_STRICT_ALIGN, "Assume that unaligned accesses are handled by the system" },\ ++ { "relocatable", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, "Produce code relocatable at runtime." },\ ++ { "no-relocatable", -MASK_RELOCATABLE, "Don't produce code relocatable at runtime." },\ ++ { "relocatable-lib", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, "Produce code relocatable at runtime." },\ ++ { "no-relocatable-lib", -MASK_RELOCATABLE, "Don't produce code relocatable at runtime." },\ ++ { "little-endian", MASK_LITTLE_ENDIAN, "Produce little endian code." }, \ ++ { "little", MASK_LITTLE_ENDIAN, "Produce little endian code." }, \ ++ { "big-endian", -MASK_LITTLE_ENDIAN, "Produce big endian code." }, \ ++ { "big", -MASK_LITTLE_ENDIAN, "Produce big endian code." }, \ ++ { "no-toc", 0, "no description yet" }, \ ++ { "toc", MASK_MINIMAL_TOC, "no description yet" }, \ ++ { "full-toc", MASK_MINIMAL_TOC, "no description yet" }, \ ++ { "prototype", MASK_PROTOTYPE, "no description yet" }, \ ++ { "no-prototype", -MASK_PROTOTYPE, "no description yet" }, \ ++ { "no-traceback", 0, "no description yet" }, \ ++ { "eabi", MASK_EABI, "Use EABI." }, \ ++ { "no-eabi", -MASK_EABI, "Don't use EABI." }, \ ++ { "regnames", MASK_REGNAMES, "Use alternate register names." }, \ ++ { "no-regnames", -MASK_REGNAMES, "Don't use alternate register names." },\ ++ { "sdata", 0, "no description yet" }, \ ++ { "no-sdata", 0, "no description yet" }, \ ++ { "sim", 0, "Link with libsim.a, libc.a and sim-crt0.o." }, \ ++ { "ads", 0, "Link with libads.a, libc.a and crt0.o." }, \ ++ { "yellowknife", 0, "Link with libyk.a, libc.a and crt0.o." }, \ ++ { "mvme", 0, "Link with libmvme.a, libc.a and crt0.o." }, \ ++ { "emb", 0, "Set the PPC_EMB bit in the ELF flags header" }, \ ++ { "solaris-cclib", 0, "no description yet" }, \ ++ { "shlib", 0, "no description yet" }, \ ++ EXTRA_SUBTARGET_SWITCHES \ ++ { "newlib", 0, "no description yet" }, + + /* This is meant to be redefined in the host dependent files */ + #define EXTRA_SUBTARGET_SWITCHES +@@ -111,8 +111,8 @@ extern const char *rs6000_abi_name; + extern const char *rs6000_sdata_name; + + #define SUBTARGET_OPTIONS \ +- { "call-", &rs6000_abi_name}, \ +- { "sdata=", &rs6000_sdata_name} ++ { "call-", &rs6000_abi_name, "Select ABI calling convention." }, \ ++ { "sdata=", &rs6000_sdata_name, "Select method for sdata handling." } + + /* Max # of bytes for variables to automatically be put into the .sdata + or .sdata2 sections. */ +@@ -803,6 +803,40 @@ do { \ + fprintf (FILE, "\t.long "); \ + output_addr_const (FILE, (VALUE)); \ + fprintf (FILE, "\n"); \ ++ } \ ++} while (0) ++ ++ ++/* This is how to output an assembler line defining an address ++ constant for the dwarf call unwinding information. ++ For -mrelocatable, we mark all addresses that need to be fixed up ++ in the .fixup section. */ ++ ++extern int dwarflabelno; ++ ++#undef ASM_OUTPUT_DWARF_ADDR ++#define ASM_OUTPUT_DWARF_ADDR(FILE,LABEL) \ ++do { \ ++ if ((TARGET_RELOCATABLE || flag_pic)) \ ++ { \ ++ char buf[256], *p; \ ++ \ ++ ASM_GENERATE_INTERNAL_LABEL (buf, "LCDW", dwarflabelno++); \ ++ STRIP_NAME_ENCODING (p, buf); \ ++ fprintf (FILE, "%s:\n", p); \ ++ fprintf (FILE, "\t.4byte\t"); \ ++ assemble_name (FILE, LABEL); \ ++ fprintf (FILE, "\n"); \ ++ fprintf (FILE, "\t.section \".fixup\",\"aw\"\n"); \ ++ ASM_OUTPUT_ALIGN (FILE, 2); \ ++ fprintf (FILE, "\t.long\t%s\n", p); \ ++ fprintf (FILE, "\t.previous\n"); \ ++ } \ ++ else \ ++ { \ ++ fprintf (FILE, "\t.4byte\t"); \ ++ assemble_name (FILE, LABEL); \ ++ fprintf (FILE, "\n"); \ + } \ + } while (0) + +Index: gcc/cp/decl.c +=================================================================== +RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v +retrieving revision 1.358.4.13 +diff -u -p -r1.358.4.13 decl.c +--- gcc/cp/decl.c 2000/06/10 00:06:42 1.358.4.13 ++++ gcc/cp/decl.c 2001/05/01 17:11:32 +@@ -6473,6 +6473,9 @@ init_decl_processing () + void_type_node = make_node (VOID_TYPE); + record_builtin_type (RID_VOID, NULL_PTR, void_type_node); + layout_type (void_type_node); /* Uses integer_zero_node. */ ++ /* We are not going to have real types in C with less than byte alignment, ++ so we might as well not have any types that claim to have it. */ ++ TYPE_ALIGN (void_type_node) = BITS_PER_UNIT; + void_list_node = build_tree_list (NULL_TREE, void_type_node); + TREE_PARMLIST (void_list_node) = 1; + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/libstdc++-wstring.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/libstdc++-wstring.dpatch @@ -0,0 +1,32 @@ +#! /bin/sh -e + +# DP: enable definition of wstring type, if __ENABLE_WSTRING is defined. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- libstdc++/string~ Sat Feb 20 13:21:49 1999 ++++ libstdc++/string Sun Dec 5 16:35:27 1999 +@@ -7,7 +7,9 @@ + + extern "C++" { + typedef basic_string string; +-// typedef basic_string wstring; ++#ifdef __ENABLE_WSTRING ++typedef basic_string wstring; ++#endif + } // extern "C++" + + #endif --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-s390.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-s390.dpatch @@ -0,0 +1,14901 @@ +#! /bin/sh -e + +# DP: IBM S/390 patch + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +diff -urN --exclude=CVS gcc-2.95.3/config/mh-s390pic gcc/config/mh-s390pic +--- gcc-2.95.3/config/mh-s390pic Thu Jan 1 01:00:00 1970 ++++ gcc/config/mh-s390pic Fri Jan 28 17:52:04 2000 +@@ -0,0 +1 @@ ++PICFLAG=-fpic +diff -urN --exclude=CVS gcc-2.95.3/config/mh-s390xpic gcc/config/mh-s390xpic +--- gcc-2.95.3/config/mh-s390xpic Thu Jan 1 01:00:00 1970 ++++ gcc/config/mh-s390xpic Thu Mar 22 19:42:04 2001 +@@ -0,0 +1 @@ ++PICFLAG=-fPIC +diff -urN --exclude=CVS gcc-2.95.3/config/mt-s390pic gcc/config/mt-s390pic +--- gcc-2.95.3/config/mt-s390pic Thu Jan 1 01:00:00 1970 ++++ gcc/config/mt-s390pic Fri Jan 28 17:52:04 2000 +@@ -0,0 +1 @@ ++PICFLAG_FOR_TARGET=-fpic +diff -urN --exclude=CVS gcc-2.95.3/config/mt-s390xpic gcc/config/mt-s390xpic +--- gcc-2.95.3/config/mt-s390xpic Thu Jan 1 01:00:00 1970 ++++ gcc/config/mt-s390xpic Thu Apr 19 17:26:37 2001 +@@ -0,0 +1 @@ ++PICFLAG_FOR_TARGET=-fPIC +diff -urN --exclude=CVS gcc-2.95.3/config.guess gcc/config.guess +--- gcc-2.95.3/config.guess Wed Mar 8 05:52:57 2000 ++++ gcc/config.guess Tue Jun 12 16:22:48 2001 +@@ -690,6 +690,9 @@ + i?86) + VENDOR=pc; + ;; ++ s390*) ++ VENDOR=ibm; ++ ;; + *) + VENDOR=unknown; + ;; +diff -urN --exclude=CVS gcc-2.95.3/config.sub gcc/config.sub +--- gcc-2.95.3/config.sub Wed Aug 4 10:09:26 1999 ++++ gcc/config.sub Tue Jun 12 16:22:48 2001 +@@ -168,7 +168,7 @@ + | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | alpha | alphaev5 | alphaev56 | alphapca56 | alphaev6 \ + | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ +- | 1750a | dsp16xx | pdp11 \ ++ | 1750a | dsp16xx | pdp11 | s390 | s390x \ + | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ + | mipstx39 | mipstx39el \ + | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x) +@@ -211,7 +211,7 @@ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ +- | xmp-* | ymp-* \ ++ | xmp-* | ymp-* | s390-* | s390x-* \ + | hppa-* | hppa1.0-* | hppa1.1-* \ + | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ + | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* \ +diff -urN --exclude=CVS gcc-2.95.3/gcc/combine.c gcc/gcc/combine.c +--- gcc-2.95.3/gcc/combine.c Thu Jan 25 15:03:01 2001 ++++ gcc/gcc/combine.c Wed Jun 27 15:38:33 2001 +@@ -2034,7 +2034,8 @@ + or the only use of a pseudo, we can change its mode. */ + && (GET_MODE (*split) == GET_MODE (i2dest) + || GET_MODE (*split) == VOIDmode +- || REGNO (i2dest) < FIRST_PSEUDO_REGISTER ++ || (REGNO (i2dest) < FIRST_PSEUDO_REGISTER ++ && HARD_REGNO_MODE_OK (REGNO (i2dest), GET_MODE (*split))) + || (REG_N_SETS (REGNO (i2dest)) == 1 && ! added_sets_2 + && ! REG_USERVAR_P (i2dest))) + && (next_real_insn (i2) == i3 +@@ -6700,7 +6701,8 @@ + <= GET_MODE_BITSIZE (GET_MODE (x)) - (floor_log2 (mask) + 1)) + && GET_CODE (XEXP (x, 0)) == ASHIFT + && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT +- && INTVAL (XEXP (XEXP (x, 0), 1)) == INTVAL (XEXP (x, 1))) ++ && INTVAL (XEXP (XEXP (x, 0), 1)) == INTVAL (XEXP (x, 1)) ++ && HOST_BITS_PER_WIDE_INT >= GET_MODE_BITSIZE(mode)) + return force_to_mode (XEXP (XEXP (x, 0), 0), mode, mask, + reg, next_select); + +diff -urN --exclude=CVS gcc-2.95.3/gcc/config/s390/fixdfdi.h gcc/gcc/config/s390/fixdfdi.h +--- gcc-2.95.3/gcc/config/s390/fixdfdi.h Thu Jan 1 01:00:00 1970 ++++ gcc/gcc/config/s390/fixdfdi.h Thu Aug 16 11:58:51 2001 +@@ -0,0 +1,301 @@ ++/* Definitions of target machine for GNU compiler, for IBM S/390 ++ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. ++ Contributed by Hartmut Penner (hpenner@de.ibm.com) and ++ Ulrich Weigand (uweigand@de.ibm.com). ++ ++This file is part of GNU CC. ++ ++GNU CC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++GNU CC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GNU CC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++#ifdef L_fixunsdfdi ++#define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF) ++#define EXCESSD 1022 ++#define SIGNBIT 0x80000000 ++#define SIGND(fp) ((fp.l.upper) & SIGNBIT) ++#define MANTD_LL(fp) ((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL) ++#define FRACD_LL(fp) (fp.ll & (HIDDEND_LL-1)) ++#define HIDDEND_LL ((UDItype_x)1 << 52) ++ ++typedef int DItype_x __attribute__ ((mode (DI))); ++typedef unsigned int UDItype_x __attribute__ ((mode (DI))); ++typedef int SItype_x __attribute__ ((mode (SI))); ++typedef unsigned int USItype_x __attribute__ ((mode (SI))); ++ ++union double_long { ++ double d; ++ struct { ++ SItype_x upper; ++ USItype_x lower; ++ } l; ++ UDItype_x ll; ++}; ++ ++ ++/* convert double to unsigned int */ ++UDItype_x ++__fixunsdfdi (double a1) ++{ ++ register union double_long dl1; ++ register int exp; ++ register UDItype_x l; ++ ++ dl1.d = a1; ++ ++ /* +/- 0, denormalized, negativ */ ++ ++ if (!EXPD (dl1) || SIGND(dl1)) ++ return 0; ++ ++ exp = EXPD (dl1) - EXCESSD - 53; ++ ++ /* number < 1 */ ++ ++ if (exp < -53) ++ return 0; ++ ++ /* NaN */ ++ ++ if ((EXPD(dl1) == 0x7ff) && (FRACD_LL(dl1) != 0)) /* NaN */ ++ return 0x0ULL; ++ ++ /* Number big number & + inf */ ++ ++ if (exp >= 12) { ++ return 0xFFFFFFFFFFFFFFFFULL; ++ } ++ ++ l = MANTD_LL(dl1); ++ ++ /* shift down until exp < 12 or l = 0 */ ++ if (exp > 0) ++ l <<= exp; ++ else ++ l >>= -exp; ++ ++ return l; ++} ++#define __fixunsdfdi ___fixunsdfdi ++#endif ++#undef L_fixunsdfdi ++ ++#ifdef L_fixdfdi ++#define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF) ++#define EXCESSD 1022 ++#define SIGNBIT 0x80000000 ++#define SIGND(fp) ((fp.l.upper) & SIGNBIT) ++#define MANTD_LL(fp) ((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL) ++#define FRACD_LL(fp) (fp.ll & (HIDDEND_LL-1)) ++#define HIDDEND_LL ((UDItype_x)1 << 52) ++ ++typedef int DItype_x __attribute__ ((mode (DI))); ++typedef unsigned int UDItype_x __attribute__ ((mode (DI))); ++typedef int SItype_x __attribute__ ((mode (SI))); ++typedef unsigned int USItype_x __attribute__ ((mode (SI))); ++ ++union double_long { ++ double d; ++ struct { ++ SItype_x upper; ++ USItype_x lower; ++ } l; ++ UDItype_x ll; ++}; ++ ++/* convert double to int */ ++DItype_x ++__fixdfdi (double a1) ++{ ++ register union double_long dl1; ++ register int exp; ++ register DItype_x l; ++ ++ dl1.d = a1; ++ ++ /* +/- 0, denormalized */ ++ ++ if (!EXPD (dl1)) ++ return 0; ++ ++ exp = EXPD (dl1) - EXCESSD - 53; ++ ++ /* number < 1 */ ++ ++ if (exp < -53) ++ return 0; ++ ++ /* NaN */ ++ ++ if ((EXPD(dl1) == 0x7ff) && (FRACD_LL(dl1) != 0)) /* NaN */ ++ return 0x8000000000000000ULL; ++ ++ /* Number big number & +/- inf */ ++ ++ if (exp >= 11) { ++ l = (long long)1<<63; ++ if (!SIGND(dl1)) ++ l--; ++ return l; ++ } ++ ++ l = MANTD_LL(dl1); ++ ++ /* shift down until exp < 12 or l = 0 */ ++ if (exp > 0) ++ l <<= exp; ++ else ++ l >>= -exp; ++ ++ return (SIGND (dl1) ? -l : l); ++} ++#define __fixdfdi ___fixdfdi ++#endif ++#undef L_fixdfdi ++ ++#ifdef L_fixunssfdi ++#define EXP(fp) (((fp.l) >> 23) & 0xFF) ++#define EXCESS 126 ++#define SIGNBIT 0x80000000 ++#define SIGN(fp) ((fp.l) & SIGNBIT) ++#define HIDDEN (1 << 23) ++#define MANT(fp) (((fp.l) & 0x7FFFFF) | HIDDEN) ++#define FRAC(fp) ((fp.l) & 0x7FFFFF) ++ ++typedef int DItype_x __attribute__ ((mode (DI))); ++typedef unsigned int UDItype_x __attribute__ ((mode (DI))); ++typedef int SItype_x __attribute__ ((mode (SI))); ++typedef unsigned int USItype_x __attribute__ ((mode (SI))); ++ ++union float_long ++ { ++ float f; ++ USItype_x l; ++ }; ++ ++/* convert float to unsigned int */ ++UDItype_x ++__fixunssfdi (float a1) ++{ ++ register union float_long fl1; ++ register int exp; ++ register UDItype_x l; ++ ++ fl1.f = a1; ++ ++ /* +/- 0, denormalized, negativ */ ++ ++ if (!EXP (fl1) || SIGN(fl1)) ++ return 0; ++ ++ exp = EXP (fl1) - EXCESS - 24; ++ ++ /* number < 1 */ ++ ++ if (exp < -24) ++ return 0; ++ ++ /* NaN */ ++ ++ if ((EXP(fl1) == 0xff) && (FRAC(fl1) != 0)) /* NaN */ ++ return 0x0ULL; ++ ++ /* Number big number & + inf */ ++ ++ if (exp >= 41) { ++ return 0xFFFFFFFFFFFFFFFFULL; ++ } ++ ++ l = MANT(fl1); ++ ++ if (exp > 0) ++ l <<= exp; ++ else ++ l >>= -exp; ++ ++ return l; ++} ++#define __fixunssfdi ___fixunssfdi ++#endif ++#undef L_fixunssfdi ++ ++#ifdef L_fixsfdi ++#define EXP(fp) (((fp.l) >> 23) & 0xFF) ++#define EXCESS 126 ++#define SIGNBIT 0x80000000 ++#define SIGN(fp) ((fp.l) & SIGNBIT) ++#define HIDDEN (1 << 23) ++#define MANT(fp) (((fp.l) & 0x7FFFFF) | HIDDEN) ++#define FRAC(fp) ((fp.l) & 0x7FFFFF) ++ ++typedef int DItype_x __attribute__ ((mode (DI))); ++typedef unsigned int UDItype_x __attribute__ ((mode (DI))); ++typedef int SItype_x __attribute__ ((mode (SI))); ++typedef unsigned int USItype_x __attribute__ ((mode (SI))); ++ ++union float_long ++ { ++ float f; ++ USItype_x l; ++ }; ++ ++/* convert double to int */ ++DItype_x ++__fixsfdi (float a1) ++{ ++ register union float_long fl1; ++ register int exp; ++ register DItype_x l; ++ ++ fl1.f = a1; ++ ++ /* +/- 0, denormalized */ ++ ++ if (!EXP (fl1)) ++ return 0; ++ ++ exp = EXP (fl1) - EXCESS - 24; ++ ++ /* number < 1 */ ++ ++ if (exp < -24) ++ return 0; ++ ++ /* NaN */ ++ ++ if ((EXP(fl1) == 0xff) && (FRAC(fl1) != 0)) /* NaN */ ++ return 0x8000000000000000ULL; ++ ++ /* Number big number & +/- inf */ ++ ++ if (exp >= 40) { ++ l = (long long)1<<63; ++ if (!SIGN(fl1)) ++ l--; ++ return l; ++ } ++ ++ l = MANT(fl1); ++ ++ if (exp > 0) ++ l <<= exp; ++ else ++ l >>= -exp; ++ ++ return (SIGN (fl1) ? -l : l); ++} ++#define __fixsfdi ___fixsfdi ++#endif ++#undef L_fixsfdi ++ +diff -urN --exclude=CVS gcc-2.95.3/gcc/config/s390/linux.h gcc/gcc/config/s390/linux.h +--- gcc-2.95.3/gcc/config/s390/linux.h Thu Jan 1 01:00:00 1970 ++++ gcc/gcc/config/s390/linux.h Tue Jul 31 15:46:42 2001 +@@ -0,0 +1,389 @@ ++/* Definitions for Linux for S/390. ++ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. ++ Contributed by Hartmut Penner (hpenner@de.ibm.com) and ++ Ulrich Weigand (uweigand@de.ibm.com). ++ ++This file is part of GNU CC. ++ ++GNU CC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++GNU CC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GNU CC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++#ifndef _LINUX_H ++#define _LINUX_H ++ ++#define IEEE_FLOAT 1 ++#define TARGET_IBM_FLOAT 0 ++#define TARGET_IEEE_FLOAT 1 ++ ++#include /* Base s390 target machine definitions*/ ++ ++#include ++ ++#undef SIZE_TYPE /* use default */ ++ ++#undef TARGET_VERSION ++#define TARGET_VERSION fprintf (stderr, " (Linux for S/390)"); ++ ++/* Names to predefine in the preprocessor for this target machine. */ ++ ++#define CPP_PREDEFINES "-Dlinux -Asystem(linux) -Acpu(s390) -Amachine(s390) -D__s390__ -Asystem(unix) -Dunix -D__ELF__" ++ ++/* ++ * Caller save not (always) working in gcc-2.95.2 ++ */ ++ ++#undef CC1_SPEC ++#define CC1_SPEC "-fno-caller-saves" ++#define CC1PLUS_SPEC "-fno-caller-saves" ++ ++#undef LINK_SPEC ++#ifdef CROSS_COMPILE ++#define LINK_SPEC "-m elf_s390 %{shared:-shared} \ ++ %{!shared: \ ++ %{!ibcs: \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1 \ ++ -rpath-link=/usr/local/s390-ibm-linux/lib}} \ ++ %{static:-static}}}" ++#else ++#define LINK_SPEC "-m elf_s390 %{shared:-shared} \ ++ %{!shared: \ ++ %{!ibcs: \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ ++ %{static:-static}}}" ++#endif ++ ++/* Need to define this. Otherwise define to BITS_PER_WORD in cexp.c. ++ But BITS_PER_WORD depends on target flags, which are not defined in ++ cexpc.c. */ ++ ++#undef WCHAR_TYPE ++#define WCHAR_TYPE "int" ++#undef WCHAR_TYPE_SIZE ++#define WCHAR_TYPE_SIZE 32 ++#define MAX_LONG_TYPE_SIZE 64 ++ ++/* Character to start a comment. */ ++ ++#define ASM_COMMENT_START "#" ++ ++ ++/* Assembler pseudos to introduce constants of various size. */ ++ ++#define ASM_SHORT "\t.word" ++#define ASM_LONG "\t.long" ++#define ASM_QUAD "\t.quad" ++#define ASM_DOUBLE "\t.double" ++ ++ ++/* Prefix for internally generated assembler labels. */ ++#define LPREFIX ".L" ++ ++#define ASM_OUTPUT_LABELREF(FILE, NAME) \ ++ fprintf (FILE, "%s", NAME); ++ ++ ++/* This is how to output the definition of a user-level label named NAME, ++ such as the label on a static function or variable NAME. */ ++ ++#undef ASM_OUTPUT_LABEL ++#define ASM_OUTPUT_LABEL(FILE, NAME) \ ++ (assemble_name (FILE, NAME), fputs (":\n", FILE)) ++ ++/* This is how to output an assembler line defining a `double' constant. */ ++ ++ ++/* This is how to output an assembler line defining a `double' constant. */ ++ ++#undef ASM_OUTPUT_DOUBLE ++#define ASM_OUTPUT_DOUBLE(FILE, VALUE) \ ++ { \ ++ long t[2]; \ ++ REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), t); \ ++ fprintf (FILE, "\t.long 0x%lx\n\t.long 0x%lx\n", \ ++ t[0] & 0xffffffff, t[1] & 0xffffffff); \ ++ } ++ ++/* This is how to output an assembler line defining a `float' constant. */ ++ ++#undef ASM_OUTPUT_FLOAT ++#define ASM_OUTPUT_FLOAT(FILE, VALUE) \ ++ { \ ++ long t; \ ++ REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \ ++ fprintf (FILE, "\t.long 0x%lx\n", t & 0xffffffff); \ ++ } ++ ++/* Store in OUTPUT a string (made with alloca) containing ++ an assembler-name for a local static variable named NAME. ++ LABELNO is an integer which is different for each call. */ ++ ++#undef ASM_FORMAT_PRIVATE_NAME ++#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ ++( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \ ++ sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO))) ++ ++ ++#define ASM_OUTPUT_DOUBLE_INT(FILE, VALUE) \ ++do { fprintf (FILE, "%s\t", ASM_QUAD); \ ++ output_addr_const (FILE, (VALUE)); \ ++ putc ('\n',FILE); \ ++ } while (0) ++ ++ ++/* This is how to output an assembler line defining an `int' constant. */ ++ ++#undef ASM_OUTPUT_INT ++#define ASM_OUTPUT_INT(FILE, VALUE) \ ++do { fprintf (FILE, "%s\t", ASM_LONG); \ ++ output_addr_const (FILE, (VALUE)); \ ++ putc ('\n',FILE); \ ++ } while (0) ++ ++/* Likewise for `char' and `short' constants. ++ is this supposed to do align too?? */ ++ ++#define ASM_OUTPUT_SHORT(FILE, VALUE) \ ++( fprintf (FILE, "%s ", ASM_SHORT), \ ++ output_addr_const (FILE, (VALUE)), \ ++ putc ('\n',FILE)) ++ ++#define ASM_OUTPUT_CHAR(FILE, VALUE) \ ++( fprintf (FILE, "%s ", ASM_BYTE_OP), \ ++ output_addr_const (FILE, (VALUE)), \ ++ putc ('\n', FILE)) ++ ++/* This is how to output an assembler line for a numeric constant byte. */ ++ ++#define ASM_OUTPUT_BYTE(FILE, VALUE) \ ++ fprintf ((FILE), "%s 0x%x\n", ASM_BYTE_OP, (VALUE)) ++ ++ /* internal macro to output long */ ++#define _ASM_OUTPUT_LONG(FILE, VALUE) \ ++ fprintf (FILE, "\t.long\t0x%lX\n", VALUE); ++ ++ ++/* This is how to output an element of a case-vector that is absolute. */ ++ ++#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ ++ fprintf (FILE, "%s\t%s%d\n", TARGET_64BIT?ASM_QUAD:ASM_LONG, \ ++ LPREFIX, VALUE) ++ ++/* This is how to output an element of a case-vector that is relative. */ ++ ++#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ ++ fprintf (FILE, "%s\t%s%d-%s%d\n", TARGET_64BIT?ASM_QUAD:ASM_LONG, \ ++ LPREFIX, VALUE, LPREFIX, REL) ++ ++ ++/* Define the parentheses used to group arithmetic operations ++ in assembler code. */ ++ ++#undef ASM_OPEN_PAREN ++#undef ASM_CLOSE_PAREN ++#define ASM_OPEN_PAREN "" ++#define ASM_CLOSE_PAREN "" ++ ++ ++ ++/* This is how to output an assembler line ++ that says to advance the location counter ++ to a multiple of 2**LOG bytes. */ ++ ++#define ASM_OUTPUT_ALIGN(FILE, LOG) \ ++ if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG)) ++ ++/* This is how to output an assembler line ++ that says to advance the location counter by SIZE bytes. */ ++ ++#undef ASM_OUTPUT_SKIP ++#define ASM_OUTPUT_SKIP(FILE, SIZE) \ ++ fprintf ((FILE), "\t.set .,.+%u\n", (SIZE)) ++ ++/* This is how to output an assembler line ++ that says to advance the location counter ++ to a multiple of 2**LOG bytes. */ ++ ++#define ASM_OUTPUT_ALIGN(FILE, LOG) \ ++ if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG)) ++ ++/* This is how to output an assembler line ++ that says to advance the location counter by SIZE bytes. */ ++ ++#define ASM_OUTPUT_SKIP(FILE, SIZE) \ ++ fprintf ((FILE), "\t.set .,.+%u\n", (SIZE)) ++ ++/* The routine used to output sequences of byte values. We use a special ++ version of this for most svr4 targets because doing so makes the ++ generated assembly code more compact (and thus faster to assemble) ++ as well as more readable. Note that if we find subparts of the ++ character sequence which end with NUL (and which are shorter than ++ STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */ ++ ++#undef ASM_OUTPUT_ASCII ++#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \ ++do { \ ++ register unsigned char *_ascii_bytes = (unsigned char *) (STR); \ ++ register unsigned char *limit = _ascii_bytes + (LENGTH); \ ++ register unsigned bytes_in_chunk = 0; \ ++ for (; _ascii_bytes < limit; _ascii_bytes++) \ ++ { \ ++ register unsigned char *p; \ ++ if (bytes_in_chunk >= 64) \ ++ { \ ++ fputc ('\n', (FILE)); \ ++ bytes_in_chunk = 0; \ ++ } \ ++ for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \ ++ continue; \ ++ if (p < limit && (p - _ascii_bytes) <= STRING_LIMIT) \ ++ { \ ++ if (bytes_in_chunk > 0) \ ++ { \ ++ fputc ('\n', (FILE)); \ ++ bytes_in_chunk = 0; \ ++ } \ ++ ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \ ++ _ascii_bytes = p; \ ++ } \ ++ else \ ++ { \ ++ if (bytes_in_chunk == 0) \ ++ fprintf ((FILE), "%s\t", ASM_BYTE_OP); \ ++ else \ ++ fputc (',', (FILE)); \ ++ fprintf ((FILE), "0x%02x", *_ascii_bytes); \ ++ bytes_in_chunk += 5; \ ++ } \ ++ } \ ++ if (bytes_in_chunk > 0) \ ++ fprintf ((FILE), "\n"); \ ++} while (0) ++ ++/* Output before read-only data. */ ++ ++#define TEXT_SECTION_ASM_OP ".text" ++ ++/* Output before writable (initialized) data. */ ++ ++#define DATA_SECTION_ASM_OP ".data" ++ ++/* Output before writable (uninitialized) data. */ ++ ++#define BSS_SECTION_ASM_OP ".bss" ++ ++/* This is how to output a command to make the user-level label named NAME ++ defined for reference from other files. */ ++ ++#define ASM_GLOBALIZE_LABEL(FILE, NAME) \ ++ (fputs (".globl ", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE)) ++ ++#define DBX_REGISTER_NUMBER(REGNO) (REGNO) ++ ++/* ++ * This macro generates the assembly code for function entry. ++ */ ++ ++#define FUNCTION_PROLOGUE(FILE, LSIZE) s390_function_prologue (FILE, LSIZE) ++ ++/* This macro generates the assembly code for function exit, on machines ++ that need it. If FUNCTION_EPILOGUE is not defined then individual ++ return instructions are generated for each return statement. Args are ++ same as for FUNCTION_PROLOGUE. ++ ++ The function epilogue should not depend on the current stack pointer! ++ It should use the frame pointer only. This is mandatory because ++ of alloca; we also take advantage of it to omit stack adjustments ++ before returning. */ ++ ++#define FUNCTION_EPILOGUE(FILE, LSIZE) s390_function_epilogue(FILE, LSIZE) ++ ++/* Select section for constant in constant pool. ++ We are in the right section. ++ undef for 64 bit mode (linux64.h). ++ */ ++ ++#undef SELECT_RTX_SECTION ++#define SELECT_RTX_SECTION(MODE, X) ++ ++ ++/* Output code to add DELTA to the first argument, and then jump to FUNCTION. ++ Used for C++ multiple inheritance. */ ++#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ ++do { \ ++ if (TARGET_64BIT) \ ++ { \ ++ if (flag_pic) \ ++ { \ ++ fprintf (FILE, "\tlarl 1,0f\n"); \ ++ fprintf (FILE, "\tagf %d,0(1)\n", \ ++ aggregate_value_p (TREE_TYPE \ ++ (TREE_TYPE (FUNCTION))) ? 3 :2 ); \ ++ fprintf (FILE, "\tlarl 1,"); \ ++ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \ ++ fprintf (FILE, "@GOTENT\n"); \ ++ fprintf (FILE, "\tlg 1,0(1)\n"); \ ++ fprintf (FILE, "\tbr 1\n"); \ ++ fprintf (FILE, "0:\t.long %d\n",DELTA); \ ++ } \ ++ else \ ++ { \ ++ fprintf (FILE, "\tlarl 1,0f\n"); \ ++ fprintf (FILE, "\tagf %d,0(1)\n", \ ++ aggregate_value_p (TREE_TYPE \ ++ (TREE_TYPE (FUNCTION))) ? 3 :2 ); \ ++ fprintf (FILE, "\tjg "); \ ++ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \ ++ fprintf (FILE, "\n"); \ ++ fprintf (FILE, "0:\t.long %d\n",DELTA); \ ++ } \ ++ } \ ++ else \ ++ { \ ++ if (flag_pic) \ ++ { \ ++ fprintf (FILE, "\tbras 1,0f\n"); \ ++ fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_-.\n"); \ ++ fprintf (FILE, "\t.long "); \ ++ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \ ++ fprintf (FILE, "@GOT\n"); \ ++ fprintf (FILE, "\t.long %d\n",DELTA); \ ++ fprintf (FILE, "0:\tal %d,8(1)\n", \ ++ aggregate_value_p (TREE_TYPE \ ++ (TREE_TYPE (FUNCTION))) ? 3 : 2 ); \ ++ fprintf (FILE, "\tl 0,4(1)\n"); \ ++ fprintf (FILE, "\tal 1,0(1)\n"); \ ++ fprintf (FILE, "\talr 1,0\n"); \ ++ fprintf (FILE, "\tl 1,0(1)\n"); \ ++ fprintf (FILE, "\tbr 1\n"); \ ++ } else { \ ++ fprintf (FILE, "\tbras 1,0f\n"); \ ++ fprintf (FILE, "\t.long "); \ ++ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \ ++ fprintf (FILE, "-.\n"); \ ++ fprintf (FILE, "\t.long %d\n",DELTA); \ ++ fprintf (FILE, "0:\tal %d,4(1)\n", \ ++ aggregate_value_p (TREE_TYPE \ ++ (TREE_TYPE (FUNCTION))) ? 3 : 2 ); \ ++ fprintf (FILE, "\tal 1,0(1)\n"); \ ++ fprintf (FILE, "\tbr 1\n"); \ ++ } \ ++ } \ ++} while (0) ++ ++#endif +diff -urN --exclude=CVS gcc-2.95.3/gcc/config/s390/linux64.h gcc/gcc/config/s390/linux64.h +--- gcc-2.95.3/gcc/config/s390/linux64.h Thu Jan 1 01:00:00 1970 ++++ gcc/gcc/config/s390/linux64.h Thu Aug 16 11:59:28 2001 +@@ -0,0 +1,82 @@ ++/* Definitions for Linux for S/390 64bit. ++ Copyright (C) 2000 Free Software Foundation, Inc. ++ Contributed by Hartmut Penner ++ ++This file is part of GNU CC. ++ ++GNU CC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++GNU CC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GNU CC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++#ifndef _LINUX64_H ++#define _LINUX64_H ++ ++#include /* Base linux target machine definitions*/ ++ ++#undef PTRDIFF_TYPE ++#define PTRDIFF_TYPE "long int" ++ ++#undef TARGET_DEFAULT ++#define TARGET_DEFAULT 0x13 ++ ++#undef TARGET_VERSION ++#define TARGET_VERSION fprintf (stderr, " (Linux for S/390 zSeries 64 bit)"); ++ ++/* Names to predefine in the preprocessor for this target machine. */ ++ ++#undef CPP_PREDEFINES ++#define CPP_PREDEFINES "-Dlinux -Asystem(linux) -Acpu(s390) -Amachine(s390) -D__s390__ -D__s390x__ -Asystem(unix) -Dunix -D__ELF__" ++ ++ ++#undef LINK_SPEC ++#ifdef CROSS_COMPILE ++#define LINK_SPEC "-m elf64_s390 %{shared:-shared} \ ++ %{!shared: \ ++ %{!ibcs: \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld64.so.1 \ ++ -rpath-link=/usr/local/s390x-ibm-linux/lib}} \ ++ %{static:-static}}}" ++#else ++#define LINK_SPEC "-m elf64_s390 %{shared:-shared} \ ++ %{!shared: \ ++ %{!ibcs: \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld64.so.1}} \ ++ %{static:-static}}}" ++#endif ++ ++#undef INT_ASM_OP ++#define INT_ASM_OP "\t.quad\t" ++ ++#undef PROMOTE_PROTOTYPES ++#undef MASK_RETURN_ADDR ++#undef SELECT_SECTION ++ ++/* With 64 bit new linkage for floating point registers. */ ++#undef CALL_USED_REGISTERS ++#define CALL_USED_REGISTERS \ ++{ 1, 1, 1, 1, \ ++ 1, 1, 0, 0, \ ++ 0, 0, 0, 0, \ ++ 0, 1, 1, 1, \ ++ 1, 1, 1, 1, \ ++ 1, 1, 1, 1, \ ++ 0, 0, 0, 0, \ ++ 0, 0, 0, 0, \ ++ 1, 1 } ++ ++#endif +diff -urN --exclude=CVS gcc-2.95.3/gcc/config/s390/s390-295-64.h gcc/gcc/config/s390/s390-295-64.h +--- gcc-2.95.3/gcc/config/s390/s390-295-64.h Thu Jan 1 01:00:00 1970 ++++ gcc/gcc/config/s390/s390-295-64.h Thu Feb 8 18:50:33 2001 +@@ -0,0 +1,7 @@ ++#ifndef _S390_295_64_H ++#define _S390_295_64_H ++ ++#include "s390/s390-295.h" ++#include "s390/linux64.h" ++ ++#endif +diff -urN --exclude=CVS gcc-2.95.3/gcc/config/s390/s390-295.h gcc/gcc/config/s390/s390-295.h +--- gcc-2.95.3/gcc/config/s390/s390-295.h Thu Jan 1 01:00:00 1970 ++++ gcc/gcc/config/s390/s390-295.h Fri Jul 6 14:38:53 2001 +@@ -0,0 +1,68 @@ ++#ifndef _S390_295_H ++#define _S390_295_H ++ ++#define __V2_95__ ++ ++#include "s390/linux.h" ++ ++#undef CC1_SPEC ++#define CC1_SPEC "-fno-caller-saves" ++#define CC1PLUS_SPEC "-fno-caller-saves" ++ ++#undef REGISTER_MOVE_COST ++/* On s390, copy between fprs and gprs is expensive. */ ++ ++#define REGISTER_MOVE_COST(CLASS1, CLASS2) \ ++ (((CLASS1 != CLASS2) && \ ++ (CLASS1 == FP_REGS || CLASS2 == FP_REGS)) ? 10 : 1) ++ ++ ++/* Generate necessary RTL for __builtin_saveregs(). ++ ARGLIST is the argument list; see expr.c. */ ++ ++ ++extern struct rtx_def *s390_builtin_saveregs (); ++#define EXPAND_BUILTIN_SAVEREGS(ARGLIST) s390_builtin_saveregs (ARGLIST) ++ ++#define INSN_ADDRESSES(ID) insn_addresses[ID] ++#define INSN_ADDRESSES_NEW(ID,I) ID ++#define va_list_type_node ptr_type_node ++#define get_varargs_alias_set() NULL ++ ++/* Use SELECT_SECTION from gcc 3.0 to fix readonly bug */ ++ ++#undef SELECT_SECTION ++#define SELECT_SECTION(DECL, RELOC) \ ++{ \ ++ if (TREE_CODE (DECL) == STRING_CST) \ ++ { \ ++ if (! flag_writable_strings) \ ++ const_section (); \ ++ else \ ++ data_section (); \ ++ } \ ++ else if (TREE_CODE (DECL) == VAR_DECL) \ ++ { \ ++ if ((flag_pic && RELOC) \ ++ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ ++ || !DECL_INITIAL (DECL) \ ++ || (DECL_INITIAL (DECL) != error_mark_node \ ++ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \ ++ data_section (); \ ++ else \ ++ const_section (); \ ++ } \ ++ else if (TREE_CODE (DECL) == CONSTRUCTOR) \ ++ { \ ++ if ((flag_pic && RELOC) \ ++ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ ++ || ! TREE_CONSTANT (DECL)) \ ++ data_section (); \ ++ else \ ++ const_section (); \ ++ } \ ++ else \ ++ const_section (); \ ++} ++ ++#endif +diff -urN --exclude=CVS gcc-2.95.3/gcc/config/s390/s390-protos.h gcc/gcc/config/s390/s390-protos.h +--- gcc-2.95.3/gcc/config/s390/s390-protos.h Thu Jan 1 01:00:00 1970 ++++ gcc/gcc/config/s390/s390-protos.h Fri Jun 22 16:08:02 2001 +@@ -0,0 +1,85 @@ ++/* Definitions of target machine for GNU compiler, for IBM S/390. ++ Copyright (C) 2000 Free Software Foundation, Inc. ++ Contributed by Hartmut Penner (hpenner@de.ibm.com) ++ ++This file is part of GNU CC. ++ ++GNU CC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++GNU CC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GNU CC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++/* Declare functions in s390.c and linux.c */ ++ ++#ifdef RTX_CODE ++ ++#ifdef TREE_CODE ++extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx, int)); ++extern void s390_va_start PARAMS ((int, tree, rtx)); ++ ++#endif /* TREE_CODE */ ++ ++extern int fp_operand PARAMS ((rtx, enum machine_mode)); ++extern int s_operand PARAMS ((rtx, enum machine_mode)); ++extern int r_or_im8_operand PARAMS ((rtx, enum machine_mode)); ++extern int r_or_s_operand PARAMS ((rtx, enum machine_mode)); ++extern int r_or_s_or_im8_operand PARAMS ((rtx, enum machine_mode)); ++extern int r_or_x_or_im16_operand PARAMS ((rtx, enum machine_mode)); ++extern int bras_sym_operand PARAMS ((rtx, enum machine_mode)); ++extern int dead_p PARAMS ((rtx, rtx)); ++extern void print_operand PARAMS ((FILE *, rtx, char)); ++extern void print_operand_address PARAMS ((FILE *, rtx)); ++extern int legitimate_pic_operand_p PARAMS ((rtx)); ++extern int legitimate_constant_p PARAMS ((rtx)); ++ ++extern int unsigned_comparison_operator PARAMS ((rtx)); ++extern int unsigned_jump_follows_p PARAMS ((rtx)); ++ ++extern void update_cc PARAMS ((rtx, rtx)); ++ ++extern void s390_initialize_trampoline PARAMS ((rtx, rtx, rtx)); ++extern void s390_output_symbolic_const PARAMS ((FILE *, rtx)); ++extern int s390_adjust_cost PARAMS ((rtx, rtx, rtx, int)); ++ ++extern int s390_stop_dump_lit_p PARAMS ((rtx)); ++extern void s390_dump_literal_pool PARAMS ((rtx, rtx)); ++extern void s390_expand_eh_epilogue PARAMS ((rtx, rtx, rtx)); ++extern void s390_asm_output_external_libcall PARAMS ((FILE *, rtx)); ++ ++#endif /* RTX_CODE */ ++ ++#ifdef TREE_CODE ++extern void s390_function_arg_advance PARAMS ((CUMULATIVE_ARGS *, ++ enum machine_mode, ++ tree, int)); ++extern struct rtx_def *s390_function_arg PARAMS ((CUMULATIVE_ARGS *, ++ enum machine_mode, tree, int)); ++extern int s390_function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *, ++ enum machine_mode, tree, int)); ++extern int s390_function_arg_pass_by_reference PARAMS ((enum machine_mode, tree)); ++extern void setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *, ++ enum machine_mode, tree, ++ int *, int)); ++extern struct rtx_def *s390_va_arg PARAMS ((tree, tree)); ++extern union tree_node *s390_build_va_list PARAMS ((void)); ++extern void s390_asm_output_pool_prologue PARAMS ((FILE *, char *, tree, int)); ++extern void encode_section_info PARAMS ((tree)); ++ ++#endif /* TREE_CODE */ ++ ++ ++extern void s390_trampoline_template PARAMS ((FILE *)); ++extern int s390_function_prologue PARAMS ((FILE *, int)); ++extern int s390_function_epilogue PARAMS ((FILE *, int)); ++extern void s390_final_chunkify PARAMS ((int)); ++extern int s390_arg_frame_offset PARAMS ((void)); +diff -urN gcc-20011006/gcc/config/s390/s390.c src-native-new/gcc/config/s390/s390.c +--- gcc-20011006/gcc/config/s390/s390.c Thu Jan 1 00:00:00 1970 ++++ src-native-new/gcc/config/s390/s390.c Tue Feb 19 05:57:15 2002 +@@ -0,0 +1,2694 @@ ++/* Subroutines used for code generation on IBM S/390 and zSeries ++ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. ++ Contributed by Hartmut Penner (hpenner@de.ibm.com) and ++ Ulrich Weigand (uweigand@de.ibm.com). ++ ++This file is part of GNU CC. ++ ++GNU CC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++GNU CC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GNU CC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++#include "config.h" ++#include "system.h" ++#include "rtl.h" ++#include "expr.h" ++#include "tree.h" ++#include "regs.h" ++#include "hard-reg-set.h" ++#include "real.h" ++#include "insn-config.h" ++#include "conditions.h" ++#include "insn-flags.h" ++#include "output.h" ++#include "insn-attr.h" ++#include "flags.h" ++#include "recog.h" ++#include "math.h" ++#include "obstack.h" ++#include "except.h" ++#include "function.h" ++#include "toplev.h" ++ ++#include "tm_p.h" ++ ++extern int reload_completed; ++ ++/* Function count for creating unique internal labels in a compile unit. */ ++int s390_function_count = 0; ++ ++/* Save information from a "cmpxx" operation until the branch or scc is ++ emitted. */ ++rtx s390_compare_op0, s390_compare_op1; ++ ++/* Return TRUE or FALSE depending on whether every SET in INSN that ++ set the CC register has source and destination with matching CC modes, ++ and that the CC mode is at least as constrained as REQ_MODE. */ ++ ++static int ++s390_match_ccmode_set (set, req_mode) ++ rtx set; ++ int req_mode; ++{ ++ int set_mode; ++ ++ if (GET_CODE (set) != SET) ++ abort (); ++ ++ if (GET_CODE (SET_DEST (set)) != REG || !CC_REGNO_P (REGNO (SET_DEST (set)))) ++ return 1; ++ ++ set_mode = GET_MODE (SET_DEST (set)); ++ switch (set_mode) ++ { ++ case CCmode: ++ return 0; ++ ++ case CCSmode: ++ if (req_mode != CCSmode) ++ return 0; ++ break; ++ case CCUmode: ++ if (req_mode != CCUmode) ++ return 0; ++ break; ++ case CCZmode: ++ if (req_mode != CCSmode && req_mode != CCUmode && req_mode != CCTmode) ++ return 0; ++ break; ++ ++ default: ++ abort (); ++ } ++ ++ return (GET_MODE (SET_SRC (set)) == set_mode); ++} ++ ++int ++s390_match_ccmode (insn, req_mode) ++ rtx insn; ++ int req_mode; ++{ ++ int i; ++ ++ if (GET_CODE (PATTERN (insn)) == SET) ++ return s390_match_ccmode_set (PATTERN (insn), req_mode); ++ ++ if (GET_CODE (PATTERN (insn)) == PARALLEL) ++ for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++) ++ { ++ rtx set = XVECEXP (PATTERN (insn), 0, i); ++ if (GET_CODE (set) == SET) ++ if (!s390_match_ccmode_set (set, req_mode)) ++ return 0; ++ } ++ ++ return 1; ++} ++ ++ ++void ++optimization_options (level, size) ++ int level; ++ int size ATTRIBUTE_UNUSED; ++{ ++#ifdef HAVE_decrement_and_branch_on_count ++ /* When optimizing, enable use of BRCT instruction. */ ++ if (level >= 1) ++ flag_branch_on_count_reg = 1; ++#endif ++} ++ ++ ++/* Map for smallest class containing reg regno. */ ++ ++enum reg_class regclass_map[FIRST_PSEUDO_REGISTER] = ++{ GENERAL_REGS, ADDR_REGS, ADDR_REGS, ADDR_REGS, ++ ADDR_REGS, ADDR_REGS, ADDR_REGS, ADDR_REGS, ++ ADDR_REGS, ADDR_REGS, ADDR_REGS, ADDR_REGS, ++ ADDR_REGS, ADDR_REGS, ADDR_REGS, ADDR_REGS, ++ FP_REGS, FP_REGS, FP_REGS, FP_REGS, ++ FP_REGS, FP_REGS, FP_REGS, FP_REGS, ++ FP_REGS, FP_REGS, FP_REGS, FP_REGS, ++ FP_REGS, FP_REGS, FP_REGS, FP_REGS, ++ ADDR_REGS, NO_REGS ++}; ++ ++ ++/* Match exactly zero. */ ++ ++int ++const0_operand (op, mode) ++ register rtx op; ++ enum machine_mode mode; ++{ ++ return op == CONST0_RTX (mode); ++} ++ ++/* Match exactly one. */ ++ ++int ++const1_operand (op, mode) ++ register rtx op; ++ enum machine_mode mode; ++{ ++ return op == CONST1_RTX (mode); ++} ++ ++ ++/* Return 1 if OP needs base and index register. */ ++ ++static int ++base_n_index_p (rtx op) ++{ ++ if ((GET_CODE (op) == PLUS) && ++ (GET_CODE (XEXP (op, 0)) == PLUS || ++ GET_CODE (XEXP (op, 1)) == PLUS || ++ GET_CODE (XEXP (op, 1)) == REG )) ++ return 1; ++ return 0; ++} ++ ++/* Check mode and mode of op, set it to mode of op, if VOIDmode. */ ++ ++static int ++check_mode (op, mode) ++ register rtx op; ++ enum machine_mode *mode; ++{ ++ if (*mode == VOIDmode) ++ *mode = GET_MODE (op); ++ else ++ { ++ if (GET_MODE (op) != VOIDmode && GET_MODE (op) != *mode) ++ return 0; ++ } ++ return 1; ++} ++ ++ ++/* Return 1 if OP a valid operand for the LARL instruction. ++ OP is the current operation. ++ MODE is the current operation mode. */ ++ ++int ++larl_operand (op, mode) ++ register rtx op; ++ enum machine_mode mode; ++{ ++ rtx sym; ++ register enum rtx_code code = GET_CODE (op); ++ ++ if (! check_mode (op, &mode)) ++ return 0; ++ ++ /* Allow labels and local symbols. */ ++ if (GET_CODE (op) == LABEL_REF) ++ return 1; ++ if (GET_CODE (op) == SYMBOL_REF ++ && (!flag_pic || SYMBOL_REF_FLAG (op) ++ || CONSTANT_POOL_ADDRESS_P (op))) ++ return 1; ++ ++ /* Everything else must have a CONST, so strip it. */ ++ if (GET_CODE (op) != CONST) ++ return 0; ++ op = XEXP (op, 0); ++ ++ /* Allow adding *even* constants. */ ++ if (GET_CODE (op) == PLUS) ++ { ++ if (GET_CODE (XEXP (op, 1)) != CONST_INT ++ || (INTVAL (XEXP (op, 1)) & 1) != 0) ++ return 0; ++ op = XEXP (op, 0); ++ } ++ ++ /* Labels and local symbols allowed here as well. */ ++ if (GET_CODE (op) == LABEL_REF) ++ return 1; ++ if (GET_CODE (op) == SYMBOL_REF ++ && (!flag_pic || SYMBOL_REF_FLAG (op) ++ || CONSTANT_POOL_ADDRESS_P (op))) ++ return 1; ++ ++ /* Now we must have a @GOTENT offset or @PLT stub. */ ++ if (GET_CODE (op) == UNSPEC ++ && XINT (op, 1) == 111) ++ return 1; ++ if (GET_CODE (op) == UNSPEC ++ && XINT (op, 1) == 113) ++ return 1; ++ ++ return 0; ++} ++ ++/* Return 1 if OP is a valid FP-Register. ++ OP is the current operation. ++ MODE is the current operation mode. */ ++ ++int ++fp_operand (op, mode) ++ register rtx op; ++ enum machine_mode mode; ++{ ++ register enum rtx_code code = GET_CODE (op); ++ if (! check_mode (op, &mode)) ++ return 0; ++ if (code == REG && REGNO_OK_FOR_FP_P (REGNO (op))) ++ return 1; ++ else ++ return 0; ++} ++ ++/* Return 1 if OP is a valid S operand for an RS, SI or SS type instruction. */ ++ ++int ++s_operand (op, mode) ++ register rtx op; ++ enum machine_mode mode; ++{ ++ register enum rtx_code code = GET_CODE (op); ++ ++ if (! check_mode (op,&mode)) ++ return 0; ++ ++ if (code == MEM) { ++ if (base_n_index_p (XEXP (op, 0))) ++ return 0; ++ } ++ ++ return memory_operand (op, mode); ++} ++ ++/* Return 1 if OP is a valid R or S operand for an RS, SI or SS type ++ instruction. */ ++ ++int ++r_or_s_operand (op, mode) ++ register rtx op; ++ enum machine_mode mode; ++{ ++ register enum rtx_code code = GET_CODE (op); ++ ++ if (!general_operand (op, mode)) ++ return 0; ++ ++ if (code == MEM) { ++ if (base_n_index_p (XEXP (op, 0))) ++ return 0; ++ else ++ return memory_operand (op, mode); ++ } ++ return register_operand (op, mode); ++} ++ ++/* Return 1 if OP is a valid R or S or immediate operand for ++ RS, SI or SS type instruction. */ ++ ++int ++r_or_s_or_im8_operand (op, mode) ++ register rtx op; ++ enum machine_mode mode; ++{ ++ register enum rtx_code code = GET_CODE (op); ++ ++ if (!general_operand (op, mode)) ++ return 0; ++ ++ if (code == MEM) { ++ if (base_n_index_p (XEXP (op, 0))) ++ return 0; ++ else ++ return memory_operand (op, mode); ++ } ++ return register_operand (op, mode) || immediate_operand (op, mode); ++} ++ ++/* Return 1 if OP is a valid R or X or 16 bit immediate operand for ++ RX, RR or RI type instruction. */ ++ ++int ++r_or_x_or_im16_operand (op, mode) ++ register rtx op; ++ enum machine_mode mode; ++{ ++ ++ if (! general_operand (op, mode)) ++ return 0; ++ ++ if (GET_CODE (op) == CONST_INT) ++ return (CONST_OK_FOR_LETTER_P (INTVAL (op), 'K')); ++ return register_operand (op, mode) || memory_operand (op, mode); ++} ++ ++/* Return 1 if OP is a valid R or 8 bit immediate operand for ++ !!!!!!! type instruction. */ ++ ++int ++r_or_im8_operand (op, mode) ++ register rtx op; ++ enum machine_mode mode; ++{ ++ ++ if (!general_operand (op, mode)) ++ return 0; ++ ++ if (GET_CODE (op) == CONST_INT) ++ return (CONST_OK_FOR_LETTER_P (INTVAL (op), 'J')); ++ return register_operand (op, mode) || memory_operand (op, mode); ++} ++ ++/* Return 1 if OP is a valid operand for the 'test under mask' ++ instruction with 16 bit immediate. ++ The value should only have set bits in one halfword. */ ++ ++int ++tmxx_operand (op, mode) ++ register rtx op; ++ enum machine_mode mode; ++{ ++ rtx con; ++ if (GET_CODE (op) == CONST_INT) ++ return (CONST_OK_FOR_LETTER_P (INTVAL (op), 'L')); ++ if (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == SYMBOL_REF && ++ CONSTANT_POOL_ADDRESS_P (XEXP (op, 0))) ++ { ++ con = get_pool_constant (XEXP (op, 0)); ++ ++ if (GET_CODE (con) == CONST_INT) ++ { ++ unsigned HOST_WIDEST_INT c; ++ ++ c = (unsigned HOST_WIDEST_INT) INTVAL (con); ++ ++ return ((c & 0xffff) ? ((c & 0xffffffffffff0000ULL)==0) : ++ (c & 0xffff0000) ? ((c & 0xffffffff0000ffffULL)==0) : ++ (c & 0xffff00000000ULL) ? ((c & 0xffff0000ffffffffULL)==0) : ++ (c & 0xffff000000000000ULL) ? ((c & 0xffffffffffffULL)==0) : 1); ++ ++ } ++ } ++ return 0; ++} ++ ++ ++/* Return 1 if valid operand for BRAS ++ OP is the current operation. ++ MODE is the current operation mode. */ ++ ++int ++bras_sym_operand (op, mode) ++ register rtx op; ++ enum machine_mode mode; ++{ ++ register enum rtx_code code = GET_CODE (op); ++ ++ /* Allow SYMBOL_REFs. */ ++ if (code == SYMBOL_REF) ++ return 1; ++ ++ /* Allow @PLT stubs. */ ++ if (code == CONST ++ && GET_CODE (XEXP (op, 0)) == UNSPEC ++ && XINT (XEXP (op, 0), 1) == 113) ++ return 1; ++ return 0; ++} ++ ++ ++/* Return 1 if OP is a load multiple operation. It is known to be a ++ PARALLEL and the first section will be tested. */ ++ ++int ++load_multiple_operation (op, mode) ++ rtx op; ++ enum machine_mode mode ATTRIBUTE_UNUSED; ++{ ++ int count = XVECLEN (op, 0); ++ unsigned int dest_regno; ++ rtx src_addr; ++ int i; ++ ++ ++ /* Perform a quick check so we don't blow up below. */ ++ if (count <= 1 ++ || GET_CODE (XVECEXP (op, 0, 0)) != SET ++ || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG ++ || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != MEM) ++ return 0; ++ ++ dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0))); ++ src_addr = XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0); ++ ++ for (i = 1; i < count; i++) ++ { ++ rtx elt = XVECEXP (op, 0, i); ++ ++ if (GET_CODE (elt) != SET ++ || GET_CODE (SET_DEST (elt)) != REG ++ || GET_MODE (SET_DEST (elt)) != Pmode ++ || REGNO (SET_DEST (elt)) != dest_regno + i ++ || GET_CODE (SET_SRC (elt)) != MEM ++ || GET_MODE (SET_SRC (elt)) != Pmode ++ || GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS ++ || ! rtx_equal_p (XEXP (XEXP (SET_SRC (elt), 0), 0), src_addr) ++ || GET_CODE (XEXP (XEXP (SET_SRC (elt), 0), 1)) != CONST_INT ++ || INTVAL (XEXP (XEXP (SET_SRC (elt), 0), 1)) != i * 4) ++ return 0; ++ } ++ ++ return 1; ++} ++ ++/* Similar, but tests for store multiple. */ ++ ++int ++store_multiple_operation (op, mode) ++ rtx op; ++ enum machine_mode mode ATTRIBUTE_UNUSED; ++{ ++ int count = XVECLEN (op, 0) - 1; ++ unsigned int src_regno; ++ rtx dest_addr; ++ int i; ++ ++ /* Perform a quick check so we don't blow up below. */ ++ if (count <= 1 ++ || GET_CODE (XVECEXP (op, 0, 0)) != SET ++ || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != MEM ++ || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != REG) ++ return 0; ++ ++ src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0))); ++ dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, 0)), 0); ++ ++ for (i = 1; i < count; i++) ++ { ++ rtx elt = XVECEXP (op, 0, i); ++ ++ if (GET_CODE (elt) != SET ++ || GET_CODE (SET_SRC (elt)) != REG ++ || GET_MODE (SET_SRC (elt)) != Pmode ++ || REGNO (SET_SRC (elt)) != src_regno + i ++ || GET_CODE (SET_DEST (elt)) != MEM ++ || GET_MODE (SET_DEST (elt)) != Pmode ++ || GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS ++ || ! rtx_equal_p (XEXP (XEXP (SET_DEST (elt), 0), 0), dest_addr) ++ || GET_CODE (XEXP (XEXP (SET_DEST (elt), 0), 1)) != CONST_INT ++ || INTVAL (XEXP (XEXP (SET_DEST (elt), 0), 1)) != i * 4) ++ return 0; ++ } ++ return 1; ++} ++ ++ ++/* Returns 1 if OP contains a symbol reference */ ++ ++int ++symbolic_reference_mentioned_p (op) ++ rtx op; ++{ ++ register char *fmt; ++ register int i; ++ ++ if (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF) ++ return 1; ++ ++ fmt = GET_RTX_FORMAT (GET_CODE (op)); ++ for (i = GET_RTX_LENGTH (GET_CODE (op)) - 1; i >= 0; i--) ++ { ++ if (fmt[i] == 'E') ++ { ++ register int j; ++ ++ for (j = XVECLEN (op, i) - 1; j >= 0; j--) ++ if (symbolic_reference_mentioned_p (XVECEXP (op, i, j))) ++ return 1; ++ } ++ ++ else if (fmt[i] == 'e' && symbolic_reference_mentioned_p (XEXP (op, i))) ++ return 1; ++ } ++ ++ return 0; ++} ++ ++ ++int ++legitimate_pic_operand_p (op) ++ register rtx op; ++{ ++ /* All non-symbolic constants that made it ++ up to here are fine. */ ++ if (!SYMBOLIC_CONST (op)) ++ return 1; ++ ++ /* Accept immediate LARL operands. */ ++ if (TARGET_64BIT) ++ return larl_operand (op, VOIDmode); ++ ++ /* Reject everything else; must be handled ++ via emit_pic_move. */ ++ return 0; ++} ++ ++int ++legitimate_constant_p (op) ++ register rtx op; ++{ ++ /* Reject doubles and integers out of range. */ ++ if (GET_CODE (op) == CONST_DOUBLE || ++ (GET_CODE (op) == CONST_INT && ++ (INTVAL (op) < -32768 || INTVAL (op) > 32767))) ++ return 0; ++ ++ /* Accept all other non-symbolic constants. */ ++ if (!SYMBOLIC_CONST (op)) ++ return 1; ++ ++ /* In the PIC case, symbolic constants must *not* be ++ forced into the literal pool. We accept them here, ++ so that they will be handled by emit_pic_move. */ ++ if (flag_pic) ++ return 1; ++ ++ /* Even in the non-PIC case, we can accept immediate ++ LARL operands here. */ ++ if (TARGET_64BIT) ++ return larl_operand (op, VOIDmode); ++ ++ /* All remaining non-PIC symbolic constants are ++ forced into the literal pool. */ ++ return 0; ++} ++ ++ ++/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression ++ that is a valid memory address for an instruction. ++ The MODE argument is the machine mode for the MEM expression ++ that wants to use this address. ++ ++ On S/390, legitimate addresses are: ++ base l reg,(base) ++ displacement l reg,disp ++ base + displacement l reg,disp(base) ++ index + base l reg,(base,index),reg ++ (index + base) + displacement l reg,disp(base,index) ++ ++ It only recognizes address in canonical form. LEGITIMIZE_ADDRESS should ++ convert common non-canonical forms to canonical form so that they will ++ be recognized. */ ++ ++struct s390_address ++{ ++ rtx base; ++ rtx indx; ++ rtx disp; ++}; ++ ++static int ++s390_decompose_address (addr, out, strict) ++ register rtx addr; ++ struct s390_address *out; ++ int strict; ++{ ++ rtx base = NULL_RTX; ++ rtx indx = NULL_RTX; ++ rtx disp = NULL_RTX; ++ ++ /* Decompose address into base + index + displacement. */ ++ ++ if (GET_CODE (addr) == REG || GET_CODE (addr) == UNSPEC) ++ base = addr; ++ ++ else if (GET_CODE (addr) == PLUS) ++ { ++ rtx op0 = XEXP (addr, 0); ++ rtx op1 = XEXP (addr, 1); ++ enum rtx_code code0 = GET_CODE (op0); ++ enum rtx_code code1 = GET_CODE (op1); ++ ++ if (code0 == REG || code0 == UNSPEC) ++ { ++ if (code1 == REG || code1 == UNSPEC) ++ { ++ indx = op0; /* index + base */ ++ base = op1; ++ } ++ ++ else ++ { ++ base = op0; /* base + displacement */ ++ disp = op1; ++ } ++ } ++ ++ else if (code0 == PLUS) ++ { ++ indx = XEXP (op0, 0); /* index + base + disp */ ++ base = XEXP (op0, 1); ++ disp = op1; ++ } ++ ++ else ++ { ++ return FALSE; ++ } ++ } ++ ++ else ++ disp = addr; /* displacement */ ++ ++ ++ /* Validate base register. */ ++ if (base) ++ { ++ if (GET_CODE (base) == UNSPEC) ++ { ++ if (XVECLEN (base, 0) != 1 || XINT (base, 1) != 101) ++ return FALSE; ++ base = XVECEXP (base, 0, 0); ++ } ++ ++ if (GET_CODE (base) != REG || GET_MODE (base) != Pmode) ++ return FALSE; ++ ++ if ((strict && ! REG_OK_FOR_BASE_STRICT_P (base)) ++ || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (base))) ++ return FALSE; ++ } ++ ++ /* Validate index register. */ ++ if (indx) ++ { ++ if (GET_CODE (indx) == UNSPEC) ++ { ++ if (XVECLEN (indx, 0) != 1 || XINT (indx, 1) != 101) ++ return FALSE; ++ indx = XVECEXP (indx, 0, 0); ++ } ++ ++ if (GET_CODE (indx) != REG || GET_MODE (indx) != Pmode) ++ return FALSE; ++ ++ if ((strict && ! REG_OK_FOR_BASE_STRICT_P (indx)) ++ || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (indx))) ++ return FALSE; ++ } ++ ++ /* Validate displacement. */ ++ if (disp) ++ { ++ /* Allow integer constant in range. */ ++ if (GET_CODE (disp) == CONST_INT) ++ { ++ if (INTVAL (disp) < 0 || INTVAL (disp) >= 4096) ++ return FALSE; ++ } ++ ++ /* In the small-PIC case, the linker converts @GOT12 ++ offsets to possible displacements. */ ++ else if (GET_CODE (disp) == CONST ++ && GET_CODE (XEXP (disp, 0)) == UNSPEC ++ && XINT (XEXP (disp, 0), 1) == 110) ++ { ++ if (flag_pic != 1) ++ return FALSE; ++ } ++ ++ /* We can convert literal pool addresses to ++ displacements by basing them off the base register. */ ++ else ++ { ++ /* In some cases, we can accept an additional ++ small constant offset. Split these off here. */ ++ ++ int offset = 0; ++ ++ if (GET_CODE (disp) == CONST ++ && GET_CODE (XEXP (disp, 0)) == PLUS ++ && GET_CODE (XEXP (XEXP (disp, 0), 1)) == CONST_INT) ++ { ++ offset = INTVAL (XEXP (XEXP (disp, 0), 1)); ++ disp = XEXP (XEXP (disp, 0), 0); ++ } ++ ++ /* Now we must have a literal pool address. */ ++ if (GET_CODE (disp) != SYMBOL_REF ++ || !CONSTANT_POOL_ADDRESS_P (disp)) ++ return FALSE; ++ ++ /* In 64-bit PIC mode we cannot accept symbolic ++ constants in the constant pool. */ ++ if (TARGET_64BIT && flag_pic ++ && SYMBOLIC_CONST (get_pool_constant (disp))) ++ return FALSE; ++ ++ /* If we have an offset, make sure it does not ++ exceed the size of the constant pool entry. */ ++ if (offset && offset >= GET_MODE_SIZE (get_pool_mode (disp))) ++ return FALSE; ++ ++ /* Either base or index must be free to ++ hold the base register. */ ++ if (base && indx) ++ return FALSE; ++ ++ /* Convert the address. */ ++ if (base) ++ indx = gen_rtx_REG (Pmode, BASE_REGISTER); ++ else ++ base = gen_rtx_REG (Pmode, BASE_REGISTER); ++ ++ disp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, disp), 100); ++ disp = gen_rtx_CONST (Pmode, disp); ++ ++ if (offset) ++ disp = plus_constant (disp, offset); ++ } ++ } ++ ++ if (out) ++ { ++ out->base = base; ++ out->indx = indx; ++ out->disp = disp; ++ } ++ ++ return TRUE; ++} ++ ++int ++legitimate_address_p (mode, addr, strict) ++ enum machine_mode mode; ++ register rtx addr; ++ int strict; ++{ ++ return s390_decompose_address (addr, NULL, strict); ++} ++ ++/* Return a legitimate reference for ORIG (an address) using the ++ register REG. If REG is 0, a new pseudo is generated. ++ ++ There are two types of references that must be handled: ++ ++ 1. Global data references must load the address from the GOT, via ++ the PIC reg. An insn is emitted to do this load, and the reg is ++ returned. ++ ++ 2. Static data references, constant pool addresses, and code labels ++ compute the address as an offset from the GOT, whose base is in ++ the PIC reg. Static data objects have SYMBOL_REF_FLAG set to ++ differentiate them from global data objects. The returned ++ address is the PIC reg + an unspec constant. ++ ++ GO_IF_LEGITIMATE_ADDRESS rejects symbolic references unless the PIC ++ reg also appears in the address. */ ++ ++rtx ++legitimize_pic_address (orig, reg) ++ rtx orig; ++ rtx reg; ++{ ++ rtx addr = orig; ++ rtx new = orig; ++ rtx base; ++ ++ if (GET_CODE (addr) == LABEL_REF ++ || (GET_CODE (addr) == SYMBOL_REF ++ && (SYMBOL_REF_FLAG (addr) ++ || CONSTANT_POOL_ADDRESS_P (addr)))) ++ { ++ /* This is a local symbol. */ ++ if (TARGET_64BIT) ++ { ++ /* Access local symbols PC-relative via LARL. ++ This is the same as in the non-PIC case, so it is ++ handled automatically ... */ ++ } ++ else ++ { ++ /* Access local symbols relative to the literal pool. */ ++ ++ rtx temp = reg? reg : gen_reg_rtx (Pmode); ++ ++ addr = gen_rtx_UNSPEC (SImode, gen_rtvec (1, addr), 100); ++ addr = gen_rtx_CONST (SImode, addr); ++ addr = force_const_mem (SImode, addr); ++ emit_move_insn (temp, addr); ++ ++ base = gen_rtx_REG (Pmode, BASE_REGISTER); ++ base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base), 101); ++ new = gen_rtx_PLUS (Pmode, base, temp); ++ ++ if (reg != 0) ++ { ++ emit_move_insn (reg, new); ++ new = reg; ++ } ++ } ++ } ++ else if (GET_CODE (addr) == SYMBOL_REF) ++ { ++ if (reg == 0) ++ reg = gen_reg_rtx (Pmode); ++ ++ if (flag_pic == 1) ++ { ++ /* Assume GOT offset < 4k. This is handled the same way ++ in both 31- and 64-bit code (@GOT12). */ ++ ++ current_function_uses_pic_offset_table = 1; ++ ++ new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), 110); ++ new = gen_rtx_CONST (Pmode, new); ++ new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new); ++ new = gen_rtx_MEM (Pmode, new); ++ RTX_UNCHANGING_P (new) = 1; ++ emit_move_insn (reg, new); ++ new = reg; ++ } ++ else if (TARGET_64BIT) ++ { ++ /* If the GOT offset might be >= 4k, we determine the position ++ of the GOT entry via a PC-relative LARL (@GOTENT). */ ++ ++ rtx temp = gen_reg_rtx (Pmode); ++ ++ new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), 111); ++ new = gen_rtx_CONST (Pmode, new); ++ emit_move_insn (temp, new); ++ ++ new = gen_rtx_MEM (Pmode, temp); ++ RTX_UNCHANGING_P (new) = 1; ++ emit_move_insn (reg, new); ++ new = reg; ++ } ++ else ++ { ++ /* If the GOT offset might be >= 4k, we have to load it ++ from the literal pool (@GOT). */ ++ ++ rtx temp = gen_reg_rtx (Pmode); ++ ++ current_function_uses_pic_offset_table = 1; ++ ++ addr = gen_rtx_UNSPEC (SImode, gen_rtvec (1, addr), 112); ++ addr = gen_rtx_CONST (SImode, addr); ++ addr = force_const_mem (SImode, addr); ++ emit_move_insn (temp, addr); ++ ++ new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp); ++ new = gen_rtx_MEM (Pmode, new); ++ RTX_UNCHANGING_P (new) = 1; ++ emit_move_insn (reg, new); ++ new = reg; ++ } ++ } ++ else ++ { ++ if (GET_CODE (addr) == CONST) ++ { ++ addr = XEXP (addr, 0); ++ if (GET_CODE (addr) == UNSPEC) ++ { ++ if (XVECLEN (addr, 0) != 1) ++ abort (); ++ switch (XINT (addr, 1)) ++ { ++ /* If someone moved an @GOT or lt-relative UNSPEC ++ out of the literal pool, force them back in. */ ++ case 100: ++ case 112: ++ case 114: ++ new = force_const_mem (SImode, orig); ++ break; ++ ++ /* @GOTENT is OK as is. */ ++ case 111: ++ break; ++ ++ /* @PLT is OK as is on 64-bit, must be converted to ++ lt-relative PLT on 31-bit. */ ++ case 113: ++ if (!TARGET_64BIT) ++ { ++ rtx temp = reg? reg : gen_reg_rtx (Pmode); ++ ++ addr = XVECEXP (addr, 0, 0); ++ addr = gen_rtx_UNSPEC (SImode, gen_rtvec (1, addr), 114); ++ addr = gen_rtx_CONST (SImode, addr); ++ addr = force_const_mem (SImode, addr); ++ emit_move_insn (temp, addr); ++ ++ base = gen_rtx_REG (Pmode, BASE_REGISTER); ++ base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base), 101); ++ new = gen_rtx_PLUS (Pmode, base, temp); ++ ++ if (reg != 0) ++ { ++ emit_move_insn (reg, new); ++ new = reg; ++ } ++ } ++ break; ++ ++ /* Everything else cannot happen. */ ++ default: ++ abort (); ++ } ++ } ++ else if (GET_CODE (addr) != PLUS) ++ abort (); ++ } ++ if (GET_CODE (addr) == PLUS) ++ { ++ rtx op0 = XEXP (addr, 0), op1 = XEXP (addr, 1); ++ /* Check first to see if this is a constant offset ++ from a local symbol reference. */ ++ if ((GET_CODE (op0) == LABEL_REF ++ || (GET_CODE (op0) == SYMBOL_REF ++ && (SYMBOL_REF_FLAG (op0) ++ || CONSTANT_POOL_ADDRESS_P (op0)))) ++ && GET_CODE (op1) == CONST_INT) ++ { ++ if (TARGET_64BIT) ++ { ++ if (INTVAL (op1) & 1) ++ { ++ /* LARL can't handle odd offsets, so emit a ++ pair of LARL and LA. */ ++ rtx temp = reg? reg : gen_reg_rtx (Pmode); ++ ++ if (INTVAL (op1) < 0 || INTVAL (op1) >= 4096) ++ { ++ int even = INTVAL (op1) - 1; ++ op0 = gen_rtx_PLUS (Pmode, op0, GEN_INT (even)); ++ op1 = GEN_INT (1); ++ } ++ ++ emit_move_insn (temp, op0); ++ new = gen_rtx_PLUS (Pmode, temp, op1); ++ ++ if (reg != 0) ++ { ++ emit_move_insn (reg, new); ++ new = reg; ++ } ++ } ++ else ++ { ++ /* If the offset is even, we can just use LARL. ++ This will happen automatically. */ ++ } ++ } ++ else ++ { ++ /* Access local symbols relative to the literal pool. */ ++ ++ rtx temp = reg? reg : gen_reg_rtx (Pmode); ++ ++ addr = gen_rtx_UNSPEC (SImode, gen_rtvec (1, op0), 100); ++ addr = gen_rtx_PLUS (SImode, addr, op1); ++ addr = gen_rtx_CONST (SImode, addr); ++ addr = force_const_mem (SImode, addr); ++ emit_move_insn (temp, addr); ++ ++ base = gen_rtx_REG (Pmode, BASE_REGISTER); ++ base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base), 101); ++ new = gen_rtx_PLUS (Pmode, base, temp); ++ ++ if (reg != 0) ++ { ++ emit_move_insn (reg, new); ++ new = reg; ++ } ++ } ++ } ++ ++ /* Now, check whether it is an LT-relative symbol plus offset ++ that was pulled out of the literal pool. Force it back in. */ ++ ++ else if (GET_CODE (op0) == UNSPEC ++ && GET_CODE (op1) == CONST_INT) ++ { ++ if (XVECLEN (op0, 0) != 1) ++ abort (); ++ if (XINT (op0, 1) != 100) ++ abort (); ++ ++ new = force_const_mem (SImode, orig); ++ } ++ ++ /* Otherwise, compute the sum. */ ++ else ++ { ++ base = legitimize_pic_address (XEXP (addr, 0), reg); ++ new = legitimize_pic_address (XEXP (addr, 1), ++ base == reg ? NULL_RTX : reg); ++ if (GET_CODE (new) == CONST_INT) ++ new = plus_constant (base, INTVAL (new)); ++ else ++ { ++ if (GET_CODE (new) == PLUS && CONSTANT_P (XEXP (new, 1))) ++ { ++ base = gen_rtx_PLUS (Pmode, base, XEXP (new, 0)); ++ new = XEXP (new, 1); ++ } ++ new = gen_rtx_PLUS (Pmode, base, new); ++ } ++ ++ if (GET_CODE (new) == CONST) ++ new = XEXP (new, 0); ++ new = force_operand (new, 0); ++ } ++ } ++ } ++ return new; ++} ++ ++/* Emit insns to move operands[1] into operands[0]. */ ++ ++void ++emit_pic_move (operands, mode) ++ rtx *operands; ++ enum machine_mode mode ATTRIBUTE_UNUSED; ++{ ++ rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode); ++ ++ if (GET_CODE (operands[0]) == MEM && SYMBOLIC_CONST (operands[1])) ++ operands[1] = force_reg (Pmode, operands[1]); ++ else ++ operands[1] = legitimize_pic_address (operands[1], temp); ++} ++ ++/* Try machine-dependent ways of modifying an illegitimate address ++ to be legitimate. If we find one, return the new, valid address. ++ This macro is used in only one place: `memory_address' in explow.c. ++ ++ OLDX is the address as it was before break_out_memory_refs was called. ++ In some cases it is useful to look at this to decide what needs to be done. ++ ++ MODE and WIN are passed so that this macro can use ++ GO_IF_LEGITIMATE_ADDRESS. ++ ++ It is always safe for this macro to do nothing. It exists to recognize ++ opportunities to optimize the output. ++ ++ When -fpic is used, special handling is needed for symbolic references. ++ See comments by legitimize_pic_address for details. */ ++ ++rtx ++legitimize_address (x, oldx, mode) ++ register rtx x; ++ register rtx oldx ATTRIBUTE_UNUSED; ++ enum machine_mode mode; ++{ ++ if (flag_pic && SYMBOLIC_CONST (x)) ++ return legitimize_pic_address (x, 0); ++ ++ return x; ++} ++ ++ ++/* Output branch conditions. */ ++ ++static void ++output_branch_condition (FILE *file, rtx code) ++{ ++ switch (GET_CODE (code)) ++ { ++ case EQ: ++ fprintf (file, "e"); ++ break; ++ case NE: ++ fprintf (file, "ne"); ++ break; ++ case GT: ++ case GTU: ++ fprintf (file, "h"); ++ break; ++ case LT: ++ case LTU: ++ fprintf (file, "l"); ++ break; ++ case GE: ++ case GEU: ++ fprintf (file, "he"); ++ break; ++ case LE: ++ case LEU: ++ fprintf (file, "le"); ++ break; ++ default: ++ fatal_insn ("Unknown CC code", code); ++ } ++} ++ ++static void ++output_inverse_branch_condition (FILE *file, rtx code) ++{ ++ switch (GET_CODE (code)) ++ { ++ case EQ: ++ fprintf (file, "ne"); ++ break; ++ case NE: ++ fprintf (file, "e"); ++ break; ++ case GT: ++ case GTU: ++ fprintf (file, "nh"); ++ break; ++ case LT: ++ case LTU: ++ fprintf (file, "nl"); ++ break; ++ case GE: ++ case GEU: ++ fprintf (file, "nhe"); ++ break; ++ case LE: ++ case LEU: ++ fprintf (file, "nle"); ++ break; ++ default: ++ fatal_insn ("Unknown CC code", code); ++ } ++} ++ ++/* Output a symbolic constant. */ ++ ++void ++s390_output_symbolic_const (FILE *file, rtx x) ++{ ++ switch (GET_CODE (x)) ++ { ++ case CONST: ++ case ZERO_EXTEND: ++ case SIGN_EXTEND: ++ s390_output_symbolic_const (file, XEXP (x, 0)); ++ break; ++ ++ case PLUS: ++ s390_output_symbolic_const (file, XEXP (x, 0)); ++ fprintf (file, "+"); ++ s390_output_symbolic_const (file, XEXP (x, 1)); ++ break; ++ ++ case MINUS: ++ s390_output_symbolic_const (file, XEXP (x, 0)); ++ fprintf (file, "-"); ++ s390_output_symbolic_const (file, XEXP (x, 1)); ++ break; ++ ++ case CONST_INT: ++ output_addr_const (file, x); ++ break; ++ ++ case LABEL_REF: ++ case CODE_LABEL: ++ output_addr_const (file, x); ++ break; ++ ++ case SYMBOL_REF: ++ output_addr_const (file, x); ++ if (CONSTANT_POOL_ADDRESS_P (x) && s390_pool_count != 0) ++ fprintf (file, "_%X", s390_pool_count); ++ break; ++ ++ case UNSPEC: ++ if (XVECLEN (x, 0) != 1) ++ output_operand_lossage ("invalid UNSPEC as operand (1)"); ++ switch (XINT (x, 1)) ++ { ++ case 100: ++ s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); ++ fprintf (file, "-.LT%X_%X", ++ s390_function_count, s390_pool_count); ++ break; ++ case 110: ++ s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); ++ fprintf (file, "@GOT12"); ++ break; ++ case 111: ++ s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); ++ fprintf (file, "@GOTENT"); ++ break; ++ case 112: ++ s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); ++ fprintf (file, "@GOT"); ++ break; ++ case 113: ++ s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); ++ fprintf (file, "@PLT"); ++ break; ++ case 114: ++ s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); ++ fprintf (file, "@PLT-.LT%X_%X", ++ s390_function_count, s390_pool_count); ++ break; ++ default: ++ output_operand_lossage ("invalid UNSPEC as operand (2)"); ++ break; ++ } ++ break; ++ ++ default: ++ fatal_insn ("UNKNOWN in s390_output_symbolic_const !?", x); ++ break; ++ } ++} ++ ++/* Output an address operand. */ ++ ++void ++print_operand_address (FILE *file, rtx addr) ++{ ++ struct s390_address ad; ++ ++ if (!s390_decompose_address (addr, &ad, TRUE)) ++ output_operand_lossage ("Cannot decompose address.\n"); ++ ++ if (ad.disp) ++ s390_output_symbolic_const (file, ad.disp); ++ else ++ fprintf (file, "0"); ++ ++ if (ad.base && ad.indx) ++ fprintf (file, "(%s,%s)", reg_names[REGNO (ad.indx)], ++ reg_names[REGNO (ad.base)]); ++ else if (ad.base) ++ fprintf (file, "(%s)", reg_names[REGNO (ad.base)]); ++} ++ ++/* Output an operand. */ ++ ++void ++print_operand (FILE *file, rtx x, char code) ++{ ++ switch (code) ++ { ++ case 'C': ++ output_branch_condition (file, x); ++ return; ++ ++ case 'D': ++ output_inverse_branch_condition (file, x); ++ return; ++ ++ case 'Y': ++ fprintf (file, ".LT%X_%X-.", s390_function_count, s390_pool_count); ++ return; ++ ++ case 'y': ++ fprintf (file, ".LT%X_%X", s390_function_count, s390_pool_count); ++ return; ++ ++ case 'O': ++ { ++ struct s390_address ad; ++ ++ if (GET_CODE (x) != MEM ++ || !s390_decompose_address (XEXP (x, 0), &ad, TRUE) ++ || ad.indx) ++ abort (); ++ ++ if (ad.disp) ++ s390_output_symbolic_const (file, ad.disp); ++ else ++ fprintf (file, "0"); ++ } ++ return; ++ ++ case 'R': ++ { ++ struct s390_address ad; ++ ++ if (GET_CODE (x) != MEM ++ || !s390_decompose_address (XEXP (x, 0), &ad, TRUE) ++ || ad.indx) ++ abort (); ++ ++ if (ad.base) ++ fprintf (file, "%s", reg_names[REGNO (ad.base)]); ++ else ++ fprintf (file, "0"); ++ } ++ return; ++ ++ case 'N': ++ if (GET_CODE (x) == REG) ++ x = gen_rtx_REG (GET_MODE (x), REGNO (x) + 1); ++ else if (GET_CODE (x) == MEM) ++ x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 4)); ++ else ++ abort (); ++ break; ++ ++ case 'M': ++ if (GET_CODE (x) == REG) ++ x = gen_rtx_REG (GET_MODE (x), REGNO (x) + 1); ++ else if (GET_CODE (x) == MEM) ++ x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 8)); ++ else ++ abort (); ++ break; ++ } ++ ++ switch (GET_CODE (x)) ++ { ++ case REG: ++ fprintf (file, "%s", reg_names[REGNO (x)]); ++ break; ++ ++ case MEM: ++ output_address (XEXP (x, 0)); ++ break; ++ ++ case CONST: ++ case CODE_LABEL: ++ case LABEL_REF: ++ case SYMBOL_REF: ++ s390_output_symbolic_const (file, x); ++ break; ++ ++ case CONST_INT: ++ if (code == 'b') ++ fprintf (file, "%d", INTVAL (x) & 0xff); ++ else if (code == 'X') ++ fprintf (file, "%d", INTVAL (x) & 0xff); ++ else if (code == 'x') ++ fprintf (file, "0x%x", INTVAL (x) & 0xffff); ++ else if (code == 'h') ++ fprintf (file, "%d", (INTVAL (x) << 16) >> 16); ++ else ++ fprintf (file, "%d", INTVAL (x)); ++ break; ++ ++ default: ++ fatal_insn ("UNKNOWN in print_operand !?", x); ++ break; ++ } ++} ++ ++#define DEBUG_SCHED 0 ++ ++/* True, if register regno is used for forming a memory address in ++ a expression x. */ ++ ++static int ++reg_used_in_mem_p (int regno, rtx x) ++{ ++ enum rtx_code code = GET_CODE (x); ++ int i, j; ++ const char *fmt; ++ ++ if (code == MEM) ++ { ++ if (refers_to_regno_p (regno, regno+1, ++ XEXP (x, 0), 0)) ++ return 1; ++ } ++ ++ fmt = GET_RTX_FORMAT (code); ++ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) ++ { ++ if (fmt[i] == 'e' ++ && reg_used_in_mem_p (regno, XEXP (x, i))) ++ return 1; ++ ++ else if (fmt[i] == 'E') ++ for (j = 0; j < XVECLEN (x, i); j++) ++ if (reg_used_in_mem_p (regno, XVECEXP (x, i, j))) ++ return 1; ++ } ++ return 0; ++} ++ ++/* Returns true, if expression dep_rtx sets a address register ++ used by instruction insn to address memory. */ ++ ++static int ++addr_generation_dependency_p (rtx dep_rtx, rtx insn) ++{ ++ rtx target; ++ ++ if (GET_CODE (dep_rtx) == SET) ++ { ++ target = SET_DEST (dep_rtx); ++ ++ if (GET_CODE (target) == REG) ++ { ++ int regno = REGNO (target); ++ ++ if (get_attr_type (insn) == TYPE_LA) ++ return refers_to_regno_p (regno, regno+1, ++ SET_SRC (PATTERN (insn)), 0); ++ else if (get_attr_atype (insn) == ATYPE_MEM) ++ return reg_used_in_mem_p (regno, PATTERN (insn)); ++ } ++ } ++ return 0; ++} ++ ++ ++/* Data dependencies are all handled without delay. But if an register ++ is changed for a memory access, at least 4 cycle need to be put ++ between the set of the register and the use. Because of that, ++ the delays specified in the .md file needs to check and adjust ++ to the right cost. */ ++ ++int ++s390_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost ) ++{ ++ rtx dep_rtx, dest, x; ++ int i; ++ ++ /* If the dependence is an anti-dependence, there is no cost. For an ++ output dependence, there is sometimes a cost, but it doesn't seem ++ worth handling those few cases. */ ++ ++ if (REG_NOTE_KIND (link) != 0) ++ return 0; ++ ++ /* If we can't recognize the insns, we can't really do anything. */ ++ if (recog_memoized (insn) < 0 || recog_memoized (dep_insn) < 0) ++ return cost; ++ ++ /* If cost equal 1 nothing needs to be checked. */ ++ ++ if (cost == 1) ++ { ++ return cost; ++ } ++ ++ dep_rtx = PATTERN (dep_insn); ++ ++ if (GET_CODE (dep_rtx) == SET) ++ { ++ if (addr_generation_dependency_p (dep_rtx, insn)) ++ { ++ if (DEBUG_SCHED) ++ { ++ fprintf (stderr, "\n\nAddress dependency detected: cost %d\n", ++ cost); ++ debug_rtx (dep_insn); ++ debug_rtx (insn); ++ } ++ return cost; ++ } ++ } ++ ++ else if (GET_CODE (dep_rtx) == PARALLEL) ++ { ++ for (i = 0; i < XVECLEN (dep_rtx, 0); i++) ++ { ++ if (addr_generation_dependency_p (XVECEXP (dep_rtx, 0, i), ++ insn)) ++ { ++ if (DEBUG_SCHED) ++ { ++ fprintf (stderr, "\n\nAddress dependency detected: cost %d\n" ++ ,cost); ++ debug_rtx (dep_insn); ++ debug_rtx (insn); ++ } ++ return cost; ++ } ++ } ++ } ++ ++ /* default cost. */ ++ return 1; ++} ++ ++/* Pool concept for Linux 390: ++ - Function prologue saves used register ++ - literal pool is dumped in prologue and jump across with bras ++ - If function has more than 4 k literals, at about every ++ S390_CHUNK_MAX offset in the function a literal pool will be ++ dumped ++ - in this case, a branch from one chunk to other chunk needs ++ a reload of base register at the code label branched to. */ ++ ++ ++ ++rtx s390_pool_start_insn = NULL_RTX; ++ ++/* Count of actual pool in function (-1 -> before function). */ ++ ++int s390_pool_count = -1; ++ ++ ++ ++void ++s390_asm_output_pool_prologue (FILE *file, char *fname, tree fndecl, int size) ++{ ++ ++ if (s390_pool_count>0) { ++ /* ++ * We are in an internal pool, branch over ++ */ ++ if (TARGET_64BIT) ++ { ++ fprintf (file, "\tlarl\t%s,.LT%X_%X\n", ++ reg_names[BASE_REGISTER], ++ s390_function_count, s390_pool_count); ++ readonly_data_section (); ++ ASM_OUTPUT_ALIGN (file, floor_log2 (3)); ++ fprintf (file, ".LT%X_%X:\t# Pool %d\n", ++ s390_function_count, s390_pool_count, s390_pool_count); ++ } ++ else ++ fprintf (file,"\t.align 4\n\tbras\t%s,0f\n.LT%X_%X:\t# Pool %d \n", ++ reg_names[BASE_REGISTER], ++ s390_function_count, s390_pool_count, s390_pool_count); ++ } ++ if (!TARGET_64BIT) ++ function_section (fndecl); ++} ++ ++ ++/* Split all branches that exceed the maximum distance. */ ++ ++static void ++s390_split_branches (void) ++{ ++ rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM); ++ rtx insn, pat, label, target, jump, tmp; ++ ++ /* In 64-bit mode we can jump +- 4GB. */ ++ ++ if (TARGET_64BIT) ++ return; ++ ++ /* Find all branches that exceed 64KB, and split them. */ ++ ++ for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) ++ { ++ if (GET_CODE (insn) != JUMP_INSN) ++ continue; ++ ++ pat = PATTERN (insn); ++ if (GET_CODE (pat) != SET) ++ continue; ++ ++ if (GET_CODE (SET_SRC (pat)) == LABEL_REF) ++ { ++ label = SET_SRC (pat); ++ } ++ else if (GET_CODE (SET_SRC (pat)) == IF_THEN_ELSE) ++ { ++ if (GET_CODE (XEXP (SET_SRC (pat), 1)) == LABEL_REF) ++ label = XEXP (SET_SRC (pat), 1); ++ else if (GET_CODE (XEXP (SET_SRC (pat), 2)) == LABEL_REF) ++ label = XEXP (SET_SRC (pat), 2); ++ else ++ continue; ++ } ++ else ++ continue; ++ ++ if (get_attr_length (insn) == 4) ++ continue; ++ ++ if (flag_pic) ++ { ++ target = gen_rtx_UNSPEC (SImode, gen_rtvec (1, label), 100); ++ target = gen_rtx_CONST (SImode, target); ++ target = force_const_mem (SImode, target); ++ jump = gen_rtx_REG (Pmode, BASE_REGISTER); ++ jump = gen_rtx_PLUS (Pmode, jump, temp_reg); ++ } ++ else ++ { ++ target = force_const_mem (Pmode, label); ++ jump = temp_reg; ++ } ++ ++ if (GET_CODE (SET_SRC (pat)) == IF_THEN_ELSE) ++ { ++ if (GET_CODE (XEXP (SET_SRC (pat), 1)) == LABEL_REF) ++ jump = gen_rtx_IF_THEN_ELSE (VOIDmode, XEXP (SET_SRC (pat), 0), ++ jump, pc_rtx); ++ else ++ jump = gen_rtx_IF_THEN_ELSE (VOIDmode, XEXP (SET_SRC (pat), 0), ++ pc_rtx, jump); ++ } ++ ++ tmp = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, target), insn); ++ INSN_ADDRESSES_NEW (tmp, -1); ++ ++ tmp = emit_jump_insn_before (gen_rtx_SET (VOIDmode, pc_rtx, jump), insn); ++ INSN_ADDRESSES_NEW (tmp, -1); ++ ++ remove_insn (insn); ++ insn = tmp; ++ } ++} ++ ++/* Chunkify the literal pool if required. */ ++ ++static void ++s390_chunkify_pool (void) ++{ ++ int *ltorg_uids, max_ltorg, chunk, last_addr, next_addr; ++ rtx insn; ++ ++ /* Do we need to chunkify the literal pool? */ ++ ++ if (get_pool_size () <= S390_POOL_MAX) ++ return; ++ ++ /* Find all insns where a literal pool chunk must be inserted. */ ++ ++ ltorg_uids = alloca (insn_current_address / 1024 + 1024); ++ max_ltorg = 0; ++ ++ last_addr = 0; ++ for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) ++ { ++ if (INSN_ADDRESSES (INSN_UID (insn)) - last_addr < S390_CHUNK_MAX) ++ continue; ++ if (INSN_ADDRESSES (INSN_UID (insn)) - last_addr > S390_CHUNK_OV) ++ abort (); ++ ++ if (GET_CODE (insn) == CODE_LABEL ++ && !(GET_CODE (NEXT_INSN (insn)) == JUMP_INSN ++ && (GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_VEC ++ || GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_DIFF_VEC))) ++ { ++ ltorg_uids[max_ltorg++] = INSN_UID (prev_real_insn (insn)); ++ last_addr = INSN_ADDRESSES (ltorg_uids[max_ltorg-1]); ++ continue; ++ } ++ ++ if (GET_CODE (insn) == CALL_INSN) ++ { ++ ltorg_uids[max_ltorg++] = INSN_UID (insn); ++ last_addr = INSN_ADDRESSES (ltorg_uids[max_ltorg-1]); ++ continue; ++ } ++ } ++ ++ ltorg_uids[max_ltorg] = -1; ++ ++ /* Find and mark all labels that are branched into ++ from an insn belonging to a different chunk. */ ++ ++ chunk = last_addr = 0; ++ next_addr = ltorg_uids[chunk] == -1 ? insn_current_address + 1 ++ : INSN_ADDRESSES (ltorg_uids[chunk]); ++ ++ for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) ++ { ++ if (GET_CODE (insn) == JUMP_INSN) ++ { ++ rtx pat = PATTERN (insn); ++ if (GET_CODE (pat) == SET) ++ { ++ rtx label = 0; ++ ++ if (GET_CODE (SET_SRC (pat)) == LABEL_REF) ++ { ++ label = XEXP (SET_SRC (pat), 0); ++ } ++ else if (GET_CODE (SET_SRC (pat)) == IF_THEN_ELSE) ++ { ++ if (GET_CODE (XEXP (SET_SRC (pat), 1)) == LABEL_REF) ++ label = XEXP (XEXP (SET_SRC (pat), 1), 0); ++ else if (GET_CODE (XEXP (SET_SRC (pat), 2)) == LABEL_REF) ++ label = XEXP (XEXP (SET_SRC (pat), 2), 0); ++ } ++ ++ if (label) ++ { ++ if (INSN_ADDRESSES (INSN_UID (label)) <= last_addr ++ || INSN_ADDRESSES (INSN_UID (label)) > next_addr) ++ SYMBOL_REF_USED (label) = 1; ++ } ++ } ++ else if (GET_CODE (pat) == ADDR_VEC ++ || GET_CODE (pat) == ADDR_DIFF_VEC) ++ { ++ int i, diff_p = GET_CODE (pat) == ADDR_DIFF_VEC; ++ ++ for (i = 0; i < XVECLEN (pat, diff_p); i++) ++ { ++ rtx label = XEXP (XVECEXP (pat, diff_p, i), 0); ++ ++ if (INSN_ADDRESSES (INSN_UID (label)) <= last_addr ++ || INSN_ADDRESSES (INSN_UID (label)) > next_addr) ++ SYMBOL_REF_USED (label) = 1; ++ } ++ } ++ } ++ ++ if (INSN_UID (insn) == ltorg_uids[chunk]) ++ { ++ last_addr = INSN_ADDRESSES (ltorg_uids[chunk++]); ++ next_addr = ltorg_uids[chunk] == -1 ? insn_current_address + 1 ++ : INSN_ADDRESSES (ltorg_uids[chunk]); ++ } ++ } ++ ++ /* Insert literal pools and base register reload insns. */ ++ ++ chunk = 0; ++ for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) ++ { ++ if (INSN_UID (insn) == ltorg_uids[chunk]) ++ { ++ rtx new_insn = gen_ltorg (GEN_INT (chunk++)); ++ INSN_ADDRESSES_NEW (emit_insn_after (new_insn, insn), -1); ++ } ++ ++ if (GET_CODE (insn) == CODE_LABEL && SYMBOL_REF_USED (insn)) ++ { ++ rtx new_insn = gen_reload_base (insn); ++ INSN_ADDRESSES_NEW (emit_insn_after (new_insn, insn), -1); ++ } ++ } ++ ++ /* Recompute insn addresses. */ ++ ++ init_insn_lengths (); ++ shorten_branches (get_insns ()); ++} ++ ++/* Return 1 if next literal pool is reached (check for ltorg insn) ++ maybe should use unspec insn. */ ++ ++ ++int ++s390_stop_dump_lit_p (rtx insn) ++{ ++ rtx body=PATTERN (insn); ++ if (GET_CODE (body) == PARALLEL ++ && GET_CODE (XVECEXP (body, 0, 0)) == SET ++ && GET_CODE (XVECEXP (body, 0, 1)) == USE ++ && GET_CODE (XEXP ((XVECEXP (body, 0, 1)),0)) == CONST_INT ++ && GET_CODE (SET_DEST (XVECEXP (body, 0, 0))) == REG ++ && REGNO (SET_DEST (XVECEXP (body, 0, 0))) == BASE_REGISTER ++ && SET_SRC (XVECEXP (body, 0, 0)) == pc_rtx) { ++ return 1; ++ } ++ else ++ return 0; ++} ++ ++void ++s390_dump_literal_pool (rtx act_insn, rtx stop) ++{ ++ s390_pool_start_insn = act_insn; ++ s390_pool_count++; ++ output_constant_pool (current_function_name, current_function_decl); ++ function_section (current_function_decl); ++} ++ ++ ++#ifdef DWARF2_DEBUGGING_INFO ++extern char *dwarf2out_cfi_label PARAMS ((void)); ++#endif ++ ++/* Flag set in prologue, used in epilog to know ++ if stack is allocated or not. */ ++ ++static int leaf_function_flag; ++rtx s390_got_label; ++rtx s390_profile[10]; ++int s390_nr_constants; ++ ++/* Returns 1 if floating point registers need to be saved. */ ++ ++static int ++save_fprs_p () ++{ ++ int i; ++ if (!TARGET_64BIT) ++ return 0; ++ for (i=24; i<=31; i++) ++ { ++ if (regs_ever_live[i] == 1) ++ return 1; ++ } ++ return 0; ++} ++ ++/* Current function is a leaf function, without automatics, ++ alloca or vararg stuff. */ ++ ++static int ++cur_is_leaf_function () ++{ ++ int lsize = get_frame_size () + current_function_outgoing_args_size ++ + save_fprs_p () * 64; ++ ++ if (leaf_function_p () && ((lsize) == 0) && ++ ! (current_function_calls_alloca) && ++ ! (current_function_stdarg) && ! (current_function_varargs)) ++ return 1; ++ return 0; ++} ++ ++/* Calculate offset between argument pointer and frame pointer ++ initialy after prologue. */ ++ ++int ++s390_arg_frame_offset () ++{ ++ int lsize = get_frame_size () + current_function_outgoing_args_size ++ + save_fprs_p () * 64; ++ ++ if (cur_is_leaf_function ()) ++ return STACK_POINTER_OFFSET; ++ else ++ return 2*STACK_POINTER_OFFSET + lsize; ++} ++ ++/* Save Floating point register on current stack. */ ++ ++static int ++save_fprs (FILE *file, long offset, int fp) ++{ ++ int i; ++ ++ if (!TARGET_64BIT) ++ return 0; ++ ++ for (i=24; i<=31; i++) ++ { ++ if (regs_ever_live[i] == 1) ++ { ++ fprintf (file, "\tstd\t%s,%d(%s)\n", reg_names[i], ++ (i-24) * 8 + offset, reg_names[fp]); ++ } ++ } ++} ++ ++/* Restore Floating point register on current stack. */ ++ ++static int ++restore_fprs (FILE *file, long offset, int fp) ++{ ++ int i; ++ ++ if (!TARGET_64BIT) ++ return 0; ++ ++ if (!save_fprs_p ()) ++ return 0; ++ ++ if (offset < 0) ++ { ++ fp = 1; ++ offset = 0; ++ fprintf (file, "\tlgr\t%s,%s\n", reg_names[fp], ++ reg_names[STACK_POINTER_REGNUM]); ++ fprintf (file, "\taghi\t%s,-64\n", reg_names[fp]); ++ } ++ ++ for (i=24; i<=31; i++) ++ { ++ if (regs_ever_live[i] == 1) ++ { ++ fprintf (file, "\tld\t%s,%d(%s)\n", reg_names[i], ++ (i-24) * 8 + offset, reg_names[fp]); ++ } ++ } ++} ++ ++/* Output constant pool in function prologue (31 bit) or in readonly section. */ ++ ++static int ++s390_output_constant_pool (FILE* file) ++{ ++ /* Output constant pool. */ ++ if (s390_nr_constants || regs_ever_live[BASE_REGISTER]) ++ { ++ s390_pool_count = 0; ++ if (TARGET_64BIT) ++ { ++ fprintf (file, "\tlarl\t%s,.LT%X_%X\n", reg_names[BASE_REGISTER], ++ s390_function_count, s390_pool_count); ++ readonly_data_section (); ++ ASM_OUTPUT_ALIGN (file, floor_log2 (3)); ++ } ++ else ++ { ++ fprintf (file, "\tbras\t%s,.LTN%X_%X\n", reg_names[BASE_REGISTER], ++ s390_function_count, s390_pool_count); ++ } ++ fprintf (file, ".LT%X_%X:\n", s390_function_count, s390_pool_count); ++ output_constant_pool (current_function_name, current_function_decl); ++ fprintf (file, ".LTN%X_%X:\n", s390_function_count, ++ s390_pool_count); ++ if (TARGET_64BIT) ++ function_section (current_function_decl); ++ ++ regs_ever_live[BASE_REGISTER] = 1; ++ } ++} ++ ++ ++/* This function generates the assembly code for function entry. */ ++ ++static rtx ++s390_force_const_mem_late (rtx cst) ++{ ++ cst = force_const_mem (Pmode, cst); ++ ++ s390_nr_constants++; ++ regs_ever_live[BASE_REGISTER] = 1; ++ ++ emit_insn_before (gen_rtx (USE, Pmode, cst), get_insns ()); ++ ++ return cst; ++} ++ ++static rtx ++s390_force_const_mem_symbol (char *name, int func, int global) ++{ ++ rtx symbol; ++ ++ if (TARGET_64BIT) ++ abort (); ++ ++ symbol = gen_rtx (SYMBOL_REF, Pmode, name); ++ SYMBOL_REF_FLAG (symbol) = !global; ++ ++ if (flag_pic) ++ { ++ if (global) ++ { ++ current_function_uses_pic_offset_table = 1; ++ symbol = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, symbol), func? 114 : 112); ++ symbol = gen_rtx_CONST (VOIDmode, symbol); ++ } ++ else ++ { ++ symbol = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, symbol), 100); ++ symbol = gen_rtx_CONST (VOIDmode, symbol); ++ } ++ } ++ ++ return s390_force_const_mem_late (symbol); ++} ++ ++/* This function generates the assembly code for function entry. */ ++ ++int ++s390_function_prologue (FILE * file, int lsize) ++{ ++ extern int profile_label_no; ++ int i, j; ++ long frame_size; ++ rtx stack_label = 0, got_label = 0, tmp; ++ char *l; ++ char b64[2] = " "; ++ b64[0] = TARGET_64BIT ? 'g' : '\0'; ++ ++ /* Check for too large size of local variables */ ++ ++ if (lsize > 0x7fff0000) ++ fatal ("Total size of local variables exceeds architecture limit."); ++ /* Profile code (-p, -a, -ax needs some literals). */ ++ ++ if (profile_block_flag && !TARGET_64BIT) ++ { ++ s390_profile[0] = s390_force_const_mem_symbol ("__bb_init_func", 1, 1); ++ s390_profile[1] = s390_force_const_mem_symbol ("__bb_init_trace_func", 1, 1); ++ s390_profile[2] = s390_force_const_mem_symbol ("__bb_trace_func", 1, 1); ++ s390_profile[3] = s390_force_const_mem_symbol ("__bb_trace_ret", 1, 1); ++ s390_profile[5] = s390_force_const_mem_symbol ("__bb", 0, 1); ++ s390_profile[6] = s390_force_const_mem_symbol (".LPBX0", 0, 0); ++ s390_profile[7] = s390_force_const_mem_symbol (".LPBX2", 0, 0); ++ } ++ ++ if (profile_flag && !TARGET_64BIT) ++ { ++ static char label[128]; ++ sprintf (label, "%sP%d", LPREFIX, profile_label_no); ++ ++ s390_profile[4] = s390_force_const_mem_symbol ("_mcount", 1, 1); ++ s390_profile[9] = s390_force_const_mem_symbol (label, 0, 0); ++ } ++ ++ s390_chunkify_pool (); ++ s390_split_branches (); ++ ++ if (current_function_uses_pic_offset_table) ++ regs_ever_live[12] = 1; ++ ++ if (!TARGET_64BIT && current_function_uses_pic_offset_table) ++ { ++ got_label = s390_force_const_mem_symbol ("_GLOBAL_OFFSET_TABLE_", 0, 0); ++ } ++ ++ if ((frame_size = ++ STARTING_FRAME_OFFSET + lsize + save_fprs_p () * 64) > 0x7fff) ++ { ++ stack_label = s390_force_const_mem_late (GEN_INT (frame_size)); ++ } ++ ++ if (!optimize) ++ { ++ /* Stupid register allocation is stupid ... ++ It does not always recognize the base register is used. */ ++ ++ regs_ever_live[BASE_REGISTER] = 1; ++ } ++ ++ if (cur_is_leaf_function ()) ++ { ++ leaf_function_flag = 1; ++ fprintf (file, "%s\tleaf function\n", ASM_COMMENT_START); ++ fprintf (file, "%s\thas varargs %d\n", ASM_COMMENT_START, ++ current_function_stdarg); ++ fprintf (file, "%s\tincoming args (stack) %d\n", ASM_COMMENT_START, ++ current_function_args_size); ++ fprintf (file, "%s\tfunction length %d\n", ASM_COMMENT_START, ++ insn_current_address); ++ fprintf (file, "%s\tregister live ", ASM_COMMENT_START); ++ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) ++ fprintf (file, "%d", regs_ever_live[i]); ++ fputc ('\n',file); ++ ++ /* Save gprs 6 - 15 and fprs 4 and 6. */ ++ for (i = 6; i < 13 && (regs_ever_live[i] == 0); i++); ++ ++ if (s390_nr_constants || regs_ever_live[13] || i != 13) ++ { ++ fprintf (file, "\tstm%s\t%s,%s,%d(%s)\n", ++ b64, reg_names[i], reg_names[13], ++ i * UNITS_PER_WORD, ++ reg_names[STACK_POINTER_REGNUM]); ++#ifdef INCOMING_RETURN_ADDR_RTX ++ if (dwarf2out_do_frame ()) ++ { ++ l = dwarf2out_cfi_label (); ++ dwarf2out_def_cfa (l, STACK_POINTER_REGNUM, ++ STACK_POINTER_OFFSET); ++ for (j = i; j <= 14; j++) ++ dwarf2out_reg_save (l, j, (TARGET_64BIT ? (j-20) : (j-24)) ++ * UNITS_PER_WORD); ++ if (regs_ever_live[18]) ++ dwarf2out_reg_save (l, 18, -16); ++ if (regs_ever_live[19]) ++ dwarf2out_reg_save (l, 19, -8); ++ } ++#endif ++ } ++ ++ s390_output_constant_pool (file); ++ ++ /* Save fprs. */ ++ ++ if (!TARGET_64BIT) ++ { ++ if (regs_ever_live[18]) ++ fprintf (file, "\tstd\t4,80(%s)\n", reg_names[STACK_POINTER_REGNUM]); ++ if (regs_ever_live[19]) ++ fprintf (file, "\tstd\t6,88(%s)\n", reg_names[STACK_POINTER_REGNUM]); ++ } ++ } ++ else ++ { /* No leaf function. */ ++ fprintf (file, "%s\tleaf function %d\n", ASM_COMMENT_START, ++ leaf_function_p ()); ++ fprintf (file, "%s\tautomatics %d\n", ASM_COMMENT_START, ++ lsize); ++ fprintf (file, "%s\toutgoing args %d\n", ASM_COMMENT_START, ++ current_function_outgoing_args_size); ++ fprintf (file, "%s\tneed frame pointer %d\n", ASM_COMMENT_START, ++ frame_pointer_needed); ++ fprintf (file, "%s\tcall alloca %d\n", ASM_COMMENT_START, ++ current_function_calls_alloca); ++ fprintf (file, "%s\thas varargs %d\n", ASM_COMMENT_START, ++ current_function_stdarg || current_function_varargs); ++ fprintf (file, "%s\tincoming args (stack) %d\n", ASM_COMMENT_START, ++ current_function_args_size); ++ fprintf (file, "%s\tfunction length %d\n", ASM_COMMENT_START, ++ insn_current_address); ++ fprintf (file, "%s\tregister live ", ASM_COMMENT_START); ++ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) ++ fprintf (file, "%d", regs_ever_live[i]); ++ fputc ('\n',file); ++ ++ /* Save gprs 6 - 15 and fprs 4 and 6. */ ++ ++ if (current_function_stdarg || current_function_varargs) ++ { ++ i = 2; ++ } ++ else ++ { ++ for (i = 6; i < 13 && (regs_ever_live[i] == 0); i++); ++ } ++ ++ fprintf (file, "\tstm%s\t%s,%s,%d(%s)\n", ++ b64, reg_names[i], reg_names[15], i * UNITS_PER_WORD, ++ reg_names[STACK_POINTER_REGNUM]); ++ ++#ifdef INCOMING_RETURN_ADDR_RTX ++ if (dwarf2out_do_frame ()) ++ { ++ l = dwarf2out_cfi_label (); ++ dwarf2out_def_cfa (l, STACK_POINTER_REGNUM, STACK_POINTER_OFFSET); ++ for (j = i; j <= 15; j++) ++ dwarf2out_reg_save (l, j, (TARGET_64BIT ? (j-20) : (j-24)) * ++ UNITS_PER_WORD); ++ if (regs_ever_live[18]) ++ dwarf2out_reg_save (l, 18, -16); ++ if (regs_ever_live[19]) ++ dwarf2out_reg_save (l, 19, -8); ++ } ++#endif ++ ++ s390_output_constant_pool (file); ++ ++ /* Save fprs. */ ++ ++ if (current_function_stdarg || current_function_varargs) ++ { ++ fprintf (file, "\tstd\t%s,%d(%s)\n", ++ reg_names[16], ++ STACK_POINTER_OFFSET-32, ++ reg_names[STACK_POINTER_REGNUM]); ++ fprintf (file, "\tstd\t%s,%d(%s)\n", ++ reg_names[17], ++ STACK_POINTER_OFFSET-24, ++ reg_names[STACK_POINTER_REGNUM]); ++ if (TARGET_64BIT) ++ { ++ fprintf (file, "\tstd\t%s,%d(%s)\n", ++ reg_names[18], ++ STACK_POINTER_OFFSET-16, ++ reg_names[STACK_POINTER_REGNUM]); ++ fprintf (file, "\tstd\t%s,%d(%s)\n", ++ reg_names[19], ++ STACK_POINTER_OFFSET-8, ++ reg_names[STACK_POINTER_REGNUM]); ++ } ++ } ++ if (!TARGET_64BIT) ++ { ++ if (regs_ever_live[18]) ++ fprintf (file, "\tstd\t%s,%d(%s)\n", ++ reg_names[18], ++ STACK_POINTER_OFFSET-16, ++ reg_names[STACK_POINTER_REGNUM]); ++ if (regs_ever_live[19]) ++ fprintf (file, "\tstd\t%s,%d(%s)\n", ++ reg_names[19], ++ STACK_POINTER_OFFSET-8, ++ reg_names[STACK_POINTER_REGNUM]); ++ } ++ ++ ++ if (save_fprs_p () && frame_size > 4095) ++ { ++ int fp = 1; ++ int offset = 0; ++ fprintf (file, "\tlgr\t%s,%s\n", reg_names[fp], ++ reg_names[STACK_POINTER_REGNUM]); ++ fprintf (file, "\taghi\t%s,-64\n", reg_names[fp]); ++ save_fprs (file, 0, fp); ++ } ++ ++ /* Decrement stack. */ ++ ++ if (TARGET_BACKCHAIN || (STARTING_FRAME_OFFSET + ++ lsize + STACK_POINTER_OFFSET > 4095 ++ || frame_pointer_needed ++ || current_function_calls_alloca)) ++ { ++ ++ fprintf (file, "\tl%sr\t%s,%s\n", b64, ++ reg_names[1], reg_names[STACK_POINTER_REGNUM]); ++ } ++ ++ if (stack_label) ++ { ++ rtx operands[2]; ++ ++ operands[0] = stack_pointer_rtx; ++ operands[1] = stack_label; ++ if (TARGET_64BIT) ++ output_asm_insn ("sg\t%0,%1", operands); ++ else ++ output_asm_insn ("s\t%0,%1", operands); ++ } ++ else ++ { ++ fprintf (file, "\ta%shi\t%s,-%d\n",b64, ++ reg_names[STACK_POINTER_REGNUM], frame_size); ++ } ++#ifdef INCOMING_RETURN_ADDR_RTX ++ if (dwarf2out_do_frame ()) ++ { ++ if (frame_pointer_needed) ++ dwarf2out_def_cfa ("", HARD_FRAME_POINTER_REGNUM, ++ STACK_POINTER_OFFSET+frame_size); ++ else ++ dwarf2out_def_cfa ("", STACK_POINTER_REGNUM, ++ STACK_POINTER_OFFSET+frame_size); ++ } ++#endif ++ ++ ++ /* Generate backchain. */ ++ ++ if (TARGET_BACKCHAIN || (STARTING_FRAME_OFFSET + ++ lsize + STACK_POINTER_OFFSET > 4095 ++ || frame_pointer_needed ++ || current_function_calls_alloca)) ++ { ++ fprintf (file, "\tst%s\t%s,0(%s)\n", ++ b64, reg_names[1], reg_names[STACK_POINTER_REGNUM]); ++ } ++ } ++ ++ if (frame_pointer_needed) ++ { ++ fprintf (file, "\tl%sr\t%s,%s\n", b64, ++ reg_names[FRAME_POINTER_REGNUM], ++ reg_names[STACK_POINTER_REGNUM]); ++ } ++ ++ /* Load GOT if used and emit use insn that optimizer does not ++ erase literal pool entry. */ ++ ++ if (current_function_uses_pic_offset_table) ++ { ++ rtx operands[3]; ++ if (TARGET_64BIT) ++ { ++ fprintf (file, "\tlarl\t%s,_GLOBAL_OFFSET_TABLE_\n", ++ reg_names[PIC_OFFSET_TABLE_REGNUM]); ++ } ++ else ++ { ++ operands[0] = gen_rtx (REG, Pmode, PIC_OFFSET_TABLE_REGNUM); ++ operands[1] = got_label; ++ operands[2] = gen_rtx (REG, Pmode, BASE_REGISTER); ++ output_asm_insn ("l\t%0,%1\n\tar\t%0,%2", operands); ++ } ++ } ++ /* Save FPRs below save area. */ ++ ++ if (frame_size <= 4095) ++ save_fprs (file, frame_size - 64, STACK_POINTER_REGNUM); ++ ++ return 0; ++} ++ ++/* This function generates the assembly code for function exit. */ ++ ++int ++s390_function_epilogue (FILE * file, int lsize) ++{ ++/* Register is call clobbered and not used for eh or return. */ ++#define FREE_REG 4 ++ ++ int i; ++ long frame_size; ++ int return_reg = RETURN_REGNUM; ++ int fp, offset; ++ char b64[2] = " "; ++ ++ b64[0] = TARGET_64BIT ? 'g' : '\0'; ++ frame_size = STARTING_FRAME_OFFSET + lsize + save_fprs_p () * 64; ++ ++ if (current_function_uses_pic_offset_table) ++ regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1; ++ ++ if (leaf_function_flag) ++ { ++ for (i = 6; i < 13 && (regs_ever_live[i] == 0); i++); ++ ++ if (s390_nr_constants || regs_ever_live[13] || i != 13) ++ { ++ fprintf (file, "\tlm%s\t%s,%s,%d(%s)\n", b64, ++ reg_names[i], reg_names[13], ++ UNITS_PER_WORD * i, ++ reg_names[STACK_POINTER_REGNUM]); ++ } ++ if (!TARGET_64BIT) ++ { ++ if (regs_ever_live[18]) ++ fprintf (file, "\tld\t%s,%d(%s)\n", ++ reg_names[18], ++ STACK_POINTER_OFFSET-16, ++ reg_names[STACK_POINTER_REGNUM]); ++ if (regs_ever_live[19]) ++ fprintf (file, "\tld\t%s,%d(%s)\n", ++ reg_names[19], ++ STACK_POINTER_OFFSET-8, ++ reg_names[STACK_POINTER_REGNUM]); ++ } ++ } ++ else ++ { ++ for (i = 6; i < 13 && (regs_ever_live[i] == 0); i++); ++ ++ if (frame_size + STACK_POINTER_OFFSET > 4095) ++ { ++ offset = 0; ++ fp = STACK_POINTER_REGNUM; ++ } ++ else if (frame_pointer_needed || current_function_calls_alloca) ++ { ++ offset = frame_size; ++ fp = FRAME_POINTER_REGNUM; ++ } ++ else ++ { ++ offset = frame_size; ++ fp = STACK_POINTER_REGNUM; ++ } ++ ++ /* Restore from offset below save area. */ ++ ++ if (offset == 0) ++ fprintf (file, "\tl%s\t%s,0(%s)\n", b64, ++ reg_names[fp], reg_names[fp]); ++ restore_fprs (file, offset-64, fp); ++ return_reg = FREE_REG; ++ fprintf (file, "\tl%s\t%s,%d(%s)\n", b64, reg_names[return_reg], ++ UNITS_PER_WORD*RETURN_REGNUM+offset, reg_names[fp]); ++ if (!TARGET_64BIT) ++ { ++ if (regs_ever_live[18]) ++ fprintf (file, "\tld\t%s,%d(%s)\n", ++ reg_names[18], ++ offset+STACK_POINTER_OFFSET-16, reg_names[fp]); ++ if (regs_ever_live[19]) ++ fprintf (file, "\tld\t%s,%d(%s)\n", ++ reg_names[19], ++ offset+STACK_POINTER_OFFSET-8, reg_names[fp]); ++ } ++ fprintf (file, "\tlm%s\t%s,%s,%d(%s)\n", b64, ++ reg_names[i], reg_names[15], ++ (UNITS_PER_WORD * i) + offset, reg_names[fp]); ++ } ++ ++ fprintf (file, "\tbr\t%s\n", reg_names[return_reg]); ++ ++ current_function_uses_pic_offset_table = 0; ++ leaf_function_flag = 0; ++ s390_pool_start_insn = NULL_RTX; ++ s390_pool_count = -1; ++ s390_function_count++; ++ return 0; ++} ++ ++/* This is epilogue code, maybe should use generic in except.c. */ ++ ++void ++s390_expand_eh_epilogue (rtx reg1, rtx reg2, rtx reg3) ++{ ++ rtx stub_start, after_stub; ++ rtx ra, tmp; ++ ++ /* Otherwise, use the same stub technique we had before. */ ++ ++ eh_return_stub_label = stub_start = gen_label_rtx (); ++ after_stub = gen_label_rtx (); ++ ++ /* Set the return address to the stub label. */ ++ ++ ra = expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS, ++ 0, hard_frame_pointer_rtx); ++ if (GET_CODE (ra) == REG && REGNO (ra) >= FIRST_PSEUDO_REGISTER) ++ abort (); ++ ++ emit_insn (gen_rtx_USE (VOIDmode, gen_rtx_LABEL_REF (Pmode, stub_start))); ++ tmp = memory_address (Pmode, gen_rtx_LABEL_REF (Pmode, stub_start)); ++ ++ tmp = force_operand (tmp, ra); ++ if (tmp != ra) ++ emit_move_insn (ra, tmp); ++ ++ /* Indicate that the registers are in fact used. */ ++ emit_insn (gen_rtx_USE (VOIDmode, reg1)); ++ emit_insn (gen_rtx_USE (VOIDmode, reg2)); ++ emit_insn (gen_rtx_USE (VOIDmode, reg3)); ++ if (GET_CODE (ra) == REG) ++ emit_insn (gen_rtx_USE (VOIDmode, ra)); ++ ++ emit_move_insn (gen_rtx_REG (Pmode, 1), reg3); ++ /* Generate the stub. */ ++ ++ emit_jump (after_stub); ++ emit_label (stub_start); ++ ++ reg1 = gen_rtx_REG (Pmode, 2); ++ ++ emit_indirect_jump (gen_rtx_REG (Pmode, 1)); ++ ++ emit_label (after_stub); ++} ++ ++ ++/* For structs of odd size the address is passed as reference. ++ Complex number are also passes on the stack. ++ ++ Note: We don't use mode, since a struct with the following format ++ is BLKmode, but has size 4. ++ struct ++ { ++ char a; ++ char b[3] ++ }. ++ The ABI states, that this value has to be passed in register. */ ++ ++ ++static int ++s390_function_arg_size (enum machine_mode mode, tree type) ++{ ++ if (type) ++ return int_size_in_bytes (type); ++ ++ /* No type info available for some library calls ... */ ++ if (mode != BLKmode) ++ return GET_MODE_SIZE (mode); ++ ++ /* If we have neither type nor mode, abort */ ++ abort (); ++} ++ ++int ++s390_function_arg_pass_by_reference (enum machine_mode mode, tree type) ++{ ++ int size = s390_function_arg_size (mode, type); ++ ++ if (type) ++ { ++ if (AGGREGATE_TYPE_P (type) && ++ size != 1 && size != 2 && size != 4 && size != 8) ++ return 1; ++ ++ if (TREE_CODE (type) == COMPLEX_TYPE) ++ return 1; ++ } ++ return 0; ++ ++} ++ ++/* Update the data in CUM to advance over an argument of mode MODE and ++ data type TYPE. (TYPE is null for libcalls where that information ++ may not be available.). */ ++ ++void ++s390_function_arg_advance (CUMULATIVE_ARGS * cum, ++ enum machine_mode mode, tree type, int named) ++{ ++ if (! TARGET_SOFT_FLOAT && (mode == DFmode || mode == SFmode)) ++ { ++ cum->fprs++; ++ } ++ else if (s390_function_arg_pass_by_reference (mode, type)) ++ { ++ cum->gprs += 1; ++ } ++ else ++ { ++ int size = s390_function_arg_size (mode, type); ++ cum->gprs += ((size + UNITS_PER_WORD-1) / UNITS_PER_WORD); ++ } ++} ++ ++ ++ ++/* Define where to put the arguments to a function. Value is zero to push ++ the argument on the stack, or a hard register in which to store the ++ argument. Gprs 2-6 and Fprs 0 and 2 are used as arguments. ++ All integral values go into register, until all are used up, the rest ++ goes onto stack. The same is valid for floating-point values. */ ++ ++rtx ++s390_function_arg (CUMULATIVE_ARGS * cum, ++ enum machine_mode mode, tree type, int named) ++{ ++ if (s390_function_arg_pass_by_reference (mode, type)) ++ return 0; ++ ++ if (! TARGET_SOFT_FLOAT && (mode == DFmode || mode == SFmode)) ++ { ++ if (cum->fprs + 1 > (TARGET_64BIT? 4 : 2)) ++ return 0; ++ else ++ return gen_rtx (REG, mode, cum->fprs + 16); ++ } ++ else ++ { ++ int size = s390_function_arg_size (mode, type); ++ int n_gprs = (size + UNITS_PER_WORD-1) / UNITS_PER_WORD; ++ ++ if (cum->gprs + n_gprs > 5) ++ return 0; ++ else ++ return gen_rtx (REG, mode, cum->gprs + 2); ++ } ++} ++ ++/* ++ * Do what is necessary for `va_start'. The argument is ignored; ++ * We look at the current function to determine if stdarg or varargs ++ * is used. ++ */ ++ ++rtx ++s390_builtin_saveregs (arglist) ++ tree arglist ATTRIBUTE_UNUSED; ++{ ++ rtx off, block, dest, tmp; ++ tree fntype = TREE_TYPE (current_function_decl); ++ ++ int stdarg = (TYPE_ARG_TYPES (fntype) != 0 ++ && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype))) ++ != void_type_node)); ++ /* Allocate the va_list constructor */ ++ block = assign_stack_local (BLKmode, 4 * UNITS_PER_WORD, BITS_PER_WORD); ++ RTX_UNCHANGING_P (block) = 1; ++ RTX_UNCHANGING_P (XEXP (block, 0)) = 1; ++ ++ /* ++ * Store the # of named gpr and fpr in 1st and 2nd word of va_list ++ */ ++ ++ dest = change_address (block, ptr_mode, ++ plus_constant ( ++ XEXP (block, 0) ++ ,0)); ++ emit_move_insn (dest, GEN_INT (current_function_args_info.gprs)); ++ dest = change_address (block, ptr_mode, ++ plus_constant (XEXP (block, 0), UNITS_PER_WORD)); ++ emit_move_insn (dest, GEN_INT (current_function_args_info.fprs)); ++ ++ /* ++ * Store the address of the overflow area in 3rd word of va_list ++ */ ++ ++ ++ ++ if (stdarg) ++ off = current_function_arg_offset_rtx; ++ else { /* non ansi varargs */ ++ if (GET_CODE (current_function_arg_offset_rtx) != CONST_INT) { ++ debug_rtx (current_function_arg_offset_rtx); ++ abort (); ++ } ++ ++ if (INTVAL (current_function_arg_offset_rtx) != 0) ++ off = gen_rtx_CONST_INT (Pmode, ++ INTVAL (current_function_arg_offset_rtx)- ++ UNITS_PER_WORD); ++ else ++ off = current_function_arg_offset_rtx; ++ } ++ ++ dest = change_address (block, ptr_mode, ++ plus_constant (XEXP (block, 0),2*UNITS_PER_WORD)); ++ ++ tmp = expand_binop (Pmode, add_optab, virtual_incoming_args_rtx, ++ off, ++ dest, 0, OPTAB_WIDEN); ++ if (tmp != dest) ++ emit_move_insn (dest, tmp); ++ ++ /* ++ * Store the address of the register savearea in 4rd word of va_list ++ */ ++ ++ dest = change_address (block, ptr_mode, ++ plus_constant (XEXP (block, 0),3*UNITS_PER_WORD)); ++ ++ tmp = expand_binop (Pmode, add_optab, virtual_incoming_args_rtx, ++ GEN_INT (-STACK_POINTER_OFFSET), ++ dest, 0, OPTAB_WIDEN); ++ if (tmp != dest) ++ emit_move_insn (dest, tmp); ++ ++ /* Return the address of the va_list constructor. */ ++ return XEXP (block, 0); ++} ++ ++ ++/* Implementation of Trampoline ++ Gpr 1 is used as base register and for the jump ++ to the nested function. ++ Gpr 0 is static chain. */ ++ ++void ++s390_trampoline_template (FILE * file) ++{ ++ if (TARGET_64BIT) ++ { ++ fprintf (file, "larl\t%s,0f\n", reg_names[1]); ++ fprintf (file, "lg\t%s,0(%s)\n", reg_names[0], reg_names[1]); ++ fprintf (file, "lg\t%s,8(%s)\n", reg_names[1], reg_names[1]); ++ fprintf (file, "br\t%s\n", reg_names[1]); ++ fprintf (file, "0:\t.quad\t0\n"); ++ fprintf (file, ".quad\t0\n"); ++ } ++ else ++ { ++ fprintf (file, "basr\t%s,0\n", reg_names[1]); ++ fprintf (file, "l\t%s,10(%s)\n", reg_names[0], reg_names[1]); ++ fprintf (file, "l\t%s,14(%s)\n", reg_names[1], reg_names[1]); ++ fprintf (file, "br\t%s\n", reg_names[1]); ++ fprintf (file, ".long\t0\n"); ++ fprintf (file, ".long\t0\n"); ++ } ++} ++ ++void ++s390_initialize_trampoline (addr, fnaddr, cxt) ++ rtx addr; ++ rtx fnaddr; ++ rtx cxt; ++{ ++ emit_move_insn (gen_rtx ++ (MEM, Pmode, ++ memory_address (Pmode, ++ plus_constant (addr, (TARGET_64BIT ? 20 : 12) ))), cxt); ++ emit_move_insn (gen_rtx ++ (MEM, Pmode, ++ memory_address (Pmode, ++ plus_constant (addr, (TARGET_64BIT ? 28 : 16) ))), fnaddr); ++} +diff -urN gcc-20011006/gcc/config/s390/s390.h src-native-new/gcc/config/s390/s390.h +--- gcc-20011006/gcc/config/s390/s390.h Thu Jan 1 00:00:00 1970 ++++ src-native-new/gcc/config/s390/s390.h Tue Feb 19 05:57:15 2002 +@@ -0,0 +1,1887 @@ ++/* Definitions of target machine for GNU compiler, for IBM S/390 ++ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. ++ Contributed by Hartmut Penner (hpenner@de.ibm.com) and ++ Ulrich Weigand (uweigand@de.ibm.com). ++This file is part of GNU CC. ++ ++GNU CC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++GNU CC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GNU CC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++#ifndef _S390_H ++#define _S390_H ++ ++#define TARGET_VERSION fprintf (stderr, " (S/390)"); ++ ++extern int flag_pic; ++ ++/* Run-time compilation parameters selecting different hardware subsets. */ ++ ++extern int target_flags; ++ ++/* Target macros checked at runtime of compiler. */ ++ ++#define TARGET_HARD_FLOAT (target_flags & 1) ++#define TARGET_BACKCHAIN (target_flags & 2) ++#define TARGET_SMALL_EXEC (target_flags & 4) ++#define TARGET_DEBUG_ARG (target_flags & 8) ++#define TARGET_64BIT (target_flags & 16) ++#define TARGET_MVCLE (target_flags & 32) ++ ++#define TARGET_DEFAULT 0x3 ++#define TARGET_SOFT_FLOAT (!(target_flags & 1)) ++ ++/* Macro to define tables used to set the flags. This is a list in braces ++ of pairs in braces, each pair being { "NAME", VALUE } ++ where VALUE is the bits to set or minus the bits to clear. ++ An empty string NAME is used to identify the default VALUE. */ ++ ++#define TARGET_SWITCHES \ ++{ { "hard-float", 1, N_("Use hardware fp")}, \ ++ { "soft-float", -1, N_("Don't use hardware fp")}, \ ++ { "backchain", 2, N_("Set backchain")}, \ ++ { "no-backchain", -2, N_("Don't set backchain (faster, but debug harder")}, \ ++ { "small-exec", 4, N_("Use bras for execucable < 64k")}, \ ++ { "no-small-exec",-4, N_("Don't use bras")}, \ ++ { "debug", 8, N_("Additional debug prints")}, \ ++ { "no-debug", -8, N_("Don't print additional debug prints")}, \ ++ { "64", 16, N_("64 bit mode")}, \ ++ { "31", -16, N_("31 bit mode")}, \ ++ { "mvcle", 32, N_("mvcle use")}, \ ++ { "no-mvcle", -32, N_("mvc&ex")}, \ ++ { "", TARGET_DEFAULT, 0 } } ++ ++/* Define this to change the optimizations performed by default. */ ++#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) optimization_options(LEVEL, SIZE) ++ ++/* The current function count for create unique internal labels. */ ++ ++extern int s390_function_count; ++ ++/* The amount of space used for outgoing arguments. */ ++ ++extern int current_function_outgoing_args_size; ++ ++/* Target machine storage layout. */ ++ ++/* Define this if most significant bit is lowest numbered in instructions ++ that operate on numbered bit-fields. */ ++ ++#define BITS_BIG_ENDIAN 1 ++ ++/* Define this if most significant byte of a word is the lowest numbered. */ ++ ++#define BYTES_BIG_ENDIAN 1 ++ ++/* Define this if MS word of a multiword is the lowest numbered. */ ++ ++#define WORDS_BIG_ENDIAN 1 ++ ++/* Number of bits in an addressable storage unit. */ ++ ++#define BITS_PER_UNIT 8 ++ ++/* Width in bits of a "word", which is the contents of a machine register. */ ++ ++#define BITS_PER_WORD (TARGET_64BIT ? 64 : 32) ++#define MAX_BITS_PER_WORD 64 ++ ++/* Width of a word, in units (bytes). */ ++ ++#define UNITS_PER_WORD (TARGET_64BIT ? 8 : 4) ++#define MIN_UNITS_PER_WORD 4 ++ ++/* Width in bits of a pointer. See also the macro `Pmode' defined below. */ ++ ++#define POINTER_SIZE (TARGET_64BIT ? 64 : 32) ++ ++/* A C expression for the size in bits of the type `short' on the ++ target machine. If you don't define this, the default is half a ++ word. (If this would be less than one storage unit, it is ++ rounded up to one unit.) */ ++#define SHORT_TYPE_SIZE 16 ++ ++/* A C expression for the size in bits of the type `int' on the ++ target machine. If you don't define this, the default is one ++ word. */ ++#define INT_TYPE_SIZE 32 ++ ++/* A C expression for the size in bits of the type `long' on the ++ target machine. If you don't define this, the default is one ++ word. */ ++#define LONG_TYPE_SIZE (TARGET_64BIT ? 64 : 32) ++#define MAX_LONG_TYPE_SIZE 64 ++ ++/* A C expression for the size in bits of the type `long long' on the ++ target machine. If you don't define this, the default is two ++ words. */ ++#define LONG_LONG_TYPE_SIZE 64 ++ ++/* Right now we only support two floating point formats, the ++ 32 and 64 bit ieee formats. */ ++ ++#define FLOAT_TYPE_SIZE 32 ++#define DOUBLE_TYPE_SIZE 64 ++#define LONG_DOUBLE_TYPE_SIZE 64 ++ ++/* Define this macro if it is advisable to hold scalars in registers ++ in a wider mode than that declared by the program. In such cases, ++ the value is constrained to be within the bounds of the declared ++ type, but kept valid in the wider mode. The signedness of the ++ extension may differ from that of the type. */ ++ ++#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \ ++if (INTEGRAL_MODE_P (MODE) && \ ++ GET_MODE_SIZE (MODE) < UNITS_PER_WORD) { \ ++ (MODE) = Pmode; \ ++ } ++ ++/* Defining PROMOTE_FUNCTION_ARGS eliminates some unnecessary zero/sign ++ extensions applied to char/short functions arguments. Defining ++ PROMOTE_FUNCTION_RETURN does the same for function returns. */ ++ ++#define PROMOTE_FUNCTION_ARGS ++#define PROMOTE_FUNCTION_RETURN ++#define PROMOTE_FOR_CALL_ONLY ++ ++/* Allocation boundary (in *bits*) for storing pointers in memory. */ ++ ++#define POINTER_BOUNDARY 32 ++ ++/* Allocation boundary (in *bits*) for storing arguments in argument list. */ ++ ++#define PARM_BOUNDARY (TARGET_64BIT ? 64 : 32) ++ ++/* Boundary (in *bits*) on which stack pointer should be aligned. */ ++ ++#define STACK_BOUNDARY 64 ++ ++/* Allocation boundary (in *bits*) for the code of a function. */ ++ ++#define FUNCTION_BOUNDARY 32 ++ ++/* There is no point aligning anything to a rounder boundary than this. */ ++ ++#define BIGGEST_ALIGNMENT 64 ++ ++/* Alignment of field after `int : 0' in a structure. */ ++ ++#define EMPTY_FIELD_BOUNDARY 32 ++ ++/* Alignment on even adresses for LARL instruction. */ ++ ++#define CONSTANT_ALIGNMENT(EXP, ALIGN) (ALIGN) < 16 ? 16 : (ALIGN) ++ ++#define DATA_ALIGNMENT(TYPE, ALIGN) (ALIGN) < 16 ? 16 : (ALIGN) ++ ++/* Define this if move instructions will actually fail to work when given ++ unaligned data. */ ++ ++#define STRICT_ALIGNMENT 0 ++ ++/* real arithmetic */ ++ ++#define REAL_ARITHMETIC ++ ++/* Define target floating point format. */ ++ ++#undef TARGET_FLOAT_FORMAT ++#ifdef IEEE_FLOAT ++#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT ++#else ++#define TARGET_FLOAT_FORMAT IBM_FLOAT_FORMAT ++#endif ++ ++/* Define if special allocation order desired. */ ++ ++#define REG_ALLOC_ORDER \ ++{ 1, 2, 3, 4, 5, 0, 14, 13, 12, 11, 10, 9, 8, 7, 6, \ ++ 16, 17, 18, 19, 20, 21, 22, 23, \ ++ 24, 25, 26, 27, 28, 29, 30, 31, \ ++ 15, 32, 33 } ++ ++/* Standard register usage. */ ++ ++#define INT_REGNO_P(N) ( (N) >= 0 && (N) < 16 ) ++#ifdef IEEE_FLOAT ++#define FLOAT_REGNO_P(N) ( (N) >= 16 && (N) < 32 ) ++#else ++#define FLOAT_REGNO_P(N) ( (N) >= 16 && (N) < 20 ) ++#endif ++#define CC_REGNO_P(N) ( (N) == 33 ) ++ ++/* Number of actual hardware registers. The hardware registers are ++ assigned numbers for the compiler from 0 to just below ++ FIRST_PSEUDO_REGISTER. ++ All registers that the compiler knows about must be given numbers, ++ even those that are not normally considered general registers. ++ For the 390, we give the data registers numbers 0-15, ++ and the floating point registers numbers 16-19. ++ G5 and following have 16 IEEE floating point register, ++ which get numbers 16-31. */ ++ ++#define FIRST_PSEUDO_REGISTER 34 ++ ++/* The following register have a fix usage ++ GPR 12: GOT register points to the GOT, setup in prologue, ++ GOT contains pointer to variables in shared libraries ++ GPR 13: Base register setup in prologue to point to the ++ literal table of each function ++ GPR 14: Return registers holds the return address ++ GPR 15: Stack pointer */ ++ ++#define PIC_OFFSET_TABLE_REGNUM 12 ++#define BASE_REGISTER 13 ++#define RETURN_REGNUM 14 ++#define STACK_POINTER_REGNUM 15 ++ ++#define FIXED_REGISTERS \ ++{ 0, 0, 0, 0, \ ++ 0, 0, 0, 0, \ ++ 0, 0, 0, 0, \ ++ 0, 1, 1, 1, \ ++ 0, 0, 0, 0, \ ++ 0, 0, 0, 0, \ ++ 0, 0, 0, 0, \ ++ 0, 0, 0, 0, \ ++ 1, 1 } ++ ++/* 1 for registers not available across function calls. These must include ++ the FIXED_REGISTERS and also any registers that can be used without being ++ saved. ++ The latter must include the registers where values are returned ++ and the register where structure-value addresses are passed. */ ++ ++#define CALL_USED_REGISTERS \ ++{ 1, 1, 1, 1, \ ++ 1, 1, 0, 0, \ ++ 0, 0, 0, 0, \ ++ 0, 1, 1, 1, \ ++ 1, 1, 0, 0, \ ++ 1, 1, 1, 1, \ ++ 1, 1, 1, 1, \ ++ 1, 1, 1, 1, \ ++ 1, 1 } ++ ++/* If not pic code, gpr 12 can be used. */ ++ ++#define CONDITIONAL_REGISTER_USAGE \ ++do \ ++ { \ ++ if (flag_pic) \ ++ { \ ++ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ ++ call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ ++ } \ ++ } while (0) ++ ++/* The following register have a special usage ++ GPR 11: Frame pointer if needed to point to automatic variables. ++ GPR 32: In functions with more the 5 args this register ++ points to that arguments, it is always eliminated ++ with stack- or frame-pointer. ++ GPR 33: Condition code 'register' */ ++ ++#define FRAME_POINTER_REGNUM 11 ++ ++#define ARG_POINTER_REGNUM 32 ++ ++#define CC_REGNUM 33 ++ ++/* We use the register %r0 to pass the static chain to a nested function. ++ ++ Note: It is assumed that this register is call-clobbered! ++ We can't use any of the function-argument registers either, ++ and register 1 is needed by the trampoline code, so we have ++ no other choice but using this one ... */ ++ ++#define STATIC_CHAIN_REGNUM 0 ++ ++/* Return number of consecutive hard regs needed starting at reg REGNO ++ to hold something of mode MODE. ++ This is ordinarily the length in words of a value of mode MODE ++ but can be less for certain modes in special long registers. */ ++ ++#define HARD_REGNO_NREGS(REGNO, MODE) \ ++ (FLOAT_REGNO_P(REGNO)? \ ++ (GET_MODE_CLASS(MODE) == MODE_COMPLEX_FLOAT ? 2 : 1) : \ ++ INT_REGNO_P(REGNO)? \ ++ ((GET_MODE_SIZE(MODE)+UNITS_PER_WORD-1) / UNITS_PER_WORD) : \ ++ 1) ++ ++/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. ++ The gprs can hold QI, HI, SI, SF, DF, SC and DC. ++ Even gprs can hold DI. ++ The floating point registers can hold DF, SF, DC and SC. */ ++ ++#define HARD_REGNO_MODE_OK(REGNO, MODE) \ ++ (FLOAT_REGNO_P(REGNO)? \ ++ (GET_MODE_CLASS(MODE) == MODE_FLOAT || \ ++ GET_MODE_CLASS(MODE) == MODE_COMPLEX_FLOAT) : \ ++ INT_REGNO_P(REGNO)? \ ++ (!((TARGET_64BIT && (MODE) == TImode) || \ ++ (!TARGET_64BIT && (MODE) == DImode)) || ((REGNO) & 1) == 0 ) : \ ++ CC_REGNO_P(REGNO)? \ ++ GET_MODE_CLASS (MODE) == MODE_CC : \ ++ 0) ++ ++/* Value is 1 if it is a good idea to tie two pseudo registers when one has ++ mode MODE1 and one has mode MODE2. ++ If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, ++ for any hard reg, then this must be 0 for correct output. */ ++ ++#define MODES_TIEABLE_P(MODE1, MODE2) \ ++ (((MODE1) == SFmode || (MODE1) == DFmode) \ ++ == ((MODE2) == SFmode || (MODE2) == DFmode)) ++ ++ ++/* Define this macro if references to a symbol must be treated ++ differently depending on something about the variable or ++ function named by the symbol (such as what section it is in). ++ ++ On s390, if using PIC, mark a SYMBOL_REF for a non-global symbol ++ so that we may access it directly in the GOT. */ ++ ++#define ENCODE_SECTION_INFO(DECL) \ ++do \ ++ { \ ++ if (flag_pic) \ ++ { \ ++ rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \ ++ ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \ ++ \ ++ if (GET_CODE (rtl) == MEM) \ ++ { \ ++ SYMBOL_REF_FLAG (XEXP (rtl, 0)) \ ++ = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \ ++ || ! TREE_PUBLIC (DECL)); \ ++ } \ ++ } \ ++ } \ ++while (0) ++ ++ ++/* This is an array of structures. Each structure initializes one pair ++ of eliminable registers. The "from" register number is given first, ++ followed by "to". Eliminations of the same "from" register are listed ++ in order of preference. */ ++ ++#define ELIMINABLE_REGS \ ++{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ ++ { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ ++ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}} ++ ++#define CAN_ELIMINATE(FROM, TO) (1) ++ ++#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ ++{ if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ ++ { (OFFSET) = 0; } \ ++ else if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \ ++ { (OFFSET) = s390_arg_frame_offset (); } \ ++ else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ ++ { (OFFSET) = s390_arg_frame_offset (); } \ ++} ++ ++#define CAN_DEBUG_WITHOUT_FP ++ ++/* Value should be nonzero if functions must have frame pointers. ++ Zero means the frame pointer need not be set up (and parms may be ++ accessed via the stack pointer) in functions that seem suitable. ++ This is computed in `reload', in reload1.c. */ ++ ++#define FRAME_POINTER_REQUIRED 0 ++ ++/* Define the classes of registers for register constraints in the ++ machine description. Also define ranges of constants. ++ ++ One of the classes must always be named ALL_REGS and include all hard regs. ++ If there is more than one class, another class must be named NO_REGS ++ and contain no registers. ++ ++ The name GENERAL_REGS must be the name of a class (or an alias for ++ another name such as ALL_REGS). This is the class of registers ++ that is allowed by "g" or "r" in a register constraint. ++ Also, registers outside this class are allocated only when ++ instructions express preferences for them. ++ ++ The classes must be numbered in nondecreasing order; that is, ++ a larger-numbered class must never be contained completely ++ in a smaller-numbered class. ++ ++ For any two classes, it is very desirable that there be another ++ class that represents their union. */ ++ ++/*#define SMALL_REGISTER_CLASSES 1*/ ++ ++enum reg_class ++{ ++ NO_REGS, ADDR_REGS, GENERAL_REGS, ++ FP_REGS, ALL_REGS, LIM_REG_CLASSES ++}; ++ ++#define N_REG_CLASSES (int) LIM_REG_CLASSES ++ ++/* Give names of register classes as strings for dump file. */ ++ ++#define REG_CLASS_NAMES \ ++{ "NO_REGS","ADDR_REGS", "GENERAL_REGS", "FP_REGS", "ALL_REGS" } ++ ++/* Define which registers fit in which classes. This is an initializer for ++ a vector of HARD_REG_SET of length N_REG_CLASSES. ++ G5 and latter have 16 register and support IEEE floating point operations. */ ++ ++#define REG_CLASS_CONTENTS \ ++{ \ ++ { 0x00000000, 0x00000000 }, /* NO_REGS */ \ ++ { 0x0000fffe, 0x00000001 }, /* ADDR_REGS */ \ ++ { 0x0000ffff, 0x00000001 }, /* GENERAL_REGS */ \ ++ { 0xffff0000, 0x00000000 }, /* FP_REGS */ \ ++ { 0xffffffff, 0x00000003 }, /* ALL_REGS */ \ ++} ++ ++ ++/* The same information, inverted: ++ Return the class number of the smallest class containing ++ reg number REGNO. This could be a conditional expression ++ or could index an array. */ ++ ++#define REGNO_REG_CLASS(REGNO) (regclass_map[REGNO]) ++ ++extern enum reg_class regclass_map[]; /* smalled class containing REGNO */ ++ ++/* The class value for index registers, and the one for base regs. */ ++ ++#define INDEX_REG_CLASS ADDR_REGS ++#define BASE_REG_CLASS ADDR_REGS ++ ++/* Get reg_class from a letter such as appears in the machine description. */ ++ ++#define REG_CLASS_FROM_LETTER(C) \ ++ ((C) == 'a' ? ADDR_REGS : \ ++ (C) == 'd' ? GENERAL_REGS : \ ++ (C) == 'f' ? FP_REGS : NO_REGS) ++ ++/* The letters I, J, K, L and M in a register constraint string can be used ++ to stand for particular ranges of immediate operands. ++ This macro defines what the ranges are. ++ C is the letter, and VALUE is a constant value. ++ Return 1 if VALUE is in the range specified by C. */ ++ ++#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ++ ((C) == 'I' ? (unsigned long) (VALUE) < 256 : \ ++ (C) == 'J' ? (unsigned long) (VALUE) < 4096 : \ ++ (C) == 'K' ? (VALUE) >= -32768 && (VALUE) < 32768 : \ ++ (C) == 'L' ? (unsigned long) (VALUE) < 65536 : 0) ++ ++/* Similar, but for floating constants, and defining letters G and H. ++ Here VALUE is the CONST_DOUBLE rtx itself. */ ++ ++#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 1 ++ ++/* 'Q' means a memory-reference for a S-type operand. */ ++ ++#define EXTRA_CONSTRAINT(OP, C) \ ++ ((C) == 'Q' ? s_operand (OP, GET_MODE (OP)) : \ ++ (C) == 'S' ? larl_operand (OP, GET_MODE (OP)) : 0) ++ ++/* Given an rtx X being reloaded into a reg required to be in class CLASS, ++ return the class of reg to actually use. In general this is just CLASS; ++ but on some machines in some cases it is preferable to use a more ++ restrictive class. */ ++ ++#define PREFERRED_RELOAD_CLASS(X, CLASS) \ ++ (GET_CODE (X) == CONST_DOUBLE ? \ ++ (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? FP_REGS : ADDR_REGS) :\ ++ (GET_CODE (X) == CONST_INT ? \ ++ (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? FP_REGS : ADDR_REGS) :\ ++ GET_CODE (X) == PLUS || \ ++ GET_CODE (X) == LABEL_REF || \ ++ GET_CODE (X) == SYMBOL_REF || \ ++ GET_CODE (X) == CONST ? ADDR_REGS : (CLASS))) ++ ++/* Return the maximum number of consecutive registers needed to represent ++ mode MODE in a register of class CLASS. */ ++ ++#define CLASS_MAX_NREGS(CLASS, MODE) \ ++ ((CLASS) == FP_REGS ? \ ++ (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT ? 2 : 1) : \ ++ (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) ++ ++/* If we are copying between FP registers and anything else, we need a memory ++ location. */ ++ ++#define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \ ++ ((CLASS1) != (CLASS2) && ((CLASS1) == FP_REGS || (CLASS2) == FP_REGS)) ++ ++/* Get_secondary_mem widens its argument to BITS_PER_WORD which loses on 64bit ++ because the movsi and movsf patterns don't handle r/f moves. */ ++ ++#define SECONDARY_MEMORY_NEEDED_MODE(MODE) \ ++ (GET_MODE_BITSIZE (MODE) < 32 \ ++ ? mode_for_size (32, GET_MODE_CLASS (MODE), 0) \ ++ : MODE) ++ ++ ++/* A C expression whose value is nonzero if pseudos that have been ++ assigned to registers of class CLASS would likely be spilled ++ because registers of CLASS are needed for spill registers. ++ ++ The default value of this macro returns 1 if CLASS has exactly one ++ register and zero otherwise. On most machines, this default ++ should be used. Only define this macro to some other expression ++ if pseudo allocated by `local-alloc.c' end up in memory because ++ their hard registers were needed for spill registers. If this ++ macro returns nonzero for those classes, those pseudos will only ++ be allocated by `global.c', which knows how to reallocate the ++ pseudo to another register. If there would not be another ++ register available for reallocation, you should not change the ++ definition of this macro since the only effect of such a ++ definition would be to slow down register allocation. */ ++ ++/* Stack layout; function entry, exit and calling. */ ++ ++/* The current return address is on Offset 56 of the current frame ++ if we are in an leaf_function. Otherwise we have to go one stack ++ back. ++ The return address of anything farther back is accessed normally ++ at an offset of 56 from the frame pointer. ++ ++ FIXME: builtin_return_addr does not work correctly in a leaf ++ function, we need to find way to find out, if we ++ are in a leaf function ++ */ ++ ++#define _RETURN_ADDR_OFFSET (TARGET_64BIT ? 112 : 56) ++ ++#define RETURN_ADDR_RTX(count, frame) \ ++ gen_rtx (MEM, Pmode, \ ++ memory_address (Pmode, \ ++ plus_constant ( \ ++ copy_to_reg (gen_rtx (MEM, Pmode, \ ++ memory_address (Pmode, frame))), \ ++ _RETURN_ADDR_OFFSET))); ++ ++/* The following macros will turn on dwarf2 exception hndling ++ Other code location for this exception handling are ++ in s390.md (eh_return insn) and in linux.c in the prologue. */ ++ ++#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, RETURN_REGNUM) ++ ++/* We have 31 bit mode. */ ++ ++#define MASK_RETURN_ADDR (GEN_INT (0x7fffffff)) ++ ++/* Location, from where return address to load. */ ++ ++#define DWARF_FRAME_RETURN_COLUMN 14 ++ ++/* Describe how we implement __builtin_eh_return. */ ++#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 6 : INVALID_REGNUM) ++#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 10) ++#define EH_RETURN_HANDLER_RTX \ ++ gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, \ ++ TARGET_64BIT? -48 : -40)) ++ ++/* Define this if pushing a word on the stack makes the stack pointer a ++ smaller address. */ ++ ++#define STACK_GROWS_DOWNWARD ++ ++/* Define this if the nominal address of the stack frame is at the ++ high-address end of the local variables; that is, each additional local ++ variable allocated goes at a more negative offset in the frame. */ ++ ++/* #define FRAME_GROWS_DOWNWARD */ ++ ++/* Offset from stack-pointer to first location of outgoing args. */ ++ ++#define STACK_POINTER_OFFSET (TARGET_64BIT ? 160 : 96) ++ ++/* Offset within stack frame to start allocating local variables at. ++ If FRAME_GROWS_DOWNWARD, this is the offset to the END of the ++ first local allocated. Otherwise, it is the offset to the BEGINNING ++ of the first local allocated. */ ++ ++#define STARTING_FRAME_OFFSET \ ++ (STACK_POINTER_OFFSET + current_function_outgoing_args_size) ++ ++#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = 0 ++ ++/* If we generate an insn to push BYTES bytes, this says how many the stack ++ pointer really advances by. On S/390, we have no push instruction. */ ++ ++/* #define PUSH_ROUNDING(BYTES) */ ++ ++/* Accumulate the outgoing argument count so we can request the right ++ DSA size and determine stack offset. */ ++ ++#define ACCUMULATE_OUTGOING_ARGS 1 ++ ++/* Offset from the stack pointer register to an item dynamically ++ allocated on the stack, e.g., by `alloca'. ++ ++ The default value for this macro is `STACK_POINTER_OFFSET' plus the ++ length of the outgoing arguments. The default is correct for most ++ machines. See `function.c' for details. */ ++#define STACK_DYNAMIC_OFFSET(FUNDECL) (STARTING_FRAME_OFFSET) ++ ++/* Offset of first parameter from the argument pointer register value. ++ On the S/390, we define the argument pointer to the start of the fixed ++ area. */ ++#define FIRST_PARM_OFFSET(FNDECL) 0 ++ ++/* Define this if stack space is still allocated for a parameter passed ++ in a register. The value is the number of bytes allocated to this ++ area. */ ++/* #define REG_PARM_STACK_SPACE(FNDECL) 32 */ ++ ++/* Define this if the above stack space is to be considered part of the ++ space allocated by the caller. */ ++/* #define OUTGOING_REG_PARM_STACK_SPACE */ ++ ++/* 1 if N is a possible register number for function argument passing. ++ On S390, general registers 2 - 6 and floating point register 0 and 2 ++ are used in this way. */ ++ ++#define FUNCTION_ARG_REGNO_P(N) (((N) >=2 && (N) <7) || \ ++ (N) == 16 || (N) == 17) ++ ++/* Define a data type for recording info about an argument list during ++ the scan of that argument list. This data type should hold all ++ necessary information about the function itself and about the args ++ processed so far, enough to enable macros such as FUNCTION_ARG to ++ determine where the next arg should go. */ ++ ++typedef struct s390_arg_structure ++{ ++ int gprs; /* gpr so far */ ++ int fprs; /* fpr so far */ ++} ++CUMULATIVE_ARGS; ++ ++ ++/* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to ++ a function whose data type is FNTYPE. ++ For a library call, FNTYPE is 0. */ ++ ++#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, NN) \ ++ ((CUM).gprs=0, (CUM).fprs=0) ++ ++/* Update the data in CUM to advance over an argument of mode MODE and ++ data type TYPE. (TYPE is null for libcalls where that information ++ may not be available.) */ ++ ++#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ ++ s390_function_arg_advance (&CUM, MODE, TYPE, NAMED) ++ ++/* Define where to put the arguments to a function. Value is zero to push ++ the argument on the stack, or a hard register in which to store the ++ argument. */ ++ ++#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ ++ s390_function_arg (&CUM, MODE, TYPE, NAMED) ++ ++/* Define where to expect the arguments of a function. Value is zero, if ++ the argument is on the stack, or a hard register in which the argument ++ is stored. It is the same like FUNCTION_ARG, except for unnamed args ++ That means, that all in case of varargs used, the arguments are expected ++ from the stack. ++ S/390 has already space on the stack for args coming in registers, ++ they are pushed in prologue, if needed. */ ++ ++ ++/* Define the `__builtin_va_list' type. */ ++ ++#define BUILD_VA_LIST_TYPE(VALIST) \ ++ (VALIST) = s390_build_va_list () ++ ++/* Implement `va_start' for varargs and stdarg. */ ++ ++#define EXPAND_BUILTIN_VA_START(stdarg, valist, nextarg) \ ++ s390_va_start (stdarg, valist, nextarg) ++ ++/* Implement `va_arg'. */ ++ ++#define EXPAND_BUILTIN_VA_ARG(valist, type) \ ++ s390_va_arg (valist, type) ++ ++/* For an arg passed partly in registers and partly in memory, this is the ++ number of registers used. For args passed entirely in registers or ++ entirely in memory, zero. */ ++ ++#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0 ++ ++ ++/* Define if returning from a function call automatically pops the ++ arguments described by the number-of-args field in the call. */ ++ ++#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) 0 ++ ++ ++/* Define how to find the value returned by a function. VALTYPE is the ++ data type of the value (as a tree). ++ If the precise function being called is known, FUNC is its FUNCTION_DECL; ++ otherwise, FUNC is 15. */ ++ ++#define RET_REG(MODE) ((GET_MODE_CLASS (MODE) == MODE_INT \ ++ || TARGET_SOFT_FLOAT ) ? 2 : 16) ++ ++ ++/* for structs the address is passed, and the Callee makes a ++ copy, only if needed */ ++ ++#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ ++ s390_function_arg_pass_by_reference (MODE, TYPE) ++ ++ ++/* Register 2 (and 3) for integral values ++ or floating point register 0 (and 2) for fp values are used. */ ++ ++#define FUNCTION_VALUE(VALTYPE, FUNC) \ ++ gen_rtx_REG ((INTEGRAL_TYPE_P (VALTYPE) \ ++ && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \ ++ || POINTER_TYPE_P (VALTYPE) \ ++ ? word_mode : TYPE_MODE (VALTYPE), \ ++ TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_HARD_FLOAT ? 16 : 2) ++ ++/* Define how to find the value returned by a library function assuming ++ the value has mode MODE. */ ++ ++#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, RET_REG (MODE)) ++ ++/* 1 if N is a possible register number for a function value. */ ++ ++#define FUNCTION_VALUE_REGNO_P(N) ((N) == 2 || (N) == 16) ++ ++/* The definition of this macro implies that there are cases where ++ a scalar value cannot be returned in registers. */ ++ ++#define RETURN_IN_MEMORY(type) \ ++ (TYPE_MODE (type) == BLKmode || \ ++ TYPE_MODE (type) == DCmode || \ ++ TYPE_MODE (type) == SCmode) ++ ++/* Mode of stack savearea. ++ FUNCTION is VOIDmode because calling convention maintains SP. ++ BLOCK needs Pmode for SP. ++ NONLOCAL needs twice Pmode to maintain both backchain and SP. */ ++ ++#define STACK_SAVEAREA_MODE(LEVEL) \ ++ (LEVEL == SAVE_FUNCTION ? VOIDmode \ ++ : LEVEL == SAVE_NONLOCAL ? (TARGET_64BIT ? TImode : DImode) : Pmode) ++ ++/* Structure value address is passed as invisible first argument (gpr 2). */ ++ ++#define STRUCT_VALUE 0 ++ ++/* This macro definition sets up a default value for `main' to return. */ ++ ++#define DEFAULT_MAIN_RETURN c_expand_return (integer_zero_node) ++ ++/* Length in units of the trampoline for entering a nested function. */ ++ ++#define TRAMPOLINE_SIZE (TARGET_64BIT ? 36 : 20) ++ ++/* Initialize the dynamic part of trampoline. */ ++ ++#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \ ++ s390_initialize_trampoline ((ADDR), (FNADDR), (CXT)) ++ ++/* Template for constant part of trampoline. */ ++ ++#define TRAMPOLINE_TEMPLATE(FILE) \ ++ s390_trampoline_template (FILE) ++ ++/* Output assembler code to FILE to increment profiler label # LABELNO ++ for profiling a function entry. */ ++ ++#define FUNCTION_PROFILER(FILE, LABELNO) \ ++do { \ ++ extern rtx s390_profile[]; \ ++ extern s390_pool_count; \ ++ rtx tmp; \ ++ static char label[128]; \ ++ fprintf (FILE, "# function profiler \n"); \ ++ if (TARGET_64BIT) \ ++ { \ ++ rtx tmp[1]; \ ++ output_asm_insn ("stg\t14,8(15)", tmp); \ ++ sprintf (label, "%sP%d", LPREFIX, LABELNO); \ ++ tmp[0] = gen_rtx_SYMBOL_REF (Pmode, label); \ ++ SYMBOL_REF_FLAG (tmp[0]) = 1; \ ++ output_asm_insn ("larl\t1,%0", tmp); \ ++ tmp[0] = gen_rtx_SYMBOL_REF (Pmode, "_mcount"); \ ++ if (flag_pic) \ ++ { \ ++ tmp[0] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, tmp[0]), 113); \ ++ tmp[0] = gen_rtx_CONST (Pmode, tmp[0]); \ ++ } \ ++ output_asm_insn ("brasl\t14,%0", tmp); \ ++ output_asm_insn ("lg\t14,8(15)", tmp); \ ++ } \ ++ else \ ++ { \ ++ output_asm_insn ("l 14,4(15)", s390_profile); \ ++ s390_pool_count = 0; \ ++ output_asm_insn ("st 14,4(15)", s390_profile); \ ++ output_asm_insn ("l 14,%4", s390_profile); \ ++ output_asm_insn ("l 1,%9", s390_profile); \ ++ if (flag_pic) \ ++ { \ ++ output_asm_insn ("ar 1,13", s390_profile); \ ++ output_asm_insn ("bas 14,0(14,13)", s390_profile); \ ++ } \ ++ else \ ++ { \ ++ output_asm_insn ("basr 14,14", s390_profile); \ ++ } \ ++ output_asm_insn ("l 14,4(15)", s390_profile); \ ++ } \ ++} while (0) ++ ++/* #define PROFILE_BEFORE_PROLOGUE */ ++ ++/* There are three profiling modes for basic blocks available. ++ The modes are selected at compile time by using the options ++ -a or -ax of the gnu compiler. ++ The variable `profile_block_flag' will be set according to the ++ selected option. ++ ++ profile_block_flag == 0, no option used: ++ ++ No profiling done. ++ ++ profile_block_flag == 1, -a option used. ++ ++ Count frequency of execution of every basic block. ++ ++ profile_block_flag == 2, -ax option used. ++ ++ Generate code to allow several different profiling modes at run time. ++ Available modes are: ++ Produce a trace of all basic blocks. ++ Count frequency of jump instructions executed. ++ In every mode it is possible to start profiling upon entering ++ certain functions and to disable profiling of some other functions. ++ ++ The result of basic-block profiling will be written to a file `bb.out'. ++ If the -ax option is used parameters for the profiling will be read ++ from file `bb.in'. ++ ++*/ ++ ++/* The following macro shall output assembler code to FILE ++ to initialize basic-block profiling. ++ ++ If profile_block_flag == 2 ++ ++ Output code to call the subroutine `__bb_init_trace_func' ++ and pass two parameters to it. The first parameter is ++ the address of a block allocated in the object module. ++ The second parameter is the number of the first basic block ++ of the function. ++ ++ The name of the block is a local symbol made with this statement: ++ ++ ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 0); ++ ++ Of course, since you are writing the definition of ++ `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you ++ can take a short cut in the definition of this macro and use the ++ name that you know will result. ++ ++ The number of the first basic block of the function is ++ passed to the macro in BLOCK_OR_LABEL. ++ ++ If described in a virtual assembler language the code to be ++ output looks like: ++ ++ parameter1 <- LPBX0 ++ parameter2 <- BLOCK_OR_LABEL ++ call __bb_init_trace_func ++ ++ else if profile_block_flag != 0 ++ ++ Output code to call the subroutine `__bb_init_func' ++ and pass one single parameter to it, which is the same ++ as the first parameter to `__bb_init_trace_func'. ++ ++ The first word of this parameter is a flag which will be nonzero if ++ the object module has already been initialized. So test this word ++ first, and do not call `__bb_init_func' if the flag is nonzero. ++ Note: When profile_block_flag == 2 the test need not be done ++ but `__bb_init_trace_func' *must* be called. ++ ++ BLOCK_OR_LABEL may be used to generate a label number as a ++ branch destination in case `__bb_init_func' will not be called. ++ ++ If described in a virtual assembler language the code to be ++ output looks like: ++ ++ cmp (LPBX0),0 ++ jne local_label ++ parameter1 <- LPBX0 ++ call __bb_init_func ++local_label: ++ ++*/ ++ ++#undef FUNCTION_BLOCK_PROFILER ++#define FUNCTION_BLOCK_PROFILER(FILE, BLOCK_OR_LABEL) \ ++do \ ++ { \ ++ if (TARGET_64BIT) \ ++ { \ ++ rtx tmp[1]; \ ++ fprintf (FILE, "# function block profiler %d \n", profile_block_flag); \ ++ output_asm_insn ("ipm 0", tmp); \ ++ output_asm_insn ("aghi 15,-224", tmp); \ ++ output_asm_insn ("stmg 14,5,160(15)", tmp); \ ++ output_asm_insn ("larl 2,.LPBX0", tmp); \ ++ switch (profile_block_flag) \ ++ { \ ++ case 2: \ ++ if (BLOCK_OR_LABEL < 0x10000) { \ ++ tmp[0] = gen_rtx_CONST_INT (Pmode, (BLOCK_OR_LABEL)); \ ++ output_asm_insn ("llill 3,%x0", tmp); \ ++ } else { \ ++ int bo = BLOCK_OR_LABEL; \ ++ tmp[0] = gen_rtx_CONST_INT (Pmode, bo&0x7fff); \ ++ output_asm_insn ("llill 3,%x0", tmp); \ ++ tmp[0] = gen_rtx_CONST_INT (Pmode, (bo&0xffff0000)>>16); \ ++ output_asm_insn ("iilh 3,%x0", tmp); \ ++ } \ ++ tmp[0] = gen_rtx_SYMBOL_REF (Pmode, "__bb_init_trace_func"); \ ++ if (flag_pic) \ ++ { \ ++ tmp[0] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, tmp[0]), 113); \ ++ tmp[0] = gen_rtx_CONST (Pmode, tmp[0]); \ ++ } \ ++ output_asm_insn ("brasl\t14,%0", tmp); \ ++ break; \ ++ default: \ ++ output_asm_insn ("cli 7(2),0", tmp); \ ++ output_asm_insn ("jne 2f", tmp); \ ++ tmp[0] = gen_rtx_SYMBOL_REF (Pmode, "__bb_init_func"); \ ++ if (flag_pic) \ ++ { \ ++ tmp[0] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, tmp[0]), 113); \ ++ tmp[0] = gen_rtx_CONST (Pmode, tmp[0]); \ ++ } \ ++ output_asm_insn ("brasl\t14,%0", tmp); \ ++ break; \ ++ } \ ++ output_asm_insn ("2:", tmp); \ ++ output_asm_insn ("lmg 14,5,160(15)", tmp); \ ++ output_asm_insn ("aghi 15,224", tmp); \ ++ output_asm_insn ("spm 0", tmp); \ ++ } \ ++ else \ ++ { \ ++ extern rtx s390_profile[]; \ ++ fprintf (FILE, "# function block profiler %d \n", profile_block_flag); \ ++ output_asm_insn ("ipm 0", s390_profile); \ ++ output_asm_insn ("ahi 15,-128", s390_profile); \ ++ output_asm_insn ("stm 14,5,96(15)", s390_profile); \ ++ output_asm_insn ("l 2,%6", s390_profile); \ ++ if (flag_pic) \ ++ output_asm_insn ("ar 2,13", s390_profile); \ ++ switch (profile_block_flag) \ ++ { \ ++ case 2: \ ++ output_asm_insn ("l 4,%1", s390_profile); \ ++ if (BLOCK_OR_LABEL < 0x8000) { \ ++ s390_profile[8] = gen_rtx_CONST_INT (Pmode, (BLOCK_OR_LABEL)); \ ++ output_asm_insn ("lhi 3,%8", s390_profile); \ ++ } else { \ ++ int bo = BLOCK_OR_LABEL; \ ++ s390_profile[8] = gen_rtx_CONST_INT (Pmode, (bo&0xffff8000)>>15); \ ++ output_asm_insn ("lhi 3,%8", s390_profile); \ ++ output_asm_insn ("sll 3,15", s390_profile); \ ++ s390_profile[8] = gen_rtx_CONST_INT (Pmode, bo&0x7fff); \ ++ output_asm_insn ("ahi 3,%8", s390_profile); \ ++ } \ ++ break; \ ++ default: \ ++ output_asm_insn ("l 4,%0", s390_profile); \ ++ output_asm_insn ("cli 3(2),0", s390_profile); \ ++ output_asm_insn ("jne 2f", s390_profile); \ ++ break; \ ++ } \ ++ if (flag_pic) \ ++ output_asm_insn ("bas 14,0(4,13)", s390_profile); \ ++ else \ ++ output_asm_insn ("basr 14,4", s390_profile); \ ++ output_asm_insn ("2:", s390_profile); \ ++ output_asm_insn ("lm 14,5,96(15)", s390_profile); \ ++ output_asm_insn ("ahi 15,128", s390_profile); \ ++ output_asm_insn ("spm 0", s390_profile); \ ++ } \ ++ } while (0) ++ ++/* The following macro shall output assembler code to FILE ++ to increment a counter associated with basic block number BLOCKNO. ++ ++ If profile_block_flag == 2 ++ ++ Output code to initialize the global structure `__bb' and ++ call the function `__bb_trace_func' which will increment the ++ counter. ++ ++ `__bb' consists of two words. In the first word the number ++ of the basic block has to be stored. In the second word ++ the address of a block allocated in the object module ++ has to be stored. ++ ++ The basic block number is given by BLOCKNO. ++ ++ The address of the block is given by the label created with ++ ++ ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 0); ++ ++ by FUNCTION_BLOCK_PROFILER. ++ ++ Of course, since you are writing the definition of ++ `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you ++ can take a short cut in the definition of this macro and use the ++ name that you know will result. ++ ++ If described in a virtual assembler language the code to be ++ output looks like: ++ ++ move BLOCKNO -> (__bb) ++ move LPBX0 -> (__bb+4) ++ call __bb_trace_func ++ ++ Note that function `__bb_trace_func' must not change the ++ machine state, especially the flag register. To grant ++ this, you must output code to save and restore registers ++ either in this macro or in the macros MACHINE_STATE_SAVE ++ and MACHINE_STATE_RESTORE. The last two macros will be ++ used in the function `__bb_trace_func', so you must make ++ sure that the function prologue does not change any ++ register prior to saving it with MACHINE_STATE_SAVE. ++ ++ else if profile_block_flag != 0 ++ ++ Output code to increment the counter directly. ++ Basic blocks are numbered separately from zero within each ++ compiled object module. The count associated with block number ++ BLOCKNO is at index BLOCKNO in an array of words; the name of ++ this array is a local symbol made with this statement: ++ ++ ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 2); ++ ++ Of course, since you are writing the definition of ++ `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you ++ can take a short cut in the definition of this macro and use the ++ name that you know will result. ++ ++ If described in a virtual assembler language the code to be ++ output looks like: ++ ++ inc (LPBX2+4*BLOCKNO) ++ ++*/ ++ ++#define BLOCK_PROFILER(FILE, BLOCKNO) \ ++do \ ++ { \ ++ if (TARGET_64BIT) \ ++ { \ ++ rtx tmp[1]; \ ++ fprintf (FILE, "# block profiler %d block %d \n", \ ++ profile_block_flag, BLOCKNO); \ ++ output_asm_insn ("ipm 14", tmp); \ ++ output_asm_insn ("aghi 15,-224", tmp); \ ++ output_asm_insn ("stmg 14,5,160(15)", tmp); \ ++ output_asm_insn ("larl 2,_bb", tmp); \ ++ if ((BLOCKNO*8) < 0x10000) { \ ++ tmp[0] = gen_rtx_CONST_INT (Pmode, (BLOCKNO*8)); \ ++ output_asm_insn ("llill 3,%x0", tmp); \ ++ } else { \ ++ int bo = BLOCKNO*8; \ ++ tmp[0] = gen_rtx_CONST_INT (Pmode, bo&0xffff); \ ++ output_asm_insn ("llill 3,%x0", tmp); \ ++ tmp[0] = gen_rtx_CONST_INT (Pmode, (bo&0xffff0000)>>16); \ ++ output_asm_insn ("iilh 3,%x0", tmp); \ ++ } \ ++ switch (profile_block_flag) \ ++ { \ ++ case 2: \ ++ output_asm_insn ("stg 3,0(2)", tmp); \ ++ output_asm_insn ("larl 3,.LPBX0", tmp); \ ++ output_asm_insn ("stg 3,0(2)", tmp); \ ++ tmp[0] = gen_rtx_SYMBOL_REF (Pmode, "__bb_trace_func"); \ ++ if (flag_pic) \ ++ { \ ++ tmp[0] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, tmp[0]), 113); \ ++ tmp[0] = gen_rtx_CONST (Pmode, tmp[0]); \ ++ } \ ++ output_asm_insn ("brasl\t14,%0", tmp); \ ++ break; \ ++ default: \ ++ output_asm_insn ("larl 2,.LPBX2", tmp); \ ++ output_asm_insn ("la 2,0(2,3)", tmp); \ ++ output_asm_insn ("lg 3,0(2)", tmp); \ ++ output_asm_insn ("aghi 3,1", tmp); \ ++ output_asm_insn ("stg 3,0(2)", tmp); \ ++ break; \ ++ } \ ++ output_asm_insn ("lmg 14,5,160(15)", tmp); \ ++ output_asm_insn ("ahi 15,224", tmp); \ ++ output_asm_insn ("spm 14", tmp); \ ++ } \ ++ else \ ++ { \ ++ extern rtx s390_profile[]; \ ++ fprintf (FILE, "# block profiler %d block %d \n", \ ++ profile_block_flag,BLOCKNO); \ ++ output_asm_insn ("ipm 14", s390_profile); \ ++ output_asm_insn ("ahi 15,-128", s390_profile); \ ++ output_asm_insn ("stm 14,5,96(15)", s390_profile); \ ++ switch (profile_block_flag) \ ++ { \ ++ case 2: \ ++ output_asm_insn ("l 4,%2", s390_profile); \ ++ output_asm_insn ("l 2,%5", s390_profile); \ ++ if (flag_pic) \ ++ output_asm_insn ("ar 2,13", s390_profile); \ ++ if (BLOCKNO < 0x8000) { \ ++ s390_profile[7] = gen_rtx_CONST_INT (Pmode, (BLOCKNO)*4); \ ++ output_asm_insn ("lhi 3,%8", s390_profile); \ ++ } else { \ ++ int bo = BLOCKNO; \ ++ s390_profile[8] = gen_rtx_CONST_INT (Pmode, (bo&0xffff8000)>>15); \ ++ output_asm_insn ("lhi 3,%8", s390_profile); \ ++ output_asm_insn ("sll 3,15", s390_profile); \ ++ s390_profile[8] = gen_rtx_CONST_INT (Pmode, bo&0x7fff); \ ++ output_asm_insn ("ahi 3,%7", s390_profile); \ ++ } \ ++ output_asm_insn ("st 3,0(2)", s390_profile); \ ++ output_asm_insn ("mvc 0(4,2),%5", s390_profile); \ ++ if (flag_pic) \ ++ output_asm_insn ("bas 14,0(4,13)", s390_profile); \ ++ else \ ++ output_asm_insn ("basr 14,4", s390_profile); \ ++ break; \ ++ default: \ ++ if (BLOCKNO < 0x2000) { \ ++ s390_profile[8] = gen_rtx_CONST_INT (Pmode, (BLOCKNO)*4); \ ++ output_asm_insn ("lhi 2,%8", s390_profile); \ ++ } else { \ ++ int bo = BLOCKNO*4; \ ++ s390_profile[8] = gen_rtx_CONST_INT (Pmode, (bo&0xffff8000)>>15); \ ++ output_asm_insn ("lhi 2,%8", s390_profile); \ ++ output_asm_insn ("sll 2,15", s390_profile); \ ++ s390_profile[8] = gen_rtx_CONST_INT (Pmode, bo&0x7fff); \ ++ output_asm_insn ("ahi 2,%8", s390_profile); \ ++ } \ ++ output_asm_insn ("a 2,%7", s390_profile); \ ++ if (flag_pic) \ ++ output_asm_insn ("l 3,0(2,13)", s390_profile); \ ++ else \ ++ output_asm_insn ("l 3,0(2)", s390_profile); \ ++ output_asm_insn ("ahi 3,1", s390_profile); \ ++ if (flag_pic) \ ++ output_asm_insn ("st 3,0(2,13)", s390_profile); \ ++ else \ ++ output_asm_insn ("st 3,0(2)", s390_profile); \ ++ break; \ ++ } \ ++ output_asm_insn ("lm 14,5,96(15)", s390_profile); \ ++ output_asm_insn ("ahi 15,128", s390_profile); \ ++ output_asm_insn ("spm 14", s390_profile); \ ++ } \ ++ } while (0) ++ ++ ++/* The following macro shall output assembler code to FILE ++ to indicate a return from function during basic-block profiling. ++ ++ If profiling_block_flag == 2: ++ ++ Output assembler code to call function `__bb_trace_ret'. ++ ++ Note that function `__bb_trace_ret' must not change the ++ machine state, especially the flag register. To grant ++ this, you must output code to save and restore registers ++ either in this macro or in the macros MACHINE_STATE_SAVE_RET ++ and MACHINE_STATE_RESTORE_RET. The last two macros will be ++ used in the function `__bb_trace_ret', so you must make ++ sure that the function prologue does not change any ++ register prior to saving it with MACHINE_STATE_SAVE_RET. ++ ++ else if profiling_block_flag != 0: ++ ++ The macro will not be used, so it need not distinguish ++ these cases. ++*/ ++ ++#define FUNCTION_BLOCK_PROFILER_EXIT(FILE) \ ++do { \ ++ if (TARGET_64BIT) \ ++ { \ ++ rtx tmp[1]; \ ++ fprintf (FILE, "# block profiler exit \n"); \ ++ output_asm_insn ("ipm 14", tmp); \ ++ output_asm_insn ("aghi 15,-224", tmp); \ ++ output_asm_insn ("stmg 14,5,160(15)", tmp); \ ++ tmp[0] = gen_rtx_SYMBOL_REF (Pmode, "__bb_trace_ret"); \ ++ if (flag_pic) \ ++ { \ ++ tmp[0] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, tmp[0]), 113); \ ++ tmp[0] = gen_rtx_CONST (Pmode, tmp[0]); \ ++ } \ ++ output_asm_insn ("brasl 14,%0", tmp); \ ++ output_asm_insn ("lmg 14,5,160(15)", tmp); \ ++ output_asm_insn ("aghi 15,224", tmp); \ ++ output_asm_insn ("spm 14", tmp); \ ++ } \ ++ else \ ++ { \ ++ extern rtx s390_profile[]; \ ++ fprintf (FILE, "# block profiler exit \n"); \ ++ output_asm_insn ("ipm 14", s390_profile); \ ++ output_asm_insn ("ahi 15,-128", s390_profile); \ ++ output_asm_insn ("stm 14,5,96(15)", s390_profile); \ ++ output_asm_insn ("l 4,%3", s390_profile); \ ++ if (flag_pic) \ ++ output_asm_insn ("bas 14,0(4,13)", s390_profile); \ ++ else \ ++ output_asm_insn ("basr 14,4", s390_profile); \ ++ output_asm_insn ("lm 14,5,96(15)", s390_profile); \ ++ output_asm_insn ("ahi 15,128", s390_profile); \ ++ output_asm_insn ("spm 14", s390_profile); \ ++ } \ ++ } while (0) ++ ++/* The function `__bb_trace_func' is called in every basic block ++ and is not allowed to change the machine state. Saving (restoring) ++ the state can either be done in the BLOCK_PROFILER macro, ++ before calling function (rsp. after returning from function) ++ `__bb_trace_func', or it can be done inside the function by ++ defining the macros: ++ ++ MACHINE_STATE_SAVE(ID) ++ MACHINE_STATE_RESTORE(ID) ++ ++ In the latter case care must be taken, that the prologue code ++ of function `__bb_trace_func' does not already change the ++ state prior to saving it with MACHINE_STATE_SAVE. ++ ++ The parameter `ID' is a string identifying a unique macro use. ++ ++ On the s390 all save/restore is done in macros above ++*/ ++ ++/* ++#define MACHINE_STATE_SAVE(ID) \ ++ fprintf (FILE, "\tahi 15,-128 # save state\n"); \ ++ fprintf (FILE, "\tstm 14,5,96(15)\n"); \ ++ ++#define MACHINE_STATE_RESTORE(ID) \ ++ fprintf (FILE, "\tlm 14,5,96(15) # restore state\n"); \ ++ fprintf (FILE, "\tahi 15,128\n"); \ ++*/ ++ ++ ++/* Define EXIT_IGNORE_STACK if, when returning from a function, the stack ++ pointer does not matter (provided there is a frame pointer). */ ++ ++#define EXIT_IGNORE_STACK 1 ++ ++/* Addressing modes, and classification of registers for them. */ ++ ++/* #define HAVE_POST_INCREMENT */ ++/* #define HAVE_POST_DECREMENT */ ++ ++/* #define HAVE_PRE_DECREMENT */ ++/* #define HAVE_PRE_INCREMENT */ ++ ++/* These assume that REGNO is a hard or pseudo reg number. They give ++ nonzero only if REGNO is a hard reg of the suitable class or a pseudo ++ reg currently allocated to a suitable hard reg. ++ These definitions are NOT overridden anywhere. */ ++ ++#define REGNO_OK_FOR_INDEX_P(REGNO) \ ++ (((REGNO) > 0 && (REGNO) < 16) || (REGNO) == ARG_POINTER_REGNUM \ ++ /* || (REGNO) == FRAME_POINTER_REGNUM */ \ ++ || (reg_renumber[REGNO] > 0 && reg_renumber[REGNO] < 16)) ++ ++#define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_INDEX_P (REGNO) ++ ++#define REGNO_OK_FOR_DATA_P(REGNO) \ ++ ((REGNO) < 16 || (unsigned) reg_renumber[REGNO] < 16) ++ ++#define REGNO_OK_FOR_FP_P(REGNO) \ ++ FLOAT_REGNO_P (REGNO) ++ ++/* Now macros that check whether X is a register and also, ++ strictly, whether it is in a specified class. */ ++ ++/* 1 if X is a data register. */ ++ ++#define DATA_REG_P(X) (REG_P (X) && REGNO_OK_FOR_DATA_P (REGNO (X))) ++ ++/* 1 if X is an fp register. */ ++ ++#define FP_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FP_P (REGNO (X))) ++ ++/* 1 if X is an address register. */ ++ ++#define ADDRESS_REG_P(X) (REG_P (X) && REGNO_OK_FOR_BASE_P (REGNO (X))) ++ ++/* Maximum number of registers that can appear in a valid memory address. */ ++ ++#define MAX_REGS_PER_ADDRESS 2 ++ ++/* Recognize any constant value that is a valid address. */ ++ ++#define CONSTANT_ADDRESS_P(X) 0 ++ ++#define SYMBOLIC_CONST(X) \ ++(GET_CODE (X) == SYMBOL_REF \ ++ || GET_CODE (X) == LABEL_REF \ ++ || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X))) ++ ++/* General operand is everything except SYMBOL_REF, CONST and CONST_DOUBLE ++ they have to be forced to constant pool ++ CONST_INT have to be forced into constant pool, if greater than ++ 64k. Depending on the insn they have to be force into constant pool ++ for smaller value; in this case we have to work with nonimmediate operand. */ ++ ++#define LEGITIMATE_PIC_OPERAND_P(X) \ ++ legitimate_pic_operand_p (X) ++ ++/* Nonzero if the constant value X is a legitimate general operand. ++ It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ ++ ++#define LEGITIMATE_CONSTANT_P(X) \ ++ legitimate_constant_p (X) ++ ++/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check ++ its validity for a certain class. We have two alternate definitions ++ for each of them. The usual definition accepts all pseudo regs; the ++ other rejects them all. The symbol REG_OK_STRICT causes the latter ++ definition to be used. ++ ++ Most source files want to accept pseudo regs in the hope that they will ++ get allocated to the class that the insn wants them to be in. ++ Some source files that are used after register allocation ++ need to be strict. */ ++ ++/* ++ * Nonzero if X is a hard reg that can be used as an index or if it is ++ * a pseudo reg. ++ */ ++ ++#define REG_OK_FOR_INDEX_NONSTRICT_P(X) \ ++((GET_MODE (X) == Pmode) && \ ++ ((REGNO (X) > 0 && REGNO (X) < 16) || \ ++ (REGNO (X) == ARG_POINTER_REGNUM) || \ ++ (REGNO (X) >= FIRST_PSEUDO_REGISTER))) ++ ++/* Nonzero if X is a hard reg that can be used as a base reg or if it is ++ a pseudo reg. */ ++ ++#define REG_OK_FOR_BASE_NONSTRICT_P(X) REG_OK_FOR_INDEX_NONSTRICT_P (X) ++ ++/* Nonzero if X is a hard reg that can be used as an index. */ ++ ++#define REG_OK_FOR_INDEX_STRICT_P(X) \ ++((GET_MODE (X) == Pmode) && (REGNO_OK_FOR_INDEX_P (REGNO (X)))) ++ ++/* Nonzero if X is a hard reg that can be used as a base reg. */ ++ ++#define REG_OK_FOR_BASE_STRICT_P(X) \ ++((GET_MODE (X) == Pmode) && (REGNO_OK_FOR_BASE_P (REGNO (X)))) ++ ++ ++#ifndef REG_OK_STRICT ++#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_NONSTRICT_P(X) ++#define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NONSTRICT_P(X) ++#else ++#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_STRICT_P(X) ++#define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P(X) ++#endif ++ ++ ++/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a ++ valid memory address for an instruction. ++ The MODE argument is the machine mode for the MEM expression ++ that wants to use this address. ++ ++ The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS, ++ except for CONSTANT_ADDRESS_P which is actually machine-independent. */ ++ ++#ifdef REG_OK_STRICT ++#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ ++{ \ ++ if (legitimate_address_p (MODE, X, 1)) \ ++ goto ADDR; \ ++} ++#else ++#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ ++{ \ ++ if (legitimate_address_p (MODE, X, 0)) \ ++ goto ADDR; \ ++} ++#endif ++ ++ ++/* S/390 has no mode dependent addresses. */ ++ ++#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) ++ ++/* Try machine-dependent ways of modifying an illegitimate address ++ to be legitimate. If we find one, return the new, valid address. ++ This macro is used in only one place: `memory_address' in explow.c. */ ++ ++#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \ ++{ \ ++ (X) = legitimize_address (X, OLDX, MODE); \ ++ if (memory_address_p (MODE, X)) \ ++ goto WIN; \ ++} ++ ++/* Specify the machine mode that this machine uses for the index in the ++ tablejump instruction. */ ++ ++#define CASE_VECTOR_MODE (TARGET_64BIT ? DImode : SImode) ++ ++/* Define this if the tablejump instruction expects the table to contain ++ offsets from the address of the table. ++ Do not define this if the table should contain absolute addresses. */ ++ ++/* #define CASE_VECTOR_PC_RELATIVE */ ++ ++/* Load from integral MODE < SI from memory into register makes sign_extend ++ or zero_extend ++ In our case sign_extension happens for Halfwords, other no extension. */ ++ ++#define LOAD_EXTEND_OP(MODE) \ ++(TARGET_64BIT ? ((MODE) == QImode ? ZERO_EXTEND : \ ++ (MODE) == HImode ? SIGN_EXTEND : NIL) \ ++ : ((MODE) == HImode ? SIGN_EXTEND : NIL)) ++ ++/* Specify the tree operation to be used to convert reals to integers. */ ++ ++#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR ++ ++/* Define this if fixuns_trunc is the same as fix_trunc. */ ++ ++/* #define FIXUNS_TRUNC_LIKE_FIX_TRUNC */ ++ ++/* We use "unsigned char" as default. */ ++ ++#define DEFAULT_SIGNED_CHAR 0 ++ ++/* This is the kind of divide that is easiest to do in the general case. */ ++ ++#define EASY_DIV_EXPR TRUNC_DIV_EXPR ++ ++/* Max number of bytes we can move from memory to memory in one reasonably ++ fast instruction. */ ++ ++#define MOVE_MAX 256 ++ ++/* Define this if zero-extension is slow (more than one real instruction). */ ++ ++#define SLOW_ZERO_EXTEND ++ ++/* Nonzero if access to memory by bytes is slow and undesirable. */ ++ ++#define SLOW_BYTE_ACCESS 1 ++ ++/* Define if shifts truncate the shift count which implies one can omit ++ a sign-extension or zero-extension of a shift count. */ ++ ++/* #define SHIFT_COUNT_TRUNCATED */ ++ ++/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits ++ is done just by pretending it is already truncated. */ ++ ++#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 ++ ++/* We assume that the store-condition-codes instructions store 0 for false ++ and some other value for true. This is the value stored for true. */ ++ ++/* #define STORE_FLAG_VALUE -1 */ ++ ++/* When a prototype says `char' or `short', really pass an `int'. */ ++ ++#define PROMOTE_PROTOTYPES 1 ++ ++/* Don't perform CSE on function addresses. */ ++ ++#define NO_FUNCTION_CSE ++ ++/* Specify the machine mode that pointers have. ++ After generation of rtl, the compiler makes no further distinction ++ between pointers and any other objects of this machine mode. */ ++ ++#define Pmode (TARGET_64BIT ? DImode : SImode) ++ ++/* A function address in a call instruction is a byte address (for ++ indexing purposes) so give the MEM rtx a byte's mode. */ ++ ++#define FUNCTION_MODE QImode ++ ++ ++/* A part of a C `switch' statement that describes the relative costs ++ of constant RTL expressions. It must contain `case' labels for ++ expression codes `const_int', `const', `symbol_ref', `label_ref' ++ and `const_double'. Each case must ultimately reach a `return' ++ statement to return the relative cost of the use of that kind of ++ constant value in an expression. The cost may depend on the ++ precise value of the constant, which is available for examination ++ in X, and the rtx code of the expression in which it is contained, ++ found in OUTER_CODE. ++ ++ CODE is the expression code--redundant, since it can be obtained ++ with `GET_CODE (X)'. */ ++/* Force_const_mem does not work out of reload, because the saveable_obstack ++ is set to reload_obstack, which does not live long enough. ++ Because of this we cannot use force_const_mem in addsi3. ++ This leads to problems with gen_add2_insn with a constant greater ++ than a short. Because of that we give a addition of greater ++ constants a cost of 3 (reload1.c 10096). */ ++ ++ ++#define CONST_COSTS(RTX, CODE, OUTER_CODE) \ ++ case CONST: \ ++ if ((GET_CODE (XEXP (RTX, 0)) == MINUS) && \ ++ (GET_CODE (XEXP (XEXP (RTX, 0), 1)) != CONST_INT)) \ ++ return 1000; \ ++ case CONST_INT: \ ++ if ((OUTER_CODE == PLUS) && \ ++ ((INTVAL (RTX) > 32767) || \ ++ (INTVAL (RTX) < -32768))) \ ++ return COSTS_N_INSNS (3); \ ++ case LABEL_REF: \ ++ case SYMBOL_REF: \ ++ case CONST_DOUBLE: \ ++ return 0; \ ++ ++ ++/* Like `CONST_COSTS' but applies to nonconstant RTL expressions. ++ This can be used, for example, to indicate how costly a multiply ++ instruction is. In writing this macro, you can use the construct ++ `COSTS_N_INSNS (N)' to specify a cost equal to N fast ++ instructions. OUTER_CODE is the code of the expression in which X ++ is contained. ++ ++ This macro is optional; do not define it if the default cost ++ assumptions are adequate for the target machine. */ ++ ++#define RTX_COSTS(X, CODE, OUTER_CODE) \ ++ case ASHIFT: \ ++ case ASHIFTRT: \ ++ case LSHIFTRT: \ ++ case PLUS: \ ++ case AND: \ ++ case IOR: \ ++ case XOR: \ ++ case MINUS: \ ++ case NEG: \ ++ case NOT: \ ++ return 1; \ ++ case MULT: \ ++ if (GET_MODE (XEXP (X, 0)) == DImode) \ ++ return 40; \ ++ else \ ++ return 7; \ ++ case DIV: \ ++ case UDIV: \ ++ case MOD: \ ++ case UMOD: \ ++ return 33; ++ ++ ++/* An expression giving the cost of an addressing mode that contains ++ ADDRESS. If not defined, the cost is computed from the ADDRESS ++ expression and the `CONST_COSTS' values. ++ ++ For most CISC machines, the default cost is a good approximation ++ of the true cost of the addressing mode. However, on RISC ++ machines, all instructions normally have the same length and ++ execution time. Hence all addresses will have equal costs. ++ ++ In cases where more than one form of an address is known, the form ++ with the lowest cost will be used. If multiple forms have the ++ same, lowest, cost, the one that is the most complex will be used. ++ ++ For example, suppose an address that is equal to the sum of a ++ register and a constant is used twice in the same basic block. ++ When this macro is not defined, the address will be computed in a ++ register and memory references will be indirect through that ++ register. On machines where the cost of the addressing mode ++ containing the sum is no higher than that of a simple indirect ++ reference, this will produce an additional instruction and ++ possibly require an additional register. Proper specification of ++ this macro eliminates this overhead for such machines. ++ ++ Similar use of this macro is made in strength reduction of loops. ++ ++ ADDRESS need not be valid as an address. In such a case, the cost ++ is not relevant and can be any value; invalid addresses need not be ++ assigned a different cost. ++ ++ On machines where an address involving more than one register is as ++ cheap as an address computation involving only one register, ++ defining `ADDRESS_COST' to reflect this can cause two registers to ++ be live over a region of code where only one would have been if ++ `ADDRESS_COST' were not defined in that manner. This effect should ++ be considered in the definition of this macro. Equivalent costs ++ should probably only be given to addresses with different numbers ++ of registers on machines with lots of registers. ++ ++ This macro will normally either not be defined or be defined as a ++ constant. ++ ++ On s390 symbols are expensive if compiled with fpic ++ lifetimes. */ ++ ++#define ADDRESS_COST(RTX) \ ++ ((flag_pic && GET_CODE (RTX) == SYMBOL_REF) ? 2 : 1) ++ ++/* On s390, copy between fprs and gprs is expensive. */ ++ ++#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \ ++ (((CLASS1 != CLASS2) && \ ++ (CLASS1 == FP_REGS || CLASS2 == FP_REGS)) ? 10 : 1) ++ ++ ++/* A C expression for the cost of moving data of mode M between a ++ register and memory. A value of 2 is the default; this cost is ++ relative to those in `REGISTER_MOVE_COST'. ++ ++ If moving between registers and memory is more expensive than ++ between two registers, you should define this macro to express the ++ relative cost. */ ++ ++#define MEMORY_MOVE_COST(M, C, I) 1 ++ ++/* A C expression for the cost of a branch instruction. A value of 1 ++ is the default; other values are interpreted relative to that. */ ++ ++#define BRANCH_COST 1 ++ ++/* Add any extra modes needed to represent the condition code. */ ++#define EXTRA_CC_MODES CCZmode, CCAmode, CCUmode, CCSmode, CCTmode ++ ++/* Define the names for the modes specified above. */ ++#define EXTRA_CC_NAMES "CCZ", "CCA", "CCU", "CCS", "CCT" ++ ++/* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE, ++ return the mode to be used for the comparison. */ ++ ++#define SELECT_CC_MODE(OP, X, Y) \ ++ ( (OP) == EQ || (OP) == NE ? CCZmode \ ++ : (OP) == LE || (OP) == LT || \ ++ (OP) == GE || (OP) == GT ? CCSmode \ ++ : (OP) == LEU || (OP) == LTU || \ ++ (OP) == GEU || (OP) == GTU ? CCUmode \ ++ : CCmode ) ++ ++ ++/* Define the information needed to generate branch and scc insns. This is ++ stored from the compare operation. Note that we can't use "rtx" here ++ since it hasn't been defined! */ ++ ++extern struct rtx_def *s390_compare_op0, *s390_compare_op1; ++ ++extern int s390_match_ccmode PARAMS ((struct rtx_def *, int)); ++ ++ ++/* How to refer to registers in assembler output. This sequence is ++ indexed by compiler's hard-register-number (see above). */ ++ ++#define REGISTER_NAMES \ ++{ "%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7", \ ++ "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", \ ++ "%f0", "%f2", "%f4", "%f6", "%f1", "%f3", "%f5", "%f7", \ ++ "%f8", "%f10", "%f12", "%f14", "%f9", "%f11", "%f13", "%f15", \ ++ "%ap", "%cc" \ ++} ++ ++/* implicit call of memcpy, not bcopy */ ++ ++#define TARGET_MEM_FUNCTIONS ++ ++ ++/* Define results of standard character escape sequences. */ ++ ++#define TARGET_BELL (0x07) ++#define TARGET_BS (0x08) ++#define TARGET_TAB (0x09) ++#define TARGET_NEWLINE (0x0A) ++#define TARGET_VT 11 ++#define TARGET_FF 12 ++#define TARGET_CR 13 ++ ++/* Print operand X (an rtx) in assembler syntax to file FILE. ++ CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified. ++ For `%' followed by punctuation, CODE is the punctuation and X is null. */ ++ ++#define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE) ++ ++#define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR) ++ ++ ++/* Define the codes that are matched by predicates in aux-output.c. */ ++ ++#define PREDICATE_CODES \ ++ {"s_operand", { MEM }}, \ ++ {"bras_sym_operand",{ SYMBOL_REF, CONST }}, \ ++ {"r_or_s_operand", { MEM, SUBREG, REG }}, \ ++ {"r_or_im8_operand", { CONST_INT, SUBREG, REG }}, \ ++ {"r_or_s_or_im8_operand", { MEM, SUBREG, REG, CONST_INT }}, \ ++ {"r_or_x_or_im16_operand", { MEM, SUBREG, REG, CONST_INT }}, \ ++ {"const0_operand", { CONST_INT, CONST_DOUBLE }}, \ ++ {"const1_operand", { CONST_INT, CONST_DOUBLE }}, \ ++ {"tmxx_operand", { CONST_INT, MEM }}, ++ ++ ++/* A C statement (sans semicolon) to update the integer variable COST ++ based on the relationship between INSN that is dependent on ++ DEP_INSN through the dependence LINK. The default is to make no ++ adjustment to COST. This can be used for example to specify to ++ the scheduler that an output- or anti-dependence does not incur ++ the same cost as a data-dependence. */ ++ ++#define ADJUST_COST(insn, link, dep_insn, cost) \ ++ (cost) = s390_adjust_cost (insn, link, dep_insn, cost) ++ ++/* S/390 constant pool breaks the devices in crtstuff.c to control section ++ in where code resides. We have to write it as asm code. */ ++#ifndef __s390x__ ++#define CRT_CALL_STATIC_FUNCTION(func) \ ++ if (0) \ ++ func (); /* ... to avoid warnings. */ \ ++ else \ ++ asm \ ++ ("bras\t%%r2,1f\n\ ++0: .long\t" #func " - 0b\n\ ++1: l\t%%r3,0(%%r2)\n\ ++ bas\t%%r14,0(%%r3,%%r2)" : : : "2", "3", "cc", "memory"); ++#endif ++ ++/* Constant Pool for all symbols operands which are changed with ++ force_const_mem during insn generation (expand_insn). */ ++ ++extern struct rtx_def *s390_pool_start_insn; ++extern int s390_pool_count; ++extern int s390_nr_constants; ++ ++/* Function is splitted in chunk, if literal pool could overflow ++ Value need to be lowered, if problems with displacement overflow. */ ++ ++#define S390_CHUNK_MAX 0xe00 ++#define S390_CHUNK_OV 0x1000 ++#define S390_POOL_MAX 0xe00 ++ ++#define ASM_OUTPUT_POOL_PROLOGUE(FILE, FUNNAME, fndecl, size) \ ++{ \ ++ register rtx insn; \ ++ struct pool_constant *pool; \ ++ \ ++ if (s390_pool_count == -1) \ ++ { \ ++ s390_nr_constants = 0; \ ++ for (pool = first_pool; pool; pool = pool->next) \ ++ if (pool->mark) s390_nr_constants++; \ ++ return; \ ++ } \ ++ if (first_pool == 0) { \ ++ s390_asm_output_pool_prologue (FILE, FUNNAME, fndecl, size); \ ++ return; \ ++ } \ ++ for (pool = first_pool; pool; pool = pool->next) \ ++ pool->mark = 0; \ ++ \ ++ insn = s390_pool_start_insn; \ ++ \ ++ if (insn==NULL_RTX) \ ++ insn = get_insns (); \ ++ else \ ++ insn = NEXT_INSN (insn); \ ++ for (; insn; insn = NEXT_INSN (insn)) { \ ++ if (GET_RTX_CLASS (GET_CODE (insn)) == 'i') { \ ++ if (s390_stop_dump_lit_p (insn)) { \ ++ mark_constants (PATTERN (insn)); \ ++ break; \ ++ } else \ ++ mark_constants (PATTERN (insn)); \ ++ } \ ++ } \ ++ \ ++ /* Mark entries referenced by other entries */ \ ++ for (pool = first_pool; pool; pool = pool->next) \ ++ if (pool->mark) \ ++ mark_constants (pool->constant); \ ++ \ ++ s390_asm_output_pool_prologue (FILE, FUNNAME, fndecl, size); \ ++} ++ ++/* We need to return, because otherwise the pool is deleted of the ++ constant pool after the first output. */ ++ ++#define ASM_OUTPUT_POOL_EPILOGUE(FILE, FUNNAME, fndecl, size) return; ++ ++#define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, EXP, MODE, ALIGN, LABELNO, WIN) \ ++{ \ ++ if ((s390_pool_count == 0) || (s390_pool_count > 0 && LABELNO >= 0)) \ ++ { \ ++ fprintf (FILE, ".LC%d:\n", LABELNO); \ ++ LABELNO = ~LABELNO; \ ++ } \ ++ if (s390_pool_count > 0) \ ++ { \ ++ fprintf (FILE, ".LC%d_%X:\n", ~LABELNO, s390_pool_count); \ ++ } \ ++ \ ++ /* Output the value of the constant itself. */ \ ++ switch (GET_MODE_CLASS (pool->mode)) \ ++ { \ ++ case MODE_FLOAT: \ ++ if (GET_CODE (x) != CONST_DOUBLE) \ ++ abort (); \ ++ \ ++ memcpy ((char *) &u, (char *) &CONST_DOUBLE_LOW (x), sizeof u); \ ++ assemble_real (u.d, pool->mode); \ ++ break; \ ++ \ ++ case MODE_INT: \ ++ case MODE_PARTIAL_INT: \ ++ if (flag_pic && (GET_CODE (x) == CONST || \ ++ GET_CODE (x) == SYMBOL_REF || \ ++ GET_CODE (x) == LABEL_REF )) \ ++ { \ ++ fprintf (FILE, "%s\t",TARGET_64BIT ? ASM_QUAD : ASM_LONG); \ ++ s390_output_symbolic_const (FILE, x); \ ++ fputc ('\n', (FILE)); \ ++ } \ ++ else \ ++ assemble_integer (x, GET_MODE_SIZE (pool->mode), 1); \ ++ break; \ ++ \ ++ default: \ ++ abort (); \ ++ } \ ++ goto WIN; \ ++} ++ ++#endif +diff -urN gcc-20011006/gcc/config/s390/s390.md src-native-new/gcc/config/s390/s390.md +--- gcc-20011006/gcc/config/s390/s390.md Thu Jan 1 00:00:00 1970 ++++ src-native-new/gcc/config/s390/s390.md Tue Feb 19 05:57:15 2002 +@@ -0,0 +1,5826 @@ ++;;- Machine description for GNU compiler -- S/390 / zSeries version. ++;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. ++;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and ++;; Ulrich Weigand (uweigand@de.ibm.com). ++;; This file is part of GNU CC. ++ ++;; GNU CC is free software; you can redistribute it and/or modify ++;; it under the terms of the GNU General Public License as published by ++;; the Free Software Foundation; either version 2, or (at your option) ++;; any later version. ++ ++;; GNU CC is distributed in the hope that it will be useful, ++;; but WITHOUT ANY WARRANTY; without even the implied warranty of ++;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++;; GNU General Public License for more details. ++ ++;; You should have received a copy of the GNU General Public License ++;; along with GNU CC; see the file COPYING. If not, write to ++;; the Free Software Foundation, 59 Temple Place - Suite 330, ++;; Boston, MA 02111-1307, USA. ++ ++;; ++;; Special constraints for s/390 machine description: ++;; ++;; a -- Any address register from 1 to 15. ++;; d -- Any register from 0 to 15. ++;; I -- An 8-bit constant (0..255). ++;; J -- A 12-bit constant (0..4095). ++;; K -- A 16-bit constant (-32768..32767). ++;; Q -- A memory reference without index-register. ++;; S -- Valid operand for the LARL instruction. ++;; ++;; Special formats used for outputting 390 instructions. ++;; ++;; %b -- Print a constant byte integer. xy ++;; %h -- Print a signed 16-bit. wxyz ++;; %N -- Print next register (second word of a DImode reg) or next word. ++;; %M -- Print next register (second word of a TImode reg) or next word. ++;; %O -- Print the offset of a memory reference (PLUS (REG) (CONST_INT)). ++;; %R -- Print the register of a memory reference (PLUS (REG) (CONST_INT)). ++;; ++;; We have a special constraint for pattern matching. ++;; ++;; s_operand -- Matches a valid S operand in a RS, SI or SS type instruction. ++;; ++;; r_or_s_operand -- Matches a register or a valid S operand in a RS, SI ++;; or SS type instruction or a register ++;; ++ ++;; Insn type. Used to default other attribute values. ++ ++; ++; Insn are devide in two classes: ++; mem: Use of base and/or index register for address generation ++; reg: Use of second and third register not for address generation ++; ++ ++(define_attr "atype" "mem,reg" (const_string "reg")) ++ ++; ++; Insn may take 1,2,3 or many cycles ++; For the scheduling it does not matter, if a instruction has ++; a issue_delay from 4 or more cycles, since the address dependency ++; between two insns needs at least 4 cycles. ++; ++ ++(define_attr "cycle" "1,2,3,n" (const_string "1")) ++ ++; ++; There are three classes of insns: ++; set: instruction setting a (potential) address relevant register ++; xset: instruction setting no address relevant register ++; la: instruction setting a (potential) address relevant register, ++; but behave 'better' on the pipeline ++; ++ ++(define_attr "type" "set,xset,la" (const_string "xset")) ++ ++; ++; Set operations changing a target register, which could be used for ++; address generation. Adjust cost will check, if realy applicable. ++; ++ ++(define_function_unit "memory" 1 0 ++ (and (eq_attr "type" "set") ++ (eq_attr "cycle" "1")) ++ 5 1 [(eq_attr "atype" "mem")] ) ++ ++(define_function_unit "memory" 1 0 ++ (and (eq_attr "type" "set") ++ (eq_attr "cycle" "2")) 5 2) ++ ++(define_function_unit "memory" 1 0 ++ (and (eq_attr "type" "set") ++ (eq_attr "cycle" "3")) 5 3) ++ ++(define_function_unit "memory" 1 0 ++ (and (eq_attr "type" "set") ++ (eq_attr "cycle" "n")) 5 4) ++ ++(define_function_unit "memory" 1 0 ++ (eq_attr "type" "la") 2 1) ++ ++; ++; xset insns, which don't set any valid address register. ++; Only the issue delay matters. ++; ++ ++(define_function_unit "memory" 1 0 ++ (and (eq_attr "type" "xset") ++ (eq_attr "cycle" "1")) 1 1) ++ ++(define_function_unit "memory" 1 0 ++ (and (eq_attr "type" "xset") ++ (eq_attr "cycle" "2")) 1 2) ++ ++(define_function_unit "memory" 1 0 ++ (and (eq_attr "type" "xset") ++ (eq_attr "cycle" "3")) 1 3) ++ ++(define_function_unit "memory" 1 0 ++ (and (eq_attr "type" "xset") ++ (eq_attr "cycle" "n")) 1 4) ++ ++; Operand type. Used to default length attribute values ++ ++(define_attr "op_type" ++ "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE" ++ (const_string "RX")) ++ ++;; Length in bytes. ++ ++(define_attr "length" "" ++(cond [ (eq_attr "op_type" "E") (const_int 2) ++ (eq_attr "op_type" "RR") (const_int 2) ++ (eq_attr "op_type" "RX") (const_int 4) ++ (eq_attr "op_type" "RI") (const_int 4) ++ (eq_attr "op_type" "RRE") (const_int 4) ++ (eq_attr "op_type" "RS") (const_int 4) ++ (eq_attr "op_type" "RSI") (const_int 4) ++ (eq_attr "op_type" "RX") (const_int 4) ++ (eq_attr "op_type" "S") (const_int 4) ++ (eq_attr "op_type" "SI") (const_int 4) ++ (eq_attr "op_type" "SS") (const_int 6) ++ (eq_attr "op_type" "SSE") (const_int 6) ++ (eq_attr "op_type" "RXE") (const_int 6) ++ (eq_attr "op_type" "RSE") (const_int 6) ++ (eq_attr "op_type" "RIL") (const_int 6)] ++ (const_int 4))) ++ ++;; Define attributes for `asm' insns. ++ ++(define_asm_attributes [(set_attr "type" "xset") ++ (set_attr "op_type" "NN")]) ++ ++;; ++;; Condition Codes ++;; ++; ++; CCL: Zero Nonzero Zero Nonzero (AL, ALR, SL, SLR, N, NC, NI, NR, O, OC, OI, OR, X, XC, XI, XR) ++; CCA: Zero Zero Overflow (A, AR, AH, AHI, S, SR, SH, SHI, LTR, LCR, LNR, LPR, SLA, SLDA, SLA, SRDA) ++; CCU: Equal ULess UGreater -- (CL, CLR, CLI, CLM) ++; CCS: Equal SLess SGreater -- (C, CR, CH, CHI, ICM) ++; CCT: Zero Mixed Mixed Ones (TM, TMH, TML) ++ ++; CCZ -> CCL / CCZ1 ++; CCZ1 -> CCA/CCU/CCS/CCT ++; CCS -> CCA ++ ++; String: CLC, CLCL, CLCLE, CLST, CUSE, MVCL, MVCLE, MVPG, MVST, SRST ++; Clobber: CKSM, CFC, CS, CDS, CUUTF, CUTFU, PLO, SPM, STCK, STCKE, TS, TRT, TRE, UPT ++ ++ ++;; ++;;- Compare instructions. ++;; ++ ++(define_expand "cmpdi" ++ [(set (reg:CC 33) ++ (compare:CC (match_operand:DI 0 "register_operand" "") ++ (match_operand:DI 1 "general_operand" "")))] ++ "TARGET_64BIT" ++ " ++{ ++ s390_compare_op0 = operands[0]; ++ s390_compare_op1 = operands[1]; ++ DONE; ++}") ++ ++(define_expand "cmpsi" ++ [(set (reg:CC 33) ++ (compare:CC (match_operand:SI 0 "register_operand" "") ++ (match_operand:SI 1 "general_operand" "")))] ++ "" ++ " ++{ ++ s390_compare_op0 = operands[0]; ++ s390_compare_op1 = operands[1]; ++ DONE; ++}") ++ ++;(define_expand "cmphi" ++; [(set (reg:CC 33) ++; (compare:CC (match_operand:HI 0 "register_operand" "") ++; (match_operand:HI 1 "general_operand" "")))] ++; "" ++; " ++;{ ++; s390_compare_op0 = operands[0]; ++; s390_compare_op1 = operands[1]; ++; DONE; ++;}") ++ ++;(define_expand "cmpqi" ++; [(set (reg:CC 33) ++; (compare:CC (match_operand:QI 0 "register_operand" "") ++; (match_operand:QI 1 "general_operand" "")))] ++; "" ++; " ++;{ ++; s390_compare_op0 = operands[0]; ++; s390_compare_op1 = operands[1]; ++; DONE; ++;}") ++ ++(define_expand "cmpdf" ++ [(set (reg:CC 33) ++ (compare:CC (match_operand:DF 0 "register_operand" "") ++ (match_operand:DF 1 "general_operand" "")))] ++ "TARGET_HARD_FLOAT" ++ " ++{ ++ s390_compare_op0 = operands[0]; ++ s390_compare_op1 = operands[1]; ++ DONE; ++}") ++ ++(define_expand "cmpsf" ++ [(set (reg:CC 33) ++ (compare:CC (match_operand:SF 0 "register_operand" "") ++ (match_operand:SF 1 "general_operand" "")))] ++ "TARGET_HARD_FLOAT" ++ " ++{ ++ s390_compare_op0 = operands[0]; ++ s390_compare_op1 = operands[1]; ++ DONE; ++}") ++ ++ ++; DI instructions ++ ++(define_insn "*cmpdi_tm2" ++ [(set (reg 33) ++ (compare (zero_extract:DI (match_operand:DI 0 "register_operand" "d") ++ (match_operand:DI 1 "const1_operand" "") ++ (match_operand:DI 2 "immediate_operand" "I")) ++ (const_int 0)))] ++ "s390_match_ccmode(insn, CCTmode) && ++ INTVAL(operands[2]) >= 0 && INTVAL(operands[2]) < 64" ++ "* ++{ ++ if (INTVAL (operands[2]) > 47) ++ { ++ operands[1] = GEN_INT (1 << (63 - INTVAL(operands[2]))); ++ return \"tmll\\t%0,%x1\"; ++ } ++ else if (INTVAL (operands[2]) > 31) ++ { ++ operands[1] = GEN_INT (1 << (47 - INTVAL(operands[2]))); ++ return \"tmlh\\t%0,%x1\"; ++ } ++ else if (INTVAL (operands[2]) > 15) ++ { ++ operands[1] = GEN_INT (1 << (31 - INTVAL(operands[2]))); ++ return \"tmhl\\t%0,%x1\"; ++ } ++ operands[1] = GEN_INT (1 << (15 - INTVAL(operands[2]))); ++ return \"tmhh\\t%0,%x1\"; ++}" ++ [(set_attr "op_type" "RX") ++ (set_attr "type" "xset")]) ++ ++ ++(define_insn "*cmpdi_tm" ++ [(set (reg 33) ++ (compare (and:DI (match_operand:DI 0 "register_operand" "%d") ++ (match_operand:DI 1 "tmxx_operand" "Lm")) ++ (const_int 0)))] ++ "s390_match_ccmode(insn, CCTmode)" ++ "* ++{ ++ unsigned HOST_WIDEST_INT i; ++ if (GET_CODE (operands[1]) == MEM && ++ GET_CODE (XEXP (operands[1],0)) == SYMBOL_REF && ++ CONSTANT_POOL_ADDRESS_P (XEXP (operands[1],0))) ++ { ++ operands[1] = get_pool_constant (XEXP (operands[1],0)); ++ } ++ ++ i = (unsigned HOST_WIDEST_INT) INTVAL (operands[1]); ++ ++ if (i >= 0x1000000000000ULL) ++ { ++ operands[1] = GEN_INT (i >> 48); ++ return \"tmhh\\t%0,%x1\"; ++ } ++ else if (i > 0x100000000ULL) ++ { ++ operands[1] = GEN_INT (i >> 32); ++ return \"tmhl\\t%0,%x1\"; ++ } ++ else if (i >= 0x10000ULL) ++ { ++ operands[1] = GEN_INT (i >> 16); ++ return \"tmlh\\t%0,%x1\"; ++ } ++ else ++ return \"tmll\\t%0,%x1\"; ++}" ++ [(set_attr "op_type" "RX") ++ (set_attr "type" "xset")]) ++ ++ ++(define_insn "*ltgr" ++ [(set (reg 33) ++ (compare (match_operand:DI 0 "register_operand" "d") ++ (match_operand:DI 1 "const0_operand" ""))) ++ (set (match_operand:DI 2 "register_operand" "=d") ++ (match_dup 0))] ++ "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT" ++ "ltgr\\t%2,%0" ++ [(set_attr "op_type" "RRE") ++ (set_attr "type" "set")]) ++ ++(define_insn "*cmpdi_ccs_0_64" ++ [(set (reg 33) ++ (compare (match_operand:DI 0 "register_operand" "d") ++ (match_operand:DI 1 "const0_operand" "")))] ++ "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT" ++ "ltgr\\t%0,%0" ++ [(set_attr "op_type" "RRE") ++ (set_attr "type" "set")]) ++ ++(define_insn "*cmpdi_ccs_0_31" ++ [(set (reg 33) ++ (compare (match_operand:DI 0 "register_operand" "d") ++ (match_operand:DI 1 "const0_operand" "")))] ++ "s390_match_ccmode(insn, CCSmode)" ++ "srda\\t%0,0" ++ [(set_attr "op_type" "RS") ++ (set_attr "type" "set")]) ++ ++(define_insn "*cmpdi_ccs" ++ [(set (reg 33) ++ (compare (match_operand:DI 0 "register_operand" "d,d,d") ++ (match_operand:DI 1 "general_operand" "d,K,m")))] ++ "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT" ++ "@ ++ cgr\\t%0,%1 ++ cghi\\t%0,%c1 ++ cg\\t%0,%1" ++ [(set_attr "op_type" "RRE,RI,RXE") ++ (set_attr "atype" "reg,reg,mem")]) ++ ++(define_insn "*cmpdi_ccu" ++ [(set (reg 33) ++ (compare (match_operand:DI 0 "register_operand" "d,d") ++ (match_operand:DI 1 "general_operand" "d,m")))] ++ "s390_match_ccmode(insn, CCUmode) && TARGET_64BIT" ++ "@ ++ clgr\\t%0,%1 ++ clg\\t%0,%1" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "atype" "reg,mem")]) ++ ++(define_insn "*cmpdi_ccu_mem" ++ [(set (reg 33) ++ (compare (match_operand:DI 0 "s_operand" "oQ") ++ (match_operand:DI 1 "s_operand" "oQ")))] ++ "s390_match_ccmode(insn, CCUmode)" ++ "clc\\t%O0(8,%R0),%1" ++ [(set_attr "op_type" "SS") ++ (set_attr "atype" "mem")]) ++ ++; SI instructions ++ ++(define_insn "*cmpsi_cct" ++ [(set (reg 33) ++ (compare (zero_extract:SI (match_operand:SI 0 "register_operand" "%d") ++ (match_operand:SI 1 "const1_operand" "") ++ (match_operand:SI 2 "immediate_operand" "I")) ++ (const_int 0)))] ++ "s390_match_ccmode(insn, CCTmode) && ++ INTVAL(operands[2]) >= 0 && INTVAL(operands[2]) < 32" ++ "* ++{ ++ if (INTVAL (operands[2]) > 15) ++ { ++ operands[1] = GEN_INT (1 << (31 - INTVAL(operands[2]))); ++ return \"tml\\t%0,%x1\"; ++ } ++ operands[1] = GEN_INT (1 << (15 - INTVAL(operands[2]))); ++ return \"tmh\\t%0,%x1\"; ++}" ++ [(set_attr "op_type" "RI") ++ (set_attr "type" "xset")]) ++ ++(define_insn "*cmpsi_tm" ++ [(set (reg 33) ++ (compare (and:SI (match_operand:SI 0 "register_operand" "%d") ++ (match_operand:SI 1 "tmxx_operand" "Lm")) ++ (const_int 0)))] ++ "s390_match_ccmode(insn, CCTmode)" ++ "* ++{ ++ unsigned long i; ++ if (GET_CODE (operands[1]) == MEM && ++ GET_CODE (XEXP (operands[1],0)) == SYMBOL_REF && ++ CONSTANT_POOL_ADDRESS_P (XEXP (operands[1],0))) ++ { ++ operands[1] = get_pool_constant (XEXP (operands[1],0)); ++ } ++ ++ i = (unsigned long) INTVAL (operands[1]); ++ if (i > 0xffff) ++ { ++ operands[1] = GEN_INT (i / 0x10000); ++ return \"tmh\\t%0,%x1\"; ++ } ++ return \"tml\\t%0,%x1\"; ++}" ++ [(set_attr "op_type" "RX") ++ (set_attr "type" "xset")]) ++ ++ ++(define_insn "*ltr" ++ [(set (reg 33) ++ (compare (match_operand:SI 0 "register_operand" "d") ++ (match_operand:SI 1 "const0_operand" ""))) ++ (set (match_operand:SI 2 "register_operand" "=d") ++ (match_dup 0))] ++ "s390_match_ccmode(insn, CCSmode)" ++ "ltr\\t%2,%0" ++ [(set_attr "op_type" "RR") ++ (set_attr "type" "set")]) ++ ++(define_insn "*icm15" ++ [(set (reg 33) ++ (compare (match_operand:SI 0 "s_operand" "Qo") ++ (match_operand:SI 1 "const0_operand" ""))) ++ (set (match_operand:SI 2 "register_operand" "=d") ++ (match_dup 0))] ++ "s390_match_ccmode(insn, CCSmode)" ++ "icm\\t%2,15,%0" ++ [(set_attr "op_type" "RS") ++ (set_attr "atype" "mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "*icm15_cconly" ++ [(set (reg 33) ++ (compare (match_operand:SI 0 "s_operand" "Qo") ++ (match_operand:SI 1 "const0_operand" ""))) ++ (clobber (match_scratch:SI 2 "=d"))] ++ "s390_match_ccmode(insn, CCSmode)" ++ "icm\\t%2,15,%0" ++ [(set_attr "op_type" "RS") ++ (set_attr "atype" "mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "*cmpsi_ccs_0" ++ [(set (reg 33) ++ (compare (match_operand:SI 0 "register_operand" "d") ++ (match_operand:SI 1 "const0_operand" "")))] ++ "s390_match_ccmode(insn, CCSmode)" ++ "ltr\\t%0,%0" ++ [(set_attr "op_type" "RR") ++ (set_attr "type" "set")]) ++ ++(define_insn "*cmpsidi_ccs" ++ [(set (reg 33) ++ (compare (match_operand:SI 0 "register_operand" "d") ++ (sign_extend:SI (match_operand:HI 1 "memory_operand" "m"))))] ++ "s390_match_ccmode(insn, CCSmode)" ++ "ch\\t%0,%1" ++ [(set_attr "op_type" "RR") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++(define_insn "*cmpsi_ccs" ++ [(set (reg 33) ++ (compare (match_operand:SI 0 "register_operand" "d,d,d") ++ (match_operand:SI 1 "general_operand" "d,K,m")))] ++ "s390_match_ccmode(insn, CCSmode)" ++ "@ ++ cr\\t%0,%1 ++ chi\\t%0,%c1 ++ c\\t%0,%1" ++ [(set_attr "op_type" "RR,RI,RX") ++ (set_attr "atype" "reg,reg,mem") ++ (set_attr "type" "xset,xset,xset")]) ++ ++(define_insn "*cmpsi_ccu" ++ [(set (reg 33) ++ (compare (match_operand:SI 0 "register_operand" "d,d") ++ (match_operand:SI 1 "general_operand" "d,m")))] ++ "s390_match_ccmode(insn, CCUmode)" ++ "@ ++ clr\\t%0,%1 ++ cl\\t%0,%1" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "atype" "reg,mem")]) ++ ++(define_insn "*cmpsi_ccu_mem" ++ [(set (reg 33) ++ (compare (match_operand:SI 0 "s_operand" "oQ") ++ (match_operand:SI 1 "s_operand" "oQ")))] ++ "s390_match_ccmode(insn, CCUmode)" ++ "clc\\t%O0(4,%R0),%1" ++ [(set_attr "op_type" "SS") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++ ++; HI instructions ++ ++(define_insn "*icm3" ++ [(set (reg 33) ++ (compare (match_operand:HI 0 "s_operand" "Qo") ++ (match_operand:HI 1 "const0_operand" ""))) ++ (set (match_operand:HI 2 "register_operand" "=d") ++ (match_dup 0))] ++ "s390_match_ccmode(insn, CCSmode)" ++ "icm\\t%2,3,%0" ++ [(set_attr "op_type" "RS") ++ (set_attr "atype" "mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "*cmphi_cct_0" ++ [(set (reg 33) ++ (compare (match_operand:HI 0 "register_operand" "d") ++ (match_operand:HI 1 "const0_operand" "")))] ++ "s390_match_ccmode(insn, CCTmode)" ++ "tml\\t%0,65535" ++ [(set_attr "op_type" "RX") ++ (set_attr "type" "xset")]) ++ ++(define_insn "*cmphi_ccs_0" ++ [(set (reg 33) ++ (compare (match_operand:HI 0 "s_operand" "Qo") ++ (match_operand:HI 1 "const0_operand" ""))) ++ (clobber (match_scratch:HI 2 "=d"))] ++ "s390_match_ccmode(insn, CCSmode)" ++ "icm\\t%2,3,%0" ++ [(set_attr "op_type" "RS") ++ (set_attr "atype" "mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "*cmphi_ccu" ++ [(set (reg 33) ++ (compare (match_operand:HI 0 "register_operand" "d") ++ (match_operand:HI 1 "s_operand" "Qo")))] ++ "s390_match_ccmode(insn, CCUmode)" ++ "clm\\t%0,3,%1" ++ [(set_attr "op_type" "RS") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++(define_insn "*cmphi_ccu_mem" ++ [(set (reg 33) ++ (compare (match_operand:HI 0 "s_operand" "oQ") ++ (match_operand:HI 1 "s_operand" "oQ")))] ++ "s390_match_ccmode(insn, CCUmode)" ++ "clc\\t%O0(2,%R0),%1" ++ [(set_attr "op_type" "SS") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++ ++; QI instructions ++ ++(define_insn "*icm1" ++ [(set (reg 33) ++ (compare (match_operand:QI 0 "s_operand" "Qo") ++ (match_operand:QI 1 "const0_operand" ""))) ++ (set (match_operand:QI 2 "register_operand" "=d") ++ (match_dup 0))] ++ "s390_match_ccmode(insn, CCSmode)" ++ "icm\\t%2,1,%0" ++ [(set_attr "op_type" "RS") ++ (set_attr "atype" "mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "*tm_0" ++ [(set (reg 33) ++ (compare (zero_extend:SI (and:QI (match_operand:QI 0 "s_operand" "Qo") ++ (match_operand:QI 1 "immediate_operand" ""))) ++ (const_int 0)))] ++ "s390_match_ccmode(insn, CCTmode) && ++ INTVAL(operands[1]) >= 0 && INTVAL(operands[1]) < 256" ++ "tm\\t%0,%1" ++ [(set_attr "op_type" "RI") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++(define_insn "*cmpqi_cct_0" ++ [(set (reg 33) ++ (compare (match_operand:QI 0 "register_operand" "d") ++ (match_operand:QI 1 "const0_operand" "")))] ++ "s390_match_ccmode(insn, CCTmode)" ++ "tml\\t%0,255" ++ [(set_attr "op_type" "RI") ++ (set_attr "type" "xset")]) ++ ++(define_insn "*cmpqi_ccs_0" ++ [(set (reg 33) ++ (compare (match_operand:QI 0 "s_operand" "Qo") ++ (match_operand:QI 1 "const0_operand" ""))) ++ (clobber (match_scratch:QI 2 "=d"))] ++ "s390_match_ccmode(insn, CCSmode)" ++ "icm\\t%2,1,%0" ++ [(set_attr "op_type" "RS") ++ (set_attr "type" "xset")]) ++ ++(define_insn "*cmpqi_ccu_0" ++ [(set (reg 33) ++ (compare (match_operand:QI 0 "s_operand" "Qo") ++ (match_operand:QI 1 "const0_operand" "")))] ++ "s390_match_ccmode(insn, CCUmode)" ++ "cli\\t%0,0" ++ [(set_attr "op_type" "SI") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++(define_insn "*cmpqi_ccu" ++ [(set (reg 33) ++ (compare (match_operand:QI 0 "register_operand" "d") ++ (match_operand:QI 1 "s_operand" "Qo")))] ++ "s390_match_ccmode(insn, CCUmode)" ++ "clm\\t%0,1,%1" ++ [(set_attr "op_type" "RS") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++(define_insn "*cmpqi_ccu_immed" ++ [(set (reg 33) ++ (compare (match_operand:QI 0 "s_operand" "Qo") ++ (match_operand:QI 1 "immediate_operand" "")))] ++ "s390_match_ccmode(insn, CCUmode) && ++ INTVAL(operands[1]) >= 0 && INTVAL(operands[1]) < 256" ++ "cli\\t%0,%1" ++ [(set_attr "op_type" "SI") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++(define_insn "*cmpqi_ccu_mem" ++ [(set (reg 33) ++ (compare (match_operand:QI 0 "s_operand" "oQ") ++ (match_operand:QI 1 "s_operand" "oQ")))] ++ "s390_match_ccmode(insn, CCUmode)" ++ "clc\\t%O0(1,%R0),%1" ++ [(set_attr "op_type" "SS") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++ ++; DF instructions ++ ++(define_insn "*cmpdf_ccs_0" ++ [(set (reg 33) ++ (compare (match_operand:DF 0 "register_operand" "f") ++ (match_operand:DF 1 "const0_operand" "")))] ++ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "ltdbr\\t%0,%0" ++ [(set_attr "op_type" "RRE") ++ (set_attr "type" "set")]) ++ ++(define_insn "*cmpdf_ccs_0_ibm" ++ [(set (reg 33) ++ (compare (match_operand:DF 0 "register_operand" "f") ++ (match_operand:DF 1 "const0_operand" "")))] ++ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "ltdr\\t%0,%0" ++ [(set_attr "op_type" "RR") ++ (set_attr "type" "set")]) ++ ++(define_insn "*cmpdf_ccs" ++ [(set (reg 33) ++ (compare (match_operand:DF 0 "register_operand" "f,f") ++ (match_operand:DF 1 "nonimmediate_operand" "f,m")))] ++ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "@ ++ cdbr\\t%0,%1 ++ cdb\\t%0,%1" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "xset,xset")]) ++ ++(define_insn "*cmpdf_ccs_ibm" ++ [(set (reg 33) ++ (compare (match_operand:DF 0 "register_operand" "f,f") ++ (match_operand:DF 1 "nonimmediate_operand" "f,m")))] ++ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "@ ++ cdr\\t%0,%1 ++ cd\\t%0,%1" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "xset,xset")]) ++ ++ ++; SF instructions ++ ++(define_insn "*cmpsf_ccs_0" ++ [(set (reg 33) ++ (compare (match_operand:SF 0 "register_operand" "f") ++ (match_operand:SF 1 "const0_operand" "")))] ++ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "ltebr\\t%0,%0" ++ [(set_attr "op_type" "RRE") ++ (set_attr "type" "set")]) ++ ++(define_insn "*cmpsf_ccs_0_ibm" ++ [(set (reg 33) ++ (compare (match_operand:SF 0 "register_operand" "f") ++ (match_operand:SF 1 "const0_operand" "")))] ++ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "lter\\t%0,%0" ++ [(set_attr "op_type" "RR") ++ (set_attr "type" "set")]) ++ ++(define_insn "*cmpsf_ccs" ++ [(set (reg 33) ++ (compare (match_operand:SF 0 "register_operand" "f,f") ++ (match_operand:SF 1 "nonimmediate_operand" "f,m")))] ++ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "@ ++ cebr\\t%0,%1 ++ ceb\\t%0,%1" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "xset,xset")]) ++ ++(define_insn "*cmpsf_ccs" ++ [(set (reg 33) ++ (compare (match_operand:SF 0 "register_operand" "f,f") ++ (match_operand:SF 1 "nonimmediate_operand" "f,m")))] ++ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "@ ++ cer\\t%0,%1 ++ ce\\t%0,%1" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "xset,xset")]) ++ ++ ++;; ++;;- Move instructions. ++;; ++ ++; ++; movti instruction pattern(s). ++; ++ ++(define_insn "movti" ++ [(set (match_operand:TI 0 "nonimmediate_operand" "=d,d,d,m,Q") ++ (match_operand:TI 1 "general_operand" "d,K,m,d,Q"))] ++ "TARGET_64BIT" ++ "* ++{ ++ switch (which_alternative) ++ { ++ case 0: /* d <- d */ ++ if (REGNO (operands[0]) == REGNO (operands[1]) + 1) ++ return \"lgr\\t%M0,%M1\;lgr\\t%0,%1\"; ++ else ++ return \"lgr\\t%0,%1\;lgr\\t%M0,%M1\"; ++ ++ case 1: /* d <- K */ ++ if (INTVAL(operands[1]) < 0) ++ return \"lghi\\t%0,-1\;lghi\\t%M0,%h1\"; ++ else ++ return \"lghi\\t%0,0\;lghi\\t%M0,%h1\"; ++ ++ case 2: /* d <- m */ ++ if (s_operand (operands[1], GET_MODE (operands[1]))) ++ return \"lmg\\t%0,%M0,%1\"; ++ else ++ return \"la\\t%M0,%1\;lmg\\t%0,%M0,0(%M0)\"; ++ ++ case 3: /* m <- d */ ++ if (!s_operand (operands[0], GET_MODE (operands[0]))) ++ return \"stg\\t%1,%0\;stg\\t%M1,%M0\"; ++ else ++ return \"stmg\\t%1,%M1,%0\"; ++ ++ case 4: /* m <- m */ ++ return \"mvc\\t%O0(16,%R0),%1\"; ++ } ++}" ++ [(set_attr "op_type" "NN,NN,RS,RS,SS") ++ (set_attr "atype" "reg,reg,mem,mem,mem") ++ (set_attr "type" "set") ++ (set_attr "length" "12,8,10,10,*")]) ++ ++; ++; movdi instruction pattern(s). ++; ++ ++;; If generating PIC code and operands[1] is a symbolic CONST, emit a ++;; move to get the address of the symbolic object from the GOT. ++ ++(define_expand "movdi" ++ [(set (match_operand:DI 0 "general_operand" "") ++ (match_operand:DI 1 "general_operand" ""))] ++ "" ++ " ++{ ++ if (CONSTANT_P (operands[1]) ++ && !LEGITIMATE_CONSTANT_P (operands[1])) ++ operands[1] = force_const_mem (DImode, operands[1]); ++ ++ if (TARGET_64BIT && flag_pic && SYMBOLIC_CONST (operands[1])) ++ emit_pic_move (operands, DImode); ++}") ++ ++(define_insn "*movdi_64" ++ [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,m,Q") ++ (match_operand:DI 1 "general_operand" "d,K,S,m,d,Q"))] ++ "TARGET_64BIT" ++ "@ ++ lgr\\t%0,%1 ++ lghi\\t%0,%h1 ++ larl\\t%0,%1 ++ lg\\t%0,%1 ++ stg\\t%1,%0 ++ mvc\\t%O0(8,%R0),%1" ++ [(set_attr "op_type" "RRE,RI,RIL,RXE,RXE,SS") ++ (set_attr "atype" "reg,reg,reg,mem,mem,mem") ++ (set_attr "type" "set,set,la,set,set,set")]) ++ ++(define_insn "*movdi_31" ++ [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,m,Q") ++ (match_operand:DI 1 "general_operand" "d,K,m,d,Q"))] ++ "!TARGET_64BIT" ++ "* ++{ ++ switch (which_alternative) ++ { ++ case 0: /* d <- d */ ++ if (REGNO (operands[0]) == REGNO (operands[1]) + 1) ++ return \"lr\\t%N0,%N1\;lr\\t%0,%1\"; ++ else ++ return \"lr\\t%0,%1\;lr\\t%N0,%N1\"; ++ ++ case 1: /* d <- K */ ++ if (INTVAL (operands[1]) < 0) ++ return \"lhi\\t%0,-1\;lhi\\t%N0,%h1\"; ++ else ++ return \"lhi\\t%0,0\;lhi\\t%N0,%h1\"; ++ ++ case 2: /* d <- m */ ++ if (s_operand (operands[1], GET_MODE (operands[1]))) ++ return \"lm\\t%0,%N0,%1\"; ++ else ++ return \"la\\t%N0,%1\;lm\\t%0,%N0,0(%N0)\"; ++ ++ case 3: /* m <- d */ ++ if (s_operand (operands[0], GET_MODE (operands[0]))) ++ return \"stm\\t%1,%N1,%0\"; ++ else ++ return \"st\\t%1,%0\;st\\t%N1,%N0\"; ++ ++ case 4: /* m <- m */ ++ return \"mvc\\t%O0(8,%R0),%1\"; ++ } ++}" ++ [(set_attr "op_type" "NN,NN,RS,RS,SS") ++ (set_attr "atype" "reg,reg,mem,mem,mem") ++ (set_attr "type" "set") ++ (set_attr "length" "4,8,8,8,*")]) ++ ++ ++; ++; movsi instruction pattern(s). ++; ++ ++;; If generating PIC code and operands[1] is a symbolic CONST, emit a ++;; move to get the address of the symbolic object from the GOT. ++ ++(define_expand "movsi" ++ [(set (match_operand:SI 0 "general_operand" "") ++ (match_operand:SI 1 "general_operand" ""))] ++ "" ++ " ++{ ++ if (CONSTANT_P (operands[1]) ++ && !LEGITIMATE_CONSTANT_P (operands[1])) ++ operands[1] = force_const_mem (SImode, operands[1]); ++ ++ if (flag_pic && SYMBOLIC_CONST (operands[1])) ++ emit_pic_move (operands, SImode); ++}") ++ ++(define_insn "*movsi" ++ [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,m,Q") ++ (match_operand:SI 1 "general_operand" "d,K,m,d,Q"))] ++ "" ++ "@ ++ lr\\t%0,%1 ++ lhi\\t%0,%h1 ++ l\\t%0,%1 ++ st\\t%1,%0 ++ mvc\\t%O0(4,%R0),%1" ++ [(set_attr "op_type" "RR,RI,RX,RX,SS") ++ (set_attr "atype" "reg,reg,mem,mem,mem") ++ (set_attr "type" "set")]) ++ ++ ++; ++; movhi instruction pattern(s). ++; ++ ++(define_insn "movhi" ++ [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,m") ++ (match_operand:HI 1 "r_or_x_or_im16_operand" "d,K,m,d"))] ++ "" ++ "@ ++ lr\\t%0,%1 ++ lhi\\t%0,%h1 ++ lh\\t%0,%1 ++ sth\\t%1,%0" ++ [(set_attr "op_type" "RR,RI,RX,RX") ++ (set_attr "atype" "reg,reg,mem,mem") ++ (set_attr "type" "xset")]) ++ ++ ++; ++; movqi instruction pattern(s). ++; ++ ++(define_insn "movqi_64" ++ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,m,Q") ++ (match_operand:QI 1 "general_operand" "d,K,m,d,n"))] ++ "TARGET_64BIT" ++ "@ ++ lr\\t%0,%1 ++ llill\\t%0,%x1 ++ llgc\\t%0,%1 ++ stc\\t%1,%0 ++ mvi\\t%0,%b1" ++ [(set_attr "op_type" "RR,RI,RXE,RX,SI") ++ (set_attr "atype" "reg,reg,mem,mem,mem") ++ (set_attr "type" "xset")]) ++ ++ ++(define_insn "movqi" ++ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,m,Q") ++ (match_operand:QI 1 "r_or_x_or_im16_operand" "d,n,m,d,n"))] ++ "" ++ "@ ++ lr\\t%0,%1 ++ lhi\\t%0,%c1 ++ ic\\t%0,%1 ++ stc\\t%1,%0 ++ mvi\\t%0,%b1" ++ [(set_attr "op_type" "RR,RX,RX,RX,SI") ++ (set_attr "atype" "reg,reg,mem,mem,mem") ++ (set_attr "type" "xset")]) ++ ++ ++; ++; moveqstrictqi instruction pattern(s). ++; ++ ++(define_insn "*movstrictqi" ++ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+d,m")) ++ (match_operand:QI 1 "nonimmediate_operand" "m,d"))] ++ "" ++ "@ ++ ic\\t%0,%1 ++ stc\\t%1,%0" ++ [(set_attr "op_type" "RX,RX") ++ (set_attr "atype" "mem,mem")]) ++ ++ ++; ++; movstricthi instruction pattern(s). ++; ++ ++(define_insn "*movstricthi" ++ [(set (strict_low_part (match_operand:HI 0 "r_or_s_operand" "+d,Q")) ++ (match_operand:HI 1 "r_or_s_operand" "Q,d")) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ icm\\t%0,3,%1 ++ stcm\\t%1,3,%0" ++ [(set_attr "op_type" "RS,RS") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++ ++; ++; movstrictsi instruction pattern(s). ++; ++ ++(define_insn "movestrictsi" ++ [(set (strict_low_part (match_operand:SI 0 "nonimmediate_operand" "+d,d,m")) ++ (match_operand:SI 1 "nonimmediate_operand" "d,m,d"))] ++ "TARGET_64BIT" ++ "@ ++ lr\\t%0,%1 ++ l\\t%0,%1 ++ st\\t%1,%0" ++ [(set_attr "op_type" "RR,RS,RS") ++ (set_attr "atype" "reg,mem,mem") ++ (set_attr "type" "xset")]) ++ ++ ++; ++; movdf instruction pattern(s). ++; ++ ++(define_expand "movdf" ++ [(set (match_operand:DF 0 "nonimmediate_operand" "") ++ (match_operand:DF 1 "general_operand" ""))] ++ "" ++ " ++{ ++ if (GET_CODE (operands[1]) == CONST_DOUBLE) ++ operands[1] = force_const_mem (DFmode, operands[1]); ++}") ++ ++(define_insn "*movdf_64" ++ [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,m,d,m,d,Q") ++ (match_operand:DF 1 "general_operand" "f,m,f,m,d,d,Q"))] ++ "TARGET_64BIT && TARGET_HARD_FLOAT" ++ "@ ++ ldr\\t%0,%1 ++ ld\\t%0,%1 ++ std\\t%1,%0 ++ lg\\t%0,%1 ++ stg\\t%1,%0 ++ lgr\\t%0,%1 ++ mvc\\t%O0(8,%R0),%1" ++ [(set_attr "op_type" "RR,RX,RX,RXE,RXE,RR,SS") ++ (set_attr "atype" "reg,mem,mem,mem,mem,mem,mem") ++ (set_attr "type" "xset")]) ++ ++(define_insn "*movdf_31" ++ [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,m,d,m,d,Q") ++ (match_operand:DF 1 "general_operand" "f,m,f,m,d,d,Q"))] ++ "TARGET_HARD_FLOAT" ++ "* ++{ ++ switch (which_alternative) ++ { ++ case 0: /* f <- f */ ++ return \"ldr\\t%0,%1\"; ++ ++ case 1: /* f <- m */ ++ return \"ld\\t%0,%1\"; ++ ++ case 2: /* m <- f */ ++ return \"std\\t%1,%0\"; ++ ++ case 3: /* d <- m */ ++ if (s_operand (operands[1], GET_MODE (operands[1]))) ++ return \"lm\\t%0,%N0,%1\"; ++ else ++ return \"la\\t%N0,%1\;lm\\t%0,%N0,0(%N0)\"; ++ ++ case 4: /* m <- d */ ++ if (s_operand (operands[0], GET_MODE (operands[0]))) ++ return \"stm\\t%1,%N1,%0\"; ++ else ++ return \"st\\t%1,%0\;st\\t%N1,%N0\"; ++ ++ case 5: /* d <- d */ ++ if (REGNO (operands[0]) == REGNO (operands[1]) + 1) ++ return \"lr\\t%N0,%N1\;lr\\t%0,%1\"; ++ else ++ return \"lr\\t%0,%1\;lr\\t%N0,%N1\"; ++ ++ case 6: /* m <- m */ ++ return \"mvc\\t%O0(8,%R0),%1\"; ++ } ++}" ++ [(set_attr "op_type" "RR,RX,RX,RS,RS,NN,SS") ++ (set_attr "atype" "reg,mem,mem,mem,mem,reg,mem") ++ (set_attr "length" "*,*,*,*,*,4,*")]) ++ ++(define_insn "*movdf_soft_64" ++ [(set (match_operand:DF 0 "nonimmediate_operand" "=d,m,d,Q") ++ (match_operand:DF 1 "general_operand" "m,d,d,Q"))] ++ "TARGET_64BIT && TARGET_SOFT_FLOAT" ++ "@ ++ lg\\t%0,%1 ++ stg\\t%1,%0 ++ lgr\\t%0,%1 ++ mvc\\t%O0(8,%R0),%1" ++ [(set_attr "op_type" "RXE,RXE,RR,SS") ++ (set_attr "atype" "mem,mem,mem,mem") ++ (set_attr "type" "xset")]) ++ ++(define_insn "*movdf_soft_31" ++ [(set (match_operand:DF 0 "nonimmediate_operand" "=!d,d,m,Q") ++ (match_operand:DF 1 "general_operand" "!d,m,d,Q"))] ++ "TARGET_SOFT_FLOAT" ++ "* ++{ ++ switch (which_alternative) ++ { ++ case 0: /* d <- d */ ++ if (REGNO (operands[0]) == REGNO (operands[1]) + 1) ++ return \"lr\\t%N0,%N1\;lr\\t%0,%1\"; ++ else ++ return \"lr\\t%0,%1\;lr\\t%N0,%N1\"; ++ ++ case 1: /* d <- m */ ++ if (s_operand (operands[1], GET_MODE (operands[1]))) ++ return \"lm\\t%0,%N0,%1\"; ++ else ++ return \"la\\t%N0,%1\;lm\\t%0,%N0,0(%N0)\"; ++ ++ case 2: /* m <- d */ ++ if (s_operand (operands[0], GET_MODE (operands[0]))) ++ return \"stm\\t%1,%N1,%0\"; ++ else ++ return \"st\\t%1,%0\;st\\t%N1,%N0\"; ++ ++ case 3: /* m <- m */ ++ return \"mvc\\t%O0(8,%R0),%1\"; ++ } ++}" ++ [(set_attr "op_type" "NN,RS,RS,SS") ++ (set_attr "atype" "reg,mem,mem,mem") ++ (set_attr "length" "8,*,*,*")]) ++ ++ ++; ++; movsf instruction pattern(s). ++; ++ ++(define_expand "movsf" ++ [(set (match_operand:SF 0 "nonimmediate_operand" "") ++ (match_operand:SF 1 "general_operand" ""))] ++ "" ++ " ++{ ++ if (GET_CODE (operands[1]) == CONST_DOUBLE) ++ operands[1] = force_const_mem (SFmode, operands[1]); ++}") ++ ++(define_insn "*movsf_64" ++ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,m,d,m,d,Q") ++ (match_operand:SF 1 "general_operand" "f,m,f,m,d,d,Q"))] ++ "TARGET_64BIT && TARGET_HARD_FLOAT" ++ "@ ++ ler\\t%0,%1 ++ le\\t%0,%1 ++ ste\\t%1,%0 ++ llgf\\t%0,%1 ++ st\\t%1,%0 ++ lgr\\t%0,%1 ++ mvc\\t%O0(4,%R0),%1" ++ [(set_attr "op_type" "RR,RX,RX,RXE,RX,RR,SS") ++ (set_attr "atype" "reg,mem,mem,mem,mem,reg,mem")]) ++ ++(define_insn "*movsf_31" ++ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,m,d,m,d,Q") ++ (match_operand:SF 1 "general_operand" "f,m,f,m,d,d,Q"))] ++ "TARGET_HARD_FLOAT" ++ "@ ++ ler\\t%0,%1 ++ le\\t%0,%1 ++ ste\\t%1,%0 ++ l\\t%0,%1 ++ st\\t%1,%0 ++ lr\\t%0,%1 ++ mvc\\t%O0(4,%R0),%1" ++ [(set_attr "op_type" "RR,RX,RX,RX,RX,RR,SS") ++ (set_attr "atype" "reg,mem,mem,mem,mem,reg,mem")]) ++ ++(define_insn "*movsf_soft" ++ [(set (match_operand:SF 0 "nonimmediate_operand" "=d,d,m,Q") ++ (match_operand:SF 1 "general_operand" "d,m,d,Q"))] ++ "TARGET_SOFT_FLOAT" ++ "@ ++ lr\\t%0,%1 ++ l\\t%0,%1 ++ st\\t%1,%0 ++ mvc\\t%O0(4,%R0),%1" ++ [(set_attr "op_type" "RR,RX,RX,SS") ++ (set_attr "atype" "reg,mem,mem,mem")]) ++; ++; load_multiple pattern(s). ++; ++ ++(define_expand "load_multiple" ++ [(match_par_dup 3 [(set (match_operand 0 "" "") ++ (match_operand 1 "" "")) ++ (use (match_operand 2 "" ""))])] ++ "" ++ " ++{ ++ int regno; ++ int count; ++ rtx from; ++ int i; ++ ++ /* Support only loading a constant number of fixed-point registers from ++ memory and only bother with this if more than two */ ++ if (GET_CODE (operands[2]) != CONST_INT ++ || INTVAL (operands[2]) <= 2 ++ || INTVAL (operands[2]) > 16 ++ || GET_CODE (operands[1]) != MEM ++ || GET_CODE (operands[0]) != REG ++ || REGNO (operands[0]) >= 16) ++ FAIL; ++ ++ count = INTVAL (operands[2]); ++ regno = REGNO (operands[0]); ++ ++ operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count)); ++ from = force_reg (Pmode, XEXP (operands[1], 0)); ++ ++ for (i = 0; i < count; i++) ++ XVECEXP (operands[3], 0, i) ++ = gen_rtx_SET (VOIDmode, gen_rtx_REG (Pmode, regno + i), ++ change_address (operands[1], Pmode, ++ plus_constant (from, i * 4))); ++}") ++ ++(define_insn "*load_multiple_di" ++ [(match_parallel 0 "load_multiple_operation" ++ [(set (match_operand:DI 1 "register_operand" "=r") ++ (match_operand:DI 2 "s_operand" "oQ"))])] ++ "" ++ "* ++{ ++ int words = XVECLEN (operands[0], 0); ++ ++ if (XVECLEN (operands[0], 0) == 1) ++ return \"lg\\t%1,0(%2)\"; ++ ++ operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1); ++ return \"lmg\\t%1,%0,%2\"; ++}" ++ [(set_attr "op_type" "RXE") ++ (set_attr "atype" "mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "*load_multiple_si" ++ [(match_parallel 0 "load_multiple_operation" ++ [(set (match_operand:SI 1 "register_operand" "=r") ++ (match_operand:SI 2 "s_operand" "oQ"))])] ++ "" ++ "* ++{ ++ int words = XVECLEN (operands[0], 0); ++ ++ if (XVECLEN (operands[0], 0) == 1) ++ return \"l\\t%1,0(%2)\"; ++ ++ operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1); ++ return \"lm\\t%1,%0,%2\"; ++}" ++ [(set_attr "op_type" "RXE") ++ (set_attr "atype" "mem") ++ (set_attr "type" "set")]) ++ ++; ++; store multiple pattern(s). ++; ++ ++(define_expand "store_multiple" ++ [(match_par_dup 3 [(set (match_operand 0 "" "") ++ (match_operand 1 "" "")) ++ (use (match_operand 2 "" ""))])] ++ "" ++ " ++{ ++ int regno; ++ int count; ++ rtx to; ++ int i; ++ ++ /* Support only storing a constant number of fixed-point registers to ++ memory and only bother with this if more than two. */ ++ if (GET_CODE (operands[2]) != CONST_INT ++ || INTVAL (operands[2]) <= 2 ++ || INTVAL (operands[2]) > 16 ++ || GET_CODE (operands[0]) != MEM ++ || GET_CODE (operands[1]) != REG ++ || REGNO (operands[1]) >= 16) ++ FAIL; ++ ++ count = INTVAL (operands[2]); ++ regno = REGNO (operands[1]); ++ ++ operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count)); ++ to = force_reg (Pmode, XEXP (operands[0], 0)); ++ ++ for (i = 0; i < count; i++) ++ XVECEXP (operands[3], 0, i) ++ = gen_rtx_SET (VOIDmode, ++ change_address (operands[0], Pmode, ++ plus_constant (to, i * 4)), ++ gen_rtx_REG (Pmode, regno + i)); ++}") ++ ++(define_insn "*store_multiple_di" ++ [(match_parallel 0 "store_multiple_operation" ++ [(set (match_operand:DI 1 "s_operand" "=oQ") ++ (match_operand:DI 2 "register_operand" "r"))])] ++ "" ++ "* ++{ ++ int words = XVECLEN (operands[0], 0); ++ ++ if (XVECLEN (operands[0], 0) == 1) ++ return \"stg\\t%1,0(%2)\"; ++ ++ operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1); ++ return \"stmg\\t%2,%0,%1\"; ++}" ++ [(set_attr "op_type" "RXE") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++ ++(define_insn "*store_multiple_si" ++ [(match_parallel 0 "store_multiple_operation" ++ [(set (match_operand:SI 1 "s_operand" "=oQ") ++ (match_operand:SI 2 "register_operand" "r"))])] ++ "" ++ "* ++{ ++ int words = XVECLEN (operands[0], 0); ++ ++ if (XVECLEN (operands[0], 0) == 1) ++ return \"st\\t%1,0(%2)\"; ++ ++ operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1); ++ return \"stm\\t%2,%0,%1\"; ++}" ++ [(set_attr "op_type" "RXE") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++;; ++;; String instructions. ++;; ++ ++; ++; movstrdi instruction pattern(s). ++; ++ ++(define_expand "movstrdi" ++ [(set (match_operand:BLK 0 "general_operand" "") ++ (match_operand:BLK 1 "general_operand" "")) ++ (use (match_operand:DI 2 "general_operand" "")) ++ (match_operand 3 "" "")] ++ "TARGET_64BIT" ++ " ++{ ++ rtx addr0, addr1; ++ ++ addr0 = force_operand (XEXP (operands[0], 0), NULL_RTX); ++ addr1 = force_operand (XEXP (operands[1], 0), NULL_RTX); ++ ++ if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 256) ++ { ++ operands[0] = change_address (operands[0], VOIDmode, addr0); ++ operands[1] = change_address (operands[1], VOIDmode, addr1); ++ operands[2] = GEN_INT (INTVAL (operands[2]) - 1); ++ ++ emit_insn (gen_movstrsico (operands[0], operands[1], operands[2])); ++ DONE; ++ } ++ else ++ { ++ if (TARGET_MVCLE) ++ { ++ /* implementation suggested by Richard Henderson */ ++ rtx reg0 = gen_reg_rtx (TImode); ++ rtx reg1 = gen_reg_rtx (TImode); ++ rtx len = operands[2]; ++ ++ if (! CONSTANT_P (len)) ++ len = force_reg (DImode, len); ++ ++ /* Load up the address+length pairs. */ ++ ++ emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 0), addr0); ++ emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 1), len); ++ ++ emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 0), addr1); ++ emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 1), len); ++ ++ /* MOVE */ ++ emit_insn (gen_movstrdi_64 (reg0, reg1)); ++ DONE; ++ } ++ else ++ { ++ rtx label = gen_label_rtx (); ++ rtx reg0, reg1, len; ++ ++ reg0 = gen_reg_rtx (DImode); ++ reg1 = gen_reg_rtx (DImode); ++ len = gen_reg_rtx (DImode); ++ ++ emit_move_insn (len, operands[2]); ++ emit_insn (gen_cmpdi (len, const0_rtx)); ++ emit_jump_insn (gen_beq (label)); ++ emit_move_insn (reg0, addr0); ++ emit_move_insn (reg1, addr1); ++ emit_insn (gen_adddi3 (len, len, constm1_rtx)); ++ emit_insn (gen_movstrdix_64 (reg0, reg1, len)); ++ emit_label (label); ++ DONE; ++ } ++ } ++}") ++ ++; ++; movstrsi instruction pattern(s). ++; ++ ++(define_expand "movstrsi" ++ [(set (match_operand:BLK 0 "general_operand" "") ++ (match_operand:BLK 1 "general_operand" "")) ++ (use (match_operand:SI 2 "general_operand" "")) ++ (match_operand 3 "" "")] ++ "" ++ " ++{ ++ rtx addr0 = force_operand (XEXP (operands[0], 0), NULL_RTX); ++ rtx addr1 = force_operand (XEXP (operands[1], 0), NULL_RTX); ++ ++ if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 256) ++ { ++ operands[0] = change_address (operands[0], VOIDmode, addr0); ++ operands[1] = change_address (operands[1], VOIDmode, addr1); ++ operands[2] = GEN_INT (INTVAL (operands[2]) - 1); ++ ++ emit_insn (gen_movstrsico (operands[0], operands[1], operands[2])); ++ DONE; ++ } ++ else ++ { ++ if (TARGET_64BIT) ++ FAIL; ++ ++ if (TARGET_MVCLE) ++ { ++ /* implementation suggested by Richard Henderson */ ++ rtx reg0 = gen_reg_rtx (DImode); ++ rtx reg1 = gen_reg_rtx (DImode); ++ rtx len = operands[2]; ++ ++ ++ if (! CONSTANT_P (len)) ++ len = force_reg (SImode, len); ++ ++ /* Load up the address+length pairs. */ ++ ++ emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 0), addr0); ++ emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 1), len); ++ ++ emit_move_insn (gen_rtx_SUBREG (SImode, reg1, 0), addr1); ++ emit_move_insn (gen_rtx_SUBREG (SImode, reg1, 1), len); ++ ++ /* MOVE */ ++ emit_insn (gen_movstrsi_31 (reg0, reg1)); ++ DONE; ++ } ++ else ++ { ++ rtx label = gen_label_rtx (); ++ rtx reg0, reg1, len; ++ ++ reg0 = gen_reg_rtx (SImode); ++ reg1 = gen_reg_rtx (SImode); ++ len = gen_reg_rtx (SImode); ++ ++ emit_move_insn (len, operands[2]); ++ emit_insn (gen_cmpsi (len, const0_rtx)); ++ emit_jump_insn (gen_beq (label)); ++ emit_move_insn (reg0, addr0); ++ emit_move_insn (reg1, addr1); ++ emit_insn (gen_addsi3 (len, len, constm1_rtx)); ++ emit_insn (gen_movstrsix_31 (reg0, reg1, len)); ++ emit_label (label); ++ DONE; ++ } ++ } ++}") ++ ++; Move a block that is less than 256 bytes in length. ++ ++(define_insn "movstrsico" ++ [(set (match_operand:BLK 0 "s_operand" "=oQ") ++ (match_operand:BLK 1 "s_operand" "oQ")) ++ (use (match_operand 2 "const_int_operand" "I"))] ++ "((unsigned) INTVAL (operands[2]) < 256)" ++ "mvc\\t%O0(%c2+1,%R0),%1" ++ [(set_attr "op_type" "SS") ++ (set_attr "atype" "mem")]) ++ ++; Move a block that is more than 256 bytes in lenght or length in register ++ ++(define_insn "movstrdix_64" ++ [(set (mem:BLK (match_operand:DI 0 "register_operand" "a")) ++ (mem:BLK (match_operand:DI 1 "register_operand" "a"))) ++ (use (match_operand:DI 2 "register_operand" "a")) ++ (clobber (match_dup 0)) ++ (clobber (match_dup 1)) ++ (clobber (match_scratch:DI 3 "=&a")) ++ (clobber (reg:CC 33))] ++ "" ++ "* ++{ ++ rtx xop[4]; ++ xop[0] = gen_label_rtx (); ++ xop[1] = gen_label_rtx (); ++ xop[2] = gen_label_rtx (); ++ xop[3] = operands[3]; ++ output_asm_insn (\"srag\\t%3,%2,8\",operands); ++ output_asm_insn (\"jz\\t%l1\",xop); ++ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", ++ CODE_LABEL_NUMBER (xop[0])); ++ output_asm_insn (\"mvc\\t0(256,%0),0(%1)\",operands); ++ output_asm_insn (\"la\\t%0,256(%0)\",operands); ++ output_asm_insn (\"la\\t%1,256(%1)\",operands); ++ xop[3] = operands[3]; ++ output_asm_insn (\"brct\\t%3,%l0\",xop); ++ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", ++ CODE_LABEL_NUMBER (xop[1])); ++ xop[3] = operands[3]; ++ output_asm_insn (\"bras\\t%3,%l2\",xop); ++ output_asm_insn (\"mvc\\t0(1,%0),0(%1)\",operands); ++ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", ++ CODE_LABEL_NUMBER (xop[2])); ++ return \"ex\\t%2,0(%3)\"; ++}" ++ [(set_attr "op_type" "NN") ++ (set_attr "atype" "mem") ++ (set_attr "length" "44")]) ++ ++(define_insn "movstrsix_31" ++ [(set (mem:BLK (match_operand:SI 0 "register_operand" "a")) ++ (mem:BLK (match_operand:SI 1 "register_operand" "a"))) ++ (use (match_operand:SI 2 "register_operand" "a")) ++ (clobber (match_dup 0)) ++ (clobber (match_dup 1)) ++ (clobber (match_scratch:SI 3 "=&a")) ++ (clobber (reg:CC 33))] ++ "" ++ "* ++{ ++ rtx xop[4]; ++ xop[0] = gen_label_rtx (); ++ xop[1] = gen_label_rtx (); ++ xop[2] = gen_label_rtx (); ++ xop[3] = operands[3]; ++ output_asm_insn (\"lr\\t%3,%2\",operands); ++ output_asm_insn (\"sra\\t%3,8\",operands); ++ output_asm_insn (\"jz\\t%l1\",xop); ++ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", ++ CODE_LABEL_NUMBER (xop[0])); ++ output_asm_insn (\"mvc\\t0(256,%0),0(%1)\",operands); ++ output_asm_insn (\"la\\t%0,256(%0)\",operands); ++ output_asm_insn (\"la\\t%1,256(%1)\",operands); ++ xop[3] = operands[3]; ++ output_asm_insn (\"brct\\t%3,%l0\",xop); ++ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", ++ CODE_LABEL_NUMBER (xop[1])); ++ xop[3] = operands[3]; ++ output_asm_insn (\"bras\\t%3,%l2\",xop); ++ output_asm_insn (\"mvc\\t0(1,%0),0(%1)\",operands); ++ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", ++ CODE_LABEL_NUMBER (xop[2])); ++ return \"ex\\t%2,0(%3)\"; ++}" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "42") ++ (set_attr "atype" "mem")]) ++ ++; Move a block that is larger than 255 bytes in length. ++ ++(define_insn "movstrdi_64" ++ [(set (mem:BLK (subreg:DI (match_operand:TI 0 "register_operand" "d") 0)) ++ (mem:BLK (subreg:DI (match_operand:TI 1 "register_operand" "d") 0))) ++ (clobber (match_dup 0)) ++ (clobber (match_dup 1)) ++ (clobber (reg:CC 33))] ++ "" ++ "mvcle\\t%0,%1,0\;jo\\t.-4" ++ [(set_attr "op_type" "NN") ++ (set_attr "atype" "mem") ++ (set_attr "length" "8")]) ++ ++(define_insn "movstrsi_31" ++ [(set (mem:BLK (subreg:SI (match_operand:DI 0 "register_operand" "d") 0)) ++ (mem:BLK (subreg:SI (match_operand:DI 1 "register_operand" "d") 0))) ++ (clobber (match_dup 0)) ++ (clobber (match_dup 1)) ++ (clobber (reg:CC 33))] ++ "" ++ "mvcle\\t%0,%1,0\;jo\\t.-4" ++ [(set_attr "op_type" "NN") ++ (set_attr "atype" "mem") ++ (set_attr "length" "8")]) ++ ++; ++; clrstrdi instruction pattern(s). ++; ++ ++(define_expand "clrstrdi" ++ [(set (match_operand:BLK 0 "general_operand" "") ++ (const_int 0)) ++ (use (match_operand:DI 1 "general_operand" "")) ++ (match_operand 2 "" "")] ++ "TARGET_64BIT" ++ " ++{ ++ rtx addr = force_operand (XEXP (operands[0], 0), NULL_RTX); ++ ++ operands[0] = change_address (operands[0], VOIDmode, addr); ++ ++ if (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) < 256) ++ { ++ emit_insn (gen_clrstrsico (operands[0], operands[1])); ++ DONE; ++ } ++ else ++ { ++ rtx reg0 = gen_reg_rtx (TImode); ++ rtx reg1 = gen_reg_rtx (TImode); ++ rtx len = operands[1]; ++ ++ if (! CONSTANT_P (len)) ++ len = force_reg (DImode, len); ++ ++ /* Load up the address+length pairs. */ ++ ++ emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 0), addr); ++ emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 1), len); ++ ++ emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 1), const0_rtx); ++ ++ /* Clear! */ ++ emit_insn (gen_clrstrsi_64 (reg0, reg1)); ++ DONE; ++ } ++}") ++ ++; ++; clrstrsi instruction pattern(s). ++; ++ ++(define_expand "clrstrsi" ++ [(set (match_operand:BLK 0 "general_operand" "") ++ (const_int 0)) ++ (use (match_operand:SI 1 "general_operand" "")) ++ (match_operand 2 "" "")] ++ "!TARGET_64BIT" ++ " ++{ ++ rtx addr = force_operand (XEXP (operands[0], 0), NULL_RTX); ++ ++ operands[0] = change_address (operands[0], VOIDmode, addr); ++ ++ if (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) < 256) ++ { ++ emit_insn (gen_clrstrsico (operands[0], operands[1])); ++ DONE; ++ } ++ else ++ { ++ rtx reg0 = gen_reg_rtx (DImode); ++ rtx reg1 = gen_reg_rtx (DImode); ++ rtx len = operands[1]; ++ ++ if (! CONSTANT_P (len)) ++ len = force_reg (SImode, len); ++ ++ /* Load up the address+length pairs. */ ++ ++ emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 0), addr); ++ emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 1), len); ++ ++ emit_move_insn (gen_rtx_SUBREG (SImode, reg1, 1), const0_rtx); ++ ++ /* CLear! */ ++ emit_insn (gen_clrstrsi_31 (reg0, reg1)); ++ DONE; ++ } ++}") ++ ++; Clear memory with length less than 256 bytes ++ ++(define_insn "clrstrsico" ++ [(set (match_operand:BLK 0 "s_operand" "=Qo") ++ (const_int 0)) ++ (use (match_operand 1 "immediate_operand" "I")) ++ (clobber (reg:CC 33))] ++ "" ++ "xc\\t%O0(%1,%R0),%0" ++ [(set_attr "op_type" "RS") ++ (set_attr "atype" "mem")]) ++ ++; Clear memory with length greater 256 bytes or lenght not constant ++ ++(define_insn "clrstrsi_64" ++ [(set (mem:BLK (subreg:DI (match_operand:TI 0 "register_operand" "d") 0)) ++ (const_int 0)) ++ (use (match_operand:TI 1 "register_operand" "d")) ++ (clobber (match_dup 0)) ++ (clobber (match_dup 1)) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "mvcle\\t%0,%1,0\;jo\\t.-4" ++ [(set_attr "op_type" "NN") ++ (set_attr "atype" "mem") ++ (set_attr "cycle" "n") ++ (set_attr "length" "8")]) ++ ++(define_insn "clrstrsi_31" ++ [(set (mem:BLK (subreg:SI (match_operand:DI 0 "register_operand" "d") 0)) ++ (const_int 0)) ++ (use (match_operand:DI 1 "register_operand" "d")) ++ (clobber (match_dup 0)) ++ (clobber (match_dup 1)) ++ (clobber (reg:CC 33))] ++ "!TARGET_64BIT" ++ "mvcle\\t%0,%1,0\;jo\\t.-4" ++ [(set_attr "op_type" "NN") ++ (set_attr "atype" "mem") ++ (set_attr "cycle" "n") ++ (set_attr "length" "8")]) ++ ++; ++; cmpstrdi instruction pattern(s). ++; ++ ++(define_expand "cmpstrdi" ++ [(set (match_operand:DI 0 "register_operand" "") ++ (compare:DI (match_operand:BLK 1 "s_operand" "") ++ (match_operand:BLK 2 "s_operand" "") ) ) ++ (use (match_operand:DI 3 "general_operand" "")) ++ (use (match_operand:DI 4 "" ""))] ++ "TARGET_64BIT" ++ " ++{ ++ rtx addr0, addr1; ++ ++ /* for pre/post increment */ ++ operands[1] = protect_from_queue (operands[1], 0); ++ operands[2] = protect_from_queue (operands[2], 0); ++ operands[3] = protect_from_queue (operands[3], 0); ++ ++ addr0 = force_operand (XEXP (operands[1], 0), NULL_RTX); ++ addr1 = force_operand (XEXP (operands[2], 0), NULL_RTX); ++ ++ if (GET_CODE (operands[3]) == CONST_INT && INTVAL (operands[3]) < 256) ++ { ++ if (INTVAL (operands[3]) == 0) { ++ emit_move_insn (operands[0], operands[3]); ++ DONE; ++ } ++ ++ operands[1] = change_address (operands[1], VOIDmode, addr0); ++ operands[2] = change_address (operands[2], VOIDmode, addr1); ++ ++ emit_insn (gen_cmpstr_const (operands[1], operands[2], operands[3])); ++ emit_insn (gen_cmpint_di (operands[0])); ++ DONE; ++ } ++ else ++ { ++ /* implementation suggested by Richard Henderson */ ++ rtx reg0 = gen_reg_rtx (TImode); ++ rtx reg1 = gen_reg_rtx (TImode); ++ rtx len = operands[3]; ++ ++ if (! CONSTANT_P (len)) ++ len = force_reg (DImode, len); ++ ++ /* Load up the address+length pairs. */ ++ emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 0), addr0); ++ emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 1), len); ++ ++ emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 0), addr1); ++ emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 1), len); ++ ++ /* Compare! */ ++ emit_insn (gen_cmpstr_64 (reg0, reg1)); ++ emit_insn (gen_cmpint_di (operands[0])); ++ DONE; ++ } ++}") ++ ++; ++; cmpstrsi instruction pattern(s). ++; ++ ++(define_expand "cmpstrsi" ++ [(set (match_operand:SI 0 "register_operand" "") ++ (compare:SI (match_operand:BLK 1 "s_operand" "") ++ (match_operand:BLK 2 "s_operand" "") ) ) ++ (use (match_operand:SI 3 "general_operand" "")) ++ (use (match_operand:SI 4 "" ""))] ++ "" ++ " ++{ ++ rtx addr0, addr1; ++ ++ /* for pre/post increment */ ++ operands[1] = protect_from_queue (operands[1], 0); ++ operands[2] = protect_from_queue (operands[2], 0); ++ operands[3] = protect_from_queue (operands[3], 0); ++ ++ addr0 = force_operand (XEXP (operands[1], 0), NULL_RTX); ++ addr1 = force_operand (XEXP (operands[2], 0), NULL_RTX); ++ ++ if (GET_CODE (operands[3]) == CONST_INT && INTVAL (operands[3]) < 256) ++ { ++ if (INTVAL (operands[3]) == 0) { ++ emit_move_insn (operands[0], operands[3]); ++ DONE; ++ } ++ ++ operands[1] = change_address (operands[1], VOIDmode, addr0); ++ operands[2] = change_address (operands[2], VOIDmode, addr1); ++ ++ emit_insn (gen_cmpstr_const (operands[1], operands[2], operands[3])); ++ emit_insn (gen_cmpint_si (operands[0])); ++ DONE; ++ } ++ else ++ { ++ /* implementation suggested by Richard Henderson */ ++ rtx reg0, reg1; ++ rtx len = operands[3]; ++ ++ if (TARGET_64BIT) ++ { ++ reg0 = gen_reg_rtx (TImode); ++ reg1 = gen_reg_rtx (TImode); ++ } ++ else ++ { ++ reg0 = gen_reg_rtx (DImode); ++ reg1 = gen_reg_rtx (DImode); ++ } ++ ++ if (! CONSTANT_P (len)) ++ len = force_reg (Pmode, len); ++ ++ /* Load up the address+length pairs. */ ++ emit_move_insn (gen_rtx_SUBREG (Pmode, reg0, 0), addr0); ++ emit_move_insn (gen_rtx_SUBREG (Pmode, reg0, 1), len); ++ ++ emit_move_insn (gen_rtx_SUBREG (Pmode, reg1, 0), addr1); ++ emit_move_insn (gen_rtx_SUBREG (Pmode, reg1, 1), len); ++ ++ /* Compare! */ ++ if (TARGET_64BIT) ++ emit_insn (gen_cmpstr_64 (reg0, reg1)); ++ else ++ emit_insn (gen_cmpstr_31 (reg0, reg1)); ++ ++ emit_insn (gen_cmpint_si (operands[0])); ++ DONE; ++ } ++}") ++ ++; Compare a block that is less than 256 bytes in length. ++ ++(define_insn "cmpstr_const" ++ [(set (reg:CCU 33) ++ (compare:CCU (match_operand:BLK 0 "s_operand" "oQ") ++ (match_operand:BLK 1 "s_operand" "oQ"))) ++ (use (match_operand 2 "immediate_operand" "I"))] ++ "(unsigned) INTVAL (operands[2]) < 256" ++ "clc\\t%O0(%c2,%R0),%1" ++ [(set_attr "op_type" "SS") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++; Compare a block that is larger than 255 bytes in length. ++ ++(define_insn "cmpstr_64" ++ [(set (reg:CCU 33) ++ (compare:CCU (mem:BLK (subreg:DI (match_operand:TI 0 "register_operand" "d") 0)) ++ (mem:BLK (subreg:DI (match_operand:TI 1 "register_operand" "d") 0)))) ++ (clobber (subreg:DI (match_dup 0) 0)) ++ (clobber (subreg:DI (match_dup 0) 1)) ++ (clobber (subreg:DI (match_dup 1) 0)) ++ (clobber (subreg:DI (match_dup 1) 1))] ++ "TARGET_64BIT" ++ "clcl\\t%0,%1" ++ [(set_attr "op_type" "RR") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++(define_insn "cmpstr_31" ++ [(set (reg:CCU 33) ++ (compare:CCU (mem:BLK (subreg:SI (match_operand:DI 0 "register_operand" "d") 0)) ++ (mem:BLK (subreg:SI (match_operand:DI 1 "register_operand" "d") 0)))) ++ (clobber (subreg:SI (match_dup 0) 0)) ++ (clobber (subreg:SI (match_dup 0) 1)) ++ (clobber (subreg:SI (match_dup 1) 0)) ++ (clobber (subreg:SI (match_dup 1) 1))] ++ "!TARGET_64BIT" ++ "clcl\\t%0,%1" ++ [(set_attr "op_type" "RR") ++ (set_attr "atype" "mem") ++ (set_attr "type" "xset")]) ++ ++; Convert condition code to integer in range (-1, 0, 1) ++ ++(define_insn "cmpint_si" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (compare:SI (reg:CCU 33) (const_int 0)))] ++ "" ++ "* ++{ ++ output_asm_insn (\"lhi\\t%0,1\", operands); ++ output_asm_insn (\"jh\\t.+12\", operands); ++ output_asm_insn (\"jl\\t.+6\", operands); ++ output_asm_insn (\"sr\\t%0,%0\", operands); ++ return \"lcr\\t%0,%0\"; ++}" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "16") ++ (set_attr "atype" "reg") ++ (set_attr "type" "xset")]) ++ ++(define_insn "cmpint_di" ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (compare:DI (reg:CCU 33) (const_int 0)))] ++ "TARGET_64BIT" ++ "* ++{ ++ output_asm_insn (\"lghi\\t%0,1\", operands); ++ output_asm_insn (\"jh\\t.+12\", operands); ++ output_asm_insn (\"jl\\t.+6\", operands); ++ output_asm_insn (\"sgr\\t%0,%0\", operands); ++ return \"lcgr\\t%0,%0\"; ++}" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "22") ++ (set_attr "atype" "reg") ++ (set_attr "type" "xset")]) ++ ++;; ++;;- Conversion instructions. ++;; ++ ++; ++; extendsidi2 instruction pattern(s). ++; ++ ++(define_insn "extendsidi2" ++ [(set (match_operand:DI 0 "register_operand" "=d,d") ++ (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))] ++ "TARGET_64BIT" ++ "@ ++ lgfr\\t%0,%1 ++ lgf\\t%0,%1" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "set")]) ++ ++ ++; ++; extendhidi2 instruction pattern(s). ++; ++ ++(define_insn "extendhidi2" ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (sign_extend:DI (match_operand:HI 1 "register_operand" "d"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "sllg\\t%0,%1,48\;srag\\t%0,%0,48" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "12") ++ (set_attr "cycle" "2") ++ (set_attr "type" "set")]) ++ ++ ++; ++; extendqidi2 instruction pattern(s). ++; ++ ++(define_insn "extendqidi2" ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (sign_extend:DI (match_operand:QI 1 "register_operand" "d"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "sllg\\t%0,%1,56\;srag\\t%0,%0,56" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "12") ++ (set_attr "cycle" "2") ++ (set_attr "type" "set")]) ++ ++ ++; ++; extendhisi2 instruction pattern(s). ++; ++ ++(define_insn "extendhisi2" ++ [(set (match_operand:SI 0 "register_operand" "=d,!d,d") ++ (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "0,d,m"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ sll\\t%1,16\;sra\\t%1,16 ++ lr\\t%0,%1\;sll\\t%0,16\;sra\\t%0,16 ++ lh\\t%0,%1" ++ [(set_attr "op_type" "NN,NN,RX") ++ (set_attr "cycle" "2,3,1") ++ (set_attr "atype" "reg,reg,mem") ++ (set_attr "type" "set") ++ (set_attr "length" "8,10,*")]) ++ ++ ++; ++; extendqisi2 instruction pattern(s). ++; ++ ++(define_insn "extendqisi2" ++ [(set (match_operand:SI 0 "register_operand" "=d,d") ++ (sign_extend:SI (match_operand:QI 1 "r_or_s_operand" "0,Q"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ sll\\t%0,24\;sra\\t%0,24 ++ icm\\t%0,8,%1\;sra\\t%0,24" ++ [(set_attr "op_type" "NN,NN") ++ (set_attr "cycle" "2") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "set") ++ (set_attr "length" "8,8")]) ++ ++ ++; ++; extendqihi2 instruction pattern(s). ++; ++ ++(define_insn "extendqihi2" ++ [(set (match_operand:HI 0 "register_operand" "=d,d") ++ (sign_extend:HI (match_operand:QI 1 "r_or_s_operand" "0,Q"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ sll\\t%0,24\;sra\\t%0,24 ++ icm\\t%0,8,%1\;sra\\t%0,24" ++ [(set_attr "op_type" "NN,NN") ++ (set_attr "cycle" "2") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "set") ++ (set_attr "length" "8,8")]) ++ ++ ++; ++; zero_extendsidi2 instruction pattern(s). ++; ++ ++(define_insn "zero_extendsidi2" ++ [(set (match_operand:DI 0 "register_operand" "=d,d") ++ (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))] ++ "TARGET_64BIT" ++ "@ ++ llgfr\\t%0,%1 ++ llgf\\t%0,%1" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "set")]) ++ ++ ++; ++; zero_extendhidi2 instruction pattern(s). ++; ++ ++(define_insn "zero_extendhidi2" ++ [(set (match_operand:DI 0 "register_operand" "=!d,d") ++ (zero_extend:DI (match_operand:HI 1 "nonimmediate_operand" "d,m")))] ++ "TARGET_64BIT" ++ "@ ++ llgfr\\t%0,%1\;iilh\\t%0,0 ++ llgh\\t%0,%1" ++ [(set_attr "op_type" "NN,RXE") ++ (set_attr "cycle" "2,1") ++ (set_attr "atype" "reg,mem") ++ (set_attr "length" "12,*") ++ (set_attr "type" "set")]) ++ ++ ++; ++; zero_extendqidi2 instruction pattern(s) ++; ++ ++(define_insn "zero_extendqidi2" ++ [(set (match_operand:DI 0 "register_operand" "=!d,d") ++ (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "d,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ sllg\\t%0,%1,56\;srlg\\t%0,%0,56 ++ llgc\\t%0,%1" ++ [(set_attr "op_type" "NN,RXE") ++ (set_attr "cycle" "2,1") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "set") ++ (set_attr "length" "12,*")]) ++ ++ ++; ++; zero_extendhisi2 instruction pattern(s). ++; ++ ++(define_expand "zero_extendhisi2" ++ [(set (match_operand:SI 0 "register_operand" "") ++ (zero_extend:SI (match_operand:HI 1 "r_or_s_operand" "")))] ++ "" ++ " ++{ ++ if (!TARGET_64BIT) ++ { ++ emit_insn (gen_zero_extendhisi2_31 (operands[0], operands[1], ++ force_const_mem (SImode, const0_rtx))); ++ DONE; ++ } ++}") ++ ++(define_insn "*zero_extendhisi2_64" ++ [(set (match_operand:SI 0 "register_operand" "=d,d") ++ (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "0,m")))] ++ "TARGET_64BIT" ++ "@ ++ iilh\\t%0,0 ++ llgh\\t%0,%1" ++ [(set_attr "op_type" "RI,RXE") ++ (set_attr "atype" "reg,mem")]) ++ ++(define_insn "zero_extendhisi2_31" ++ [(set (match_operand:SI 0 "register_operand" "=d,d") ++ (zero_extend:SI (match_operand:HI 1 "r_or_s_operand" "0,Q"))) ++ (use (match_operand:SI 2 "memory_operand" "m,m")) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ icm\\t%0,12,%2 ++ icm\\t%0,12,%1\;srl\\t%0,16" ++ [(set_attr "op_type" "RX,NN") ++ (set_attr "cycle" "1,2") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "set") ++ (set_attr "length" "*,8")]) ++ ++ ++; ++; zero_extendqisi2 instruction pattern(s). ++; ++ ++(define_insn "*zero_extendqisi2_mem_31" ++ [(set (match_operand:SI 0 "register_operand" "=&d") ++ (zero_extend:SI (match_operand:QI 1 "memory_operand" "m"))) ++ (use (match_operand:SI 2 "memory_operand" "m" )) ++ (clobber (reg:CC 33))] ++ "" ++ "sr\\t%0,%0\;ic\\t%0,%1" ++ [(set_attr "op_type" "NN") ++ (set_attr "cycle" "2") ++ (set_attr "atype" "mem") ++ (set_attr "type" "set") ++ (set_attr "length" "6")]) ++ ++(define_insn "zero_extendqisi2_reg_31" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (zero_extend:SI (match_operand:QI 1 "register_operand" "0"))) ++ (use (match_operand:SI 2 "memory_operand" "m" )) ++ (clobber (reg:CC 33))] ++ "" ++ "icm\\t%0,14,%2" ++ [(set_attr "op_type" "RX") ++ (set_attr "atype" "mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "*zero_extendqisi2_64" ++ [(set (match_operand:SI 0 "register_operand" "=!d,d") ++ (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "d,m")))] ++ "TARGET_64BIT" ++ "@ ++ sllg\\t%0,%1,56\;srlg\\t%0,%0,56 ++ llgc\\t%0,%1" ++ [(set_attr "op_type" "NN,RXE") ++ (set_attr "cycle" "2,1") ++ (set_attr "atype" "reg,mem") ++ (set_attr "length" "12,*")]) ++ ++(define_expand "zero_extendqisi2" ++ [(set (match_operand:SI 0 "register_operand" "") ++ (zero_extend:SI (match_operand:QI 1 "r_or_s_operand" "")))] ++ "" ++ " ++{ ++ if (!TARGET_64BIT) ++ { ++ emit_insn (gen_zero_extendqisi2_reg_31 (operands[0], operands[1], ++ force_const_mem (SImode, const0_rtx))); ++ DONE; ++ } ++}") ++ ++ ++; ++; zero_extendqihi2 instruction pattern(s). ++; ++ ++(define_insn "zero_extendqihi2_64" ++ [(set (match_operand:HI 0 "register_operand" "=d,d") ++ (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ nill\\t%0,0x00FF ++ llgc\\t%0,%1" ++ [(set_attr "op_type" "RI,RXE") ++ (set_attr "atype" "reg,mem")]) ++ ++(define_insn "zero_extendqihi2_31" ++ [(set (match_operand:HI 0 "register_operand" "=d,&d") ++ (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0,m"))) ++ (use (match_operand:SI 2 "memory_operand" "m,m")) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ icm\\t%0,14,%2 ++ sr\\t%0,%0\;ic\\t%0,%1" ++ [(set_attr "op_type" "RX,NN") ++ (set_attr "atype" "reg,mem") ++ (set_attr "length" "*,8")]) ++ ++(define_expand "zero_extendqihi2" ++ [(set (match_operand:HI 0 "register_operand" "") ++ (zero_extend:HI (match_operand:QI 1 "general_operand" "")))] ++ "" ++ " ++{ ++ if (!TARGET_64BIT) ++ { ++ emit_insn (gen_zero_extendqihi2_31 (operands[0], operands[1], ++ force_const_mem (SImode, const0_rtx))); ++ DONE; ++ } ++ else ++ { ++ emit_insn (gen_zero_extendqihi2_64 (operands[0], operands[1])); ++ DONE; ++ } ++}") ++ ++ ++; ++; truncdisi2 instruction pattern(s). ++; ++ ++(define_insn "truncdisi2" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (truncate:SI (match_operand:DI 1 "register_operand" "d")))] ++ "TARGET_64BIT" ++ "llgfr\\t%0,%1" ++ [(set_attr "op_type" "RRE")]) ++ ++ ++; ++; truncdihi2 instruction pattern(s). ++; ++ ++(define_insn "truncdihi2" ++ [(set (match_operand:HI 0 "register_operand" "=d") ++ (truncate:HI (match_operand:DI 1 "register_operand" "d")))] ++ "TARGET_64BIT" ++ "llgfr\\t%0,%1\;iilh\\t%0,0" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "10")]) ++ ++ ++; ++; truncdiqi2 instruction pattern(s). ++; ++ ++(define_insn "truncdiqi2" ++ [(set (match_operand:QI 0 "register_operand" "=d") ++ (truncate:QI (match_operand:DI 1 "register_operand" "d"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "sllg\\t%0,%1,56\;srlg\\t%0,%0,56" ++ [(set_attr "op_type" "NN") ++ (set_attr "cycle" "2") ++ (set_attr "length" "12")]) ++ ++ ++; ++; truncsihi2 instruction pattern(s). ++; ++ ++(define_expand "truncsihi2" ++ [(set (match_operand:HI 0 "register_operand" "") ++ (truncate:HI (match_operand:SI 1 "register_operand" "")))] ++ "" ++ " ++{ ++ if (!TARGET_64BIT) ++ { ++ emit_insn (gen_do_truncsihi2 (operands[0], operands[1], ++ force_const_mem (SImode, const0_rtx))); ++ DONE; ++ } ++}") ++ ++ ++(define_insn "do_truncsihi2" ++ [(set (match_operand:HI 0 "register_operand" "=d") ++ (truncate:HI (match_operand:SI 1 "register_operand" "0"))) ++ (use (match_operand:SI 2 "memory_operand" "m")) ++ (clobber (reg:CC 33))] ++ "" ++ "icm\\t%0,12,%2" ++ [(set_attr "op_type" "RX")]) ++ ++(define_insn "*truncsihi2_64" ++ [(set (match_operand:HI 0 "register_operand" "=d") ++ (truncate:HI (match_operand:SI 1 "register_operand" "0")))] ++ "TARGET_64BIT" ++ "iilh\\t%0,0" ++ [(set_attr "op_type" "RI")]) ++ ++ ++; ++; truncsiqi2 instruction pattern(s). ++; ++ ++(define_insn "truncsiqi2" ++ [(set (match_operand:QI 0 "register_operand" "=d") ++ (truncate:QI (match_operand:SI 1 "register_operand" "0"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "iilh\\t%0,0\;nill\\t%0,0x00FF" ++ [(set_attr "op_type" "NN") ++ (set_attr "cycle" "2") ++ (set_attr "length" "8")]) ++ ++ ++; ++; trunchiqi2 instruction pattern(s). ++; ++ ++(define_insn "trunchiqi2" ++ [(set (match_operand:QI 0 "register_operand" "=d") ++ (truncate:QI (match_operand:HI 1 "register_operand" "0"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "nill\\t%0,0x00FF" ++ [(set_attr "op_type" "RI")]) ++ ++ ++; ++; fixuns_truncdfdi2 and fix_truncdfsi2 instruction pattern(s). ++; ++ ++(define_expand "fixuns_truncdfdi2" ++ [(set (match_operand:DI 0 "register_operand" "") ++ (unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))] ++ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ " ++{ ++ rtx label1 = gen_label_rtx (); ++ rtx label2 = gen_label_rtx (); ++ rtx temp = gen_reg_rtx (DFmode); ++ operands[1] = force_reg (DFmode, operands[1]); ++ ++ emit_insn (gen_cmpdf (operands[1], force_const_mem (DFmode, ++ CONST_DOUBLE_FROM_REAL_VALUE (0x8000000000000000ULL, DFmode)))); ++ emit_jump_insn (gen_blt (label1)); ++ ++ emit_insn (gen_subdf3 (temp, operands[1], force_const_mem (DFmode, ++ CONST_DOUBLE_FROM_REAL_VALUE (0x10000000000000000ULL, DFmode)))); ++ emit_insn (gen_fix_truncdfdi2_ieee (operands[0], temp, GEN_INT(7))); ++ emit_jump_insn (gen_jump (label2)); ++ ++ emit_label (label1); ++ emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5))); ++ emit_label (label2); ++ DONE; ++}") ++ ++(define_expand "fix_truncdfdi2" ++ [(set (match_operand:DI 0 "register_operand" "") ++ (fix:DI (match_operand:DF 1 "nonimmediate_operand" "")))] ++ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ " ++{ ++ operands[1] = force_reg (DFmode, operands[1]); ++ emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5))); ++ DONE; ++}") ++ ++(define_insn "fix_truncdfdi2_ieee" ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (fix:DI (match_operand:DF 1 "register_operand" "f"))) ++ (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] 1) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "cgdbr\\t%0,%h2,%1" ++ [(set_attr "op_type" "RRE") ++ (set_attr "cycle" "n")]) ++ ++; ++; fixuns_truncdfsi2 and fix_truncdfsi2 instruction pattern(s). ++; ++ ++(define_expand "fixuns_truncdfsi2" ++ [(set (match_operand:SI 0 "register_operand" "") ++ (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ " ++{ ++ rtx label1 = gen_label_rtx (); ++ rtx label2 = gen_label_rtx (); ++ rtx temp = gen_reg_rtx (DFmode); ++ ++ operands[1] = force_reg (DFmode,operands[1]); ++ emit_insn (gen_cmpdf (operands[1], force_const_mem (DFmode, ++ CONST_DOUBLE_FROM_REAL_VALUE (0x80000000, DFmode)))); ++ emit_jump_insn (gen_blt (label1)); ++ emit_insn (gen_subdf3 (temp, operands[1], force_const_mem (DFmode, ++ CONST_DOUBLE_FROM_REAL_VALUE (0x100000000ULL, DFmode)))); ++ emit_insn (gen_fix_truncdfsi2_ieee (operands[0], temp, GEN_INT (7))); ++ emit_jump_insn (gen_jump (label2)); ++ ++ emit_label (label1); ++ emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5))); ++ emit_label (label2); ++ DONE; ++}") ++ ++(define_expand "fix_truncdfsi2" ++ [(set (match_operand:SI 0 "register_operand" "") ++ (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))] ++ "TARGET_HARD_FLOAT" ++ " ++{ ++ if (TARGET_IBM_FLOAT) ++ { ++ /* This is the algorithm from POP chapter A.5.7.2. */ ++ ++ rtx temp = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD); ++ rtx two31r = force_const_mem (DFmode, ++ gen_rtx (CONST_DOUBLE, VOIDmode, cc0_rtx, ++ 0x08000000, 0x4F000000)); ++ rtx two32 = force_const_mem (DFmode, ++ gen_rtx (CONST_DOUBLE, VOIDmode, cc0_rtx, ++ 0x0, 0x4E000001)); ++ ++ operands[1] = force_reg (DFmode, operands[1]); ++ emit_insn (gen_fix_truncdfsi2_ibm (operands[0], operands[1], ++ two31r, two32, temp)); ++ } ++ else ++ { ++ operands[1] = force_reg (DFmode, operands[1]); ++ emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5))); ++ } ++ ++ DONE; ++}") ++ ++(define_insn "fix_truncdfsi2_ieee" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (fix:SI (match_operand:DF 1 "register_operand" "f"))) ++ (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] 1) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "cfdbr\\t%0,%h2,%1" ++ [(set_attr "op_type" "RRE") ++ (set_attr "cycle" "n" )]) ++ ++(define_insn "fix_truncdfsi2_ibm" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (fix:SI (match_operand:DF 1 "nonimmediate_operand" "+f"))) ++ (use (match_operand:DF 2 "memory_operand" "m")) ++ (use (match_operand:DF 3 "memory_operand" "m")) ++ (use (match_operand:BLK 4 "memory_operand" "m")) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "* ++{ ++ output_asm_insn (\"sd\\t%1,%2\", operands); ++ output_asm_insn (\"aw\\t%1,%3\", operands); ++ output_asm_insn (\"std\\t%1,%4\", operands); ++ output_asm_insn (\"xi\\t%N4,128\", operands); ++ return \"l\\t%0,%N4\"; ++}" ++ [(set_attr "op_type" "NN") ++ (set_attr "cycle" "n") ++ (set_attr "length" "20")]) ++ ++; ++; fixuns_truncsfdi2 and fix_truncsfdi2 instruction pattern(s). ++; ++ ++(define_expand "fixuns_truncsfdi2" ++ [(set (match_operand:DI 0 "register_operand" "") ++ (unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))] ++ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ " ++{ ++ rtx label1 = gen_label_rtx (); ++ rtx label2 = gen_label_rtx (); ++ rtx temp = gen_reg_rtx (SFmode); ++ ++ operands[1] = force_reg (SFmode, operands[1]); ++ emit_insn (gen_cmpsf (operands[1], force_const_mem (SFmode, ++ CONST_DOUBLE_FROM_REAL_VALUE (0x8000000000000000ULL, SFmode)))); ++ emit_jump_insn (gen_blt (label1)); ++ ++ emit_insn (gen_subsf3 (temp, operands[1], force_const_mem (SFmode, ++ CONST_DOUBLE_FROM_REAL_VALUE (0x10000000000000000ULL, SFmode)))); ++ emit_insn (gen_fix_truncsfdi2_ieee (operands[0], temp, GEN_INT(7))); ++ emit_jump_insn (gen_jump (label2)); ++ ++ emit_label (label1); ++ emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5))); ++ emit_label (label2); ++ DONE; ++}") ++ ++(define_expand "fix_truncsfdi2" ++ [(set (match_operand:DI 0 "register_operand" "") ++ (fix:DI (match_operand:SF 1 "nonimmediate_operand" "")))] ++ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ " ++{ ++ operands[1] = force_reg (SFmode, operands[1]); ++ emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5))); ++ DONE; ++}") ++ ++(define_insn "fix_truncsfdi2_ieee" ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (fix:DI (match_operand:SF 1 "register_operand" "f"))) ++ (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] 1) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "cgebr\\t%0,%h2,%1" ++ [(set_attr "op_type" "RRE") ++ (set_attr "cycle" "n")]) ++ ++; ++; fixuns_truncsfsi2 and fix_truncsfsi2 instruction pattern(s). ++; ++ ++(define_expand "fixuns_truncsfsi2" ++ [(set (match_operand:SI 0 "register_operand" "") ++ (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ " ++{ ++ rtx label1 = gen_label_rtx (); ++ rtx label2 = gen_label_rtx (); ++ rtx temp = gen_reg_rtx (SFmode); ++ ++ operands[1] = force_reg (SFmode, operands[1]); ++ emit_insn (gen_cmpsf (operands[1], force_const_mem (SFmode, ++ CONST_DOUBLE_FROM_REAL_VALUE (0x80000000, SFmode)))); ++ emit_jump_insn (gen_blt (label1)); ++ emit_insn (gen_subsf3 (temp, operands[1], force_const_mem (SFmode, ++ CONST_DOUBLE_FROM_REAL_VALUE (0x100000000ULL, SFmode)))); ++ emit_insn (gen_fix_truncsfsi2_ieee (operands[0], temp, GEN_INT (7))); ++ emit_jump_insn (gen_jump (label2)); ++ ++ emit_label (label1); ++ emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5))); ++ emit_label (label2); ++ DONE; ++}") ++ ++(define_expand "fix_truncsfsi2" ++ [(set (match_operand:SI 0 "register_operand" "") ++ (fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))] ++ "TARGET_HARD_FLOAT" ++ " ++{ ++ if (TARGET_IBM_FLOAT) ++ { ++ /* Convert to DFmode and then use the POP algorithm. */ ++ rtx temp = gen_reg_rtx (DFmode); ++ emit_insn (gen_extendsfdf2 (temp, operands[1])); ++ emit_insn (gen_fix_truncdfsi2 (operands[0], temp)); ++ } ++ else ++ { ++ operands[1] = force_reg (SFmode, operands[1]); ++ emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5))); ++ } ++ ++ DONE; ++}") ++ ++(define_insn "fix_truncsfsi2_ieee" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (fix:SI (match_operand:SF 1 "register_operand" "f"))) ++ (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] 1) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "cfebr\\t%0,%h2,%1" ++ [(set_attr "op_type" "RRE") ++ (set_attr "cycle" "n")]) ++ ++; ++; floatdidf2 instruction pattern(s). ++; ++ ++(define_insn "floatdidf2" ++ [(set (match_operand:DF 0 "register_operand" "=f") ++ (float:DF (match_operand:DI 1 "register_operand" "d")))] ++ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "cdgbr\\t%0,%1" ++ [(set_attr "op_type" "RRE") ++ (set_attr "cycle" "n" )]) ++ ++; ++; floatdisf2 instruction pattern(s). ++; ++ ++(define_insn "floatdisf2" ++ [(set (match_operand:SF 0 "register_operand" "=f") ++ (float:SF (match_operand:DI 1 "register_operand" "d")))] ++ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "cegbr\\t%0,%1" ++ [(set_attr "op_type" "RRE") ++ (set_attr "cycle" "n" )]) ++ ++; ++; floatsidf2 instruction pattern(s). ++; ++ ++(define_expand "floatsidf2" ++ [(set (match_operand:DF 0 "register_operand" "") ++ (float:DF (match_operand:SI 1 "register_operand" "")))] ++ "TARGET_HARD_FLOAT" ++ " ++{ ++ if (TARGET_IBM_FLOAT) ++ { ++ /* This is the algorithm from POP chapter A.5.7.1. */ ++ ++ rtx temp = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD); ++ rtx two31 = force_const_mem (DFmode, ++ gen_rtx (CONST_DOUBLE, VOIDmode, cc0_rtx, ++ 0x80000000, 0x4E000000)); ++ ++ emit_insn (gen_floatsidf2_ibm (operands[0], operands[1], two31, temp)); ++ DONE; ++ } ++}") ++ ++(define_insn "floatsidf2_ieee" ++ [(set (match_operand:DF 0 "register_operand" "=f") ++ (float:DF (match_operand:SI 1 "register_operand" "d")))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "cdfbr\\t%0,%1" ++ [(set_attr "op_type" "RRE") ++ (set_attr "cycle" "n" )]) ++ ++(define_insn "floatsidf2_ibm" ++ [(set (match_operand:DF 0 "register_operand" "=f") ++ (float:DF (match_operand:SI 1 "register_operand" "d"))) ++ (use (match_operand:DF 2 "memory_operand" "m")) ++ (use (match_operand:BLK 3 "memory_operand" "m")) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "* ++{ ++ output_asm_insn (\"st\\t%0,%N3\", operands); ++ output_asm_insn (\"xi\\t%N3,128\", operands); ++ output_asm_insn (\"mvc\\t%O3(4,%R3),%2\", operands); ++ output_asm_insn (\"ld\\t%0,%3\", operands); ++ return \"sd\\t%0,%2\"; ++}" ++ [(set_attr "op_type" "NN") ++ (set_attr "cycle" "n" ) ++ (set_attr "length" "20")]) ++ ++; ++; floatsisf2 instruction pattern(s). ++; ++ ++(define_expand "floatsisf2" ++ [(set (match_operand:SF 0 "register_operand" "") ++ (float:SF (match_operand:SI 1 "register_operand" "")))] ++ "TARGET_HARD_FLOAT" ++ " ++{ ++ if (TARGET_IBM_FLOAT) ++ { ++ /* Use the POP algorithm to convert to DFmode and then truncate. */ ++ rtx temp = gen_reg_rtx (DFmode); ++ emit_insn (gen_floatsidf2 (temp, operands[1])); ++ emit_insn (gen_truncdfsf2 (operands[0], temp)); ++ DONE; ++ } ++}") ++ ++(define_insn "floatsisf2_ieee" ++ [(set (match_operand:SF 0 "register_operand" "=f") ++ (float:SF (match_operand:SI 1 "register_operand" "d")))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "cefbr\\t%0,%1" ++ [(set_attr "op_type" "RRE") ++ (set_attr "cycle" "n" )]) ++ ++; ++; truncdfsf2 instruction pattern(s). ++; ++ ++(define_expand "truncdfsf2" ++ [(set (match_operand:SF 0 "register_operand" "") ++ (float_truncate:SF (match_operand:DF 1 "general_operand" "")))] ++ "TARGET_HARD_FLOAT" ++ " ++{ ++ if (CONSTANT_P(operands[1])) ++ operands[1] = force_const_mem (DFmode, operands[1]); ++}") ++ ++(define_insn "truncdfsf2_ieee" ++ [(set (match_operand:SF 0 "register_operand" "=f") ++ (float_truncate:SF (match_operand:DF 1 "nonimmediate_operand" "f")))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "ledbr\\t%0,%1" ++ [(set_attr "op_type" "RRE")]) ++ ++(define_insn "truncdfsf2_ibm" ++ [(set (match_operand:SF 0 "register_operand" "=f,f") ++ (float_truncate:SF (match_operand:DF 1 "nonimmediate_operand" "f,m")))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "@ ++ lrer\\t%0,%1 ++ le\\t%0,%1" ++ [(set_attr "op_type" "RR,RX")]) ++ ++; ++; extendsfdf2 instruction pattern(s). ++; ++ ++(define_expand "extendsfdf2" ++ [(set (match_operand:DF 0 "register_operand" "") ++ (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "")))] ++ "TARGET_HARD_FLOAT" ++ " ++{ ++ if (TARGET_IBM_FLOAT) ++ { ++ emit_insn (gen_extendsfdf2_ibm (operands[0], operands[1])); ++ DONE; ++ } ++}") ++ ++(define_insn "extendsfdf2_ieee" ++ [(set (match_operand:DF 0 "register_operand" "=f,f") ++ (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,m")))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "@ ++ ldebr\\t%0,%1 ++ ldeb\\t%0,%1" ++ [(set_attr "op_type" "RRE,RXE")]) ++ ++(define_insn "extendsfdf2_ibm" ++ [(set (match_operand:DF 0 "register_operand" "=f,f") ++ (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "@ ++ sdr\\t%0,%0\;ler\\t%0,%1 ++ sdr\\t%0,%0\;le\\t%0,%1" ++ [(set_attr "op_type" "RRE,RXE")]) ++ ++ ++;; ++;; ARITHMETRIC OPERATIONS ++;; ++; arithmetric operations set the ConditionCode, ++; because of unpredictable Bits in Register for Halfword and Byte ++; the ConditionCode can be set wrong in operations for Halfword and Byte ++ ++;; ++;;- Add instructions. ++;; ++ ++; ++; adddi3 instruction pattern(s). ++; ++ ++(define_insn "addaddr_esame" ++ [(set (match_operand:DI 0 "register_operand" "=a,a") ++ (plus:DI (match_operand:DI 1 "register_operand" "%a,a") ++ (match_operand:DI 2 "nonmemory_operand" "J,a")))] ++ "TARGET_64BIT && (((REGNO (operands[1]) == STACK_POINTER_REGNUM ) || ++ (REGNO (operands[1]) == BASE_REGISTER)) && ++ (GET_CODE (operands[2]) == REG || ++ CONST_OK_FOR_LETTER_P (INTVAL (operands[2]),'J')))" ++ "@ ++ la\\t%0,%c2(,%1) ++ la\\t%0,0(%1,%2)" ++ [(set_attr "op_type" "RX") ++ (set_attr "atype" "mem") ++ (set_attr "type" "la")]) ++ ++(define_insn "adddi3_64" ++ [(set (match_operand:DI 0 "register_operand" "=d,d,d") ++ (plus:DI (match_operand:DI 1 "register_operand" "%0,0,0") ++ (match_operand:DI 2 "general_operand" "d,K,m") ) ) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ agr\\t%0,%2 ++ aghi\\t%0,%h2 ++ ag\\t%0,%2" ++ [(set_attr "op_type" "RRE,RI,RXE") ++ (set_attr "atype" "reg,reg,mem") ++ (set_attr "type" "set")]) ++ ++; ++; For weakness of reload, need (set (reg x) (plus (reg y) (reg x))) ++; ++ ++(define_insn "adddi3_inv_64" ++ [(set (match_operand:DI 0 "register_operand" "=d,d,d") ++ (plus:DI (match_operand:DI 1 "general_operand" "%d,K,m") ++ (match_operand:DI 2 "register_operand" "0,0,0") ) ) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ agr\\t%0,%1 ++ aghi\\t%0,%h1 ++ ag\\t%0,%1" ++ [(set_attr "op_type" "RRE,RI,RXE") ++ (set_attr "atype" "reg,reg,mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "adddi3_31" ++ [(set (match_operand:DI 0 "register_operand" "=d,d") ++ (plus:DI (match_operand:DI 1 "register_operand" "0,0") ++ (match_operand:DI 2 "general_operand" "d,m") ) ) ++ (clobber (reg:CC 33))] ++ "!TARGET_64BIT" ++ "* ++{ ++ switch(which_alternative) ++ { ++ case 0: /* d <- d */ ++ output_asm_insn (\"ar\\t%0,%2\", operands); ++ output_asm_insn (\"alr\\t%N0,%N2\", operands); ++ break; ++ ++ case 1: /* d <- m */ ++ output_asm_insn (\"a\\t%0,%2\", operands); ++ output_asm_insn (\"al\\t%N0,%N2\", operands); ++ break; ++ } ++ ++ output_asm_insn (\"brc\\t12,.+8\", operands); ++ return \"ahi\\t%0,1\"; ++}" ++ [(set_attr "op_type" "NN,NN") ++ (set_attr "atype" "reg,mem") ++ (set_attr "length" "12,16")]) ++ ++(define_expand "adddi3" ++ [(set (match_operand:DI 0 "register_operand" "") ++ (plus:DI (match_operand:DI 1 "register_operand" "") ++ (match_operand:DI 2 "general_operand" "")))] ++ "" ++ " ++{ ++ if (TARGET_64BIT) ++ emit_insn(gen_adddi3_64 (operands[0],operands[1],operands[2])); ++ else ++ emit_insn(gen_adddi3_31 (operands[0],operands[1],operands[2])); ++ DONE; ++}") ++ ++(define_insn "reload_load_address" ++ [(set (match_operand:DI 0 "register_operand" "=a") ++ (match_operand:QI 1 "address_operand" "p"))] ++ "TARGET_64BIT" ++ "la\\t%0,%a1" ++ [(set_attr "op_type" "RX") ++ (set_attr "atype" "mem") ++ (set_attr "type" "la")]) ++ ++(define_insn "*reload_load_address_reg_0" ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (plus:DI (match_operand:DI 1 "register_operand" "%0") ++ (match_operand:DI 2 "register_operand" "d")))] ++ "TARGET_64BIT" ++ "brxlg\\t%0,%2,.+6" ++ [(set_attr "op_type" "RIE") ++ (set_attr "atype" "reg") ++ (set_attr "type" "set")]) ++ ++(define_insn "*reload_la_64" ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (plus:DI (match_operand:DI 1 "general_operand" "g") ++ (match_operand:DI 2 "general_operand" "g")))] ++ "TARGET_64BIT && reload_in_progress" ++ "#") ++ ++(define_split ++ [(set (match_operand:DI 0 "register_operand" "") ++ (plus:DI (match_operand:DI 1 "general_operand" "") ++ (match_operand:DI 2 "register_operand" "")))] ++ "TARGET_64BIT && reload_completed ++ && !address_operand (gen_rtx_PLUS (DImode, operands[1], operands[2]), QImode) ++ && !rtx_equal_p (operands[0], operands[1]) ++ && !rtx_equal_p (operands[0], operands[2])" ++ [(set (match_dup 0) (match_dup 1)) ++ (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 2)))] ++ "") ++ ++(define_split ++ [(set (match_operand:DI 0 "register_operand" "") ++ (plus:DI (match_operand:DI 1 "register_operand" "") ++ (match_operand:DI 2 "general_operand" "")))] ++ "TARGET_64BIT && reload_completed ++ && !address_operand (gen_rtx_PLUS (DImode, operands[1], operands[2]), QImode) ++ && !rtx_equal_p (operands[0], operands[1]) ++ && !rtx_equal_p (operands[0], operands[2])" ++ [(set (match_dup 0) (match_dup 2)) ++ (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 1)))] ++ "") ++ ++; ++; addsi3 instruction pattern(s). ++; ++; The following insn is used when it is known that operand one is the stack pointer, ++; and operand two is small enough to fit in the displacement field ++; In this case, the result will be a address ++; ++ ++(define_insn "addaddr" ++ [(set (match_operand:SI 0 "register_operand" "=d,d") ++ (plus:SI (match_operand:SI 1 "register_operand" "%a,a") ++ (match_operand:SI 2 "nonmemory_operand" "J,a")))] ++ "(((REGNO (operands[1]) == STACK_POINTER_REGNUM ) || ++ (REGNO (operands[1]) == BASE_REGISTER)) && ++ (GET_CODE (operands[2]) == REG || ++ CONST_OK_FOR_LETTER_P (INTVAL (operands[2]),'J')))" ++ "@ ++ la\\t%0,%c2(,%1) ++ la\\t%0,0(%1,%2)" ++ [(set_attr "op_type" "RX") ++ (set_attr "atype" "mem") ++ (set_attr "type" "la")]) ++ ++(define_insn "*addaddr_picR" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (plus:SI (match_operand:SI 1 "register_operand" "a") ++ (unspec:SI [(match_operand:SI 2 "register_operand" "a")] 101)))] ++ "" ++ "la\\t%0,0(%1,%2)" ++ [(set_attr "op_type" "RX") ++ (set_attr "atype" "mem") ++ (set_attr "type" "la")]) ++ ++(define_insn "*addaddr_picL" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "a")] 101) ++ (match_operand:SI 1 "register_operand" "a")))] ++ "" ++ "la\\t%0,0(%1,%2)" ++ [(set_attr "op_type" "RX") ++ (set_attr "atype" "mem") ++ (set_attr "type" "la")]) ++ ++(define_insn "*addaddr_picN" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (unspec:SI [(match_operand:SI 1 "register_operand" "a")] 101))] ++ "" ++ "la\\t%0,0(%1)" ++ [(set_attr "op_type" "RX") ++ (set_attr "atype" "mem") ++ (set_attr "type" "la")]) ++ ++(define_insn "addsi3" ++ [(set (match_operand:SI 0 "register_operand" "=d,d,d") ++ (plus:SI (match_operand:SI 1 "register_operand" "%0,0,0") ++ (match_operand:SI 2 "general_operand" "d,K,m"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ ar\\t%0,%2 ++ ahi\\t%0,%h2 ++ a\\t%0,%2" ++ [(set_attr "op_type" "RR,RI,RX") ++ (set_attr "atype" "reg,reg,mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "do_la" ++ [(set (match_operand:SI 0 "register_operand" "=a") ++ (match_operand:QI 1 "address_operand" "p"))] ++ "volatile_ok" ++ "la\\t%0,%a1" ++ [(set_attr "op_type" "RX") ++ (set_attr "atype" "mem") ++ (set_attr "type" "la")]) ++ ++(define_insn "*do_la_reg_0" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (plus:SI (match_operand:SI 1 "register_operand" "%0") ++ (match_operand:SI 2 "register_operand" "d")))] ++ "" ++ "brxle\\t%0,%2,.+4" ++ [(set_attr "op_type" "RSI") ++ (set_attr "atype" "reg") ++ (set_attr "type" "set")]) ++ ++(define_insn "*reload_la_31" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (plus:SI (match_operand:SI 1 "general_operand" "g") ++ (match_operand:SI 2 "general_operand" "g")))] ++ "reload_in_progress" ++ "#") ++ ++(define_split ++ [(set (match_operand:SI 0 "register_operand" "") ++ (plus:SI (match_operand:SI 1 "general_operand" "") ++ (match_operand:SI 2 "register_operand" "")))] ++ "reload_completed ++ && !address_operand (gen_rtx_PLUS (SImode, operands[1], operands[2]), QImode) ++ && !rtx_equal_p (operands[0], operands[1]) ++ && !rtx_equal_p (operands[0], operands[2])" ++ [(set (match_dup 0) (match_dup 1)) ++ (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2)))] ++ "") ++ ++(define_split ++ [(set (match_operand:SI 0 "register_operand" "") ++ (plus:SI (match_operand:SI 1 "register_operand" "") ++ (match_operand:SI 2 "general_operand" "")))] ++ "reload_completed ++ && !address_operand (gen_rtx_PLUS (SImode, operands[1], operands[2]), QImode) ++ && !rtx_equal_p (operands[0], operands[1]) ++ && !rtx_equal_p (operands[0], operands[2])" ++ [(set (match_dup 0) (match_dup 2)) ++ (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1)))] ++ "") ++ ++(define_insn "addsi_64" ++ [(set (match_operand:SI 0 "register_operand" "=d,d") ++ (plus:SI (match_operand:SI 1 "register_operand" "%a,a") ++ (match_operand:SI 2 "nonmemory_operand" "J,a")))] ++ "TARGET_64BIT" ++ "@ ++ la\\t%0,%c2(,%1) ++ la\\t%0,0(%1,%2)" ++ [(set_attr "op_type" "RX") ++ (set_attr "atype" "mem") ++ (set_attr "type" "la")]) ++ ++; ++; addhi3 instruction pattern(s). ++; ++ ++(define_insn "addhi3" ++ [(set (match_operand:HI 0 "register_operand" "=d,d,d") ++ (plus:HI (match_operand:HI 1 "register_operand" "%0,0,0") ++ (match_operand:HI 2 "general_operand" "d,K,m"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ ar\\t%0,%2 ++ ahi\\t%0,%h2 ++ ah\\t%0,%2" ++ [(set_attr "op_type" "RR,RI,RX") ++ (set_attr "atype" "reg,reg,mem")]) ++ ++ ++; ++; addqi3 instruction pattern(s). ++; ++ ++(define_insn "addqi3" ++ [(set (match_operand:QI 0 "register_operand" "=d,d") ++ (plus:QI (match_operand:QI 1 "register_operand" "%0,0") ++ (match_operand:QI 2 "general_operand" "a,n"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ ar\\t%0,%2 ++ ahi\\t%0,%h2" ++ [(set_attr "op_type" "RX,RX") ++ (set_attr "atype" "reg,mem")]) ++ ++ ++; ++; adddf3 instruction pattern(s). ++; ++ ++(define_expand "adddf3" ++ [(parallel ++ [(set (match_operand:DF 0 "register_operand" "=f,f") ++ (plus:DF (match_operand:DF 1 "register_operand" "%0,0") ++ (match_operand:DF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))])] ++ "TARGET_HARD_FLOAT" ++ "") ++ ++(define_insn "*adddf3" ++ [(set (match_operand:DF 0 "register_operand" "=f,f") ++ (plus:DF (match_operand:DF 1 "register_operand" "%0,0") ++ (match_operand:DF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "@ ++ adbr\\t%0,%2 ++ adb\\t%0,%2" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "atype" "reg,mem")]) ++ ++(define_insn "*adddf3_ibm" ++ [(set (match_operand:DF 0 "register_operand" "=f,f") ++ (plus:DF (match_operand:DF 1 "register_operand" "%0,0") ++ (match_operand:DF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "@ ++ adr\\t%0,%2 ++ ad\\t%0,%2" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "atype" "reg,mem")]) ++ ++; ++; addsf3 instruction pattern(s). ++; ++ ++(define_expand "addsf3" ++ [(parallel ++ [(set (match_operand:SF 0 "register_operand" "=f,f") ++ (plus:SF (match_operand:SF 1 "register_operand" "%0,0") ++ (match_operand:SF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))])] ++ "TARGET_HARD_FLOAT" ++ "") ++ ++(define_insn "*addsf3" ++ [(set (match_operand:SF 0 "register_operand" "=f,f") ++ (plus:SF (match_operand:SF 1 "register_operand" "%0,0") ++ (match_operand:SF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "@ ++ aebr\\t%0,%2 ++ aeb\\t%0,%2" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "atype" "reg,mem")]) ++ ++(define_insn "*addsf3" ++ [(set (match_operand:SF 0 "register_operand" "=f,f") ++ (plus:SF (match_operand:SF 1 "register_operand" "%0,0") ++ (match_operand:SF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "@ ++ aer\\t%0,%2 ++ ae\\t%0,%2" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "atype" "reg,mem")]) ++ ++ ++;; ++;;- Subtract instructions. ++;; ++ ++; ++; subdi3 instruction pattern(s). ++; ++ ++(define_insn "*subdi3_64" ++ [(set (match_operand:DI 0 "register_operand" "=d,d") ++ (minus:DI (match_operand:DI 1 "register_operand" "0,0") ++ (match_operand:DI 2 "general_operand" "d,m") ) ) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ sgr\\t%0,%2 ++ sg\\t%0,%2" ++ [(set_attr "op_type" "RRE,RRE") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "subdi3" ++ [(set (match_operand:DI 0 "register_operand" "=d,d") ++ (minus:DI (match_operand:DI 1 "register_operand" "0,0") ++ (match_operand:DI 2 "nonimmediate_operand" "d,m"))) ++ (clobber (reg:CC 33))] ++ "" ++ "* ++{ ++ switch (which_alternative) ++ { ++ case 0: /* d <- d */ ++ output_asm_insn (\"sr\\t%0,%2\", operands); ++ output_asm_insn (\"slr\\t%N0,%N2\", operands); ++ break; ++ case 1: /* d <- m */ ++ output_asm_insn (\"s\\t%0,%2\", operands); ++ output_asm_insn (\"sl\\t%N0,%N2\", operands); ++ break; ++ } ++ ++ output_asm_insn (\"brc\\t11,.+8\", operands); ++ return \"ahi\\t%0,-1\"; ++}" ++ [(set_attr "op_type" "NN,NN") ++ (set_attr "atype" "reg,mem") ++ (set_attr "length" "12,16")]) ++ ++; ++; subsi3 instruction pattern(s). ++; ++ ++(define_insn "subsi3" ++ [(set (match_operand:SI 0 "register_operand" "=d,d") ++ (minus:SI (match_operand:SI 1 "register_operand" "0,0") ++ (match_operand:SI 2 "general_operand" "d,m"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ sr\\t%0,%2 ++ s\\t%0,%2" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "set")]) ++ ++; ++; subhi3 instruction pattern(s). ++; ++ ++(define_insn "subhi3" ++ [(set (match_operand:HI 0 "register_operand" "=d,d,d") ++ (minus:HI (match_operand:HI 1 "register_operand" "0,0,0") ++ (match_operand:HI 2 "nonimmediate_operand" "d,K,m"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ sr\\t%0,%2 ++ ahi\\t%0,-%h2 ++ sh\\t%0,%2" ++ [(set_attr "op_type" "RR,RI,RX") ++ (set_attr "atype" "reg,reg,mem")]) ++ ++; ++; subqi3 instruction pattern(s). ++; ++ ++(define_insn "subqi3" ++ [(set (match_operand:QI 0 "register_operand" "=d") ++ (minus:QI (match_operand:QI 1 "register_operand" "0") ++ (match_operand:QI 2 "register_operand" "d"))) ++ (clobber (reg:CC 33))] ++ "" ++ "sr\\t%0,%2" ++ [(set_attr "op_type" "RR")]) ++ ++; ++; subdf3 instruction pattern(s). ++; ++ ++(define_expand "subdf3" ++ [(parallel ++ [(set (match_operand:DF 0 "register_operand" "=f,f") ++ (minus:DF (match_operand:DF 1 "register_operand" "0,0") ++ (match_operand:DF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))])] ++ "TARGET_HARD_FLOAT" ++ "") ++ ++(define_insn "*subdf3" ++ [(set (match_operand:DF 0 "register_operand" "=f,f") ++ (minus:DF (match_operand:DF 1 "register_operand" "0,0") ++ (match_operand:DF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "@ ++ sdbr\\t%0,%2 ++ sdb\\t%0,%2" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "atype" "reg,mem")]) ++ ++(define_insn "*subdf3_ibm" ++ [(set (match_operand:DF 0 "register_operand" "=f,f") ++ (minus:DF (match_operand:DF 1 "register_operand" "0,0") ++ (match_operand:DF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "@ ++ sdr\\t%0,%2 ++ sd\\t%0,%2" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "atype" "reg,mem")]) ++ ++; ++; subsf3 instruction pattern(s). ++; ++ ++(define_expand "subsf3" ++ [(parallel ++ [(set (match_operand:SF 0 "register_operand" "=f,f") ++ (minus:SF (match_operand:SF 1 "register_operand" "0,0") ++ (match_operand:SF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))])] ++ "TARGET_HARD_FLOAT" ++ "") ++ ++(define_insn "*subsf3" ++ [(set (match_operand:SF 0 "register_operand" "=f,f") ++ (minus:SF (match_operand:SF 1 "register_operand" "0,0") ++ (match_operand:SF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "@ ++ sebr\\t%0,%2 ++ seb\\t%0,%2" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "atype" "reg,mem")]) ++ ++(define_insn "*subsf3_ibm" ++ [(set (match_operand:SF 0 "register_operand" "=f,f") ++ (minus:SF (match_operand:SF 1 "register_operand" "0,0") ++ (match_operand:SF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "@ ++ ser\\t%0,%2 ++ se\\t%0,%2" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "atype" "reg,mem")]) ++ ++ ++;; ++;;- Multiply instructions. ++;; ++ ++(define_expand "muldi3" ++ [(parallel ++ [(set (match_operand:DI 0 "register_operand" "") ++ (mult:DI (match_operand:DI 1 "register_operand" "") ++ (match_operand:DI 2 "register_operand" ""))) ++ (clobber (reg:CC 33))])] ++ "" ++ " ++{ ++ if (!TARGET_64BIT) ++ { ++ rtx label1 = gen_label_rtx (); ++ rtx label2 = gen_label_rtx (); ++ rtx op0_0 = operand_subword (operands[0], 0 ,1, DImode); ++ rtx op0_1 = operand_subword (operands[0], 1 ,1, DImode); ++ rtx temp1_0 = gen_reg_rtx (SImode); ++ rtx temp1_1 = gen_reg_rtx (SImode); ++ rtx temp2_0 = gen_reg_rtx (SImode); ++ rtx temp2_1 = gen_reg_rtx (SImode); ++ ++ emit_move_insn (temp1_0, operand_subword (operands[1], 0 ,1, DImode)); ++ emit_move_insn (temp1_1, operand_subword (operands[1], 1 ,1, DImode)); ++ emit_move_insn (temp2_0, operand_subword (operands[2], 0 ,1, DImode)); ++ emit_move_insn (temp2_1, operand_subword (operands[2], 1 ,1, DImode)); ++ emit_move_insn (op0_1, temp1_1); ++ emit_insn (gen_mulsi_6432 (operands[0], operands[0], temp2_1)); ++ ++ emit_insn (gen_cmpsi (temp1_1, const0_rtx)); ++ emit_jump_insn (gen_bge (label1)); ++ emit_insn (gen_addsi3 (op0_0, op0_0, temp2_1)); ++ emit_label (label1); ++ emit_insn (gen_cmpsi (temp2_1, const0_rtx)); ++ emit_jump_insn (gen_bge (label2)); ++ emit_insn (gen_addsi3 (op0_0, op0_0, temp1_1)); ++ emit_label (label2); ++ ++ emit_insn (gen_mulsi3 (temp2_1, temp2_1, temp1_0)); ++ emit_insn (gen_addsi3 (op0_0, op0_0, temp2_1)); ++ ++ emit_insn (gen_mulsi3 (temp1_1, temp1_1, temp2_0)); ++ emit_insn (gen_addsi3 (op0_0, op0_0, temp1_1)); ++ ++ DONE; ++ } ++}") ++ ++(define_insn "*muldi3_64" ++ [(set (match_operand:DI 0 "register_operand" "=d,d,d") ++ (mult:DI (match_operand:DI 1 "register_operand" "%0,0,0") ++ (match_operand:DI 2 "general_operand" "d,K,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ msgr\\t%0,%2 ++ mghi\\t%0,%h2 ++ msg\\t%0,%2" ++ [(set_attr "op_type" "RRE,RI,RX") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "reg,reg,mem") ++ (set_attr "type" "set")]) ++ ++; ++; mulsi3 instruction pattern(s). ++; ++ ++(define_insn "mulsi3" ++ [(set (match_operand:SI 0 "register_operand" "=d,d,d") ++ (mult:SI (match_operand:SI 1 "register_operand" "%0,0,0") ++ (match_operand:SI 2 "general_operand" "d,K,m"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ msr\\t%0,%2 ++ mhi\\t%0,%h2 ++ ms\\t%0,%2" ++ [(set_attr "op_type" "RRE,RI,RX") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "reg,reg,mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "mulsi_6432" ++ [(set (match_operand:DI 0 "register_operand" "=d,d") ++ (mult:DI (sign_extend:DI ++ (truncate:SI (match_operand:DI 1 "register_operand" "0,0"))) ++ (sign_extend:DI ++ (match_operand:SI 2 "general_operand" "d,m")))) ++ (clobber (reg:CC 33))] ++ "!TARGET_64BIT" ++ "@ ++ mr\\t%0,%2 ++ m\\t%0,%2" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "set")]) ++ ++ ++; ++; muldf3 instruction pattern(s). ++; ++ ++(define_expand "muldf3" ++ [(parallel ++ [(set (match_operand:DF 0 "register_operand" "=f,f") ++ (mult:DF (match_operand:DF 1 "register_operand" "%0,0") ++ (match_operand:DF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))])] ++ "TARGET_HARD_FLOAT" ++ "") ++ ++(define_insn "*muldf3" ++ [(set (match_operand:DF 0 "register_operand" "=f,f") ++ (mult:DF (match_operand:DF 1 "register_operand" "%0,0") ++ (match_operand:DF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "@ ++ mdbr\\t%0,%2 ++ mdb\\t%0,%2" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "reg,mem")]) ++ ++(define_insn "*muldf3_ibm" ++ [(set (match_operand:DF 0 "register_operand" "=f,f") ++ (mult:DF (match_operand:DF 1 "register_operand" "%0,0") ++ (match_operand:DF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "@ ++ mdr\\t%0,%2 ++ md\\t%0,%2" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "reg,mem")]) ++ ++; ++; mulsf3 instruction pattern(s). ++; ++ ++(define_expand "mulsf3" ++ [(parallel ++ [(set (match_operand:SF 0 "register_operand" "=f,f") ++ (mult:SF (match_operand:SF 1 "register_operand" "%0,0") ++ (match_operand:SF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))])] ++ "TARGET_HARD_FLOAT" ++ "") ++ ++(define_insn "*mulsf3" ++ [(set (match_operand:SF 0 "register_operand" "=f,f") ++ (mult:SF (match_operand:SF 1 "register_operand" "%0,0") ++ (match_operand:SF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "@ ++ meebr\\t%0,%2 ++ meeb\\t%0,%2" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "reg,mem")]) ++ ++(define_insn "*mulsf3_ibm" ++ [(set (match_operand:SF 0 "register_operand" "=f,f") ++ (mult:SF (match_operand:SF 1 "register_operand" "%0,0") ++ (match_operand:SF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "@ ++ mer\\t%0,%2 ++ me\\t%0,%2" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "reg,mem")]) ++ ++ ++;; ++;;- Divide and modulo instructions. ++;; ++ ++; ++; divdi3 and moddi3 instruction pattern(s). ++; ++ ++(define_expand "divdi3" ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (div:DI (match_operand:DI 1 "register_operand" "d") ++ (match_operand:DI 2 "general_operand" "")))] ++ "TARGET_64BIT" ++ " ++{ ++ rtx op3 = gen_reg_rtx (TImode); ++ ++ if (CONSTANT_P (operands[2])) ++ operands[2] = force_const_mem (DImode, operands[2]); ++ ++ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 0), const0_rtx); ++ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 1), operands[1]); ++ emit_insn (gen_divmodtidi3 (op3, op3, operands[2])); ++ emit_move_insn (operands[0], gen_rtx (SUBREG, DImode, op3, 1)); ++ DONE; ++}") ++ ++(define_expand "moddi3" ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (mod:DI (match_operand:DI 1 "register_operand" "d") ++ (match_operand:DI 2 "general_operand" "")))] ++ "TARGET_64BIT" ++ " ++{ ++ rtx op3 = gen_reg_rtx (TImode); ++ ++ if (CONSTANT_P (operands[2])) ++ operands[2] = force_const_mem (DImode, operands[2]); ++ ++ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 0), const0_rtx); ++ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 1), operands[1]); ++ emit_insn (gen_divmodtidi3 (op3, op3, operands[2])); ++ emit_move_insn (operands[0], gen_rtx (SUBREG, DImode, op3, 0)); ++ DONE; ++}") ++ ++(define_insn "divmodtidi3" ++ [(set (subreg:DI (match_operand:TI 0 "register_operand" "=d,d") 0) ++ (truncate:DI ++ (mod:TI (match_operand:TI 1 "register_operand" "0,0") ++ (sign_extend:TI ++ (match_operand:DI 2 "nonimmediate_operand" "d,m"))))) ++ (set (subreg:DI (match_dup 0) 1) ++ (truncate:DI (div:TI (match_dup 1) (sign_extend:TI (match_dup 2))))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ dsgr\\t%0,%2 ++ dsg\\t%0,%2" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "reg,mem")]) ++ ++; ++; udivdi3 and umoddi3 instruction pattern(s). ++; ++ ++(define_expand "udivdi3" ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (udiv:DI (match_operand:DI 1 "register_operand" "d") ++ (match_operand:DI 2 "general_operand" "")))] ++ "TARGET_64BIT" ++ " ++{ ++ rtx op3 = gen_reg_rtx(TImode); ++ ++ if (CONSTANT_P (operands[2])) ++ operands[2] = force_const_mem (DImode, operands[2]); ++ ++ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 0), const0_rtx); ++ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 1), operands[1]); ++ emit_insn (gen_udivmodtidi3 (op3, op3, operands[2])); ++ emit_move_insn (operands[0], gen_rtx (SUBREG, DImode, op3, 1)); ++ DONE; ++}") ++ ++(define_expand "umoddi3" ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (umod:DI (match_operand:DI 1 "register_operand" "d") ++ (match_operand:DI 2 "general_operand" "")))] ++ "TARGET_64BIT" ++ " ++{ ++ rtx op3 = gen_reg_rtx (TImode); ++ ++ if (CONSTANT_P (operands[2])) ++ operands[2] = force_const_mem (DImode, operands[2]); ++ ++ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 0), const0_rtx); ++ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 1), operands[1]); ++ emit_insn (gen_udivmodtidi3 (op3, op3, operands[2])); ++ emit_move_insn (operands[0], gen_rtx (SUBREG, DImode, op3, 0)); ++ DONE; ++}") ++ ++(define_insn "udivmodtidi3" ++ [(set (subreg:DI (match_operand:TI 0 "register_operand" "=d,d") 0) ++ (truncate:DI ++ (umod:TI (match_operand:TI 1 "register_operand" "0,0") ++ (zero_extend:TI ++ (match_operand:DI 2 "nonimmediate_operand" "d,m"))))) ++ (set (subreg:DI (match_dup 0) 1) ++ (truncate:DI (udiv:TI (match_dup 1) (zero_extend:TI (match_dup 2))))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ dlgr\\t%0,%2 ++ dlg\\t%0,%2" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "reg,mem")]) ++ ++; ++; divsi3 and modsi3 instruction pattern(s). ++; ++ ++(define_expand "divsi3" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (div:SI (match_operand:SI 1 "register_operand" "d") ++ (match_operand:SI 2 "nonimmediate_operand" "")))] ++ "!TARGET_64BIT" ++ " ++{ ++ rtx tmp = gen_reg_rtx (DImode); ++ ++ if (CONSTANT_P (operands[2])) ++ operands[2] = force_const_mem (SImode, operands[2]); ++ else ++ operands[2] = force_reg (SImode, operands[2]); ++ ++ emit_insn (gen_rtx_CLOBBER (DImode, tmp)); ++ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), operands[1]); ++ emit_insn (gen_ashrdi3 (tmp, tmp, GEN_INT (32))); ++ emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2])); ++ emit_move_insn (operands[0], gen_rtx (SUBREG, SImode, tmp, 1)); ++ DONE; ++}") ++ ++(define_expand "modsi3" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (mod:SI (match_operand:SI 1 "register_operand" "d") ++ (match_operand:SI 2 "nonimmediate_operand" "")))] ++ "!TARGET_64BIT" ++ " ++{ ++ rtx tmp = gen_reg_rtx (DImode); ++ ++ if (CONSTANT_P (operands[2])) ++ operands[2] = force_const_mem (SImode, operands[2]); ++ else ++ operands[2] = force_reg (SImode, operands[2]); ++ ++ emit_insn (gen_rtx_CLOBBER (DImode, tmp)); ++ emit_insn (gen_movsi (gen_rtx_SUBREG (SImode, tmp, 0), operands[1])); ++ emit_insn (gen_ashrdi3 (tmp, tmp, GEN_INT (32))); ++ emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2])); ++ emit_move_insn (operands[0], gen_rtx (SUBREG, SImode, tmp, 0)); ++ DONE; ++}") ++ ++(define_insn "divmoddisi3" ++ [(set (subreg:SI (match_operand:DI 0 "register_operand" "=d,d") 0) ++ (truncate:SI ++ (mod:DI (match_operand:DI 1 "register_operand" "0,0") ++ (sign_extend:DI ++ (match_operand:SI 2 "nonimmediate_operand" "d,m"))))) ++ (set (subreg:SI (match_dup 0) 1) ++ (truncate:SI (div:DI (match_dup 1) (sign_extend:DI (match_dup 2))))) ++ (clobber (reg:CC 33))] ++ "!TARGET_64BIT" ++ "@ ++ dr\\t%0,%2 ++ d\\t%0,%2" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "reg,mem")]) ++ ++; ++; udivsi3 and umodsi3 instruction pattern(s). ++; ++ ++(define_expand "udivsi3" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (udiv:SI (match_operand:SI 1 "general_operand" "") ++ (match_operand:SI 2 "general_operand" "")))] ++ "!TARGET_64BIT" ++ " ++{ ++ rtx dr_0, dr_1, tmp; ++ ++ tmp = gen_reg_rtx (DImode); ++ dr_0 = gen_rtx (SUBREG, SImode, tmp, 0); ++ dr_1 = gen_rtx (SUBREG, SImode, tmp, 1); ++ ++ if (CONSTANT_P (operands[2])) ++ { ++ if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0) ++ { ++ rtx label1 = gen_label_rtx (); ++ ++ emit_move_insn (dr_0, operands[1]); ++ emit_move_insn (dr_1, const0_rtx); ++ emit_insn (gen_cmpsi (dr_0, operands[2])); ++ emit_jump_insn (gen_bltu (label1)); ++ emit_move_insn (dr_1, const1_rtx); ++ emit_label (label1); ++ } ++ else ++ { ++ operands[2] = force_const_mem (SImode, operands[2]); ++ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), const0_rtx); ++ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 1), operands[1]); ++ emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2])); ++ } ++ } ++ else ++ { ++ rtx label1 = gen_label_rtx (); ++ rtx label2 = gen_label_rtx (); ++ rtx label3 = gen_label_rtx (); ++ ++ operands[1] = force_reg (SImode, operands[1]); ++ operands[2] = force_reg (SImode, operands[2]); ++ ++ emit_move_insn (dr_1, const0_rtx); ++ emit_insn (gen_cmpsi (operands[2], operands[1])); ++ emit_jump_insn (gen_bgtu (label3)); ++ emit_insn (gen_cmpsi (operands[2], const1_rtx)); ++ emit_jump_insn (gen_blt (label2)); ++ emit_insn (gen_cmpsi (operands[2], const1_rtx)); ++ emit_jump_insn (gen_beq (label1)); ++ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), const0_rtx); ++ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 1), operands[1]); ++ emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2])); ++ emit_jump_insn (gen_jump (label3)); ++ emit_label (label1); ++ emit_move_insn (dr_1, operands[1]); ++ emit_jump_insn (gen_jump (label3)); ++ emit_label (label2); ++ emit_move_insn (dr_1, const1_rtx); ++ emit_label (label3); ++ } ++ ++ emit_move_insn (operands[0], dr_1); ++ DONE; ++}") ++ ++(define_expand "umodsi3" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (umod:SI (match_operand:SI 1 "nonimmediate_operand" "") ++ (match_operand:SI 2 "nonimmediate_operand" "")))] ++ "!TARGET_64BIT" ++ " ++{ ++ rtx dr_0, dr_1, tmp; ++ ++ tmp = gen_reg_rtx (DImode); ++ dr_0 = gen_rtx (SUBREG, SImode, tmp, 0); ++ dr_1 = gen_rtx (SUBREG, SImode, tmp, 1); ++ ++ if (CONSTANT_P (operands[2])) ++ { ++ if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 0) ++ { ++ rtx label1 = gen_label_rtx (); ++ ++ emit_move_insn (dr_0, operands[1]); ++ emit_insn (gen_cmpsi (dr_0, operands[2])); ++ emit_jump_insn (gen_bltu (label1)); ++ emit_insn (gen_abssi2 (dr_0, operands[2])); ++ emit_insn (gen_addsi3 (dr_0,dr_0, operands[1])); ++ emit_label (label1); ++ } ++ else ++ { ++ operands[2] = force_const_mem (SImode, operands[2]); ++ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), const0_rtx); ++ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 1), operands[1]); ++ emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2])); ++ } ++ } ++ else ++ { ++ rtx label1 = gen_label_rtx (); ++ rtx label2 = gen_label_rtx (); ++ rtx label3 = gen_label_rtx (); ++ ++ operands[1] = force_reg (SImode, operands[1]); ++ operands[2] = force_reg (SImode, operands[2]); ++ ++ emit_move_insn(dr_0, operands[1]); ++ emit_insn (gen_cmpsi (operands[2], dr_0)); ++ emit_jump_insn (gen_bgtu (label3)); ++ emit_insn (gen_cmpsi (operands[2], const1_rtx)); ++ emit_jump_insn (gen_blt (label2)); ++ emit_insn (gen_cmpsi (operands[2], const1_rtx)); ++ emit_jump_insn (gen_beq (label1)); ++ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), const0_rtx); ++ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 1), operands[1]); ++ emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2])); ++ emit_jump_insn (gen_jump (label3)); ++ emit_label (label1); ++ emit_move_insn (dr_0, const0_rtx); ++ emit_jump_insn (gen_jump (label3)); ++ emit_label (label2); ++ emit_insn (gen_subsi3 (dr_0, dr_0, operands[2])); ++ emit_label (label3); ++ } ++ ++ emit_move_insn (operands[0], dr_0); ++ DONE; ++}") ++ ++; ++; divdf3 instruction pattern(s). ++; ++ ++(define_expand "divdf3" ++ [(parallel ++ [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f") ++ (div:DF (match_operand:DF 1 "general_operand" "0,0") ++ (match_operand:DF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))])] ++ "TARGET_HARD_FLOAT" ++ "") ++ ++(define_insn "*divdf3" ++ [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f") ++ (div:DF (match_operand:DF 1 "general_operand" "0,0") ++ (match_operand:DF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "@ ++ ddbr\\t%0,%2 ++ ddb\\t%0,%2" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "reg,mem")]) ++ ++(define_insn "*divdf3_ibm" ++ [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f") ++ (div:DF (match_operand:DF 1 "general_operand" "0,0") ++ (match_operand:DF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "@ ++ ddr\\t%0,%2 ++ dd\\t%0,%2" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "reg,mem")]) ++ ++; ++; divsf3 instruction pattern(s). ++; ++ ++(define_expand "divsf3" ++ [(parallel ++ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f") ++ (div:SF (match_operand:SF 1 "nonimmediate_operand" "0,0") ++ (match_operand:SF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))])] ++ "TARGET_HARD_FLOAT" ++ "") ++ ++(define_insn "*divsf3" ++ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f") ++ (div:SF (match_operand:SF 1 "nonimmediate_operand" "0,0") ++ (match_operand:SF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "@ ++ debr\\t%0,%2 ++ deb\\t%0,%2" ++ [(set_attr "op_type" "RRE,RXE") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "reg,mem")]) ++ ++(define_insn "*divsf3" ++ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f") ++ (div:SF (match_operand:SF 1 "nonimmediate_operand" "0,0") ++ (match_operand:SF 2 "nonimmediate_operand" "f,m"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "@ ++ der\\t%0,%2 ++ de\\t%0,%2" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "reg,mem")]) ++ ++ ++;; ++;;- And instructions. ++;; ++ ++; ++; anddi3 instruction pattern(s). ++; ++ ++(define_insn "*anddi3_cc" ++ [(set (reg 33) ++ (compare (and:DI (match_operand:DI 1 "r_or_s_operand" "%0,0,0") ++ (match_operand:DI 2 "r_or_s_operand" "d,m,Q")) ++ (const_int 0))) ++ (set (match_operand:DI 0 "r_or_s_operand" "=d,d,Q") ++ (and:DI (match_dup 1) (match_dup 2)))] ++ "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT" ++ "@ ++ ngr\\t%0,%2 ++ ng\\t%0,%2 ++ nc\\t%O0(8,%R0),%2" ++ [(set_attr "op_type" "RR,RX,SS") ++ (set_attr "atype" "reg,mem,mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "*anddi3_cconly" ++ [(set (reg 33) ++ (compare (and:DI (match_operand:DI 1 "register_operand" "%0,0") ++ (match_operand:DI 2 "r_or_s_operand" "d,m")) ++ (const_int 0))) ++ (clobber (match_scratch:DI 0 "=d,d"))] ++ "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT" ++ "@ ++ ngr\\t%0,%2 ++ ng\\t%0,%2" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "anddi3" ++ [(set (match_operand:DI 0 "r_or_s_operand" "=d,d,Q") ++ (and:DI (match_operand:DI 1 "r_or_s_operand" "%0,0,0") ++ (match_operand:DI 2 "r_or_s_operand" "d,m,Q"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ ngr\\t%0,%2 ++ ng\\t%0,%2 ++ nc\\t%O0(8,%R0),%2" ++ [(set_attr "op_type" "RR,RX,SS") ++ (set_attr "atype" "reg,mem,mem") ++ (set_attr "type" "set")]) ++ ++; ++; andsi3 instruction pattern(s). ++; ++ ++(define_insn "*andsi3_cc" ++ [(set (reg 33) ++ (compare (and:SI (match_operand:SI 1 "r_or_s_operand" "%0,0,0") ++ (match_operand:SI 2 "r_or_s_operand" "d,m,Q")) ++ (const_int 0))) ++ (set (match_operand:SI 0 "r_or_s_operand" "=d,d,Q") ++ (and:SI (match_dup 1) (match_dup 2)))] ++ "s390_match_ccmode(insn, CCTmode)" ++ "@ ++ nr\\t%0,%2 ++ n\\t%0,%2 ++ nc\\t%O0(4,%R0),%2" ++ [(set_attr "op_type" "RR,RX,SS") ++ (set_attr "atype" "reg,mem,mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "*andsi3_cconly" ++ [(set (reg 33) ++ (compare (and:SI (match_operand:SI 1 "register_operand" "%0,0") ++ (match_operand:SI 2 "r_or_s_operand" "d,m")) ++ (const_int 0))) ++ (clobber (match_scratch:SI 0 "=d,d"))] ++ "s390_match_ccmode(insn, CCTmode)" ++ "@ ++ nr\\t%0,%2 ++ n\\t%0,%2" ++ [(set_attr "op_type" "RR,RX") ++ (set_attr "atype" "reg,mem") ++ (set_attr "type" "set")]) ++ ++(define_insn "andsi3" ++ [(set (match_operand:SI 0 "r_or_s_operand" "=d,d,Q") ++ (and:SI (match_operand:SI 1 "r_or_s_operand" "%0,0,0") ++ (match_operand:SI 2 "r_or_s_operand" "d,m,Q"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ nr\\t%0,%2 ++ n\\t%0,%2 ++ nc\\t%O0(4,%R0),%2" ++ [(set_attr "op_type" "RR,RX,SS") ++ (set_attr "atype" "reg,mem,mem") ++ (set_attr "type" "set")]) ++ ++; ++; andhi3 instruction pattern(s). ++; ++ ++(define_expand "andhi3" ++ [(parallel ++ [(set (match_operand:HI 0 "r_or_s_operand" "") ++ (and:HI (match_operand:HI 1 "r_or_s_operand" "") ++ (match_operand:HI 2 "r_or_s_operand" ""))) ++ (clobber (reg:CC 33))])] ++ "" ++ " ++{ ++ if (CONSTANT_P (operands[2])) ++ operands[2] = force_const_mem (HImode, operands[2]); ++}") ++ ++(define_insn "*andhi3" ++ [(set (match_operand:HI 0 "r_or_s_operand" "=d,Q") ++ (and:HI (match_operand:HI 1 "r_or_s_operand" "%0,0") ++ (match_operand:HI 2 "r_or_s_operand" "d,Q"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ nr\\t%0,%2 ++ nc\\t%O0(2,%R0),%2" ++ [(set_attr "op_type" "RR,SS") ++ (set_attr "atype" "reg,mem")]) ++ ++; ++; andqi3 instruction pattern(s). ++; ++ ++(define_insn "andqi3" ++ [(set (match_operand:QI 0 "r_or_s_operand" "=d,Q,Q") ++ (and:QI (match_operand:QI 1 "r_or_s_operand" "%0,0,0") ++ (match_operand:QI 2 "r_or_s_or_im8_operand" "d,n,Q"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ nr\\t%0,%2 ++ ni\\t%0,%b2 ++ nc\\t%O0(1,%R0),%2" ++ [(set_attr "op_type" "RR,SI,SS") ++ (set_attr "atype" "reg,mem,mem")]) ++ ++ ++;; ++;;- Bit set (inclusive or) instructions. ++;; ++ ++; ++; iordi3 instruction pattern(s). ++; ++ ++(define_insn "iordi3" ++ [(set (match_operand:DI 0 "r_or_s_operand" "=d,d,Q,d") ++ (ior:DI (match_operand:DI 1 "r_or_s_operand" "%0,0,0,0") ++ (match_operand:DI 2 "r_or_s_operand" "d,m,Q,L"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ ogr\\t%0,%2 ++ og\\t%0,%2 ++ oc\\t%O0(8,%R0),%2 ++ oill\\t%0,%2" ++ [(set_attr "op_type" "RRE,RXE,SS,RI") ++ (set_attr "atype" "reg,mem,mem,reg") ++ (set_attr "type" "set")]) ++ ++; ++; iorsi3 instruction pattern(s). ++; ++ ++(define_expand "iorsi3" ++ [(parallel ++ [(set (match_operand:SI 0 "r_or_s_operand" "") ++ (ior:SI (match_operand:SI 1 "r_or_s_operand" "") ++ (match_operand:SI 2 "r_or_s_operand" ""))) ++ (clobber (reg:CC 33))])] ++ "" ++ " ++{ ++ if (CONSTANT_P (operands[2])) ++ operands[2] = force_const_mem (SImode, operands[2]); ++}") ++ ++(define_insn "*iorsi3" ++ [(set (match_operand:SI 0 "r_or_s_operand" "=d,d,Q") ++ (ior:SI (match_operand:SI 1 "r_or_s_operand" "%0,0,0") ++ (match_operand:SI 2 "r_or_s_operand" "d,m,Q"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ or\\t%0,%2 ++ o\\t%0,%2 ++ oc\\t%O0(4,%R0),%2" ++ [(set_attr "op_type" "RR,RX,SS") ++ (set_attr "atype" "reg,mem,mem") ++ (set_attr "type" "set")]) ++ ++; ++; iorhi3 instruction pattern(s). ++; ++ ++(define_expand "iorhi3" ++ [(parallel ++ [(set (match_operand:HI 0 "r_or_s_operand" "") ++ (ior:HI (match_operand:HI 1 "r_or_s_operand" "") ++ (match_operand:HI 2 "r_or_s_operand" ""))) ++ (clobber (reg:CC 33))])] ++ "" ++ " ++{ ++ if (CONSTANT_P (operands[2])) ++ operands[2] = force_const_mem (HImode, operands[2]); ++}") ++ ++(define_insn "*iorhi3" ++ [(set (match_operand:HI 0 "r_or_s_operand" "=d,Q") ++ (ior:HI (match_operand:HI 1 "r_or_s_operand" "%0,0") ++ (match_operand:HI 2 "r_or_s_operand" "d,Q"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ or\\t%0,%2 ++ oc\\t%O0(2,%R0),%2" ++ [(set_attr "op_type" "RR,SS") ++ (set_attr "atype" "reg,mem")]) ++ ++; ++; iorqi3 instruction pattern(s). ++; ++ ++(define_insn "iorqi3" ++ [(set (match_operand:QI 0 "r_or_s_operand" "=d,Q,Q") ++ (ior:QI (match_operand:QI 1 "r_or_s_operand" "%0,0,0") ++ (match_operand:QI 2 "r_or_s_or_im8_operand" "d,n,Q"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ or\\t%0,%2 ++ oi\\t%0,%b2 ++ oc\\t%O0(1,%R0),%2" ++ [(set_attr "op_type" "RR,SI,SS") ++ (set_attr "atype" "reg,mem,mem")]) ++ ++ ++;; ++;;- Xor instructions. ++;; ++ ++; ++; xordi3 instruction pattern(s). ++; ++ ++(define_insn "xordi3" ++ [(set (match_operand:DI 0 "r_or_s_operand" "=d,d,Q") ++ (xor:DI (match_operand:DI 1 "r_or_s_operand" "%0,0,0") ++ (match_operand:DI 2 "r_or_s_operand" "d,m,Q"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ xgr\\t%0,%2 ++ xg\\t%0,%2 ++ xc\\t%O0(8,%R0),%2" ++ [(set_attr "op_type" "RRE,RXE,SS") ++ (set_attr "atype" "reg,mem,mem") ++ (set_attr "type" "set")]) ++ ++; ++; xorsi3 instruction pattern(s). ++; ++ ++(define_expand "xorsi3" ++ [(parallel ++ [(set (match_operand:SI 0 "r_or_s_operand" "") ++ (xor:SI (match_operand:SI 1 "r_or_s_operand" "") ++ (match_operand:SI 2 "r_or_s_operand" ""))) ++ (clobber (reg:CC 33))])] ++ "" ++ " ++{ ++ if (CONSTANT_P (operands[2])) ++ operands[2] = force_const_mem (SImode, operands[2]); ++}") ++ ++(define_insn "*xorsi3" ++ [(set (match_operand:SI 0 "r_or_s_operand" "=d,d,Q") ++ (xor:SI (match_operand:SI 1 "r_or_s_operand" "%0,0,0") ++ (match_operand:SI 2 "r_or_s_operand" "d,m,Q"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ xr\\t%0,%2 ++ x\\t%0,%2 ++ xc\\t%O0(4,%R0),%2" ++ [(set_attr "op_type" "RR,RX,SS") ++ (set_attr "atype" "reg,mem,mem") ++ (set_attr "type" "set")]) ++ ++; ++; xorhi3 instruction pattern(s). ++; ++ ++(define_expand "xorhi3" ++ [(parallel ++ [(set (match_operand:HI 0 "r_or_s_operand" "") ++ (xor:HI (match_operand:HI 1 "r_or_s_operand" "") ++ (match_operand:HI 2 "r_or_s_operand" ""))) ++ (clobber (reg:CC 33))])] ++ "" ++ " ++{ ++ if (CONSTANT_P (operands[2])) ++ operands[2] = force_const_mem (HImode, operands[2]); ++}") ++ ++(define_insn "*xorhi3" ++ [(set (match_operand:HI 0 "r_or_s_operand" "=d,Q") ++ (xor:HI (match_operand:HI 1 "r_or_s_operand" "%0,0") ++ (match_operand:HI 2 "r_or_s_operand" "d,Q"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ xr\\t%0,%2 ++ xc\\t%O0(2,%R0),%2" ++ [(set_attr "op_type" "RR,SS") ++ (set_attr "atype" "reg,mem")]) ++ ++; ++; xorqi3 instruction pattern(s). ++; ++ ++(define_insn "xorqi3" ++ [(set (match_operand:QI 0 "r_or_s_operand" "=d,Q,Q") ++ (xor:QI (match_operand:QI 1 "r_or_s_operand" "0,0,0") ++ (match_operand:QI 2 "r_or_s_or_im8_operand" "d,n,Q"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ xr\\t%0,%2 ++ xi\\t%0,%b2 ++ xc\\t%O0(1,%R0),%2" ++ [(set_attr "op_type" "RR,SI,SS") ++ (set_attr "atype" "reg,mem,mem")]) ++ ++ ++;; ++;;- Negate instructions. ++;; ++ ++; ++; negdi2 instruction pattern(s). ++; ++ ++(define_expand "negdi2" ++ [(parallel ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (neg:DI (match_operand:DI 1 "register_operand" "d"))) ++ (clobber (reg:CC 33))])] ++ "" ++ "") ++ ++(define_insn "*negdi2_64" ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (neg:DI (match_operand:DI 1 "register_operand" "d"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "lcgr\\t%0,%1" ++ [(set_attr "op_type" "RR") ++ (set_attr "type" "set")]) ++ ++(define_insn "*negdi2_31" ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (neg:DI (match_operand:DI 1 "register_operand" "d"))) ++ (clobber (reg:CC 33))] ++ "!TARGET_64BIT" ++ "* ++{ ++ rtx xop[1]; ++ xop[0] = gen_label_rtx (); ++ output_asm_insn (\"lcr\\t%0,%1\", operands); ++ output_asm_insn (\"lcr\\t%N0,%N1\", operands); ++ output_asm_insn (\"je\\t%l0\", xop); ++ output_asm_insn (\"bctr\\t%0,0\", operands); ++ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", ++ CODE_LABEL_NUMBER (xop[0])); ++ return \"\"; ++}" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "10")]) ++ ++; ++; negsi2 instruction pattern(s). ++; ++ ++(define_insn "negsi2" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (neg:SI (match_operand:SI 1 "register_operand" "d"))) ++ (clobber (reg:CC 33))] ++ "" ++ "lcr\\t%0,%1" ++ [(set_attr "op_type" "RR") ++ (set_attr "type" "set")]) ++ ++; ++; negdf2 instruction pattern(s). ++; ++ ++(define_expand "negdf2" ++ [(parallel ++ [(set (match_operand:DF 0 "register_operand" "=f") ++ (neg:DF (match_operand:DF 1 "register_operand" "f"))) ++ (clobber (reg:CC 33))])] ++ "TARGET_HARD_FLOAT" ++ "") ++ ++(define_insn "*negdf2" ++ [(set (match_operand:DF 0 "register_operand" "=f") ++ (neg:DF (match_operand:DF 1 "register_operand" "f"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "lcdbr\\t%0,%1" ++ [(set_attr "op_type" "RRE")]) ++ ++(define_insn "*negdf2_ibm" ++ [(set (match_operand:DF 0 "register_operand" "=f") ++ (neg:DF (match_operand:DF 1 "register_operand" "f"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "lcdr\\t%0,%1" ++ [(set_attr "op_type" "RR")]) ++ ++; ++; negsf2 instruction pattern(s). ++; ++ ++(define_expand "negsf2" ++ [(parallel ++ [(set (match_operand:SF 0 "register_operand" "=f") ++ (neg:SF (match_operand:SF 1 "register_operand" "f"))) ++ (clobber (reg:CC 33))])] ++ "TARGET_HARD_FLOAT" ++ "") ++ ++(define_insn "*negsf2" ++ [(set (match_operand:SF 0 "register_operand" "=f") ++ (neg:SF (match_operand:SF 1 "register_operand" "f"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "lcebr\\t%0,%1" ++ [(set_attr "op_type" "RRE")]) ++ ++(define_insn "*negsf2" ++ [(set (match_operand:SF 0 "register_operand" "=f") ++ (neg:SF (match_operand:SF 1 "register_operand" "f"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "lcer\\t%0,%1" ++ [(set_attr "op_type" "RR")]) ++ ++ ++;; ++;;- Absolute value instructions. ++;; ++ ++; ++; absdi2 instruction pattern(s). ++; ++ ++(define_insn "absdi2" ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (abs:DI (match_operand:DI 1 "register_operand" "d"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "lpgr\\t%0,%1" ++ [(set_attr "op_type" "RRE") ++ (set_attr "type" "set")]) ++ ++; ++; abssi2 instruction pattern(s). ++; ++ ++(define_insn "abssi2" ++ [(set (match_operand:SI 0 "register_operand" "=d") ++ (abs:SI (match_operand:SI 1 "register_operand" "d"))) ++ (clobber (reg:CC 33))] ++ "" ++ "lpr\\t%0,%1" ++ [(set_attr "op_type" "RR") ++ (set_attr "type" "set")]) ++ ++; ++; abshi2 instruction pattern(s). ++; ++ ++(define_insn "abshi2" ++ [(set (match_operand:HI 0 "register_operand" "=d") ++ (abs:HI (match_operand:HI 1 "register_operand" "d"))) ++ (clobber (reg:CC 33))] ++ "" ++ "sll\\t%1,16\;sra\\t%1,16\;lpr\\t%0,%1" ++ [(set_attr "op_type" "NN") ++ (set_attr "cycle" "3") ++ (set_attr "length" "10")]) ++ ++; ++; absdf2 instruction pattern(s). ++; ++ ++(define_expand "absdf2" ++ [(parallel ++ [(set (match_operand:DF 0 "register_operand" "=f") ++ (abs:DF (match_operand:DF 1 "register_operand" "f"))) ++ (clobber (reg:CC 33))])] ++ "TARGET_HARD_FLOAT" ++ "") ++ ++(define_insn "*absdf2" ++ [(set (match_operand:DF 0 "register_operand" "=f") ++ (abs:DF (match_operand:DF 1 "register_operand" "f"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "lpdbr\\t%0,%1" ++ [(set_attr "op_type" "RRE")]) ++ ++(define_insn "*absdf2_ibm" ++ [(set (match_operand:DF 0 "register_operand" "=f") ++ (abs:DF (match_operand:DF 1 "register_operand" "f"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "lpdr\\t%0,%1" ++ [(set_attr "op_type" "RR")]) ++ ++; ++; abssf2 instruction pattern(s). ++; ++ ++(define_expand "abssf2" ++ [(parallel ++ [(set (match_operand:SF 0 "register_operand" "=f") ++ (abs:SF (match_operand:SF 1 "register_operand" "f"))) ++ (clobber (reg:CC 33))])] ++ "TARGET_HARD_FLOAT" ++ "") ++ ++(define_insn "*abssf2" ++ [(set (match_operand:SF 0 "register_operand" "=f") ++ (abs:SF (match_operand:SF 1 "register_operand" "f"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" ++ "lpebr\\t%0,%1" ++ [(set_attr "op_type" "RRE")]) ++ ++(define_insn "*abssf2_ibm" ++ [(set (match_operand:SF 0 "register_operand" "=f") ++ (abs:SF (match_operand:SF 1 "register_operand" "f"))) ++ (clobber (reg:CC 33))] ++ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" ++ "lper\\t%0,%1" ++ [(set_attr "op_type" "RR")]) ++ ++ ++;; ++;;- One complement instructions. ++;; ++ ++; ++; one_cmpldi2 instruction pattern(s). ++; ++ ++(define_expand "one_cmpldi2" ++ [(parallel ++ [(set (match_operand:DI 0 "r_or_s_operand" "=d") ++ (not:DI (match_operand:DI 1 "r_or_s_operand" "0"))) ++ (use (match_dup 2)) ++ (clobber (reg:CC 33))])] ++ "TARGET_64BIT" ++ "{ operands[2] = force_const_mem (DImode, constm1_rtx); }") ++ ++(define_insn "*one_cmpldi2" ++ [(set (match_operand:DI 0 "r_or_s_operand" "=d,Q") ++ (not:DI (match_operand:DI 1 "r_or_s_operand" "0,0"))) ++ (use (match_operand:DI 2 "memory_operand" "m,m")) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ xg\\t%0,%2 ++ xc\\t%O0(8,%R0),%2" ++ [(set_attr "op_type" "RR,SS") ++ (set_attr "atype" "mem")]) ++ ++; ++; one_cmplsi2 instruction pattern(s). ++; ++ ++(define_expand "one_cmplsi2" ++ [(parallel ++ [(set (match_operand:SI 0 "r_or_s_operand" "=d") ++ (not:SI (match_operand:SI 1 "r_or_s_operand" "0"))) ++ (use (match_dup 2)) ++ (clobber (reg:CC 33))])] ++ "" ++ "{ operands[2] = force_const_mem (SImode, constm1_rtx); }") ++ ++(define_insn "*one_cmplsi2" ++ [(set (match_operand:SI 0 "r_or_s_operand" "=d,Q") ++ (not:SI (match_operand:SI 1 "r_or_s_operand" "0,0"))) ++ (use (match_operand:SI 2 "memory_operand" "m,m")) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ x\\t%0,%2 ++ xc\\t%O0(4,%R0),%2" ++ [(set_attr "op_type" "RR,SS") ++ (set_attr "atype" "mem")]) ++ ++; ++; one_cmplhi2 instruction pattern(s). ++; ++ ++(define_expand "one_cmplhi2" ++ [(parallel ++ [(set (match_operand:HI 0 "r_or_s_operand" "=d") ++ (not:HI (match_operand:HI 1 "r_or_s_operand" "0"))) ++ (use (match_dup 2)) ++ (clobber (reg:CC 33))])] ++ "" ++ "{ operands[2] = force_const_mem (SImode, constm1_rtx); }") ++ ++(define_insn "*one_cmplhi2" ++ [(set (match_operand:HI 0 "r_or_s_operand" "=d,Q") ++ (not:HI (match_operand:HI 1 "r_or_s_operand" "0,0"))) ++ (use (match_operand:SI 2 "memory_operand" "m,m")) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ x\\t%0,%2 ++ xc\\t%O0(2,%R0),%2" ++ [(set_attr "op_type" "RX,SS") ++ (set_attr "atype" "mem")]) ++ ++; ++; one_cmplqi2 instruction pattern(s). ++; ++ ++(define_insn "one_cmpqi2" ++ [(set (match_operand:QI 0 "memory_operand" "=Q") ++ (not:QI (match_operand:QI 1 "memory_operand" "0"))) ++ (clobber (reg:CC 33))] ++ "" ++ "xi\\t%0,255" ++ [(set_attr "op_type" "SI")]) ++ ++ ++;; ++;;- Rotate instructions. ++;; ++ ++; ++; rotldi3 instruction pattern(s). ++; ++ ++(define_insn "rotldi3" ++ [(set (match_operand:DI 0 "register_operand" "=d,d") ++ (rotate:DI (match_operand:DI 1 "register_operand" "d,d") ++ (match_operand:DI 2 "nonmemory_operand" "J,a"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ rllg\\t%0,%1,%c2 ++ rllg\\t%0,%1,0(%2)" ++ [(set_attr "op_type" "RSE") ++ (set_attr "type" "set")]) ++ ++; ++; rotlsi3 instruction pattern(s). ++; ++ ++(define_insn "rotlsi3" ++ [(set (match_operand:SI 0 "register_operand" "=d,d") ++ (rotate:SI (match_operand:SI 1 "register_operand" "d,d") ++ (match_operand:SI 2 "nonmemory_operand" "J,a"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ rll\\t%0,%1,%c2 ++ rll\\t%0,%1,0(%2)" ++ [(set_attr "op_type" "RSE") ++ (set_attr "type" "set")]) ++ ++ ++;; ++;;- Arithmetic shift instructions. ++;; ++;; for left shifts always setal shifts are used (ANSI-C) ++ ++; ++; ashldi3 instruction pattern(s). ++; ++ ++(define_expand "ashldi3" ++ [(parallel ++ [(set (match_operand:DI 0 "register_operand" "") ++ (ashift:DI (match_operand:DI 1 "register_operand" "") ++ (match_operand:SI 2 "nonmemory_operand" ""))) ++ (clobber (reg:CC 33))])] ++ "" ++ "") ++ ++(define_insn "*ashldi3_31" ++ [(set (match_operand:DI 0 "register_operand" "=d,d") ++ (ashift:DI (match_operand:DI 1 "register_operand" "0,0") ++ (match_operand:SI 2 "nonmemory_operand" "J,a"))) ++ (clobber (reg:CC 33))] ++ "!TARGET_64BIT" ++ "@ ++ sldl\\t%0,%c2 ++ sldl\\t%0,0(%2)" ++ [(set_attr "op_type" "RS") ++ (set_attr "type" "set")]) ++ ++(define_insn "*ashldi3_64" ++ [(set (match_operand:DI 0 "register_operand" "=d,d") ++ (ashift:DI (match_operand:DI 1 "register_operand" "d,d") ++ (match_operand:SI 2 "nonmemory_operand" "J,a"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ sllg\\t%0,%1,%2 ++ sllg\\t%0,%1,0(%2)" ++ [(set_attr "op_type" "RSE") ++ (set_attr "type" "set")]) ++ ++; ++; ashrdi3 instruction pattern(s). ++; ++ ++(define_expand "ashrdi3" ++ [(parallel ++ [(set (match_operand:DI 0 "register_operand" "") ++ (ashiftrt:DI (match_operand:DI 1 "register_operand" "") ++ (match_operand:SI 2 "nonmemory_operand" ""))) ++ (clobber (reg:CC 33))])] ++ "" ++ "") ++ ++(define_insn "*ashrdi3_31" ++ [(set (match_operand:DI 0 "register_operand" "=d,d") ++ (ashiftrt:DI (match_operand:DI 1 "register_operand" "0,0") ++ (match_operand:SI 2 "nonmemory_operand" "J,a"))) ++ (clobber (reg:CC 33))] ++ "!TARGET_64BIT" ++ "@ ++ srda\\t%0,%c2 ++ srda\\t%0,0(%2)" ++ [(set_attr "op_type" "RS")]) ++ ++(define_insn "*ashrdi3_64" ++ [(set (match_operand:DI 0 "register_operand" "=d,d") ++ (ashiftrt:DI (match_operand:DI 1 "register_operand" "d,d") ++ (match_operand:SI 2 "nonmemory_operand" "J,a"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ srag\\t%0,%1,%c2 ++ srag\\t%0,%1,0(%2)" ++ [(set_attr "op_type" "RSE") ++ (set_attr "type" "set")]) ++ ++; ++; ashlsi3 instruction pattern(s). ++; ++; all 32 bits has to be shifted (testcase co750c) ++ ++(define_insn "ashlsi3" ++ [(set (match_operand:SI 0 "register_operand" "=d,d") ++ (ashift:SI (match_operand:SI 1 "register_operand" "0,0") ++ (match_operand:SI 2 "r_or_im8_operand" "J,a"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ sll\\t%0,%c2 ++ sll\\t%0,0(%2)" ++ [(set_attr "op_type" "RS") ++ (set_attr "type" "set")]) ++ ++; ++; ashrsi3 instruction pattern(s). ++; ++ ++(define_insn "ashrsi3" ++ [(set (match_operand:SI 0 "register_operand" "=d,d") ++ (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0") ++ (match_operand:SI 2 "r_or_im8_operand" "J,a"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ sra\\t%0,%c2 ++ sra\\t%0,0(%2)" ++ [(set_attr "op_type" "RS") ++ (set_attr "type" "set")]) ++ ++; ++; ashlhi3 instruction pattern(s). ++; ++ ++(define_insn "ashlhi3" ++ [(set (match_operand:HI 0 "register_operand" "=d,d") ++ (ashift:HI (match_operand:HI 1 "register_operand" "0,0") ++ (match_operand:SI 2 "r_or_im8_operand" "J,a"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ sll\\t%0,%c2 ++ sll\\t%0,0(%2)" ++ [(set_attr "op_type" "RS,RS")]) ++ ++; ++; ashrhi3 instruction pattern(s). ++; ++ ++(define_insn "ashrhi3" ++ [(set (match_operand:HI 0 "register_operand" "=d,d") ++ (ashiftrt:HI (match_operand:HI 1 "register_operand" "0,0") ++ (match_operand:SI 2 "r_or_im8_operand" "J,a"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ sll\\t%0,16\;sra\\t%0,16+%c2 ++ sll\\t%0,16\;sra\\t%0,16(%2)" ++ [(set_attr "op_type" "NN,NN") ++ (set_attr "length" "8,8")]) ++ ++ ++;; ++;;- logical shift instructions. ++;; ++ ++; ++; lshrdi3 instruction pattern(s). ++; ++ ++(define_expand "lshrdi3" ++ [(parallel ++ [(set (match_operand:DI 0 "register_operand" "") ++ (lshiftrt:DI (match_operand:DI 1 "register_operand" "") ++ (match_operand:SI 2 "nonmemory_operand" ""))) ++ (clobber (reg:CC 33))])] ++ "" ++ "") ++ ++(define_insn "*lshrdi3_31" ++ [(set (match_operand:DI 0 "register_operand" "=d,d") ++ (lshiftrt:DI (match_operand:DI 1 "register_operand" "0,0") ++ (match_operand:SI 2 "nonmemory_operand" "J,a"))) ++ (clobber (reg:CC 33))] ++ "!TARGET_64BIT" ++ "@ ++ srdl\\t%0,%c2 ++ srdl\\t%0,0(%2)" ++ [(set_attr "op_type" "RS,RS")]) ++ ++(define_insn "*lshrdi3_64" ++ [(set (match_operand:DI 0 "register_operand" "=d,d") ++ (lshiftrt:DI (match_operand:DI 1 "register_operand" "d,d") ++ (match_operand:SI 2 "nonmemory_operand" "J,a"))) ++ (clobber (reg:CC 33))] ++ "TARGET_64BIT" ++ "@ ++ srlg\\t%0,%1,%c2 ++ srlg\\t%0,%1,0(%2)" ++ [(set_attr "op_type" "RS,RS") ++ (set_attr "type" "set")]) ++ ++; ++; lshrsi3 instruction pattern(s). ++; ++ ++(define_insn "lshrsi3" ++ [(set (match_operand:SI 0 "register_operand" "=d,d") ++ (lshiftrt:SI (match_operand:SI 1 "register_operand" "0,0") ++ (match_operand:SI 2 "r_or_im8_operand" "J,a"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ srl\\t%0,%c2 ++ srl\\t%0,0(%2)" ++ [(set_attr "op_type" "RS") ++ (set_attr "type" "set")]) ++ ++; ++; lshrhi3 instruction pattern(s). ++; ++ ++(define_insn "lshrhi3" ++ [(set (match_operand:HI 0 "register_operand" "=d,d") ++ (lshiftrt:HI (match_operand:HI 1 "register_operand" "0,0") ++ (match_operand:SI 2 "r_or_im8_operand" "J,a"))) ++ (clobber (reg:CC 33))] ++ "" ++ "@ ++ sll\\t%0,16\;srl\\t%0,16+%c2 ++ sll\\t%0,16\;srl\\t%0,16(%2)" ++ [(set_attr "op_type" "NN,NN") ++ (set_attr "length" "8,8")]) ++ ++ ++;; ++;; Branch instruction patterns. ++;; ++ ++(define_expand "beq" ++ [(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2))) ++ (set (pc) ++ (if_then_else (eq (reg:CCZ 33) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }") ++ ++(define_expand "bne" ++ [(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2))) ++ (set (pc) ++ (if_then_else (ne (reg:CCZ 33) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }") ++ ++(define_expand "bgt" ++ [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) ++ (set (pc) ++ (if_then_else (gt (reg:CCS 33) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }") ++ ++(define_expand "bgtu" ++ [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2))) ++ (set (pc) ++ (if_then_else (gtu (reg:CCU 33) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }") ++ ++(define_expand "blt" ++ [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) ++ (set (pc) ++ (if_then_else (lt (reg:CCS 33) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }") ++ ++(define_expand "bltu" ++ [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2))) ++ (set (pc) ++ (if_then_else (ltu (reg:CCU 33) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }") ++ ++(define_expand "bge" ++ [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) ++ (set (pc) ++ (if_then_else (ge (reg:CCS 33) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }") ++ ++(define_expand "bgeu" ++ [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2))) ++ (set (pc) ++ (if_then_else (geu (reg:CCU 33) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }") ++ ++(define_expand "ble" ++ [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) ++ (set (pc) ++ (if_then_else (le (reg:CCS 33) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }") ++ ++(define_expand "bleu" ++ [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2))) ++ (set (pc) ++ (if_then_else (leu (reg:CCU 33) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }") ++ ++ ++;; ++;;- Conditional jump instructions. ++;; ++ ++(define_insn "cjump" ++ [(set (pc) ++ (if_then_else ++ (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)]) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "* ++{ ++ if (get_attr_length (insn) == 4) ++ return \"j%C1\\t%l0\"; ++ else if (TARGET_64BIT) ++ return \"jg%C1\\t%l0\"; ++ else ++ abort (); ++}" ++ [(set_attr "op_type" "RI") ++ (set (attr "length") ++ (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) ++ (const_int 4) ++ (ne (symbol_ref "TARGET_64BIT") (const_int 0)) ++ (const_int 6) ++ (eq (symbol_ref "flag_pic") (const_int 0)) ++ (const_int 6)] (const_int 8)))]) ++ ++(define_insn "*cjump_long" ++ [(set (pc) ++ (if_then_else ++ (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)]) ++ (match_operand 0 "address_operand" "p") ++ (pc)))] ++ "" ++ "* ++{ ++ if (get_attr_op_type (insn) == OP_TYPE_RR) ++ return \"b%C1r\\t%0\"; ++ else ++ return \"b%C1\\t%a0\"; ++}" ++ [(set (attr "op_type") ++ (if_then_else (match_operand 0 "register_operand" "") ++ (const_string "RR") (const_string "RX"))) ++ (set_attr "atype" "mem")]) ++ ++ ++;; ++;;- Negated conditional jump instructions. ++;; ++ ++(define_insn "icjump" ++ [(set (pc) ++ (if_then_else ++ (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)]) ++ (pc) ++ (label_ref (match_operand 0 "" ""))))] ++ "" ++ "* ++{ ++ if (get_attr_length (insn) == 4) ++ return \"j%D1\\t%l0\"; ++ else if (TARGET_64BIT) ++ return \"jg%D1\\t%l0\"; ++ else ++ abort (); ++}" ++ [(set_attr "op_type" "RI") ++ (set (attr "length") ++ (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) ++ (const_int 4) ++ (ne (symbol_ref "TARGET_64BIT") (const_int 0)) ++ (const_int 6) ++ (eq (symbol_ref "flag_pic") (const_int 0)) ++ (const_int 6)] (const_int 8)))]) ++ ++(define_insn "*icjump_long" ++ [(set (pc) ++ (if_then_else ++ (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)]) ++ (pc) ++ (match_operand 0 "address_operand" "p")))] ++ "" ++ "* ++{ ++ if (get_attr_op_type (insn) == OP_TYPE_RR) ++ return \"b%D1r\\t%0\"; ++ else ++ return \"b%D1\\t%a0\"; ++}" ++ [(set (attr "op_type") ++ (if_then_else (match_operand 0 "register_operand" "") ++ (const_string "RR") (const_string "RX"))) ++ (set_attr "atype" "mem")]) ++ ++ ++;; ++;;- Subtract one and jump if not zero. ++;; ++ ++;(define_expand "decrement_and_branch_on_count" ++; [(use (match_operand 0 "register_operand" "")) ++; (use (label_ref (match_operand 1 "" "")))] ++; "" ++; " ++;{ ++;/* if (TARGET_64BIT) ++; emit_jump_insn (gen_brctdi (operands[0], operands[1])); ++; else */ ++; emit_jump_insn (gen_brctsi (operands[0], operands[1])); ++; DONE; ++;}") ++; ++;(define_insn "brctsi" ++; [(set (pc) ++; (if_then_else ++; (ne (match_operand:SI 0 "register_operand" "+a") ++; (const_int 1)) ++; (label_ref (match_operand 1 "" "")) ++; (pc))) ++; (set (match_dup 0) ++; (plus:SI (match_dup 0) (const_int -1)))] ++; "" ++; "brct\\t%0,%l1" ++; [(set_attr "op_type" "RI") ++; (set_attr "type" "branch")] ++;) ++; ++;(define_insn "ibrctsi" ++; [(set (pc) ++; (if_then_else ++; (eq (match_operand:SI 0 "register_operand" "+a") ++; (const_int 1)) ++; (pc) ++; (label_ref (match_operand 1 "" "")))) ++; (set (match_dup 0) ++; (plus:SI (match_dup 0) (const_int -1)))] ++; "" ++; "brct\\t%0,%l1" ++; [(set_attr "op_type" "RI") ++; (set_attr "type" "branch")] ++;) ++ ++ ++;; ++;;- Unconditional jump instructions. ++;; ++ ++; ++; jump instruction pattern(s). ++; ++ ++(define_insn "jump" ++ [(set (pc) (label_ref (match_operand 0 "" "")))] ++ "" ++ "* ++{ ++ if (get_attr_length (insn) == 4) ++ return \"j\\t%l0\"; ++ else if (TARGET_64BIT) ++ return \"jg\\t%l0\"; ++ else ++ abort (); ++}" ++ [(set_attr "op_type" "RI") ++ (set (attr "length") ++ (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) ++ (const_int 4) ++ (ne (symbol_ref "TARGET_64BIT") (const_int 0)) ++ (const_int 6) ++ (eq (symbol_ref "flag_pic") (const_int 0)) ++ (const_int 6)] (const_int 8)))]) ++ ++; ++; indirect-jump instruction pattern(s). ++; ++ ++(define_insn "indirect_jump" ++ [(set (pc) (match_operand 0 "address_operand" "p"))] ++ "" ++ "* ++{ ++ if (get_attr_op_type (insn) == OP_TYPE_RR) ++ return \"br\\t%0\"; ++ else ++ return \"b\\t%a0\"; ++}" ++ [(set (attr "op_type") ++ (if_then_else (match_operand 0 "register_operand" "") ++ (const_string "RR") (const_string "RX"))) ++ (set_attr "atype" "mem")]) ++ ++; ++; casesi instruction pattern(s). ++; ++ ++(define_insn "casesi_jump" ++ [(set (pc) (match_operand 0 "address_operand" "p")) ++ (use (label_ref (match_operand 1 "" "")))] ++ "" ++ "* ++{ ++ if (get_attr_op_type (insn) == OP_TYPE_RR) ++ return \"br\\t%0\"; ++ else ++ return \"b\\t%a0\"; ++}" ++ [(set (attr "op_type") ++ (if_then_else (match_operand 0 "register_operand" "") ++ (const_string "RR") (const_string "RX"))) ++ (set_attr "atype" "mem")]) ++ ++(define_expand "casesi" ++ [(match_operand:SI 0 "general_operand" "") ++ (match_operand:SI 1 "general_operand" "") ++ (match_operand:SI 2 "general_operand" "") ++ (label_ref (match_operand 3 "" "")) ++ (label_ref (match_operand 4 "" ""))] ++ "" ++ " ++{ ++ rtx index = gen_reg_rtx (SImode); ++ rtx base = gen_reg_rtx (Pmode); ++ rtx target = gen_reg_rtx (Pmode); ++ ++ emit_move_insn (index, operands[0]); ++ emit_insn (gen_subsi3 (index, index, operands[1])); ++ emit_cmp_and_jump_insns (index, operands[2], GTU, NULL_RTX, SImode, 1, ++ 0, operands[4]); ++ ++ if (Pmode != SImode) ++ index = convert_to_mode (Pmode, index, 1); ++ if (GET_CODE (index) != REG) ++ index = copy_to_mode_reg (Pmode, index); ++ ++ if (TARGET_64BIT) ++ emit_insn (gen_ashldi3 (index, index, GEN_INT (3))); ++ else ++ emit_insn (gen_ashlsi3 (index, index, GEN_INT (2))); ++ ++ emit_move_insn (base, gen_rtx_LABEL_REF (Pmode, operands[3])); ++ ++ index = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, base, index)); ++ emit_move_insn (target, index); ++ ++ if (flag_pic) ++ target = gen_rtx_PLUS (Pmode, base, target); ++ emit_jump_insn (gen_casesi_jump (target, operands[3])); ++ ++ DONE; ++}") ++ ++ ++;; ++;;- Jump to subroutine. ++;; ++;; ++ ++; ++; untyped call instruction pattern(s). ++; ++ ++;; Call subroutine returning any type. ++(define_expand "untyped_call" ++ [(parallel [(call (match_operand 0 "" "") ++ (const_int 0)) ++ (match_operand 1 "" "") ++ (match_operand 2 "" "")])] ++ "" ++ " ++{ ++ int i; ++ ++ emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx)); ++ ++ for (i = 0; i < XVECLEN (operands[2], 0); i++) ++ { ++ rtx set = XVECEXP (operands[2], 0, i); ++ emit_move_insn (SET_DEST (set), SET_SRC (set)); ++ } ++ ++ /* The optimizer does not know that the call sets the function value ++ registers we stored in the result block. We avoid problems by ++ claiming that all hard registers are used and clobbered at this ++ point. */ ++ emit_insn (gen_blockage ()); ++ ++ DONE; ++}") ++ ++;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and ++;; all of memory. This blocks insns from being moved across this point. ++ ++(define_insn "blockage" ++ [(unspec_volatile [(const_int 0)] 0)] ++ "" ++ "") ++ ++ ++; ++; call instruction pattern(s). ++; ++ ++(define_expand "call" ++ [(parallel [(call (match_operand 0 "" "") ++ (match_operand 1 "" "")) ++ (clobber (match_operand 2 "" ""))])] ++ "" ++ " ++{ ++ /* Abuse operand 2 to hold the return register. */ ++ operands[2] = gen_rtx_REG (Pmode, RETURN_REGNUM); ++ ++ /* In 31-bit, we must load the GOT register even if the ++ compiler doesn't know about it, because the PLT glue ++ code uses it. In 64-bit, this is not necessary. */ ++ if (flag_pic && !TARGET_64BIT) ++ current_function_uses_pic_offset_table = 1; ++ ++ /* Direct function calls need special treatment. */ ++ if (GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF) ++ { ++ rtx sym = XEXP (operands[0], 0); ++ ++ /* When calling a global routine in PIC mode, we must ++ replace the symbol itself with the PLT stub. */ ++ if (flag_pic && !SYMBOL_REF_FLAG(sym)) ++ { ++ sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), 113); ++ sym = gen_rtx_CONST (Pmode, sym); ++ } ++ ++ /* Unless we can use the bras(l) insn, force the ++ routine address into a register. */ ++ if (!TARGET_SMALL_EXEC && !TARGET_64BIT) ++ { ++ rtx target = gen_reg_rtx (Pmode); ++ emit_move_insn (target, sym); ++ sym = target; ++ } ++ ++ operands[0] = gen_rtx_MEM (QImode, sym); ++ } ++}") ++ ++(define_insn "brasl" ++ [(call (mem:QI (match_operand:DI 0 "bras_sym_operand" "X")) ++ (match_operand:SI 1 "const_int_operand" "n")) ++ (clobber (match_operand:DI 2 "register_operand" "=r"))] ++ "TARGET_64BIT" ++ "brasl\\t%2,%0" ++ [(set_attr "op_type" "RIL") ++ (set_attr "cycle" "n")]) ++ ++(define_insn "bras" ++ [(call (mem:QI (match_operand:SI 0 "bras_sym_operand" "X")) ++ (match_operand:SI 1 "const_int_operand" "n")) ++ (clobber (match_operand:SI 2 "register_operand" "=r"))] ++ "TARGET_SMALL_EXEC" ++ "bras\\t%2,%0" ++ [(set_attr "op_type" "RI") ++ (set_attr "cycle" "n")]) ++ ++(define_insn "basr_64" ++ [(call (mem:QI (match_operand:DI 0 "register_operand" "a")) ++ (match_operand:SI 1 "const_int_operand" "n")) ++ (clobber (match_operand:DI 2 "register_operand" "=r"))] ++ "TARGET_64BIT" ++ "basr\\t%2,%0" ++ [(set_attr "op_type" "RR") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "mem")]) ++ ++(define_insn "basr_31" ++ [(call (mem:QI (match_operand:SI 0 "register_operand" "a")) ++ (match_operand:SI 1 "const_int_operand" "n")) ++ (clobber (match_operand:SI 2 "register_operand" "=r"))] ++ "!TARGET_64BIT" ++ "basr\\t%2,%0" ++ [(set_attr "op_type" "RR") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "mem")]) ++ ++(define_insn "bas_64" ++ [(call (mem:QI (match_operand:QI 0 "address_operand" "p")) ++ (match_operand:SI 1 "const_int_operand" "n")) ++ (clobber (match_operand:DI 2 "register_operand" "=r"))] ++ "TARGET_64BIT" ++ "bas\\t%2,%a0" ++ [(set_attr "op_type" "RX") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "mem")]) ++ ++(define_insn "bas_31" ++ [(call (mem:QI (match_operand:QI 0 "address_operand" "p")) ++ (match_operand:SI 1 "const_int_operand" "n")) ++ (clobber (match_operand:SI 2 "register_operand" "=r"))] ++ "!TARGET_64BIT" ++ "bas\\t%2,%a0" ++ [(set_attr "op_type" "RX") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "mem")]) ++ ++ ++; ++; call_value instruction pattern(s). ++; ++ ++(define_expand "call_value" ++ [(parallel [(set (match_operand 0 "" "") ++ (call (match_operand 1 "" "") ++ (match_operand 2 "" ""))) ++ (clobber (match_operand 3 "" ""))])] ++ "" ++ " ++{ ++ /* Abuse operand 3 to hold the return register. */ ++ operands[3] = gen_rtx_REG (Pmode, RETURN_REGNUM); ++ ++ /* In 31-bit, we must load the GOT register even if the ++ compiler doesn't know about it, because the PLT glue ++ code uses it. In 64-bit, this is not necessary. */ ++ if (flag_pic && !TARGET_64BIT) ++ current_function_uses_pic_offset_table = 1; ++ ++ /* Direct function calls need special treatment. */ ++ if (GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF) ++ { ++ rtx sym = XEXP (operands[1], 0); ++ ++ /* When calling a global routine in PIC mode, we must ++ replace the symbol itself with the PLT stub. */ ++ if (flag_pic && !SYMBOL_REF_FLAG(sym)) ++ { ++ sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), 113); ++ sym = gen_rtx_CONST (Pmode, sym); ++ } ++ ++ /* Unless we can use the bras(l) insn, force the ++ routine address into a register. */ ++ if (!TARGET_SMALL_EXEC && !TARGET_64BIT) ++ { ++ rtx target = gen_reg_rtx (Pmode); ++ emit_move_insn (target, sym); ++ sym = target; ++ } ++ ++ operands[1] = gen_rtx_MEM (QImode, sym); ++ } ++}") ++ ++(define_insn "brasl_r" ++ [(set (match_operand 0 "register_operand" "=df") ++ (call (mem:QI (match_operand:DI 1 "bras_sym_operand" "X")) ++ (match_operand:SI 2 "const_int_operand" "n"))) ++ (clobber (match_operand:DI 3 "register_operand" "=r"))] ++ "TARGET_64BIT" ++ "brasl\\t%3,%1" ++ [(set_attr "op_type" "RIL") ++ (set_attr "cycle" "n")]) ++ ++(define_insn "bras_r" ++ [(set (match_operand 0 "register_operand" "=df") ++ (call (mem:QI (match_operand:SI 1 "bras_sym_operand" "X")) ++ (match_operand:SI 2 "const_int_operand" "n"))) ++ (clobber (match_operand:SI 3 "register_operand" "=r"))] ++ "TARGET_SMALL_EXEC" ++ "bras\\t%3,%1" ++ [(set_attr "op_type" "RI") ++ (set_attr "cycle" "n")]) ++ ++(define_insn "basr_r_64" ++ [(set (match_operand 0 "register_operand" "=df") ++ (call (mem:QI (match_operand:DI 1 "register_operand" "a")) ++ (match_operand:SI 2 "const_int_operand" "n"))) ++ (clobber (match_operand:DI 3 "register_operand" "=r"))] ++ "TARGET_64BIT" ++ "basr\\t%3,%1" ++ [(set_attr "op_type" "RR") ++ (set_attr "cycle" "n")]) ++ ++(define_insn "basr_r_31" ++ [(set (match_operand 0 "register_operand" "=df") ++ (call (mem:QI (match_operand:SI 1 "register_operand" "a")) ++ (match_operand:SI 2 "const_int_operand" "n"))) ++ (clobber (match_operand:SI 3 "register_operand" "=r"))] ++ "!TARGET_64BIT" ++ "basr\\t%3,%1" ++ [(set_attr "op_type" "RR") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "mem")]) ++ ++(define_insn "bas_r_64" ++ [(set (match_operand 0 "register_operand" "=df") ++ (call (mem:QI (match_operand:QI 1 "address_operand" "p")) ++ (match_operand:SI 2 "const_int_operand" "n"))) ++ (clobber (match_operand:DI 3 "register_operand" "=r"))] ++ "TARGET_64BIT" ++ "bas\\t%3,%a1" ++ [(set_attr "op_type" "RX") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "mem")]) ++ ++(define_insn "bas_r_31" ++ [(set (match_operand 0 "register_operand" "=df") ++ (call (mem:QI (match_operand:QI 1 "address_operand" "p")) ++ (match_operand:SI 2 "const_int_operand" "n"))) ++ (clobber (match_operand:SI 3 "register_operand" "=r"))] ++ "!TARGET_64BIT" ++ "bas\\t%3,%a1" ++ [(set_attr "op_type" "RX") ++ (set_attr "cycle" "n") ++ (set_attr "atype" "mem")]) ++ ++ ++;; ++;;- Miscellaneous instructions. ++;; ++ ++; ++; allocate stack instruction pattern(s). ++; ++ ++(define_expand "allocate_stack" ++ [(set (reg 15) ++ (plus (reg 15) (match_operand 1 "general_operand" ""))) ++ (set (match_operand 0 "general_operand" "") ++ (reg 15))] ++ "" ++ " ++{ ++ rtx stack = gen_rtx (REG, Pmode, STACK_POINTER_REGNUM); ++ rtx chain = gen_rtx (MEM, Pmode, stack); ++ rtx temp = gen_reg_rtx (Pmode); ++ ++ emit_move_insn (temp, chain); ++ ++ if (TARGET_64BIT) ++ emit_insn (gen_adddi3 (stack, stack, negate_rtx (Pmode, operands[1]))); ++ else ++ emit_insn (gen_addsi3 (stack, stack, negate_rtx (Pmode, operands[1]))); ++ ++ emit_move_insn (chain, temp); ++ ++ emit_move_insn (operands[0], virtual_stack_dynamic_rtx); ++ DONE; ++}") ++ ++ ++; ++; setjmp/longjmp instruction pattern(s). ++; ++ ++(define_expand "builtin_setjmp_setup" ++ [(unspec [(match_operand 0 "register_operand" "a")] 1)] ++ "" ++ " ++{ ++ rtx base = gen_rtx_MEM (Pmode, plus_constant (operands[0], 4 * GET_MODE_SIZE (Pmode))); ++ rtx basereg = gen_rtx_REG (Pmode, BASE_REGISTER); ++ ++ emit_move_insn (base, basereg); ++ DONE; ++}") ++ ++(define_expand "builtin_setjmp_receiver" ++ [(unspec_volatile [(label_ref (match_operand 0 "" ""))] 2)] ++ "flag_pic" ++ " ++{ ++ rtx gotreg = gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM); ++ rtx got = gen_rtx_SYMBOL_REF (Pmode, \"_GLOBAL_OFFSET_TABLE_\"); ++ SYMBOL_REF_FLAG (got) = 1; ++ ++ emit_move_insn (gotreg, got); ++ emit_insn (gen_rtx_USE (VOIDmode, gotreg)); ++ DONE; ++}") ++ ++(define_expand "builtin_longjmp" ++ [(unspec_volatile [(match_operand 0 "register_operand" "r")] 3)] ++ "" ++ " ++{ ++ /* The elements of the buffer are, in order: */ ++ rtx fp = gen_rtx_MEM (Pmode, operands[0]); ++ rtx lab = gen_rtx_MEM (Pmode, plus_constant (operands[0], GET_MODE_SIZE (Pmode))); ++ rtx stack = gen_rtx_MEM (Pmode, plus_constant (operands[0], 2 * GET_MODE_SIZE (Pmode))); ++ rtx base = gen_rtx_MEM (Pmode, plus_constant (operands[0], 4 * GET_MODE_SIZE (Pmode))); ++ rtx basereg = gen_rtx_REG (Pmode, BASE_REGISTER); ++ rtx jmp = gen_rtx_REG (Pmode, 14); ++ ++ emit_move_insn (jmp, lab); ++ emit_move_insn (basereg, base); ++ emit_stack_restore (SAVE_NONLOCAL, stack, NULL_RTX); ++ emit_move_insn (hard_frame_pointer_rtx, fp); ++ ++ emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx)); ++ emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); ++ emit_insn (gen_rtx_USE (VOIDmode, basereg)); ++ emit_indirect_jump (jmp); ++ DONE; ++}") ++ ++ ++;; These patterns say how to save and restore the stack pointer. We need not ++;; save the stack pointer at function level since we are careful to ++;; preserve the backchain. At block level, we have to restore the backchain ++;; when we restore the stack pointer. ++;; ++;; For nonlocal gotos, we must save both the stack pointer and its ++;; backchain and restore both. Note that in the nonlocal case, the ++;; save area is a memory location. ++ ++(define_expand "save_stack_function" ++ [(match_operand 0 "general_operand" "") ++ (match_operand 1 "general_operand" "")] ++ "" ++ "DONE;") ++ ++(define_expand "restore_stack_function" ++ [(match_operand 0 "general_operand" "") ++ (match_operand 1 "general_operand" "")] ++ "" ++ "DONE;") ++ ++(define_expand "restore_stack_block" ++ [(use (match_operand 0 "register_operand" "")) ++ (set (match_dup 2) (match_dup 3)) ++ (set (match_dup 0) (match_operand 1 "register_operand" "")) ++ (set (match_dup 3) (match_dup 2))] ++ "" ++ " ++{ ++ operands[2] = gen_reg_rtx (Pmode); ++ operands[3] = gen_rtx_MEM (Pmode, operands[0]); ++}") ++ ++(define_expand "save_stack_nonlocal" ++ [(match_operand 0 "memory_operand" "") ++ (match_operand 1 "register_operand" "")] ++ "" ++ " ++{ ++ rtx temp = gen_reg_rtx (Pmode); ++ ++ /* Copy the backchain to the first word, sp to the second. */ ++ emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1])); ++ emit_move_insn (operand_subword (operands[0], 0, 0, ++ TARGET_64BIT ? TImode : DImode), ++ temp); ++ emit_move_insn (operand_subword (operands[0], 1, 0, ++ TARGET_64BIT ? TImode : DImode), ++ operands[1]); ++ DONE; ++}") ++ ++(define_expand "restore_stack_nonlocal" ++ [(match_operand 0 "register_operand" "") ++ (match_operand 1 "memory_operand" "")] ++ "" ++ " ++{ ++ rtx temp = gen_reg_rtx (Pmode); ++ ++ /* Restore the backchain from the first word, sp from the second. */ ++ emit_move_insn (temp, ++ operand_subword (operands[1], 0, 0, ++ TARGET_64BIT ? TImode : DImode)); ++ emit_move_insn (operands[0], ++ operand_subword (operands[1], 1, 0, ++ TARGET_64BIT ? TImode : DImode)); ++ emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp); ++ DONE; ++}") ++ ++ ++(define_expand "eh_epilogue" ++ [(use (match_operand 0 "register_operand" "")) ++ (use (match_operand 1 "register_operand" "")) ++ (use (match_operand 2 "register_operand" ""))] ++ "" ++ " ++{ ++ s390_expand_eh_epilogue (operands[0], operands[1], operands[2]); ++ DONE; ++}") ++ ++ ++; ++; nop instruction pattern(s). ++; ++ ++(define_insn "nop" ++ [(const_int 0)] ++ "" ++ "lr\\t0,0" ++ [(set_attr "op_type" "RR")]) ++ ++ ++; ++; Special literal pool access instruction pattern(s). ++; ++ ++(define_insn "reload_base" ++ [(parallel [(set (reg 13) (pc)) ++ (use (label_ref (match_operand 0 "" "")))])] ++ "" ++ "* ++{ ++ if (TARGET_64BIT) ++ return \"larl\\t13,%y0\"; ++ else ++ return \"basr\\t13,0\;ahi\\t13,%Y0\"; ++}" ++ [(set_attr "op_type" "NN") ++ (set_attr "cycle" "2") ++ (set_attr "length" "8")]) ++ ++(define_insn "ltorg" ++ [(parallel [(set (reg 13) (pc)) ++ (use (match_operand:SI 0 "const_int_operand" ""))])] ++ "" ++ "* ++{ ++ s390_dump_literal_pool (insn, operands[0]); ++ return \"0:\"; ++}" ++ [(set_attr "op_type" "NN") ++ (set_attr "cycle" "n") ++ (set_attr "length" "4096")]) ++ ++ ++;; ++;; Peephole optimization patterns. ++;; ++ ++(define_peephole ++ [(set (match_operand:SI 0 "memory_operand" "m") ++ (match_operand:SI 1 "register_operand" "d")) ++ (set (match_dup 1) ++ (match_dup 0))] ++ "" ++ "st\\t%1,%0") ++ ++(define_peephole ++ [(set (match_operand:SI 0 "memory_operand" "m") ++ (match_operand:SI 1 "register_operand" "d")) ++ (set (match_dup 0) ++ (match_dup 1))] ++ "" ++ "st\\t%1,%0") ++ ++(define_peephole ++ [(set (match_operand:SI 0 "register_operand" "") ++ (match_operand:SI 1 "register_operand" "")) ++ (parallel ++ [(set (match_dup 0) ++ (plus:SI (match_dup 0) ++ (match_operand:SI 2 "immediate_operand" ""))) ++ (clobber (reg:CC 33))])] ++ "(REGNO (operands[0]) == STACK_POINTER_REGNUM || ++ REGNO (operands[1]) == STACK_POINTER_REGNUM || ++ REGNO (operands[0]) == BASE_REGISTER || ++ REGNO (operands[1]) == BASE_REGISTER) && ++ INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 4096" ++ "la\\t%0,%c2(%1)") ++ ++; ++; peepholes for fast char instructions ++; ++ ++;(define_peephole ++; [(set (match_operand:QI 0 "register_operand" "d") ++; (match_operand:QI 1 "s_operand" "Q")) ++; (set (match_operand:SI 2 "register_operand" "0") ++; (zero_extend:SI (match_dup 0)))] ++; "REGNO(operands[0]) == REGNO(operands[2])" ++; "icm\\t%0,8,%1\;srl\\t%0,24") ++ ++;(define_peephole ++; [(set (match_operand:QI 0 "register_operand" "d") ++; (match_operand:QI 1 "s_operand" "Q")) ++; (set (match_operand:SI 2 "register_operand" "0") ++; (sign_extend:SI (match_dup 0)))] ++; "REGNO(operands[0]) == REGNO(operands[2])" ++; "icm\\t%0,8,%1\;sra\\t%0,24") ++ ++(define_peephole ++ [(set (match_operand:QI 0 "register_operand" "d") ++ (match_operand:QI 1 "immediate_operand" "J")) ++ (set (match_operand:SI 2 "register_operand" "0" ) ++ (sign_extend:SI (match_dup 0) ) )] ++ "REGNO(operands[0]) == REGNO(operands[2])" ++ "lhi\\t%0,%h1") ++ ++; ++; peepholes for fast short instructions ++; ++ ++;(define_peephole ++; [(set (match_operand:HI 0 "register_operand" "d") ++; (match_operand:HI 1 "s_operand" "Q")) ++; (set (match_operand:SI 2 "register_operand" "0" ) ++; (zero_extend:SI (match_dup 0)))] ++; "REGNO(operands[0]) == REGNO(operands[2])" ++; "icm\\t%0,12,%1\;srl\\t%0,16") ++ ++(define_peephole ++ [(set (match_operand:HI 0 "register_operand" "d") ++ (match_operand:HI 1 "memory_operand" "m")) ++ (set (match_operand:SI 2 "register_operand" "0" ) ++ (sign_extend:SI (match_dup 0)))] ++ "REGNO(operands[0]) == REGNO(operands[2])" ++ "lh\\t%0,%1") ++ ++(define_peephole ++ [(set (match_operand:HI 0 "register_operand" "d") ++ (match_operand:HI 1 "immediate_operand" "K")) ++ (set (match_operand:SI 2 "register_operand" "0" ) ++ (sign_extend:SI (match_dup 0) ) )] ++ "REGNO(operands[0]) == REGNO(operands[2])" ++ "lhi\\t%0,%h1") ++ ++; ++; peepholes for divide instructions ++; ++ ++(define_peephole ++ [(set (match_operand:DI 0 "register_operand" "d") ++ (match_operand:DI 1 "memory_operand" "m")) ++ (set (match_dup 0) ++ (lshiftrt:DI (match_dup 0) ++ (match_operand:SI 2 "immediate_operand" "J"))) ++ (set (match_dup 0) ++ (div:SI (match_dup 0) ++ (match_operand:SI 3 "nonimmediate_operand" "g"))) ++ (set (match_dup 1) ++ (match_dup 0))] ++ "" ++ "* ++{ ++ output_asm_insn (\"l\\t%0,%1\", operands); ++ output_asm_insn (\"srdl\\t%0,%b2\", operands); ++ ++ if (REG_P (operands[3])) ++ output_asm_insn (\"dr\\t%0,%3\", operands); ++ else ++ output_asm_insn (\"d\\t%0,%3\", operands); ++ ++ return \"st\\t%N0,%N1\"; ++}") ++ ++(define_peephole ++ [(set (match_operand:DI 0 "register_operand" "d") ++ (match_operand:DI 1 "memory_operand" "m")) ++ (set (match_dup 0) ++ (lshiftrt:DI (match_dup 0) ++ (match_operand:SI 2 "immediate_operand" "J"))) ++ (set (match_dup 0) ++ (mod:SI (match_dup 0) ++ (match_operand:SI 3 "nonimmediate_operand" "g"))) ++ (set (match_dup 1) ++ (match_dup 0))] ++ "" ++ "* ++{ ++ output_asm_insn (\"l\\t%0,%1\", operands); ++ output_asm_insn (\"srdl\\t%0,%b2\", operands); ++ ++ if (REG_P (operands[3])) ++ output_asm_insn (\"dr\\t%0,%3\", operands); ++ else ++ output_asm_insn (\"d\\t%0,%3\", operands); ++ ++ return \"st\\t%0,%1\"; ++}") ++ +diff -urN --exclude=CVS gcc-2.95.3/gcc/config/s390/t-linux gcc/gcc/config/s390/t-linux +--- gcc-2.95.3/gcc/config/s390/t-linux Thu Jan 1 01:00:00 1970 ++++ gcc/gcc/config/s390/t-linux Thu Aug 16 11:59:02 2001 +@@ -0,0 +1,6 @@ ++# The crtbegin and crtend must not depend on a small GOT ++CRTSTUFF_T_CFLAGS = -O2 -fPIC ++ ++# Compile libgcc2.a with pic. ++TARGET_LIBGCC2_CFLAGS = -fPIC -include $(srcdir)/config/s390/fixdfdi.h ++ +diff -urN --exclude=CVS gcc-2.95.3/gcc/config/s390/tm_p.h gcc/gcc/config/s390/tm_p.h +--- gcc-2.95.3/gcc/config/s390/tm_p.h Thu Jan 1 01:00:00 1970 ++++ gcc/gcc/config/s390/tm_p.h Fri Jul 6 09:10:33 2001 +@@ -0,0 +1,5 @@ ++#include "tm.h" ++#include "s390-protos.h" ++ ++/* Needed for 2.96 va-arg fake. */ ++#include +diff -urN --exclude=CVS gcc-2.95.3/gcc/config/s390/xm-s390.h gcc/gcc/config/s390/xm-s390.h +--- gcc-2.95.3/gcc/config/s390/xm-s390.h Thu Jan 1 01:00:00 1970 ++++ gcc/gcc/config/s390/xm-s390.h Mon Nov 6 14:39:37 2000 +@@ -0,0 +1,49 @@ ++/* Configuration for GNU C-compiler for S/390 ++ Copyright (C) 1999 Free Software Foundation, Inc. ++ Contributed by Hartmut Penner (hpenner@de.ibm.com). ++ ++This file is part of GNU CC. ++ ++GNU CC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++GNU CC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GNU CC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++/* #defines that need visibility everywhere. */ ++ ++#define FALSE 0 ++#define TRUE 1 ++ ++/* This describes the machine the compiler is hosted on. */ ++ ++#define HOST_BITS_PER_CHAR 8 ++#define HOST_BITS_PER_SHORT 16 ++#define HOST_BITS_PER_INT 32 ++#define HOST_BITS_PER_LONG 32 ++#define HOST_BITS_PER_LONGLONG 64 ++ ++#define HOST_WORDS_BIG_ENDIAN 1 ++ ++/* Target machine dependencies. tm.h is a symbolic link to the actual ++ target specific file. */ ++ ++#include "tm.h" ++ ++/* Arguments to use with `exit'. */ ++ ++#define SUCCESS_EXIT_CODE 0 ++#define FATAL_EXIT_CODE 33 ++ ++ ++ ++ +diff -urN --exclude=CVS gcc-2.95.3/gcc/config/s390/xm-s390x.h gcc/gcc/config/s390/xm-s390x.h +--- gcc-2.95.3/gcc/config/s390/xm-s390x.h Thu Jan 1 01:00:00 1970 ++++ gcc/gcc/config/s390/xm-s390x.h Wed Dec 27 17:46:16 2000 +@@ -0,0 +1,49 @@ ++/* Configuration for GNU C-compiler for S/390 ++ Copyright (C) 1999 Free Software Foundation, Inc. ++ Contributed by Hartmut Penner (hpenner@de.ibm.com). ++ ++This file is part of GNU CC. ++ ++GNU CC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++GNU CC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GNU CC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++/* #defines that need visibility everywhere. */ ++ ++#define FALSE 0 ++#define TRUE 1 ++ ++/* This describes the machine the compiler is hosted on. */ ++ ++#define HOST_BITS_PER_CHAR 8 ++#define HOST_BITS_PER_SHORT 16 ++#define HOST_BITS_PER_INT 32 ++#define HOST_BITS_PER_LONG 64 ++#define HOST_BITS_PER_LONGLONG 64 ++ ++#define HOST_WORDS_BIG_ENDIAN 1 ++ ++/* Target machine dependencies. tm.h is a symbolic link to the actual ++ target specific file. */ ++ ++#include "tm.h" ++ ++/* Arguments to use with `exit'. */ ++ ++#define SUCCESS_EXIT_CODE 0 ++#define FATAL_EXIT_CODE 33 ++ ++ ++ ++ +diff -urN --exclude=CVS gcc-2.95.3/gcc/configure gcc/gcc/configure +--- gcc-2.95.3/gcc/configure Fri Mar 16 15:13:48 2001 ++++ gcc/gcc/configure Tue Jul 3 14:20:57 2001 +@@ -5307,6 +5307,27 @@ + xmake_file=rs6000/x-lynx + use_collect2=yes + ;; ++ s390-*-linux*) ++ xmake_file=x-linux ++ tmake_file="t-linux s390/t-linux" ++ xm_file="s390/xm-s390.h" ++ tm_file=s390/s390-295.h ++ elf=yes ++ gas=yes ++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" ++ extra_headers=va-s390.h ++ ;; ++ s390x-*-linux*) ++ cpu_type=s390 ++ xmake_file=x-linux ++ tmake_file="t-linux s390/t-linux" ++ xm_file="s390/xm-s390x.h" ++ tm_file=s390/s390-295-64.h ++ elf=yes ++ gas=yes ++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" ++ extra_headers=va-s390.h ++ ;; + sh-*-elf*) + tm_file=sh/elf.h + float_format=sh +diff -urN --exclude=CVS gcc-2.95.3/gcc/configure.in gcc/gcc/configure.in +--- gcc-2.95.3/gcc/configure.in Thu Jan 25 15:03:02 2001 ++++ gcc/gcc/configure.in Tue Jul 3 14:20:57 2001 +@@ -3001,6 +3001,27 @@ + xmake_file=rs6000/x-lynx + use_collect2=yes + ;; ++ s390-ibm-linux*) ++ xmake_file=x-linux ++ tmake_file="t-linux s390/t-linux" ++ xm_file="s390/xm-s390.h" ++ tm_file=s390/s390-295.h ++ elf=yes ++ gas=yes ++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" ++ extra_headers=va-s390.h ++ ;; ++ s390x-ibm-linux*) ++ cpu_type=s390 ++ xmake_file=x-linux ++ tmake_file="t-linux s390/t-linux" ++ xm_file="s390/xm-s390x.h" ++ tm_file=s390/s390-295-64.h ++ elf=yes ++ gas=yes ++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" ++ extra_headers=va-s390.h ++ ;; + sh-*-elf*) + tm_file=sh/elf.h + float_format=sh +diff -urN --exclude=CVS gcc-2.95.3/gcc/except.c gcc/gcc/except.c +--- gcc-2.95.3/gcc/except.c Mon Feb 19 15:01:59 2001 ++++ gcc/gcc/except.c Fri Jan 28 17:44:43 2000 +@@ -1343,7 +1343,7 @@ + but there is no allocation routine that allocates at the level of + the last binding contour. */ + arg = assign_stack_local (BLKmode, +- GET_MODE_SIZE (Pmode)*(size+1), ++ GET_MODE_SIZE (Pmode)*(size+2), + 0); + + arg = change_address (arg, Pmode, NULL_RTX); +diff -urN --exclude=CVS gcc-2.95.3/gcc/expmed.c gcc/gcc/expmed.c +--- gcc-2.95.3/gcc/expmed.c Thu Jan 25 15:03:06 2001 ++++ gcc/gcc/expmed.c Tue Jun 12 16:22:48 2001 +@@ -961,6 +961,7 @@ + register rtx op0 = str_rtx; + rtx spec_target = target; + rtx spec_target_subreg = 0; ++ enum machine_mode int_mode; + #ifdef HAVE_extv + int extv_bitsize; + #endif +@@ -1165,10 +1166,19 @@ + NULL_RTX, 0); + } + +- /* From here on we know the desired field is smaller than a word +- so we can assume it is an integer. So we can safely extract it as one +- size of integer, if necessary, and then truncate or extend +- to the size that is wanted. */ ++ /* From here on we know the desired field is smaller than a word. */ ++ ++ /* Check if there is a correspondingly-sized integer field, so we can ++ safely extract it as one size of integer, if necessary; then ++ truncate or extend to the size that is wanted; then use SUBREGs or ++ convert_to_mode to get one of the modes we really wanted. */ ++ ++ int_mode = int_mode_for_mode (tmode); ++ if (int_mode == BLKmode) ++ int_mode = int_mode_for_mode (mode); ++ if (int_mode == BLKmode) ++ abort(); /* Should probably push op0 out to memory and then ++ do a load. */ + + /* OFFSET is the number of words or bytes (UNIT says which) + from STR_RTX to the first word or byte containing part of the field. */ +@@ -1323,14 +1333,14 @@ + else + { + delete_insns_since (last); +- target = extract_fixed_bit_field (tmode, op0, offset, bitsize, ++ target = extract_fixed_bit_field (int_mode, op0, offset, bitsize, + bitpos, target, 1, align); + } + } + else + extzv_loses: + #endif +- target = extract_fixed_bit_field (tmode, op0, offset, bitsize, bitpos, ++ target = extract_fixed_bit_field (int_mode, op0, offset, bitsize, bitpos, + target, 1, align); + } + else +@@ -1459,14 +1469,14 @@ + else + { + delete_insns_since (last); +- target = extract_fixed_bit_field (tmode, op0, offset, bitsize, ++ target = extract_fixed_bit_field (int_mode, op0, offset, bitsize, + bitpos, target, 0, align); + } + } + else + extv_loses: + #endif +- target = extract_fixed_bit_field (tmode, op0, offset, bitsize, bitpos, ++ target = extract_fixed_bit_field (int_mode, op0, offset, bitsize, bitpos, + target, 0, align); + } + if (target == spec_target) +diff -urN --exclude=CVS gcc-2.95.3/gcc/f/target.h gcc/gcc/f/target.h +--- gcc-2.95.3/gcc/f/target.h Sat Mar 27 11:24:06 1999 ++++ gcc/gcc/f/target.h Fri Feb 2 10:47:23 2001 +@@ -247,7 +247,7 @@ + #define ffetargetOffset_f "ll" + + #if FFETARGET_okINTEGER1 +-#ifndef __alpha__ ++#if !defined(__alpha__) && !defined(__s390x__) + typedef long int ffetargetInteger1; + #define ffetargetInteger1_f "l" + #else +@@ -288,7 +288,7 @@ + ? + #endif + #if FFETARGET_okLOGICAL1 +-#ifndef __alpha__ ++#if !defined(__alpha__) && !defined(__s390x__) + typedef long int ffetargetLogical1; + #define ffetargetLogical1_f "l" + #else +@@ -330,7 +330,7 @@ + #endif + #if FFETARGET_okREAL1 + #ifdef REAL_ARITHMETIC +-#ifndef __alpha__ ++#if !defined(__alpha__) && !defined(__s390x__) + typedef long int ffetargetReal1; + #define ffetargetReal1_f "l" + #define ffetarget_cvt_r1_to_rv_ REAL_VALUE_UNTO_TARGET_SINGLE +@@ -354,7 +354,7 @@ + #endif + #if FFETARGET_okREAL2 + #ifdef REAL_ARITHMETIC +-#ifndef __alpha__ ++#if !defined(__alpha__) && !defined(__s390x__) + typedef struct + { + long int v[2]; +@@ -1496,7 +1496,7 @@ + #define ffetarget_init_2() + #define ffetarget_init_3() + #define ffetarget_init_4() +-#ifndef __alpha__ ++#if !defined(__alpha__) && !defined(__s390x__) + #define ffetarget_integerdefault_is_magical(i) \ + (((unsigned long int) i) == FFETARGET_integerBIG_MAGICAL) + #else +diff -urN --exclude=CVS gcc-2.95.3/gcc/ginclude/stdarg.h gcc/gcc/ginclude/stdarg.h +--- gcc-2.95.3/gcc/ginclude/stdarg.h Sat May 8 03:52:35 1999 ++++ gcc/gcc/ginclude/stdarg.h Thu Dec 28 13:35:08 2000 +@@ -62,6 +62,9 @@ + #if defined (_TMS320C4x) || defined (_TMS320C3x) + #include + #else ++#if defined (__s390__) || defined (__s390x__) ++#include ++#else + + /* Define __gnuc_va_list. */ + +@@ -121,6 +124,7 @@ + + #endif /* _STDARG_H */ + ++#endif /* not s390 */ + #endif /* not TMS320C3x or TMS320C4x */ + #endif /* not v850 */ + #endif /* not mn10200 */ +diff -urN --exclude=CVS gcc-2.95.3/gcc/ginclude/va-s390.h gcc/gcc/ginclude/va-s390.h +--- gcc-2.95.3/gcc/ginclude/va-s390.h Thu Jan 1 01:00:00 1970 ++++ gcc/gcc/ginclude/va-s390.h Thu May 17 18:40:28 2001 +@@ -0,0 +1,186 @@ ++/* GNU C varargs support for the S/390. */ ++ ++#ifndef __GNUC_VA_LIST ++#define __GNUC_VA_LIST ++ ++typedef struct __va_list_tag { ++ long __gpr; /* index into the array of 5 GPRs stored in the ++ register save area __gpr=0 corresponds to r2, ++ __gpr=1 to r3, etc. */ ++ long __fpr; /* index into the array of 2 FPRs stored in the ++ register save area __fpr=0 corresponds to f0, ++ __fpr=1 to f2, etc. */ ++ char *__incoming_args_area; /* location on stack that holds the next ++ overflow argument */ ++ char *__reg_save_area; /* where r2:r6 and f0 and f2, ++ if saved are stored */ ++} __gnuc_va_list[1],*__gnuc_va_listp; ++#endif ++ ++/* If this is for internal libc use, don't define anything but ++ __gnuc_va_list. */ ++#if defined (_STDARG_H) || defined (_VARARGS_H) ++ ++/* Register save area located in the 96 byte of the ++ * Stack given to the called function ++ */ ++ ++#ifndef __VA_S390_H__ ++#define __VA_S390_H__ ++typedef struct { ++ long __backchain; ++ long __spare; ++ long __gp_save[14]; /* save area for GP registers */ ++ long long __fp_save[4]; /* save area for FP registers */ ++} __va_regsave_t; ++ ++/* Macros to access the register save area */ ++/* We cast to void * and then to TYPE * because this avoids ++ a warning about increasing the alignment requirement. */ ++ ++#define __VA_FP_REGSAVE(AP,TYPE) \ ++ ((TYPE *) (void *) (&(((__va_regsave_t *) \ ++ (AP)->__reg_save_area)->__fp_save[(AP)->__fpr]))) ++ ++#define __VA_GP_REGSAVE(AP,TYPE) \ ++ ((TYPE *) (void *) (&(((__va_regsave_t *) \ ++ (AP)->__reg_save_area)->__gp_save[(AP)->__gpr]))) ++#define __va_overflow(AP) (AP)->__incoming_args_area ++ ++ ++#define __va_start_common(AP, LASTARG) \ ++__extension__ ({ \ ++ *(AP) = *(__gnuc_va_listp) __builtin_saveregs (); \ ++ (void)0; \ ++ }) ++ ++#ifdef _STDARG_H /* stdarg.h support */ ++ ++/* Calling __builtin_next_arg gives the proper error message if LASTARG is ++ not indeed the last argument. */ ++#define va_start(AP,LASTARG) \ ++ (__builtin_next_arg(LASTARG),__va_start_common (AP, LASTARG)) ++ ++ ++#else /* varargs.h support */ ++ ++#define va_alist __builtin_va_alist ++#define va_dcl int __builtin_va_alist;... ++#define va_start(AP) __va_start_common (AP,va_alist) ++ ++#endif /* _STDARG_H */ ++ ++#define __va_fptype_p(TYPE) \ ++ ((__builtin_classify_type(*(TYPE *)0) == 8)) ++ ++#define __va_float_p(TYPE) \ ++ ((__builtin_classify_type(*(TYPE *)0) == 8) && (sizeof(TYPE) == 4)) ++ ++#define __va_double_p(TYPE) \ ++ ((__builtin_classify_type(*(TYPE *)0) == 8) && (sizeof(TYPE) == 8)) ++ ++#ifndef __s390x__ ++#define __va_longlong_p(TYPE) \ ++ (((__builtin_classify_type(*(TYPE *)0) == 1) || \ ++ (__builtin_classify_type(*(TYPE *)0) >= 12)) && \ ++ (sizeof(TYPE) == 8)) ++#else ++#define __va_longlong_p(TYPE) 0 ++#endif ++ ++#define __va_aggregate_p(TYPE) \ ++ ((__builtin_classify_type(*(TYPE *)0) >= 12) && \ ++ (sizeof(TYPE) != 1) && \ ++ (sizeof(TYPE) != 2) && \ ++ (sizeof(TYPE) != 4) && \ ++ (sizeof(TYPE) != 8)) ++ ++#define __va_size(TYPE) ((sizeof(TYPE) + sizeof (long) - 1) / sizeof (long)) ++ ++#ifndef __s390x__ ++#define __fp_num 2 ++#define __va_add_ptr(TYPE) \ ++ ((sizeof(TYPE) == 2) ? 1 : (sizeof(TYPE) == 1) ? 3 :0); ++#else ++#define __fp_num 4 ++#define __va_add_ptr(TYPE) \ ++ ((sizeof(TYPE) == 4) ? 1 : (sizeof(TYPE) == 2) ? 3 : \ ++ (sizeof(TYPE) == 1) ? 7 : 0) ++#endif ++ ++ ++#define va_arg(AP,TYPE) \ ++__extension__ (*({ \ ++ register TYPE *__ptr; \ ++ \ ++ if (__va_float_p (TYPE) && (AP)->__fpr < __fp_num) \ ++ { \ ++ __ptr = __VA_FP_REGSAVE (AP, TYPE); \ ++ (AP)->__fpr++; \ ++ } \ ++ else if (__va_double_p (TYPE) && (AP)->__fpr < __fp_num) \ ++ { \ ++ __ptr = __VA_FP_REGSAVE (AP, TYPE); \ ++ (AP)->__fpr++; \ ++ } \ ++ else if (__va_longlong_p (TYPE) ) \ ++ { \ ++ if ((AP)->__gpr < 4) \ ++ { \ ++ __ptr = __VA_GP_REGSAVE (AP, TYPE); \ ++ (AP)->__gpr++; \ ++ (AP)->__gpr++; \ ++ } \ ++ else \ ++ { \ ++ __ptr = (TYPE *) (void *) (__va_overflow(AP)); \ ++ __va_overflow(AP) += __va_size (TYPE) * sizeof (long); \ ++ (AP)->__gpr++; \ ++ } \ ++ } \ ++ /* Aggregates passed by reference. */ \ ++ else if (__va_aggregate_p (TYPE)) \ ++ { \ ++ if ((AP)->__gpr < 5) \ ++ { \ ++ __ptr = *__VA_GP_REGSAVE (AP, TYPE*); \ ++ (AP)->__gpr++; \ ++ } \ ++ else \ ++ { \ ++ TYPE **__pptr = (TYPE **) (__va_overflow (AP)); \ ++ __ptr = * __pptr; \ ++ __va_overflow (AP) = (char *) (__pptr + 1); \ ++ } \ ++ } \ ++ \ ++ else if (((AP)->__gpr < 5) && !(__va_fptype_p(TYPE))) \ ++ { \ ++ __ptr = __VA_GP_REGSAVE (AP, TYPE ); \ ++ __ptr += __va_add_ptr(TYPE); \ ++ (AP)->__gpr++; \ ++ } \ ++ else \ ++ { \ ++ __ptr = (TYPE *) (void *) (__va_overflow(AP)); \ ++ __ptr += __va_add_ptr(TYPE); \ ++ __va_overflow(AP) += __va_size (TYPE) * sizeof (long); \ ++ } \ ++ \ ++ __ptr; \ ++})) ++ ++#define va_end(AP) ((void)0) ++ ++/* Copy __gnuc_va_list into another variable of this type. */ ++#define __va_copy(dest, src) *(dest) = *(src) ++ ++#endif /* __VA_S390_H__ */ ++#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ ++ ++ ++ ++ ++ ++ ++ +diff -urN --exclude=CVS gcc-2.95.3/gcc/ginclude/varargs.h gcc/gcc/ginclude/varargs.h +--- gcc-2.95.3/gcc/ginclude/varargs.h Wed Jul 7 02:19:05 1999 ++++ gcc/gcc/ginclude/varargs.h Thu Dec 28 13:35:08 2000 +@@ -60,6 +60,9 @@ + #if defined (_TMS320C4x) || defined (_TMS320C3x) + #include + #else ++#if defined (__s390__) || defined (__s390x__) ++#include ++#else + + #ifdef __NeXT__ + +@@ -140,6 +143,7 @@ + /* Copy __gnuc_va_list into another variable of this type. */ + #define __va_copy(dest, src) (dest) = (src) + ++#endif /* not s390 */ + #endif /* not TMS320C3x or TMS320C4x */ + #endif /* not v850 */ + #endif /* not mn10200 */ +diff -urN --exclude=CVS gcc-2.95.3/gcc/glimits.h gcc/gcc/glimits.h +--- gcc-2.95.3/gcc/glimits.h Mon Mar 27 19:22:10 2000 ++++ gcc/gcc/glimits.h Tue Jun 12 16:22:49 2001 +@@ -64,7 +64,7 @@ + /* Minimum and maximum values a `signed long int' can hold. + (Same as `int'). */ + #ifndef __LONG_MAX__ +-#if defined (__alpha__) || (defined (_ARCH_PPC) && defined (__64BIT__)) || defined (__sparc_v9__) || defined (__sparcv9) ++#if defined (__alpha__) || (defined (_ARCH_PPC) && defined (__64BIT__)) || defined (__sparc_v9__) || defined (__sparcv9) || defined (__s390x__) + #define __LONG_MAX__ 9223372036854775807L + #else + #define __LONG_MAX__ 2147483647L +diff -urN --exclude=CVS gcc-2.95.3/gcc/longlong.h gcc/gcc/longlong.h +--- gcc-2.95.3/gcc/longlong.h Wed Jan 6 21:44:39 1999 ++++ gcc/gcc/longlong.h Tue Mar 20 15:35:03 2001 +@@ -334,6 +334,75 @@ + } while (0) + #endif + ++#if defined (__s390__) ++#define add_ssaaaa(sh, sl, ah, al, bh, bl) ({ \ ++ USItype __sh = (ah); \ ++ USItype __sl = (al); \ ++ __asm__ (" alr %1,%3\n" \ ++ " brc 12,0f\n" \ ++ " ahi %0,1\n" \ ++ "0: alr %0,%2" \ ++ : "+&d" (__sh), "+d" (__sl) \ ++ : "d" (bh), "d" (bl) : "cc" ); \ ++ (sh) = __sh; \ ++ (sl) = __sl; \ ++}) ++#define sub_ddmmss(sh, sl, ah, al, bh, bl) ({ \ ++ USItype __sh = (ah); \ ++ USItype __sl = (al); \ ++ __asm__ (" slr %1,%3\n" \ ++ " brc 3,0f\n" \ ++ " ahi %0,-1\n" \ ++ "0: slr %0,%2" \ ++ : "+&d" (__sh), "+d" (__sl) \ ++ : "d" (bh), "d" (bl) : "cc" ); \ ++ (sh) = __sh; \ ++ (sl) = __sl; \ ++}) ++#define umul_ppmm(wh, wl, u, v) ({ \ ++ USItype __wh = (u); \ ++ USItype __wl = (v); \ ++ __asm__ (" ltr 1,%0\n" \ ++ " mr 0,%1\n" \ ++ " jnm 0f\n" \ ++ " alr 0,%1\n" \ ++ "0: ltr %1,%1\n" \ ++ " jnm 1f\n" \ ++ " alr 0,%0\n" \ ++ "1: lr %0,0\n" \ ++ " lr %1,1\n" \ ++ : "+d" (__wh), "+d" (__wl) \ ++ : : "0", "1", "cc" ); \ ++ (wh) = __wh; \ ++ (wl) = __wl; \ ++}) ++#define smul_ppmm(xh, xl, m0, m1) ({ \ ++ union { \ ++ DItype __ll; \ ++ struct { USItype __h, __l; } __i; \ ++ } __xx; \ ++ __xx.__i.__l = (m0); \ ++ __asm__ ("mr %0,%1" \ ++ : "+&d" (__xx) \ ++ : "d" (m1) ); \ ++ (xh) = __xx.__i.__h; \ ++ (xl) = __xx.__i.__l; \ ++}) ++#define sdiv_qrnnd(q, r, n1, n0, d) ({ \ ++ union { \ ++ DItype __ll; \ ++ struct { USItype __h, __l; } __i; \ ++ } __xx; \ ++ __xx.__i.__h = (n1); \ ++ __xx.__i.__l = (n0); \ ++ __asm__ ("dr %0,%1" \ ++ : "+&d" (__xx) \ ++ : "d" (d) ); \ ++ (r) = __xx.__i.__h; \ ++ (q) = __xx.__i.__l; \ ++}) ++#endif ++ + #if defined (__i386__) || defined (__i486__) + #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ + __asm__ ("addl %5,%1 +diff -urN --exclude=CVS gcc-2.95.3/gcc/reload1.c gcc/gcc/reload1.c +--- gcc-2.95.3/gcc/reload1.c Thu Jan 25 15:03:21 2001 ++++ gcc/gcc/reload1.c Tue Jun 12 16:22:49 2001 +@@ -3278,10 +3278,11 @@ + rtx new_body; + int val = 0; + struct elim_table *ep; +- ++#if 0 ++ /* could be called in force_const_mem context. */ + if (! replace) + push_obstacks (&reload_obstack, &reload_obstack); +- ++#endif + if (old_set != 0 && GET_CODE (SET_DEST (old_set)) == REG + && REGNO (SET_DEST (old_set)) < FIRST_PSEUDO_REGISTER) + { +@@ -3488,10 +3489,10 @@ + the pre-passes. */ + if (val && REG_NOTES (insn) != 0) + REG_NOTES (insn) = eliminate_regs (REG_NOTES (insn), 0, REG_NOTES (insn)); +- ++#if 0 + if (! replace) + pop_obstacks (); +- ++#endif + return val; + } + +@@ -4230,7 +4231,7 @@ + + else if (GET_RTX_CLASS (GET_CODE (insn)) == 'i') + { +- rtx oldpat = PATTERN (insn); ++ rtx oldpat = copy_rtx (PATTERN (insn)); + + /* If this is a USE and CLOBBER of a MEM, ensure that any + references to eliminable registers have been removed. */ +@@ -4819,6 +4820,7 @@ + /* In use for anything means we can't use it for RELOAD_OTHER. */ + if (TEST_HARD_REG_BIT (reload_reg_used_in_other_addr, regno) + || TEST_HARD_REG_BIT (reload_reg_used_in_op_addr, regno) ++ || TEST_HARD_REG_BIT (reload_reg_used_in_op_addr_reload, regno) + || TEST_HARD_REG_BIT (reload_reg_used_in_insn, regno)) + return 0; + +@@ -6055,7 +6057,9 @@ + inherited register for subsequent reloads. */ + || (reload_out[r] && reload_reg_rtx[r] + && rtx_equal_p (reload_out[r], +- reload_reg_rtx[r]))) ++ reload_reg_rtx[r])) ++ || regno_clobbered_p (i, insn, reload_mode[r], 0)) ++ + { + if (! reload_optional[r]) + { +@@ -6655,7 +6659,13 @@ + AUTO_INC reload if reload_out is set but reload_out_reg isn't. */ + && (! reload_inherited[j] || (reload_out[j] && ! reload_out_reg[j])) + && ! rtx_equal_p (reload_reg_rtx[j], old) +- && reload_reg_rtx[j] != 0) ++ && reload_reg_rtx[j] != 0 ++ /* inherited RELOAD_FOR_OPERAND_ADDR are deleted ++ * therefor the RELOAD_FOR_OPADDR_ADDR should be deleted, too ++ */ ++ && (reload_when_needed[j] != RELOAD_FOR_OPADDR_ADDR || ++ !(reload_inherited[j+1] && ++ reload_when_needed[j+1] == RELOAD_FOR_OPERAND_ADDRESS))) + { + register rtx reloadreg = reload_reg_rtx[j]; + rtx oldequiv = 0; +@@ -7172,9 +7182,32 @@ + && (dead_or_set_p (insn, + spill_reg_stored_to[REGNO (reload_reg_rtx[j])]) + || rtx_equal_p (spill_reg_stored_to[REGNO (reload_reg_rtx[j])], +- reload_out_reg[j]))) +- delete_output_reload (insn, j, REGNO (reload_reg_rtx[j])); +- ++ reload_out_reg[j]))) { ++ /* HP FIX ++ * does not work right ++(insn 4732 3425 3445 (set (reg:SI 1551) ++ (reg/v:SI 49)) 27 {do_movsi} (insn_list/j/c 74 (nil)) ++ (nil)) ++.... ++(insn 3458 3451 3460 (set (reg:SI 1551) ++ (ashift:SI (reg:SI 1551) ++ (const_int 1 [0x1]))) 133 {ashlsi3} (insn_list/j/c 4732 (nil)) ++ (expr_list:REG_EQUAL (mult:SI (reg/v:SI 49) ++ (const_int 2 [0x2])) ++ (nil))) ++ ++(insn 3460 3458 3461 (set (reg:SI 1551) ++ (plus:SI (reg:SI 1551) ++ (reg/v:SI 49))) 75 {do_addsi3} (insn_list/j/c 74 (insn_list/j/c 3458 (nil))) ++ (expr_list:REG_DEAD (reg/v:SI 49) ++ (expr_list:REG_EQUAL (mult:SI (reg/v:SI 49) ++ (const_int 3 [0x3])) ++ (nil)))) ++ * reload for first insn is deleted, but used for second insn !!!! ++ * FIXME: real problem not understood so far ++ */ ++ // delete_output_reload (insn, j, REGNO (reload_reg_rtx[j])); ++ } + /* Input-reloading is done. Now do output-reloading, + storing the value from the reload-register after the main insn + if reload_out[j] is nonzero. +@@ -8099,6 +8132,9 @@ + break; + return; + } ++ if (GET_CODE (i1) == CALL_INSN ++ && reg_mentioned_p (reg, CALL_INSN_FUNCTION_USAGE (i1))) ++ return; + } + + /* The caller has already checked that REG dies or is set in INSN. +@@ -10283,6 +10319,7 @@ + if (GET_CODE (src0) == REG) + { + if (REGNO (src0) != regno ++ || reg_set_luid[regno] == 0 + || reg_offset[regno] != const0_rtx) + { + reg_base_reg[regno] = REGNO (src0); +diff -urN --exclude=CVS gcc-2.95.3/gcc/stmt.c gcc/gcc/stmt.c +--- gcc-2.95.3/gcc/stmt.c Thu Jan 25 15:03:22 2001 ++++ gcc/gcc/stmt.c Tue Jun 12 16:22:49 2001 +@@ -1552,7 +1552,7 @@ + XVECEXP (body, 3, ninputs - ninout + i) /* argvec */ + = output_rtx[j]; + XVECEXP (body, 4, ninputs - ninout + i) /* constraints */ +- = gen_rtx_ASM_INPUT (inout_mode[j], match[j]); ++ = gen_rtx_ASM_INPUT (inout_mode[i], match[j]); + } + + /* Now, for each output, construct an rtx +diff -urN --exclude=CVS gcc-2.95.3/gcc/varasm.c gcc/gcc/varasm.c +--- gcc-2.95.3/gcc/varasm.c Mon Feb 19 15:02:02 2001 ++++ gcc/gcc/varasm.c Thu Jun 21 13:25:56 2001 +@@ -3202,7 +3202,7 @@ + const_double_chain = p->const_double_chain; + } + +-enum kind { RTX_DOUBLE, RTX_INT }; ++enum kind { RTX_DOUBLE, RTX_INT, RTX_UNSPEC }; + + struct rtx_const + { +@@ -3285,6 +3285,10 @@ + abort (); + value->un.addr.offset = - INTVAL (XEXP (x, 1)); + } ++ else if (GET_CODE (x) == UNSPEC) ++ { ++ value->un.addr.base = x; ++ } + else + abort (); + break; +@@ -3293,7 +3297,17 @@ + abort (); + } + +- if (value->kind == RTX_INT && value->un.addr.base != 0) ++ if (value->kind == RTX_INT && value->un.addr.base != 0 ++ && GET_CODE (value->un.addr.base) == UNSPEC) ++ { ++ if (XVECLEN (value->un.addr.base, 0) != 1) ++ abort(); ++ ++ value->kind = RTX_UNSPEC + XINT (value->un.addr.base, 1); ++ value->un.addr.base = XVECEXP (value->un.addr.base, 0, 0); ++ } ++ ++ if (value->kind != RTX_DOUBLE && value->un.addr.base != 0) + switch (GET_CODE (value->un.addr.base)) + { + case SYMBOL_REF: +@@ -3320,7 +3334,8 @@ + decode_rtx_const (GET_MODE (x), XEXP (x, 0), &val0); + decode_rtx_const (GET_MODE (x), XEXP (x, 1), &val1); + +- if (val0.un.addr.base == val1.un.addr.base) ++ if (val0.kind != RTX_DOUBLE && val0.kind == val1.kind ++ && val0.un.addr.base == val1.un.addr.base) + return GEN_INT (val0.un.addr.offset - val1.un.addr.offset); + return x; + } +@@ -3484,12 +3499,12 @@ + push_obstacks_nochange (); + rtl_in_saveable_obstack (); + +- if (GET_CODE (x) == CONST) ++ if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS) + x = gen_rtx_CONST (GET_MODE (x), + gen_rtx_PLUS (GET_MODE (x), + XEXP (XEXP (x, 0), 0), + XEXP (XEXP (x, 0), 1))); +- else ++ else if (GET_CODE (x) == CONST_INT) + x = GEN_INT (INTVAL (x)); + + pop_obstacks (); +diff -urN gcc-20011006/gcc/crtstuff.c src-native-new/gcc/crtstuff.c +--- gcc-20011006/gcc/crtstuff.c Tue Apr 3 22:38:59 2001 ++++ src-native-new/gcc/crtstuff.c Tue Feb 19 05:57:15 2002 +@@ -56,6 +56,10 @@ + #include + #include "frame.h" + ++#ifndef CRT_CALL_STATIC_FUNCTION ++# define CRT_CALL_STATIC_FUNCTION(func) func () ++#endif ++ + /* We do not want to add the weak attribute to the declarations of these + routines in frame.h because that will cause the definition of these + symbols to be weak as well. +@@ -185,7 +189,7 @@ + fini_dummy (void) + { + asm (FINI_SECTION_ASM_OP); +- __do_global_dtors_aux (); ++ CRT_CALL_STATIC_FUNCTION (__do_global_dtors_aux); + #ifdef FORCE_FINI_SECTION_ALIGN + FORCE_FINI_SECTION_ALIGN; + #endif +@@ -209,7 +213,7 @@ + init_dummy (void) + { + asm (INIT_SECTION_ASM_OP); +- frame_dummy (); ++ CRT_CALL_STATIC_FUNCTION (frame_dummy); + #ifdef FORCE_INIT_SECTION_ALIGN + FORCE_INIT_SECTION_ALIGN; + #endif +@@ -374,7 +378,7 @@ + init_dummy (void) + { + asm (INIT_SECTION_ASM_OP); +- __do_global_ctors_aux (); ++ CRT_CALL_STATIC_FUNCTION (__do_global_ctors_aux); + #ifdef FORCE_INIT_SECTION_ALIGN + FORCE_INIT_SECTION_ALIGN; + #endif +diff -urN ../gcc-2.95-2.95.4.ds13/src-native/gcc/config/s390/s390-295.h src-native/gcc/config/s390/s390-295.h +--- ../gcc-2.95-2.95.4.ds13/src-native/gcc/config/s390/s390-295.h Tue Jul 2 11:57:58 2002 ++++ src-native/gcc/config/s390/s390-295.h Tue Jul 2 11:54:50 2002 +@@ -24,7 +24,9 @@ + extern struct rtx_def *s390_builtin_saveregs (); + #define EXPAND_BUILTIN_SAVEREGS(ARGLIST) s390_builtin_saveregs (ARGLIST) + +-#define INSN_ADDRESSES(ID) insn_addresses[ID] ++extern int insn_lengths_max_uid; ++#define INSN_ADDRESSES_SIZE() ((size_t)insn_lengths_max_uid) ++#define INSN_ADDRESSES(ID) ((ID) >= insn_lengths_max_uid ? -1 : insn_addresses[ID]) + #define INSN_ADDRESSES_NEW(ID,I) ID + #define va_list_type_node ptr_type_node + #define get_varargs_alias_set() NULL +diff -urN ../gcc-2.95-2.95.4.ds13/src-native/gcc/config/s390/s390-protos.h src-native/gcc/config/s390/s390-protos.h +--- ../gcc-2.95-2.95.4.ds13/src-native/gcc/config/s390/s390-protos.h Tue Jul 2 11:57:58 2002 ++++ src-native/gcc/config/s390/s390-protos.h Tue Jul 2 11:54:50 2002 +@@ -29,6 +29,7 @@ + + #endif /* TREE_CODE */ + ++extern int consttable_operand PARAMS ((rtx, enum machine_mode)); + extern int fp_operand PARAMS ((rtx, enum machine_mode)); + extern int s_operand PARAMS ((rtx, enum machine_mode)); + extern int r_or_im8_operand PARAMS ((rtx, enum machine_mode)); +@@ -39,6 +40,7 @@ + extern int dead_p PARAMS ((rtx, rtx)); + extern void print_operand PARAMS ((FILE *, rtx, char)); + extern void print_operand_address PARAMS ((FILE *, rtx)); ++extern int legitimate_la_operand_p PARAMS ((rtx)); + extern int legitimate_pic_operand_p PARAMS ((rtx)); + extern int legitimate_constant_p PARAMS ((rtx)); + +@@ -51,8 +53,6 @@ + extern void s390_output_symbolic_const PARAMS ((FILE *, rtx)); + extern int s390_adjust_cost PARAMS ((rtx, rtx, rtx, int)); + +-extern int s390_stop_dump_lit_p PARAMS ((rtx)); +-extern void s390_dump_literal_pool PARAMS ((rtx, rtx)); + extern void s390_expand_eh_epilogue PARAMS ((rtx, rtx, rtx)); + extern void s390_asm_output_external_libcall PARAMS ((FILE *, rtx)); + +@@ -72,7 +72,6 @@ + int *, int)); + extern struct rtx_def *s390_va_arg PARAMS ((tree, tree)); + extern union tree_node *s390_build_va_list PARAMS ((void)); +-extern void s390_asm_output_pool_prologue PARAMS ((FILE *, char *, tree, int)); + extern void encode_section_info PARAMS ((tree)); + + #endif /* TREE_CODE */ +diff -urN ../gcc-2.95-2.95.4.ds13/src-native/gcc/config/s390/s390.c src-native/gcc/config/s390/s390.c +--- ../gcc-2.95-2.95.4.ds13/src-native/gcc/config/s390/s390.c Tue Jul 2 11:57:58 2002 ++++ src-native/gcc/config/s390/s390.c Tue Jul 2 11:54:50 2002 +@@ -39,6 +39,7 @@ + #include "obstack.h" + #include "except.h" + #include "function.h" ++#include "bitmap.h" + #include "toplev.h" + + #include "tm_p.h" +@@ -165,7 +166,18 @@ + { + return op == CONST1_RTX (mode); + } +- ++ ++/* Return true if OP is constant. ++ OP is the current operation. ++ MODE is the current operation mode. */ ++ ++int ++consttable_operand (op, mode) ++ rtx op; ++ enum machine_mode mode ATTRIBUTE_UNUSED; ++{ ++ return CONSTANT_P (op); ++} + + /* Return 1 if OP needs base and index register. */ + +@@ -728,6 +740,24 @@ + return FALSE; + } + ++ /* Accept chunkfied literal pool symbol references. */ ++ else if (GET_CODE (disp) == CONST ++ && GET_CODE (XEXP (disp, 0)) == MINUS ++ && GET_CODE (XEXP (XEXP (disp, 0), 0)) == LABEL_REF ++ && GET_CODE (XEXP (XEXP (disp, 0), 1)) == LABEL_REF) ++ { ++ } ++ ++ /* Likewise if a constant offset is present. */ ++ else if (GET_CODE (disp) == CONST ++ && GET_CODE (XEXP (disp, 0)) == PLUS ++ && GET_CODE (XEXP (XEXP (disp, 0), 1)) == CONST_INT ++ && GET_CODE (XEXP (XEXP (disp, 0), 0)) == MINUS ++ && GET_CODE (XEXP (XEXP (XEXP (disp, 0), 0), 0)) == LABEL_REF ++ && GET_CODE (XEXP (XEXP (XEXP (disp, 0), 0), 1)) == LABEL_REF) ++ { ++ } ++ + /* We can convert literal pool addresses to + displacements by basing them off the base register. */ + else +@@ -799,6 +829,56 @@ + return s390_decompose_address (addr, NULL, strict); + } + ++/* Return 1 if OP is a valid operand for the LA instruction. ++ In 31-bit, we need to prove that the result is used as an ++ address, as LA performs only a 31-bit addition. */ ++ ++int ++legitimate_la_operand_p (op) ++ register rtx op; ++{ ++ struct s390_address addr; ++ if (!s390_decompose_address (op, &addr, FALSE)) ++ return FALSE; ++ ++ if (TARGET_64BIT) ++ return TRUE; ++ ++ /* Use of the base or stack pointer implies address. */ ++ ++ if (addr.base && GET_CODE (addr.base) == REG) ++ { ++ if (REGNO (addr.base) == BASE_REGISTER ++ || REGNO (addr.base) == STACK_POINTER_REGNUM) ++ return TRUE; ++ ++ /* Before reload, use of the frame pointer register ++ also implies address. After reload, this is so ++ only if the frame pointer was not eliminated. */ ++ if (!(reload_completed || reload_in_progress) ++ || frame_pointer_needed) ++ if (REGNO (addr.base) == FRAME_POINTER_REGNUM) ++ return TRUE; ++ } ++ ++ if (addr.indx && GET_CODE (addr.indx) == REG) ++ { ++ if (REGNO (addr.indx) == BASE_REGISTER ++ || REGNO (addr.indx) == STACK_POINTER_REGNUM) ++ return TRUE; ++ ++ /* Before reload, use of the frame pointer register ++ also implies address. After reload, this is so ++ only if the frame pointer was not eliminated. */ ++ if (!(reload_completed || reload_in_progress) ++ || frame_pointer_needed) ++ if (REGNO (addr.indx) == FRAME_POINTER_REGNUM) ++ return TRUE; ++ } ++ ++ return FALSE; ++} ++ + /* Return a legitimate reference for ORIG (an address) using the + register REG. If REG is 0, a new pseudo is generated. + +@@ -996,6 +1076,7 @@ + { + int even = INTVAL (op1) - 1; + op0 = gen_rtx_PLUS (Pmode, op0, GEN_INT (even)); ++ op0 = gen_rtx_CONST (Pmode, op0); + op1 = GEN_INT (1); + } + +@@ -1116,8 +1197,47 @@ + register rtx oldx ATTRIBUTE_UNUSED; + enum machine_mode mode; + { +- if (flag_pic && SYMBOLIC_CONST (x)) +- return legitimize_pic_address (x, 0); ++ rtx constant_term = const0_rtx; ++ ++ if (flag_pic) ++ { ++ if (SYMBOLIC_CONST (x) ++ || (GET_CODE (x) == PLUS ++ && (SYMBOLIC_CONST (XEXP (x, 0)) ++ || SYMBOLIC_CONST (XEXP (x, 1))))) ++ x = legitimize_pic_address (x, 0); ++ ++ if (legitimate_address_p (mode, x, FALSE)) ++ return x; ++ } ++ ++ x = eliminate_constant_term (x, &constant_term); ++ ++ if (GET_CODE (x) == PLUS) ++ { ++ if (GET_CODE (XEXP (x, 0)) == REG) ++ { ++ register rtx temp = gen_reg_rtx (Pmode); ++ register rtx val = force_operand (XEXP (x, 1), temp); ++ if (val != temp) ++ emit_move_insn (temp, val); ++ ++ x = gen_rtx_PLUS (Pmode, XEXP (x, 0), temp); ++ } ++ ++ else if (GET_CODE (XEXP (x, 1)) == REG) ++ { ++ register rtx temp = gen_reg_rtx (Pmode); ++ register rtx val = force_operand (XEXP (x, 0), temp); ++ if (val != temp) ++ emit_move_insn (temp, val); ++ ++ x = gen_rtx_PLUS (Pmode, temp, XEXP (x, 1)); ++ } ++ } ++ ++ if (constant_term != const0_rtx) ++ x = gen_rtx_PLUS (Pmode, x, constant_term); + + return x; + } +@@ -1215,18 +1335,10 @@ + break; + + case CONST_INT: +- output_addr_const (file, x); +- break; +- + case LABEL_REF: + case CODE_LABEL: +- output_addr_const (file, x); +- break; +- + case SYMBOL_REF: + output_addr_const (file, x); +- if (CONSTANT_POOL_ADDRESS_P (x) && s390_pool_count != 0) +- fprintf (file, "_%X", s390_pool_count); + break; + + case UNSPEC: +@@ -1236,8 +1348,7 @@ + { + case 100: + s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); +- fprintf (file, "-.LT%X_%X", +- s390_function_count, s390_pool_count); ++ fprintf (file, "-.LT%X", s390_function_count); + break; + case 110: + s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); +@@ -1257,8 +1368,7 @@ + break; + case 114: + s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); +- fprintf (file, "@PLT-.LT%X_%X", +- s390_function_count, s390_pool_count); ++ fprintf (file, "@PLT-.LT%X", s390_function_count); + break; + default: + output_operand_lossage ("invalid UNSPEC as operand (2)"); +@@ -1280,7 +1390,7 @@ + struct s390_address ad; + + if (!s390_decompose_address (addr, &ad, TRUE)) +- output_operand_lossage ("Cannot decompose address.\n"); ++ output_operand_lossage ("Cannot decompose address."); + + if (ad.disp) + s390_output_symbolic_const (file, ad.disp); +@@ -1309,14 +1419,6 @@ + output_inverse_branch_condition (file, x); + return; + +- case 'Y': +- fprintf (file, ".LT%X_%X-.", s390_function_count, s390_pool_count); +- return; +- +- case 'y': +- fprintf (file, ".LT%X_%X", s390_function_count, s390_pool_count); +- return; +- + case 'O': + { + struct s390_address ad; +@@ -1488,13 +1590,6 @@ + if (recog_memoized (insn) < 0 || recog_memoized (dep_insn) < 0) + return cost; + +- /* If cost equal 1 nothing needs to be checked. */ +- +- if (cost == 1) +- { +- return cost; +- } +- + dep_rtx = PATTERN (dep_insn); + + if (GET_CODE (dep_rtx) == SET) +@@ -1508,7 +1603,7 @@ + debug_rtx (dep_insn); + debug_rtx (insn); + } +- return cost; ++ return cost + 4; + } + } + +@@ -1526,59 +1621,13 @@ + debug_rtx (dep_insn); + debug_rtx (insn); + } +- return cost; ++ return cost + 4; + } + } + } + + /* default cost. */ +- return 1; +-} +- +-/* Pool concept for Linux 390: +- - Function prologue saves used register +- - literal pool is dumped in prologue and jump across with bras +- - If function has more than 4 k literals, at about every +- S390_CHUNK_MAX offset in the function a literal pool will be +- dumped +- - in this case, a branch from one chunk to other chunk needs +- a reload of base register at the code label branched to. */ +- +- +- +-rtx s390_pool_start_insn = NULL_RTX; +- +-/* Count of actual pool in function (-1 -> before function). */ +- +-int s390_pool_count = -1; +- +- +- +-void +-s390_asm_output_pool_prologue (FILE *file, char *fname, tree fndecl, int size) +-{ +- +- if (s390_pool_count>0) { +- /* +- * We are in an internal pool, branch over +- */ +- if (TARGET_64BIT) +- { +- fprintf (file, "\tlarl\t%s,.LT%X_%X\n", +- reg_names[BASE_REGISTER], +- s390_function_count, s390_pool_count); +- readonly_data_section (); +- ASM_OUTPUT_ALIGN (file, floor_log2 (3)); +- fprintf (file, ".LT%X_%X:\t# Pool %d\n", +- s390_function_count, s390_pool_count, s390_pool_count); +- } +- else +- fprintf (file,"\t.align 4\n\tbras\t%s,0f\n.LT%X_%X:\t# Pool %d \n", +- reg_names[BASE_REGISTER], +- s390_function_count, s390_pool_count, s390_pool_count); +- } +- if (!TARGET_64BIT) +- function_section (fndecl); ++ return cost; + } + + +@@ -1625,6 +1674,8 @@ + if (get_attr_length (insn) == 4) + continue; + ++ regs_ever_live[RETURN_REGNUM] = 1; ++ + if (flag_pic) + { + target = gen_rtx_UNSPEC (SImode, gen_rtvec (1, label), 100); +@@ -1660,62 +1711,533 @@ + } + } + ++ ++/* Find a literal pool symbol referenced in RTX X, and store ++ it at REF. Will abort if X contains references to more than ++ one such pool symbol; multiple references to the same symbol ++ are allowed, however. ++ ++ The rtx pointed to by REF must be initialized to NULL_RTX ++ by the caller before calling this routine. */ ++ ++static void ++find_constant_pool_ref (x, ref) ++ rtx x; ++ rtx *ref; ++{ ++ int i, j; ++ const char *fmt; ++ ++ if (GET_CODE (x) == SYMBOL_REF ++ && CONSTANT_POOL_ADDRESS_P (x)) ++ { ++ if (*ref == NULL_RTX) ++ *ref = x; ++ else if (*ref != x) ++ abort(); ++ } ++ ++ fmt = GET_RTX_FORMAT (GET_CODE (x)); ++ for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--) ++ { ++ if (fmt[i] == 'e') ++ { ++ find_constant_pool_ref (XEXP (x, i), ref); ++ } ++ else if (fmt[i] == 'E') ++ { ++ for (j = 0; j < XVECLEN (x, i); j++) ++ find_constant_pool_ref (XVECEXP (x, i, j), ref); ++ } ++ } ++} ++ ++/* Replace every reference to the literal pool symbol REF ++ in X by the address ADDR. Fix up MEMs as required. */ ++ ++static void ++replace_constant_pool_ref (x, ref, addr) ++ rtx *x; ++ rtx ref; ++ rtx addr; ++{ ++ int i, j; ++ const char *fmt; ++ ++ if (*x == ref) ++ abort (); ++ ++ /* Literal pool references can only occur inside a MEM ... */ ++ if (GET_CODE (*x) == MEM) ++ { ++ rtx memref = XEXP (*x, 0); ++ ++ if (memref == ref) ++ { ++ *x = change_address (*x, VOIDmode, addr); ++ return; ++ } ++ ++ if (GET_CODE (memref) == CONST ++ && GET_CODE (XEXP (memref, 0)) == PLUS ++ && GET_CODE (XEXP (XEXP (memref, 0), 1)) == CONST_INT ++ && XEXP (XEXP (memref, 0), 0) == ref) ++ { ++ HOST_WIDE_INT off = INTVAL (XEXP (XEXP (memref, 0), 1)); ++ *x = change_address (*x, VOIDmode, plus_constant (addr, off)); ++ return; ++ } ++ } ++ ++ /* ... or a load-address type pattern. */ ++ if (GET_CODE (*x) == SET) ++ { ++ rtx addrref = SET_SRC (*x); ++ ++ if (addrref == ref) ++ { ++ SET_SRC (*x) = addr; ++ return; ++ } ++ ++ if (GET_CODE (addrref) == CONST ++ && GET_CODE (XEXP (addrref, 0)) == PLUS ++ && GET_CODE (XEXP (XEXP (addrref, 0), 1)) == CONST_INT ++ && XEXP (XEXP (addrref, 0), 0) == ref) ++ { ++ HOST_WIDE_INT off = INTVAL (XEXP (XEXP (addrref, 0), 1)); ++ SET_SRC (*x) = plus_constant (addr, off); ++ return; ++ } ++ } ++ ++ fmt = GET_RTX_FORMAT (GET_CODE (*x)); ++ for (i = GET_RTX_LENGTH (GET_CODE (*x)) - 1; i >= 0; i--) ++ { ++ if (fmt[i] == 'e') ++ { ++ replace_constant_pool_ref (&XEXP (*x, i), ref, addr); ++ } ++ else if (fmt[i] == 'E') ++ { ++ for (j = 0; j < XVECLEN (*x, i); j++) ++ replace_constant_pool_ref (&XVECEXP (*x, i, j), ref, addr); ++ } ++ } ++} ++ ++/* We keep a list of constants we which we have to add to internal ++ constant tables in the middle of large functions. */ ++ ++#define NR_C_MODES 6 ++enum machine_mode constant_modes[NR_C_MODES] = ++{ ++ DFmode, DImode, ++ SFmode, SImode, ++ HImode, ++ QImode ++}; ++ ++rtx (*gen_consttable[NR_C_MODES])(rtx) = ++{ ++ gen_consttable_df, gen_consttable_di, ++ gen_consttable_sf, gen_consttable_si, ++ gen_consttable_hi, ++ gen_consttable_qi ++}; ++ ++struct constant ++{ ++ struct constant *next; ++ rtx value; ++ rtx label; ++}; ++ ++struct constant_pool ++{ ++ struct constant_pool *next; ++ rtx first_insn; ++ rtx last_insn; ++ int first_addr; ++ int last_addr; ++ ++ struct constant *constants[NR_C_MODES]; ++ rtx label; ++ int size; ++}; ++ ++static struct constant_pool *s390_start_pool PARAMS ((struct constant_pool **, rtx, int)); ++static void s390_end_pool PARAMS ((struct constant_pool *, rtx, int)); ++static struct constant_pool *s390_find_pool PARAMS ((struct constant_pool *, rtx)); ++static rtx s390_add_pool PARAMS ((struct constant_pool *, rtx, enum machine_mode)); ++static rtx s390_dump_pool PARAMS ((struct constant_pool *)); ++static void s390_free_pool PARAMS ((struct constant_pool *)); ++ ++/* Create new constant pool covering instructions starting at INSN ++ and chain it to the end of POOL_LIST. */ ++ ++static struct constant_pool * ++s390_start_pool (pool_list, insn, addr) ++ struct constant_pool **pool_list; ++ rtx insn; ++ int addr; ++{ ++ struct constant_pool *pool, **prev; ++ int i; ++ ++ if (addr == -1) ++ abort (); ++ ++ pool = (struct constant_pool *) xmalloc (sizeof *pool); ++ pool->next = NULL; ++ for (i = 0; i < NR_C_MODES; i++) ++ pool->constants[i] = NULL; ++ ++ pool->label = gen_label_rtx (); ++ pool->first_insn = insn; ++ pool->first_addr = addr; ++ pool->last_insn = NULL_RTX; ++ pool->last_addr = INT_MAX; ++ pool->size = 0; ++ ++ for (prev = pool_list; *prev; prev = &(*prev)->next) ++ ; ++ *prev = pool; ++ ++ return pool; ++} ++ ++/* End range of instructions covered by POOL at INSN. */ ++ ++static void ++s390_end_pool (pool, insn, addr) ++ struct constant_pool *pool; ++ rtx insn; ++ int addr; ++{ ++ if (addr == -1) ++ abort (); ++ ++ pool->last_insn = insn; ++ pool->last_addr = addr; ++} ++ ++/* Return pool out of POOL_LIST that covers INSN. */ ++ ++static struct constant_pool * ++s390_find_pool (pool_list, insn) ++ struct constant_pool *pool_list; ++ rtx insn; ++{ ++ int addr = INSN_ADDRESSES (INSN_UID (insn)); ++ struct constant_pool *pool; ++ ++ if (addr == -1) ++ return NULL; ++ ++ for (pool = pool_list; pool; pool = pool->next) ++ if (pool->first_addr <= addr && pool->last_addr > addr) ++ break; ++ ++ return pool; ++} ++ ++/* Add constant VAL of mode MODE to the constant pool POOL. ++ Return an RTX describing the distance from the start of ++ the pool to the location of the new constant. */ ++ ++static rtx ++s390_add_pool (pool, val, mode) ++ struct constant_pool *pool; ++ rtx val; ++ enum machine_mode mode; ++{ ++ struct constant *c; ++ rtx offset; ++ int i; ++ ++ for (i = 0; i < NR_C_MODES; i++) ++ if (constant_modes[i] == mode) ++ break; ++ if (i == NR_C_MODES) ++ abort (); ++ ++ for (c = pool->constants[i]; c != NULL; c = c->next) ++ if (rtx_equal_p (val, c->value)) ++ break; ++ ++ if (c == NULL) ++ { ++ c = (struct constant *) xmalloc (sizeof *c); ++ c->value = val; ++ c->label = gen_label_rtx (); ++ c->next = pool->constants[i]; ++ pool->constants[i] = c; ++ pool->size += GET_MODE_SIZE (mode); ++ } ++ ++ offset = gen_rtx_MINUS (Pmode, gen_rtx_LABEL_REF (Pmode, c->label), ++ gen_rtx_LABEL_REF (Pmode, pool->label)); ++ offset = gen_rtx_CONST (Pmode, offset); ++ return offset; ++} ++ ++/* Dump out the constants in POOL. */ ++ ++static rtx ++s390_dump_pool (pool) ++ struct constant_pool *pool; ++{ ++ struct constant *c; ++ rtx insn; ++ int i; ++ ++ /* Select location to put literal pool. */ ++ if (TARGET_64BIT) ++ insn = get_last_insn (); ++ else ++ insn = pool->last_insn? pool->last_insn : get_last_insn (); ++ ++ /* Pool start insn switches to proper section ++ and guarantees necessary alignment. */ ++ if (TARGET_64BIT) ++ insn = emit_insn_after (gen_pool_start_64 (), insn); ++ else ++ insn = emit_insn_after (gen_pool_start_31 (), insn); ++ INSN_ADDRESSES_NEW (insn, -1); ++ ++ insn = emit_label_after (pool->label, insn); ++ INSN_ADDRESSES_NEW (insn, -1); ++ ++ /* Dump constants in descending alignment requirement order, ++ ensuring proper alignment for every constant. */ ++ for (i = 0; i < NR_C_MODES; i++) ++ for (c = pool->constants[i]; c; c = c->next) ++ { ++ insn = emit_label_after (c->label, insn); ++ INSN_ADDRESSES_NEW (insn, -1); ++ insn = emit_insn_after (gen_consttable[i] (c->value), insn); ++ INSN_ADDRESSES_NEW (insn, -1); ++ } ++ ++ /* Pool end insn switches back to previous section ++ and guarantees necessary alignment. */ ++ if (TARGET_64BIT) ++ insn = emit_insn_after (gen_pool_end_64 (), insn); ++ else ++ insn = emit_insn_after (gen_pool_end_31 (), insn); ++ INSN_ADDRESSES_NEW (insn, -1); ++ ++ insn = emit_barrier_after (insn); ++ INSN_ADDRESSES_NEW (insn, -1); ++ ++ return insn; ++} ++ ++/* Free all memory used by POOL. */ ++ ++static void ++s390_free_pool (pool) ++ struct constant_pool *pool; ++{ ++ int i; ++ ++ for (i = 0; i < NR_C_MODES; i++) ++ { ++ struct constant *c = pool->constants[i]; ++ while (c != NULL) ++ { ++ struct constant *next = c->next; ++ free (c); ++ c = next; ++ } ++ } ++ ++ free (pool); ++} ++ ++/* Used in s390.md for branch length calculation. */ ++int s390_pool_overflow = 0; ++ + /* Chunkify the literal pool if required. */ + ++#define S390_POOL_CHUNK_MIN 0xc00 ++#define S390_POOL_CHUNK_MAX 0xe00 ++ + static void + s390_chunkify_pool (void) + { +- int *ltorg_uids, max_ltorg, chunk, last_addr, next_addr; ++ rtx base_reg = gen_rtx_REG (Pmode, ++ TARGET_64BIT? BASE_REGISTER : RETURN_REGNUM); ++ ++ struct constant_pool *curr_pool = NULL, *pool_list = NULL; ++ int extra_size = 0; ++ bitmap far_labels; + rtx insn; + + /* Do we need to chunkify the literal pool? */ + +- if (get_pool_size () <= S390_POOL_MAX) ++ if (get_pool_size () < S390_POOL_CHUNK_MAX) + return; + +- /* Find all insns where a literal pool chunk must be inserted. */ ++ regs_ever_live[REGNO (base_reg)] = 1; + +- ltorg_uids = alloca (insn_current_address / 1024 + 1024); +- max_ltorg = 0; ++ /* Scan all insns and move literals to pool chunks. ++ Replace all occurrances of literal pool references ++ by explicit references to pool chunk entries. */ + +- last_addr = 0; + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + { +- if (INSN_ADDRESSES (INSN_UID (insn)) - last_addr < S390_CHUNK_MAX) ++ /* Special-case broken cmp[ds]i_tm insns. */ ++ if (GET_CODE (insn) == INSN ++ && INSN_CODE (insn) != CODE_FOR_cmpdi_tm ++ && INSN_CODE (insn) != CODE_FOR_cmpsi_tm) ++ { ++ rtx addr, pool_ref = NULL_RTX; ++ find_constant_pool_ref (PATTERN (insn), &pool_ref); ++ if (pool_ref) ++ { ++ if (!curr_pool) ++ curr_pool = s390_start_pool (&pool_list, insn, ++ INSN_ADDRESSES (INSN_UID (insn))); ++ ++ addr = s390_add_pool (curr_pool, get_pool_constant (pool_ref), ++ get_pool_mode (pool_ref)); ++ ++ addr = gen_rtx_PLUS (Pmode, base_reg, addr); ++ replace_constant_pool_ref (&PATTERN (insn), pool_ref, addr); ++ INSN_CODE (insn) = -1; ++ } ++ } ++ ++ if (!curr_pool ++ || INSN_ADDRESSES_SIZE () <= (size_t) INSN_UID (insn) ++ || INSN_ADDRESSES (INSN_UID (insn)) == -1) + continue; +- if (INSN_ADDRESSES (INSN_UID (insn)) - last_addr > S390_CHUNK_OV) +- abort (); + +- if (GET_CODE (insn) == CODE_LABEL +- && !(GET_CODE (NEXT_INSN (insn)) == JUMP_INSN +- && (GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_VEC +- || GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_DIFF_VEC))) +- { +- ltorg_uids[max_ltorg++] = INSN_UID (prev_real_insn (insn)); +- last_addr = INSN_ADDRESSES (ltorg_uids[max_ltorg-1]); +- continue; +- } ++ if (GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == USE) ++ continue; + +- if (GET_CODE (insn) == CALL_INSN) ++ if (TARGET_64BIT) + { +- ltorg_uids[max_ltorg++] = INSN_UID (insn); +- last_addr = INSN_ADDRESSES (ltorg_uids[max_ltorg-1]); +- continue; ++ if (curr_pool->size < S390_POOL_CHUNK_MAX) ++ continue; ++ ++ s390_end_pool (curr_pool, insn, ++ INSN_ADDRESSES (INSN_UID (insn))); ++ curr_pool = NULL; + } ++ else ++ { ++ int chunk_size = INSN_ADDRESSES (INSN_UID (insn)) ++ - INSN_ADDRESSES (INSN_UID (curr_pool->first_insn)) ++ + extra_size; ++ ++ /* We will later have to insert base register reload insns. ++ Those will have an effect on code size, which we need to ++ consider here. This calculation makes rather pessimistic ++ worst-case assumptions. */ ++ if (GET_CODE (insn) == CODE_LABEL ++ || GET_CODE (insn) == JUMP_INSN) ++ extra_size += 6; ++ else if (GET_CODE (insn) == CALL_INSN) ++ extra_size += 4; ++ ++ if (chunk_size < S390_POOL_CHUNK_MIN ++ && curr_pool->size < S390_POOL_CHUNK_MIN) ++ continue; ++ ++ /* Pool chunks can only be inserted after BARRIERs ... */ ++ if (GET_CODE (insn) == BARRIER) ++ { ++ s390_end_pool (curr_pool, insn, ++ INSN_ADDRESSES (INSN_UID (insn))); ++ curr_pool = NULL; ++ extra_size = 0; ++ } ++ ++ /* ... so if we don't find one in time, create one. */ ++ else if ((chunk_size > S390_POOL_CHUNK_MAX ++ || curr_pool->size > S390_POOL_CHUNK_MAX) ++ && (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN)) ++ { ++ int addr = INSN_ADDRESSES (INSN_UID (insn)); ++ rtx label, jump, barrier; ++ ++ label = gen_label_rtx (); ++ jump = emit_jump_insn_after (gen_jump (label), insn); ++ barrier = emit_barrier_after (jump); ++ insn = emit_label_after (label, barrier); ++ JUMP_LABEL (jump) = label; ++ LABEL_NUSES (label) = 1; ++ ++ INSN_ADDRESSES_NEW (jump, -1); ++ INSN_ADDRESSES_NEW (barrier, -1); ++ INSN_ADDRESSES_NEW (insn, -1); ++ ++ s390_end_pool (curr_pool, barrier, addr+1); ++ curr_pool = NULL; ++ extra_size = 0; ++ } ++ } ++ } ++ ++ /* As the epilog is emitted after the last insn, we need to ++ branch over any terminating pool on 31-bit. */ ++ if (curr_pool && !TARGET_64BIT) ++ { ++ rtx insn = get_last_insn (); ++ rtx label, jump, barrier; ++ ++ label = gen_label_rtx (); ++ jump = emit_jump_insn_after (gen_jump (label), insn); ++ barrier = emit_barrier_after (jump); ++ insn = emit_label_after (label, barrier); ++ JUMP_LABEL (jump) = label; ++ LABEL_NUSES (label) = 1; ++ ++ INSN_ADDRESSES_NEW (jump, -1); ++ INSN_ADDRESSES_NEW (barrier, -1); ++ INSN_ADDRESSES_NEW (insn, -1); ++ ++ s390_end_pool (curr_pool, barrier, INT_MAX); + } + +- ltorg_uids[max_ltorg] = -1; ++ /* Dump out all literal pools. */ ++ ++ for (curr_pool = pool_list; curr_pool; curr_pool = curr_pool->next) ++ s390_dump_pool (curr_pool); + +- /* Find and mark all labels that are branched into ++ ++ /* Find all labels that are branched into + from an insn belonging to a different chunk. */ + +- chunk = last_addr = 0; +- next_addr = ltorg_uids[chunk] == -1 ? insn_current_address + 1 +- : INSN_ADDRESSES (ltorg_uids[chunk]); ++ far_labels = BITMAP_ALLOCA (); + + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + { +- if (GET_CODE (insn) == JUMP_INSN) ++ /* Labels marked with LABEL_PRESERVE_P can be target ++ of non-local jumps, so we have to mark them. ++ The same holds for named labels. ++ ++ Don't do that, however, if it is the label before ++ a jump table. */ ++ ++ if (GET_CODE (insn) == CODE_LABEL ++ && (LABEL_PRESERVE_P (insn) || LABEL_NAME (insn))) ++ { ++ rtx vec_insn = next_real_insn (insn); ++ rtx vec_pat = vec_insn && GET_CODE (vec_insn) == JUMP_INSN ? ++ PATTERN (vec_insn) : NULL_RTX; ++ if (!vec_pat ++ || !(GET_CODE (vec_pat) == ADDR_VEC ++ || GET_CODE (vec_pat) == ADDR_DIFF_VEC)) ++ bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (insn)); ++ } ++ ++ /* If we have a direct jump (conditional or unconditional) ++ or a casesi jump, check all potential targets. */ ++ else if (GET_CODE (insn) == JUMP_INSN) + { + rtx pat = PATTERN (insn); + if (GET_CODE (pat) == SET) +@@ -1736,89 +2258,131 @@ + + if (label) + { +- if (INSN_ADDRESSES (INSN_UID (label)) <= last_addr +- || INSN_ADDRESSES (INSN_UID (label)) > next_addr) +- SYMBOL_REF_USED (label) = 1; ++ if (s390_find_pool (pool_list, label) ++ != s390_find_pool (pool_list, insn)) ++ bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (label)); + } + } +- else if (GET_CODE (pat) == ADDR_VEC +- || GET_CODE (pat) == ADDR_DIFF_VEC) +- { +- int i, diff_p = GET_CODE (pat) == ADDR_DIFF_VEC; +- +- for (i = 0; i < XVECLEN (pat, diff_p); i++) +- { +- rtx label = XEXP (XVECEXP (pat, diff_p, i), 0); ++ else if (GET_CODE (pat) == PARALLEL ++ && XVECLEN (pat, 0) == 2 ++ && GET_CODE (XVECEXP (pat, 0, 0)) == SET ++ && GET_CODE (XVECEXP (pat, 0, 1)) == USE ++ && GET_CODE (XEXP (XVECEXP (pat, 0, 1), 0)) == LABEL_REF) ++ { ++ /* Find the jump table used by this casesi jump. */ ++ rtx vec_label = XEXP (XEXP (XVECEXP (pat, 0, 1), 0), 0); ++ rtx vec_insn = next_real_insn (vec_label); ++ rtx vec_pat = vec_insn && GET_CODE (vec_insn) == JUMP_INSN ? ++ PATTERN (vec_insn) : NULL_RTX; ++ if (vec_pat ++ && (GET_CODE (vec_pat) == ADDR_VEC ++ || GET_CODE (vec_pat) == ADDR_DIFF_VEC)) ++ { ++ int i, diff_p = GET_CODE (vec_pat) == ADDR_DIFF_VEC; + +- if (INSN_ADDRESSES (INSN_UID (label)) <= last_addr +- || INSN_ADDRESSES (INSN_UID (label)) > next_addr) +- SYMBOL_REF_USED (label) = 1; +- } +- } +- } ++ for (i = 0; i < XVECLEN (vec_pat, diff_p); i++) ++ { ++ rtx label = XEXP (XVECEXP (vec_pat, diff_p, i), 0); + +- if (INSN_UID (insn) == ltorg_uids[chunk]) +- { +- last_addr = INSN_ADDRESSES (ltorg_uids[chunk++]); +- next_addr = ltorg_uids[chunk] == -1 ? insn_current_address + 1 +- : INSN_ADDRESSES (ltorg_uids[chunk]); ++ if (s390_find_pool (pool_list, label) ++ != s390_find_pool (pool_list, insn)) ++ bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (label)); ++ } ++ } ++ } + } + } + +- /* Insert literal pools and base register reload insns. */ ++ /* Insert base register reload insns before every pool. */ ++ ++ for (curr_pool = pool_list; curr_pool; curr_pool = curr_pool->next) ++ if (TARGET_64BIT) ++ { ++ rtx pool_ref = gen_rtx_LABEL_REF (Pmode, curr_pool->label); ++ rtx new_insn = gen_rtx_SET (Pmode, base_reg, pool_ref); ++ rtx insn = curr_pool->first_insn; ++ INSN_ADDRESSES_NEW (emit_insn_before (new_insn, insn), -1); ++ } ++ else ++ { ++ rtx new_insn = gen_reload_base (base_reg, curr_pool->label); ++ rtx insn = curr_pool->first_insn; ++ INSN_ADDRESSES_NEW (emit_insn_before (new_insn, insn), -1); ++ } ++ ++ /* Insert base register reload insns at every far label. */ + +- chunk = 0; + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) +- { +- if (INSN_UID (insn) == ltorg_uids[chunk]) +- { +- rtx new_insn = gen_ltorg (GEN_INT (chunk++)); +- INSN_ADDRESSES_NEW (emit_insn_after (new_insn, insn), -1); +- } ++ if (GET_CODE (insn) == CODE_LABEL ++ && bitmap_bit_p (far_labels, CODE_LABEL_NUMBER (insn))) ++ { ++ struct constant_pool *pool = s390_find_pool (pool_list, insn); ++ if (pool) ++ { ++ if (TARGET_64BIT) ++ { ++ rtx pool_ref = gen_rtx_LABEL_REF (Pmode, pool->label); ++ rtx new_insn = gen_rtx_SET (Pmode, base_reg, pool_ref); ++ INSN_ADDRESSES_NEW (emit_insn_after (new_insn, insn), -1); ++ } ++ else ++ { ++ rtx new_insn = gen_reload_base (base_reg, pool->label); ++ INSN_ADDRESSES_NEW (emit_insn_after (new_insn, insn), -1); ++ } ++ } ++ } ++ ++ /* Insert base register reload insns after every call if necessary. */ ++ ++ if (REGNO (base_reg) == RETURN_REGNUM) ++ for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) ++ if (GET_CODE (insn) == CALL_INSN) ++ { ++ struct constant_pool *pool = s390_find_pool (pool_list, insn); ++ if (pool) ++ { ++ rtx new_insn = gen_reload_base2 (base_reg, pool->label); ++ INSN_ADDRESSES_NEW (emit_insn_after (new_insn, insn), -1); ++ } ++ } + +- if (GET_CODE (insn) == CODE_LABEL && SYMBOL_REF_USED (insn)) +- { +- rtx new_insn = gen_reload_base (insn); +- INSN_ADDRESSES_NEW (emit_insn_after (new_insn, insn), -1); +- } +- } + + /* Recompute insn addresses. */ + ++ s390_pool_overflow = 1; + init_insn_lengths (); + shorten_branches (get_insns ()); +-} ++ s390_pool_overflow = 0; + +-/* Return 1 if next literal pool is reached (check for ltorg insn) +- maybe should use unspec insn. */ ++ /* Insert base register reload insns after far branches. */ + ++ if (!TARGET_64BIT) ++ for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) ++ if (GET_CODE (insn) == JUMP_INSN ++ && GET_CODE (PATTERN (insn)) == SET ++ && get_attr_length (insn) >= 12) ++ { ++ struct constant_pool *pool = s390_find_pool (pool_list, insn); ++ if (pool) ++ { ++ rtx new_insn = gen_reload_base (base_reg, pool->label); ++ INSN_ADDRESSES_NEW (emit_insn_after (new_insn, insn), -1); ++ } ++ } + +-int +-s390_stop_dump_lit_p (rtx insn) +-{ +- rtx body=PATTERN (insn); +- if (GET_CODE (body) == PARALLEL +- && GET_CODE (XVECEXP (body, 0, 0)) == SET +- && GET_CODE (XVECEXP (body, 0, 1)) == USE +- && GET_CODE (XEXP ((XVECEXP (body, 0, 1)),0)) == CONST_INT +- && GET_CODE (SET_DEST (XVECEXP (body, 0, 0))) == REG +- && REGNO (SET_DEST (XVECEXP (body, 0, 0))) == BASE_REGISTER +- && SET_SRC (XVECEXP (body, 0, 0)) == pc_rtx) { +- return 1; +- } +- else +- return 0; +-} + +-void +-s390_dump_literal_pool (rtx act_insn, rtx stop) +-{ +- s390_pool_start_insn = act_insn; +- s390_pool_count++; +- output_constant_pool (current_function_name, current_function_decl); +- function_section (current_function_decl); +-} ++ /* Free all memory. */ ++ ++ while (pool_list) ++ { ++ struct constant_pool *next = pool_list->next; ++ s390_free_pool (pool_list); ++ pool_list = next; ++ } + ++ BITMAP_FREE (far_labels); ++} + + #ifdef DWARF2_DEBUGGING_INFO + extern char *dwarf2out_cfi_label PARAMS ((void)); +@@ -1831,6 +2395,7 @@ + rtx s390_got_label; + rtx s390_profile[10]; + int s390_nr_constants; ++int s390_pool_count = -1; + + /* Returns 1 if floating point registers need to be saved. */ + +@@ -1933,31 +2498,34 @@ + + /* Output constant pool in function prologue (31 bit) or in readonly section. */ + +-static int ++static void + s390_output_constant_pool (FILE* file) + { + /* Output constant pool. */ + if (s390_nr_constants || regs_ever_live[BASE_REGISTER]) + { +- s390_pool_count = 0; + if (TARGET_64BIT) + { +- fprintf (file, "\tlarl\t%s,.LT%X_%X\n", reg_names[BASE_REGISTER], +- s390_function_count, s390_pool_count); ++ fprintf (file, "\tlarl\t%s,.LT%X\n", reg_names[BASE_REGISTER], ++ s390_function_count); + readonly_data_section (); +- ASM_OUTPUT_ALIGN (file, floor_log2 (3)); ++ ASM_OUTPUT_ALIGN (file, 3); + } + else + { +- fprintf (file, "\tbras\t%s,.LTN%X_%X\n", reg_names[BASE_REGISTER], +- s390_function_count, s390_pool_count); ++ fprintf (file, "\tbras\t%s,.LTN%X\n", reg_names[BASE_REGISTER], ++ s390_function_count); + } +- fprintf (file, ".LT%X_%X:\n", s390_function_count, s390_pool_count); ++ fprintf (file, ".LT%X:\n", s390_function_count); ++ ++ s390_pool_count = 0; + output_constant_pool (current_function_name, current_function_decl); +- fprintf (file, ".LTN%X_%X:\n", s390_function_count, +- s390_pool_count); ++ s390_pool_count = -1; ++ + if (TARGET_64BIT) + function_section (current_function_decl); ++ else ++ fprintf (file, ".LTN%X:\n", s390_function_count); + + regs_ever_live[BASE_REGISTER] = 1; + } +@@ -2168,7 +2736,7 @@ + { + l = dwarf2out_cfi_label (); + dwarf2out_def_cfa (l, STACK_POINTER_REGNUM, STACK_POINTER_OFFSET); +- for (j = i; j <= 15; j++) ++ for (j = (i < 6 ? 6 : i); j <= 15; j++) + dwarf2out_reg_save (l, j, (TARGET_64BIT ? (j-20) : (j-24)) * + UNITS_PER_WORD); + if (regs_ever_live[18]) +@@ -2231,8 +2799,7 @@ + + /* Decrement stack. */ + +- if (TARGET_BACKCHAIN || (STARTING_FRAME_OFFSET + +- lsize + STACK_POINTER_OFFSET > 4095 ++ if (TARGET_BACKCHAIN || (frame_size + STACK_POINTER_OFFSET > 4095 + || frame_pointer_needed + || current_function_calls_alloca)) + { +@@ -2272,8 +2839,7 @@ + + /* Generate backchain. */ + +- if (TARGET_BACKCHAIN || (STARTING_FRAME_OFFSET + +- lsize + STACK_POINTER_OFFSET > 4095 ++ if (TARGET_BACKCHAIN || (frame_size + STACK_POINTER_OFFSET > 4095 + || frame_pointer_needed + || current_function_calls_alloca)) + { +@@ -2410,8 +2976,6 @@ + + current_function_uses_pic_offset_table = 0; + leaf_function_flag = 0; +- s390_pool_start_insn = NULL_RTX; +- s390_pool_count = -1; + s390_function_count++; + return 0; + } +diff -urN ../gcc-2.95-2.95.4.ds13/src-native/gcc/config/s390/s390.h src-native/gcc/config/s390/s390.h +--- ../gcc-2.95-2.95.4.ds13/src-native/gcc/config/s390/s390.h Tue Jul 2 11:57:58 2002 ++++ src-native/gcc/config/s390/s390.h Tue Jul 2 11:54:50 2002 +@@ -809,7 +809,6 @@ + #define FUNCTION_PROFILER(FILE, LABELNO) \ + do { \ + extern rtx s390_profile[]; \ +- extern s390_pool_count; \ + rtx tmp; \ + static char label[128]; \ + fprintf (FILE, "# function profiler \n"); \ +@@ -832,8 +831,6 @@ + } \ + else \ + { \ +- output_asm_insn ("l 14,4(15)", s390_profile); \ +- s390_pool_count = 0; \ + output_asm_insn ("st 14,4(15)", s390_profile); \ + output_asm_insn ("l 14,%4", s390_profile); \ + output_asm_insn ("l 1,%9", s390_profile); \ +@@ -1752,6 +1749,8 @@ + {"r_or_x_or_im16_operand", { MEM, SUBREG, REG, CONST_INT }}, \ + {"const0_operand", { CONST_INT, CONST_DOUBLE }}, \ + {"const1_operand", { CONST_INT, CONST_DOUBLE }}, \ ++ {"consttable_operand", { SYMBOL_REF, LABEL_REF, CONST, \ ++ CONST_INT, CONST_DOUBLE }}, \ + {"tmxx_operand", { CONST_INT, MEM }}, + + +@@ -1774,24 +1773,17 @@ + else \ + asm \ + ("bras\t%%r2,1f\n\ +-0: .long\t" #func " - 0b\n\ +-1: l\t%%r3,0(%%r2)\n\ +- bas\t%%r14,0(%%r3,%%r2)" : : : "2", "3", "cc", "memory"); ++0: .long\t" #func " - 0b\n\ ++1: l\t%%r3,0(%%r2)\n\ ++ bas\t%%r14,0(%%r3,%%r2)" : : : "2", "3", "cc", "memory"); + #endif + + /* Constant Pool for all symbols operands which are changed with + force_const_mem during insn generation (expand_insn). */ + +-extern struct rtx_def *s390_pool_start_insn; + extern int s390_pool_count; + extern int s390_nr_constants; +- +-/* Function is splitted in chunk, if literal pool could overflow +- Value need to be lowered, if problems with displacement overflow. */ +- +-#define S390_CHUNK_MAX 0xe00 +-#define S390_CHUNK_OV 0x1000 +-#define S390_POOL_MAX 0xe00 ++extern int s390_pool_overflow; + + #define ASM_OUTPUT_POOL_PROLOGUE(FILE, FUNNAME, fndecl, size) \ + { \ +@@ -1805,53 +1797,16 @@ + if (pool->mark) s390_nr_constants++; \ + return; \ + } \ +- if (first_pool == 0) { \ +- s390_asm_output_pool_prologue (FILE, FUNNAME, fndecl, size); \ +- return; \ +- } \ +- for (pool = first_pool; pool; pool = pool->next) \ +- pool->mark = 0; \ +- \ +- insn = s390_pool_start_insn; \ +- \ +- if (insn==NULL_RTX) \ +- insn = get_insns (); \ +- else \ +- insn = NEXT_INSN (insn); \ +- for (; insn; insn = NEXT_INSN (insn)) { \ +- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i') { \ +- if (s390_stop_dump_lit_p (insn)) { \ +- mark_constants (PATTERN (insn)); \ +- break; \ +- } else \ +- mark_constants (PATTERN (insn)); \ +- } \ +- } \ + \ + /* Mark entries referenced by other entries */ \ + for (pool = first_pool; pool; pool = pool->next) \ + if (pool->mark) \ +- mark_constants (pool->constant); \ +- \ +- s390_asm_output_pool_prologue (FILE, FUNNAME, fndecl, size); \ ++ mark_constants (pool->constant); \ + } + +-/* We need to return, because otherwise the pool is deleted of the +- constant pool after the first output. */ +- +-#define ASM_OUTPUT_POOL_EPILOGUE(FILE, FUNNAME, fndecl, size) return; +- + #define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, EXP, MODE, ALIGN, LABELNO, WIN) \ + { \ +- if ((s390_pool_count == 0) || (s390_pool_count > 0 && LABELNO >= 0)) \ +- { \ +- fprintf (FILE, ".LC%d:\n", LABELNO); \ +- LABELNO = ~LABELNO; \ +- } \ +- if (s390_pool_count > 0) \ +- { \ +- fprintf (FILE, ".LC%d_%X:\n", ~LABELNO, s390_pool_count); \ +- } \ ++ fprintf (FILE, ".LC%d:\n", LABELNO); \ + \ + /* Output the value of the constant itself. */ \ + switch (GET_MODE_CLASS (pool->mode)) \ +diff -urN ../gcc-2.95-2.95.4.ds13/src-native/gcc/config/s390/s390.md src-native/gcc/config/s390/s390.md +--- ../gcc-2.95-2.95.4.ds13/src-native/gcc/config/s390/s390.md Tue Jul 2 11:57:58 2002 ++++ src-native/gcc/config/s390/s390.md Tue Jul 2 11:54:50 2002 +@@ -77,50 +77,21 @@ + (define_attr "type" "set,xset,la" (const_string "xset")) + + ; +-; Set operations changing a target register, which could be used for +-; address generation. Adjust cost will check, if realy applicable. ++; Dummy function unit. We only care for the cycle count. ++; Everthing else is done by ADJUST_COST. + ; + + (define_function_unit "memory" 1 0 +- (and (eq_attr "type" "set") +- (eq_attr "cycle" "1")) +- 5 1 [(eq_attr "atype" "mem")] ) ++ (eq_attr "cycle" "1") 1 1) + + (define_function_unit "memory" 1 0 +- (and (eq_attr "type" "set") +- (eq_attr "cycle" "2")) 5 2) ++ (eq_attr "cycle" "2") 2 2) + + (define_function_unit "memory" 1 0 +- (and (eq_attr "type" "set") +- (eq_attr "cycle" "3")) 5 3) ++ (eq_attr "cycle" "3") 3 3) + + (define_function_unit "memory" 1 0 +- (and (eq_attr "type" "set") +- (eq_attr "cycle" "n")) 5 4) +- +-(define_function_unit "memory" 1 0 +- (eq_attr "type" "la") 2 1) +- +-; +-; xset insns, which don't set any valid address register. +-; Only the issue delay matters. +-; +- +-(define_function_unit "memory" 1 0 +- (and (eq_attr "type" "xset") +- (eq_attr "cycle" "1")) 1 1) +- +-(define_function_unit "memory" 1 0 +- (and (eq_attr "type" "xset") +- (eq_attr "cycle" "2")) 1 2) +- +-(define_function_unit "memory" 1 0 +- (and (eq_attr "type" "xset") +- (eq_attr "cycle" "3")) 1 3) +- +-(define_function_unit "memory" 1 0 +- (and (eq_attr "type" "xset") +- (eq_attr "cycle" "n")) 1 4) ++ (eq_attr "cycle" "n") 4 4) + + ; Operand type. Used to default length attribute values + +@@ -256,7 +227,7 @@ + (match_operand:DI 1 "const1_operand" "") + (match_operand:DI 2 "immediate_operand" "I")) + (const_int 0)))] +- "s390_match_ccmode(insn, CCTmode) && ++ "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT && + INTVAL(operands[2]) >= 0 && INTVAL(operands[2]) < 64" + "* + { +@@ -282,12 +253,12 @@ + (set_attr "type" "xset")]) + + +-(define_insn "*cmpdi_tm" ++(define_insn "cmpdi_tm" + [(set (reg 33) + (compare (and:DI (match_operand:DI 0 "register_operand" "%d") + (match_operand:DI 1 "tmxx_operand" "Lm")) + (const_int 0)))] +- "s390_match_ccmode(insn, CCTmode)" ++ "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT" + "* + { + unsigned HOST_WIDEST_INT i; +@@ -387,7 +358,7 @@ + + (define_insn "*cmpsi_cct" + [(set (reg 33) +- (compare (zero_extract:SI (match_operand:SI 0 "register_operand" "%d") ++ (compare (zero_extract:SI (match_operand:SI 0 "register_operand" "d") + (match_operand:SI 1 "const1_operand" "") + (match_operand:SI 2 "immediate_operand" "I")) + (const_int 0)))] +@@ -406,7 +377,7 @@ + [(set_attr "op_type" "RI") + (set_attr "type" "xset")]) + +-(define_insn "*cmpsi_tm" ++(define_insn "cmpsi_tm" + [(set (reg 33) + (compare (and:SI (match_operand:SI 0 "register_operand" "%d") + (match_operand:SI 1 "tmxx_operand" "Lm")) +@@ -672,7 +643,7 @@ + (match_operand:DF 1 "const0_operand" "")))] + "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "ltdbr\\t%0,%0" +- [(set_attr "op_type" "RRE") ++ [(set_attr "op_type" "RR") + (set_attr "type" "set")]) + + (define_insn "*cmpdf_ccs_0_ibm" +@@ -692,7 +663,7 @@ + "@ + cdbr\\t%0,%1 + cdb\\t%0,%1" +- [(set_attr "op_type" "RRE,RXE") ++ [(set_attr "op_type" "RR,RX") + (set_attr "atype" "reg,mem") + (set_attr "type" "xset,xset")]) + +@@ -717,7 +688,7 @@ + (match_operand:SF 1 "const0_operand" "")))] + "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "ltebr\\t%0,%0" +- [(set_attr "op_type" "RRE") ++ [(set_attr "op_type" "RR") + (set_attr "type" "set")]) + + (define_insn "*cmpsf_ccs_0_ibm" +@@ -737,7 +708,7 @@ + "@ + cebr\\t%0,%1 + ceb\\t%0,%1" +- [(set_attr "op_type" "RRE,RXE") ++ [(set_attr "op_type" "RR,RX") + (set_attr "atype" "reg,mem") + (set_attr "type" "xset,xset")]) + +@@ -900,6 +871,19 @@ + + if (flag_pic && SYMBOLIC_CONST (operands[1])) + emit_pic_move (operands, SImode); ++ ++ /* expr.c tries to load an effective address using ++ force_reg. This fails because we don't have a ++ generic load_address pattern. Convert the move ++ to a proper arithmetic operation instead, unless ++ it is guaranteed to be OK. */ ++ if (GET_CODE (operands[1]) == PLUS ++ && !legitimate_la_operand_p (operands[1])) ++ { ++ operands[1] = force_operand (operands[1], operands[0]); ++ if (operands[1] == operands[0]) ++ DONE; ++ } + }") + + (define_insn "*movsi" +@@ -1377,7 +1361,7 @@ + operands[1] = change_address (operands[1], VOIDmode, addr1); + operands[2] = GEN_INT (INTVAL (operands[2]) - 1); + +- emit_insn (gen_movstrsico (operands[0], operands[1], operands[2])); ++ emit_insn (gen_movstrdi_short (operands[0], operands[1], operands[2])); + DONE; + } + else +@@ -1394,33 +1378,42 @@ + + /* Load up the address+length pairs. */ + +- emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 0), addr0); +- emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 1), len); ++ emit_move_insn (gen_highpart (DImode, reg0), addr0); ++ emit_move_insn (gen_lowpart (DImode, reg0), len); + +- emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 0), addr1); +- emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 1), len); ++ emit_move_insn (gen_highpart (DImode, reg1), addr1); ++ emit_move_insn (gen_lowpart (DImode, reg1), len); + + /* MOVE */ +- emit_insn (gen_movstrdi_64 (reg0, reg1)); ++ emit_insn (gen_movstrdi_64 (reg0, reg1, reg0, reg1)); + DONE; + } + else + { +- rtx label = gen_label_rtx (); +- rtx reg0, reg1, len; ++ rtx label1 = gen_label_rtx (); ++ rtx label2 = gen_label_rtx (); ++ rtx reg0, reg1, len, blocks; + + reg0 = gen_reg_rtx (DImode); + reg1 = gen_reg_rtx (DImode); + len = gen_reg_rtx (DImode); ++ blocks = gen_reg_rtx (DImode); + + emit_move_insn (len, operands[2]); + emit_insn (gen_cmpdi (len, const0_rtx)); +- emit_jump_insn (gen_beq (label)); ++ emit_jump_insn (gen_beq (label1)); + emit_move_insn (reg0, addr0); + emit_move_insn (reg1, addr1); + emit_insn (gen_adddi3 (len, len, constm1_rtx)); +- emit_insn (gen_movstrdix_64 (reg0, reg1, len)); +- emit_label (label); ++ emit_insn (gen_ashrdi3 (blocks, len, GEN_INT (8))); ++ emit_insn (gen_cmpdi (blocks, const0_rtx)); ++ emit_jump_insn (gen_beq (label2)); ++ emit_insn (gen_movstrdi_long (reg0, reg1, reg0, reg1, blocks, blocks)); ++ emit_label (label2); ++ operands[0] = change_address (operands[0], VOIDmode, reg0); ++ operands[1] = change_address (operands[1], VOIDmode, reg1); ++ emit_insn (gen_movstrdi_short (operands[0], operands[1], len)); ++ emit_label (label1); + DONE; + } + } +@@ -1435,7 +1428,7 @@ + (match_operand:BLK 1 "general_operand" "")) + (use (match_operand:SI 2 "general_operand" "")) + (match_operand 3 "" "")] +- "" ++ "!TARGET_64BIT" + " + { + rtx addr0 = force_operand (XEXP (operands[0], 0), NULL_RTX); +@@ -1447,14 +1440,11 @@ + operands[1] = change_address (operands[1], VOIDmode, addr1); + operands[2] = GEN_INT (INTVAL (operands[2]) - 1); + +- emit_insn (gen_movstrsico (operands[0], operands[1], operands[2])); ++ emit_insn (gen_movstrsi_short (operands[0], operands[1], operands[2])); + DONE; + } + else + { +- if (TARGET_64BIT) +- FAIL; +- + if (TARGET_MVCLE) + { + /* implementation suggested by Richard Henderson */ +@@ -1468,149 +1458,187 @@ + + /* Load up the address+length pairs. */ + +- emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 0), addr0); +- emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 1), len); ++ emit_move_insn (gen_highpart (SImode, reg0), addr0); ++ emit_move_insn (gen_lowpart (SImode, reg0), len); + +- emit_move_insn (gen_rtx_SUBREG (SImode, reg1, 0), addr1); +- emit_move_insn (gen_rtx_SUBREG (SImode, reg1, 1), len); ++ emit_move_insn (gen_highpart (SImode, reg1), addr1); ++ emit_move_insn (gen_lowpart (SImode, reg1), len); + + /* MOVE */ +- emit_insn (gen_movstrsi_31 (reg0, reg1)); ++ emit_insn (gen_movstrsi_31 (reg0, reg1, reg0, reg1)); + DONE; + } + else + { +- rtx label = gen_label_rtx (); +- rtx reg0, reg1, len; ++ rtx label1 = gen_label_rtx (); ++ rtx label2 = gen_label_rtx (); ++ rtx reg0, reg1, len, blocks; + + reg0 = gen_reg_rtx (SImode); + reg1 = gen_reg_rtx (SImode); + len = gen_reg_rtx (SImode); ++ blocks = gen_reg_rtx (SImode); + + emit_move_insn (len, operands[2]); + emit_insn (gen_cmpsi (len, const0_rtx)); +- emit_jump_insn (gen_beq (label)); ++ emit_jump_insn (gen_beq (label1)); + emit_move_insn (reg0, addr0); + emit_move_insn (reg1, addr1); + emit_insn (gen_addsi3 (len, len, constm1_rtx)); +- emit_insn (gen_movstrsix_31 (reg0, reg1, len)); +- emit_label (label); ++ emit_insn (gen_ashrsi3 (blocks, len, GEN_INT (8))); ++ emit_insn (gen_cmpsi (blocks, const0_rtx)); ++ emit_jump_insn (gen_beq (label2)); ++ emit_insn (gen_movstrsi_long (reg0, reg1, reg0, reg1, blocks, blocks)); ++ emit_label (label2); ++ operands[0] = change_address (operands[0], VOIDmode, reg0); ++ operands[1] = change_address (operands[1], VOIDmode, reg1); ++ emit_insn (gen_movstrsi_short (operands[0], operands[1], len)); ++ emit_label (label1); + DONE; + } + } + }") + +-; Move a block that is less than 256 bytes in length. ++; Move a block that is up to 256 bytes in length. ++; The block length is taken as (operands[2] % 256) + 1. + +-(define_insn "movstrsico" +- [(set (match_operand:BLK 0 "s_operand" "=oQ") +- (match_operand:BLK 1 "s_operand" "oQ")) +- (use (match_operand 2 "const_int_operand" "I"))] +- "((unsigned) INTVAL (operands[2]) < 256)" +- "mvc\\t%O0(%c2+1,%R0),%1" +- [(set_attr "op_type" "SS") +- (set_attr "atype" "mem")]) ++(define_insn "movstrdi_short" ++ [(set (match_operand:BLK 0 "s_operand" "=oQ,oQ") ++ (match_operand:BLK 1 "s_operand" "oQ,oQ")) ++ (use (match_operand:DI 2 "nonmemory_operand" "n,a")) ++ (clobber (match_scratch:DI 3 "=X,&a"))] ++ "TARGET_64BIT" ++ "* ++{ ++ switch (which_alternative) ++ { ++ case 0: ++ return \"mvc\\t%O0(%b2+1,%R0),%1\"; + +-; Move a block that is more than 256 bytes in lenght or length in register ++ case 1: ++ output_asm_insn (\"bras\\t%3,.+10\", operands); ++ output_asm_insn (\"mvc\\t%O0(1,%R0),%1\", operands); ++ return \"ex\\t%2,0(%3)\"; + +-(define_insn "movstrdix_64" +- [(set (mem:BLK (match_operand:DI 0 "register_operand" "a")) +- (mem:BLK (match_operand:DI 1 "register_operand" "a"))) +- (use (match_operand:DI 2 "register_operand" "a")) +- (clobber (match_dup 0)) +- (clobber (match_dup 1)) +- (clobber (match_scratch:DI 3 "=&a")) +- (clobber (reg:CC 33))] +- "" ++ default: ++ abort (); ++ } ++}" ++ [(set_attr "op_type" "SS,NN") ++ (set_attr "atype" "mem,mem") ++ (set_attr "length" "*,14")]) ++ ++(define_insn "movstrsi_short" ++ [(set (match_operand:BLK 0 "s_operand" "=oQ,oQ") ++ (match_operand:BLK 1 "s_operand" "oQ,oQ")) ++ (use (match_operand:SI 2 "nonmemory_operand" "n,a")) ++ (clobber (match_scratch:SI 3 "=X,&a"))] ++ "!TARGET_64BIT" + "* + { +- rtx xop[4]; +- xop[0] = gen_label_rtx (); +- xop[1] = gen_label_rtx (); +- xop[2] = gen_label_rtx (); +- xop[3] = operands[3]; +- output_asm_insn (\"srag\\t%3,%2,8\",operands); +- output_asm_insn (\"jz\\t%l1\",xop); +- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", +- CODE_LABEL_NUMBER (xop[0])); +- output_asm_insn (\"mvc\\t0(256,%0),0(%1)\",operands); +- output_asm_insn (\"la\\t%0,256(%0)\",operands); +- output_asm_insn (\"la\\t%1,256(%1)\",operands); +- xop[3] = operands[3]; +- output_asm_insn (\"brct\\t%3,%l0\",xop); +- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", +- CODE_LABEL_NUMBER (xop[1])); +- xop[3] = operands[3]; +- output_asm_insn (\"bras\\t%3,%l2\",xop); +- output_asm_insn (\"mvc\\t0(1,%0),0(%1)\",operands); +- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", +- CODE_LABEL_NUMBER (xop[2])); +- return \"ex\\t%2,0(%3)\"; ++ switch (which_alternative) ++ { ++ case 0: ++ return \"mvc\\t%O0(%b2+1,%R0),%1\"; ++ ++ case 1: ++ output_asm_insn (\"bras\\t%3,.+10\", operands); ++ output_asm_insn (\"mvc\\t%O0(1,%R0),%1\", operands); ++ return \"ex\\t%2,0(%3)\"; ++ ++ default: ++ abort (); ++ } ++}" ++ [(set_attr "op_type" "SS,NN") ++ (set_attr "atype" "mem,mem") ++ (set_attr "length" "*,14")]) ++ ++; Move a block that is a multiple of 256 bytes in length ++ ++(define_insn "movstrdi_long" ++ [(set (match_operand:DI 4 "register_operand" "=d") ++ (const_int 0)) ++ (set (match_operand:DI 0 "register_operand" "=a") ++ (plus:DI (unspec:DI [(match_operand:DI 2 "register_operand" "0")] 101) ++ (ashift:DI (match_operand:DI 5 "register_operand" "4") ++ (const_int 8)))) ++ (set (match_operand:DI 1 "register_operand" "=a") ++ (plus:DI (unspec:DI [(match_operand:DI 3 "register_operand" "1")] 101) ++ (ashift:DI (match_dup 5) (const_int 8)))) ++ (set (mem:BLK (match_dup 2)) ++ (mem:BLK (match_dup 3))) ++ (use (match_dup 5))] ++ "TARGET_64BIT" ++ "* ++{ ++ output_asm_insn (\"mvc\\t0(256,%0),0(%1)\", operands); ++ output_asm_insn (\"la\\t%0,256(%0)\", operands); ++ output_asm_insn (\"la\\t%1,256(%1)\", operands); ++ return \"brct\\t%4,.-14\"; + }" + [(set_attr "op_type" "NN") + (set_attr "atype" "mem") +- (set_attr "length" "44")]) ++ (set_attr "length" "18")]) + +-(define_insn "movstrsix_31" +- [(set (mem:BLK (match_operand:SI 0 "register_operand" "a")) +- (mem:BLK (match_operand:SI 1 "register_operand" "a"))) +- (use (match_operand:SI 2 "register_operand" "a")) +- (clobber (match_dup 0)) +- (clobber (match_dup 1)) +- (clobber (match_scratch:SI 3 "=&a")) +- (clobber (reg:CC 33))] +- "" ++(define_insn "movstrsi_long" ++ [(set (match_operand:SI 4 "register_operand" "=d") ++ (const_int 0)) ++ (set (match_operand:SI 0 "register_operand" "=a") ++ (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "0")] 101) ++ (ashift:SI (match_operand:SI 5 "register_operand" "4") ++ (const_int 8)))) ++ (set (match_operand:SI 1 "register_operand" "=a") ++ (plus:SI (unspec:SI [(match_operand:SI 3 "register_operand" "1")] 101) ++ (ashift:SI (match_dup 5) (const_int 8)))) ++ (set (mem:BLK (match_dup 2)) ++ (mem:BLK (match_dup 3))) ++ (use (match_dup 5))] ++ "!TARGET_64BIT" + "* + { +- rtx xop[4]; +- xop[0] = gen_label_rtx (); +- xop[1] = gen_label_rtx (); +- xop[2] = gen_label_rtx (); +- xop[3] = operands[3]; +- output_asm_insn (\"lr\\t%3,%2\",operands); +- output_asm_insn (\"sra\\t%3,8\",operands); +- output_asm_insn (\"jz\\t%l1\",xop); +- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", +- CODE_LABEL_NUMBER (xop[0])); +- output_asm_insn (\"mvc\\t0(256,%0),0(%1)\",operands); +- output_asm_insn (\"la\\t%0,256(%0)\",operands); +- output_asm_insn (\"la\\t%1,256(%1)\",operands); +- xop[3] = operands[3]; +- output_asm_insn (\"brct\\t%3,%l0\",xop); +- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", +- CODE_LABEL_NUMBER (xop[1])); +- xop[3] = operands[3]; +- output_asm_insn (\"bras\\t%3,%l2\",xop); +- output_asm_insn (\"mvc\\t0(1,%0),0(%1)\",operands); +- ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", +- CODE_LABEL_NUMBER (xop[2])); +- return \"ex\\t%2,0(%3)\"; ++ output_asm_insn (\"mvc\\t0(256,%0),0(%1)\", operands); ++ output_asm_insn (\"la\\t%0,256(%0)\", operands); ++ output_asm_insn (\"la\\t%1,256(%1)\", operands); ++ return \"brct\\t%4,.-14\"; + }" +- [(set_attr "op_type" "NN") +- (set_attr "length" "42") +- (set_attr "atype" "mem")]) ++ [(set_attr "op_type" "NN") ++ (set_attr "atype" "mem") ++ (set_attr "length" "18")]) + + ; Move a block that is larger than 255 bytes in length. + + (define_insn "movstrdi_64" +- [(set (mem:BLK (subreg:DI (match_operand:TI 0 "register_operand" "d") 0)) +- (mem:BLK (subreg:DI (match_operand:TI 1 "register_operand" "d") 0))) +- (clobber (match_dup 0)) +- (clobber (match_dup 1)) ++ [(set (match_operand:TI 0 "register_operand" "=d") ++ (ashift:TI (plus:TI (match_operand:TI 2 "register_operand" "0") ++ (lshiftrt:TI (match_dup 2) (const_int 64))) ++ (const_int 64))) ++ (set (match_operand:TI 1 "register_operand" "=d") ++ (ashift:TI (plus:TI (match_operand:TI 3 "register_operand" "1") ++ (lshiftrt:TI (match_dup 3) (const_int 64))) ++ (const_int 64))) ++ (set (mem:BLK (subreg:DI (match_dup 2) 0)) ++ (mem:BLK (subreg:DI (match_dup 3) 0))) + (clobber (reg:CC 33))] +- "" ++ "TARGET_64BIT" + "mvcle\\t%0,%1,0\;jo\\t.-4" + [(set_attr "op_type" "NN") + (set_attr "atype" "mem") + (set_attr "length" "8")]) + + (define_insn "movstrsi_31" +- [(set (mem:BLK (subreg:SI (match_operand:DI 0 "register_operand" "d") 0)) +- (mem:BLK (subreg:SI (match_operand:DI 1 "register_operand" "d") 0))) +- (clobber (match_dup 0)) +- (clobber (match_dup 1)) ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (ashift:DI (plus:DI (match_operand:DI 2 "register_operand" "0") ++ (lshiftrt:DI (match_dup 2) (const_int 32))) ++ (const_int 32))) ++ (set (match_operand:DI 1 "register_operand" "=d") ++ (ashift:DI (plus:DI (match_operand:DI 3 "register_operand" "1") ++ (lshiftrt:DI (match_dup 3) (const_int 32))) ++ (const_int 32))) ++ (set (mem:BLK (subreg:SI (match_dup 2) 0)) ++ (mem:BLK (subreg:SI (match_dup 3) 0))) + (clobber (reg:CC 33))] +- "" ++ "!TARGET_64BIT" + "mvcle\\t%0,%1,0\;jo\\t.-4" + [(set_attr "op_type" "NN") + (set_attr "atype" "mem") +@@ -1648,13 +1676,13 @@ + + /* Load up the address+length pairs. */ + +- emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 0), addr); +- emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 1), len); ++ emit_move_insn (gen_highpart (DImode, reg0), addr); ++ emit_move_insn (gen_lowpart (DImode, reg0), len); + +- emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 1), const0_rtx); ++ emit_move_insn (gen_lowpart (DImode, reg1), const0_rtx); + + /* Clear! */ +- emit_insn (gen_clrstrsi_64 (reg0, reg1)); ++ emit_insn (gen_clrstrsi_64 (reg0, reg1, reg0)); + DONE; + } + }") +@@ -1691,13 +1719,13 @@ + + /* Load up the address+length pairs. */ + +- emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 0), addr); +- emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 1), len); ++ emit_move_insn (gen_highpart (SImode, reg0), addr); ++ emit_move_insn (gen_lowpart (SImode, reg0), len); + +- emit_move_insn (gen_rtx_SUBREG (SImode, reg1, 1), const0_rtx); ++ emit_move_insn (gen_lowpart (SImode, reg1), const0_rtx); + + /* CLear! */ +- emit_insn (gen_clrstrsi_31 (reg0, reg1)); ++ emit_insn (gen_clrstrsi_31 (reg0, reg1, reg0)); + DONE; + } + }") +@@ -1712,16 +1740,19 @@ + "" + "xc\\t%O0(%1,%R0),%0" + [(set_attr "op_type" "RS") ++ (set_attr "cycle" "n") + (set_attr "atype" "mem")]) + + ; Clear memory with length greater 256 bytes or lenght not constant + + (define_insn "clrstrsi_64" +- [(set (mem:BLK (subreg:DI (match_operand:TI 0 "register_operand" "d") 0)) ++ [(set (match_operand:TI 0 "register_operand" "=d") ++ (ashift:TI (plus:TI (match_operand:TI 2 "register_operand" "0") ++ (lshiftrt:TI (match_dup 2) (const_int 64))) ++ (const_int 64))) ++ (set (mem:BLK (subreg:DI (match_dup 2) 0)) + (const_int 0)) + (use (match_operand:TI 1 "register_operand" "d")) +- (clobber (match_dup 0)) +- (clobber (match_dup 1)) + (clobber (reg:CC 33))] + "TARGET_64BIT" + "mvcle\\t%0,%1,0\;jo\\t.-4" +@@ -1731,11 +1762,13 @@ + (set_attr "length" "8")]) + + (define_insn "clrstrsi_31" +- [(set (mem:BLK (subreg:SI (match_operand:DI 0 "register_operand" "d") 0)) ++ [(set (match_operand:DI 0 "register_operand" "=d") ++ (ashift:DI (plus:DI (match_operand:DI 2 "register_operand" "0") ++ (lshiftrt:DI (match_dup 2) (const_int 32))) ++ (const_int 32))) ++ (set (mem:BLK (subreg:SI (match_dup 2) 0)) + (const_int 0)) + (use (match_operand:DI 1 "register_operand" "d")) +- (clobber (match_dup 0)) +- (clobber (match_dup 1)) + (clobber (reg:CC 33))] + "!TARGET_64BIT" + "mvcle\\t%0,%1,0\;jo\\t.-4" +@@ -1792,14 +1825,14 @@ + len = force_reg (DImode, len); + + /* Load up the address+length pairs. */ +- emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 0), addr0); +- emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 1), len); ++ emit_move_insn (gen_highpart (DImode, reg0), addr0); ++ emit_move_insn (gen_lowpart (DImode, reg0), len); + +- emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 0), addr1); +- emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 1), len); ++ emit_move_insn (gen_highpart (DImode, reg1), addr1); ++ emit_move_insn (gen_lowpart (DImode, reg1), len); + + /* Compare! */ +- emit_insn (gen_cmpstr_64 (reg0, reg1)); ++ emit_insn (gen_cmpstr_64 (reg0, reg1, reg0, reg1)); + emit_insn (gen_cmpint_di (operands[0])); + DONE; + } +@@ -1863,17 +1896,17 @@ + len = force_reg (Pmode, len); + + /* Load up the address+length pairs. */ +- emit_move_insn (gen_rtx_SUBREG (Pmode, reg0, 0), addr0); +- emit_move_insn (gen_rtx_SUBREG (Pmode, reg0, 1), len); ++ emit_move_insn (gen_highpart (Pmode, reg0), addr0); ++ emit_move_insn (gen_lowpart (Pmode, reg0), len); + +- emit_move_insn (gen_rtx_SUBREG (Pmode, reg1, 0), addr1); +- emit_move_insn (gen_rtx_SUBREG (Pmode, reg1, 1), len); ++ emit_move_insn (gen_highpart (Pmode, reg1), addr1); ++ emit_move_insn (gen_lowpart (Pmode, reg1), len); + + /* Compare! */ + if (TARGET_64BIT) +- emit_insn (gen_cmpstr_64 (reg0, reg1)); ++ emit_insn (gen_cmpstr_64 (reg0, reg1, reg0, reg1)); + else +- emit_insn (gen_cmpstr_31 (reg0, reg1)); ++ emit_insn (gen_cmpstr_31 (reg0, reg1, reg0, reg1)); + + emit_insn (gen_cmpint_si (operands[0])); + DONE; +@@ -1883,8 +1916,8 @@ + ; Compare a block that is less than 256 bytes in length. + + (define_insn "cmpstr_const" +- [(set (reg:CCU 33) +- (compare:CCU (match_operand:BLK 0 "s_operand" "oQ") ++ [(set (reg:CCS 33) ++ (compare:CCS (match_operand:BLK 0 "s_operand" "oQ") + (match_operand:BLK 1 "s_operand" "oQ"))) + (use (match_operand 2 "immediate_operand" "I"))] + "(unsigned) INTVAL (operands[2]) < 256" +@@ -1896,13 +1929,11 @@ + ; Compare a block that is larger than 255 bytes in length. + + (define_insn "cmpstr_64" +- [(set (reg:CCU 33) +- (compare:CCU (mem:BLK (subreg:DI (match_operand:TI 0 "register_operand" "d") 0)) +- (mem:BLK (subreg:DI (match_operand:TI 1 "register_operand" "d") 0)))) +- (clobber (subreg:DI (match_dup 0) 0)) +- (clobber (subreg:DI (match_dup 0) 1)) +- (clobber (subreg:DI (match_dup 1) 0)) +- (clobber (subreg:DI (match_dup 1) 1))] ++ [(clobber (match_operand:TI 0 "register_operand" "=d")) ++ (clobber (match_operand:TI 1 "register_operand" "=d")) ++ (set (reg:CCS 33) ++ (compare:CCS (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0)) ++ (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0))))] + "TARGET_64BIT" + "clcl\\t%0,%1" + [(set_attr "op_type" "RR") +@@ -1910,13 +1941,11 @@ + (set_attr "type" "xset")]) + + (define_insn "cmpstr_31" +- [(set (reg:CCU 33) +- (compare:CCU (mem:BLK (subreg:SI (match_operand:DI 0 "register_operand" "d") 0)) +- (mem:BLK (subreg:SI (match_operand:DI 1 "register_operand" "d") 0)))) +- (clobber (subreg:SI (match_dup 0) 0)) +- (clobber (subreg:SI (match_dup 0) 1)) +- (clobber (subreg:SI (match_dup 1) 0)) +- (clobber (subreg:SI (match_dup 1) 1))] ++ [(clobber (match_operand:DI 0 "register_operand" "=d")) ++ (clobber (match_operand:DI 1 "register_operand" "=d")) ++ (set (reg:CCS 33) ++ (compare:CCS (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0)) ++ (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0))))] + "!TARGET_64BIT" + "clcl\\t%0,%1" + [(set_attr "op_type" "RR") +@@ -1927,7 +1956,7 @@ + + (define_insn "cmpint_si" + [(set (match_operand:SI 0 "register_operand" "=d") +- (compare:SI (reg:CCU 33) (const_int 0)))] ++ (compare:SI (reg:CCS 33) (const_int 0)))] + "" + "* + { +@@ -1944,7 +1973,7 @@ + + (define_insn "cmpint_di" + [(set (match_operand:DI 0 "register_operand" "=d") +- (compare:DI (reg:CCU 33) (const_int 0)))] ++ (compare:DI (reg:CCS 33) (const_int 0)))] + "TARGET_64BIT" + "* + { +@@ -2748,7 +2777,7 @@ + (float_truncate:SF (match_operand:DF 1 "nonimmediate_operand" "f")))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "ledbr\\t%0,%1" +- [(set_attr "op_type" "RRE")]) ++ [(set_attr "op_type" "RR")]) + + (define_insn "truncdfsf2_ibm" + [(set (match_operand:SF 0 "register_operand" "=f,f") +@@ -2973,35 +3002,6 @@ + (set_attr "atype" "mem") + (set_attr "type" "la")]) + +-(define_insn "*addaddr_picR" +- [(set (match_operand:SI 0 "register_operand" "=d") +- (plus:SI (match_operand:SI 1 "register_operand" "a") +- (unspec:SI [(match_operand:SI 2 "register_operand" "a")] 101)))] +- "" +- "la\\t%0,0(%1,%2)" +- [(set_attr "op_type" "RX") +- (set_attr "atype" "mem") +- (set_attr "type" "la")]) +- +-(define_insn "*addaddr_picL" +- [(set (match_operand:SI 0 "register_operand" "=d") +- (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "a")] 101) +- (match_operand:SI 1 "register_operand" "a")))] +- "" +- "la\\t%0,0(%1,%2)" +- [(set_attr "op_type" "RX") +- (set_attr "atype" "mem") +- (set_attr "type" "la")]) +- +-(define_insn "*addaddr_picN" +- [(set (match_operand:SI 0 "register_operand" "=d") +- (unspec:SI [(match_operand:SI 1 "register_operand" "a")] 101))] +- "" +- "la\\t%0,0(%1)" +- [(set_attr "op_type" "RX") +- (set_attr "atype" "mem") +- (set_attr "type" "la")]) +- + (define_insn "addsi3" + [(set (match_operand:SI 0 "register_operand" "=d,d,d") + (plus:SI (match_operand:SI 1 "register_operand" "%0,0,0") +@@ -3016,10 +3016,11 @@ + (set_attr "atype" "reg,reg,mem") + (set_attr "type" "set")]) + +-(define_insn "do_la" ++(define_insn "*do_la" + [(set (match_operand:SI 0 "register_operand" "=a") + (match_operand:QI 1 "address_operand" "p"))] +- "volatile_ok" ++ "reload_in_progress || reload_completed ++ || legitimate_la_operand_p (operands[1])" + "la\\t%0,%a1" + [(set_attr "op_type" "RX") + (set_attr "atype" "mem") +@@ -3029,7 +3030,7 @@ + [(set (match_operand:SI 0 "register_operand" "=d") + (plus:SI (match_operand:SI 1 "register_operand" "%0") + (match_operand:SI 2 "register_operand" "d")))] +- "" ++ "reload_in_progress || reload_completed" + "brxle\\t%0,%2,.+4" + [(set_attr "op_type" "RSI") + (set_attr "atype" "reg") +@@ -3135,7 +3136,7 @@ + "@ + adbr\\t%0,%2 + adb\\t%0,%2" +- [(set_attr "op_type" "RRE,RXE") ++ [(set_attr "op_type" "RR,RX") + (set_attr "atype" "reg,mem")]) + + (define_insn "*adddf3_ibm" +@@ -3172,7 +3173,7 @@ + "@ + aebr\\t%0,%2 + aeb\\t%0,%2" +- [(set_attr "op_type" "RRE,RXE") ++ [(set_attr "op_type" "RR,RX") + (set_attr "atype" "reg,mem")]) + + (define_insn "*addsf3" +@@ -3305,7 +3306,7 @@ + "@ + sdbr\\t%0,%2 + sdb\\t%0,%2" +- [(set_attr "op_type" "RRE,RXE") ++ [(set_attr "op_type" "RR,RX") + (set_attr "atype" "reg,mem")]) + + (define_insn "*subdf3_ibm" +@@ -3342,7 +3343,7 @@ + "@ + sebr\\t%0,%2 + seb\\t%0,%2" +- [(set_attr "op_type" "RRE,RXE") ++ [(set_attr "op_type" "RR,RX") + (set_attr "atype" "reg,mem")]) + + (define_insn "*subsf3_ibm" +@@ -3481,7 +3482,7 @@ + "@ + mdbr\\t%0,%2 + mdb\\t%0,%2" +- [(set_attr "op_type" "RRE,RXE") ++ [(set_attr "op_type" "RR,RX") + (set_attr "cycle" "n") + (set_attr "atype" "reg,mem")]) + +@@ -3520,7 +3521,7 @@ + "@ + meebr\\t%0,%2 + meeb\\t%0,%2" +- [(set_attr "op_type" "RRE,RXE") ++ [(set_attr "op_type" "RR,RX") + (set_attr "cycle" "n") + (set_attr "atype" "reg,mem")]) + +@@ -3883,7 +3884,7 @@ + "@ + ddbr\\t%0,%2 + ddb\\t%0,%2" +- [(set_attr "op_type" "RRE,RXE") ++ [(set_attr "op_type" "RR,RX") + (set_attr "cycle" "n") + (set_attr "atype" "reg,mem")]) + +@@ -3922,7 +3923,7 @@ + "@ + debr\\t%0,%2 + deb\\t%0,%2" +- [(set_attr "op_type" "RRE,RXE") ++ [(set_attr "op_type" "RR,RX") + (set_attr "cycle" "n") + (set_attr "atype" "reg,mem")]) + +@@ -4364,7 +4365,7 @@ + (clobber (reg:CC 33))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "lcdbr\\t%0,%1" +- [(set_attr "op_type" "RRE")]) ++ [(set_attr "op_type" "RR")]) + + (define_insn "*negdf2_ibm" + [(set (match_operand:DF 0 "register_operand" "=f") +@@ -4392,7 +4393,7 @@ + (clobber (reg:CC 33))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "lcebr\\t%0,%1" +- [(set_attr "op_type" "RRE")]) ++ [(set_attr "op_type" "RR")]) + + (define_insn "*negsf2" + [(set (match_operand:SF 0 "register_operand" "=f") +@@ -4465,7 +4466,7 @@ + (clobber (reg:CC 33))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "lpdbr\\t%0,%1" +- [(set_attr "op_type" "RRE")]) ++ [(set_attr "op_type" "RR")]) + + (define_insn "*absdf2_ibm" + [(set (match_operand:DF 0 "register_operand" "=f") +@@ -4493,7 +4494,7 @@ + (clobber (reg:CC 33))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "lpebr\\t%0,%1" +- [(set_attr "op_type" "RRE")]) ++ [(set_attr "op_type" "RR")]) + + (define_insn "*abssf2_ibm" + [(set (match_operand:SF 0 "register_operand" "=f") +@@ -4970,9 +4971,13 @@ + (const_int 4) + (ne (symbol_ref "TARGET_64BIT") (const_int 0)) + (const_int 6) ++ (ne (symbol_ref "s390_pool_overflow") (const_int 0)) ++ (if_then_else (eq (symbol_ref "flag_pic") (const_int 0)) ++ (const_int 12) (const_int 14)) + (eq (symbol_ref "flag_pic") (const_int 0)) + (const_int 6)] (const_int 8)))]) + ++ + (define_insn "*cjump_long" + [(set (pc) + (if_then_else +@@ -5005,7 +5010,7 @@ + (label_ref (match_operand 0 "" ""))))] + "" + "* +-{ ++{ + if (get_attr_length (insn) == 4) + return \"j%D1\\t%l0\"; + else if (TARGET_64BIT) +@@ -5019,6 +5024,9 @@ + (const_int 4) + (ne (symbol_ref "TARGET_64BIT") (const_int 0)) + (const_int 6) ++ (ne (symbol_ref "s390_pool_overflow") (const_int 0)) ++ (if_then_else (eq (symbol_ref "flag_pic") (const_int 0)) ++ (const_int 12) (const_int 14)) + (eq (symbol_ref "flag_pic") (const_int 0)) + (const_int 6)] (const_int 8)))]) + +@@ -5650,34 +5659,132 @@ + ; Special literal pool access instruction pattern(s). + ; + +-(define_insn "reload_base" +- [(parallel [(set (reg 13) (pc)) +- (use (label_ref (match_operand 0 "" "")))])] ++(define_insn "consttable_qi" ++ [(unspec_volatile [(match_operand:QI 0 "consttable_operand" "X")] 200)] + "" + "* + { +- if (TARGET_64BIT) +- return \"larl\\t13,%y0\"; +- else +- return \"basr\\t13,0\;ahi\\t13,%Y0\"; ++ assemble_integer (operands[0], 1, 1); ++ return \"\"; + }" +- [(set_attr "op_type" "NN") +- (set_attr "cycle" "2") +- (set_attr "length" "8")]) ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "1")]) + +-(define_insn "ltorg" +- [(parallel [(set (reg 13) (pc)) +- (use (match_operand:SI 0 "const_int_operand" ""))])] ++(define_insn "consttable_hi" ++ [(unspec_volatile [(match_operand:HI 0 "consttable_operand" "X")] 201)] + "" + "* + { +- s390_dump_literal_pool (insn, operands[0]); +- return \"0:\"; ++ assemble_integer (operands[0], 2, 1); ++ return \"\"; + }" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "2")]) ++ ++(define_insn "consttable_si" ++ [(unspec_volatile [(match_operand:SI 0 "consttable_operand" "X")] 202)] ++ "" ++ "* ++{ ++ if (!TARGET_64BIT && flag_pic && SYMBOLIC_CONST (operands[0])) ++ return \".long\\t%0\"; ++ ++ assemble_integer (operands[0], 4, 1); ++ return \"\"; ++}" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "4")]) ++ ++(define_insn "consttable_di" ++ [(unspec_volatile [(match_operand:DI 0 "consttable_operand" "X")] 203)] ++ "" ++ "* ++{ ++ assemble_integer (operands[0], 8, 1); ++ return \"\"; ++}" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "8")]) ++ ++(define_insn "consttable_sf" ++ [(unspec_volatile [(match_operand:SF 0 "consttable_operand" "X")] 204)] ++ "" ++ "* ++{ ++ REAL_VALUE_TYPE r; ++ ++ if (GET_CODE (operands[0]) != CONST_DOUBLE) ++ abort (); ++ ++ REAL_VALUE_FROM_CONST_DOUBLE (r, operands[0]); ++ assemble_real (r, SFmode); ++ return \"\"; ++}" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "4")]) ++ ++(define_insn "consttable_df" ++ [(unspec_volatile [(match_operand:DF 0 "consttable_operand" "X")] 205)] ++ "" ++ "* ++{ ++ REAL_VALUE_TYPE r; ++ ++ if (GET_CODE (operands[0]) != CONST_DOUBLE) ++ abort (); ++ ++ REAL_VALUE_FROM_CONST_DOUBLE (r, operands[0]); ++ assemble_real (r, DFmode); ++ return \"\"; ++}" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "8")]) ++ ++(define_insn "pool_start_31" ++ [(unspec_volatile [(const_int 0)] 206)] ++ "!TARGET_64BIT" ++ ".align\\t4" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "2")]) ++ ++(define_insn "pool_end_31" ++ [(unspec_volatile [(const_int 0)] 207)] ++ "!TARGET_64BIT" ++ ".align\\t2" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "2")]) ++ ++(define_insn "pool_start_64" ++ [(unspec_volatile [(const_int 0)] 206)] ++ "TARGET_64BIT" ++ ".section\\t.rodata\;.align\\t8" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "0")]) ++ ++(define_insn "pool_end_64" ++ [(unspec_volatile [(const_int 0)] 207)] ++ "TARGET_64BIT" ++ ".previous" ++ [(set_attr "op_type" "NN") ++ (set_attr "length" "0")]) ++ ++(define_insn "reload_base" ++ [(set (match_operand:SI 0 "register_operand" "=a") ++ (unspec:SI [(label_ref (match_operand 1 "" ""))] 210))] ++ "!TARGET_64BIT" ++ "basr\\t%0,0\;la\\t%0,%1-.(%0)" + [(set_attr "op_type" "NN") +- (set_attr "cycle" "n") +- (set_attr "length" "4096")]) ++ (set_attr "type" "la") ++ (set_attr "length" "6")]) + ++(define_insn "reload_base2" ++ [(set (match_operand:SI 0 "register_operand" "=a") ++ (unspec:SI [(label_ref (match_operand 1 "" ""))] 211))] ++ "!TARGET_64BIT" ++ "la\\t%0,%1-.(%0)" ++ [(set_attr "op_type" "NN") ++ (set_attr "type" "la") ++ (set_attr "length" "4")]) + + ;; + ;; Peephole optimization patterns. +diff -urN ../gcc-2.95-2.95.4.ds13/src-native/gcc/configure src-native/gcc/configure +--- ../gcc-2.95-2.95.4.ds13/src-native/gcc/configure Tue Jul 2 11:57:58 2002 ++++ src-native/gcc/configure Tue Jul 2 11:47:13 2002 +@@ -5889,7 +5889,7 @@ + if test x$enable_haifa = x + then + case $target in +- alpha*-* | hppa*-* | powerpc*-* | rs6000-* | *sparc*-* | m32r*-*) ++ alpha*-* | hppa*-* | powerpc*-* | rs6000-* | s390*-* | *sparc*-* | m32r*-*) + enable_haifa=yes;; + esac + fi +diff -urN ../gcc-2.95-2.95.4.ds13/src-native/gcc/configure.in src-native/gcc/configure.in +--- ../gcc-2.95-2.95.4.ds13/src-native/gcc/configure.in Tue Jul 2 11:57:58 2002 ++++ src-native/gcc/configure.in Tue Jul 2 11:47:13 2002 +@@ -3585,7 +3585,7 @@ + if test x$enable_haifa = x + then + case $target in +- alpha*-* | hppa*-* | powerpc*-* | rs6000-* | *sparc*-* | m32r*-*) ++ alpha*-* | hppa*-* | powerpc*-* | rs6000-* | s390*-* | *sparc*-* | m32r*-*) + enable_haifa=yes;; + esac + fi +diff -urN ../gcc-2.95-2.95.4.ds13/src-native/gcc/cse.c src-native/gcc/cse.c +--- ../gcc-2.95-2.95.4.ds13/src-native/gcc/cse.c Tue Jul 2 11:57:56 2002 ++++ src-native/gcc/cse.c Tue Jul 2 11:47:04 2002 +@@ -6578,8 +6578,16 @@ + } + else if (GET_CODE (x) == CLOBBER) + { +- if (GET_CODE (XEXP (x, 0)) == MEM) +- canon_reg (XEXP (x, 0), NULL_RTX); ++ rtx clobbered = XEXP (x, 0); ++ ++ if (GET_CODE (clobbered) == MEM) ++ canon_reg (clobbered, NULL_RTX); ++ else if (GET_CODE (clobbered) == REG ++ || GET_CODE (clobbered) == SUBREG) ++ invalidate (clobbered, VOIDmode); ++ else if (GET_CODE (clobbered) == STRICT_LOW_PART ++ || GET_CODE (clobbered) == ZERO_EXTRACT) ++ invalidate (XEXP (clobbered, 0), GET_MODE (clobbered)); + } + + /* Canonicalize a USE of a pseudo register or memory location. */ +diff -urN ../gcc-2.95-2.95.4.ds13/src-native/gcc/dbxout.c src-native/gcc/dbxout.c +--- ../gcc-2.95-2.95.4.ds13/src-native/gcc/dbxout.c Sun Apr 18 13:09:24 1999 ++++ src-native/gcc/dbxout.c Tue Jul 2 11:47:13 2002 +@@ -1994,6 +1994,15 @@ + alter_subreg (home); + } + ++ /* Similarly, if a variable was optimized completely ++ into a constant from the constant pool, do not ++ mention it. */ ++ if (GET_CODE (home) == MEM ++ && GET_CODE (XEXP (home, 0)) == SYMBOL_REF ++ && CONSTANT_POOL_ADDRESS_P (XEXP (home, 0))) ++ return; ++ ++ + /* The kind-of-variable letter depends on where + the variable is and on the scope of its name: + G and N_GSYM for static storage and global scope, +diff -urN ../gcc-2.95-2.95.4.ds13/src-native/gcc/f/com.h src-native/gcc/f/com.h +--- ../gcc-2.95-2.95.4.ds13/src-native/gcc/f/com.h Sat Apr 17 10:58:25 1999 ++++ src-native/gcc/f/com.h Tue Jul 2 11:47:04 2002 +@@ -127,7 +127,7 @@ + #define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2) + #endif + +-#if LONG_TYPE_SIZE == FLOAT_TYPE_SIZE ++#if (LONG_TYPE_SIZE == MAX_LONG_TYPE_SIZE) && (LONG_TYPE_SIZE == FLOAT_TYPE_SIZE) + # define FFECOM_f2cINTEGER FFECOM_f2ccodeLONG + # define FFECOM_f2cLOGICAL FFECOM_f2ccodeLONG + #elif INT_TYPE_SIZE == FLOAT_TYPE_SIZE +@@ -137,7 +137,7 @@ + # error Cannot find a suitable type for FFECOM_f2cINTEGER + #endif + +-#if LONG_TYPE_SIZE == (FLOAT_TYPE_SIZE * 2) ++#if (LONG_TYPE_SIZE == MAX_LOG_TYPE_SIZE) && (LONG_TYPE_SIZE == (FLOAT_TYPE_SIZE * 2)) + # define FFECOM_f2cLONGINT FFECOM_f2ccodeLONG + #elif LONG_LONG_TYPE_SIZE == (FLOAT_TYPE_SIZE * 2) + # define FFECOM_f2cLONGINT FFECOM_f2ccodeLONGLONG +diff -urN ../gcc-2.95-2.95.4.ds13/src-native/gcc/final.c src-native/gcc/final.c +--- ../gcc-2.95-2.95.4.ds13/src-native/gcc/final.c Sat Mar 31 04:32:45 2001 ++++ src-native/gcc/final.c Tue Jul 2 11:54:50 2002 +@@ -628,7 +628,7 @@ + int *insn_addresses; + + /* Max uid for which the above arrays are valid. */ +-static int insn_lengths_max_uid; ++int insn_lengths_max_uid; + + /* Address of insn being processed. Used by `insn_current_length'. */ + int insn_current_address; +diff -urN ../gcc-2.95-2.95.4.ds13/src-native/gcc/loop.c src-native/gcc/loop.c +--- ../gcc-2.95-2.95.4.ds13/src-native/gcc/loop.c Tue Jul 2 11:57:56 2002 ++++ src-native/gcc/loop.c Tue Jul 2 11:47:18 2002 +@@ -4100,7 +4100,8 @@ + } + + /* Now, can we transform this biv into a giv? */ +- if (bl2 ++ /* Disabled because it breaks on non-cc0 targets ... */ ++ if (0 && bl2 + && bl2->biv_count == 1 + && rtx_equal_p (increment, + biv_total_increment (bl2, loop_start, loop_end)) +diff -urN ../gcc-2.95-2.95.4.ds13/src-native/gcc/regmove.c src-native/gcc/regmove.c +--- ../gcc-2.95-2.95.4.ds13/src-native/gcc/regmove.c Wed Jun 20 04:34:00 2001 ++++ src-native/gcc/regmove.c Tue Jul 2 11:47:13 2002 +@@ -704,6 +704,13 @@ + if (MEM_VOLATILE_P (SET_SRC (set))) + return; + ++ /* If there is a REG_EQUIV note in the the insn, the replacement ++ is not valid, since the register maybe in an other mode than ++ the memory location. */ ++ ++ if (find_reg_note (p, REG_EQUIV, 0)) ++ return; ++ + /* Do not use a SUBREG to truncate from one mode to another if truncation + is not a nop. */ + if (GET_MODE_BITSIZE (GET_MODE (src_reg)) <= GET_MODE_BITSIZE (GET_MODE (src)) --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gpc-update9.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gpc-update9.dpatch @@ -0,0 +1,178 @@ +#! /bin/sh -e + +dir= +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3/gcc" + dir="$3/" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p1 < $0 + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p1 < $0 + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +From: Waldek Hebisch +To: Frank Heckenbach +Cc: doko@cs.tu-berlin.de +Subject: Re: Debian patches +Date: Mon, 1 Mar 2004 05:10:14 +0100 (CET) + +> Waldek, do you have a complete collection handy? Otherwise, I'll +> collect them from our mails (and show you so you can check if +> I'm missing anything). + +AFAIKS the recent Debian tarballs have 7 backend patches. They +miss a patch that eliminated CEIL_MOD_EXPR (crucial for sets on +m68k, but masked otherwise). + +One of the patches (empty set <> [0]) is for regression introduced in 3.3. +The others probably will help 2.95.3 -- but I never tried. Also +the following front end patches which I posted on the mailing list may +be considered (sorry for #if 0 in the patch -- I run testsute as-is +and ATM I am too busy to re-check them). + + The first one fixes a spurious error message in +Extended Pascal mode. However I feel that we should do the checks +differently... + +# DP: - Fix a spurious error message in Extended Pascal mode. + +diff -ru tt/gpc-20030830.pp/p/types.c gpc-20030830/p/types.c +--- tt/gpc-20030830.pp/p/types.c Wed Aug 13 06:32:06 2003 ++++ gpc-20030830/p/types.c Fri Feb 6 05:33:44 2004 +@@ -859,9 +859,13 @@ + if (TREE_CODE (type) != ARRAY_TYPE || TREE_CODE (TREE_TYPE (type)) != CHAR_TYPE) + return 0; + +- if (error_flag && !PASCAL_TYPE_PACKED (type)) +- chk_dialect ("using unpacked character arrays as strings is", B_D_PASCAL); +- ++ if (!PASCAL_TYPE_PACKED (type)) ++ { ++ if (error_flag) ++ chk_dialect ("using unpacked character arrays as strings is", B_D_PASCAL); ++ if (co->pascal_dialect & C_E_O_PASCAL) ++ return 0; ++ } + /* String type low index must be one and nonvarying according to ISO */ + if (tree_int_cst_equal (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), integer_one_node)) + return 1; + +The second handles (hopefully correctly) access to packed fields: +# DP: - Correctly handle access to packed fields + +diff -rbu gpc-20030830.orig/p/expressions.c gpc-20030830/p/expressions.c +--- gpc-20030830.orig/p/expressions.c Wed Aug 13 06:29:55 2003 ++++ gpc-20030830/p/expressions.c Tue Feb 10 02:50:52 2004 +@@ -2754,7 +2754,7 @@ + int noconvert; + { + /* No default_conversion here. It causes trouble for ADDR_EXPR. */ +- tree arg = xarg, addr, argtype = 0, t; ++ tree arg = xarg, addr, argtype = 0; + enum tree_code typecode = TREE_CODE (TREE_TYPE (arg)); + const char *errstring = NULL; + +@@ -2851,13 +2851,14 @@ + if (TREE_CODE (arg) == ARRAY_REF) + { + tree index, array = TREE_OPERAND (arg, 0); +- ++#if 0 + tree t = array; + if (noconvert) + /* Don't let mark_addressable do this, it would complain about packed fields */ + while (TREE_CODE (t) == COMPONENT_REF) + t = TREE_OPERAND (t, 0); +- if (!mark_addressable (t)) ++#endif ++ if (!mark_addressable2 (array, noconvert)) + return error_mark_node; + + if (!noconvert && PASCAL_TYPE_PACKED (TREE_TYPE (TREE_OPERAND (arg, 0)))) +@@ -2925,13 +2926,14 @@ + argtype = c_build_type_variant (argtype, TREE_READONLY (arg), TREE_THIS_VOLATILE (arg)); + + argtype = build_pointer_type (argtype); +- ++#if 0 + t = arg; + if (noconvert) + /* Don't let mark_addressable do this, it would complain about packed fields */ + while (TREE_CODE (t) == COMPONENT_REF) + t = TREE_OPERAND (t, 0); +- if (!mark_addressable (t)) ++#endif ++ if (!mark_addressable2 (arg, noconvert)) + return error_mark_node; + + if (TREE_CODE (arg) == BIT_FIELD_REF && PASCAL_TYPE_PACKED (TREE_TYPE (TREE_OPERAND (arg, 0)))) +diff -rbu gpc-20030830.orig/p/gpc.h gpc-20030830/p/gpc.h +--- gpc-20030830.orig/p/gpc.h Sun Sep 14 01:16:10 2003 ++++ gpc-20030830/p/gpc.h Tue Feb 10 01:59:29 2004 +@@ -1189,6 +1189,9 @@ + extern int lvalue_p PARAMS ((tree)); + #ifdef GCC_3_3 + extern bool mark_addressable PARAMS ((tree)); ++extern bool mark_addressable2 PARAMS ((tree, int)); ++#else ++extern int mark_addressable2 PARAMS ((tree, int)); + #endif + #ifndef EGCS + extern int mark_addressable PARAMS ((tree)); +diff -rbu gpc-20030830.orig/p/typecheck.c gpc-20030830/p/typecheck.c +--- gpc-20030830.orig/p/typecheck.c Wed Aug 13 06:27:31 2003 ++++ gpc-20030830/p/typecheck.c Tue Feb 10 01:59:38 2004 +@@ -2167,12 +2167,24 @@ + mark_addressable (exp) + tree exp; + { ++ return mark_addressable2 (exp, 0); ++} ++ ++#ifdef GCC_3_3 ++bool ++#else ++int ++#endif ++mark_addressable2 (exp, allow_packed) ++ tree exp; ++ int allow_packed; ++{ + tree x = exp; + while (1) + switch (TREE_CODE (x)) + { + case COMPONENT_REF: +- if (DECL_PACKED_FIELD (TREE_OPERAND (x, 1))) ++ if ((DECL_PACKED_FIELD (TREE_OPERAND (x, 1))) && !allow_packed) + { + error ("cannot take address of packed record field `%s'", + IDENTIFIER_NAME (DECL_NAME (TREE_OPERAND (x, 1)))); +diff -rbu gpc-20030830.orig/p/types.c gpc-20030830/p/types.c +--- gpc-20030830.orig/p/types.c Wed Aug 13 06:32:06 2003 ++++ gpc-20030830/p/types.c Tue Feb 10 01:59:52 2004 +@@ -2283,7 +2288,7 @@ + /* Don't let mark_addressable do this, it would complain about packed fields */ + while (TREE_CODE (t) == COMPONENT_REF) + t = TREE_OPERAND (t, 0); +- if (!mark_addressable (t)) ++ if (!mark_addressable2 (t, 1)) + return error_mark_node; + } + + + +-- + Waldek Hebisch +hebisch@math.uni.wroc.pl --- gcc-2.95-2.95.4.ds15.orig/debian/patches/reporting.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/reporting.dpatch @@ -0,0 +1,30 @@ +#! /bin/sh -e + +# DP: --help gives hint to /usr/share/doc/debian/bug-reporting.txt + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- gcc/gcc.c~ Sun Feb 20 15:36:56 2000 ++++ gcc/gcc.c Sun Feb 20 15:40:30 2000 +@@ -5350,6 +5350,8 @@ + { + printf ("\nFor bug reporting instructions, please see:\n"); + printf ("%s.\n", GCCBUGURL); ++ printf ("For Debian GNU/Linux specific bugs,\n"); ++ printf ("please see /usr/share/doc/debian/bug-reporting.txt.\n"); + + return (0); + } --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-weaksym.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-weaksym.dpatch @@ -0,0 +1,81 @@ +#! /bin/sh -e + +# DP: Franz Sirl's weak sym patch to make glibc buildable again + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- gcc/rtl.h 2001/01/25 14:03:22 1.105.4.3 ++++ gcc/rtl.h 2001/03/13 01:03:58 +@@ -168,7 +168,8 @@ typedef struct rtx_def + either changing how we compute the frame address or saving and + restoring registers in the prologue and epilogue. + 1 in a MEM if the MEM refers to a scalar, rather than a member of +- an aggregate. */ ++ an aggregate. ++ 1 in a SYMBOL_REF if the symbol is weak. */ + unsigned frame_related : 1; + /* The first element of the operands of this rtx. + The number of operands and their types are controlled +@@ -661,6 +662,9 @@ extern char *note_insn_name[]; + /* 1 means a SYMBOL_REF has been the library function in emit_library_call. */ + #define SYMBOL_REF_USED(RTX) ((RTX)->used) + ++/* 1 means a SYMBOL_REF is weak. */ ++#define SYMBOL_REF_WEAK(RTX) ((RTX)->frame_related) ++ + /* For an INLINE_HEADER rtx, FIRST_FUNCTION_INSN is the first insn + of the function that is not involved in copying parameters to + pseudo-registers. FIRST_PARM_INSN is the very first insn of +--- gcc/rtlanal.c 2001/01/25 14:03:22 1.36.4.2 ++++ gcc/rtlanal.c 2001/03/13 01:04:00 +@@ -136,11 +136,9 @@ rtx_addr_can_trap_p (x) + switch (code) + { + case SYMBOL_REF: ++ return SYMBOL_REF_WEAK (x); ++ + case LABEL_REF: +- /* SYMBOL_REF is problematic due to the possible presence of +- a #pragma weak, but to say that loads from symbols can trap is +- *very* costly. It's not at all clear what's best here. For +- now, we ignore the impact of #pragma weak. */ + return 0; + + case REG: +--- gcc/varasm.c 2001/01/25 14:03:24 1.59.4.6 ++++ gcc/varasm.c 2001/03/13 01:04:04 +@@ -723,6 +723,8 @@ make_decl_rtl (decl, asmspec, top_level) + Also handle vars declared register invalidly. */ + if (DECL_RTL (decl) == 0) + { ++ rtx x; ++ + /* Can't use just the variable's own name for a variable + whose scope is less than the whole file. + Concatenate a distinguishing number. */ +@@ -752,8 +754,10 @@ make_decl_rtl (decl, asmspec, top_level) + new_name, strlen (new_name)); + } + +- DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl), +- gen_rtx_SYMBOL_REF (Pmode, name)); ++ x = gen_rtx_SYMBOL_REF (Pmode, name); ++ SYMBOL_REF_WEAK (x) = DECL_WEAK (decl); ++ DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl), x); ++ + MEM_ALIAS_SET (DECL_RTL (decl)) = get_alias_set (decl); + + /* If this variable is to be treated as volatile, show its --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-core-2.95.2-avr-1.1.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-core-2.95.2-avr-1.1.dpatch @@ -0,0 +1,13221 @@ +#! /bin/sh -e + +# DP: Some fixes for ARM from Philip Blundell +# DP: put together by Hakan Ardo + +src=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + src=$3/gcc +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p1 --fuzz 10 < $0 + cd $src && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p1 --fuzz 10 < $0 + cd $src && autoconf + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +diff -Nrc3p gcc-2.95.2.orig/gcc/config/avr/avr.c gcc-2.95.2/gcc/config/avr/avr.c +*** gcc-2.95.2.orig/gcc/config/avr/avr.c Sat Dec 18 17:50:16 1999 +--- gcc-2.95.2/gcc/config/avr/avr.c Tue Dec 21 13:37:39 1999 +*************** +*** 0 **** +--- 1,4147 ---- ++ /* Subroutines for insn-output.c for ATMEL AVR micro controllers ++ Copyright (C) 1998, 1999 by Denis Chertykov (denisc@overta.ru) ++ ++ You can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ */ ++ ++ #ifndef FILE ++ # include ++ #endif ++ #include "config.h" ++ #include ++ #include ++ #include "rtl.h" ++ #include "regs.h" ++ #include "hard-reg-set.h" ++ #include "real.h" ++ #include "insn-config.h" ++ #include "conditions.h" ++ #include "insn-flags.h" ++ #include "output.h" ++ #include "insn-attr.h" ++ #include "flags.h" ++ #include "reload.h" ++ #include "tree.h" ++ #include "expr.h" ++ #include "toplev.h" ++ #include "obstack.h" ++ ++ ++ static int avr_naked_function_p PROTO ((tree)); ++ ++ /* Used for generate various comparison insn's */ ++ struct rtx_def *avr_compare_op0, *avr_compare_op1; ++ struct rtx_def * (*avr_compare_gen)(); ++ ++ /* Temporary register RTX (gen_rtx (REG,QImode,TMP_REGNO)) */ ++ rtx tmp_reg_rtx; ++ /* Zeroed register RTX (gen_rtx (REG,QImode,ZERO_REGNO)) */ ++ rtx zero_reg_rtx; ++ ++ /* AVR register names {"r0", "r1", ..., "r31"} */ ++ char * avr_regnames[] = REGISTER_NAMES; ++ ++ /* Flag: needed for the Uros Platise `ava' assembler syntax */ ++ int make_it_public; ++ ++ /* This holds the last insn address. */ ++ static int last_insn_address = 0; ++ ++ /* Commands in compiled file */ ++ static int commands_in_file; ++ /* Commands in the functions prologues in the compiled file */ ++ static int commands_in_prologues; ++ /* Commands in the functions epilogues in the compiled file */ ++ static int commands_in_epilogues; ++ ++ /* Prologue/Epilogue size in words */ ++ static int prologue_size; ++ static int epilogue_size; ++ ++ /* Ininial stack value specified by the `-minit-stack=' option */ ++ const char *avr_ram_end = NULL; ++ static const char *initial_stack; /* numeric representation */ ++ ++ const char *avr_mcu_name = "at90s8515"; ++ ++ struct mcu_type_s *avr_mcu_type; ++ ++ static struct mcu_type_s mcu_types[] = ++ {{"at90s2313","AT90S2313", 224-1, 0}, ++ {"at90s2323","AT90S2323", 224-1, 0}, ++ {"at90s2333","AT90S2333", 224-1, 0}, ++ {"attiny22", "ATtiny22", 224-1, 0}, ++ {"at90s2343","AT90S2343", 224-1, 0}, ++ {"at90s4433","AT90S4433", 224-1, 0}, ++ {"at90s4414","AT90S4414", 0x15f, 0}, ++ {"at90s4434","AT90S4434", 0x15f, 0}, ++ {"at90s8515","AT90S8515", 0x25f, 0}, ++ {"at90s8535","AT90S8535", 0x25f, 0}, ++ {"atmega603","ATmega603", 0x0fff,1}, /* XXX */ ++ {"atmega103","ATmega103", 0x0fff,1}, /* XXX */ ++ {NULL,0,0}}; ++ ++ void ++ avr_override_options () ++ { ++ for (avr_mcu_type = mcu_types; avr_mcu_type->name; ++avr_mcu_type) ++ if (strcmp (avr_mcu_type->name, avr_mcu_name) == 0) ++ break; ++ if (!avr_mcu_type->name) ++ { ++ int i; ++ fprintf (stderr, ++ "Wrong mcu `%s' specified\n" ++ "Allowed mcu's:\n", avr_mcu_name); ++ for (i = 0; mcu_types[i].name; ++i) ++ fprintf (stderr," %s\n", mcu_types[i].name); ++ fatal (""); ++ } ++ /* flag_function_sections=1; */ /* always add `removable' to segment decl */ ++ } ++ ++ /* Initialize all variables */ ++ void ++ avr_init_once () ++ { ++ tmp_reg_rtx = gen_rtx (REG,QImode,TMP_REGNO); ++ zero_reg_rtx = gen_rtx (REG,QImode,ZERO_REGNO); ++ } ++ ++ /* return register class from register number */ ++ static int reg_class_tab[]={ ++ GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS, ++ GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS, ++ GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS, ++ GENERAL_REGS, /* r0 - r15 */ ++ LD_REGS,LD_REGS,LD_REGS,LD_REGS,LD_REGS,LD_REGS,LD_REGS, ++ LD_REGS, /* r16 - 23 */ ++ ADDW_REGS,ADDW_REGS, /* r24,r25 */ ++ POINTER_X_REGS,POINTER_X_REGS, /* r26,27 */ ++ POINTER_Y_REGS,POINTER_Y_REGS, /* r28,r29 */ ++ POINTER_Z_REGS,POINTER_Z_REGS, /* r30,r31 */ ++ STACK_REG,STACK_REG /* SPL,SPH */ ++ }; ++ ++ /* Return register class for register R */ ++ enum reg_class ++ avr_regno_reg_class (r) ++ int r; ++ { ++ if (r <= 33) ++ return reg_class_tab[r]; ++ return ALL_REGS; ++ } ++ ++ ++ /* ++ A C expression which defines the machine-dependent operand ++ constraint letters for register classes. If CHAR is such a ++ letter, the value should be the register class corresponding to ++ it. Otherwise, the value should be `NO_REGS'. The register ++ letter `r', corresponding to class `GENERAL_REGS', will not be ++ passed to this macro; you do not need to handle it. ++ */ ++ enum reg_class ++ avr_reg_class_from_letter (c) ++ int c; ++ { ++ switch (c) ++ { ++ case 't' : return R0_REG; ++ case 'b' : return BASE_POINTER_REGS; ++ case 'e' : return POINTER_REGS; ++ case 'w' : return ADDW_REGS; ++ case 'd' : return LD_REGS; ++ case 'l' : return NO_LD_REGS; ++ case 'a' : return SIMPLE_LD_REGS; ++ case 'x' : return POINTER_X_REGS; ++ case 'y' : return POINTER_Y_REGS; ++ case 'z' : return POINTER_Z_REGS; ++ case 'q' : return STACK_REG; ++ default: break; ++ } ++ return NO_REGS; ++ } ++ ++ /* Return non-zero if FUNC is a naked function. */ ++ ++ static int ++ avr_naked_function_p (func) ++ tree func; ++ { ++ tree a; ++ ++ if (TREE_CODE (func) != FUNCTION_DECL) ++ abort (); ++ ++ a = lookup_attribute ("naked", DECL_MACHINE_ATTRIBUTES (func)); ++ return a != NULL_TREE; ++ } ++ ++ /* Return nonzero if FUNC is an interrupt function as specified ++ by the "interrupt" attribute. ++ */ ++ static int ++ interrupt_function_p (func) ++ tree func; ++ { ++ tree a; ++ ++ if (TREE_CODE (func) != FUNCTION_DECL) ++ return 0; ++ ++ a = lookup_attribute ("interrupt", DECL_MACHINE_ATTRIBUTES (func)); ++ return a != NULL_TREE; ++ } ++ ++ /* Return nonzero if FUNC is an signal function as specified ++ by the "signal" attribute. ++ */ ++ static int ++ signal_function_p (func) ++ tree func; ++ { ++ tree a; ++ ++ if (TREE_CODE (func) != FUNCTION_DECL) ++ return 0; ++ ++ a = lookup_attribute ("signal", DECL_MACHINE_ATTRIBUTES (func)); ++ return a != NULL_TREE; ++ } ++ ++ /* Compute offset from arg_pointer and frame_pointer */ ++ int ++ initial_elimination_offset (from,to) ++ int from,to; ++ { ++ int reg; ++ int interrupt_func_p = interrupt_function_p (current_function_decl); ++ int signal_func_p = signal_function_p (current_function_decl); ++ int leaf_func_p = leaf_function_p (); ++ int main_p = ! strcmp ("main", current_function_name); ++ int offset= frame_pointer_needed ? 2 : 0; ++ ++ for (reg = 0; reg < 32; ++reg) ++ { ++ if ((!leaf_func_p && (call_used_regs[reg] ++ && (interrupt_func_p || signal_func_p))) ++ || ++ (regs_ever_live[reg] ++ && (!call_used_regs[reg] || interrupt_func_p || signal_func_p) ++ && ! (frame_pointer_needed ++ && (reg == REG_Y || reg == (REG_Y+1))))) ++ { ++ ++offset; ++ } ++ } ++ return get_frame_size () + 2 + 1 + offset; ++ } ++ ++ /* This function checks sequence of live registers */ ++ ++ static int ++ sequent_regs_live () ++ { ++ int reg; ++ int live_seq=0; ++ int cur_seq=0; ++ ++ for (reg = 0; reg < 18; ++reg) ++ { ++ if (!call_used_regs[reg]) ++ { ++ if (regs_ever_live[reg]) ++ { ++ ++live_seq; ++ ++cur_seq; ++ } ++ else ++ cur_seq = 0; ++ } ++ } ++ ++ if (!frame_pointer_needed) ++ { ++ if (regs_ever_live[REG_Y]) ++ { ++ ++live_seq; ++ ++cur_seq; ++ } ++ else ++ cur_seq = 0; ++ ++ if (regs_ever_live[REG_Y+1]) ++ { ++ ++live_seq; ++ ++cur_seq; ++ } ++ else ++ cur_seq = 0; ++ } ++ else ++ { ++ cur_seq += 2; ++ live_seq += 2; ++ } ++ return (cur_seq == live_seq) ? live_seq : 0; ++ } ++ ++ ++ /* Output function prologue */ ++ void ++ function_prologue (FILE *file, int size) ++ { ++ int reg; ++ int interrupt_func_p; ++ int signal_func_p; ++ int leaf_func_p; ++ int main_p; ++ int live_seq; ++ int minimize; ++ ++ if (avr_naked_function_p (current_function_decl)) ++ { ++ fprintf (file, "/* prologue: naked */\n"); ++ return; ++ } ++ ++ interrupt_func_p = interrupt_function_p (current_function_decl); ++ signal_func_p = signal_function_p (current_function_decl); ++ leaf_func_p = leaf_function_p (); ++ main_p = ! strcmp ("main", current_function_name); ++ live_seq = sequent_regs_live (); ++ minimize = (TARGET_CALL_PROLOGUES ++ && !interrupt_func_p && !signal_func_p && live_seq); ++ ++ last_insn_address = 0; ++ prologue_size = 0; ++ fprintf (file, "/* prologue: frame size=%d */\n", size); ++ ++ if (interrupt_func_p) ++ { ++ fprintf (file,"\tsei\n"); ++ ++prologue_size; ++ } ++ if (interrupt_func_p | signal_func_p) ++ { ++ fprintf (file, "\t" ++ AS1 (push,__zero_reg__) CR_TAB ++ AS1 (push,__tmp_reg__) CR_TAB ++ AS2 (in,__tmp_reg__,__SREG__) CR_TAB ++ AS1 (push,__tmp_reg__) CR_TAB ++ AS1 (clr,__zero_reg__) "\n"); ++ prologue_size += 5; ++ } ++ if (main_p) ++ { ++ char stack_str[300]; ++ sprintf (stack_str, ++ "%s - %d", ++ TARGET_INCLUDE ? "__INIT_STACK" : initial_stack, ++ size); ++ ++ fprintf (file, ("\t" ++ AS2 (ldi, r28, lo8(%s)) CR_TAB ++ AS2 (ldi, r29, hi8(%s)) CR_TAB ++ AS2 (out,__SP_L__,r28) CR_TAB ++ AS2 (out,__SP_H__,r29) "\n"), stack_str, stack_str); ++ prologue_size += 4; ++ } ++ else if (minimize && (frame_pointer_needed || live_seq > 6)) ++ { ++ char t[300]; ++ sprintf (t, AS_STR ("CcC_%s_body", ++ ".L_%s_body"), current_function_name); ++ fprintf (file, ("\t" ++ AS2 (ldi, r26, %d) CR_TAB ++ AS2 (ldi, r27, %d) CR_TAB) ++ , size & 0xff, size / 0x100); ++ fprintf (file, (AS2 (ldi, r30, pm_lo8(%s)) CR_TAB ++ AS2 (ldi, r31, pm_hi8(%s))CR_TAB) ++ ,t,t); ++ prologue_size += 4; ++ if (AVR_MEGA) ++ { ++ fprintf (file, AS1 (jmp,__prologue_saves__+%d) "\n", ++ (18 - live_seq) * 2); ++ prologue_size += 2; ++ } ++ else ++ { ++ fprintf (file, AS1 (rjmp,__prologue_saves__+%d) "\n", ++ (18 - live_seq) * 2); ++ ++prologue_size; ++ } ++ fprintf (file, "%s:\n", t); ++ } ++ else ++ { ++ for (reg = 0; reg < 32; ++reg) ++ { ++ if ((!leaf_func_p ++ && (call_used_regs[reg] ++ && (interrupt_func_p || signal_func_p) ++ && !(reg == TMP_REGNO || reg == ZERO_REGNO))) ++ || (regs_ever_live[reg] ++ && (!call_used_regs[reg] ++ || interrupt_func_p || signal_func_p) ++ && ! (frame_pointer_needed ++ && (reg == REG_Y || reg == (REG_Y+1))))) ++ { ++ fprintf (file, "\t" AS1 (push,%s) "\n", avr_regnames[reg]); ++ ++prologue_size; ++ } ++ } ++ if (frame_pointer_needed) ++ { ++ { ++ fprintf (file, "\t" ++ AS1 (push,r28) CR_TAB ++ AS1 (push,r29) CR_TAB ++ AS2 (in,r28,__SP_L__) CR_TAB ++ AS2 (in,r29,__SP_H__) "\n"); ++ prologue_size += 4; ++ if (size) ++ { ++ if (size > 63) ++ { ++ fprintf (file, ("\t" ++ AS2 (subi,r28,%d) CR_TAB ++ AS2 (sbci,r29,%d) CR_TAB) ++ , size & 0xff, size / 0x100); ++ prologue_size += 2; ++ } ++ else ++ { ++ fprintf (file, "\t" AS2 (sbiw,r28,%d) CR_TAB, size); ++ ++prologue_size; ++ } ++ if (interrupt_func_p) ++ { ++ fprintf (file, ++ "cli" CR_TAB ++ AS2 (out,__SP_L__,r28) CR_TAB ++ "sei" CR_TAB ++ AS2 (out,__SP_H__,r29) "\n"); ++ prologue_size += 4; ++ } ++ else if (signal_func_p || TARGET_NO_INTERRUPTS) ++ { ++ fprintf (file, ++ AS2 (out,__SP_L__,r28) CR_TAB ++ AS2 (out,__SP_H__,r29) "\n"); ++ prologue_size += 2; ++ } ++ else ++ { ++ fprintf (file, ++ AS2 (in,__tmp_reg__,__SREG__) CR_TAB ++ "cli" CR_TAB ++ AS2 (out,__SP_L__,r28) CR_TAB ++ AS2 (out,__SREG__,__tmp_reg__) CR_TAB ++ AS2 (out,__SP_H__,r29) "\n"); ++ prologue_size += 5; ++ } ++ } ++ } ++ } ++ } ++ fprintf (file, "/* prologue end (size=%d) */\n", prologue_size); ++ } ++ ++ /* Output function epilogue */ ++ void ++ function_epilogue (FILE *file, int size) ++ { ++ int reg; ++ int interrupt_func_p; ++ int signal_func_p; ++ int leaf_func_p; ++ int main_p; ++ int function_size; ++ int live_seq; ++ int minimize; ++ ++ if (avr_naked_function_p (current_function_decl)) ++ { ++ fprintf (file, "/* epilogue: naked */\n"); ++ return; ++ } ++ ++ interrupt_func_p = interrupt_function_p (current_function_decl); ++ signal_func_p = signal_function_p (current_function_decl); ++ leaf_func_p = leaf_function_p (); ++ main_p = ! strcmp ("main", current_function_name); ++ function_size = (insn_addresses[INSN_UID (get_last_insn ())] ++ - insn_addresses[INSN_UID (get_insns ())]); ++ live_seq = sequent_regs_live (); ++ minimize = (TARGET_CALL_PROLOGUES ++ && !interrupt_func_p && !signal_func_p && live_seq); ++ ++ epilogue_size = 0; ++ fprintf (file, "/* epilogue: frame size=%d */\n", size); ++ if (main_p) ++ { ++ fprintf (file, "__stop_progIi__:\n\trjmp __stop_progIi__\n"); ++ ++epilogue_size; ++ } ++ else if (minimize && (frame_pointer_needed || live_seq > 4)) ++ { ++ fprintf (file, ("\t" AS2 (ldi, r30, %d) CR_TAB), live_seq); ++ ++epilogue_size; ++ if (frame_pointer_needed) ++ { ++ if (size) ++ { ++ if (size > 63) ++ { ++ fprintf (file, AS2 (subi,r28,lo8(-%d)) CR_TAB, size); ++ fprintf (file, AS2 (sbci,r29,hi8(-%d)) CR_TAB, size); ++ epilogue_size += 2; ++ } ++ else ++ { ++ fprintf (file, AS2 (adiw,r28,%d) CR_TAB, size); ++ ++epilogue_size; ++ } ++ } ++ } ++ else ++ { ++ fprintf (file, (AS2 (in , r28, __SP_L__) CR_TAB ++ AS2 (in , r29, __SP_H__) CR_TAB)); ++ epilogue_size += 2; ++ } ++ ++ if (AVR_MEGA) ++ { ++ fprintf (file, AS1 (jmp,__epilogue_restores__+%d) "\n", ++ (18 - live_seq) * 2); ++ epilogue_size += 2; ++ } ++ else ++ { ++ fprintf (file, AS1 (rjmp,__epilogue_restores__+%d) "\n", ++ (18 - live_seq) * 2); ++ ++epilogue_size; ++ } ++ } ++ else ++ { ++ if (frame_pointer_needed) ++ { ++ if (size) ++ { ++ if (size > 63) ++ { ++ fprintf (file, "\t" AS2 (subi,r28,lo8(-%d)) CR_TAB, size); ++ fprintf (file, AS2 (sbci,r29,hi8(-%d)) CR_TAB, size); ++ epilogue_size += 2; ++ } ++ else ++ { ++ fprintf (file, "\t" AS2 (adiw,r28,%d) CR_TAB, size); ++ ++epilogue_size; ++ } ++ if (interrupt_func_p | signal_func_p) ++ { ++ fprintf (file, ++ "cli" CR_TAB ++ AS2 (out,__SP_L__,r28) CR_TAB ++ AS2 (out,__SP_H__,r29) "\n"); ++ epilogue_size += 3; ++ } ++ else if (TARGET_NO_INTERRUPTS) ++ { ++ fprintf (file, ++ AS2 (out,__SP_L__,r28) CR_TAB ++ AS2 (out,__SP_H__,r29) "\n"); ++ epilogue_size += 2; ++ } ++ else ++ { ++ fprintf (file, ++ AS2 (in,__tmp_reg__,__SREG__) CR_TAB ++ "cli" CR_TAB ++ AS2 (out,__SP_L__,r28) CR_TAB ++ AS2 (out,__SREG__,__tmp_reg__) CR_TAB ++ AS2 (out,__SP_H__,r29) "\n"); ++ epilogue_size += 5; ++ } ++ } ++ fprintf (file, "\t" ++ AS1 (pop,r29) CR_TAB ++ AS1 (pop,r28) "\n"); ++ epilogue_size += 2; ++ } ++ ++ for (reg = 31; reg >= 0; --reg) ++ { ++ if ((!leaf_func_p ++ && (call_used_regs[reg] ++ && (interrupt_func_p || signal_func_p) ++ && !(reg == TMP_REGNO || reg == ZERO_REGNO))) ++ || (regs_ever_live[reg] ++ && (!call_used_regs[reg] ++ || interrupt_func_p || signal_func_p) ++ && ! (frame_pointer_needed ++ && (reg == REG_Y || reg == (REG_Y+1))))) ++ { ++ fprintf (file, "\t" AS1 (pop,%s) "\n", avr_regnames[reg]); ++ ++epilogue_size; ++ } ++ } ++ ++ if (interrupt_func_p | signal_func_p) ++ { ++ fprintf (file, "\t" ++ AS1 (pop,__tmp_reg__) CR_TAB ++ AS2 (out,__SREG__,__tmp_reg__) CR_TAB ++ AS1 (pop,__tmp_reg__) CR_TAB ++ AS1 (pop,__zero_reg__) "\n"); ++ epilogue_size += 4; ++ fprintf (file, "\treti\n"); ++ } ++ else ++ fprintf (file, "\tret\n"); ++ ++epilogue_size; ++ } ++ ++ fprintf (file, "/* epilogue end (size=%d) */\n", epilogue_size); ++ fprintf (file, "/* function %s size %d (%d) */\n", current_function_name, ++ prologue_size + function_size + epilogue_size, function_size); ++ commands_in_file += prologue_size + function_size + epilogue_size; ++ commands_in_prologues += prologue_size; ++ commands_in_epilogues += epilogue_size; ++ } ++ ++ ++ /* ++ Return nonzero if X (an RTX) is a legitimate memory address on the target ++ machine for a memory operand of mode MODE. ++ */ ++ int ++ legitimate_address_p (mode, x, strict) ++ enum machine_mode mode; ++ rtx x; ++ int strict; ++ { ++ int r = 0; ++ if (TARGET_ALL_DEBUG) ++ { ++ fprintf (stderr, "mode: (%s) %s %s %s %s:", ++ GET_MODE_NAME(mode), ++ strict ? "(strict)": "", ++ reload_completed ? "(reload_completed)": "", ++ reload_in_progress ? "(reload_in_progress)": "", ++ reg_renumber ? "(reg_renumber)" : ""); ++ if (GET_CODE (x) == PLUS ++ && REG_P (XEXP (x, 0)) ++ && GET_CODE (XEXP (x, 1)) == CONST_INT ++ && INTVAL (XEXP (x, 1)) >= 0 ++ && INTVAL (XEXP (x, 1)) <= (64 - GET_MODE_SIZE (mode)) ++ && reg_renumber ++ ) ++ fprintf (stderr, "(r%d ---> r%d)", REGNO (XEXP (x, 0)), ++ true_regnum (XEXP (x, 0))); ++ debug_rtx (x); ++ } ++ if (REG_P (x) && (strict ? REG_OK_FOR_BASE_STRICT_P (x) ++ : REG_OK_FOR_BASE_NOSTRICT_P (x))) ++ r = 'R'; ++ else if (CONSTANT_ADDRESS_P (x)) ++ r = 'S'; ++ else if (GET_CODE (x) == PLUS ++ && REG_P (XEXP (x, 0)) ++ && GET_CODE (XEXP (x, 1)) == CONST_INT ++ && INTVAL (XEXP (x, 1)) >= 0 ++ ) ++ { ++ #if 0 ++ int fit = INTVAL (XEXP (x, 1)) <= (64 - GET_MODE_SIZE (mode)); ++ if (fit) ++ { ++ if (! strict ++ || REGNO (XEXP (x,0)) == REG_Y || REGNO (XEXP (x,0)) == REG_Z) ++ r = 'Q'; ++ } ++ else if ((reload_in_progress | reload_completed) ++ && frame_pointer_needed ++ && XEXP (x,0) == frame_pointer_rtx) ++ r = 'U'; ++ #else ++ int fit = INTVAL (XEXP (x, 1)) <= (64 - GET_MODE_SIZE (mode)); ++ if (fit) ++ { ++ if (! strict ++ || REGNO (XEXP (x,0)) == REG_Y || REGNO (XEXP (x,0)) == REG_Z) ++ r = 'Q'; ++ if (XEXP (x,0) == frame_pointer_rtx ++ || XEXP (x,0) == arg_pointer_rtx) ++ r = 'Q'; ++ } ++ else if (1/* (reload_in_progress | reload_completed) */ ++ && frame_pointer_needed ++ && XEXP (x,0) == frame_pointer_rtx) ++ r = 'U'; ++ #endif ++ } ++ else if ((GET_CODE (x) == PRE_DEC || GET_CODE (x) == POST_INC) ++ && REG_P (XEXP (x, 0)) ++ && (strict ? REG_OK_FOR_BASE_STRICT_P (XEXP (x, 0)) ++ : REG_OK_FOR_BASE_NOSTRICT_P (XEXP (x, 0)))) ++ { ++ r = 'T'; ++ } ++ if (TARGET_ALL_DEBUG) ++ { ++ fprintf (stderr, " ret = %c\n", r); ++ } ++ return r; ++ } ++ ++ /* ++ Attempts to replace X with a valid ++ memory address for an operand of mode MODE ++ */ ++ rtx ++ legitimize_address (x, oldx, mode) ++ rtx x; ++ rtx oldx; ++ enum machine_mode mode; ++ { ++ x = oldx; ++ if (TARGET_ALL_DEBUG) ++ { ++ fprintf (stderr, "legitimize_address mode: %s", GET_MODE_NAME(mode)); ++ debug_rtx (oldx); ++ } ++ ++ if (GET_CODE (oldx) == PLUS ++ && REG_P (XEXP (oldx,0))) ++ { ++ if (REG_P (XEXP (oldx,1))) ++ x = force_reg (GET_MODE (oldx), oldx); ++ else if (GET_CODE (XEXP (oldx, 1)) == CONST_INT) ++ { ++ int offs = INTVAL (XEXP (oldx,1)); ++ if (frame_pointer_rtx != XEXP (oldx,0)) ++ if (offs > 64 - GET_MODE_SIZE (mode)) ++ { ++ if (TARGET_ALL_DEBUG) ++ fprintf (stderr, "force_reg (big offset)\n"); ++ x = force_reg (GET_MODE (oldx), oldx); ++ } ++ } ++ } ++ return x; ++ } ++ ++ ++ /* Return a pointer register name as a string */ ++ static inline char * ++ ptrreg_to_str (int regno) ++ { ++ switch (regno) ++ { ++ case REG_X: return "X"; ++ case REG_Y: return "Y"; ++ case REG_Z: return "Z"; ++ default: ++ fatal ("Internal compiler bug: register r%d can't be pointer\n", regno); ++ } ++ return NULL; ++ } ++ ++ /* ++ Return the condition name as string. ++ Used in conditional jump constructing ++ */ ++ static char * ++ cond_string (code) ++ enum rtx_code code; ++ { ++ switch (code) ++ { ++ case NE: ++ return "ne"; ++ case EQ: ++ return "eq"; ++ case GE: ++ if (cc_prev_status.flags & CC_OVERFLOW_UNUSABLE) ++ return "pl"; ++ else ++ return "ge"; ++ case GT: ++ fatal ("Internal compiler bug: command `bgt'"); ++ case LE: ++ fatal ("Internal compiler bug: command `ble'"); ++ case LT: ++ if (cc_prev_status.flags & CC_OVERFLOW_UNUSABLE) ++ return "mi"; ++ else ++ return "lt"; ++ case GEU: ++ return "sh"; ++ case GTU: ++ fatal ("Internal compiler bug: command `bgtu'"); ++ case LEU: ++ fatal ("Internal compiler bug: command `bleu'"); ++ case LTU: ++ return "lo"; ++ default: ++ abort (); ++ } ++ } ++ ++ ++ void ++ print_operand_address (file, addr) ++ FILE *file; ++ register rtx addr; ++ { ++ switch (GET_CODE (addr)) ++ { ++ case REG: ++ fprintf (file, ptrreg_to_str (REGNO (addr))); ++ break; ++ ++ case PRE_DEC: ++ fprintf (file, "-%s", ptrreg_to_str (REGNO (XEXP (addr, 0)))); ++ break; ++ ++ case POST_INC: ++ fprintf (file, "%s+", ptrreg_to_str (REGNO (XEXP (addr, 0)))); ++ break; ++ ++ default: ++ if (CONSTANT_ADDRESS_P (addr) ++ && (SYMBOL_REF_FLAG (addr) || GET_CODE (addr) == LABEL_REF)) ++ { ++ if (TARGET_AVA) ++ { ++ fprintf (file, "("); ++ output_addr_const (file,addr); ++ fprintf (file ,")/2"); ++ } ++ else ++ { ++ fprintf (file, "pm("); ++ output_addr_const (file,addr); ++ fprintf (file ,")"); ++ } ++ } ++ else ++ output_addr_const (file, addr); ++ } ++ } ++ ++ void ++ print_operand (file, x, code) ++ FILE *file; ++ rtx x; ++ int code; ++ { ++ int abcd = 0; ++ ++ if (code >= 'A' && code <= 'D') ++ abcd = code - 'A'; ++ ++ if (REG_P (x)) ++ { ++ if (x == zero_reg_rtx) ++ fprintf (file,"__zero_reg__"); ++ else ++ fprintf (file, reg_names[true_regnum (x) + abcd]); ++ } ++ else if (GET_CODE (x) == CONST_INT) ++ fprintf (file, "%d", INTVAL (x) + abcd); ++ else if (GET_CODE (x) == MEM) ++ { ++ rtx addr = XEXP (x,0); ++ if (code == 'K') ++ { ++ if (CONSTANT_P (addr)) ++ putc ('s', file); ++ else if (GET_CODE (addr) == PLUS) ++ putc ('d', file); ++ } ++ else if (CONSTANT_P (addr) && abcd) ++ { ++ fputc ('(', file); ++ output_address (addr); ++ fprintf (file, ")+%d", abcd); ++ } ++ else if (GET_CODE (addr) == PLUS) ++ { ++ print_operand_address (file, XEXP (addr,0)); ++ if (REGNO (XEXP (addr, 0)) == REG_X) ++ fatal_insn ("Internal compiler bug.\nBad address:" ++ ,addr); ++ fputc ('+', file); ++ print_operand (file, XEXP (addr,1), code); ++ } ++ else ++ output_address (addr); ++ } ++ else if (GET_CODE (x) == CONST_DOUBLE) ++ { ++ long val; ++ REAL_VALUE_TYPE rv; ++ if (GET_MODE (x) != SFmode) ++ fatal_insn ("Internal compiler bug. Unknown mode:", x); ++ REAL_VALUE_FROM_CONST_DOUBLE (rv, x); ++ REAL_VALUE_TO_TARGET_SINGLE (rv, val); ++ asm_fprintf (file, "0x%x", val); ++ } ++ else if (code == 'j') ++ asm_fprintf (file, cond_string (GET_CODE (x))); ++ else if (code == 'k') ++ asm_fprintf (file, cond_string (reverse_condition (GET_CODE (x)))); ++ else ++ output_address (x); ++ } ++ ++ /* Recognise operand OP of mode MODE used in call instructions */ ++ int ++ call_insn_operand (op, mode) ++ rtx op; ++ enum machine_mode mode; ++ { ++ if (GET_CODE (op) == MEM) ++ { ++ rtx inside = XEXP (op, 0); ++ if (register_operand (inside, Pmode)) ++ return 1; ++ if (CONSTANT_ADDRESS_P (inside)) ++ return 1; ++ } ++ return 0; ++ } ++ ++ /* Update the condition code from the insn. */ ++ ++ void ++ notice_update_cc (body, insn) ++ rtx body; ++ rtx insn; ++ { ++ switch (get_attr_cc (insn)) ++ { ++ case CC_NONE: ++ /* Insn does not affect CC at all. */ ++ break; ++ ++ case CC_SET_N: ++ CC_STATUS_INIT; ++ break; ++ ++ case CC_SET_ZN: ++ { ++ rtx set = single_set (insn); ++ CC_STATUS_INIT; ++ if (set) ++ { ++ cc_status.flags |= CC_NO_OVERFLOW; ++ cc_status.value1 = SET_DEST (set); ++ } ++ } ++ break; ++ ++ case CC_SET_CZN: ++ /* Insn sets the Z,N,C flags of CC to recog_operand[0]. ++ The V flag may or may not be known but that's ok because ++ alter_cond will change tests to use EQ/NE. */ ++ { ++ rtx set = single_set (insn); ++ CC_STATUS_INIT; ++ if (set) ++ { ++ cc_status.value1 = SET_DEST (set); ++ cc_status.flags |= CC_OVERFLOW_UNUSABLE; ++ } ++ } ++ break; ++ ++ case CC_COMPARE: ++ { ++ rtx set = single_set (insn); ++ CC_STATUS_INIT; ++ if (set) ++ cc_status.value1 = SET_SRC (set); ++ } ++ break; ++ ++ case CC_CLOBBER: ++ /* Insn doesn't leave CC in a usable state. */ ++ CC_STATUS_INIT; ++ break; ++ } ++ } ++ ++ int ++ class_max_nregs (class, mode) ++ enum reg_class class; ++ enum machine_mode mode; ++ { ++ return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD); ++ } ++ ++ /* Choose mode for jump insn: ++ 1 - relative jump in range -63 <= x <= 62 ++ 2 - relative jump in range -2046 <= x <= 2045 ++ 3 - absolute jump (only for ATmega[16]03 ++ */ ++ int ++ avr_jump_mode (x,insn) ++ rtx x; /* jump operand */ ++ rtx insn; /* jump insn */ ++ { ++ int dest_addr = insn_addresses[INSN_UID (GET_MODE (x) == LABEL_REF ++ ? XEXP (x, 0) : x)]; ++ int cur_addr = insn_addresses[INSN_UID (insn)]; ++ int jump_distance = cur_addr - dest_addr; ++ if (-63 <= jump_distance && jump_distance <= 62) ++ return 1; ++ else if (-2046 <= jump_distance && jump_distance <= 2045) ++ return 2; ++ else if (AVR_MEGA) ++ return 3; ++ return 2; ++ } ++ ++ /* return AVR condition jump commands */ ++ char * ++ ret_cond_branch (cond,len) ++ RTX_CODE cond; ++ int len; ++ { ++ switch (cond) ++ { ++ case GT: ++ if (cc_prev_status.flags & CC_OVERFLOW_UNUSABLE) ++ return (len == 1 ? (AS1 (breq,_PC_+2) CR_TAB ++ AS1 (brpl,%0)) : ++ len == 2 ? (AS1 (breq,_PC_+4) CR_TAB ++ AS1 (brmi,_PC_+2) CR_TAB ++ AS1 (rjmp,%0)) : ++ (AS1 (breq,_PC_+6) CR_TAB ++ AS1 (brmi,_PC_+4) CR_TAB ++ AS1 (jmp,%0))); ++ ++ else ++ return (len == 1 ? (AS1 (breq,_PC_+2) CR_TAB ++ AS1 (brge,%0)) : ++ len == 2 ? (AS1 (breq,_PC_+4) CR_TAB ++ AS1 (brlt,_PC_+2) CR_TAB ++ AS1 (rjmp,%0)) : ++ (AS1 (breq,_PC_+6) CR_TAB ++ AS1 (brlt,_PC_+4) CR_TAB ++ AS1 (jmp,%0))); ++ case GTU: ++ return (len == 1 ? (AS1 (breq,_PC_+2) CR_TAB ++ AS1 (brsh,%0)) : ++ len == 2 ? (AS1 (breq,_PC_+4) CR_TAB ++ AS1 (brlo,_PC_+2) CR_TAB ++ AS1 (rjmp,%0)) : ++ (AS1 (breq,_PC_+6) CR_TAB ++ AS1 (brlo,_PC_+4) CR_TAB ++ AS1 (jmp,%0))); ++ case LE: ++ if (cc_prev_status.flags & CC_OVERFLOW_UNUSABLE) ++ return (len == 1 ? (AS1 (breq,%0) CR_TAB ++ AS1 (brmi,%0)) : ++ len == 2 ? (AS1 (breq,_PC_+2) CR_TAB ++ AS1 (brpl,_PC_+2) CR_TAB ++ AS1 (rjmp,%0)) : ++ (AS1 (breq,_PC_+2) CR_TAB ++ AS1 (brpl,_PC_+4) CR_TAB ++ AS1 (jmp,%0))); ++ else ++ return (len == 1 ? (AS1 (breq,%0) CR_TAB ++ AS1 (brlt,%0)) : ++ len == 2 ? (AS1 (breq,_PC_+2) CR_TAB ++ AS1 (brge,_PC_+2) CR_TAB ++ AS1 (rjmp,%0)) : ++ (AS1 (breq,_PC_+2) CR_TAB ++ AS1 (brge,_PC_+4) CR_TAB ++ AS1 (jmp,%0))); ++ case LEU: ++ return (len == 1 ? (AS1 (breq,%0) CR_TAB ++ AS1 (brlo,%0)) : ++ len == 2 ? (AS1 (breq,_PC_+2) CR_TAB ++ AS1 (brsh,_PC_+2) CR_TAB ++ AS1 (rjmp,%0)) : ++ (AS1 (breq,_PC_+2) CR_TAB ++ AS1 (brsh,_PC_+4) CR_TAB ++ AS1 (jmp,%0))); ++ default: ++ switch (len) ++ { ++ case 1: ++ return AS1 (br%j1,%0); ++ case 2: ++ return (AS1 (br%k1,_PC_+2) CR_TAB ++ AS1 (rjmp,%0)); ++ default: ++ return (AS1 (br%k1,_PC_+4) CR_TAB ++ AS1 (jmp,%0)); ++ } ++ } ++ return ""; ++ } ++ ++ /* Predicate function for immediate operand which fits to byte (8bit) */ ++ int ++ byte_immediate_operand (op, mode) ++ register rtx op; ++ enum machine_mode mode; ++ { ++ return (GET_CODE (op) == CONST_INT ++ && INTVAL (op) <= 0xff && INTVAL (op) >= 0); ++ } ++ ++ /* ++ Output all insn addresses and their sizes into the assembly language ++ output file. This is helpful for debugging whether the length attributes ++ in the md file are correct. ++ Output insn cost for next insn. ++ */ ++ ++ void ++ final_prescan_insn (insn, operand, num_operands) ++ rtx insn, *operand; ++ int num_operands; ++ { ++ rtx x; ++ int uid = INSN_UID (insn); ++ ++ if (TARGET_INSN_SIZE_DUMP || TARGET_ALL_DEBUG) ++ { ++ fprintf (asm_out_file, "/*DEBUG: 0x%x\t\t%d\t%d */\n", insn_addresses[uid], ++ insn_addresses[uid] - last_insn_address, ++ rtx_cost (PATTERN (insn),INSN)); ++ } ++ last_insn_address = insn_addresses[uid]; ++ ++ if (TARGET_RTL_DUMP) ++ { ++ fprintf (asm_out_file, "/*****************\n"); ++ print_rtl_single (asm_out_file, insn); ++ fprintf (asm_out_file, "*****************/\n"); ++ } ++ } ++ ++ /* ++ return 0 if undefined, ++ 1 if always true or always false ++ */ ++ ++ int ++ avr_simplify_comparision_p (mode, operator, x) ++ enum machine_mode mode; ++ RTX_CODE operator; ++ rtx x; ++ { ++ unsigned int max = (mode == QImode ? 0xff : ++ mode == HImode ? 0xffff : ++ mode == SImode ? 0xffffffff : 0); ++ if (max && operator && GET_CODE (x) == CONST_INT) ++ { ++ if (unsigned_condition (operator) != operator) ++ max >>= 1; ++ ++ if (max != (INTVAL (x) & max) ++ && INTVAL (x) != 0xff) ++ return 1; ++ } ++ return 0; ++ } ++ ++ #define FROM_25_TO_8 ++ ++ #ifdef FROM_25_TO_8 ++ # define FIRST_CUM_REG 26 ++ #else ++ # define FIRST_CUM_REG 2 ++ #endif ++ ++ int ++ function_arg_regno_p(r) ++ int r; ++ { ++ #ifdef FROM_25_TO_8 ++ return (r >= 8 && r <= 25); ++ #else ++ return (r >= 2 && r <= 19); ++ #endif ++ } ++ ++ void ++ init_cumulative_args (cum, fntype, libname, indirect) ++ CUMULATIVE_ARGS *cum; ++ tree fntype; ++ char *libname; ++ int indirect; ++ { ++ #ifdef FROM_25_TO_8 ++ cum->nregs = 18; ++ #else ++ cum->nregs = 18; ++ #endif ++ cum->regno = FIRST_CUM_REG; ++ if (!libname) ++ { ++ int stdarg = (TYPE_ARG_TYPES (fntype) != 0 ++ && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype))) ++ != void_type_node)); ++ if (stdarg) ++ cum->nregs = 0; ++ } ++ } ++ ++ rtx ++ function_arg (cum, mode, type, named) ++ CUMULATIVE_ARGS *cum; ++ enum machine_mode mode; ++ tree type; ++ int named; ++ { ++ rtx ret = NULL_RTX; ++ int bytes = (mode == BLKmode ? int_size_in_bytes (type) ++ : GET_MODE_SIZE (mode)); ++ ++ if (cum->nregs && bytes <= cum->nregs) ++ ret = gen_rtx (REG, mode, ++ #ifdef FROM_25_TO_8 ++ cum->regno - bytes ++ #else ++ cum->regno ++ #endif ++ ); ++ return ret; ++ } ++ ++ void ++ function_arg_advance (cum, mode, type, named) ++ CUMULATIVE_ARGS *cum; /* current arg information */ ++ enum machine_mode mode; /* current arg mode */ ++ tree type; /* type of the argument or 0 if lib support */ ++ int named; /* whether or not the argument was named */ ++ { ++ int bytes = (mode == BLKmode) ? int_size_in_bytes (type) ++ : GET_MODE_SIZE (mode); ++ ++ cum->nregs -= bytes; ++ #ifdef FROM_25_TO_8 ++ cum->regno -= bytes; ++ #else ++ cum->regno += bytes; ++ #endif ++ ++ if (cum->nregs <= 0) ++ { ++ cum->nregs = 0; ++ cum->regno = FIRST_CUM_REG; ++ } ++ ++ return; ++ } ++ ++ /*********************************************************************** ++ Functions for output various mov's for the various modes ++ ************************************************************************/ ++ char * ++ out_movqi_r_mr (insn, op, l) ++ rtx insn; ++ rtx op[]; ++ int *l; /* instruction length */ ++ { ++ /* We handle CONSTANT_ADDRESS_P case in adjust_insn_length */ ++ if (l) *l=1; ++ if (GET_CODE (op[1]) == MEM) ++ { ++ rtx x = XEXP (op[1],0); ++ if (GET_CODE (x) == PLUS ++ && REG_P (XEXP (x,0)) ++ && GET_CODE (XEXP (x,1)) == CONST_INT) ++ { ++ if((INTVAL (XEXP (x,1)) - GET_MODE_SIZE (GET_MODE (op[1]))) >= 63) ++ { ++ int disp = INTVAL (XEXP (x,1)); ++ if (REGNO (XEXP (x,0)) != REG_Y) ++ fatal_insn ("Incorrect insn:",insn); ++ if (disp <= 63 + 64 - GET_MODE_SIZE (GET_MODE (op[1]))) ++ { ++ if (l) ++ *l = 3; ++ else ++ { ++ op[4] = GEN_INT (disp - 63); ++ return (AS2 (adiw, r28, %4) CR_TAB ++ AS2 (ldd, %0,Y+63) CR_TAB ++ AS2 (sbiw, r28, %4)); ++ } ++ } ++ else ++ { ++ op[4] = XEXP (x,1); ++ if (l) ++ *l = 5; ++ else ++ return (AS2 (subi, r28, lo8(-%4)) CR_TAB ++ AS2 (sbci, r29, hi8(-%4)) CR_TAB ++ AS2 (ld, %0,Y) CR_TAB ++ AS2 (subi, r28, lo8(%4)) CR_TAB ++ AS2 (sbci, r29, hi8(%4))); ++ } ++ } ++ else if (REGNO (XEXP (x,0)) == REG_X) ++ { ++ /* This is a paranoid case LEGITIMIZE_RELOAD_ADDRESS must exclude ++ it but I have this situation with extremal optimizing options ++ */ ++ if (l) ++ *l=3; ++ else ++ { ++ output_asm_insn (AS2 (adiw, r26, %0),&XEXP (x,1)); ++ output_asm_insn (AS2 (ld ,%0,X),op); ++ if (!reg_overlap_mentioned_p (op[0],XEXP (x,0))) ++ output_asm_insn (AS2 (sbiw, r26, %0),&XEXP (x,1)); ++ } ++ return ""; ++ } ++ } ++ } ++ return AS2 (ld%K1,%0,%1); ++ } ++ ++ char * ++ out_movhi_r_mr (insn, op, l) ++ rtx insn; ++ rtx op[]; ++ int *l; /* instruction length */ ++ { ++ int reg_dest = true_regnum (op[0]); ++ int reg_base = true_regnum (XEXP (op[1],0)); ++ int len_p = 1,tmp; ++ int *real_l=l; ++ ++ if (!l) ++ l = &tmp, len_p = 0; ++ ++ if (reg_base > 0) ++ { ++ if (reg_dest == reg_base) /* R = (R) */ ++ return *l=3, (AS2 (ld,__tmp_reg__,%1+) CR_TAB ++ AS2 (ld,%B0,%1) CR_TAB ++ AS2 (mov,%A0,__tmp_reg__)); ++ else if (reg_base == REG_X) /* (R26) */ ++ { ++ if (reg_unused_after (insn, XEXP (op[1],0))) ++ return *l=2, (AS2 (ld,%A0,X+) CR_TAB ++ AS2 (ld,%B0,X)); ++ else ++ return *l=3, (AS2 (ld,%A0,X+) CR_TAB ++ AS2 (ld,%B0,X) CR_TAB ++ AS2 (sbiw,r26,1)); ++ } ++ else /* (R) */ ++ return *l=2, (AS2 (ld,%A0,%1) CR_TAB ++ AS2 (ldd,%B0,%1+1)); ++ } ++ else if (GET_CODE (XEXP (op[1],0)) == PLUS) /* (R + i) */ ++ { ++ int disp = INTVAL(XEXP (XEXP (op[1],0), 1)); ++ int reg_base = true_regnum (XEXP (XEXP (op[1],0), 0)); ++ ++ if (disp > 64 - GET_MODE_SIZE (GET_MODE (op[1]))) ++ { ++ rtx x = XEXP (op[1],0); ++ if (REGNO (XEXP (x,0)) != REG_Y) ++ fatal_insn ("Incorrect insn:",insn); ++ if (disp <= 63 + 64 - GET_MODE_SIZE (GET_MODE (op[1]))) ++ { ++ op[4] = GEN_INT (disp - 62); ++ return *l=4, (AS2 (adiw, r28, %4) CR_TAB ++ AS2 (ldd, %A0,Y+62) CR_TAB ++ AS2 (ldd, %B0,Y+63) CR_TAB ++ AS2 (sbiw, r28, %4)); ++ } ++ else ++ { ++ op[4] = XEXP (x,1); ++ return *l=6, (AS2 (subi, r28, lo8(-%4)) CR_TAB ++ AS2 (sbci, r29, hi8(-%4)) CR_TAB ++ AS2 (ld, %A0,Y) CR_TAB ++ AS2 (ldd, %B0,Y+1) CR_TAB ++ AS2 (subi, r28, lo8(%4)) CR_TAB ++ AS2 (sbci, r29, hi8(%4))); ++ } ++ } ++ if (reg_base == REG_X) ++ { ++ /* This is a paranoid case. LEGITIMIZE_RELOAD_ADDRESS must exclude ++ it but I have this situation with extremal optimization options ++ */ ++ rtx ops[1]; ++ ops[0] = XEXP (XEXP (op[1],0), 1); ++ if (real_l) ++ *l = 4; ++ else if (reg_base == reg_dest) ++ { ++ output_asm_insn (AS2 (adiw, r26, %0), ops); ++ output_asm_insn (AS2 (ld , __tmp_reg__, X+), op); ++ output_asm_insn (AS2 (ld , %B0, X), op); ++ output_asm_insn (AS2 (mov, %A0, __tmp_reg__),op); ++ } ++ else ++ { ++ output_asm_insn (AS2 (adiw, r26, %0), ops); ++ output_asm_insn (AS2 (ld , %A0, X+), op); ++ output_asm_insn (AS2 (ld , %B0, X), op); ++ if (INTVAL (ops[0]) == 63) ++ { ++ output_asm_insn (AS2 (subi, r26, %0+1), ops); ++ output_asm_insn (AS2 (sbci, r26, 0), ops); ++ } ++ else ++ output_asm_insn (AS2 (sbiw, r26, %0+1), ops); ++ } ++ return ""; ++ } ++ ++ if (reg_base == reg_dest) ++ return *l=3, (AS2 (ldd,__tmp_reg__,%A1) CR_TAB ++ AS2 (ldd,%B0,%B1) CR_TAB ++ AS2 (mov,%A0,__tmp_reg__)); ++ else ++ return *l=2, (AS2 (ldd,%A0,%A1) CR_TAB ++ AS2 (ldd,%B0,%B1)); ++ } ++ else if (GET_CODE (XEXP (op[1],0)) == PRE_DEC) /* (--R) */ ++ { ++ if (reg_overlap_mentioned_p (op[0], XEXP (XEXP (op[1],0),0))) ++ { ++ debug_rtx (insn); ++ fatal ("Internal error. Incorrect insn."); ++ } ++ return *l=2, (AS2 (ld,%B0,%1) CR_TAB ++ AS2 (ld,%A0,%1)); ++ } ++ else if (GET_CODE (XEXP (op[1],0)) == POST_INC) /* (R++) */ ++ { ++ if (reg_overlap_mentioned_p (op[0], XEXP (XEXP (op[1],0),0))) ++ { ++ debug_rtx (insn); ++ fatal ("Internal error. Incorrect insn."); ++ } ++ return *l=2, (AS2 (ld,%A0,%1) CR_TAB ++ AS2 (ld,%B0,%1)); ++ } ++ else if (CONSTANT_ADDRESS_P (XEXP (op[1],0))) ++ return *l=4, (AS2 (lds,%A0,%A1) CR_TAB ++ AS2 (lds,%B0,%B1)); ++ fatal_insn ("Unknown move insn:",insn); ++ return ""; ++ } ++ ++ char * ++ out_movsi_r_mr (insn,op,l) ++ rtx insn; ++ rtx op[]; ++ int *l; /* instruction length */ ++ { ++ int reg_dest=true_regnum (op[0]); ++ int reg_base=true_regnum (XEXP (op[1],0)); ++ int tmp; ++ if (!l) ++ l=&tmp; ++ if (reg_base > 0) ++ { ++ if (reg_base == REG_X) /* (R26) */ ++ { ++ if (reg_dest == REG_X) ++ return *l=6, (AS2 (adiw,r26,3) CR_TAB ++ AS2 (ld,%D0,X) CR_TAB ++ AS2 (ld,%C0,-X) CR_TAB ++ AS2 (ld,__tmp_reg__,-X) CR_TAB ++ AS2 (ld,%A0,-X) CR_TAB ++ AS2 (mov,%B0,__tmp_reg__)); ++ else if (reg_dest == REG_X - 2) ++ return *l=5, (AS2 (ld,%A0,X+) CR_TAB ++ AS2 (ld,%B0,X+) CR_TAB ++ AS2 (ld,__tmp_reg__,X+) CR_TAB ++ AS2 (ld,%D0,X) CR_TAB ++ AS2 (mov,%C0,__tmp_reg__)); ++ else if (reg_unused_after (insn,XEXP (op[1],0))) ++ return *l=4, (AS2 (ld,%A0,X+) CR_TAB ++ AS2 (ld,%B0,X+) CR_TAB ++ AS2 (ld,%C0,X+) CR_TAB ++ AS2 (ld,%D0,X)); ++ else ++ return *l=5, (AS2 (ld,%A0,X+) CR_TAB ++ AS2 (ld,%B0,X+) CR_TAB ++ AS2 (ld,%C0,X+) CR_TAB ++ AS2 (ld,%D0,X) CR_TAB ++ AS2 (sbiw,r26,3)); ++ } ++ else ++ { ++ if (reg_dest == reg_base) ++ return *l=5, (AS2 (ldd,%D0,%1+3) CR_TAB ++ AS2 (ldd,%C0,%1+2) CR_TAB ++ AS2 (ldd,__tmp_reg__,%1+1) CR_TAB ++ AS2 (ld,%A0,%1) CR_TAB ++ AS2 (mov,%B0,__tmp_reg__)); ++ else if (reg_base == reg_dest + 2) ++ return *l=5, (AS2 (ld ,%A0,%1) CR_TAB ++ AS2 (ldd,%B0,%1+1) CR_TAB ++ AS2 (ldd,__tmp_reg__,%1+2) CR_TAB ++ AS2 (ldd,%D0,%1+3) CR_TAB ++ AS2 (mov,%C0,__tmp_reg__)); ++ else ++ return *l=4, (AS2 (ld ,%A0,%1) CR_TAB ++ AS2 (ldd,%B0,%1+1) CR_TAB ++ AS2 (ldd,%C0,%1+2) CR_TAB ++ AS2 (ldd,%D0,%1+3)); ++ } ++ } ++ else if (GET_CODE (XEXP (op[1],0)) == PLUS) /* (R + i) */ ++ { ++ int disp = INTVAL(XEXP (XEXP (op[1],0), 1)); ++ ++ if (disp > 64 - GET_MODE_SIZE (GET_MODE (op[1]))) ++ { ++ rtx x = XEXP (op[1],0); ++ if (REGNO (XEXP (x,0)) != REG_Y) ++ fatal_insn ("Incorrect insn:",insn); ++ if (disp <= 63 + 64 - GET_MODE_SIZE (GET_MODE (op[1]))) ++ { ++ op[4] = GEN_INT (disp - 60); ++ return *l=6,(AS2 (adiw, r28, %4) CR_TAB ++ AS2 (ldd, %A0,Y+60) CR_TAB ++ AS2 (ldd, %B0,Y+61) CR_TAB ++ AS2 (ldd, %C0,Y+62) CR_TAB ++ AS2 (ldd, %D0,Y+63) CR_TAB ++ AS2 (sbiw, r28, %4)); ++ } ++ else ++ { ++ op[4] = XEXP (x,1); ++ return *l=8,(AS2 (subi, r28, lo8(-%4)) CR_TAB ++ AS2 (sbci, r29, hi8(-%4)) CR_TAB ++ AS2 (ld, %A0,Y) CR_TAB ++ AS2 (ldd, %B0,Y+1) CR_TAB ++ AS2 (ldd, %C0,Y+2) CR_TAB ++ AS2 (ldd, %D0,Y+3) CR_TAB ++ AS2 (subi, r28, lo8(%4)) CR_TAB ++ AS2 (sbci, r29, hi8(%4))); ++ } ++ } ++ ++ reg_base = true_regnum (XEXP (XEXP (op[1],0), 0)); ++ if (reg_dest == reg_base) ++ return *l=5, (AS2 (ldd,%D0,%D1) CR_TAB ++ AS2 (ldd,%C0,%C1) CR_TAB ++ AS2 (ldd,__tmp_reg__,%B1) CR_TAB ++ AS2 (ldd,%A0,%A1) CR_TAB ++ AS2 (mov,%B0,__tmp_reg__)); ++ else if (reg_dest == reg_base - 2) ++ return *l=5, (AS2 (ldd,%A0,%A1) CR_TAB ++ AS2 (ldd,%B0,%B1) CR_TAB ++ AS2 (ldd,__tmp_reg__,%C1) CR_TAB ++ AS2 (ldd,%D0,%D1) CR_TAB ++ AS2 (mov,%C0,__tmp_reg__)); ++ return *l=4, (AS2 (ldd,%A0,%A1) CR_TAB ++ AS2 (ldd,%B0,%B1) CR_TAB ++ AS2 (ldd,%C0,%C1) CR_TAB ++ AS2 (ldd,%D0,%D1)); ++ } ++ else if (GET_CODE (XEXP (op[1],0)) == PRE_DEC) /* (--R) */ ++ return *l=4, (AS2 (ld,%D0,%1) CR_TAB ++ AS2 (ld,%C0,%1) CR_TAB ++ AS2 (ld,%B0,%1) CR_TAB ++ AS2 (ld,%A0,%1)); ++ else if (GET_CODE (XEXP (op[1],0)) == POST_INC) /* (R++) */ ++ return *l=4, (AS2 (ld,%A0,%1) CR_TAB ++ AS2 (ld,%B0,%1) CR_TAB ++ AS2 (ld,%C0,%1) CR_TAB ++ AS2 (ld,%D0,%1)); ++ else if (CONSTANT_ADDRESS_P (XEXP (op[1],0))) ++ return *l=8, (AS2 (lds,%A0,%A1) CR_TAB ++ AS2 (lds,%B0,%B1) CR_TAB ++ AS2 (lds,%C0,%C1) CR_TAB ++ AS2 (lds,%D0,%D1)); ++ ++ fatal_insn ("Unknown move insn:",insn); ++ return ""; ++ } ++ ++ char * ++ out_movsi_mr_r (insn,op,l) ++ rtx insn; ++ rtx op[]; ++ int *l; ++ { ++ int reg_base = true_regnum (XEXP (op[0],0)); ++ int reg_dest = true_regnum (op[1]); ++ int tmp; ++ if (!l) ++ l = &tmp; ++ if (CONSTANT_ADDRESS_P (XEXP (op[0],0))) ++ return *l=8,(AS2 (sts,%A0,%A1) CR_TAB ++ AS2 (sts,%B0,%B1) CR_TAB ++ AS2 (sts,%C0,%C1) CR_TAB ++ AS2 (sts,%D0,%D1)); ++ if (reg_base > 0) /* (r) */ ++ { ++ if (reg_base == REG_X) /* (R26) */ ++ { ++ if (reg_dest == REG_X) ++ { ++ if (reg_unused_after (insn,XEXP (op[0],0))) ++ return *l=5, (AS2 (mov,__tmp_reg__,%B1) CR_TAB ++ AS2 (st,%0+,%A1) CR_TAB ++ AS2 (st,%0+,__tmp_reg__) CR_TAB ++ AS2 (st,%0+,%C1) CR_TAB ++ AS2 (st,%0,%D1)); ++ else ++ return *l=6, (AS2 (mov,__tmp_reg__,%B1) CR_TAB ++ AS2 (st,%0+,%A1) CR_TAB ++ AS2 (st,%0+,__tmp_reg__) CR_TAB ++ AS2 (st,%0+,%C1) CR_TAB ++ AS2 (st,%0,%D1) CR_TAB ++ AS2 (sbiw,r26,3)); ++ } ++ else if (reg_base == reg_dest+2) ++ { ++ if (reg_unused_after (insn,XEXP (op[0],0))) ++ return *l=7, (AS2 (mov,__zero_reg__,%C1) CR_TAB ++ AS2 (mov,__tmp_reg__,%D1) CR_TAB ++ AS2 (st,%0+,%A1) CR_TAB ++ AS2 (st,%0+,%B1) CR_TAB ++ AS2 (st,%0+,__zero_reg__) CR_TAB ++ AS2 (st,%0,__tmp_reg__) CR_TAB ++ AS1 (clr,__zero_reg__)); ++ else ++ return *l=8, (AS2 (mov,__zero_reg__,%C1) CR_TAB ++ AS2 (mov,__tmp_reg__,%D1) CR_TAB ++ AS2 (st,%0+,%A1) CR_TAB ++ AS2 (st,%0+,%B1) CR_TAB ++ AS2 (st,%0+,__zero_reg__) CR_TAB ++ AS2 (st,%0,__tmp_reg__) CR_TAB ++ AS1 (clr,__zero_reg__) CR_TAB ++ AS2 (sbiw,r26,3)); ++ } ++ return *l=5, (AS2 (st,%0+,%A1) CR_TAB ++ AS2 (st,%0+,%B1) CR_TAB ++ AS2 (st,%0+,%C1) CR_TAB ++ AS2 (st,%0,%D1) CR_TAB ++ AS2 (sbiw,r26,3)); ++ } ++ else ++ return *l=4, (AS2 (st,%0,%A1) CR_TAB ++ AS2 (std,%0+1,%B1) CR_TAB ++ AS2 (std,%0+2,%C1) CR_TAB ++ AS2 (std,%0+3,%D1)); ++ } ++ else if (GET_CODE (XEXP (op[0],0)) == PLUS) /* (R + i) */ ++ { ++ int disp = INTVAL(XEXP (XEXP (op[0],0), 1)); ++ if (disp > 64 - GET_MODE_SIZE (GET_MODE (op[0]))) ++ { ++ rtx x = XEXP (op[0],0); ++ if (REGNO (XEXP (x,0)) != REG_Y) ++ fatal_insn ("Incorrect insn:",insn); ++ if (disp <= 63 + 64 - GET_MODE_SIZE (GET_MODE (op[0]))) ++ { ++ op[4] = GEN_INT (disp - 60); ++ return *l=6,(AS2 (adiw, r28, %4) CR_TAB ++ AS2 (std, Y+60,%A1) CR_TAB ++ AS2 (std, Y+61,%B1) CR_TAB ++ AS2 (std, Y+62,%C1) CR_TAB ++ AS2 (std, Y+63,%D1) CR_TAB ++ AS2 (sbiw, r28, %4)); ++ } ++ else ++ { ++ op[4] = XEXP (x,1); ++ return *l=8,(AS2 (subi, r28, lo8(-%4)) CR_TAB ++ AS2 (sbci, r29, hi8(-%4)) CR_TAB ++ AS2 (st, Y,%A1) CR_TAB ++ AS2 (std, Y+1,%B1) CR_TAB ++ AS2 (std, Y+2,%C1) CR_TAB ++ AS2 (std, Y+3,%D1) CR_TAB ++ AS2 (subi, r28, lo8(%4)) CR_TAB ++ AS2 (sbci, r29, hi8(%4))); ++ } ++ } ++ return *l=4, (AS2 (std,%A0,%A1) CR_TAB ++ AS2 (std,%B0,%B1) CR_TAB ++ AS2 (std,%C0,%C1) CR_TAB ++ AS2 (std,%D0,%D1)); ++ } ++ else if (GET_CODE (XEXP (op[0],0)) == PRE_DEC) /* (--R) */ ++ return *l=4, (AS2 (st,%0,%D1) CR_TAB ++ AS2 (st,%0,%C1) CR_TAB ++ AS2 (st,%0,%B1) CR_TAB ++ AS2 (st,%0,%A1)); ++ else if (GET_CODE (XEXP (op[0],0)) == POST_INC) /* (R++) */ ++ return *l=4, (AS2 (st,%0,%A1) CR_TAB ++ AS2 (st,%0,%B1) CR_TAB ++ AS2 (st,%0,%C1) CR_TAB ++ AS2 (st,%0,%D1)); ++ fatal_insn ("Unknown move insn:",insn); ++ return ""; ++ } ++ ++ char * ++ output_movsisf(insn, operands, which_alternative) ++ rtx insn; ++ rtx operands[]; ++ int which_alternative; ++ { ++ rtx link; ++ switch (which_alternative) ++ { ++ case 0: /* mov r,r */ ++ if (true_regnum (operands[0]) > true_regnum (operands[1])) ++ return (AS2 (mov,%D0,%D1) CR_TAB ++ AS2 (mov,%C0,%C1) CR_TAB ++ AS2 (mov,%B0,%B1) CR_TAB ++ AS2 (mov,%A0,%A1)); ++ else ++ return (AS2 (mov,%A0,%A1) CR_TAB ++ AS2 (mov,%B0,%B1) CR_TAB ++ AS2 (mov,%C0,%C1) CR_TAB ++ AS2 (mov,%D0,%D1)); ++ case 1: /* mov r,L */ ++ return (AS1 (clr,%A0) CR_TAB ++ AS1 (clr,%B0) CR_TAB ++ AS1 (clr,%C0) CR_TAB ++ AS1 (clr,%D0)); ++ case 2: /* mov r,d */ ++ if (GET_MODE (operands[0]) == SImode ++ && operands[1] == const1_rtx ++ && (link = find_reg_note (insn, REG_WAS_0, 0)) ++ /* Make sure the insn that stored the 0 is still present. */ ++ && ! INSN_DELETED_P (XEXP (link, 0)) ++ && GET_CODE (XEXP (link, 0)) != NOTE ++ /* Make sure cross jumping didn't happen here. */ ++ && no_labels_between_p (XEXP (link, 0), insn) ++ /* Make sure the reg hasn't been clobbered. */ ++ && ! reg_set_between_p (operands[0], XEXP (link, 0), insn)) ++ /* Fastest way to change a 0 to a 1. */ ++ return AS1 (inc,%A0 ; reg_was_0); ++ return (AS2 (ldi,%A0,lo8(%1)) CR_TAB ++ AS2 (ldi,%B0,hi8(%1)) CR_TAB ++ AS2 (ldi,%C0,hlo8(%1)) CR_TAB ++ AS2 (ldi,%D0,hhi8(%1))); ++ case 3: /* mov r,m*/ ++ case 5: ++ return out_movsi_r_mr (insn, operands, NULL); ++ case 4: /* mov m,r*/ ++ case 6: ++ { ++ rtx save1=NULL; ++ if (operands[1] == const0_rtx) ++ { ++ save1 = operands[1]; ++ operands[1] = zero_reg_rtx; ++ } ++ output_asm_insn (out_movsi_mr_r (insn,operands,NULL), operands); ++ if (save1) ++ operands[1] = save1; ++ } ++ return ""; ++ } ++ } ++ ++ char * ++ out_movqi_mr_r (insn, op, l) ++ rtx insn; ++ rtx op[]; ++ int *l; /* instruction length */ ++ { ++ if (l) *l=1; ++ ++ if (GET_CODE (op[0]) == MEM) ++ { ++ rtx x = XEXP (op[0],0); ++ if (GET_CODE (x) == PLUS ++ && REG_P (XEXP (x,0)) ++ && GET_CODE (XEXP (x,1)) == CONST_INT) ++ { ++ if ((INTVAL (XEXP (x,1)) - GET_MODE_SIZE (GET_MODE (op[0]))) >= 63) ++ { ++ int disp = INTVAL (XEXP (x,1)); ++ if (REGNO (XEXP (x,0)) != REG_Y) ++ fatal_insn ("Incorrect insn:",insn); ++ if (disp <= 63 + 64 - GET_MODE_SIZE (GET_MODE (op[0]))) ++ { ++ if (l) ++ *l = 3; ++ else ++ { ++ op[4] = GEN_INT (disp - 63); ++ return (AS2 (adiw, r28, %4) CR_TAB ++ AS2 (std, Y+63,%1) CR_TAB ++ AS2 (sbiw, r28, %4)); ++ } ++ } ++ else ++ { ++ op[4] = XEXP (x,1); ++ if (l) ++ *l = 5; ++ else ++ return (AS2 (subi, r28, lo8(-%4)) CR_TAB ++ AS2 (sbci, r29, hi8(-%4)) CR_TAB ++ AS2 (st, Y,%1) CR_TAB ++ AS2 (subi, r28, lo8(%4)) CR_TAB ++ AS2 (sbci, r29, hi8(%4))); ++ } ++ } ++ else if (REGNO (XEXP (x,0)) == REG_X) ++ { ++ if (l) ++ *l=4; ++ else ++ { ++ int overlap_p = reg_overlap_mentioned_p (op[1],XEXP (x,0)); ++ if (!overlap_p) ++ output_asm_insn (AS2 (mov, __tmp_reg__, %1),op); ++ output_asm_insn (AS2 (adiw, r26,%0),&XEXP (x,1)); ++ if (overlap_p) ++ output_asm_insn (AS2 (st ,X,__tmp_reg__),op); ++ else ++ output_asm_insn (AS2 (st ,X,%1),op); ++ output_asm_insn (AS2 (sbiw ,r26,%0),&XEXP (x,1)); ++ } ++ return ""; ++ } ++ } ++ } ++ return AS2 (st%K0, %0,%1); ++ } ++ ++ char * ++ out_movhi_mr_r (insn,op,l) ++ rtx insn; ++ rtx op[]; ++ int *l; ++ { ++ int reg_base = true_regnum (XEXP (op[0],0)); ++ int reg_dest = true_regnum (op[1]); ++ int tmp; ++ if (!l) ++ l = &tmp; ++ if (CONSTANT_ADDRESS_P (XEXP (op[0],0))) ++ return *l=4,(AS2 (sts,%A0,%A1) CR_TAB ++ AS2 (sts,%B0,%B1)); ++ if (reg_base > 0) ++ { ++ if (reg_base == REG_X) ++ { ++ if (reg_dest == REG_X) ++ { ++ if (reg_unused_after (insn, op[1])) ++ return *l=3, (AS2 (mov,__tmp_reg__,r27) CR_TAB ++ AS2 (st ,X+,r26) CR_TAB ++ AS2 (st ,X,__tmp_reg__)); ++ else ++ return *l=4, (AS2 (mov,__tmp_reg__,r27) CR_TAB ++ AS2 (st ,X+,r26) CR_TAB ++ AS2 (st ,X,__tmp_reg__) CR_TAB ++ AS2 (sbiw,r26,1)); ++ } ++ else ++ { ++ if (reg_unused_after (insn, XEXP (op[0],0))) ++ return *l=2, (AS2 (st,X+,%A1) CR_TAB ++ AS2 (st,X,%B1)); ++ else ++ return *l=3, (AS2 (st ,X+,%A1) CR_TAB ++ AS2 (st ,X,%B1) CR_TAB ++ AS2 (sbiw,r26,1)); ++ } ++ } ++ else ++ return *l=2, (AS2 (st ,%0,%A1) CR_TAB ++ AS2 (std,%0+1,%B1)); ++ } ++ else if (GET_CODE (XEXP (op[0],0)) == PLUS) ++ { ++ int disp = INTVAL(XEXP (XEXP (op[0],0), 1)); ++ if (disp > 64 - GET_MODE_SIZE (GET_MODE (op[0]))) ++ { ++ rtx x = XEXP (op[0],0); ++ if (REGNO (XEXP (x,0)) != REG_Y) ++ fatal_insn ("Incorrect insn:",insn); ++ if (disp <= 63 + 64 - GET_MODE_SIZE (GET_MODE (op[0]))) ++ { ++ op[4] = GEN_INT (disp - 62); ++ return *l=4,(AS2 (adiw, r28, %4) CR_TAB ++ AS2 (std, Y+62,%A1) CR_TAB ++ AS2 (std, Y+63,%B1) CR_TAB ++ AS2 (sbiw, r28, %4)); ++ } ++ else ++ { ++ op[4] = XEXP (x,1); ++ return *l=6,(AS2 (subi, r28, lo8(-%4)) CR_TAB ++ AS2 (sbci, r29, hi8(-%4)) CR_TAB ++ AS2 (st, Y,%A1) CR_TAB ++ AS2 (std, Y+1,%B1) CR_TAB ++ AS2 (subi, r28, lo8(%4)) CR_TAB ++ AS2 (sbci, r29, hi8(%4))); ++ } ++ } ++ return *l=2, (AS2 (std,%A0,%A1) CR_TAB ++ AS2 (std,%B0,%B1)); ++ } ++ else if (GET_CODE (XEXP (op[0],0)) == PRE_DEC) /* (--R) */ ++ return *l=2, (AS2 (st,%0,%B1) CR_TAB ++ AS2 (st,%0,%A1)); ++ else if (GET_CODE (XEXP (op[0],0)) == POST_INC) /* (R++) */ ++ return *l=2, (AS2 (st,%0,%A1) CR_TAB ++ AS2 (st,%0,%B1)); ++ fatal_insn ("Unknown move insn:",insn); ++ return ""; ++ } ++ ++ /* Return 1 if frame pointer for current function required */ ++ ++ int ++ frame_pointer_required_p() ++ { ++ return (current_function_calls_alloca ++ || current_function_args_info.nregs == 0 ++ || current_function_varargs ++ || get_frame_size () > 0); ++ } ++ ++ /* ++ Return 1 if next insn is a JUMP_INSN with condition (GT,LE,GTU,LTU) ++ */ ++ int ++ compare_diff_p (insn) ++ rtx insn; ++ { ++ rtx next = next_real_insn (insn); ++ RTX_CODE cond = UNKNOWN; ++ if (GET_CODE (next) == JUMP_INSN) ++ { ++ rtx pat = PATTERN (next); ++ rtx src = SET_SRC (pat); ++ rtx t = XEXP (src,0); ++ cond = GET_CODE (t); ++ } ++ return (cond == GT || cond == GTU || cond == LE || cond == LEU) ? cond : 0; ++ } ++ ++ int ++ compare_eq_p (insn) ++ rtx insn; ++ { ++ rtx next = next_real_insn (insn); ++ RTX_CODE cond = UNKNOWN; ++ if (GET_CODE (next) == JUMP_INSN) ++ { ++ rtx pat = PATTERN (next); ++ rtx src = SET_SRC (pat); ++ rtx t = XEXP (src,0); ++ cond = GET_CODE (t); ++ } ++ return (cond == EQ || cond == NE); ++ } ++ ++ char * ++ out_tsthi (insn,l) ++ rtx insn; ++ int *l; ++ { ++ if (!compare_eq_p (insn)) ++ { ++ if (l) *l = 1; ++ return AS1 (tst,%B0); ++ } ++ if (TEST_HARD_REG_CLASS (ADDW_REGS, true_regnum (SET_SRC (PATTERN (insn))))) ++ { ++ if (l) *l = 1; ++ return AS2 (sbiw,%0,0); ++ } ++ if (compare_eq_p (insn) && reg_unused_after (insn, SET_SRC (PATTERN (insn)))) ++ { ++ if (l) *l = 1; ++ return AS2 (or,%A0,%B0); ++ } ++ if (l) *l = 2; ++ return (AS2 (cp,%A0,__zero_reg__) CR_TAB ++ AS2 (cpc,%B0,__zero_reg__)); ++ } ++ ++ ++ ++ char * ++ out_tstsi (insn,l) ++ rtx insn; ++ int *l; ++ { ++ if (!compare_eq_p (insn)) ++ { ++ if (l) *l = 1; ++ return AS1 (tst,%D0); ++ } ++ if (TEST_HARD_REG_CLASS (ADDW_REGS, true_regnum (SET_SRC (PATTERN (insn))))) ++ { ++ if (l) *l = 3; ++ return (AS2 (sbiw,%A0,0) CR_TAB ++ AS2 (cpc,%C0,__zero_reg__) CR_TAB ++ AS2 (cpc,%D0,__zero_reg__)); ++ } ++ if (l) *l = 4; ++ return (AS2 (cp,%A0,__zero_reg__) CR_TAB ++ AS2 (cpc,%B0,__zero_reg__) CR_TAB ++ AS2 (cpc,%C0,__zero_reg__) CR_TAB ++ AS2 (cpc,%D0,__zero_reg__)); ++ } ++ ++ /* ++ Generate asm equivalent for various shift's. ++ Shift count are CONST_INT or REG. ++ */ ++ ++ void ++ out_shift_with_cnt (template,insn,operands,len) ++ char * template; ++ rtx insn; ++ rtx operands[]; ++ int *len; ++ { ++ rtx op[10]; ++ int l_hi=0; ++ char str[300]; ++ op[0] = operands[0]; ++ op[1] = operands[1]; ++ op[2] = operands[2]; ++ op[3] = operands[3]; ++ str[0] = 0; ++ ++ if (CONSTANT_P (operands[2])) ++ { ++ if (len) ++ ++*len; ++ else ++ strcat (str, "ldi %3,lo8(%2)"); ++ } ++ else if (GET_CODE (operands[2]) == MEM) ++ { ++ int mov_len; ++ rtx op_mov[10]; ++ l_hi = 1; ++ if (len) ++ *len = 2; ++ op[3] = op_mov[0] = tmp_reg_rtx; ++ op_mov[1] = op[2]; ++ ++ if (!len) ++ { ++ output_asm_insn (out_movqi_r_mr (insn, op_mov, NULL), op_mov); ++ strcat (str,(AS2 (or,%3,%3) CR_TAB ++ AS1 (breq,L_hi%=))); ++ } ++ else ++ { ++ out_movqi_r_mr (insn, op_mov, &mov_len); ++ *len += mov_len; ++ } ++ } ++ else if (register_operand (operands[2],QImode)) ++ { ++ l_hi = 1; ++ if (len) ++ *len += 2; ++ else ++ strcat (str, (AS2 (or,%2,%2) CR_TAB ++ AS1 (breq,L_hi%=))); ++ ++ if (reg_unused_after (insn, operands[2])) ++ { ++ op[3] = op[2]; ++ } ++ else ++ { ++ op[3] = tmp_reg_rtx; ++ if (len) ++ ++*len; ++ else ++ strcat (str, CR_TAB "mov %3,%2"); ++ } ++ } ++ if (!len) ++ { ++ strcat (str,"\n\t"); ++ strcat (str, template); ++ if (l_hi) ++ strcat (str, "\nL_hi%=:"); ++ output_asm_insn (str, op); ++ } ++ } ++ ++ ++ /* SHIFT LEFT (x<= reg1) ++ return (AS2 (mov,%D0,%C1) CR_TAB ++ AS2 (mov,%C0,%B1) CR_TAB ++ AS2 (mov,%B0,%A1) CR_TAB ++ AS1 (clr,%A0)); ++ else if (reg0 + 1 == reg1) ++ return *len = 1, AS1 (clr,%A0); ++ else ++ return (AS1 (clr,%A0) CR_TAB ++ AS2 (mov,%B0,%A1) CR_TAB ++ AS2 (mov,%C0,%B1) CR_TAB ++ AS2 (mov,%D0,%C1)); ++ } ++ case 16: ++ { ++ int reg0 = true_regnum (operands[0]); ++ int reg1 = true_regnum (operands[1]); ++ *len=4; ++ if (reg0 + 1 >= reg1) ++ return (AS2 (mov,%D0,%B1) CR_TAB ++ AS2 (mov,%C0,%A1) CR_TAB ++ AS1 (clr,%B0) CR_TAB ++ AS1 (clr,%A0)); ++ if (reg0 + 2 == reg1) ++ return *len = 2, (AS1 (clr,%B0) CR_TAB ++ AS1 (clr,%A0)); ++ else ++ return (AS2 (mov,%C0,%A1) CR_TAB ++ AS2 (mov,%D0,%B1) CR_TAB ++ AS1 (clr,%B0) CR_TAB ++ AS1 (clr,%A0)); ++ } ++ case 24: ++ *len=4; ++ if (true_regnum (operands[0]) + 3 != true_regnum (operands[1])) ++ return (AS2 (mov,%D0,%A1) CR_TAB ++ AS1 (clr,%C0) CR_TAB ++ AS1 (clr,%B0) CR_TAB ++ AS1 (clr,%A0)); ++ else ++ return *len = 3, (AS1 (clr,%C0) CR_TAB ++ AS1 (clr,%B0) CR_TAB ++ AS1 (clr,%A0)); ++ } ++ } ++ if (len) ++ *len = 6; ++ out_shift_with_cnt (AS1 (lsl,%0) CR_TAB ++ AS1 (rol,%B0) CR_TAB ++ AS1 (rol,%C0) CR_TAB ++ AS1 (rol,%D0) CR_TAB ++ AS1 (dec,%3) CR_TAB ++ AS1 (brne,_PC_-12), ++ insn, operands, len); ++ return ""; ++ } ++ ++ /* Arithmetic SHIFT RIGHT ((signed)x>>i) */ ++ char * ++ ashrqi3_out (insn,operands,len) ++ rtx insn; ++ rtx operands[]; ++ int *len; /* insn length */ ++ { ++ if (GET_CODE (operands[2]) == CONST_INT) ++ { ++ int *t=len; ++ int k; ++ if (!len) ++ len = &k; ++ switch (INTVAL (operands[2])) ++ { ++ default: len = t; break; ++ case 1: ++ *len=1; ++ return AS1 (asr,%0); ++ case 2: ++ *len=2; ++ return (AS1 (asr,%0) CR_TAB ++ AS1 (asr,%0)); ++ case 3: ++ *len=3; ++ return (AS1 (asr,%0) CR_TAB ++ AS1 (asr,%0) CR_TAB ++ AS1 (asr,%0)); ++ case 4: ++ *len=4; ++ return (AS1 (asr,%0) CR_TAB ++ AS1 (asr,%0) CR_TAB ++ AS1 (asr,%0) CR_TAB ++ AS1 (asr,%0)); ++ } ++ } ++ if (len) ++ *len = 3; ++ out_shift_with_cnt (AS1 (asr,%0) CR_TAB ++ AS1 (dec,%3) CR_TAB ++ AS1 (brne,_PC_-6), ++ insn, operands, len); ++ return ""; ++ } ++ ++ char * ++ ashrhi3_out (insn,operands,len) ++ rtx insn; ++ rtx operands[]; ++ int *len; ++ { ++ if (GET_CODE (operands[2]) == CONST_INT) ++ { ++ int k; ++ int *t=len; ++ if (!len) ++ len = &k; ++ switch (INTVAL (operands[2])) ++ { ++ default: len = t; break; ++ case 1: ++ *len=2; ++ return (AS1 (asr,%B0) CR_TAB ++ AS1 (ror,%A0)); ++ case 2: ++ *len=4; ++ return (AS1 (asr,%B0) CR_TAB ++ AS1 (ror,%A0) CR_TAB ++ AS1 (asr,%B0) CR_TAB ++ AS1 (ror,%A0)); ++ case 8: ++ if (true_regnum (operands[0]) != true_regnum (operands[1]) + 1) ++ return *len = 4, (AS2 (mov,%A0,%B1) CR_TAB ++ AS1 (clr,%B0) CR_TAB ++ AS2 (sbrc,%A0,7) CR_TAB ++ AS1 (dec,%B0)); ++ else ++ return *len = 3, (AS1 (clr,%B0) CR_TAB ++ AS2 (sbrc,%A0,7) CR_TAB ++ AS1 (dec,%B0)); ++ } ++ } ++ if (len) ++ *len = 4; ++ out_shift_with_cnt (AS1 (asr,%B0) CR_TAB ++ AS1 (ror,%A0) CR_TAB ++ AS1 (dec,%3) CR_TAB ++ AS1 (brne,_PC_-8), ++ insn, operands, len); ++ return ""; ++ } ++ ++ char * ++ ashrsi3_out (insn,operands,len) ++ rtx insn; ++ rtx operands[]; ++ int *len; ++ { ++ if (GET_CODE (operands[2]) == CONST_INT) ++ { ++ int k; ++ int *t = len; ++ if (!len) ++ len = &k; ++ switch (INTVAL (operands[2])) ++ { ++ default: len = t; break; ++ case 1: ++ *len=4; ++ return (AS1 (asr,%D0) CR_TAB ++ AS1 (ror,%C0) CR_TAB ++ AS1 (ror,%B0) CR_TAB ++ AS1 (ror,%A0)); ++ case 8: ++ { ++ int reg0 = true_regnum (operands[0]); ++ int reg1 = true_regnum (operands[1]); ++ *len=6; ++ if (reg0 <= reg1) ++ return (AS2 (mov,%A0,%B1) CR_TAB ++ AS2 (mov,%B0,%C1) CR_TAB ++ AS2 (mov,%C0,%D1) CR_TAB ++ AS1 (clr,%D0) CR_TAB ++ AS2 (sbrc,%C0,7) CR_TAB ++ AS1 (dec,%D0)); ++ else if (reg0 == reg1 + 1) ++ return *len = 3, (AS1 (clr,%D0) CR_TAB ++ AS2 (sbrc,%C0,7) CR_TAB ++ AS1 (dec,%D0)); ++ else ++ return (AS1 (clr,%D0) CR_TAB ++ AS2 (sbrc,%C0,7) CR_TAB ++ AS1 (dec,%D0) CR_TAB ++ AS2 (mov,%C0,%D1) CR_TAB ++ AS2 (mov,%B0,%C1) CR_TAB ++ AS2 (mov,%A0,%B1)); ++ } ++ case 16: ++ { ++ int reg0 = true_regnum (operands[0]); ++ int reg1 = true_regnum (operands[1]); ++ *len=6; ++ if (reg0 <= reg1 + 1) ++ return (AS2 (mov,%A0,%C1) CR_TAB ++ AS2 (mov,%B0,%D1) CR_TAB ++ AS1 (clr,%D0) CR_TAB ++ AS2 (sbrc,%B0,7) CR_TAB ++ AS1 (com,%D0) CR_TAB ++ AS2 (mov,%C0,%D0)); ++ else if (reg0 == reg1 + 2) ++ return *len = 4, (AS1 (clr,%D0) CR_TAB ++ AS2 (sbrc,%B0,7) CR_TAB ++ AS1 (com,%D0) CR_TAB ++ AS2 (mov,%C0,%D0)); ++ else ++ return (AS2 (mov,%B0,%D1) CR_TAB ++ AS2 (mov,%A0,%C1) CR_TAB ++ AS1 (clr,%D0) CR_TAB ++ AS2 (sbrc,%B0,7) CR_TAB ++ AS1 (com,%D0) CR_TAB ++ AS2 (mov,%C0,%D0)); ++ } ++ case 24: ++ if (true_regnum (operands[0]) != true_regnum (operands[1]) + 3) ++ return *len = 6, (AS2 (mov,%A0,%D1) CR_TAB ++ AS1 (clr,%D0) CR_TAB ++ AS2 (sbrc,%A0,7) CR_TAB ++ AS1 (com,%D0) CR_TAB ++ AS2 (mov,%B0,%D0) CR_TAB ++ AS2 (mov,%C0,%D0)); ++ else ++ return *len = 5, (AS1 (clr,%D0) CR_TAB ++ AS2 (sbrc,%A0,7) CR_TAB ++ AS1 (com,%D0) CR_TAB ++ AS2 (mov,%B0,%D0) CR_TAB ++ AS2 (mov,%C0,%D0)); ++ } ++ } ++ if (len) ++ *len = 6; ++ out_shift_with_cnt (AS1 (asr,%D0) CR_TAB ++ AS1 (ror,%C0) CR_TAB ++ AS1 (ror,%B0) CR_TAB ++ AS1 (ror,%A0) CR_TAB ++ AS1 (dec,%3) CR_TAB ++ AS1 (brne,_PC_-12), ++ insn, operands, len); ++ return ""; ++ } ++ ++ /* LOGIC SHIFT RIGHT ((unsigned)x>>i) */ ++ char * ++ lshrqi3_out (insn,operands,len) ++ rtx insn; ++ rtx operands[]; ++ int *len; ++ { ++ if (GET_CODE (operands[2]) == CONST_INT) ++ { ++ int k; ++ int *t=len; ++ if (!len) ++ len = &k; ++ switch (INTVAL (operands[2])) ++ { ++ default: len = t; break; ++ case 1: ++ *len=1; ++ return AS1 (lsr,%0); ++ case 2: ++ *len=2; ++ return (AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0)); ++ case 3: ++ *len=3; ++ return (AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0)); ++ case 4: ++ if (TEST_HARD_REG_CLASS (LD_REGS, true_regnum (operands[0]))) ++ { ++ *len=2; ++ return (AS1 (swap,%0) CR_TAB ++ AS2 (andi,%0,0x0f)); ++ } ++ *len=4; ++ return (AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0)); ++ case 5: ++ if (TEST_HARD_REG_CLASS (LD_REGS, true_regnum (operands[0]))) ++ { ++ *len=3; ++ return (AS1 (swap,%0) CR_TAB ++ AS1 (lsr,%0) CR_TAB ++ AS2 (andi,%0,0x7)); ++ } ++ *len=5; ++ return (AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0)); ++ case 6: ++ if (TEST_HARD_REG_CLASS (LD_REGS, true_regnum (operands[0]))) ++ { ++ *len=4; ++ return (AS1 (swap,%0) CR_TAB ++ AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0) CR_TAB ++ AS2 (andi,%0,0x3)); ++ } ++ *len=6; ++ return (AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0) CR_TAB ++ AS1 (lsr,%0)); ++ case 7: ++ *len=3; ++ return (AS1 (rol,%0) CR_TAB ++ AS1 (clr,%0) CR_TAB ++ AS1 (rol,%0)); ++ } ++ } ++ if (len) ++ *len = 3; ++ out_shift_with_cnt (AS1 (lsr,%0) CR_TAB ++ AS1 (dec,%3) CR_TAB ++ AS1 (brne,_PC_-6), ++ insn, operands, len); ++ return ""; ++ } ++ ++ char * ++ lshrhi3_out (insn,operands,len) ++ rtx insn; ++ rtx operands[]; ++ int *len; ++ { ++ if (GET_CODE (operands[2]) == CONST_INT) ++ { ++ int k; ++ int *t=len; ++ if (!len) ++ len = &k; ++ switch (INTVAL (operands[2])) ++ { ++ default: len = t; break; ++ case 1: ++ *len=2; ++ return (AS1 (lsr,%B0) CR_TAB ++ AS1 (ror,%A0)); ++ case 2: ++ *len=4; ++ return (AS1 (lsr,%B0) CR_TAB ++ AS1 (ror,%A0) CR_TAB ++ AS1 (lsr,%B0) CR_TAB ++ AS1 (ror,%A0)); ++ case 8: ++ if (true_regnum (operands[0]) != true_regnum (operands[1]) + 1) ++ return *len = 2, (AS2 (mov,%A0,%B1) CR_TAB ++ AS1 (clr,%B0)); ++ else ++ return *len = 1, AS1 (clr,%B0); ++ ++ } ++ } ++ if (len) ++ *len = 4; ++ out_shift_with_cnt (AS1 (lsr,%B0) CR_TAB ++ AS1 (ror,%A0) CR_TAB ++ AS1 (dec,%3) CR_TAB ++ AS1 (brne,_PC_-8), ++ insn, operands, len); ++ return ""; ++ } ++ ++ char * ++ lshrsi3_out (insn,operands,len) ++ rtx insn; ++ rtx operands[]; ++ int *len; ++ { ++ if (GET_CODE (operands[2]) == CONST_INT) ++ { ++ int k; ++ int *t=len; ++ if (!len) ++ len = &k; ++ switch (INTVAL (operands[2])) ++ { ++ default: len = t; break; ++ case 1: ++ *len=4; ++ return (AS1 (lsr,%D0) CR_TAB ++ AS1 (ror,%C0) CR_TAB ++ AS1 (ror,%B0) CR_TAB ++ AS1 (ror,%A0)); ++ case 8: ++ { ++ int reg0 = true_regnum (operands[0]); ++ int reg1 = true_regnum (operands[1]); ++ *len=4; ++ if (reg0 <= reg1) ++ return (AS2 (mov,%A0,%B1) CR_TAB ++ AS2 (mov,%B0,%C1) CR_TAB ++ AS2 (mov,%C0,%D1) CR_TAB ++ AS1 (clr,%D0)); ++ else if (reg0 == reg1 + 1) ++ return *len = 1, AS1 (clr,%D0); ++ else ++ return (AS1 (clr,%D0) CR_TAB ++ AS2 (mov,%C0,%D1) CR_TAB ++ AS2 (mov,%B0,%C1) CR_TAB ++ AS2 (mov,%A0,%B1)); ++ } ++ case 16: ++ { ++ int reg0 = true_regnum (operands[0]); ++ int reg1 = true_regnum (operands[1]); ++ *len=4; ++ if (reg0 <= reg1 + 1) ++ return (AS2 (mov,%A0,%C1) CR_TAB ++ AS2 (mov,%B0,%D1) CR_TAB ++ AS1 (clr,%C0) CR_TAB ++ AS1 (clr,%D0)); ++ else if (reg0 == reg1 + 2) ++ return *len = 2, (AS1 (clr,%C0) CR_TAB ++ AS1 (clr,%D0)); ++ else ++ return (AS2 (mov,%B0,%D1) CR_TAB ++ AS2 (mov,%A0,%C1) CR_TAB ++ AS1 (clr,%C0) CR_TAB ++ AS1 (clr,%D0)); ++ } ++ case 24: ++ if (true_regnum (operands[0]) != true_regnum (operands[1]) + 3) ++ return *len = 4, (AS2 (mov,%A0,%D1) CR_TAB ++ AS1 (clr,%B0) CR_TAB ++ AS1 (clr,%C0) CR_TAB ++ AS1 (clr,%D0)); ++ else ++ return *len = 3, (AS1 (clr,%B0) CR_TAB ++ AS1 (clr,%C0) CR_TAB ++ AS1 (clr,%D0)); ++ } ++ } ++ if (len) ++ *len = 6; ++ out_shift_with_cnt (AS1 (lsr,%D0) CR_TAB ++ AS1 (ror,%C0) CR_TAB ++ AS1 (ror,%B0) CR_TAB ++ AS1 (ror,%A0) CR_TAB ++ AS1 (dec,%3) CR_TAB ++ AS1 (brne,_PC_-12), ++ insn, operands, len); ++ return ""; ++ } ++ ++ int ++ adjust_insn_length (insn,len) ++ rtx insn; ++ int len; ++ { ++ rtx patt = PATTERN (insn); ++ rtx set; ++ if (GET_CODE (patt) == SET) ++ { ++ rtx op[10]; ++ op[1] = SET_SRC (patt); ++ op[0] = SET_DEST (patt); ++ if (REG_P (op[0]) && GET_CODE (op[1]) == MEM) ++ { ++ if (CONSTANT_ADDRESS_P (XEXP (op[1],0))) ++ switch (GET_MODE (op[0])) ++ { ++ case QImode: len = 2; break; ++ case HImode: len = 4; break; ++ case SImode: ++ case SFmode: len = 8; break; ++ default: break; ++ } ++ else ++ switch (GET_MODE (op[0])) ++ { ++ case QImode: out_movqi_r_mr (insn,op,&len); break; ++ case HImode: out_movhi_r_mr (insn,op,&len); break; ++ case SImode: ++ case SFmode: out_movsi_r_mr (insn,op,&len); break; ++ default: break; ++ } ++ } ++ else if ((REG_P (op[1]) || const0_rtx == op[1]) ++ && GET_CODE (op[0]) == MEM) ++ { ++ if (CONSTANT_ADDRESS_P (XEXP (op[0],0))) ++ switch (GET_MODE (op[0])) ++ { ++ case QImode: len = 2; break; ++ case HImode: len = 4; break; ++ case SImode: ++ case SFmode: len = 8; break; ++ default: break; ++ } ++ else if (GET_CODE (XEXP (op[0],0)) != POST_DEC) ++ switch (GET_MODE (op[0])) ++ { ++ case QImode: out_movqi_mr_r (insn,op,&len); break; ++ case HImode: out_movhi_mr_r (insn,op,&len); break; ++ case SImode: ++ case SFmode: out_movsi_mr_r (insn,op,&len); break; ++ default: break; ++ } ++ } ++ else if (op[0] == cc0_rtx && REG_P (op[1])) ++ { ++ switch (GET_MODE (op[1])) ++ { ++ case HImode: out_tsthi (insn,&len); break; ++ case SImode: out_tstsi (insn,&len); break; ++ default: break; ++ } ++ } ++ else if (GET_CODE (op[1]) == AND) ++ { ++ if (GET_CODE (XEXP (op[1],1)) == CONST_INT) ++ { ++ HOST_WIDE_INT mask = INTVAL (XEXP (op[1],1)); ++ if (GET_MODE (op[1]) == SImode) ++ len = (((mask & 0xff) != 0xff) ++ + ((mask & 0xff00) != 0xff00) ++ + ((mask & 0xff0000UL) != 0xff0000UL) ++ + ((mask & 0xff000000UL) != 0xff000000UL)); ++ else if (GET_MODE (op[1]) == HImode) ++ len = (((mask & 0xff) != 0xff) ++ + ((mask & 0xff00) != 0xff00)); ++ } ++ } ++ else if (GET_CODE (op[1]) == IOR) ++ { ++ if (GET_CODE (XEXP (op[1],1)) == CONST_INT) ++ { ++ HOST_WIDE_INT mask = INTVAL (XEXP (op[1],1)); ++ if (GET_MODE (op[1]) == SImode) ++ len = (((mask & 0xff) == 0) ++ + ((mask & 0xff00) == 0) ++ + ((mask & 0xff0000UL) == 0) ++ + ((mask & 0xff000000UL) ==0)); ++ else if (GET_MODE (op[1]) == HImode) ++ len = (((mask & 0xff) == 0) ++ + ((mask & 0xff00) == 0)); ++ } ++ } ++ } ++ set = single_set (insn); ++ if (set) ++ { ++ rtx op[10]; ++ op[1] = SET_SRC (set); ++ op[0] = SET_DEST (set); ++ if (GET_CODE (op[1]) == ASHIFT ++ || GET_CODE (op[1]) == ASHIFTRT ++ || GET_CODE (op[1]) == LSHIFTRT) ++ { ++ rtx ops[10]; ++ ops[0] = op[0]; ++ ops[1] = XEXP (op[1],0); ++ ops[2] = XEXP (op[1],1); ++ switch (GET_CODE (op[1])) ++ { ++ case ASHIFT: ++ switch (GET_MODE (op[0])) ++ { ++ case QImode: ashlqi3_out (insn,ops,&len); break; ++ case HImode: ashlhi3_out (insn,ops,&len); break; ++ case SImode: ashlsi3_out (insn,ops,&len); break; ++ default: break; ++ } ++ break; ++ case ASHIFTRT: ++ switch (GET_MODE (op[0])) ++ { ++ case QImode: ashrqi3_out (insn,ops,&len); break; ++ case HImode: ashrhi3_out (insn,ops,&len); break; ++ case SImode: ashrsi3_out (insn,ops,&len); break; ++ default: break; ++ } ++ break; ++ case LSHIFTRT: ++ switch (GET_MODE (op[0])) ++ { ++ case QImode: lshrqi3_out (insn,ops,&len); break; ++ case HImode: lshrhi3_out (insn,ops,&len); break; ++ case SImode: lshrsi3_out (insn,ops,&len); break; ++ default: break; ++ } ++ break; ++ default: ++ break; ++ } ++ } ++ } ++ return len; ++ } ++ ++ ++ int ++ reg_unused_after (insn, reg) ++ rtx insn; ++ rtx reg; ++ { ++ return (0 ++ /* In egcs 1.1.x dead_or_set_p do not properly after reload ++ #ifdef PRESERVE_DEATH_INFO_REGNO_P&&0 ++ || dead_or_set_p (insn,reg) ++ #endif ++ */ ++ ++ || (REG_P(reg) && _reg_unused_after (insn, reg))); ++ } ++ /* Return non-zero if REG is not used after INSN. ++ We assume REG is a reload reg, and therefore does ++ not live past labels. It may live past calls or jumps though. */ ++ int ++ _reg_unused_after (insn, reg) ++ rtx insn; ++ rtx reg; ++ { ++ enum rtx_code code; ++ rtx set; ++ ++ /* If the reg is set by this instruction, then it is safe for our ++ case. Disregard the case where this is a store to memory, since ++ we are checking a register used in the store address. */ ++ set = single_set (insn); ++ if (set && GET_CODE (SET_DEST (set)) != MEM ++ && reg_overlap_mentioned_p (reg, SET_DEST (set))) ++ return 1; ++ ++ while ((insn = NEXT_INSN (insn))) ++ { ++ code = GET_CODE (insn); ++ ++ #if 0 ++ /* If this is a label that existed before reload, then the register ++ if dead here. However, if this is a label added by reorg, then ++ the register may still be live here. We can't tell the difference, ++ so we just ignore labels completely. */ ++ if (code == CODE_LABEL) ++ return 1; ++ /* else */ ++ #endif ++ ++ if (code == JUMP_INSN) ++ return 0; ++ ++ /* If this is a sequence, we must handle them all at once. ++ We could have for instance a call that sets the target register, ++ and a insn in a delay slot that uses the register. In this case, ++ we must return 0. */ ++ else if (code == INSN && GET_CODE (PATTERN (insn)) == SEQUENCE) ++ { ++ int i; ++ int retval = 0; ++ ++ for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++) ++ { ++ rtx this_insn = XVECEXP (PATTERN (insn), 0, i); ++ rtx set = single_set (this_insn); ++ ++ if (GET_CODE (this_insn) == CALL_INSN) ++ code = CALL_INSN; ++ else if (GET_CODE (this_insn) == JUMP_INSN) ++ { ++ if (INSN_ANNULLED_BRANCH_P (this_insn)) ++ return 0; ++ code = JUMP_INSN; ++ } ++ ++ if (set && reg_overlap_mentioned_p (reg, SET_SRC (set))) ++ return 0; ++ if (set && reg_overlap_mentioned_p (reg, SET_DEST (set))) ++ { ++ if (GET_CODE (SET_DEST (set)) != MEM) ++ retval = 1; ++ else ++ return 0; ++ } ++ if (set == 0 ++ && reg_overlap_mentioned_p (reg, PATTERN (this_insn))) ++ return 0; ++ } ++ if (retval == 1) ++ return 1; ++ else if (code == JUMP_INSN) ++ return 0; ++ } ++ ++ if (code == CALL_INSN) ++ { ++ rtx tem; ++ for (tem = CALL_INSN_FUNCTION_USAGE (insn); tem; tem = XEXP (tem, 1)) ++ if (GET_CODE (XEXP (tem, 0)) == USE ++ && REG_P (XEXP (XEXP (tem, 0), 0)) ++ && reg_overlap_mentioned_p (reg, XEXP (XEXP (tem, 0), 0))) ++ return 0; ++ if (call_used_regs[REGNO (reg)]) ++ return 1; ++ } ++ ++ if (GET_RTX_CLASS (code) == 'i') ++ { ++ rtx set = single_set (insn); ++ ++ if (set && reg_overlap_mentioned_p (reg, SET_SRC (set))) ++ return 0; ++ if (set && reg_overlap_mentioned_p (reg, SET_DEST (set))) ++ return GET_CODE (SET_DEST (set)) != MEM; ++ if (set == 0 && reg_overlap_mentioned_p (reg, PATTERN (insn))) ++ return 0; ++ } ++ } ++ return 1; ++ } ++ ++ static int bytes_count; ++ static int must_be_aligned=0; ++ ++ void ++ asm_output_char(file,value) ++ FILE *file; ++ rtx value; ++ { ++ fprintf (file, AS_STR ("\tdc.b ", ++ "\t.byte ")); ++ output_addr_const (file, value); ++ fprintf (file, "\n"); ++ ++bytes_count; ++ } ++ ++ void ++ asm_output_byte (file,value) ++ FILE *file; ++ char value; ++ { ++ fprintf (file, AS_STR ("\tdc.b 0x%x\n", ++ "\t.byte 0x%x\n"),value & 0xff); ++ ++bytes_count; ++ } ++ ++ void ++ asm_output_short(file,value) ++ FILE *file; ++ rtx value; ++ { ++ if (SYMBOL_REF_FLAG (value) || GET_CODE (value) == LABEL_REF) ++ { ++ fprintf (file, AS_STR ("\tdc.w (", ++ "\t.word pm(")); ++ output_addr_const (file, (value)); ++ fprintf (file, AS_STR (") / 2\n", ++ ")\n")); ++ } ++ else ++ { ++ fprintf (file, AS_STR ("\tdc.w (", ++ "\t.word ")); ++ output_addr_const (file, (value)); ++ fprintf (file, AS_STR (") & 0xffff\n","\n")); ++ } ++ } ++ ++ void ++ asm_output_float (file, n) ++ FILE *file; ++ REAL_VALUE_TYPE n; ++ { ++ long val; ++ char dstr[100]; ++ ++ REAL_VALUE_TO_TARGET_SINGLE (n, val); ++ REAL_VALUE_TO_DECIMAL (n, "%g", dstr); ++ fprintf (file, AS_STR ("\tdc.l 0x%08lx\t//* %s */\n", ++ "\t.long 0x%08lx\t/* %s */\n"),val, dstr); ++ } ++ ++ ++ void ++ unique_section (decl, reloc) ++ tree decl; ++ int reloc; ++ { ++ int len; ++ char *name,*string; ++ char *prefix; ++ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); ++ /* Strip off any encoding in name. */ ++ STRIP_NAME_ENCODING (name, name); ++ ++ if (TREE_CODE (decl) == FUNCTION_DECL) ++ { ++ if (flag_function_sections) ++ prefix = AS_STR ("removable flash.code.f_", ++ ".text."); ++ else ++ prefix = AS_STR ("flash.code.f_", ++ ".text"); ++ } ++ else ++ fatal ("Strange situation: unique section is not a FUNCTION_DECL"); ++ ++ if (!TARGET_AVA && !flag_function_sections) ++ name = ""; ++ ++ len = strlen (name) + strlen (prefix); ++ string = alloca (len + 1); ++ sprintf (string, "%s%s", prefix, name); ++ DECL_SECTION_NAME (decl) = build_string (len, string); ++ } ++ ++ static void ++ output_align () ++ { ++ if (TARGET_AVA) ++ { ++ fprintf (asm_out_file, "/* aligning segment */\n"); ++ if (bytes_count & 1) ++ ASM_OUTPUT_BYTE (asm_out_file,0); ++ must_be_aligned=0; ++ } ++ } ++ ++ char * ++ avr_change_section (sect_name) ++ char *sect_name; ++ { ++ if (must_be_aligned) ++ output_align(); ++ return sect_name; ++ } ++ ++ void ++ asm_output_section_name(file, decl, name, reloc) ++ FILE *file; ++ tree decl; ++ char *name; ++ int reloc; ++ { ++ if (must_be_aligned) ++ output_align(); ++ fprintf (file, AS_STR ("\tseg %s\n", ++ ".section %s\n"), name); ++ if (TARGET_AVA && !strncmp (name,"flash",strlen ("flash"))) ++ { ++ bytes_count = 0; ++ must_be_aligned=1; ++ } ++ } ++ ++ ++ ++ ++ ++ /* The routine used to output NUL terminated strings. We use a special ++ version of this for most svr4 targets because doing so makes the ++ generated assembly code more compact (and thus faster to assemble) ++ as well as more readable, especially for targets like the i386 ++ (where the only alternative is to output character sequences as ++ comma separated lists of numbers). */ ++ ++ gas_output_limited_string(file, str) ++ FILE * file; ++ char * str; ++ { ++ unsigned char *_limited_str = (unsigned char *) str; ++ unsigned ch; ++ fprintf (file, "\t%s\t\"", STRING_ASM_OP); ++ for (; ch = *_limited_str; _limited_str++) ++ { ++ int escape; ++ switch (escape = ESCAPES[ch]) ++ { ++ case 0: ++ putc (ch, file); ++ break; ++ case 1: ++ fprintf (file, "\\%03o", ch); ++ break; ++ default: ++ putc ('\\', file); ++ putc (escape, file); ++ break; ++ } ++ } ++ fprintf (file, "\"\n"); ++ } ++ ++ /* The routine used to output sequences of byte values. We use a special ++ version of this for most svr4 targets because doing so makes the ++ generated assembly code more compact (and thus faster to assemble) ++ as well as more readable. Note that if we find subparts of the ++ character sequence which end with NUL (and which are shorter than ++ STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */ ++ ++ gas_output_ascii(file, str, length) ++ FILE * file; ++ char * str; ++ size_t length; ++ { ++ unsigned char *_ascii_bytes = (unsigned char *) str; ++ unsigned char *limit = _ascii_bytes + length; ++ unsigned bytes_in_chunk = 0; ++ for (; _ascii_bytes < limit; _ascii_bytes++) ++ { ++ register unsigned char *p; ++ if (bytes_in_chunk >= 60) ++ { ++ fprintf (file, "\"\n"); ++ bytes_in_chunk = 0; ++ } ++ for (p = _ascii_bytes; p < limit && *p != '\0'; p++) ++ continue; ++ if (p < limit && (p - _ascii_bytes) <= STRING_LIMIT) ++ { ++ if (bytes_in_chunk > 0) ++ { ++ fprintf (file, "\"\n"); ++ bytes_in_chunk = 0; ++ } ++ gas_output_limited_string (file, _ascii_bytes); ++ _ascii_bytes = p; ++ } ++ else ++ { ++ int escape; ++ unsigned ch; ++ if (bytes_in_chunk == 0) ++ fprintf (file, "\t.ascii\t\""); ++ switch (escape = ESCAPES[ch = *_ascii_bytes]) ++ { ++ case 0: ++ putc (ch, file); ++ bytes_in_chunk++; ++ break; ++ case 1: ++ fprintf (file, "\\%03o", ch); ++ bytes_in_chunk += 4; ++ break; ++ default: ++ putc ('\\', file); ++ putc (escape, file); ++ bytes_in_chunk += 2; ++ break; ++ } ++ } ++ } ++ if (bytes_in_chunk > 0) ++ fprintf (file, "\"\n"); ++ } ++ ++ void ++ avr_output_ascii (file,p,size) ++ FILE *file; ++ char *p; ++ int size; ++ { ++ if (TARGET_AVA) ++ { ++ while (size--) ++ ASM_OUTPUT_BYTE (file, *p++); ++ } ++ else ++ gas_output_ascii (file, p, size); ++ } ++ ++ int ++ debug_hard_reg_set (HARD_REG_SET set) ++ { ++ int i; ++ for (i=0; i < FIRST_PSEUDO_REGISTER; ++i) ++ { ++ if (TEST_HARD_REG_BIT (set, i)) ++ { ++ fprintf (stderr, "r%-2d ", i); ++ } ++ } ++ fprintf (stderr, "\n"); ++ } ++ ++ ++ enum reg_class ++ class_likely_spilled_p(int c) ++ { ++ return ++ #if 0 ++ (c == BASE_POINTER_REGS ++ || c == POINTER_REGS ++ ); ++ #else ++ (c != ALL_REGS ++ && c != ADDW_REGS ++ ); ++ #endif ++ } ++ ++ /* ++ Predicate function for memory address operand with displacement ++ */ ++ int ++ displacement_operand (x,mode) ++ rtx x; ++ enum machine_mode mode; ++ { ++ return (GET_CODE (x) == CONST_INT ++ && INTVAL (x) >= 0 ++ && INTVAL (x) <= 64 - GET_MODE_SIZE (mode)); ++ } ++ ++ /* ++ Only `progmem' attribute valid for type. ++ */ ++ int ++ valid_machine_type_attribute(type, attributes, identifier, args) ++ tree type; ++ tree attributes; ++ tree identifier; ++ tree args; ++ { ++ return is_attribute_p ("progmem", identifier); ++ } ++ ++ /* ++ If IDENTIFIER with arguments ARGS is a valid machine specific ++ attribute for DECL return 1. ++ Valid attributes: ++ progmem - put data to program memory; ++ signal - make a function to be hardware interrupt. After function ++ epilogue interrupts are disabled; ++ interrupt - make a function to be hardware interrupt. After function ++ epilogue interrupts are enabled; ++ naked - don't generate function prologue, epilogue and `ret' command. ++ */ ++ int ++ valid_machine_decl_attribute (decl, attributes, attr, args) ++ tree decl; ++ tree attributes; ++ tree attr; ++ tree args; ++ { ++ if (is_attribute_p ("interrupt", attr) ++ || is_attribute_p ("signal", attr) ++ || is_attribute_p ("naked", attr)) ++ return TREE_CODE (decl) == FUNCTION_DECL; ++ ++ if (is_attribute_p ("progmem", attr) ++ && (TREE_STATIC (decl) || DECL_EXTERNAL (decl))) ++ { ++ if (DECL_INITIAL (decl) == NULL_TREE) ++ { ++ warning ("Only initialized variables can be placed into program memory area."); ++ return 0; ++ } ++ return 1; ++ } ++ return 0; ++ } ++ ++ ++ /* Look for attribute `progmem' in DECL ++ founded - 1 otherwise 0 */ ++ ++ avr_progmem_p (decl) ++ tree decl; ++ { ++ tree a; ++ ++ if (TREE_CODE (decl) != VAR_DECL) ++ return 0; ++ ++ if (NULL_TREE ++ != lookup_attribute ("progmem", DECL_MACHINE_ATTRIBUTES (decl))) ++ return 1; ++ ++ a=decl; ++ do ++ a = TREE_TYPE(a); ++ while (TREE_CODE (a) == ARRAY_TYPE); ++ ++ if (NULL_TREE != lookup_attribute ("progmem", TYPE_ATTRIBUTES (a))) ++ return 1; ++ ++ return 0; ++ } ++ ++ void ++ encode_section_info (decl) ++ tree decl; ++ { ++ if (TREE_CODE (decl) == FUNCTION_DECL) ++ { ++ char *name, *string; ++ char *prefix = AS_STR ("flash.code.f_", ++ ".text"); ++ int len; ++ SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1; ++ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); ++ /* Strip off any encoding in fnname. */ ++ STRIP_NAME_ENCODING (name, name); ++ ++ if (! flag_function_sections) ++ { ++ if (! TARGET_AVA) ++ name = ""; ++ len = strlen (name) + strlen (prefix); ++ string = alloca (len + 1); ++ sprintf (string, "%s%s", prefix, name); ++ ++ DECL_SECTION_NAME (decl) = build_string (len, string); ++ } ++ } ++ else if ((TREE_STATIC (decl) || DECL_EXTERNAL (decl)) ++ && TREE_CODE (decl) == VAR_DECL ++ && avr_progmem_p (decl)) ++ { ++ char * dsec = AS_STR ("flash.data", ++ ".progmem.data"); ++ DECL_SECTION_NAME (decl) = build_string (strlen (dsec), dsec); ++ } ++ } ++ ++ ++ char *avr_bss_section_name; ++ char *avr_data_section_name; ++ ++ char * ++ normalize_file_name (name) ++ char *name; ++ { ++ static char c[1000]; ++ int i; ++ char *n = name + strlen(name); ++ c[999]=0; ++ i = 999; ++ while(n != name) ++ { ++ char tmp = *(--n); ++ if ((tmp >= 'a' && tmp <= 'z') ++ || (tmp >= 'A' && tmp <= 'Z') ++ || tmp == '_' ++ || (tmp >= '0' && tmp <= '9')) ++ { ++ c[--i]=tmp; ++ if (i==0) ++ break; ++ } ++ } ++ return &c[i]; ++ } ++ ++ extern char * main_input_filename; ++ ++ static void ++ init_section_names () ++ { ++ char *bss; ++ char *data; ++ char *file = normalize_file_name (main_input_filename); ++ if (TARGET_AVA) ++ { ++ /* AVA assembler version */ ++ if (flag_function_sections) ++ { ++ bss = "\tseg removable eram.gcc_bss_section.AA"; ++ data = "\tseg removable eram.gcc_data_section.AA"; ++ } ++ else ++ { ++ bss = "\tseg eram.gcc_bss_section"; ++ data = "\tseg eram.gcc_data_section"; ++ } ++ } ++ else ++ { ++ /* GAS assembler version */ ++ bss = ".section .bss"; ++ data = ".section .data"; ++ } ++ ++ ++ ++ if (avr_bss_section_name) ++ free (avr_bss_section_name); ++ if (avr_data_section_name) ++ free (avr_data_section_name); ++ ++ avr_bss_section_name = malloc (strlen (bss) + strlen (file) + 1); ++ avr_data_section_name = malloc (strlen (data) + strlen (file) + 1); ++ ++ strcpy (avr_bss_section_name,bss); ++ strcpy (avr_data_section_name,data); ++ ++ if (TARGET_AVA && flag_function_sections) ++ { ++ strcat (avr_bss_section_name,file); ++ strcat (avr_data_section_name,file); ++ } ++ } ++ ++ void ++ asm_file_start (file) ++ FILE *file; ++ { ++ init_section_names (); ++ if (TARGET_AVA) ++ { ++ if (TARGET_INCLUDE) ++ fprintf (file, ++ "#include \"target.inc\"\n" ++ "#ifndef __AVR_ARCH_VER\n" ++ "#arch %s\n" ++ "#endif\n", avr_mcu_type->ava_name); ++ else ++ fprintf (file, "#arch %s\n", avr_mcu_type->ava_name); ++ fputs ("#define __SREG__ 0x3f\n" ++ "#define __SP_H__ 0x3e\n" ++ "#define __SP_L__ 0x3d\n", file); ++ } ++ else ++ { ++ /* GAS version */ ++ output_file_directive (file, main_input_filename); ++ fprintf (file, "\t.arch %s\n", avr_mcu_type->name); ++ fputs ("__SREG__ = 0x3f\n" ++ "__SP_H__ = 0x3e\n" ++ "__SP_L__ = 0x3d\n", file); ++ ++ } ++ ++ if (avr_ram_end) ++ initial_stack = avr_ram_end; ++ else ++ { ++ static char buf[30]; ++ initial_stack = buf; ++ sprintf (buf, "0x%x", avr_mcu_type->stack); ++ } ++ ++ ++ if (TARGET_INCLUDE && TARGET_AVA) ++ fprintf (file, ++ "#ifndef __INIT_STACK\n" ++ "#define __INIT_STACK %s\n" ++ "#endif\n", initial_stack); ++ ++ if (TARGET_AVA) ++ { ++ fputs ("#define lo8(x) ((x)&0xff)\n" ++ "#define hi8(x) (((x)>>8)&0xff)\n" ++ "#define hlo8(x) (((x)>>16)&0xff)\n" ++ "#define hhi8(x) (((x)>>24)&0xff)\n" ++ "#define pm(x) ((x)/2)\n" ++ "#define pm_lo8(x) lo8(pm(x))\n" ++ "#define pm_hi8(x) hi8(pm(x))\n" ++ "#define pm_hlo8(x) hlo8(pm(x))\n" ++ "#define pm_hhi8(x) hhi8(pm(x))\n" ++ "#define __tmp_reg__ r0\n" ++ "#define __zero_reg__ r1\n" ++ "#define _PC_ 0\n" ++ "\n" ++ "extern __prologue_saves__\n" ++ "extern __epilogue_restores__\n", file); ++ } ++ else ++ { ++ fputs ("__tmp_reg__ = r0\n" ++ "__zero_reg__ = r1\n" ++ "_PC_ = 2\n", file); ++ } ++ commands_in_file = 0; ++ commands_in_prologues = 0; ++ commands_in_epilogues = 0; ++ } ++ ++ void ++ asm_file_end (file) ++ FILE *file; ++ { ++ fprintf (file, ++ "/* File %s: code %4d (%4d), prologues %3d, epilogues %3d */\n", ++ main_input_filename, ++ commands_in_file, ++ commands_in_file - commands_in_prologues - commands_in_epilogues, ++ commands_in_prologues, commands_in_epilogues); ++ } ++ ++ void ++ asm_output_external (file, decl, name) ++ FILE *file; ++ tree decl; ++ char *name; ++ { ++ if (TARGET_AVA && ! (decl && DECL_INLINE (decl))) ++ { ++ fputs ("extern ", file); ++ assemble_name (file, name); ++ fputs ("\n", file); ++ } ++ } ++ ++ void ++ asm_output_external_libcall(file, symref) ++ FILE *file; ++ rtx symref; ++ { ++ if (TARGET_AVA) ++ fprintf (file, "extern _%s\n", XSTR (symref,0)); ++ } ++ ++ void ++ order_regs_for_local_alloc () ++ { ++ unsigned int i; ++ int order_0[] = { ++ #ifdef FROM_25_TO_8 ++ 24,25, ++ 18,19, ++ 20,21, ++ 22,23, ++ 30,31, ++ 26,27, ++ 28,29, ++ 17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2, ++ 0,1, ++ 32,33,34,35 ++ #else ++ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, ++ 24,25, ++ 16,17,18,19,20,21,22,23, ++ 28,29,30,31,26,27, ++ 32,33,34,35 ++ #endif ++ }; ++ int order_1[] = { ++ 18,19, ++ 20,21, ++ 22,23, ++ 24,25, ++ 30,31, ++ 26,27, ++ 28,29, ++ 17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2, ++ 0,1, ++ 32,33,34,35 ++ }; ++ int order_2[] = { ++ 25,24, ++ 23,22, ++ 21,20, ++ 19,18, ++ 30,31, ++ 26,27, ++ 28,29, ++ 17,16, ++ 15,14,13,12,11,10,9,8,7,6,5,4,3,2, ++ 1,0, ++ 32,33,34,35 ++ }; ++ ++ int *order = (TARGET_ORDER_1 ? order_1 : ++ TARGET_ORDER_2 ? order_2 : ++ order_0); ++ for (i=0; i < sizeof (order_0) / sizeof (order_0[0]); ++i) ++ reg_alloc_order[i] = order[i]; ++ } ++ ++ /* Calculate the cost of X code of the expression in which it is contained, ++ found in OUTER_CODE */ ++ ++ int ++ default_rtx_costs (X, code, outer_code) ++ rtx X; ++ enum rtx_code code; ++ enum rtx_code outer_code; ++ { ++ int cost=0; ++ switch (code) ++ { ++ case SYMBOL_REF: ++ case LABEL_REF: ++ cost = 2 * GET_MODE_SIZE (GET_MODE (X)); ++ break; ++ case MEM: ++ if (outer_code != SET) ++ cost = 1; ++ if (GET_CODE (XEXP (X,0)) == SYMBOL_REF) ++ cost += 2 * GET_MODE_SIZE (GET_MODE (X)); ++ else ++ cost += GET_MODE_SIZE (GET_MODE (X)); ++ break; ++ case CONST_INT: ++ cost = 0; ++ break; ++ case SIGN_EXTEND: ++ if (outer_code == SET) ++ cost = GET_MODE_SIZE (GET_MODE (X)); ++ else ++ cost = -GET_MODE_SIZE (GET_MODE (X)); ++ break; ++ case ZERO_EXTEND: ++ if (outer_code == SET) ++ cost = GET_MODE_SIZE (GET_MODE (X)); ++ else ++ cost = -1; ++ break; ++ case PLUS: ++ case MINUS: ++ if (outer_code == SET) ++ { ++ if (X == stack_pointer_rtx) ++ cost = -10; ++ else if (GET_CODE (XEXP (X,1)) == CONST_INT) ++ cost = (INTVAL (XEXP (X,1)) <= 63 ? 1 : ++ GET_MODE_SIZE (GET_MODE (X))); ++ else ++ cost = GET_MODE_SIZE (GET_MODE (X)); ++ } ++ break; ++ case COMPARE: ++ if (GET_CODE (XEXP (X,1)) == CONST_INT) ++ cost = GET_MODE_SIZE (GET_MODE (XEXP (X,0))); ++ break; ++ default: ++ break; ++ } ++ return cost; ++ } ++ ++ /* Calculate cost of memory address */ ++ int ++ avr_address_cost (rtx x) ++ { ++ if (GET_CODE (x) == PLUS ++ && GET_CODE (XEXP (x,1)) == CONST_INT ++ && (REG_P (XEXP (x,0)) || GET_CODE (XEXP (x,0)) == SUBREG) ++ && INTVAL (XEXP (x,1)) >= 61) ++ return 18; ++ if (CONSTANT_ADDRESS_P (x)) ++ return 4; ++ return 2; ++ } ++ ++ ++ /* ++ My expirience with EXTRA_CONSTRAINT as recommended by Jeffrey A Law ++ Bad result! ++ */ ++ int ++ extra_constraint (x,c) ++ rtx x; ++ char c; ++ { ++ if (c == 'Q' ++ && GET_CODE (x) == MEM ++ && GET_CODE (XEXP (x,0)) == PLUS) ++ { ++ if (TARGET_ALL_DEBUG) ++ { ++ fprintf (stderr, ("extra_constraint:\n" ++ "reload_completed: %d\n" ++ "reload_in_progress: %d\n"), ++ reload_completed, reload_in_progress); ++ debug_rtx (x); ++ } ++ if (GET_CODE (x) == MEM ++ && GET_CODE (XEXP (x,0)) == PLUS ++ && REG_P (XEXP (XEXP (x,0), 0)) ++ && GET_CODE (XEXP (XEXP (x,0), 1)) == CONST_INT ++ && (INTVAL (XEXP (XEXP (x,0), 1)) ++ <= (64 - GET_MODE_SIZE (GET_MODE (x))))) ++ { ++ rtx xx = XEXP (XEXP (x,0), 0); ++ int regno = REGNO (xx); ++ if (TARGET_ALL_DEBUG) ++ { ++ fprintf (stderr, ("extra_constraint:\n" ++ "reload_completed: %d\n" ++ "reload_in_progress: %d\n"), ++ reload_completed, reload_in_progress); ++ debug_rtx (x); ++ } ++ if (regno >= FIRST_PSEUDO_REGISTER) ++ return 1; /* allocate pseudos */ ++ else if (regno == REG_Z || regno == REG_Y) ++ return 1; /* strictly check */ ++ else if (xx == frame_pointer_rtx ++ || xx == arg_pointer_rtx) ++ return 1; /* XXX frame & arg pointer checks */ ++ } ++ } ++ return 0; ++ } ++ ++ /* ++ This function is my expirience with modifying of ++ function record_address_regs ++ */ ++ enum reg_class ++ correct_address_class (x, class, scale) ++ rtx x; ++ enum reg_class class; ++ int scale; ++ { ++ if (class == BASE_REG_CLASS) ++ { ++ if (GET_CODE (x) == PLUS ++ && GET_CODE (XEXP (x,0)) == REG ++ && GET_CODE (XEXP (x,1)) == CONST_INT) ++ class = BASE_POINTER_REGS; ++ } ++ return class; ++ } ++ ++ RTX_CODE ++ avr_normalize_condition (condition) ++ RTX_CODE condition; ++ { ++ switch (condition) ++ { ++ case GT: ++ return GE; ++ case GTU: ++ return GEU; ++ case LE: ++ return LT; ++ case LEU: ++ return LTU; ++ default: ++ fatal ("Internal compiler bug. Wrong condition: %s", ++ GET_RTX_NAME (condition)); ++ } ++ } ++ ++ void ++ machine_dependent_reorg (first_insn) ++ rtx first_insn; ++ { ++ rtx insn, pattern; ++ CC_STATUS_INIT; ++ ++ for (insn = first_insn; insn; insn = NEXT_INSN (insn)) ++ { ++ if (! (insn == 0 || GET_CODE (insn) == INSN ++ || GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == JUMP_INSN) ++ || !single_set (insn)) ++ continue; ++ ++ pattern = PATTERN (insn); ++ ++ cc_prev_status = cc_status; ++ NOTICE_UPDATE_CC (pattern, insn); ++ ++ if (GET_CODE (pattern) == PARALLEL) ++ pattern = XVECEXP (pattern, 0, 0); ++ if (GET_CODE (pattern) == SET ++ && SET_DEST (pattern) == cc0_rtx ++ && compare_diff_p (insn)) ++ { ++ if (GET_CODE (SET_SRC (pattern)) == COMPARE) ++ { ++ /* Now we work under compare insn */ ++ ++ pattern = SET_SRC (pattern); ++ if (true_regnum (XEXP (pattern,0)) >= 0 ++ && true_regnum (XEXP (pattern,1)) >= 0 ) ++ { ++ rtx x = XEXP (pattern,0); ++ rtx next = next_real_insn (insn); ++ rtx pat = PATTERN (next); ++ rtx src = SET_SRC (pat); ++ rtx t = XEXP (src,0); ++ PUT_CODE (t, swap_condition (GET_CODE (t))); ++ XEXP (pattern,0) = XEXP (pattern,1); ++ XEXP (pattern,1) = x; ++ INSN_CODE (next) = -1; ++ } ++ else if (true_regnum (XEXP (pattern,0)) >= 0 ++ && GET_CODE (XEXP (pattern,1)) == CONST_INT) ++ { ++ rtx x = XEXP (pattern,1); ++ rtx next = next_real_insn (insn); ++ rtx pat = PATTERN (next); ++ rtx src = SET_SRC (pat); ++ rtx t = XEXP (src,0); ++ ++ if (avr_simplify_comparision_p (GET_MODE (XEXP (pattern,0)), ++ GET_CODE (t), x)) ++ { ++ XEXP (pattern,1) = GEN_INT (INTVAL (x)+1); ++ PUT_CODE (t, avr_normalize_condition (GET_CODE (t))); ++ INSN_CODE (next) = -1; ++ INSN_CODE (insn) = -1; ++ } ++ } ++ } ++ else if (true_regnum (SET_SRC (pattern)) >= 0) ++ { ++ /* This is a tst insn */ ++ rtx next = next_real_insn (insn); ++ rtx pat = PATTERN (next); ++ rtx src = SET_SRC (pat); ++ rtx t = XEXP (src,0); ++ ++ if (!(cc_prev_status.value1 != 0 && cc_status.value1 != 0 ++ && rtx_equal_p (cc_status.value1, cc_prev_status.value1))) ++ { ++ PUT_CODE (t, swap_condition (GET_CODE (t))); ++ SET_SRC (pattern) = gen_rtx (NEG, ++ GET_MODE (SET_SRC (pattern)), ++ SET_SRC (pattern)); ++ INSN_CODE (next) = -1; ++ INSN_CODE (insn) = -1; ++ } ++ } ++ } ++ } ++ } ++ ++ int ++ avr_ret_register () ++ { ++ return 24; ++ } ++ ++ rtx ++ avr_libcall_value (mode) ++ enum machine_mode mode; ++ { ++ int offs = GET_MODE_SIZE (mode); ++ if (offs < 2) ++ offs = 2; ++ return gen_rtx (REG, mode, RET_REGISTER + 2 - offs); ++ } ++ ++ rtx ++ avr_function_value (type,func) ++ tree type; ++ tree func; ++ { ++ int offs; ++ if (TYPE_MODE (type) != BLKmode) ++ return avr_libcall_value (TYPE_MODE (type)); ++ ++ offs = int_size_in_bytes (type); ++ if (offs < 2) ++ offs = 2; ++ if (offs > 2 && offs < GET_MODE_SIZE (SImode)) ++ offs = GET_MODE_SIZE (SImode); ++ else if (offs > GET_MODE_SIZE (SImode) && offs < GET_MODE_SIZE (DImode)) ++ offs = GET_MODE_SIZE (DImode); ++ ++ return gen_rtx (REG, BLKmode, RET_REGISTER + 2 - offs); ++ } ++ ++ int ++ mask_one_bit_p (mask) ++ HOST_WIDE_INT mask; ++ { ++ int i; ++ unsigned HOST_WIDE_INT n=mask; ++ for (i = 0; i < 32; ++i) ++ { ++ if (n & 0x80000000UL) ++ { ++ if (n & 0x7fffffffUL) ++ return 0; ++ else ++ return 32-i; ++ } ++ n<<=1; ++ } ++ return 0; ++ } ++ ++ ++ ++ enum reg_class ++ preferred_reload_class(x,class) ++ rtx x; ++ enum reg_class class; ++ { ++ if (GET_CODE (x) == CONST_INT && INTVAL (x) == 0) ++ return class; ++ if (CONSTANT_P (x) && (class == NO_LD_REGS ++ || class == ALL_REGS ++ || class == GENERAL_REGS)) ++ { ++ return LD_REGS; ++ } ++ return class; ++ } ++ ++ ++ enum reg_class ++ secondary_input_reload_class (class, mode, x) ++ enum reg_class class; ++ enum machine_mode mode; ++ rtx x; ++ { ++ if ((class == NO_LD_REGS || class == GENERAL_REGS) ++ && CONSTANT_P (x) ++ && ! (GET_CODE (x) == CONST_INT && INTVAL (x) == 0)) ++ { ++ return SIMPLE_LD_REGS; ++ } ++ return NO_REGS; ++ } ++ ++ char * ++ output_reload_insisf (insn, operands, which_alternative) ++ rtx insn; ++ rtx *operands; ++ int which_alternative; ++ { ++ int cnst = (GET_CODE (operands[1]) == CONST_INT); ++ if (cnst && ((INTVAL (operands[1]) & 0xff) == 0)) ++ output_asm_insn (AS2 (mov, %A0, __zero_reg__), operands); ++ else ++ { ++ output_asm_insn (AS2 (ldi, %2, lo8(%1)), operands); ++ output_asm_insn (AS2 (mov, %A0, %2), operands); ++ } ++ if (cnst && ((INTVAL (operands[1]) & 0xff00) == 0)) ++ output_asm_insn (AS2 (mov, %B0, __zero_reg__), operands); ++ else ++ { ++ output_asm_insn (AS2 (ldi, %2, hi8(%1)), operands); ++ output_asm_insn (AS2 (mov, %B0, %2), operands); ++ } ++ if (cnst && ((INTVAL (operands[1]) & 0xff0000) == 0)) ++ output_asm_insn (AS2 (mov, %C0, __zero_reg__), operands); ++ else ++ { ++ output_asm_insn (AS2 (ldi, %2, hlo8(%1)), operands); ++ output_asm_insn (AS2 (mov, %C0, %2), operands); ++ } ++ if (cnst && ((INTVAL (operands[1]) & 0xff000000) == 0)) ++ output_asm_insn (AS2 (mov, %D0, __zero_reg__), operands); ++ else ++ { ++ output_asm_insn (AS2 (ldi, %2, hhi8(%1)), operands); ++ output_asm_insn (AS2 (mov, %D0, %2), operands); ++ } ++ return ""; ++ } ++ ++ char * ++ output_reload_inhi (insn, operands, which_alternative) ++ rtx insn; ++ rtx *operands; ++ int which_alternative; ++ { ++ output_asm_insn (AS2 (ldi, %2, lo8(%1)), operands); ++ output_asm_insn (AS2 (mov, %A0, %2), operands); ++ if (! (GET_CODE (operands[1]) == CONST_INT ++ && ((INTVAL (operands[1]) & 0xff) ++ == ((INTVAL (operands[1]) & 0xffff) >> 8)))) ++ output_asm_insn (AS2 (ldi, %2, hi8(%1)), operands); ++ output_asm_insn (AS2 (mov, %B0, %2), operands); ++ return ""; ++ } ++ ++ void ++ asm_globalize_label (file,name) ++ FILE *file; ++ char *name; ++ { ++ if (TARGET_AVA) ++ make_it_public=1; ++ else ++ { ++ fprintf (file, ".global\t"); ++ assemble_name (file, name); ++ fprintf (file, "\n"); ++ } ++ } ++ ++ ++ #if 0 ++ ++ rtx ++ try_auto_inc_1 (reg, mem_addr, set) ++ rtx reg; ++ rtx mem_addr; ++ rtx set; ++ { ++ if (GET_CODE (set) == SET) ++ { ++ rtx addr = XEXP (mem_addr,0); ++ HOST_WIDE_INT offset = 0; ++ ++ if (GET_CODE (addr) == PLUS ++ && GET_CODE (XEXP (addr, 1)) == CONST_INT) ++ offset = INTVAL (XEXP (addr, 1)), addr = XEXP (addr, 0); ++ ++ if (GET_CODE (addr) == REG ++ && ! reg_overlap_mentioned_p (addr, reg)) ++ { ++ register rtx y; ++ register int size = GET_MODE_SIZE (GET_MODE (mem_addr)); ++ ++ /* Is the next use an increment that might make auto-increment? */ ++ if ((y = SET_SRC (set), GET_CODE (y) == PLUS) ) ++ if (XEXP (y, 0) == addr && addr == SET_DEST (y)) ++ if (GET_CODE (XEXP (y, 1)) == CONST_INT) ++ if ((HAVE_POST_INCREMENT ++ && (INTVAL (XEXP (y, 1)) == size && offset == 0)) ++ || (HAVE_POST_DECREMENT ++ && (INTVAL (XEXP (y, 1)) == - size && offset == 0)) ++ || (HAVE_PRE_INCREMENT ++ && (INTVAL (XEXP (y, 1)) == size && offset == size)) ++ || (HAVE_PRE_DECREMENT ++ && (INTVAL (XEXP (y, 1)) == - size ++ && offset == - size))) ++ { ++ enum rtx_code inc_code = (INTVAL (XEXP (y, 1)) == size ++ ? (offset ? PRE_INC : POST_INC) ++ : (offset ? PRE_DEC : POST_DEC)); ++ ++ /* This is the simple case. Try to make the auto-inc. */ ++ return gen_rtx_MEM (GET_MODE (mem_addr), ++ gen_rtx_fmt_e (inc_code, Pmode, addr)); ++ } ++ } ++ } ++ return NULL_RTX; ++ } ++ ++ rtx ++ try_auto_inc (pnewpat, insn, pnotes) ++ rtx *pnewpat; ++ rtx insn; ++ rtx *pnotes; ++ { ++ rtx pat = *pnewpat; ++ rtx new_rtx; ++ rtx *new_mem; ++ if (GET_CODE (pat) == PARALLEL ++ && XVECLEN (pat, 0) == 2) ++ { ++ rtx incr = XVECEXP (pat, 0, 1); ++ rtx x = XVECEXP (pat, 0, 0); ++ rtx addr; ++ rtx reg; ++ if (GET_CODE (SET_SRC (x)) == MEM && REG_P (SET_DEST (x))) ++ { ++ addr = SET_SRC (x); ++ reg = SET_DEST (x); ++ new_rtx = gen_rtx_SET (VOIDmode, reg, addr); ++ new_mem = &XEXP (new_rtx,1); ++ } ++ else if (GET_CODE (SET_DEST (x)) == MEM && REG_P (SET_SRC (x))) ++ { ++ addr = SET_DEST (x); ++ reg = SET_SRC (x); ++ new_rtx = gen_rtx_SET (VOIDmode, addr, reg); ++ new_mem = &XEXP (new_rtx,0); ++ } ++ else ++ return *pnewpat; ++ if (pat = try_auto_inc_1 (reg, addr, incr)) ++ { ++ *new_mem = pat; ++ *pnewpat = new_rtx; ++ /* insn has an implicit side effect. */ ++ /* REG_NOTES (insn) */ ++ /* = gen_rtx_EXPR_LIST (REG_INC, XEXP (addr,0), REG_NOTES (insn)); */ ++ *pnotes = gen_rtx_EXPR_LIST (REG_INC, XEXP (addr,0), 0); ++ } ++ } ++ return *pnewpat; ++ } ++ #endif ++ ++ void my_deb () ++ { ++ } ++ ++ void deb_deb (int i) ++ { ++ if (i == 125) ++ my_deb (); ++ } ++ +diff -Nrc3p gcc-2.95.2.orig/gcc/config/avr/avr.md gcc-2.95.2/gcc/config/avr/avr.md +*** gcc-2.95.2.orig/gcc/config/avr/avr.md Sat Dec 18 17:50:17 1999 +--- gcc-2.95.2/gcc/config/avr/avr.md Thu Dec 23 23:18:45 1999 +*************** +*** 0 **** +--- 1,2316 ---- ++ ;; -*- Mode: Scheme -*- ++ ;; Machine description for GNU compiler, ++ ;; for ATMEL AVR micro controller. ++ ;; Copyright (C) 1998, 1999 by Denis Chertykov (denisc@overta.ru) ++ ;; ++ ;; You can redistribute it and/or modify ++ ;; it under the terms of the GNU General Public License as published by ++ ;; the Free Software Foundation; either version 2, or (at your option) ++ ;; any later version. ++ ++ ;; Condition code settings. ++ (define_attr "cc" "none,set_czn,set_zn,set_n,compare,clobber" ++ (const_string "none")) ++ ++ (define_attr "type" "branch,branch1,arith" ++ (const_string "arith")) ++ ++ ;; The size of instructions in bytes. ++ ;; XXX may depend from "cc" ++ ++ (define_attr "length" "" ++ (cond [(eq_attr "type" "branch") ++ (if_then_else (and (ge (minus (pc) (match_dup 0)) ++ (const_int -63)) ++ (le (minus (pc) (match_dup 0)) ++ (const_int 62))) ++ (const_int 1) ++ (if_then_else (and (ge (minus (pc) (match_dup 0)) ++ (const_int -2045)) ++ (le (minus (pc) (match_dup 0)) ++ (const_int 2045))) ++ (const_int 2) ++ (const_int 2))) ++ (eq_attr "type" "branch1") ++ (if_then_else (and (ge (minus (pc) (match_dup 0)) ++ (const_int -62)) ++ (le (minus (pc) (match_dup 0)) ++ (const_int 61))) ++ (const_int 2) ++ (if_then_else (and (ge (minus (pc) (match_dup 0)) ++ (const_int -2044)) ++ (le (minus (pc) (match_dup 0)) ++ (const_int 2043))) ++ (const_int 3) ++ (const_int 3)))] ++ (const_int 2))) ++ ++ ++ ++ (define_insn "*pop1" ++ [(set (reg:HI 32) (plus:HI (reg:HI 32) (const_int 1)))] ++ "" ++ "pop __tmp_reg__" ++ [(set_attr "length" "1")]) ++ ++ (define_insn "*pop2" ++ [(set (reg:HI 32) (plus:HI (reg:HI 32) (const_int 2)))] ++ "" ++ "pop __tmp_reg__ ++ pop __tmp_reg__" ++ [(set_attr "length" "2")]) ++ ++ (define_insn "*pop3" ++ [(set (reg:HI 32) (plus:HI (reg:HI 32) (const_int 3)))] ++ "" ++ "pop __tmp_reg__ ++ pop __tmp_reg__ ++ pop __tmp_reg__" ++ [(set_attr "length" "3")]) ++ ++ (define_insn "*pop4" ++ [(set (reg:HI 32) (plus:HI (reg:HI 32) (const_int 4)))] ++ "" ++ "pop __tmp_reg__ ++ pop __tmp_reg__ ++ pop __tmp_reg__ ++ pop __tmp_reg__" ++ [(set_attr "length" "4")]) ++ ++ (define_insn "*pop5" ++ [(set (reg:HI 32) (plus:HI (reg:HI 32) (const_int 5)))] ++ "" ++ "pop __tmp_reg__ ++ pop __tmp_reg__ ++ pop __tmp_reg__ ++ pop __tmp_reg__ ++ pop __tmp_reg__" ++ [(set_attr "length" "5")]) ++ ++ (define_insn "*pushqi" ++ [(set (mem:QI (post_dec (reg:HI 32))) ++ (match_operand:QI 0 "nonmemory_operand" "r,L"))] ++ "(operands[0] == const0_rtx || register_operand (operands[0], QImode))" ++ "@ ++ push %0 ++ push __zero_reg__" ++ [(set_attr "length" "1,1")]) ++ ++ ++ (define_insn "*pushhi" ++ [(set (mem:HI (post_dec (reg:HI 32))) ++ (match_operand:HI 0 "nonmemory_operand" "r,L"))] ++ "(operands[0] == const0_rtx || register_operand (operands[0], HImode))" ++ "@ ++ push %B0\;push %A0 ++ push __zero_reg__\;push __zero_reg__" ++ [(set_attr "length" "2,2")]) ++ ++ (define_insn "*pushsi" ++ [(set (mem:SI (post_dec (reg:HI 32))) ++ (match_operand:SI 0 "nonmemory_operand" "r,L"))] ++ "(operands[0] == const0_rtx || register_operand (operands[0], SImode))" ++ "@ ++ push %D0\;push %C0\;push %B0\;push %A0 ++ push __zero_reg__\;push __zero_reg__\;push __zero_reg__\;push __zero_reg__" ++ [(set_attr "length" "4,4")]) ++ ++ (define_insn "*pushsf" ++ [(set (mem:SF (post_dec (reg:HI 32))) ++ (match_operand:SF 0 "register_operand" "r"))] ++ "" ++ "push %D0 ++ push %C0 ++ push %B0 ++ push %A0" ++ [(set_attr "length" "4")]) ++ ++ (define_insn "*mov_r_sp" ++ [(set (match_operand:HI 0 "register_operand" "=r") ++ (reg:HI 32))] ++ "" ++ "in %A0,__SP_L__ ++ in %B0,__SP_H__" ++ [(set_attr "length" "2")]) ++ ++ (define_insn "*mov_sp_r" ++ [(set (reg:HI 32) ++ (match_operand:HI 0 "register_operand" "r"))] ++ "!TARGET_NO_INTERRUPTS" ++ "in __tmp_reg__,__SREG__ ++ cli ++ out __SP_L__,%A0 ++ out __SREG__,__tmp_reg__ ++ out __SP_H__,%B0" ++ [(set_attr "length" "5")]) ++ ++ (define_insn "*mov_sp_r_no_interrupts" ++ [(set (reg:HI 32) ++ (match_operand:HI 0 "register_operand" "r"))] ++ "TARGET_NO_INTERRUPTS" ++ "out __SP_L__,%A0 ++ out __SP_H__,%B0" ++ [(set_attr "length" "2")]) ++ ;============================================================================= ++ ; move byte ++ (define_expand "movqi" ++ [(set (match_operand:QI 0 "nonimmediate_operand" "") ++ (match_operand:QI 1 "general_operand" ""))] ++ "" ++ " ++ { ++ /* One of the ops has to be in a register */ ++ if (!register_operand(operand0, QImode) ++ && ! (register_operand(operand1, QImode) || const0_rtx == operand1)) ++ { ++ operands[1] = copy_to_mode_reg(QImode, operand1); ++ } ++ }"); ++ ++ (define_insn "*movqi" ++ [(set (match_operand:QI 0 "general_operand" "=r,r,d,Qm,r,q") ++ (match_operand:QI 1 "general_operand" "r,L,i,rL,Qm,r"))] ++ "(register_operand (operands[0],QImode) ++ || register_operand (operands[1], QImode) || const0_rtx == operands[1])" ++ "*{ ++ switch (which_alternative) ++ { ++ case 0: ++ return AS2 (mov, %0,%1); ++ case 1: ++ return AS1 (clr, %0); ++ case 2: ++ return AS2 (ldi, %0,lo8(%1)); ++ case 3: ++ { ++ rtx save1=NULL; ++ if (operands[1] == const0_rtx) ++ { ++ save1 = operands[1]; ++ operands[1] = zero_reg_rtx; ++ } ++ output_asm_insn (out_movqi_mr_r (insn,operands,NULL), operands); ++ if (save1) ++ operands[1] = save1; ++ } ++ return \"\"; ++ case 4: ++ return out_movqi_r_mr (insn,operands,NULL); ++ case 5: ++ return (AS2 (in,__tmp_reg__,__SREG__) CR_TAB ++ \"cli\" CR_TAB ++ AS2 (out,__SREG__,__tmp_reg__)CR_TAB ++ AS2 (out,%0,%1)); ++ } ++ }" ++ [(set_attr "length" "1,1,1,5,5,4") ++ (set_attr "cc" "none,clobber,none,clobber,clobber,none")]) ++ ++ (define_expand "reload_inqi" ++ [(parallel [(set (match_operand:QI 0 "register_operand" "=l") ++ (match_operand:QI 1 "immediate_operand" "i")) ++ (clobber (match_operand:QI 2 "register_operand" "=&a"))])] ++ "" ++ "") ++ ++ (define_insn "*reload_inqi" ++ [(set (match_operand:QI 0 "register_operand" "=l") ++ (match_operand:QI 1 "immediate_operand" "i")) ++ (clobber (match_operand:QI 2 "register_operand" "=&a"))] ++ "" ++ "ldd %2,lo8(%1) ++ mov %0,%2" ++ [(set_attr "length" "2") ++ (set_attr "cc" "none")]) ++ ++ ++ ;;============================================================================ ++ ;; move word (16 bit) ++ ++ (define_expand "movhi" ++ [(set (match_operand:HI 0 "nonimmediate_operand" "") ++ (match_operand:HI 1 "general_operand" ""))] ++ "" ++ " ++ { ++ /* One of the ops has to be in a register */ ++ if (!register_operand(operand0, HImode) ++ && !(register_operand(operand1, HImode) || const0_rtx == operands[1])) ++ { ++ operands[1] = copy_to_mode_reg(HImode, operand1); ++ } ++ }") ++ ++ (define_insn "*movhi" ++ [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,d,r,m") ++ (match_operand:HI 1 "general_operand" "r,L,i,m,rL"))] ++ "(register_operand (operands[0],HImode) ++ || register_operand (operands[1],HImode) || const0_rtx == operands[1])" ++ "*{ ++ rtx link; ++ switch (which_alternative) ++ { ++ case 0: /* mov r,r */ ++ if (true_regnum (operands[0]) > true_regnum (operands[1])) ++ return (AS2 (mov,%B0,%B1) CR_TAB ++ AS2 (mov,%A0,%A1)); ++ else ++ return (AS2 (mov,%A0,%A1) CR_TAB ++ AS2 (mov,%B0,%B1)); ++ case 1: /* mov r,L */ ++ return (AS1 (clr,%A0) CR_TAB ++ AS1 (clr,%B0)); ++ case 2: /* mov r,d */ ++ if (operands[1] == const1_rtx ++ && (link = find_reg_note (insn, REG_WAS_0, 0)) ++ /* Make sure the insn that stored the 0 is still present. */ ++ && ! INSN_DELETED_P (XEXP (link, 0)) ++ && GET_CODE (XEXP (link, 0)) != NOTE ++ /* Make sure cross jumping didn't happen here. */ ++ && no_labels_between_p (XEXP (link, 0), insn) ++ /* Make sure the reg hasn't been clobbered. */ ++ && ! reg_set_between_p (operands[0], XEXP (link, 0), insn)) ++ /* Fastest way to change a 0 to a 1. */ ++ return AS1 (inc,%A0 ; reg_was_0); ++ return (AS2 (ldi,%A0,lo8(%1)) CR_TAB ++ AS2 (ldi,%B0,hi8(%1))); ++ case 3: /* mov r,m*/ ++ return out_movhi_r_mr (insn, operands, NULL); ++ case 4: /* mov m,r*/ ++ { ++ rtx save1=NULL; ++ if (operands[1] == const0_rtx) ++ { ++ save1 = operands[1]; ++ operands[1] = zero_reg_rtx; ++ } ++ output_asm_insn (out_movhi_mr_r (insn,operands,NULL), operands); ++ if (save1) ++ operands[1] = save1; ++ } ++ return \"\"; ++ } ++ }" ++ [(set_attr "length" "2,2,2,4,4") ++ (set_attr "cc" "none,set_zn,none,clobber,clobber")]) ++ ++ (define_expand "reload_inhi" ++ [(parallel [(set (match_operand:HI 0 "register_operand" "=l") ++ (match_operand:HI 1 "immediate_operand" "i")) ++ (clobber (match_operand:QI 2 "register_operand" "=&a"))])] ++ "" ++ "") ++ ++ (define_insn "*reload_inhi" ++ [(set (match_operand:HI 0 "register_operand" "=l") ++ (match_operand:HI 1 "immediate_operand" "i")) ++ (clobber (match_operand:QI 2 "register_operand" "=&a"))] ++ "" ++ "* return output_reload_inhi (insn, operands, which_alternative);" ++ [(set_attr "length" "4") ++ (set_attr "cc" "none")]) ++ ++ ;-------------------------------------------- ++ (define_expand "movsi" ++ [(set (match_operand:SI 0 "nonimmediate_operand" "") ++ (match_operand:SI 1 "general_operand" ""))] ++ "" ++ " ++ { ++ /* One of the ops has to be in a register. */ ++ if (!register_operand (operand0, SImode) ++ && !(register_operand (operand1, SImode) || const0_rtx == operand1)) ++ { ++ operands[1] = copy_to_mode_reg (SImode, operand1); ++ } ++ }") ++ ++ (define_insn "*movsi" ++ [(set (match_operand:SI 0 "general_operand" "=r,r,d,r,Qm") ++ (match_operand:SI 1 "general_operand" "r,L,i,Qm,rL"))] ++ "(register_operand (operands[0],SImode) ++ || register_operand (operands[1],SImode) || const0_rtx == operands[1])" ++ "* return output_movsisf (insn, operands, which_alternative);" ++ [(set_attr "length" "4,4,4,8,8") ++ (set_attr "cc" "none,set_zn,none,clobber,clobber")]) ++ ++ (define_expand "reload_insi" ++ [(parallel [(set (match_operand:SI 0 "register_operand" "=l") ++ (match_operand:SI 1 "immediate_operand" "i")) ++ (clobber (match_operand:QI 2 "register_operand" "=&a"))])] ++ "" ++ "") ++ ++ (define_insn "*reload_insi" ++ [(set (match_operand:SI 0 "register_operand" "=l") ++ (match_operand:SI 1 "immediate_operand" "i")) ++ (clobber (match_operand:QI 2 "register_operand" "=&a"))] ++ "" ++ "* return output_reload_insisf (insn, operands, which_alternative);" ++ [(set_attr "length" "8") ++ (set_attr "cc" "none")]) ++ ;; fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ++ ++ (define_expand "movsf" ++ [(set (match_operand:SF 0 "nonimmediate_operand" "") ++ (match_operand:SF 1 "general_operand" ""))] ++ "" ++ " ++ { ++ /* One of the ops has to be in a register. */ ++ if (!register_operand (operand1, SFmode) ++ && !register_operand (operand0, SFmode)) ++ { ++ operands[1] = copy_to_mode_reg (SFmode, operand1); ++ } ++ }") ++ ++ (define_insn "*movsf" ++ [(set (match_operand:SF 0 "general_operand" "=r,r,d,r,Qm") ++ (match_operand:SF 1 "general_operand" "r,G,F,Qm,r"))] ++ "register_operand (operands[0], SFmode) ++ || register_operand (operands[1], SFmode)" ++ "* return output_movsisf (insn, operands, which_alternative);" ++ [(set_attr "length" "4,4,4,8,8") ++ (set_attr "cc" "none,set_zn,none,clobber,clobber")]) ++ ++ (define_expand "reload_insf" ++ [(parallel [(set (match_operand:SF 0 "register_operand" "=l") ++ (match_operand:SF 1 "immediate_operand" "iF")) ++ (clobber (match_operand:QI 2 "register_operand" "=&a"))])] ++ "" ++ "") ++ ++ (define_insn "*reload_insf" ++ [(set (match_operand:SF 0 "register_operand" "=l") ++ (match_operand:SF 1 "immediate_operand" "iF")) ++ (clobber (match_operand:QI 2 "register_operand" "=&a"))] ++ "" ++ "* return output_reload_insisf (insn, operands, which_alternative);" ++ [(set_attr "length" "8") ++ (set_attr "cc" "none")]) ++ ++ ;; ========================================================================= ++ ++ (define_expand "movstrhi" ++ [(parallel [(set (match_operand:BLK 0 "memory_operand" "") ++ (match_operand:BLK 1 "memory_operand" "")) ++ (use (match_operand:HI 2 "const_int_operand" "")) ++ (use (match_operand:HI 3 "const_int_operand" "")) ++ (clobber (match_dup 4)) ++ (clobber (match_dup 5)) ++ (clobber (match_dup 6))])] ++ "" ++ "{ ++ rtx addr0, addr1; ++ int cnt8; ++ ++ if (GET_CODE (operands[2]) != CONST_INT) ++ FAIL; ++ cnt8 = byte_immediate_operand (operands[2], GET_MODE (operands[2])); ++ operands[2] = copy_to_mode_reg (cnt8 ? QImode : HImode, operands[2]); ++ operands[4] = operands[2]; ++ ++ addr0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0)); ++ addr1 = copy_to_mode_reg (Pmode, XEXP (operands[1], 0)); ++ ++ operands[5] = addr0; ++ operands[6] = addr1; ++ ++ operands[0] = gen_rtx (MEM, BLKmode, addr0); ++ operands[1] = gen_rtx (MEM, BLKmode, addr1); ++ }") ++ ++ (define_insn "*movstrqi_insn" ++ [(set (mem:BLK (match_operand:HI 0 "register_operand" "e")) ++ (mem:BLK (match_operand:HI 1 "register_operand" "e"))) ++ (use (match_operand:QI 2 "register_operand" "r")) ++ (use (match_operand:QI 3 "const_int_operand" "i")) ++ (clobber (match_dup 2)) ++ (clobber (match_dup 0)) ++ (clobber (match_dup 1))] ++ "" ++ " ++ ld __tmp_reg__,%a1+ ++ st %a0+,__tmp_reg__ ++ dec %2 ++ brne _PC_-8" ++ [(set_attr "length" "4") ++ (set_attr "cc" "clobber")]) ++ ++ (define_insn "*movstrhi" ++ [(set (mem:BLK (match_operand:HI 0 "register_operand" "e,e")) ++ (mem:BLK (match_operand:HI 1 "register_operand" "e,e"))) ++ (use (match_operand:HI 2 "register_operand" "!w,d")) ++ (use (match_operand:HI 3 "const_int_operand" "")) ++ (clobber (match_dup 2)) ++ (clobber (match_dup 0)) ++ (clobber (match_dup 1))] ++ "" ++ "*{ ++ if (which_alternative==0) ++ return (AS2 (ld,__tmp_reg__,%a1+) CR_TAB ++ AS2 (st,%a0+,__tmp_reg__) CR_TAB ++ AS2 (sbiw,%A2,1) CR_TAB ++ AS1 (brne,_PC_-8)); ++ else ++ return (AS2 (ld,__tmp_reg__,%a1+) CR_TAB ++ AS2 (st,%a0+,__tmp_reg__) CR_TAB ++ AS2 (subi,%A2,1) CR_TAB ++ AS2 (sbci,%B2,0) CR_TAB ++ AS1 (brne,_PC_-10)); ++ }" ++ [(set_attr "length" "4,5") ++ (set_attr "cc" "clobber,clobber")]) ++ ; =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 =0 ++ ++ (define_expand "clrstrhi" ++ [(parallel [(set (match_operand:BLK 0 "memory_operand" "") ++ (const_int 0)) ++ (use (match_operand:HI 1 "const_int_operand" "")) ++ (use (match_operand:HI 2 "const_int_operand" "n")) ++ (clobber (match_dup 3)) ++ (clobber (match_dup 4))])] ++ "" ++ "{ ++ rtx addr0; ++ int cnt8; ++ ++ if (GET_CODE (operands[1]) != CONST_INT) ++ FAIL; ++ ++ cnt8 = byte_immediate_operand (operands[1], GET_MODE (operands[1])); ++ operands[1] = copy_to_mode_reg (cnt8 ? QImode : HImode, operands[1]); ++ operands[3] = operands[1]; ++ ++ addr0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0)); ++ operands[4] = addr0; ++ ++ operands[0] = gen_rtx (MEM, BLKmode, addr0); ++ }") ++ ++ (define_insn "*clrstrqi" ++ [(set (mem:BLK (match_operand:HI 0 "register_operand" "e")) ++ (const_int 0)) ++ (use (match_operand:QI 1 "register_operand" "r")) ++ (use (match_operand:QI 2 "const_int_operand" "n")) ++ (clobber (match_dup 1)) ++ (clobber (match_dup 0))] ++ "" ++ " ++ st %a0+,__zero_reg__ ++ dec %1 ++ brne _PC_-6" ++ [(set_attr "length" "3") ++ (set_attr "cc" "clobber")]) ++ ++ (define_insn "*clrstrhi" ++ [(set (mem:BLK (match_operand:HI 0 "register_operand" "e,e")) ++ (const_int 0)) ++ (use (match_operand:HI 1 "register_operand" "!w,d")) ++ (use (match_operand:HI 2 "const_int_operand" "n,n")) ++ (clobber (match_dup 1)) ++ (clobber (match_dup 0))] ++ "" ++ "*{ ++ if (which_alternative==0) ++ return (AS2 (st,%a0+,__zero_reg__) CR_TAB ++ AS2 (sbiw,%A1,1) CR_TAB ++ AS1 (brne,_PC_-6)); ++ else ++ return (AS2 (st,%a0+,__zero_reg__) CR_TAB ++ AS2 (subi,%A1,1) CR_TAB ++ AS2 (sbci,%B1,0) CR_TAB ++ AS1 (brne,_PC_-8)); ++ }" ++ [(set_attr "length" "3,4") ++ (set_attr "cc" "clobber,clobber")]) ++ ++ ++ (define_expand "cmpstrsi" ++ [(parallel [(set (match_operand:QI 0 "register_operand" "") ++ (compare:QI (match_operand:BLK 1 "general_operand" "") ++ (match_operand:BLK 2 "general_operand" ""))) ++ (use (match_operand:HI 3 "general_operand" "")) ++ (use (match_operand:QI 4 "immediate_operand" "")) ++ (clobber (match_dup 5)) ++ (clobber (match_dup 6)) ++ (clobber (match_dup 3))])] ++ "0 /* Disabled until better times */" ++ "{ ++ rtx addr1, addr2; ++ int cnt8; ++ ++ addr1 = copy_to_mode_reg (Pmode, XEXP (operands[1], 0)); ++ addr2 = copy_to_mode_reg (Pmode, XEXP (operands[2], 0)); ++ ++ cnt8 = byte_immediate_operand (operands[3], GET_MODE (operands[3])); ++ operands[3] = copy_to_mode_reg (cnt8 ? QImode : HImode, operands[3]); ++ ++ operands[5] = addr1; ++ operands[6] = addr2; ++ ++ operands[1] = gen_rtx_MEM (BLKmode, addr1); ++ operands[2] = gen_rtx_MEM (BLKmode, addr2); ++ }") ++ ++ (define_insn "*cmpstrqi_r" ++ [(set (match_operand:QI 4 "register_operand" "=d") ++ (compare:QI (mem:BLK (match_operand:HI 0 "register_operand" "e")) ++ (mem:BLK (match_operand:HI 1 "register_operand" "e")))) ++ (use (match_operand:QI 2 "register_operand" "r")) ++ (use (match_operand:QI 3 "immediate_operand" "i")) ++ (clobber (match_dup 0)) ++ (clobber (match_dup 1)) ++ (clobber (match_dup 2))] ++ "" ++ " ++ cmp_l%=: ++ ld %4,%a0+ ++ ld __tmp_reg__,%a1+ ++ sub %4,__tmp_reg__ ++ brne cmp_o%= ++ dec %2 ++ brne cmp_l%= ++ cmp_o%=: ++ brcc _PC_+2 ++ ldi %4,lo8(-1)" ++ [(set_attr "length" "8") ++ (set_attr "cc" "clobber")]) ++ ++ (define_insn "*cmpstrqi" ++ [(set (cc0) ++ (compare:QI (mem:BLK (match_operand:HI 0 "register_operand" "e")) ++ (mem:BLK (match_operand:HI 1 "register_operand" "e")))) ++ (use (match_operand:QI 2 "register_operand" "r")) ++ (use (match_operand:QI 3 "immediate_operand" "i")) ++ (clobber (match_dup 0)) ++ (clobber (match_dup 1)) ++ (clobber (match_dup 2)) ++ (clobber (match_scratch:QI 4 "=r"))] ++ "" ++ "*{ ++ cc_status.flags |= CC_NOT_SIGNED; ++ return (\"\\ncmp_l%=:\" CR_TAB ++ AS2 (ld, %4,%a0+) CR_TAB ++ AS2 (ld, __tmp_reg__,%a1+) CR_TAB ++ AS2 (sub, %4,__tmp_reg__) CR_TAB ++ AS1 (brne, cmp_o%=) CR_TAB ++ AS1 (dec, %2) CR_TAB ++ AS1 (brne, cmp_l%=\\n) ++ \"cmp_o%=:\"); ++ }" ++ [(set_attr "length" "6") ++ (set_attr "cc" "compare")]) ++ ++ (define_insn "*cmpstrhi_r" ++ [(set (match_operand:QI 4 "register_operand" "=d,d") ++ (compare:QI (mem:BLK (match_operand:HI 0 "register_operand" "e,e")) ++ (mem:BLK (match_operand:HI 1 "register_operand" "e,e")))) ++ (use (match_operand:HI 2 "register_operand" "!w,d")) ++ (use (match_operand:QI 3 "immediate_operand" "i,i")) ++ (clobber (match_dup 0)) ++ (clobber (match_dup 1)) ++ (clobber (match_dup 2))] ++ "" ++ "*{ ++ if (which_alternative==0) ++ return (\"\\ncmp_l%=:\" CR_TAB ++ AS2 (ld, %4,%a0+) CR_TAB ++ AS2 (ld, __tmp_reg__,%a1+) CR_TAB ++ AS2 (sub, %4,__tmp_reg__) CR_TAB ++ AS1 (brne, cmp_o%=) CR_TAB ++ AS2 (sbiw, %2,1) CR_TAB ++ AS1 (brne, cmp_l%=) \"\\n\" ++ \"cmp_o%=:\" CR_TAB ++ AS1 (brcc, cmp_e%=) CR_TAB ++ AS2 (ldi, %4,lo8(-1)) \"\\n\" ++ \"cmp_e%=:\"); ++ else ++ return (\"\\ncmp_l%=:\" CR_TAB ++ AS2 (ld, %4,%a0+) CR_TAB ++ AS2 (ld, __tmp_reg__,%a1+) CR_TAB ++ AS2 (sub, %4,__tmp_reg__) CR_TAB ++ AS1 (brne, cmp_o%=) CR_TAB ++ AS2 (subi, %2,lo8(-1)) CR_TAB ++ AS2 (sbci, %2,hi8(-1)) CR_TAB ++ AS1 (brne, cmp_l%=) \"\\n\" ++ \"cmp_o%=:\" CR_TAB ++ AS1 (brcc, cmp_e%=) CR_TAB ++ AS2 (ldi, %4,lo8(-1)) \"\\n\" ++ \"cmp_e%=:\"); ++ }" ++ [(set_attr "length" "8,9") ++ (set_attr "cc" "clobber,clobber")]) ++ ++ (define_insn "*cmpstrhi" ++ [(set (cc0) ++ (compare:QI (mem:BLK (match_operand:HI 0 "register_operand" "e,e")) ++ (mem:BLK (match_operand:HI 1 "register_operand" "e,e")))) ++ (use (match_operand:HI 2 "register_operand" "!w,d")) ++ (use (match_operand:QI 3 "immediate_operand" "i,i")) ++ (clobber (match_dup 0)) ++ (clobber (match_dup 1)) ++ (clobber (match_dup 2)) ++ (clobber (match_scratch:QI 4 "=&r,&r"))] ++ "" ++ "*{ ++ cc_status.flags |= CC_NOT_SIGNED; ++ if (which_alternative==0) ++ return (\"\\ncmp_l%=:\" CR_TAB ++ AS2 (ld, %4,%a0+) CR_TAB ++ AS2 (ld, __tmp_reg__,%a1+) CR_TAB ++ AS2 (sub, %4,__tmp_reg__) CR_TAB ++ AS1 (brne, cmp_e%=) CR_TAB ++ AS2 (sbiw, %2,1) CR_TAB ++ AS1 (brne, cmp_l%=\\n) ++ \"cmp_e%=:\"); ++ else ++ return (\"\\ncmp_l%=:\" CR_TAB ++ AS2 (ld, %4,%a0+) CR_TAB ++ AS2 (ld, __tmp_reg__,%a1+) CR_TAB ++ AS2 (sub, %4,__tmp_reg__) CR_TAB ++ AS1 (brne, cmp_e%=) CR_TAB ++ AS2 (subi, %2,lo8(-1)) CR_TAB ++ AS2 (sbci, %2,hi8(-1)) CR_TAB ++ AS1 (brne, cmp_l%=\\n) ++ \"cmp_e%=:\"); ++ }" ++ [(set_attr "length" "6,7") ++ (set_attr "cc" "compare,compare")]) ++ ++ ++ (define_expand "strlenhi" ++ [(parallel ++ [(set (match_dup 4) ++ (unspec:HI [(match_operand:BLK 1 "memory_operand" "") ++ (match_operand:QI 2 "const_int_operand" "") ++ (match_operand:HI 3 "immediate_operand" "")] 0)) ++ (clobber (match_dup 6))]) ++ (set (match_dup 4) (plus:HI (match_dup 4) ++ (const_int -1))) ++ (set (match_operand:HI 0 "register_operand" "") ++ (minus:HI (match_dup 4) ++ (match_dup 5)))] ++ "" ++ "{ ++ if (! (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0)) ++ FAIL; ++ operands[6] = copy_to_mode_reg (Pmode, XEXP (operands[1],0)); ++ operands[1] = gen_rtx (MEM, BLKmode, operands[6]); ++ operands[5] = operands[6]; ++ operands[4] = gen_reg_rtx (HImode); ++ }") ++ ++ (define_insn "*strlenhi" ++ [(set (match_operand:HI 0 "register_operand" "=e") ++ (unspec:HI [(mem:BLK (match_operand:HI 1 "register_operand" "%0")) ++ (const_int 0) ++ (match_operand:HI 2 "immediate_operand" "i")] 0)) ++ (clobber (match_dup 1))] ++ "" ++ "ld __tmp_reg__,%a0+ ++ tst __tmp_reg__ ++ brne _PC_-6" ++ [(set_attr "length" "3") ++ (set_attr "cc" "clobber")]) ++ ++ ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++ ; add bytes ++ ++ (define_insn "addqi3" ++ [(set (match_operand:QI 0 "register_operand" "=r,d,r,r") ++ (plus:QI (match_operand:QI 1 "register_operand" "%0,0,0,0") ++ (match_operand:QI 2 "nonmemory_operand" "r,i,P,N")))] ++ "" ++ "@ ++ add %0,%2 ++ subi %0,lo8(-(%2)) ++ inc %0 ++ dec %0" ++ [(set_attr "length" "1,1,1,1") ++ (set_attr "cc" "set_czn,set_czn,set_zn,set_zn")]) ++ ++ ++ (define_expand "addhi3" ++ [(set (match_operand:HI 0 "register_operand" "") ++ (plus:HI (match_operand:HI 1 "register_operand" "") ++ (match_operand:HI 2 "nonmemory_operand" "")))] ++ "" ++ " ++ { ++ if (GET_CODE (operands[2]) == CONST_INT) ++ { ++ short tmp = INTVAL (operands[2]); ++ operands[2] = GEN_INT(tmp); ++ } ++ if (! (reload_completed | reload_in_progress)) ++ { ++ if (REGNO (operands[0]) != REGNO (operands[1]) ++ && REGNO (operands[0]) != REGNO (operands[2])&&0) ++ { ++ emit_move_insn (operands[0], operands[1]); ++ operands[1] = operands[0]; ++ } ++ } ++ }") ++ ++ ++ (define_insn "*addhi3_zero_extend" ++ [(set (match_operand:HI 0 "register_operand" "=r") ++ (plus:HI (zero_extend:HI ++ (match_operand:QI 1 "register_operand" "r")) ++ (match_operand:HI 2 "register_operand" "0")))] ++ "" ++ "add %A0,%1 ++ adc %B0,__zero_reg__" ++ [(set_attr "length" "2") ++ (set_attr "cc" "set_n")]) ++ ++ (define_insn "*addhi3_zero_extend1" ++ [(set (match_operand:HI 0 "register_operand" "=r") ++ (plus:HI (match_operand:HI 1 "register_operand" "%0") ++ (zero_extend:HI ++ (match_operand:QI 2 "register_operand" "r"))))] ++ "" ++ "add %A0,%2 ++ adc %B0,__zero_reg__" ++ [(set_attr "length" "2") ++ (set_attr "cc" "set_n")]) ++ ++ (define_insn "*addhi3_zero_extend2" ++ [(set (match_operand:HI 0 "register_operand" "=r") ++ (plus:HI ++ (zero_extend:HI (match_operand:QI 1 "register_operand" "%0")) ++ (zero_extend:HI (match_operand:QI 2 "register_operand" "r"))))] ++ "" ++ "add %0,%2 ++ mov %B0,__zero_reg__ ++ adc %B0,__zero_reg__" ++ [(set_attr "length" "3") ++ (set_attr "cc" "set_n")]) ++ ++ (define_insn "*addhi3_sign_extend" ++ [(set (match_operand:HI 0 "register_operand" "=r") ++ (plus:HI (sign_extend:HI ++ (match_operand:QI 1 "register_operand" "r")) ++ (match_operand:HI 2 "register_operand" "0")))] ++ "0" ++ "add %A0,%1 ++ sbrs %1,7 ++ adc %B0,__zero_reg__ ++ sbrc %1,7 ++ sbc %B0,__zero_reg__" ++ [(set_attr "length" "5") ++ (set_attr "cc" "set_n")]) ++ ++ ++ (define_insn "*addhi3" ++ [(set (match_operand:HI 0 "register_operand" "=r,!w,!w,d,r,r") ++ (plus:HI ++ (match_operand:HI 1 "register_operand" "%0,0,0,0,0,0") ++ (match_operand:HI 2 "nonmemory_operand" "r,I,J,i,P,N")))] ++ "" ++ "@ ++ add %A0,%A2\;adc %B0,%B2 ++ adiw %A0,%2 ++ sbiw %A0,%n2 ++ subi %A0,lo8(-(%2))\;sbci %B0,hi8(-(%2)) ++ sec\;adc %A0,__zero_reg__\;adc %B0,__zero_reg__ ++ sec\;sbc %A0,__zero_reg__\;sbc %B0,__zero_reg__" ++ [(set_attr "length" "2,1,1,2,3,3") ++ (set_attr "cc" "set_n,set_czn,set_czn,set_czn,set_n,set_n")]) ++ ++ ++ (define_insn "*addhi3_clobber" ++ [(set (match_operand:HI 0 "register_operand" "=r,r") ++ (plus:HI (match_operand:HI 1 "register_operand" "%0,0") ++ (match_operand:HI 2 "immediate_operand" "M,i"))) ++ (clobber (match_scratch:QI 3 "=&d,&d"))] ++ "0" ++ "@ ++ ldi %3,lo8(%2)\;add %A0,%3\;adc %B0,__zero_reg__ ++ ldi %3,lo8(%2)\;add %A0,%3\;ldi %3,hi8(%2)\;adc %B0,%3" ++ [(set_attr "length" "3,4") ++ (set_attr "cc" "set_n,set_n")]) ++ ++ ++ (define_insn "addsi3" ++ [(set (match_operand:SI 0 "register_operand" "=r,!w,!w,d,r,r,&*!w,&*!w") ++ (plus:SI ++ (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,r,r") ++ (match_operand:SI 2 "nonmemory_operand" "r,I,J,i,P,N,#I,#J")))] ++ "" ++ "@ ++ add %A0,%A2\;adc %B0,%B2\;adc %C0,%C2\;adc %D0,%D2 ++ adiw %0,%2\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__ ++ sbiw %0,%n2\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__ ++ subi %0,lo8(-(%2))\;sbci %B0,hi8(-(%2))\;sbci %C0,hlo8(-(%2))\;sbci %D0,hhi8(-(%2)) ++ sec\;adc %A0,__zero_reg__\;adc %B0,__zero_reg__\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__ ++ sec\;sbc %A0,__zero_reg__\;sbc %B0,__zero_reg__\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__ ++ mov %A0,%A1\;mov %B0,%B1\;mov %C0,%C1\;mov %D0,%D1\;adiw %0,%2\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__ ++ mov %A0,%A1\;mov %B0,%B1\;mov %C0,%C1\;mov %D0,%D1\;sbiw %0,%n2\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__" ++ [(set_attr "length" "4,3,3,4,5,5,7,7") ++ (set_attr "cc" "set_n,set_n,set_czn,set_czn,set_n,set_n,set_n,set_czn")]) ++ ++ (define_insn "*addsi3_clobber" ++ [(set (match_operand:SI 0 "register_operand" "=r,r") ++ (plus:SI (match_operand:SI 1 "register_operand" "%0,0") ++ (match_operand:SI 2 "immediate_operand" "M,i"))) ++ (clobber (match_scratch:QI 3 "=&d,&d"))] ++ "0" ++ "@ ++ ldi %3,lo8(%2)\;add %A0,%3\;adc %B0,__zero_reg__\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__ ++ ldi %3,lo8(%2)\;add %A0,%3\;ldi %3,hi8(%2)\;adc %B0,%3\;ldi %3,hlo8(%2)\;adc %C0,%3\;ldi %3,hhi8(%2)\;adc %D0,%3" ++ [(set_attr "length" "5,8") ++ (set_attr "cc" "set_n,set_n")]) ++ ++ ;----------------------------------------------------------------------------- ++ ; sub bytes ++ (define_insn "subqi3" ++ [(set (match_operand:QI 0 "register_operand" "=r,d") ++ (minus:QI (match_operand:QI 1 "register_operand" "0,0") ++ (match_operand:QI 2 "nonmemory_operand" "r,i")))] ++ "" ++ "@ ++ sub %0,%2 ++ subi %0,lo8(%2)" ++ [(set_attr "length" "1,1") ++ (set_attr "cc" "set_czn,set_czn")]) ++ ++ (define_insn "subhi3" ++ [(set (match_operand:HI 0 "register_operand" "=r,d") ++ (minus:HI (match_operand:HI 1 "register_operand" "0,0") ++ (match_operand:HI 2 "nonmemory_operand" "r,i")))] ++ "" ++ "@ ++ sub %A0,%A2\;sbc %B0,%B2 ++ subi %A0,lo8(%2)\;sbci %B0,hi8(%2)" ++ [(set_attr "length" "2,2") ++ (set_attr "cc" "set_czn,set_czn")]) ++ ++ (define_insn "subsi3" ++ [(set (match_operand:SI 0 "register_operand" "=r,d") ++ (minus:SI (match_operand:SI 1 "register_operand" "0,0") ++ (match_operand:SI 2 "nonmemory_operand" "r,i")))] ++ "" ++ "@ ++ sub %0,%2\;sbc %B0,%B2\;sbc %C0,%C2\;sbc %D0,%D2 ++ subi %A0,lo8(%2)\;sbci %B0,hi8(%2)\;sbci %C0,hlo8(%2)\;sbci %D0,hhi8(%2)" ++ [(set_attr "length" "4,4") ++ (set_attr "cc" "set_czn,set_czn")]) ++ ++ ;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ++ ; and ++ ++ (define_insn "andqi3" ++ [(set (match_operand:QI 0 "register_operand" "=r,d") ++ (and:QI (match_operand:QI 1 "register_operand" "%0,0") ++ (match_operand:QI 2 "nonmemory_operand" "r,i")))] ++ "" ++ "@ ++ and %0,%2 ++ andi %0,lo8(%2)" ++ [(set_attr "length" "1,1") ++ (set_attr "cc" "set_zn,set_zn")]) ++ ++ (define_insn "andhi3" ++ [(set (match_operand:HI 0 "register_operand" "=r,d,r") ++ (and:HI (match_operand:HI 1 "register_operand" "%0,0,0") ++ (match_operand:HI 2 "nonmemory_operand" "r,i,M"))) ++ (clobber (match_scratch:QI 3 "=X,X,&d"))] ++ "" ++ "*{ ++ if (which_alternative==0) ++ return (AS2 (and,%A0,%A2) CR_TAB ++ AS2 (and,%B0,%B2)); ++ else if (which_alternative==1) ++ { ++ if (GET_CODE (operands[2]) == CONST_INT) ++ { ++ int mask = INTVAL (operands[2]); ++ if ((mask & 0xff) != 0xff) ++ output_asm_insn (AS2 (andi,%A0,lo8(%2)), operands); ++ if ((mask & 0xff00) != 0xff00) ++ output_asm_insn (AS2 (andi,%B0,hi8(%2)), operands); ++ return \"\"; ++ } ++ return (AS2 (andi,%A0,lo8(%2)) CR_TAB ++ AS2 (andi,%B0,hi8(%2))); ++ } ++ return (AS2 (ldi,%3,lo8(%2)) CR_TAB ++ AS2 (and,%A0,%3) CR_TAB ++ AS1 (clr,%B0)); ++ }" ++ [(set_attr "length" "2,2,3") ++ (set_attr "cc" "set_n,clobber,clobber")]) ++ ++ (define_insn "andsi3" ++ [(set (match_operand:SI 0 "register_operand" "=r,d") ++ (and:SI (match_operand:SI 1 "register_operand" "%0,0") ++ (match_operand:SI 2 "nonmemory_operand" "r,i")))] ++ "" ++ "*{ ++ if (which_alternative==0) ++ return (AS2 (and, %0,%2) CR_TAB ++ AS2 (and, %B0,%B2) CR_TAB ++ AS2 (and, %C0,%C2) CR_TAB ++ AS2 (and, %D0,%D2)); ++ else if (which_alternative==1) ++ { ++ if (GET_CODE (operands[2]) == CONST_INT) ++ { ++ HOST_WIDE_INT mask = INTVAL (operands[2]); ++ if ((mask & 0xff) != 0xff) ++ output_asm_insn (AS2 (andi,%A0,lo8(%2)), operands); ++ if ((mask & 0xff00) != 0xff00) ++ output_asm_insn (AS2 (andi,%B0,hi8(%2)), operands); ++ if ((mask & 0xff0000UL) != 0xff0000UL) ++ output_asm_insn (AS2 (andi,%C0,hlo8(%2)), operands); ++ if ((mask & 0xff000000UL) != 0xff000000UL) ++ output_asm_insn (AS2 (andi,%D0,hhi8(%2)), operands); ++ return \"\"; ++ } ++ return (AS2 (andi, %A0,lo8(%2)) CR_TAB ++ AS2 (andi, %B0,hi8(%2)) CR_TAB ++ AS2 (andi, %C0,hlo8(%2)) CR_TAB ++ AS2 (andi, %D0,hhi8(%2))); ++ } ++ }" ++ [(set_attr "length" "4,4") ++ (set_attr "cc" "set_n,set_n")]) ++ ++ ;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ++ ; ior ++ ++ (define_insn "iorqi3" ++ [(set (match_operand:QI 0 "register_operand" "=r,d") ++ (ior:QI (match_operand:QI 1 "register_operand" "%0,0") ++ (match_operand:QI 2 "nonmemory_operand" "r,i")))] ++ "" ++ "@ ++ or %0,%2 ++ ori %0,lo8(%2)" ++ [(set_attr "length" "1,1") ++ (set_attr "cc" "set_zn,set_zn")]) ++ ++ (define_insn "iorhi3" ++ [(set (match_operand:HI 0 "register_operand" "=r,d") ++ (ior:HI (match_operand:HI 1 "register_operand" "%0,0") ++ (match_operand:HI 2 "nonmemory_operand" "r,i")))] ++ "" ++ "*{ ++ if (which_alternative==0) ++ return (AS2 (or,%A0,%A2) CR_TAB ++ AS2 (or,%B0,%B2)); ++ if (GET_CODE (operands[2]) == CONST_INT) ++ { ++ int mask = INTVAL (operands[2]); ++ if (mask & 0xff) ++ output_asm_insn (AS2 (ori,%A0,lo8(%2)), operands); ++ if (mask & 0xff00) ++ output_asm_insn (AS2 (ori,%B0,hi8(%2)), operands); ++ return \"\"; ++ } ++ return (AS2 (ori,%0,lo8(%2)) CR_TAB ++ AS2 (ori,%B0,hi8(%2))); ++ }" ++ [(set_attr "length" "2,2") ++ (set_attr "cc" "set_n,clobber")]) ++ ++ (define_insn "*iorhi3_clobber" ++ [(set (match_operand:HI 0 "register_operand" "=r,r") ++ (ior:HI (match_operand:HI 1 "register_operand" "%0,0") ++ (match_operand:HI 2 "immediate_operand" "M,i"))) ++ (clobber (match_scratch:QI 3 "=&d,&d"))] ++ "" ++ "@ ++ ldi %3,lo8(%2)\;or %A0,%3 ++ ldi %3,lo8(%2)\;or %A0,%3\;ldi %3,lo8(%2)\;or %B0,%3" ++ [(set_attr "length" "2,4") ++ (set_attr "cc" "clobber,set_n")]) ++ ++ (define_insn "iorsi3" ++ [(set (match_operand:SI 0 "register_operand" "=r,d") ++ (ior:SI (match_operand:SI 1 "register_operand" "%0,0") ++ (match_operand:SI 2 "nonmemory_operand" "r,i")))] ++ "" ++ "*{ ++ if (which_alternative==0) ++ return (AS2 (or, %0,%2) CR_TAB ++ AS2 (or, %B0,%B2) CR_TAB ++ AS2 (or, %C0,%C2) CR_TAB ++ AS2 (or, %D0,%D2)); ++ if (GET_CODE (operands[2]) == CONST_INT) ++ { ++ HOST_WIDE_INT mask = INTVAL (operands[2]); ++ if (mask & 0xff) ++ output_asm_insn (AS2 (ori,%A0,lo8(%2)), operands); ++ if (mask & 0xff00) ++ output_asm_insn (AS2 (ori,%B0,hi8(%2)), operands); ++ if (mask & 0xff0000UL) ++ output_asm_insn (AS2 (ori,%C0,hlo8(%2)), operands); ++ if (mask & 0xff000000UL) ++ output_asm_insn (AS2 (ori,%D0,hhi8(%2)), operands); ++ return \"\"; ++ } ++ return (AS2 (ori, %A0,lo8(%2)) CR_TAB ++ AS2 (ori, %B0,hi8(%2)) CR_TAB ++ AS2 (ori, %C0,hlo8(%2)) CR_TAB ++ AS2 (ori, %D0,hhi8(%2))); ++ }" ++ [(set_attr "length" "4,4") ++ (set_attr "cc" "set_n,clobber")]) ++ ++ (define_insn "*iorsi3_clobber" ++ [(set (match_operand:SI 0 "register_operand" "=r,r") ++ (ior:SI (match_operand:SI 1 "register_operand" "%0,0") ++ (match_operand:SI 2 "immediate_operand" "M,i"))) ++ (clobber (match_scratch:QI 3 "=&d,&d"))] ++ "" ++ "@ ++ ldi %3,lo8(%2)\;or %A0,%3 ++ ldi %3,lo8(%2)\;or %A0,%3\;ldi %3,hi8(%2)\;or %B0,%3\;ldi %3,hlo8(%2)\;or %C0,%3\;ldi %3,hhi8(%2)\;or %D0,%3" ++ [(set_attr "length" "2,8") ++ (set_attr "cc" "clobber,set_n")]) ++ ++ ;;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ++ ;; xor ++ ;; ++ (define_insn "xorqi3" ++ [(set (match_operand:QI 0 "register_operand" "=r") ++ (xor:QI (match_operand:QI 1 "register_operand" "%0") ++ (match_operand:QI 2 "register_operand" "r")))] ++ "" ++ "eor %0,%2" ++ [(set_attr "length" "1") ++ (set_attr "cc" "set_zn")]) ++ ++ (define_insn "xorhi3" ++ [(set (match_operand:HI 0 "register_operand" "=r") ++ (xor:HI (match_operand:HI 1 "register_operand" "%0") ++ (match_operand:HI 2 "register_operand" "r")))] ++ "" ++ "eor %0,%2\;eor %B0,%B2" ++ [(set_attr "length" "2") ++ (set_attr "cc" "set_n")]) ++ ++ (define_insn "xorsi3" ++ [(set (match_operand:SI 0 "register_operand" "=r") ++ (xor:SI (match_operand:SI 1 "register_operand" "%0") ++ (match_operand:SI 2 "register_operand" "r")))] ++ "" ++ "eor %0,%2 ++ eor %B0,%B2 ++ eor %C0,%C2 ++ eor %D0,%D2" ++ [(set_attr "length" "4") ++ (set_attr "cc" "set_n")]) ++ ++ ;;<< << << << << << << << << << << << << << << << << << << << << << << << << << ++ ;; arithmetic shift left ++ ++ (define_insn "ashlqi3" ++ [(set (match_operand:QI 0 "register_operand" "=r,!d,r,r") ++ (ashift:QI (match_operand:QI 1 "register_operand" "0,0,0,0") ++ (match_operand:QI 2 "general_operand" "r,i,i,Qm")))] ++ "" ++ "* return ashlqi3_out (insn, operands, NULL);" ++ [(set_attr "length" "6,4,6,7") ++ (set_attr "cc" "clobber,set_czn,set_czn,clobber")]) ++ ++ (define_expand "ashlhi3" ++ [(parallel [(set (match_operand:HI 0 "register_operand" "") ++ (ashift:HI (match_operand:HI 1 "register_operand" "") ++ (match_operand:QI 2 "general_operand" ""))) ++ (clobber (match_scratch:QI 3 ""))])] ++ "" ++ "") ++ ++ (define_insn "*ashlhi3_insn" ++ [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r") ++ (ashift:HI (match_operand:HI 1 "register_operand" "0,0,r,0,0,0") ++ (match_operand:QI 2 "general_operand" "r,P,O,K,i,Qm"))) ++ (clobber (match_scratch:QI 3 "=X,X,X,X,&d,X"))] ++ "" ++ "* return ashlhi3_out (insn,operands, NULL);" ++ [(set_attr "length" "7,2,4,2,5,8") ++ (set_attr "cc" "clobber,clobber,clobber,clobber,clobber,clobber")]) ++ ++ (define_expand "ashlsi3" ++ [(parallel [(set (match_operand:SI 0 "register_operand" "") ++ (ashift:SI (match_operand:SI 1 "register_operand" "") ++ (match_operand:QI 2 "general_operand" ""))) ++ (clobber (match_scratch:QI 3 ""))])] ++ "" ++ "") ++ ++ (define_insn "*ashlsi3_insn" ++ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r") ++ (ashift:SI (match_operand:SI 1 "register_operand" "0,0,r,0,0") ++ (match_operand:QI 2 "general_operand" "r,P,O,i,Qm"))) ++ (clobber (match_scratch:QI 3 "=X,X,X,&d,X"))] ++ "" ++ "* return ashlsi3_out (insn,operands, NULL);" ++ [(set_attr "length" "9,4,4,7,10") ++ (set_attr "cc" "clobber,clobber,clobber,clobber,clobber")]) ++ ;>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> ++ ; arithmetic shift right ++ ; ++ (define_expand "ashrqi3" ++ [(parallel [(set (match_operand:QI 0 "register_operand" "") ++ (ashiftrt:QI (match_operand:QI 1 "register_operand" "") ++ (match_operand:QI 2 "general_operand" ""))) ++ (clobber (match_scratch:QI 3 ""))])] ++ "" ++ "") ++ ++ (define_insn "*ashrqi3" ++ [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r") ++ (ashiftrt:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0") ++ (match_operand:QI 2 "general_operand" "r,P,K,i,Qm"))) ++ (clobber (match_scratch:QI 3 "=X,X,X,&d,X"))] ++ "" ++ "* return ashrqi3_out (insn,operands, NULL);" ++ [(set_attr "length" "6,1,2,4,7") ++ (set_attr "cc" "clobber,clobber,clobber,clobber,clobber")]) ++ ++ ++ (define_expand "ashrhi3" ++ [(parallel [(set (match_operand:HI 0 "register_operand" "") ++ (ashiftrt:HI (match_operand:HI 1 "register_operand" "") ++ (match_operand:QI 2 "general_operand" ""))) ++ (clobber (match_scratch:QI 3 ""))])] ++ "" ++ "") ++ ++ (define_insn "*ashrhi3_insn" ++ [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r") ++ (ashiftrt:HI (match_operand:HI 1 "register_operand" "0,0,0,r,0,0") ++ (match_operand:QI 2 "general_operand" "r,P,K,O,i,Qm"))) ++ (clobber (match_scratch:QI 3 "=X,X,X,X,&d,X"))] ++ "" ++ "* return ashrhi3_out (insn,operands, NULL);" ++ [(set_attr "length" "7,2,4,2,5,8") ++ (set_attr "cc" "clobber,clobber,clobber,clobber,clobber,clobber")]) ++ ++ (define_expand "ashrsi3" ++ [(parallel [(set (match_operand:SI 0 "register_operand" "") ++ (ashiftrt:SI (match_operand:SI 1 "register_operand" "") ++ (match_operand:QI 2 "general_operand" ""))) ++ (clobber (match_scratch:QI 3 ""))])] ++ "" ++ "") ++ ++ (define_insn "*ashrsi3_insn" ++ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r") ++ (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0,r,0,0") ++ (match_operand:QI 2 "general_operand" "r,P,O,i,Qm"))) ++ (clobber (match_scratch:QI 3 "=X,X,X,&d,X"))] ++ "" ++ "* return ashrsi3_out (insn,operands, NULL);" ++ [(set_attr "length" "9,4,6,7,10") ++ (set_attr "cc" "clobber,clobber,clobber,clobber,clobber")]) ++ ;;>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> ++ ;; logical shift right ++ ;; XXX optimize ++ (define_insn "lshrqi3" ++ [(set (match_operand:QI 0 "register_operand" "=r,d,r,r") ++ (lshiftrt:QI (match_operand:QI 1 "register_operand" "0,0,0,0") ++ (match_operand:QI 2 "general_operand" "r,i,i,Qm")))] ++ "" ++ "* return lshrqi3_out (insn,operands, NULL);" ++ [(set_attr "length" "6,4,6,7") ++ (set_attr "cc" "clobber,set_czn,set_czn,clobber")]) ++ ++ (define_expand "lshrhi3" ++ [(parallel [(set (match_operand:HI 0 "register_operand" "") ++ (lshiftrt:HI (match_operand:HI 1 "register_operand" "") ++ (match_operand:QI 2 "general_operand" ""))) ++ (clobber (match_scratch:QI 3 ""))])] ++ "" ++ "") ++ ++ (define_insn "*lshrhi3_insn" ++ [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r") ++ (lshiftrt:HI (match_operand:HI 1 "register_operand" "0,0,0,r,0,0") ++ (match_operand:QI 2 "general_operand" "r,P,K,O,i,Qm"))) ++ (clobber (match_scratch:QI 3 "=X,X,X,X,&d,X"))] ++ "" ++ "* return lshrhi3_out (insn,operands, NULL);" ++ [(set_attr "length" "7,2,4,2,5,8") ++ (set_attr "cc" "clobber,clobber,clobber,clobber,clobber,clobber")]) ++ ++ ++ ++ (define_expand "lshrsi3" ++ [(parallel [(set (match_operand:SI 0 "register_operand" "") ++ (lshiftrt:SI (match_operand:SI 1 "register_operand" "") ++ (match_operand:QI 2 "general_operand" ""))) ++ (clobber (match_scratch:QI 3 ""))])] ++ "" ++ "/* Bad result. Two SI registers allocated and combiner don't work ++ on sebregs ++ { ++ if (GET_CODE (operands[2]) == CONST_INT) ++ { ++ switch (INTVAL (operands[2])) ++ { ++ case 16: ++ { ++ emit_insn (gen_movhi (gen_rtx_SUBREG (HImode, operands[0], 0), ++ gen_rtx_SUBREG (HImode, operands[1], 2))); ++ emit_insn (gen_movhi (gen_rtx_SUBREG (HImode, operands[0], 2), ++ const0_rtx)); ++ DONE; ++ } ++ } ++ } ++ } ++ */") ++ ++ (define_insn "*lshrsi3_insn" ++ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r") ++ (lshiftrt:SI (match_operand:SI 1 "register_operand" "0,0,r,0,0") ++ (match_operand:QI 2 "general_operand" "r,P,O,i,Qm"))) ++ (clobber (match_scratch:QI 3 "=X,X,X,&d,X"))] ++ "" ++ "* return lshrsi3_out (insn,operands, NULL);" ++ [(set_attr "length" "9,4,4,7,10") ++ (set_attr "cc" "clobber,clobber,clobber,clobber,clobber")]) ++ ++ ;; abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) abs(x) ++ ; abs ++ (define_insn "absqi2" ++ [(set (match_operand:QI 0 "register_operand" "=r") ++ (abs:QI (match_operand:QI 1 "register_operand" "0")))] ++ "" ++ "sbrc %0,7\;neg %0" ++ [(set_attr "length" "2") ++ (set_attr "cc" "clobber")]) ++ ++ ++ (define_insn "abssf2" ++ [(set (match_operand:SF 0 "register_operand" "=d,r") ++ (abs:SF (match_operand:SF 1 "register_operand" "0,0")))] ++ "" ++ "@ ++ andi %D0,0x7f ++ clt\;bld %D0,7" ++ [(set_attr "length" "1,2") ++ (set_attr "cc" "clobber,clobber")]) ++ ++ ;; 0 - x 0 - x 0 - x 0 - x 0 - x 0 - x 0 - x 0 - x 0 - x 0 - x 0 - x ++ ; neg ++ (define_insn "negqi2" ++ [(set (match_operand:QI 0 "register_operand" "=r") ++ (neg:QI (match_operand:QI 1 "register_operand" "0")))] ++ "" ++ "neg %0" ++ [(set_attr "length" "1") ++ (set_attr "cc" "set_zn")]) ++ ++ (define_insn "neghi2" ++ [(set (match_operand:HI 0 "register_operand" "=!d,r") ++ (neg:HI (match_operand:HI 1 "register_operand" "0,0")))] ++ "" ++ "@ ++ com %B0\;neg %A0\;sbci %B0,lo8(-1) ++ com %B0\;neg %A0\;sbc %B0,__zero_reg__\;inc %B0" ++ [(set_attr "length" "3,4") ++ (set_attr "cc" "set_czn,set_n")]) ++ ++ (define_insn "negsi2" ++ [(set (match_operand:SI 0 "register_operand" "=!d,r") ++ (neg:SI (match_operand:SI 1 "register_operand" "0,0")))] ++ "" ++ "@ ++ com %D0\;com %C0\;com %B0\;neg %A0\;sbci %B0,lo8(-1)\;sbci %C0,lo8(-1)\;sbci %D0,lo8(-1) ++ com %D0\;com %C0\;com %B0\;neg %A0\;brcs _PC_+8\;sec\;adc %B0,__zero_reg__\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__" ++ [(set_attr "length" "7,9") ++ (set_attr "cc" "set_czn,clobber")]) ++ ; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ++ ; not ++ (define_insn "one_cmplqi2" ++ [(set (match_operand:QI 0 "register_operand" "=r") ++ (not:QI (match_operand:QI 1 "register_operand" "0")))] ++ "" ++ "com %0" ++ [(set_attr "length" "1") ++ (set_attr "cc" "set_czn")]) ++ ++ (define_insn "one_cmplhi2" ++ [(set (match_operand:HI 0 "register_operand" "=r") ++ (not:HI (match_operand:HI 1 "register_operand" "0")))] ++ "" ++ "com %0\;com %B0" ++ [(set_attr "length" "2") ++ (set_attr "cc" "set_n")]) ++ ++ (define_insn "one_cmplsi2" ++ [(set (match_operand:SI 0 "register_operand" "=r") ++ (not:SI (match_operand:SI 1 "register_operand" "0")))] ++ "" ++ "com %0\;com %B0\;com %C0\;com %D0" ++ [(set_attr "length" "4") ++ (set_attr "cc" "set_n")]) ++ ++ ; xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x ++ ; sign extend ++ (define_insn "extendqihi2" ++ [(set (match_operand:HI 0 "register_operand" "=r,r") ++ (sign_extend:HI (match_operand:QI 1 "register_operand" "0,*r")))] ++ "" ++ "@ ++ clr %B0\;sbrc %0,7\;com %B0 ++ mov %A0,%A1\;clr %B0\;sbrc %A0,7\;com %B0" ++ [(set_attr "length" "3,4") ++ (set_attr "cc" "set_n,set_n")]) ++ ++ (define_insn "extendqisi2" ++ [(set (match_operand:SI 0 "register_operand" "=r,r") ++ (sign_extend:SI (match_operand:QI 1 "register_operand" "0,*r")))] ++ "" ++ "@ ++ clr %B0\;sbrc %A0,7\;com %B0\;mov %C0,%B0\;mov %D0,%B0 ++ mov %A0,%A1\;clr %B0\;sbrc %A0,7\;com %B0\;mov %C0,%B0\;mov %D0,%B0" ++ [(set_attr "length" "5,6") ++ (set_attr "cc" "clobber,clobber")]) ++ ++ (define_insn "extendhisi2" ++ [(set (match_operand:SI 0 "register_operand" "=r,&r") ++ (sign_extend:SI (match_operand:HI 1 "register_operand" "0,*r")))] ++ "" ++ "@ ++ clr %C0\;sbrc %B0,7\;com %C0\;mov %D0,%C0 ++ mov %A0,%A1\;mov %B0,%B1\;clr %C0\;sbrc %B0,7\;com %C0\;mov %D0,%C0" ++ [(set_attr "length" "4,6") ++ (set_attr "cc" "clobber,clobber")]) ++ ;; xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x ++ ;; zero extend ++ (define_insn "zero_extendqihi2" ++ [(set (match_operand:HI 0 "register_operand" "=r,r") ++ (zero_extend:HI (match_operand:QI 1 "register_operand" "0,*r")))] ++ "" ++ "@ ++ clr %B0 ++ mov %A0,%A1\;clr %B0" ++ [(set_attr "length" "1,2") ++ (set_attr "cc" "set_n,set_n")]) ++ ++ (define_insn "zero_extendqisi2" ++ [(set (match_operand:SI 0 "register_operand" "=r,r") ++ (zero_extend:SI (match_operand:QI 1 "register_operand" "0,*r")))] ++ "" ++ "@ ++ clr %B0\;clr %C0\;clr %D0 ++ mov %A0,%A1\;clr %B0\;clr %C0\;clr %D0" ++ [(set_attr "length" "3,4") ++ (set_attr "cc" "set_n,set_n")]) ++ ++ (define_insn "zero_extendhisi2" ++ [(set (match_operand:SI 0 "register_operand" "=r,&r") ++ (zero_extend:SI (match_operand:HI 1 "register_operand" "0,*r")))] ++ "" ++ "@ ++ clr %C0\;clr %D0 ++ mov %A0,%A1\;mov %B0,%B1\;clr %C0\;clr %D0" ++ [(set_attr "length" "2,4") ++ (set_attr "cc" "set_n,set_n")]) ++ ;;<=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=> ++ ;; compare ++ (define_insn "tstqi" ++ [(set (cc0) ++ (match_operand:QI 0 "register_operand" "r"))] ++ "" ++ "tst %0" ++ [(set_attr "cc" "compare") ++ (set_attr "length" "1")]) ++ ++ (define_insn "*negated_tstqi" ++ [(set (cc0) ++ (neg:QI (match_operand:QI 0 "register_operand" "r")))] ++ "" ++ "cp __zero_reg__,%0" ++ [(set_attr "cc" "compare") ++ (set_attr "length" "1")]) ++ ++ (define_insn "tsthi" ++ [(set (cc0) ++ (match_operand:HI 0 "register_operand" "!w,r"))] ++ "" ++ "* return out_tsthi (insn,NULL);" ++ [(set_attr "cc" "compare,compare") ++ (set_attr "length" "1,2")]) ++ ++ (define_insn "*negated_tsthi" ++ [(set (cc0) ++ (neg:HI (match_operand:HI 0 "register_operand" "r")))] ++ "" ++ "cp __zero_reg__,%A0 ++ cpc __zero_reg__,%B0" ++ [(set_attr "cc" "compare") ++ (set_attr "length" "2")]) ++ ++ (define_insn "tstsi" ++ [(set (cc0) ++ (match_operand:SI 0 "register_operand" "r"))] ++ "" ++ "* return out_tstsi (insn,NULL);" ++ [(set_attr "cc" "compare") ++ (set_attr "length" "4")]) ++ ++ (define_insn "*negated_tstsi" ++ [(set (cc0) ++ (neg:SI (match_operand:SI 0 "register_operand" "r")))] ++ "" ++ "cp __zero_reg__,%A0 ++ cpc __zero_reg__,%B0 ++ cpc __zero_reg__,%C0 ++ cpc __zero_reg__,%D0" ++ [(set_attr "cc" "compare") ++ (set_attr "length" "4")]) ++ ++ ++ (define_insn "cmpqi" ++ [(set (cc0) ++ (compare (match_operand:QI 0 "register_operand" "r,d") ++ (match_operand:QI 1 "nonmemory_operand" "r,i")))] ++ "" ++ "@ ++ cp %0,%1 ++ cpi %0,lo8(%1)" ++ [(set_attr "cc" "compare,compare") ++ (set_attr "length" "1,1")]) ++ ++ (define_insn "*cmpqi_sign_extend" ++ [(set (cc0) ++ (compare (sign_extend:HI ++ (match_operand:QI 0 "register_operand" "d")) ++ (match_operand:HI 1 "immediate_operand" "M")))] ++ "" ++ "cpi %0,lo8(%1)" ++ [(set_attr "cc" "compare") ++ (set_attr "length" "1")]) ++ ++ ++ ++ ++ ++ (define_insn "cmphi" ++ [(set (cc0) ++ (compare (match_operand:HI 0 "register_operand" "r,d,d,r,r") ++ (match_operand:HI 1 "nonmemory_operand" "r,M,i,M,i"))) ++ (clobber (match_scratch:QI 2 "=X,X,&d,&d,&d"))] ++ "" ++ "*{ ++ switch (which_alternative) ++ { ++ case 0: ++ return (AS2 (cp,%A0,%A1) CR_TAB ++ AS2 (cpc,%B0,%B1)); ++ case 1: ++ if (reg_unused_after (insn, operands[0]) ++ && INTVAL (operands[1]) >= 0 && INTVAL (operands[1]) <= 63 ++ && TEST_HARD_REG_CLASS (ADDW_REGS, true_regnum (operands[0]))) ++ return AS2 (sbiw,%0,%1); ++ else ++ return (AS2 (cpi,%0,%1) CR_TAB ++ AS2 (cpc,%B0,__zero_reg__)); ++ case 2: ++ if (reg_unused_after (insn, operands[0])) ++ return (AS2 (subi,%0,lo8(%1)) CR_TAB ++ AS2 (sbci,%B0,hi8(%1))); ++ else ++ return (AS2 (ldi, %2,hi8(%1)) CR_TAB ++ AS2 (cpi, %A0,lo8(%1)) CR_TAB ++ AS2 (cpc, %B0,%2)); ++ case 3: ++ return (AS2 (ldi, %2,lo8(%1)) CR_TAB ++ AS2 (cp, %A0,%2) CR_TAB ++ AS2 (cpc, %B0,__zero_reg__)); ++ ++ case 4: ++ return (AS2 (ldi, %2,lo8(%1)) CR_TAB ++ AS2 (cp, %A0,%2) CR_TAB ++ AS2 (ldi, %2,hi8(%1)) CR_TAB ++ AS2 (cpc, %B0,%2)); ++ } ++ }" ++ [(set_attr "cc" "compare,compare,compare,compare,compare") ++ (set_attr "length" "2,2,3,3,4")]) ++ ++ ++ (define_insn "cmpsi" ++ [(set (cc0) ++ (compare (match_operand:SI 0 "register_operand" "r,d,d,r,r") ++ (match_operand:SI 1 "nonmemory_operand" "r,M,i,M,i"))) ++ (clobber (match_scratch:QI 2 "=X,X,&d,&d,&d"))] ++ "" ++ "*{ ++ switch (which_alternative) ++ { ++ case 0: ++ return (AS2 (cp,%A0,%A1) CR_TAB ++ AS2 (cpc,%B0,%B1) CR_TAB ++ AS2 (cpc,%C0,%C1) CR_TAB ++ AS2 (cpc,%D0,%D1)); ++ case 1: ++ if (reg_unused_after (insn, operands[0]) ++ && INTVAL (operands[1]) >= 0 && INTVAL (operands[1]) <= 63 ++ && TEST_HARD_REG_CLASS (ADDW_REGS, true_regnum (operands[0]))) ++ return (AS2 (sbiw,%0,%1) CR_TAB ++ AS2 (cpc,%C0,__zero_reg__) CR_TAB ++ AS2 (cpc,%D0,__zero_reg__)); ++ else ++ return (AS2 (cpi,%A0,lo8(%1)) CR_TAB ++ AS2 (cpc,%B0,__zero_reg__) CR_TAB ++ AS2 (cpc,%C0,__zero_reg__) CR_TAB ++ AS2 (cpc,%D0,__zero_reg__)); ++ case 2: ++ if (reg_unused_after (insn, operands[0])) ++ return (AS2 (subi,%A0,lo8(%1)) CR_TAB ++ AS2 (sbci,%B0,hi8(%1)) CR_TAB ++ AS2 (sbci,%C0,hlo8(%1)) CR_TAB ++ AS2 (sbci,%D0,hhi8(%1))); ++ else ++ return (AS2 (cpi, %A0,lo8(%1)) CR_TAB ++ AS2 (ldi, %2,hi8(%1)) CR_TAB ++ AS2 (cpc, %B0,%2) CR_TAB ++ AS2 (ldi, %2,hlo8(%1)) CR_TAB ++ AS2 (cpc, %C0,%2) CR_TAB ++ AS2 (ldi, %2,hhi8(%1)) CR_TAB ++ AS2 (cpc, %D0,%2)); ++ case 3: ++ return (AS2 (ldi,%2,lo8(%1)) CR_TAB ++ AS2 (cp,%A0,%2) CR_TAB ++ AS2 (cpc,%B0,__zero_reg__) CR_TAB ++ AS2 (cpc,%C0,__zero_reg__) CR_TAB ++ AS2 (cpc,%D0,__zero_reg__)); ++ case 4: ++ return (AS2 (ldi, %2,lo8(%1)) CR_TAB ++ AS2 (cp, %A0,%2) CR_TAB ++ AS2 (ldi, %2,hi8(%1)) CR_TAB ++ AS2 (cpc, %B0,%2) CR_TAB ++ AS2 (ldi, %2,hlo8(%1)) CR_TAB ++ AS2 (cpc, %C0,%2) CR_TAB ++ AS2 (ldi, %2,hhi8(%1)) CR_TAB ++ AS2 (cpc, %D0,%2)); ++ } ++ }" ++ [(set_attr "cc" "compare,compare,compare,compare,compare") ++ (set_attr "length" "4,4,7,5,8")]) ++ ++ ;; ---------------------------------------------------------------------- ++ ;; JUMP INSTRUCTIONS ++ ;; ---------------------------------------------------------------------- ++ ;; Conditional jump instructions ++ ++ (define_expand "beq" ++ [(set (pc) ++ (if_then_else (eq (cc0) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "") ++ ++ (define_expand "bne" ++ [(set (pc) ++ (if_then_else (ne (cc0) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "") ++ ++ (define_expand "bge" ++ [(set (pc) ++ (if_then_else (ge (cc0) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "") ++ ++ (define_expand "bgeu" ++ [(set (pc) ++ (if_then_else (geu (cc0) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "") ++ ++ (define_expand "blt" ++ [(set (pc) ++ (if_then_else (lt (cc0) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "") ++ ++ (define_expand "bltu" ++ [(set (pc) ++ (if_then_else (ltu (cc0) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "") ++ ++ ++ ++ /**************************************************************** ++ AVR not have following conditional jumps: LE,LEU,GT,GTU. ++ Convert them all to proper jumps. ++ *****************************************************************/ ++ (define_expand "ble" ++ [(set (pc) ++ (if_then_else (le (cc0) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "") ++ ++ (define_expand "bleu" ++ [(set (pc) ++ (if_then_else (leu (cc0) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "") ++ ++ (define_expand "bgt" ++ [(set (pc) ++ (if_then_else (gt (cc0) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "") ++ ++ (define_expand "bgtu" ++ [(set (pc) ++ (if_then_else (gtu (cc0) (const_int 0)) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "" ++ "") ++ ++ (define_insn "*tst_bit" ++ [(set (cc0) ++ (and:SI (match_operand:SI 0 "register_operand" "r") ++ (const_int 1)))] ++ "" ++ " sbrc %0,%1 -----------" ++ [(set_attr "length" "3") ++ (set_attr "cc" "clobber")]) ++ ++ (define_insn "*sbrx_branch" ++ [(set (pc) ++ (if_then_else ++ (match_operator 0 "comparison_operator" ++ [(zero_extract ++ (match_operand:QI 1 "register_operand" "r") ++ (const_int 1) ++ (match_operand 2 "immediate_operand" "n")) ++ (const_int 0)]) ++ (label_ref (match_operand 3 "" "")) ++ (pc)))] ++ "(GET_CODE (operands[0]) == EQ || GET_CODE (operands[0]) == NE)" ++ "* { ++ int comp = ((get_attr_length (insn) == 4) ++ ? reverse_condition (GET_CODE (operands[0])) ++ : GET_CODE (operands[0])); ++ if (comp == EQ) ++ output_asm_insn (AS2 (sbrs,%1,%2), operands); ++ else ++ output_asm_insn (AS2 (sbrc,%1,%2), operands); ++ if (get_attr_length (insn) != 4) ++ return AS1 (rjmp,%3); ++ return (AS1 (rjmp,_PC_+4) CR_TAB ++ AS1 (jmp,%3)); ++ }" ++ [(set (attr "length") (if_then_else (and (ge (minus (pc) (match_dup 3)) ++ (const_int -2046)) ++ (le (minus (pc) (match_dup 3)) ++ (const_int 2046))) ++ (const_int 2) ++ (if_then_else (eq (symbol_ref "AVR_MEGA") ++ (const_int 0)) ++ (const_int 2) ++ (const_int 4)))) ++ (set_attr "cc" "clobber")]) ++ ++ (define_insn "*sbrx_and_branchsi" ++ [(set (pc) ++ (if_then_else ++ (match_operator 0 "comparison_operator" ++ [(and:SI ++ (match_operand:SI 1 "register_operand" "r") ++ (match_operand:SI 2 "immediate_operand" "n")) ++ (const_int 0)]) ++ (label_ref (match_operand 3 "" "")) ++ (pc)))] ++ "(GET_CODE (operands[0]) == EQ || GET_CODE (operands[0]) == NE) ++ && mask_one_bit_p(INTVAL (operands[2]))" ++ "* { ++ int comp = ((get_attr_length (insn) == 4) ++ ? reverse_condition (GET_CODE (operands[0])) ++ : GET_CODE (operands[0])); ++ int bit = mask_one_bit_p(INTVAL (operands[2])) - 1; ++ static char buf[] = \"sbrc %A1,0\"; ++ buf[3] = (comp == EQ ? 's' : 'c'); ++ buf[6] = bit / 8 + 'A'; ++ buf[9] = bit % 8 + '0'; ++ output_asm_insn (buf, operands); ++ ++ if (get_attr_length (insn) != 4) ++ return AS1 (rjmp,%3); ++ return (AS1 (rjmp,_PC_+4) CR_TAB ++ AS1 (jmp,%3)); ++ }" ++ [(set (attr "length") (if_then_else (and (ge (minus (pc) (match_dup 3)) ++ (const_int -2046)) ++ (le (minus (pc) (match_dup 3)) ++ (const_int 2046))) ++ (const_int 2) ++ (if_then_else (eq (symbol_ref "AVR_MEGA") ++ (const_int 0)) ++ (const_int 2) ++ (const_int 4)))) ++ (set_attr "cc" "clobber")]) ++ ++ (define_insn "*sbrx_and_branchhi" ++ [(set (pc) ++ (if_then_else ++ (match_operator 0 "comparison_operator" ++ [(and:HI ++ (match_operand:HI 1 "register_operand" "r") ++ (match_operand:HI 2 "immediate_operand" "n")) ++ (const_int 0)]) ++ (label_ref (match_operand 3 "" "")) ++ (pc)))] ++ "(GET_CODE (operands[0]) == EQ || GET_CODE (operands[0]) == NE) ++ && mask_one_bit_p(INTVAL (operands[2]))" ++ "* { ++ int comp = ((get_attr_length (insn) == 4) ++ ? reverse_condition (GET_CODE (operands[0])) ++ : GET_CODE (operands[0])); ++ int bit = mask_one_bit_p(INTVAL (operands[2])) - 1; ++ static char buf[] = \"sbrc %A1,0\"; ++ buf[3] = (comp == EQ ? 's' : 'c'); ++ buf[6] = bit / 8 + 'A'; ++ buf[9] = bit % 8 + '0'; ++ output_asm_insn (buf, operands); ++ ++ if (get_attr_length (insn) != 4) ++ return AS1 (rjmp,%3); ++ return (AS1 (rjmp,_PC_+4) CR_TAB ++ AS1 (jmp,%3)); ++ }" ++ [(set (attr "length") (if_then_else (and (ge (minus (pc) (match_dup 3)) ++ (const_int -2046)) ++ (le (minus (pc) (match_dup 3)) ++ (const_int 2046))) ++ (const_int 2) ++ (if_then_else (eq (symbol_ref "AVR_MEGA") ++ (const_int 0)) ++ (const_int 2) ++ (const_int 4)))) ++ (set_attr "cc" "clobber")]) ++ ;; ************************************************************************ ++ ;; Implementation of conditional jumps here. ++ ;; Compare with 0 (test) jumps ++ ;; ************************************************************************ ++ ++ (define_insn "branch" ++ [(set (pc) ++ (if_then_else (match_operator 1 "comparison_operator" ++ [(cc0) ++ (const_int 0)]) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "! (GET_CODE (operands[1]) == GT || GET_CODE (operands[1]) == GTU ++ || GET_CODE (operands[1]) == LE || GET_CODE (operands[1]) == LEU)" ++ "* ++ return ret_cond_branch (GET_CODE (operands[1]), ++ avr_jump_mode (operands[0],insn));" ++ [(set_attr "type" "branch") ++ (set_attr "cc" "clobber")]) ++ ++ (define_insn "difficult_branch" ++ [(set (pc) ++ (if_then_else (match_operator 1 "comparison_operator" ++ [(cc0) ++ (const_int 0)]) ++ (label_ref (match_operand 0 "" "")) ++ (pc)))] ++ "(GET_CODE (operands[1]) == GT || GET_CODE (operands[1]) == GTU ++ || GET_CODE (operands[1]) == LE || GET_CODE (operands[1]) == LEU)" ++ "* ++ return ret_cond_branch (GET_CODE (operands[1]), ++ avr_jump_mode (operands[0],insn));" ++ [(set_attr "type" "branch1") ++ (set_attr "cc" "clobber")]) ++ ++ ;; revers branch ++ ++ (define_insn "rvbranch" ++ [(set (pc) ++ (if_then_else (match_operator 1 "comparison_operator" [(cc0) ++ (const_int 0)]) ++ (pc) ++ (label_ref (match_operand 0 "" ""))))] ++ "! (GET_CODE (operands[1]) == GT || GET_CODE (operands[1]) == GTU ++ || GET_CODE (operands[1]) == LE || GET_CODE (operands[1]) == LEU)" ++ "* ++ return ret_cond_branch (reverse_condition (GET_CODE (operands[1])), ++ avr_jump_mode (operands[0],insn));" ++ [(set_attr "type" "branch1") ++ (set_attr "cc" "clobber")]) ++ ++ (define_insn "difficult_rvbranch" ++ [(set (pc) ++ (if_then_else (match_operator 1 "comparison_operator" [(cc0) ++ (const_int 0)]) ++ (pc) ++ (label_ref (match_operand 0 "" ""))))] ++ "(GET_CODE (operands[1]) == GT || GET_CODE (operands[1]) == GTU ++ || GET_CODE (operands[1]) == LE || GET_CODE (operands[1]) == LEU)" ++ "* ++ return ret_cond_branch (reverse_condition (GET_CODE (operands[1])), ++ avr_jump_mode (operands[0],insn));" ++ [(set_attr "type" "branch") ++ (set_attr "cc" "clobber")]) ++ ++ ;;*************************************************************************** ++ ;; Unconditional and other jump instructions. ++ ++ (define_insn "jump" ++ [(set (pc) ++ (label_ref (match_operand 0 "" "")))] ++ "" ++ "*{ ++ if (AVR_MEGA && get_attr_length (insn) != 1) ++ return \"jmp %0\"; ++ return \"rjmp %0\"; ++ }" ++ [(set (attr "length") (if_then_else (and (ge (minus (pc) (match_dup 0)) ++ (const_int -2047)) ++ (le (minus (pc) (match_dup 0)) ++ (const_int 2047))) ++ (const_int 1) ++ (const_int 2))) ++ (set_attr "cc" "none")]) ++ ++ ;; call ++ ++ (define_expand "call" ++ [(call (match_operand:HI 0 "call_insn_operand" "") ++ (match_operand:HI 1 "general_operand" ""))] ++ ;; Operand 1 not used on the AVR. ++ "" ++ "") ++ ++ ;; call value ++ ++ (define_expand "call_value" ++ [(set (match_operand 0 "register_operand" "") ++ (call (match_operand:HI 1 "call_insn_operand" "") ++ (match_operand:HI 2 "general_operand" "")))] ++ ;; Operand 2 not used on the AVR. ++ "" ++ "") ++ ++ (define_insn "call_insn" ++ [(call (mem:HI (match_operand:HI 0 "nonmemory_operand" "!z,*r,i")) ++ (match_operand:HI 1 "general_operand" "X,X,X"))] ++ ;; We don't need in saving Z register because r30,r31 is a call used registers ++ ;; Operand 1 not used on the AVR. ++ "(register_operand (operands[0], HImode) || CONSTANT_P (operands[0]))" ++ "* ++ { ++ if (which_alternative==0) ++ return \"icall\"; ++ else if (which_alternative==1) ++ return (AS2 (mov, r30,%A0) CR_TAB ++ AS2 (mov, r31,%B0) CR_TAB ++ \"icall\"); ++ else if (!AVR_MEGA) ++ return AS1(rcall,%c0); ++ return AS1(call,%c0); ++ }" ++ [(set_attr "cc" "clobber,clobber,clobber") ++ (set (attr "length") ++ (cond [(eq (symbol_ref "which_alternative") (const_int 0)) ++ (const_int 1) ++ (eq (symbol_ref "which_alternative") (const_int 0)) ++ (const_int 3) ++ (eq (symbol_ref "!AVR_MEGA") ++ (const_int 0)) ++ (const_int 2)] ++ (const_int 1)))]) ++ ++ (define_insn "call_value_insn" ++ [(set (match_operand 0 "register_operand" "=r,r,r") ++ (call (mem:HI (match_operand:HI 1 "nonmemory_operand" "!z,*r,i")) ++ ;; We don't need in saving Z register because r30,r31 is a call used registers ++ (match_operand:HI 2 "general_operand" "X,X,X")))] ++ ;; Operand 2 not used on the AVR. ++ "(register_operand (operands[0], VOIDmode) || CONSTANT_P (operands[0]))" ++ "* ++ { ++ if (which_alternative==0) ++ return \"icall\"; ++ else if (which_alternative==1) ++ return (AS2 (mov, r30,%A1) CR_TAB ++ AS2 (mov, r31,%B1) CR_TAB ++ \"icall\"); ++ else if (!AVR_MEGA) ++ return AS1(rcall,%c1); ++ return AS1(call,%c1); ++ }" ++ [(set_attr "cc" "clobber,clobber,clobber") ++ (set (attr "length") ++ (cond [(eq (symbol_ref "which_alternative") (const_int 0)) ++ (const_int 1) ++ (eq (symbol_ref "which_alternative") (const_int 0)) ++ (const_int 3) ++ (eq (symbol_ref "!AVR_MEGA") ++ (const_int 0)) ++ (const_int 2)] ++ (const_int 1)))]) ++ ++ (define_insn "nop" ++ [(const_int 0)] ++ "" ++ "nop" ++ [(set_attr "cc" "none") ++ (set_attr "length" "1")]) ++ ++ ; indirect jump ++ (define_insn "indirect_jump" ++ [(set (pc) (match_operand:HI 0 "register_operand" "!z,*r"))] ++ "" ++ "@ ++ ijmp ++ push %A0\;push %B0\;ret" ++ [(set_attr "length" "1,3") ++ (set_attr "cc" "none,none")]) ++ ++ ;; table jump ++ (define_expand "tablejump" ++ [(parallel [(set (pc) (match_operand:HI 0 "register_operand" "")) ++ (use (label_ref (match_operand 1 "" "")))])] ++ "optimize" ++ "") ++ ++ (define_insn "*tablejump" ++ [(set (pc) (mem:HI ++ (plus:HI (match_operand:HI 0 "register_operand" "=&z") ++ (label_ref (match_operand 2 "" ""))))) ++ (use (label_ref (match_operand 1 "" "")))] ++ "" ++ "subi r30,lo8(-(%2)) ++ sbci r31,hi8(-(%2)) ++ lpm ++ push r0 ++ adiw r30,1 ++ lpm ++ push r0 ++ ret" ++ [(set_attr "length" "8") ++ (set_attr "cc" "clobber")]) ++ ++ (define_expand "casesi" ++ [(set (match_dup 6) ++ (minus:HI (subreg:HI (match_operand:SI 0 "register_operand" "") 0) ++ (match_operand:HI 1 "register_operand" ""))) ++ (parallel [(set (cc0) ++ (compare (match_dup 6) ++ (match_operand:HI 2 "register_operand" ""))) ++ (clobber (match_scratch:QI 9 ""))]) ++ ++ (set (pc) ++ (if_then_else (gtu (cc0) ++ (const_int 0)) ++ (label_ref (match_operand 4 "" "")) ++ (pc))) ++ (set (match_dup 6) ++ (plus:HI (match_dup 6) ++ (match_dup 6))) ++ ;; (set (match_dup 6) ++ ;; (plus:HI (match_dup 6) (label_ref (match_operand:HI 3 "" "")))) ++ ++ (parallel [(set (pc) (mem:HI ++ (plus:HI (match_dup 6) ++ (label_ref (match_operand:HI 3 "" ""))))) ++ (use (label_ref (match_dup 3)))])] ++ "!optimize" ++ " ++ { ++ operands[6] = gen_reg_rtx (HImode); ++ }") ++ ++ ++ ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ++ ++ (define_insn "sez" ++ [(set (cc0) (const_int 0))] ++ "" ++ "sez" ++ [(set_attr "length" "1") ++ (set_attr "cc" "compare")]) ++ ++ ; ;; Some patterns for decrement and branch optimizing ++ ++ ; (define_insn "*decqi_and_branch_until_0" ++ ; [(set (pc) ++ ; (if_then_else (ne (match_operand:QI 0 "nonimmediate_operand" "+r,+o") ++ ; (const_int 0)) ++ ; (label_ref (match_operand 1 "" "")) ++ ; (pc))) ++ ; (set (match_dup 0) ++ ; (plus:QI (match_dup 0) ++ ; (const_int -1)))] ++ ; "(reload_in_progress | reload_completed) ++ ; && " ++ ; "#") ++ ++ ; (define_insn "*dechi_and_branch_until_0" ++ ; [(set (pc) ++ ; (if_then_else (ne (match_operand:HI 0 "register_operand" "+r") ++ ; (const_int 0)) ++ ; (label_ref (match_operand 1 "" "")) ++ ; (pc))) ++ ; (set (match_dup 0) ++ ; (plus:HI (match_dup 0) ++ ; (const_int -1)))] ++ ; "" ++ ; "#") ++ ++ ; (define_insn "*decsi_and_branch_until_0" ++ ; [(set (pc) ++ ; (if_then_else (ne (match_operand:SI 0 "register_operand" "+r") ++ ; (const_int 0)) ++ ; (label_ref (match_operand 1 "" "")) ++ ; (pc))) ++ ; (set (match_dup 0) ++ ; (plus:SI (match_dup 0) ++ ; (const_int -1)))] ++ ; "" ++ ; "#") ++ ++ ; (define_split ++ ; [(set (pc) ++ ; (if_then_else (ne (match_operand 0 "register_operand" "+r") ++ ; (const_int 0)) ++ ; (label_ref (match_operand 1 "" "")) ++ ; (pc))) ++ ; (set (match_dup 0) ++ ; (plus (match_dup 0) ++ ; (const_int -1)))] ++ ; "" ++ ; [(set (match_dup 0) (match_dup 2)) ++ ; (set (pc) ++ ; (if_then_else (geu (cc0) ++ ; (const_int 0)) ++ ; (label_ref (match_operand 1 "" "")) ++ ; (pc)))] ++ ; " ++ ; { ++ ; operands[2] = gen_rtx (PLUS, GET_MODE (operands[0]), ++ ; operands[0], constm1_rtx); ++ ; if (true_regnum (operands[0]) < 16) ++ ; emit_insn (gen_sez ()); ++ ; }") ++ ++ ; (define_insn "*decqi_and_branch_until_1" ++ ; [(set (pc) ++ ; (if_then_else (ne (match_operand:QI 0 "register_operand" "+r") ++ ; (const_int 1)) ++ ; (label_ref (match_operand 1 "" "")) ++ ; (pc))) ++ ; (set (match_dup 0) ++ ; (plus:QI (match_dup 0) ++ ; (const_int -1)))] ++ ; "" ++ ; "#") ++ ++ ; (define_insn "*dechi_and_branch_until_1" ++ ; [(set (pc) ++ ; (if_then_else (ne (match_operand:HI 0 "register_operand" "+r") ++ ; (const_int 1)) ++ ; (label_ref (match_operand 1 "" "")) ++ ; (pc))) ++ ; (set (match_dup 0) ++ ; (plus:HI (match_dup 0) ++ ; (const_int -1)))] ++ ; "" ++ ; "#") ++ ++ ; (define_insn "*decsi_and_branch_until_1" ++ ; [(set (pc) ++ ; (if_then_else (ne (match_operand:SI 0 "register_operand" "+r") ++ ; (const_int 1)) ++ ; (label_ref (match_operand 1 "" "")) ++ ; (pc))) ++ ; (set (match_dup 0) ++ ; (plus:SI (match_dup 0) ++ ; (const_int -1)))] ++ ; "" ++ ; "#") ++ ++ ; (define_split ++ ; [(set (pc) ++ ; (if_then_else (ne (match_operand 0 "register_operand" "+r") ++ ; (const_int 1)) ++ ; (label_ref (match_operand 1 "" "")) ++ ; (pc))) ++ ; (set (match_dup 0) ++ ; (plus (match_dup 0) ++ ; (const_int -1)))] ++ ; "" ++ ; [(set (match_dup 0) (match_dup 2)) ++ ; (set (pc) ++ ; (if_then_else (ne (cc0) ++ ; (const_int 0)) ++ ; (label_ref (match_operand 1 "" "")) ++ ; (pc)))] ++ ; " ++ ; { ++ ; operands[2] = gen_rtx (PLUS, GET_MODE (operands[0]), ++ ; operands[0], constm1_rtx); ++ ; if (true_regnum (operands[0]) < 16) ++ ; emit_insn (gen_sez ()); ++ ; }") ++ ++ ;;(define_insn "" ++ ;; [(set (pc) ++ ;; (if_then_else (eq (match_operand 0 "register_operand" "+d") ++ ;; (const_int 0)) ++ ;; (label_ref (match_operand 1 "" "")) ++ ;; (pc))) ++ ;; (set (match_dup 0) ++ ;; (plus (match_dup 0) ++ ;; (const_int -1)))] ++ ;; "" ++ ;; "#") ++ ;; ++ ;;(define_split ++ ;; [(set (pc) ++ ;; (if_then_else (eq (match_operand 0 "register_operand" "+d") ++ ;; (const_int 0)) ++ ;; (label_ref (match_operand 1 "" "")) ++ ;; (pc))) ++ ;; (set (match_dup 0) ++ ;; (plus (match_dup 0) ++ ;; (const_int -1)))] ++ ;; "" ++ ;; [(set (match_dup 0) (match_dup 2)) ++ ;; (set (pc) ++ ;; (if_then_else (ltu (cc0) ++ ;; (const_int 0)) ++ ;; (label_ref (match_operand 1 "" "")) ++ ;; (pc)))] ++ ;; " ++ ;;{ ++ ;; operands[2] = gen_rtx (PLUS, GET_MODE (operands[0]), ++ ;; operands[0], constm1_rtx); ++ ;;}") ++ ;; ************************* Peepholes ******************************** ++ (define_peephole ++ [(set (match_operand:SI 0 "register_operand" "") ++ (plus:SI (match_dup 0) ++ (const_int -1))) ++ (parallel ++ [(set (cc0) ++ (compare (match_dup 0) ++ (const_int -1))) ++ (clobber (match_operand:QI 1 "register_operand" ""))]) ++ (set (pc) ++ (if_then_else (ne (cc0) (const_int 0)) ++ (label_ref (match_operand 2 "" "")) ++ (pc)))] ++ "(true_regnum (operands[0]) >= LD_REGS ++ && true_regnum (operands[1]) >= LD_REGS)" ++ "* ++ { ++ if (TEST_HARD_REG_CLASS (ADDW_REGS, true_regnum (operands[0]))) ++ output_asm_insn (AS2 (sbiw,%0,1) CR_TAB ++ AS2 (sbc,%C0,__zero_reg__) CR_TAB ++ AS2 (sbc,%D0,__zero_reg__) \"\\n\", operands); ++ else ++ output_asm_insn (AS2 (subi,%A0,1) CR_TAB ++ AS2 (sbc,%B0,__zero_reg__) CR_TAB ++ AS2 (sbc,%C0,__zero_reg__) CR_TAB ++ AS2 (sbc,%D0,__zero_reg__) \"\\n\", operands); ++ switch (avr_jump_mode (operands[2],insn)) ++ { ++ case 1: ++ return AS1 (brcc,%2); ++ case 2: ++ return (AS1 (brcs,_PC_+2) CR_TAB ++ AS1 (rjmp,%2)); ++ } ++ return (AS1 (brcs,_PC_+4) CR_TAB ++ AS1 (jmp,%2)); ++ }") ++ ++ (define_peephole ++ [(set (match_operand:HI 0 "register_operand" "") ++ (plus:HI (match_dup 0) ++ (const_int -1))) ++ (parallel ++ [(set (cc0) ++ (compare (match_dup 0) ++ (const_int 65535))) ++ (clobber (match_operand:QI 1 "register_operand" ""))]) ++ (set (pc) ++ (if_then_else (ne (cc0) (const_int 0)) ++ (label_ref (match_operand 2 "" "")) ++ (pc)))] ++ "(true_regnum (operands[0]) >= LD_REGS ++ && true_regnum (operands[1]) >= LD_REGS)" ++ "* ++ { ++ if (TEST_HARD_REG_CLASS (ADDW_REGS, true_regnum (operands[0]))) ++ output_asm_insn (AS2 (sbiw,%0,1), operands); ++ else ++ output_asm_insn (AS2 (subi,%A0,1) CR_TAB ++ AS2 (sbc,%B0,__zero_reg__) \"\\n\", operands); ++ switch (avr_jump_mode (operands[2],insn)) ++ { ++ case 1: ++ return AS1 (brcc,%2); ++ case 2: ++ return (AS1 (brcs,_PC_+2) CR_TAB ++ AS1 (rjmp,%2)); ++ } ++ return (AS1 (brcs,_PC_+4) CR_TAB ++ AS1 (jmp,%2)); ++ }") ++ ++ (define_peephole ++ [(set (match_operand:QI 0 "register_operand" "") ++ (plus:QI (match_dup 0) ++ (const_int -1))) ++ (set (cc0) ++ (compare (match_dup 0) ++ (const_int -1))) ++ (set (pc) ++ (if_then_else (ne (cc0) (const_int 0)) ++ (label_ref (match_operand 1 "" "")) ++ (pc)))] ++ "(true_regnum (operands[0]) >= LD_REGS)" ++ "* ++ { ++ output_asm_insn (AS2 (subi,%A0,1), operands); ++ switch (avr_jump_mode (operands[1],insn)) ++ { ++ case 1: ++ return AS1 (brcc,%1); ++ case 2: ++ return (AS1 (brcs,_PC_+2) CR_TAB ++ AS1 (rjmp,%1)); ++ } ++ return (AS1 (brcs,_PC_+4) CR_TAB ++ AS1 (jmp,%1)); ++ }") ++ +diff -Nrc3p gcc-2.95.2.orig/gcc/config/avr/avr.h gcc-2.95.2/gcc/config/avr/avr.h +*** gcc-2.95.2.orig/gcc/config/avr/avr.h Sat Dec 18 17:50:17 1999 +--- gcc-2.95.2/gcc/config/avr/avr.h Sun Dec 19 22:57:52 1999 +*************** +*** 0 **** +--- 1,5524 ---- ++ /* Definitions of target machine for GNU compiler, ++ for ATMEL AVR at90s8515, ATmega103/103L, ATmega603/603L microcontroller. ++ Copyright (C) 1998, 1999 by Denis Chertykov (denisc@overta.ru) ++ ++ You can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ */ ++ ++ /* Names to predefine in the preprocessor for this target machine. */ ++ ++ #define CPP_PREDEFINES "-DAVR" ++ /* ++ Define this to be a string constant containing `-D' options to ++ define the predefined macros that identify this machine and system. ++ These macros will be predefined unless the `-ansi' option is ++ specified. ++ ++ In addition, a parallel set of macros are predefined, whose names ++ are made by appending `__' at the beginning and at the end. These ++ `__' macros are permitted by the ANSI standard, so they are ++ predefined regardless of whether `-ansi' is specified. ++ ++ For example, on the Sun, one can use the following value: ++ ++ "-Dmc68000 -Dsun -Dunix" ++ ++ The result is to define the macros `__mc68000__', `__sun__' and ++ `__unix__' unconditionally, and the macros `mc68000', `sun' and ++ `unix' provided `-ansi' is not specified. ++ */ ++ extern int target_flags; ++ /* ++ This declaration should be present. ++ */ ++ ++ /* Select string according to the target assembler */ ++ #define AS_STR(ava,gas) (TARGET_AVA ? ava : gas) ++ ++ /* Dump each assembler insn's rtl into the output file. ++ This is for debugging the compiler only. */ ++ ++ #define TARGET_ORDER_1 (target_flags & 0x1000) ++ #define TARGET_ORDER_2 (target_flags & 0x4000) ++ #define TARGET_INT8 (target_flags & 0x10000) ++ #define TARGET_NO_INTERRUPTS (target_flags & 0x20000) ++ #define TARGET_INSN_SIZE_DUMP (target_flags & 0x2000) ++ #define TARGET_INCLUDE (target_flags & 0x8000) ++ #define TARGET_CALL_PROLOGUES (target_flags & 0x40000) ++ #define TARGET_AVA (target_flags & 0x80000) ++ ++ #define TARGET_RTL_DUMP (target_flags & 0x010) ++ #define TARGET_ALL_DEBUG (target_flags & 0xfe0) ++ /* ++ `TARGET_...' ++ This series of macros is to allow compiler command arguments to ++ enable or disable the use of optional features of the target ++ machine. For example, one machine description serves both the ++ 68000 and the 68020; a command argument tells the compiler whether ++ it should use 68020-only instructions or not. This command ++ argument works by means of a macro `TARGET_68020' that tests a bit ++ in `target_flags'. ++ ++ Define a macro `TARGET_FEATURENAME' for each such option. Its ++ definition should test a bit in `target_flags'; for example: ++ ++ #define TARGET_68020 (target_flags & 1) ++ ++ One place where these macros are used is in the ++ condition-expressions of instruction patterns. Note how ++ `TARGET_68020' appears frequently in the 68000 machine description ++ file, `m68k.md'. Another place they are used is in the ++ definitions of the other macros in the `MACHINE.h' file. ++ */ ++ ++ ++ ++ #define TARGET_SWITCHES { \ ++ {"order1",0x1000}, \ ++ {"order2",0x4000}, \ ++ {"include-target",0x8000, \ ++ "Add line `#include \"target.inc\"' to front of outputed .s file"}, \ ++ {"int8",0x10000,"Assume int to be 8 bit integer"}, \ ++ {"no-interrupts",0x20000,"Don't output interrupt compatible code"}, \ ++ {"call-prologues",0x40000, \ ++ "Use subroutines for functions prologeu/epilogue"}, \ ++ {"ava", 0x80000, "Use AVA as assembler and linker"}, \ ++ {"rtl",0x10}, \ ++ {"size",0x2000,"Output instruction size's to the asm file"}, \ ++ {"deb",0xfe0}, \ ++ {"",0}} ++ /* ++ This macro defines names of command options to set and clear bits ++ in `target_flags'. Its definition is an initializer with a ++ subgrouping for each command option. ++ ++ 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 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. ++ ++ One of the subgroupings should have a null string. The number in ++ this grouping is the default value for `target_flags'. Any target ++ options act starting with that value. ++ ++ Here is an example which defines `-m68000' and `-m68020' with ++ opposite meanings, and picks the latter as the default: ++ ++ #define TARGET_SWITCHES \ ++ { { "68020", 1}, \ ++ { "68000", -1}, \ ++ { "", 1}} ++ */ ++ ++ extern const char *avr_ram_end; ++ extern const char *avr_mcu_name; ++ ++ struct mcu_type_s { ++ char * name; ++ char * ava_name; ++ int stack; ++ int mega; ++ }; ++ ++ extern struct mcu_type_s *avr_mcu_type; ++ #define AVR_MEGA (avr_mcu_type->mega) ++ ++ #define TARGET_OPTIONS { \ ++ {"init-stack=",&avr_ram_end,"Specify the initial stack address" }, \ ++ {"mcu=", &avr_mcu_name, \ ++ "Specify the MCU name (at90s23xx,attiny22,at90s44xx,at90s85xx,atmega603,atmega103)"}} ++ /* ++ This macro is similar to `TARGET_SWITCHES' but defines names of ++ command options that have values. Its definition is an ++ initializer with a subgrouping for each command option. ++ ++ Each subgrouping contains a string constant, that defines the ++ fixed part of the option name, and the address of a variable. The ++ variable, type `char *', is set to the variable part of the given ++ option if the fixed part matches. The actual option name is made ++ by appending `-m' to the specified name. ++ ++ Here is an example which defines `-mshort-data-NUMBER'. If the ++ given option is `-mshort-data-512', the variable `m88k_short_data' ++ will be set to the string `"512"'. ++ ++ extern char *m88k_short_data; ++ #define TARGET_OPTIONS \ ++ { { "short-data-", &m88k_short_data } } ++ */ ++ ++ #define TARGET_VERSION fprintf (stderr, "AVA/GNU BINUTILS version"); ++ /* ++ This macro is a C statement to print on `stderr' a string ++ describing the particular machine description choice. Every ++ machine description should define `TARGET_VERSION'. For example: ++ ++ #ifdef MOTOROLA ++ #define TARGET_VERSION \ ++ fprintf (stderr, " (68k, Motorola syntax)"); ++ #else ++ #define TARGET_VERSION \ ++ fprintf (stderr, " (68k, MIT syntax)"); ++ #endif ++ */ ++ ++ #define OVERRIDE_OPTIONS avr_override_options() ++ /* ++ `OVERRIDE_OPTIONS' ++ Sometimes certain combinations of command options do not make ++ sense on a particular target machine. You can define a macro ++ `OVERRIDE_OPTIONS' to take account of this. This macro, if ++ defined, is executed once just after all the command options have ++ been parsed. ++ ++ Don't use this macro to turn on various extra optimizations for ++ `-O'. That is what `OPTIMIZATION_OPTIONS' is for. ++ */ ++ /* ++ `OPTIMIZATION_OPTIONS (LEVEL)' ++ Some machines may desire to change what optimizations are ++ performed for various optimization levels. This macro, if ++ defined, is executed once just after the optimization level is ++ determined and before the remainder of the command options have ++ been parsed. Values set in this macro are used as the default ++ values for the other command line options. ++ ++ LEVEL is the optimization level specified; 2 if `-O2' is ++ specified, 1 if `-O' is specified, and 0 if neither is specified. ++ ++ You should not use this macro to change options that are not ++ machine-specific. These should uniformly selected by the same ++ optimization level on all supported machines. Use this macro to ++ enable machine-specific optimizations. ++ ++ *Do not examine `write_symbols' in this macro!* The debugging ++ options are not supposed to alter the generated code. ++ */ ++ ++ ++ #define CAN_DEBUG_WITHOUT_FP ++ /* ++ Define this macro if debugging can be performed even without a ++ frame pointer. If this macro is defined, GNU CC will turn on the ++ `-fomit-frame-pointer' option whenever `-O' is specified. ++ */ ++ ++ /* Define this if most significant byte of a word is the lowest numbered. */ ++ #define BITS_BIG_ENDIAN 0 ++ ++ /* Define this if most significant byte of a word is the lowest numbered. */ ++ #define BYTES_BIG_ENDIAN 0 ++ ++ /* Define this if most significant word of a multiword number is the lowest ++ numbered. */ ++ #define WORDS_BIG_ENDIAN 0 ++ ++ /* number of bits in an addressable storage unit */ ++ #define BITS_PER_UNIT 8 ++ ++ /* Width in bits of a "word", which is the contents of a machine register. ++ Note that this is not necessarily the width of data type `int';*/ ++ #define BITS_PER_WORD 8 ++ ++ /* Width of a word, in units (bytes). */ ++ #define UNITS_PER_WORD 1 ++ ++ /* Width in bits of a pointer. ++ See also the macro `Pmode' defined below. */ ++ #define POINTER_SIZE 16 ++ ++ ++ /* Maximum sized of reasonable data type ++ DImode or Dfmode ...*/ ++ #define MAX_FIXED_MODE_SIZE 32 ++ ++ /* Allocation boundary (in *bits*) for storing arguments in argument list. */ ++ #define PARM_BOUNDARY 8 ++ ++ /* Allocation boundary (in *bits*) for the code of a function. */ ++ #define FUNCTION_BOUNDARY 8 ++ ++ /* Alignment of field after `int : 0' in a structure. */ ++ #define EMPTY_FIELD_BOUNDARY 8 ++ ++ /* No data type wants to be aligned rounder than this. */ ++ #define BIGGEST_ALIGNMENT 8 ++ ++ ++ #define STRICT_ALIGNMENT 0 ++ /* ++ Define this if move instructions will actually fail to work ++ when given unaligned data. ++ */ ++ ++ ++ #define INT_TYPE_SIZE (TARGET_INT8 ? 8 : 16) ++ /* ++ A C expression for the size in bits of the type `int' on the ++ target machine. If you don't define this, the default is one word. ++ */ ++ ++ ++ #define SHORT_TYPE_SIZE (INT_TYPE_SIZE == 8 ? INT_TYPE_SIZE : 16) ++ /* ++ A C expression for the size in bits of the type `short' on the ++ target machine. If you don't define this, the default is half a ++ word. (If this would be less than one storage unit, it is rounded ++ up to one unit.) ++ */ ++ ++ #define LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 16 : 32) ++ /* ++ A C expression for the size in bits of the type `long' on the ++ target machine. If you don't define this, the default is one word. ++ */ ++ ++ ++ #define MAX_LONG_TYPE_SIZE 32 ++ /* ++ Maximum number for the size in bits of the type `long' on the ++ target machine. If this is undefined, the default is ++ `LONG_TYPE_SIZE'. Otherwise, it is the constant value that is the ++ largest value that `LONG_TYPE_SIZE' can have at run-time. This is ++ used in `cpp'. ++ */ ++ ++ ++ #define LONG_LONG_TYPE_SIZE 64 ++ /* ++ A C expression for the size in bits of the type `long long' on the ++ target machine. If you don't define this, the default is two ++ words. If you want to support GNU Ada on your machine, the value ++ of macro must be at least 64. ++ */ ++ ++ ++ #define CHAR_TYPE_SIZE 8 ++ /* ++ A C expression for the size in bits of the type `char' on the ++ target machine. If you don't define this, the default is one ++ quarter of a word. (If this would be less than one storage unit, ++ it is rounded up to one unit.) ++ */ ++ ++ #define FLOAT_TYPE_SIZE 32 ++ /* ++ A C expression for the size in bits of the type `float' on the ++ target machine. If you don't define this, the default is one word. ++ */ ++ ++ #define DOUBLE_TYPE_SIZE 32 ++ /* ++ A C expression for the size in bits of the type `double' on the ++ target machine. If you don't define this, the default is two ++ words. ++ */ ++ ++ ++ #define LONG_DOUBLE_TYPE_SIZE 32 ++ /* ++ A C expression for the size in bits of the type `long double' on ++ the target machine. If you don't define this, the default is two ++ words. ++ */ ++ ++ #define DEFAULT_SIGNED_CHAR 1 ++ /* ++ An expression whose value is 1 or 0, according to whether the type ++ `char' should be signed or unsigned by default. The user can ++ always override this default with the options `-fsigned-char' and ++ `-funsigned-char'. ++ */ ++ ++ /* ++ `DEFAULT_SHORT_ENUMS' ++ A C expression to determine whether to give an `enum' type only as ++ many bytes as it takes to represent the range of possible values ++ of that type. A nonzero value means to do that; a zero value ++ means all `enum' types should be allocated like `int'. ++ ++ If you don't define the macro, the default is 0. ++ */ ++ ++ #define SIZE_TYPE (INT_TYPE_SIZE == 8 ? "long unsigned int" : "unsigned int") ++ /* ++ A C expression for a string describing the name of the data type ++ to use for size values. The typedef name `size_t' is defined ++ using the contents of the string. ++ ++ The string can contain more than one keyword. If so, separate ++ them with spaces, and write first any length keyword, then ++ `unsigned' if appropriate, and finally `int'. The string must ++ exactly match one of the data type names defined in the function ++ `init_decl_processing' in the file `c-decl.c'. You may not omit ++ `int' or change the order--that would cause the compiler to crash ++ on startup. ++ ++ If you don't define this macro, the default is `"long unsigned ++ int"'. ++ */ ++ ++ /* ++ A C expression for a string describing the name of the data type ++ to use for the result of subtracting two pointers. The typedef ++ name `ptrdiff_t' is defined using the contents of the string. See ++ `SIZE_TYPE' above for more information. ++ ++ If you don't define this macro, the default is `"long int"'. ++ */ ++ #define PTRDIFF_TYPE (INT_TYPE_SIZE == 8 ? "long unsigned int" : "unsigned int") ++ ++ ++ #define WCHAR_TYPE_SIZE 16 ++ /* ++ A C expression for the size in bits of the data type for wide ++ characters. This is used in `cpp', which cannot make use of ++ `WCHAR_TYPE'. ++ */ ++ ++ #define FIRST_PSEUDO_REGISTER 36 ++ /* ++ Number of hardware registers known to the compiler. They receive ++ numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first ++ pseudo register's number really is assigned the number ++ `FIRST_PSEUDO_REGISTER'. ++ */ ++ ++ #define FIXED_REGISTERS {\ ++ 1,1,/* r0 r1 */\ ++ 0,0,/* r2 r3 */\ ++ 0,0,/* r4 r5 */\ ++ 0,0,/* r6 r7 */\ ++ 0,0,/* r8 r9 */\ ++ 0,0,/* r10 r11 */\ ++ 0,0,/* r12 r13 */\ ++ 0,0,/* r14 r15 */\ ++ 0,0,/* r16 r17 */\ ++ 0,0,/* r18 r19 */\ ++ 0,0,/* r20 r21 */\ ++ 0,0,/* r22 r23 */\ ++ 0,0,/* r24 r25 */\ ++ 0,0,/* r26 r27 */\ ++ 0,0,/* r28 r29 */\ ++ 0,0,/* r30 r31 */\ ++ 1,1,/* STACK */\ ++ 1,1 /* arg pointer */ } ++ /* ++ An initializer that says which registers are used for fixed ++ purposes all throughout the compiled code and are therefore not ++ available for general allocation. These would include the stack ++ pointer, the frame pointer (except on machines where that can be ++ used as a general register when no frame pointer is needed), the ++ program counter on machines where that is considered one of the ++ addressable registers, and any other numbered register with a ++ standard use. ++ ++ This information is expressed as a sequence of numbers, separated ++ by commas and surrounded by braces. The Nth number is 1 if ++ register N is fixed, 0 otherwise. ++ ++ The table initialized from this macro, and the table initialized by ++ the following one, may be overridden at run time either ++ automatically, by the actions of the macro ++ `CONDITIONAL_REGISTER_USAGE', or by the user with the command ++ options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'. ++ */ ++ ++ #define CALL_USED_REGISTERS { \ ++ 1,1,/* r0 r1 */ \ ++ 0,0,/* r2 r3 */ \ ++ 0,0,/* r4 r5 */ \ ++ 0,0,/* r6 r7 */ \ ++ 0,0,/* r8 r9 */ \ ++ 0,0,/* r10 r11 */ \ ++ 0,0,/* r12 r13 */ \ ++ 0,0,/* r14 r15 */ \ ++ 0,0,/* r16 r17 */ \ ++ 1,1,/* r18 r19 */ \ ++ 1,1,/* r20 r21 */ \ ++ 1,1,/* r22 r23 */ \ ++ 1,1,/* r24 r25 */ \ ++ 1,1,/* r26 r27 */ \ ++ 0,0,/* r28 r29 */ \ ++ 1,1,/* r30 r31 */ \ ++ 1,1,/* STACK */ \ ++ 1,1 /* arg pointer */ } ++ /* ++ Like `FIXED_REGISTERS' but has 1 for each register that is ++ clobbered (in general) by function calls as well as for fixed ++ registers. This macro therefore identifies the registers that are ++ not available for general allocation of values that must live ++ across function calls. ++ ++ If a register has 0 in `CALL_USED_REGISTERS', the compiler ++ automatically saves it on function entry and restores it on ++ function exit, if the register is used within the function. ++ */ ++ ++ /*#define CONDITIONAL_REGISTER_USAGE ;*/ ++ /* ++ Zero or more C statements that may conditionally modify two ++ variables `fixed_regs' and `call_used_regs' (both of type `char ++ []') after they have been initialized from the two preceding ++ macros. ++ ++ This is necessary in case the fixed or call-clobbered registers ++ depend on target flags. ++ ++ You need not define this macro if it has no work to do. ++ ++ If the usage of an entire class of registers depends on the target ++ flags, you may indicate this to GCC by using this macro to modify ++ `fixed_regs' and `call_used_regs' to 1 for each of the registers ++ in the classes which should not be used by GCC. Also define the ++ macro `REG_CLASS_FROM_LETTER' to return `NO_REGS' if it is called ++ with a letter for a class that shouldn't be used. ++ ++ (However, if this class is not included in `GENERAL_REGS' and all ++ of the insn patterns whose constraints permit this class are ++ controlled by target switches, then GCC will automatically avoid ++ using these registers when the target switches are opposed to ++ them.) ++ */ ++ ++ #define NON_SAVING_SETJMP 0 ++ /* ++ If this macro is defined and has a nonzero value, it means that ++ `setjmp' and related functions fail to save the registers, or that ++ `longjmp' fails to restore them. To compensate, the compiler ++ avoids putting variables in registers in functions that use ++ `setjmp'. ++ */ ++ ++ /* ++ `INCOMING_REGNO (OUT)' ++ Define this macro if the target machine has register windows. ++ This C expression returns the register number as seen by the ++ called function corresponding to the register number OUT as seen ++ by the calling function. Return OUT if register number OUT is not ++ an outbound register. ++ ++ `OUTGOING_REGNO (IN)' ++ Define this macro if the target machine has register windows. ++ This C expression returns the register number as seen by the ++ calling function corresponding to the register number IN as seen ++ by the called function. Return IN if register number IN is not an ++ inbound register. ++ ++ */ ++ #define REG_ALLOC_ORDER { \ ++ 24,25, \ ++ 18,19, \ ++ 20,21, \ ++ 22,23, \ ++ 30,31, \ ++ 26,27, \ ++ 28,29, \ ++ 17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2, \ ++ 0,1, \ ++ 32,33,34,35 \ ++ } ++ /* XXX optimize optimize ++ ++ If defined, an initializer for a vector of integers, containing the ++ numbers of hard registers in the order in which GNU CC should ++ prefer to use them (from most preferred to least). ++ ++ If this macro is not defined, registers are used lowest numbered ++ first (all else being equal). ++ ++ One use of this macro is on machines where the highest numbered ++ registers must always be saved and the save-multiple-registers ++ instruction supports only sequences of consetionve registers. On ++ such machines, define `REG_ALLOC_ORDER' to be an initializer that ++ lists the highest numbered allocatable register first. ++ */ ++ ++ #define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc () ++ /* ++ ++ ORDER_REGS_FOR_LOCAL_ALLOC' ++ A C statement (sans semicolon) to choose the order in which to ++ allocate hard registers for pseudo-registers local to a basic ++ block. ++ ++ Store the desired register order in the array `reg_alloc_order'. ++ Element 0 should be the register to allocate first; element 1, the ++ next register; and so on. ++ ++ The macro body should not assume anything about the contents of ++ `reg_alloc_order' before execution of the macro. ++ ++ On most machines, it is not necessary to define this macro. ++ ++ */ ++ ++ ++ #define HARD_REGNO_NREGS(REGNO, MODE) ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) ++ ++ /* ++ A C expression for the number of consecutive hard registers, ++ starting at register number REGNO, required to hold a value of mode ++ MODE. ++ ++ On a machine where all registers are exactly one word, a suitable ++ definition of this macro is ++ ++ #define HARD_REGNO_NREGS(REGNO, MODE) \ ++ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \ ++ / UNITS_PER_WORD)) ++ */ ++ ++ #define HARD_REGNO_MODE_OK(REGNO, MODE) (((REGNO) >= 24 && (MODE) != QImode) \ ++ ? ! ((REGNO) & 1) \ ++ : 1) ++ /* XXX may be need ++ A C expression that is nonzero if it is permissible to store a ++ value of mode MODE in hard register number REGNO (or in several ++ registers starting with that one). For a machine where all ++ registers are equivalent, a suitable definition is ++ ++ #define HARD_REGNO_MODE_OK(REGNO, MODE) 1 ++ ++ It is not necessary for this macro to check for the numbers of ++ fixed registers, because the allocation mechanism considers them ++ to be always occupied. ++ ++ On some machines, double-precision values must be kept in even/odd ++ register pairs. The way to implement that is to define this macro ++ to reject odd register numbers for such modes. ++ ++ The minimum requirement for a mode to be OK in a register is that ++ the `movMODE' instruction pattern support moves between the ++ register and any other hard register for which the mode is OK; and ++ that moving a value into the register and back out not alter it. ++ ++ Since the same instruction used to move `SImode' will work for all ++ narrower integer modes, it is not necessary on any machine for ++ `HARD_REGNO_MODE_OK' to distinguish between these modes, provided ++ you define patterns `movhi', etc., to take advantage of this. This ++ is useful because of the interaction between `HARD_REGNO_MODE_OK' ++ and `MODES_TIEABLE_P'; it is very desirable for all integer modes ++ to be tieable. ++ ++ Many machines have special registers for floating point arithmetic. ++ Often people assume that floating point machine modes are allowed ++ only in floating point registers. This is not true. Any ++ registers that can hold integers can safely *hold* a floating ++ point machine mode, whether or not floating arithmetic can be done ++ on it in those registers. Integer move instructions can be used ++ to move the values. ++ ++ On some machines, though, the converse is true: fixed-point machine ++ modes may not go in floating registers. This is true if the ++ floating registers normalize any value stored in them, because ++ storing a non-floating value there would garble it. In this case, ++ `HARD_REGNO_MODE_OK' should reject fixed-point machine modes in ++ floating registers. But if the floating registers do not ++ automatically normalize, if you can store any bit pattern in one ++ and retrieve it unchanged without a trap, then any machine mode ++ may go in a floating register, so you can define this macro to say ++ so. ++ ++ The primary significance of special floating registers is rather ++ that they are the registers acceptable in floating point arithmetic ++ instructions. However, this is of no concern to ++ `HARD_REGNO_MODE_OK'. You handle it by writing the proper ++ constraints for those instructions. ++ ++ On some machines, the floating registers are especially slow to ++ access, so that it is better to store a value in a stack frame ++ than in such a register if floating point arithmetic is not being ++ done. As long as the floating registers are not in class ++ `GENERAL_REGS', they will not be used unless some pattern's ++ constraint asks for one. ++ */ ++ ++ #define MODES_TIEABLE_P(MODE1, MODE2) 0 ++ /* ++ A C expression that is nonzero if it is desirable to choose ++ register allocation so as to avoid move instructions between a ++ value of mode MODE1 and a value of mode MODE2. ++ ++ If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, ++ MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1, ++ MODE2)' must be zero. ++ */ ++ ++ enum reg_class { ++ NO_REGS, ++ R0_REG, /* r0 */ ++ POINTER_X_REGS, /* r26 - r27 */ ++ POINTER_Y_REGS, /* r28 - r29 */ ++ POINTER_Z_REGS, /* r30 - r31 */ ++ STACK_REG, /* STACK */ ++ BASE_POINTER_REGS, /* r28 - r31 */ ++ POINTER_REGS, /* r26 - r31 */ ++ ADDW_REGS, /* r24 - r31 */ ++ SIMPLE_LD_REGS, /* r16 - r23 */ ++ LD_REGS, /* r16 - r31 */ ++ NO_LD_REGS, /* r0 - r15 */ ++ GENERAL_REGS, /* r0 - r31 */ ++ ALL_REGS, LIM_REG_CLASSES ++ }; ++ /* ++ An enumeral type that must be defined with all the register class ++ names as enumeral values. `NO_REGS' must be first. `ALL_REGS' ++ must be the last register class, followed by one more enumeral ++ value, `LIM_REG_CLASSES', which is not a register class but rather ++ tells how many classes there are. ++ ++ Each register class has a number, which is the value of casting ++ the class name to type `int'. The number serves as an index in ++ many of the tables described below. ++ */ ++ ++ ++ #define N_REG_CLASSES (int)LIM_REG_CLASSES ++ /* ++ The number of distinct register classes, defined as follows: ++ ++ #define N_REG_CLASSES (int) LIM_REG_CLASSES ++ */ ++ ++ #define REG_CLASS_NAMES { \ ++ "NO_REGS", \ ++ "R0_REG", /* r0 */ \ ++ "POINTER_X_REGS", /* r26 - r27 */ \ ++ "POINTER_Y_REGS", /* r28 - r29 */ \ ++ "POINTER_Z_REGS", /* r30 - r31 */ \ ++ "STACK_REG", /* STACK */ \ ++ "BASE_POINTER_REGS", /* r28 - r31 */ \ ++ "POINTER_REGS", /* r26 - r31 */ \ ++ "ADDW_REGS", /* r24 - r31 */ \ ++ "SIMPLE_LD_REGS", /* r16 - r23 */ \ ++ "LD_REGS", /* r16 - r31 */ \ ++ "NO_LD_REGS", /* r0 - r15 */ \ ++ "GENERAL_REGS", /* r0 - r31 */ \ ++ "ALL_REGS" } ++ /* ++ An initializer containing the names of the register classes as C ++ string constants. These names are used in writing some of the ++ debugging dumps. ++ */ ++ ++ #define REG_X 26 ++ #define REG_Y 28 ++ #define REG_Z 30 ++ #define REG_W 24 ++ ++ #define REG_CLASS_CONTENTS { \ ++ {0x00000000,0x00000000}, /* NO_REGS */ \ ++ {0x00000001,0x00000000}, /* R0_REG */ \ ++ {3 << REG_X,0x00000000}, /* POINTER_X_REGS, r26 - r27 */ \ ++ {3 << REG_Y,0x00000000}, /* POINTER_Y_REGS, r28 - r29 */ \ ++ {3 << REG_Z,0x00000000}, /* POINTER_Z_REGS, r30 - r31 */ \ ++ {0x00000000,0x00000003}, /* STACK_REG, STACK */ \ ++ {(3 << REG_Y) | (3 << REG_Z), \ ++ 0x00000000}, /* BASE_POINTER_REGS, r28 - r31 */ \ ++ {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z), \ ++ 0x00000000}, /* POINTER_REGS, r26 - r31 */ \ ++ {(3 << REG_X) | (3 << REG_Y) | (3 << REG_Z) | (3 << REG_W), \ ++ 0x00000000}, /* ADDW_REGS, r24 - r31 */ \ ++ {0x00ff0000,0x00000000}, /* SIMPLE_LD_REGS r16 - r23 */ \ ++ {(3 << REG_X)|(3 << REG_Y)|(3 << REG_Z)|(3 << REG_W)|(0xff << 16), \ ++ 0x00000000}, /* LD_REGS, r16 - r31 */ \ ++ {0x0000ffff,0x00000000}, /* NO_LD_REGS r0 - r15 */ \ ++ {0xffffffff,0x00000000}, /* GENERAL_REGS, r0 - r31 */ \ ++ {0xffffffff,0x00000003} /* ALL_REGS */ \ ++ } ++ /* ++ An initializer containing the contents of the register classes, as ++ integers which are bit masks. The Nth integer specifies the ++ contents of class N. The way the integer MASK is interpreted is ++ that register R is in the class if `MASK & (1 << R)' is 1. ++ ++ When the machine has more than 32 registers, an integer does not ++ suffice. Then the integers are replaced by sub-initializers, ++ braced groupings containing several integers. Each ++ sub-initializer must be suitable as an initializer for the type ++ `HARD_REG_SET' which is defined in `hard-reg-set.h'. ++ */ ++ ++ #define REGNO_REG_CLASS(R) avr_regno_reg_class(R) ++ /* ++ A C expression whose value is a register class containing hard ++ register REGNO. In general there is more than one such class; ++ choose a class which is "minimal", meaning that no smaller class ++ also contains the register. ++ */ ++ ++ #define BASE_REG_CLASS POINTER_REGS ++ /* ++ A macro whose definition is the name of the class to which a valid ++ base register must belong. A base register is one used in an ++ address which is the register value plus a displacement. ++ */ ++ ++ #define INDEX_REG_CLASS NO_REGS ++ /* ++ A macro whose definition is the name of the class to which a valid ++ index register must belong. An index register is one used in an ++ address where its value is either multiplied by a scale factor or ++ added to another register (as well as added to a displacement). ++ */ ++ ++ #define REG_CLASS_FROM_LETTER(C) avr_reg_class_from_letter(C) ++ /* ++ A C expression which defines the machine-dependent operand ++ constraint letters for register classes. If CHAR is such a ++ letter, the value should be the register class corresponding to ++ it. Otherwise, the value should be `NO_REGS'. The register ++ letter `r', corresponding to class `GENERAL_REGS', will not be ++ passed to this macro; you do not need to handle it. ++ */ ++ ++ #define REGNO_OK_FOR_BASE_P(r) (((r) < FIRST_PSEUDO_REGISTER \ ++ && ((r) == REG_X \ ++ || (r) == REG_Y \ ++ || (r) == REG_Z \ ++ || (r) == ARG_POINTER_REGNUM)) \ ++ || (reg_renumber \ ++ && (reg_renumber[r] == REG_X \ ++ || reg_renumber[r] == REG_Y \ ++ || reg_renumber[r] == REG_Z \ ++ || (reg_renumber[r] \ ++ == ARG_POINTER_REGNUM)))) ++ /* ++ A C expression which is nonzero if register number NUM is suitable ++ for use as a base register in operand addresses. It may be either ++ a suitable hard register or a pseudo register that has been ++ allocated such a hard register. ++ */ ++ ++ /* ++ #define REGNO_MODE_OK_FOR_BASE_P(r, m) regno_mode_ok_for_base_p(r, m) ++ A C expression that is just like `REGNO_OK_FOR_BASE_P', except that ++ that expression may examine the mode of the memory reference in ++ MODE. You should define this macro if the mode of the memory ++ reference affects whether a register may be used as a base ++ register. If you define this macro, the compiler will use it ++ instead of `REGNO_OK_FOR_BASE_P'. ++ */ ++ ++ #define REGNO_OK_FOR_INDEX_P(NUM) 0 ++ /* ++ A C expression which is nonzero if register number NUM is suitable ++ for use as an index register in operand addresses. It may be ++ either a suitable hard register or a pseudo register that has been ++ allocated such a hard register. ++ ++ The difference between an index register and a base register is ++ that the index register may be scaled. If an address involves the ++ sum of two registers, neither one of them scaled, then either one ++ may be labeled the "base" and the other the "index"; but whichever ++ labeling is used must fit the machine's constraints of which ++ registers may serve in each capacity. The compiler will try both ++ labelings, looking for one that is valid, and will reload one or ++ both registers only if neither labeling works. ++ */ ++ ++ #define PREFERRED_RELOAD_CLASS(X, CLASS) preferred_reload_class(X,CLASS) ++ /* ++ A C expression that places additional restrictions on the register ++ class to use when it is necessary to copy value X into a register ++ in class CLASS. The value is a register class; perhaps CLASS, or ++ perhaps another, smaller class. On many machines, the following ++ definition is safe: ++ ++ #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS ++ ++ Sometimes returning a more restrictive class makes better code. ++ For example, on the 68000, when X is an integer constant that is ++ in range for a `moveq' instruction, the value of this macro is ++ always `DATA_REGS' as long as CLASS includes the data registers. ++ Requiring a data register guarantees that a `moveq' will be used. ++ ++ If X is a `const_double', by returning `NO_REGS' you can force X ++ into a memory constant. This is useful on certain machines where ++ immediate floating values cannot be loaded into certain kinds of ++ registers. ++ */ ++ /* ++ `PREFERRED_OUTPUT_RELOAD_CLASS (X, CLASS)' ++ Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of ++ input reloads. If you don't define this macro, the default is to ++ use CLASS, unchanged. ++ */ ++ ++ /* ++ `LIMIT_RELOAD_CLASS (MODE, CLASS)' ++ A C expression that places additional restrictions on the register ++ class to use when it is necessary to be able to hold a value of ++ mode MODE in a reload register for which class CLASS would ++ ordinarily be used. ++ ++ Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when ++ there are certain modes that simply can't go in certain reload ++ classes. ++ ++ The value is a register class; perhaps CLASS, or perhaps another, ++ smaller class. ++ ++ Don't define this macro unless the target machine has limitations ++ which require the macro to do something nontrivial. ++ */ ++ ++ #define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \ ++ secondary_input_reload_class (CLASS, MODE, X) ++ ++ /* ++ #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) secondary_output_reload_class (CLASS, MODE, X) ++ `SECONDARY_RELOAD_CLASS (CLASS, MODE, X)' ++ `SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)' ++ Many machines have some registers that cannot be copied directly ++ to or from memory or even from other types of registers. An ++ example is the `MQ' register, which on most machines, can only be ++ copied to or from general registers, but not memory. Some ++ machines allow copying all registers to and from memory, but ++ require a scratch register for stores to some memory locations ++ (e.g., those with symbolic address on the RT, and those with ++ certain symbolic address on the Sparc when compiling PIC). In ++ some cases, both an intermediate and a scratch register are ++ required. ++ ++ You should define these macros to indicate to the reload phase ++ that it may need to allocate at least one register for a reload in ++ addition to the register to contain the data. Specifically, if ++ copying X to a register CLASS in MODE requires an intermediate ++ register, you should define `SECONDARY_INPUT_RELOAD_CLASS' to ++ return the largest register class all of whose registers can be ++ used as intermediate registers or scratch registers. ++ ++ If copying a register CLASS in MODE to X requires an intermediate ++ or scratch register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be ++ defined to return the largest register class required. If the ++ requirements for input and output reloads are the same, the macro ++ `SECONDARY_RELOAD_CLASS' should be used instead of defining both ++ macros identically. ++ ++ The values returned by these macros are often `GENERAL_REGS'. ++ Return `NO_REGS' if no spare register is needed; i.e., if X can be ++ directly copied to or from a register of CLASS in MODE without ++ requiring a scratch register. Do not define this macro if it ++ would always return `NO_REGS'. ++ ++ If a scratch register is required (either with or without an ++ intermediate register), you should define patterns for ++ `reload_inM' or `reload_outM', as required (*note Standard ++ Names::.. These patterns, which will normally be implemented with ++ a `define_expand', should be similar to the `movM' patterns, ++ except that operand 2 is the scratch register. ++ ++ Define constraints for the reload register and scratch register ++ that contain a single register class. If the original reload ++ register (whose class is CLASS) can meet the constraint given in ++ the pattern, the value returned by these macros is used for the ++ class of the scratch register. Otherwise, two additional reload ++ registers are required. Their classes are obtained from the ++ constraints in the insn pattern. ++ ++ X might be a pseudo-register or a `subreg' of a pseudo-register, ++ which could either be in a hard register or in memory. Use ++ `true_regnum' to find out; it will return -1 if the pseudo is in ++ memory and the hard register number if it is in a register. ++ ++ These macros should not be used in the case where a particular ++ class of registers can only be copied to memory and not to another ++ class of registers. In that case, secondary reload registers are ++ not needed and would not be helpful. Instead, a stack location ++ must be used to perform the copy and the `movM' pattern should use ++ memory as a intermediate storage. This case often occurs between ++ floating-point and general registers. ++ */ ++ ++ /* ++ `SECONDARY_MEMORY_NEEDED (CLASS1, CLASS2, M)' ++ Certain machines have the property that some registers cannot be ++ copied to some other registers without using memory. Define this ++ macro on those machines to be a C expression that is non-zero if ++ objects of mode M in registers of CLASS1 can only be copied to ++ registers of class CLASS2 by storing a register of CLASS1 into ++ memory and loading that memory location into a register of CLASS2. ++ ++ Do not define this macro if its value would always be zero. ++ ++ `SECONDARY_MEMORY_NEEDED_RTX (MODE)' ++ Normally when `SECONDARY_MEMORY_NEEDED' is defined, the compiler ++ allocates a stack slot for a memory location needed for register ++ copies. If this macro is defined, the compiler instead uses the ++ memory location defined by this macro. ++ ++ Do not define this macro if you do not define ++ `SECONDARY_MEMORY_NEEDED'. ++ */ ++ ++ /* ++ `SECONDARY_MEMORY_NEEDED_MODE (MODE)' ++ When the compiler needs a secondary memory location to copy ++ between two registers of mode MODE, it normally allocates ++ sufficient memory to hold a quantity of `BITS_PER_WORD' bits and ++ performs the store and load operations in a mode that many bits ++ wide and whose class is the same as that of MODE. ++ ++ This is right thing to do on most machines because it ensures that ++ all bits of the register are copied and prevents accesses to the ++ registers in a narrower mode, which some machines prohibit for ++ floating-point registers. ++ ++ However, this default behavior is not correct on some machines, ++ such as the DEC Alpha, that store short integers in floating-point ++ registers differently than in integer registers. On those ++ machines, the default widening will not work correctly and you ++ must define this macro to suppress that widening in some cases. ++ See the file `alpha.h' for details. ++ ++ Do not define this macro if you do not define ++ `SECONDARY_MEMORY_NEEDED' or if widening MODE to a mode that is ++ `BITS_PER_WORD' bits wide is correct for your machine. ++ */ ++ ++ #define SMALL_REGISTER_CLASSES 1 ++ /* ++ Normally the compiler avoids choosing registers that have been ++ explicitly mentioned in the rtl as spill registers (these ++ registers are normally those used to pass parameters and return ++ values). However, some machines have so few registers of certain ++ classes that there would not be enough registers to use as spill ++ registers if this were done. ++ ++ Define `SMALL_REGISTER_CLASSES' to be an expression with a non-zero ++ value on these machines. When this macro has a non-zero value, the ++ compiler allows registers explicitly used in the rtl to be used as ++ spill registers but avoids extending the lifetime of these ++ registers. ++ ++ It is always safe to define this macro with a non-zero value, but ++ if you unnecessarily define it, you will reduce the amount of ++ optimizations that can be performed in some cases. If you do not ++ define this macro with a non-zero value when it is required, the ++ compiler will run out of spill registers and print a fatal error ++ message. For most machines, you should not define this macro at ++ all. ++ */ ++ ++ #define CLASS_LIKELY_SPILLED_P(c) class_likely_spilled_p(c) ++ /* ++ A C expression whose value is nonzero if pseudos that have been ++ assigned to registers of class CLASS would likely be spilled ++ because registers of CLASS are needed for spill registers. ++ ++ The default value of this macro returns 1 if CLASS has exactly one ++ register and zero otherwise. On most machines, this default ++ should be used. Only define this macro to some other expression ++ if pseudo allocated by `local-alloc.c' end up in memory because ++ their hard registers were needed for spill registers. If this ++ macro returns nonzero for those classes, those pseudos will only ++ be allocated by `global.c', which knows how to reallocate the ++ pseudo to another register. If there would not be another ++ register available for reallocation, you should not change the ++ definition of this macro since the only effect of such a ++ definition would be to slow down register allocation. ++ */ ++ ++ #define CLASS_MAX_NREGS(CLASS, MODE) class_max_nregs (CLASS, MODE) ++ /* ++ A C expression for the maximum number of consecutive registers of ++ class CLASS needed to hold a value of mode MODE. ++ ++ This is closely related to the macro `HARD_REGNO_NREGS'. In fact, ++ the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be ++ the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)' for all ++ REGNO values in the class CLASS. ++ ++ This macro helps control the handling of multiple-word values in ++ the reload pass. ++ */ ++ ++ #undef CLASS_CANNOT_CHANGE_SIZE ++ /* ++ `CLASS_CANNOT_CHANGE_SIZE' ++ If defined, a C expression for a class that contains registers ++ which the compiler must always access in a mode that is the same ++ size as the mode in which it loaded the register. ++ ++ For the example, loading 32-bit integer or floating-point objects ++ into floating-point registers on the Alpha extends them to 64-bits. ++ Therefore loading a 64-bit object and then storing it as a 32-bit ++ object does not store the low-order 32-bits, as would be the case ++ for a normal register. Therefore, `alpha.h' defines this macro as ++ `FLOAT_REGS'. ++ ++ Three other special macros describe which operands fit which ++ constraint letters. ++ */ ++ ++ #define CONST_OK_FOR_LETTER_P(VALUE, C) \ ++ ((C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 63 : \ ++ (C) == 'J' ? (VALUE) <= 0 && (VALUE) >= -63: \ ++ (C) == 'K' ? (VALUE) == 2 : \ ++ (C) == 'L' ? (VALUE) == 0 : \ ++ (C) == 'M' ? (VALUE) >= 0 && (VALUE) <= 0xff : \ ++ (C) == 'N' ? (VALUE) == -1: \ ++ (C) == 'O' ? (VALUE) == 8 || (VALUE) == 16 || (VALUE) == 24: \ ++ (C) == 'P' ? (VALUE) == 1 : \ ++ 0) ++ ++ /* ++ A C expression that defines the machine-dependent operand ++ constraint letters (`I', `J', `K', ... `P') that specify ++ particular ranges of integer values. If C is one of those ++ letters, the expression should check that VALUE, an integer, is in ++ the appropriate range and return 1 if so, 0 otherwise. If C is ++ not one of those letters, the value should be 0 regardless of ++ VALUE. ++ */ ++ ++ #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ ++ ((C) == 'G' ? (VALUE) == CONST0_RTX (SFmode) \ ++ : 0) ++ /* ++ `CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)' ++ A C expression that defines the machine-dependent operand ++ constraint letters that specify particular ranges of ++ `const_double' values (`G' or `H'). ++ ++ If C is one of those letters, the expression should check that ++ VALUE, an RTX of code `const_double', is in the appropriate range ++ and return 1 if so, 0 otherwise. If C is not one of those ++ letters, the value should be 0 regardless of VALUE. ++ ++ `const_double' is used for all floating-point constants and for ++ `DImode' fixed-point constants. A given letter can accept either ++ or both kinds of values. It can use `GET_MODE' to distinguish ++ between these kinds. ++ */ ++ ++ #define EXTRA_CONSTRAINT(x, c) extra_constraint(x, c) ++ /* ++ A C expression that defines the optional machine-dependent ++ constraint letters (``Q', `R', `S', `T', `U') that can' ++ be used to segregate specific types of operands, usually memory ++ references, for the target machine. Normally this macro will not ++ be defined. If it is required for a particular target machine, it ++ should return 1 if VALUE corresponds to the operand type ++ represented by the constraint letter C. If C is not defined as an ++ extra constraint, the value returned should be 0 regardless of ++ VALUE. ++ ++ For example, on the ROMP, load instructions cannot have their ++ output in r0 if the memory reference contains a symbolic address. ++ Constraint letter `Q' is defined as representing a memory address ++ that does *not* contain a symbolic address. An alternative is ++ specified with a `Q' constraint on the input and `r' on the ++ output. The next alternative specifies `m' on the input and a ++ register class that does not include r0 on the output. ++ */ ++ ++ /* This is an undocumented variable which describes ++ how GCC will push a data */ ++ #define STACK_PUSH_CODE POST_DEC ++ ++ #define STACK_GROWS_DOWNWARD ++ /* ++ Define this macro if pushing a word onto the stack moves the stack ++ pointer to a smaller address. ++ ++ When we say, "define this macro if ...," it means that the ++ compiler checks this macro only with `#ifdef' so the precise ++ definition used does not matter. ++ */ ++ ++ /* ++ `FRAME_GROWS_DOWNWARD' ++ Define this macro if the addresses of local variable slots are at ++ negative offsets from the frame pointer. ++ */ ++ ++ /* ++ `ARGS_GROW_DOWNWARD' ++ Define this macro if successive arguments to a function occupy ++ decreasing addresses on the stack. ++ */ ++ ++ #define STARTING_FRAME_OFFSET 1 ++ /* ++ Offset from the frame pointer to the first local variable slot to ++ be allocated. ++ ++ If `FRAME_GROWS_DOWNWARD', find the next slot's offset by ++ subtracting the first slot's length from `STARTING_FRAME_OFFSET'. ++ Otherwise, it is found by adding the length of the first slot to ++ the value `STARTING_FRAME_OFFSET'. ++ */ ++ ++ #define STACK_POINTER_OFFSET 1 ++ /* ++ Offset from the stack pointer register to the first location at ++ which outgoing arguments are placed. If not specified, the ++ default value of zero is used. This is the proper value for most ++ machines. ++ ++ If `ARGS_GROW_DOWNWARD', this is the offset to the location above ++ the first location at which outgoing arguments are placed. ++ */ ++ ++ #define FIRST_PARM_OFFSET(FUNDECL) 0 ++ /* ++ Offset from the argument pointer register to the first argument's ++ address. On some machines it may depend on the data type of the ++ function. ++ ++ If `ARGS_GROW_DOWNWARD', this is the offset to the location above ++ the first argument's address. ++ */ ++ ++ /* ++ `STACK_DYNAMIC_OFFSET (FUNDECL)' ++ Offset from the stack pointer register to an item dynamically ++ allocated on the stack, e.g., by `alloca'. ++ ++ The default value for this macro is `STACK_POINTER_OFFSET' plus the ++ length of the outgoing arguments. The default is correct for most ++ machines. See `function.c' for details. ++ */ ++ ++ /* ++ `DYNAMIC_CHAIN_ADDRESS (FRAMEADDR)' ++ A C expression whose value is RTL representing the address in a ++ stack frame where the pointer to the caller's frame is stored. ++ Assume that FRAMEADDR is an RTL expression for the address of the ++ stack frame itself. ++ ++ If you don't define this macro, the default is to return the value ++ of FRAMEADDR--that is, the stack frame address is also the address ++ of the stack word that points to the previous frame. ++ */ ++ ++ /* ++ `SETUP_FRAME_ADDRESSES ()' ++ If defined, a C expression that produces the machine-specific code ++ to setup the stack so that arbitrary frames can be accessed. For ++ example, on the Sparc, we must flush all of the register windows ++ to the stack before we can access arbitrary stack frames. This ++ macro will seldom need to be defined. ++ */ ++ ++ /*XXX ++ ++ After the prologue, RA is at -4(AP) in the current frame. ++ #define RETURN_ADDR_RTX(COUNT, FRAME) \ ++ ((COUNT) == 0 \ ++ ? gen_rtx (MEM, Pmode, gen_rtx (PLUS, Pmode, arg_pointer_rtx, GEN_INT(-4)))\ ++ : gen_rtx (MEM, Pmode, gen_rtx (PLUS, Pmode, (FRAME), GEN_INT(4)))) ++ ++ #define RETURN_ADDR_RTX(COUNT, FRAMEADDR) ++ A C expression whose value is RTL representing the value of the ++ return address for the frame COUNT steps up from the current ++ frame, after the prologue. FRAMEADDR is the frame pointer of the ++ COUNT frame, or the frame pointer of the COUNT - 1 frame if ++ `RETURN_ADDR_IN_PREVIOUS_FRAME' is defined. ++ */ ++ ++ /* ++ `RETURN_ADDR_IN_PREVIOUS_FRAME' ++ Define this if the return address of a particular stack frame is ++ accessed from the frame pointer of the previous stack frame. ++ */ ++ ++ /*XXX ++ Before the prologue, RA is at 0(%esp). ++ #define INCOMING_RETURN_ADDR_RTX \ ++ gen_rtx (MEM, VOIDmode, gen_rtx (REG, VOIDmode, STACK_POINTER_REGNUM)) ++ ++ `INCOMING_RETURN_ADDR_RTX' ++ A C expression whose value is RTL representing the location of the ++ incoming return address at the beginning of any function, before ++ the prologue. This RTL is either a `REG', indicating that the ++ return value is saved in `REG', or a `MEM' representing a location ++ in the stack. ++ ++ You only need to define this macro if you want to support call ++ frame debugging information like that provided by DWARF 2. ++ */ ++ ++ /* ++ `INCOMING_FRAME_SP_OFFSET' ++ A C expression whose value is an integer giving the offset, in ++ bytes, from the value of the stack pointer register to the top of ++ the stack frame at the beginning of any function, before the ++ prologue. The top of the frame is defined to be the value of the ++ stack pointer in the previous frame, just before the call ++ instruction. ++ ++ You only need to define this macro if you want to support call ++ frame debugging information like that provided by DWARF 2. ++ */ ++ ++ ++ #define STACK_POINTER_REGNUM 32 ++ /* ++ The register number of the stack pointer register, which must also ++ be a fixed register according to `FIXED_REGISTERS'. On most ++ machines, the hardware determines which register this is. ++ */ ++ ++ #define FRAME_POINTER_REGNUM REG_Y ++ /* ++ The register number of the frame pointer register, which is used to ++ access automatic variables in the stack frame. On some machines, ++ the hardware determines which register this is. On other ++ machines, you can choose any register you wish for this purpose. ++ */ ++ ++ /* ++ `HARD_FRAME_POINTER_REGNUM' ++ On some machines the offset between the frame pointer and starting ++ offset of the automatic variables is not known until after register ++ allocation has been done (for example, because the saved registers ++ are between these two locations). On those machines, define ++ `FRAME_POINTER_REGNUM' the number of a special, fixed register to ++ be used internally until the offset is known, and define ++ `HARD_FRAME_POINTER_REGNUM' to be actual the hard register number ++ used for the frame pointer. ++ ++ You should define this macro only in the very rare circumstances ++ when it is not possible to calculate the offset between the frame ++ pointer and the automatic variables until after register ++ allocation has been completed. When this macro is defined, you ++ must also indicate in your definition of `ELIMINABLE_REGS' how to ++ eliminate `FRAME_POINTER_REGNUM' into either ++ `HARD_FRAME_POINTER_REGNUM' or `STACK_POINTER_REGNUM'. ++ ++ Do not define this macro if it would be the same as ++ `FRAME_POINTER_REGNUM'. ++ */ ++ ++ #define ARG_POINTER_REGNUM 34 ++ /* ++ The register number of the arg pointer register, which is used to ++ access the function's argument list. On some machines, this is ++ the same as the frame pointer register. On some machines, the ++ hardware determines which register this is. On other machines, ++ you can choose any register you wish for this purpose. If this is ++ not the same register as the frame pointer register, then you must ++ mark it as a fixed register according to `FIXED_REGISTERS', or ++ arrange to be able to eliminate it (*note Elimination::.). ++ */ ++ ++ /* ++ `RETURN_ADDRESS_POINTER_REGNUM' ++ The register number of the return address pointer register, which ++ is used to access the current function's return address from the ++ stack. On some machines, the return address is not at a fixed ++ offset from the frame pointer or stack pointer or argument ++ pointer. This register can be defined to point to the return ++ address on the stack, and then be converted by `ELIMINABLE_REGS' ++ into either the frame pointer or stack pointer. ++ ++ Do not define this macro unless there is no other way to get the ++ return address from the stack. ++ */ ++ ++ #define STATIC_CHAIN_REGNUM 2 ++ /* ++ `STATIC_CHAIN_INCOMING_REGNUM' ++ Register numbers used for passing a function's static chain ++ pointer. If register windows are used, the register number as ++ seen by the called function is `STATIC_CHAIN_INCOMING_REGNUM', ++ while the register number as seen by the calling function is ++ `STATIC_CHAIN_REGNUM'. If these registers are the same, ++ `STATIC_CHAIN_INCOMING_REGNUM' need not be defined. ++ ++ The static chain register need not be a fixed register. ++ ++ If the static chain is passed in memory, these macros should not be ++ defined; instead, the next two macros should be defined. ++ */ ++ /* ++ `STATIC_CHAIN' ++ `STATIC_CHAIN_INCOMING' ++ If the static chain is passed in memory, these macros provide rtx ++ giving `mem' expressions that denote where they are stored. ++ `STATIC_CHAIN' and `STATIC_CHAIN_INCOMING' give the locations as ++ seen by the calling and called functions, respectively. Often the ++ former will be at an offset from the stack pointer and the latter ++ at an offset from the frame pointer. ++ ++ The variables `stack_pointer_rtx', `frame_pointer_rtx', and ++ `arg_pointer_rtx' will have been initialized prior to the use of ++ these macros and should be used to refer to those items. ++ ++ If the static chain is passed in a register, the two previous ++ macros should be defined instead. ++ */ ++ ++ ++ #define FRAME_POINTER_REQUIRED frame_pointer_required_p() ++ /* ++ A C expression which is nonzero if a function must have and use a ++ frame pointer. This expression is evaluated in the reload pass. ++ If its value is nonzero the function will have a frame pointer. ++ ++ The expression can in principle examine the current function and ++ decide according to the facts, but on most machines the constant 0 ++ or the constant 1 suffices. Use 0 when the machine allows code to ++ be generated with no frame pointer, and doing so saves some time ++ or space. Use 1 when there is no possible advantage to avoiding a ++ frame pointer. ++ ++ In certain cases, the compiler does not know how to produce valid ++ code without a frame pointer. The compiler recognizes those cases ++ and automatically gives the function a frame pointer regardless of ++ what `FRAME_POINTER_REQUIRED' says. You don't need to worry about ++ them. ++ ++ In a function that does not require a frame pointer, the frame ++ pointer register can be allocated for ordinary usage, unless you ++ mark it as a fixed register. See `FIXED_REGISTERS' for more ++ information. ++ */ ++ ++ /* ++ #define INITIAL_FRAME_POINTER_OFFSET(DV) ((DV)=0) ++ A C statement to store in the variable DEPTH-VAR the difference ++ between the frame pointer and the stack pointer values immediately ++ after the function prologue. The value would be computed from ++ information such as the result of `get_frame_size ()' and the ++ tables of registers `regs_ever_live' and `call_used_regs'. ++ ++ If `ELIMINABLE_REGS' is defined, this macro will be not be used and ++ need not be defined. Otherwise, it must be defined even if ++ `FRAME_POINTER_REQUIRED' is defined to always be true; in that ++ case, you may set DEPTH-VAR to anything. ++ */ ++ ++ #define ELIMINABLE_REGS { \ ++ {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ ++ {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM} \ ++ ,{FRAME_POINTER_REGNUM+1,STACK_POINTER_REGNUM+1}} ++ /* ++ If defined, this macro specifies a table of register pairs used to ++ eliminate unneeded registers that point into the stack frame. If ++ it is not defined, the only elimination attempted by the compiler ++ is to replace references to the frame pointer with references to ++ the stack pointer. ++ ++ The definition of this macro is a list of structure ++ initializations, each of which specifies an original and ++ replacement register. ++ ++ On some machines, the position of the argument pointer is not ++ known until the compilation is completed. In such a case, a ++ separate hard register must be used for the argument pointer. ++ This register can be eliminated by replacing it with either the ++ frame pointer or the argument pointer, depending on whether or not ++ the frame pointer has been eliminated. ++ ++ In this case, you might specify: ++ #define ELIMINABLE_REGS \ ++ {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ ++ {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ ++ {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}} ++ ++ Note that the elimination of the argument pointer with the stack ++ pointer is specified first since that is the preferred elimination. ++ */ ++ ++ #define CAN_ELIMINATE(FROM, TO) (((FROM) == ARG_POINTER_REGNUM \ ++ && (TO) == FRAME_POINTER_REGNUM) \ ++ || (((FROM) == FRAME_POINTER_REGNUM \ ++ || (FROM) == FRAME_POINTER_REGNUM+1) \ ++ && ! FRAME_POINTER_REQUIRED \ ++ )) ++ /* ++ A C expression that returns non-zero if the compiler is allowed to ++ try to replace register number FROM-REG with register number ++ TO-REG. This macro need only be defined if `ELIMINABLE_REGS' is ++ defined, and will usually be the constant 1, since most of the ++ cases preventing register elimination are things that the compiler ++ already knows about. ++ */ ++ ++ #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ ++ OFFSET = initial_elimination_offset (FROM, TO) ++ /* ++ This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It ++ specifies the initial difference between the specified pair of ++ registers. This macro must be defined if `ELIMINABLE_REGS' is ++ defined. ++ */ ++ ++ /* ++ `LONGJMP_RESTORE_FROM_STACK' ++ Define this macro if the `longjmp' function restores registers from ++ the stack frames, rather than from those saved specifically by ++ `setjmp'. Certain quantities must not be kept in registers across ++ a call to `setjmp' on such machines. ++ */ ++ ++ /* ++ #define PROMOTE_PROTOTYPES ++ Define this macro if an argument declared in a prototype as an ++ integral type smaller than `int' should actually be passed as an ++ `int'. In addition to avoiding errors in certain cases of ++ mismatch, it also makes for better code on certain machines. ++ */ ++ ++ #define PUSH_ROUNDING(NPUSHED) (NPUSHED) ++ /* ++ A C expression that is the number of bytes actually pushed onto the ++ stack when an instruction attempts to push NPUSHED bytes. ++ ++ If the target machine does not have a push instruction, do not ++ define this macro. That directs GNU CC to use an alternate ++ strategy: to allocate the entire argument block and then store the ++ arguments into it. ++ ++ On some machines, the definition ++ ++ #define PUSH_ROUNDING(BYTES) (BYTES) ++ ++ will suffice. But on other machines, instructions that appear to ++ push one byte actually push two bytes in an attempt to maintain ++ alignment. Then the definition should be ++ ++ #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1) ++ */ ++ ++ /* ++ `ACCUMULATE_OUTGOING_ARGS' ++ If defined, the maximum amount of space required for outgoing ++ arguments will be computed and placed into the variable ++ `current_function_outgoing_args_size'. No space will be pushed ++ onto the stack for each call; instead, the function prologue should ++ increase the stack frame size by this amount. ++ ++ Defining both `PUSH_ROUNDING' and `ACCUMULATE_OUTGOING_ARGS' is ++ not proper. ++ */ ++ ++ /* ++ `REG_PARM_STACK_SPACE (FNDECL)' ++ Define this macro if functions should assume that stack space has ++ been allocated for arguments even when their values are passed in ++ registers. ++ ++ The value of this macro is the size, in bytes, of the area ++ reserved for arguments passed in registers for the function ++ represented by FNDECL. ++ ++ This space can be allocated by the caller, or be a part of the ++ machine-dependent stack frame: `OUTGOING_REG_PARM_STACK_SPACE' says ++ which. ++ */ ++ ++ /* ++ `MAYBE_REG_PARM_STACK_SPACE' ++ `FINAL_REG_PARM_STACK_SPACE (CONST_SIZE, VAR_SIZE)' ++ Define these macros in addition to the one above if functions might ++ allocate stack space for arguments even when their values are ++ passed in registers. These should be used when the stack space ++ allocated for arguments in registers is not a simple constant ++ independent of the function declaration. ++ ++ The value of the first macro is the size, in bytes, of the area ++ that we should initially assume would be reserved for arguments ++ passed in registers. ++ ++ The value of the second macro is the actual size, in bytes, of the ++ area that will be reserved for arguments passed in registers. ++ This takes two arguments: an integer representing the number of ++ bytes of fixed sized arguments on the stack, and a tree ++ representing the number of bytes of variable sized arguments on ++ the stack. ++ ++ When these macros are defined, `REG_PARM_STACK_SPACE' will only be ++ called for libcall functions, the current function, or for a ++ function being called when it is known that such stack space must ++ be allocated. In each case this value can be easily computed. ++ ++ When deciding whether a called function needs such stack space, ++ and how much space to reserve, GNU CC uses these two macros ++ instead of `REG_PARM_STACK_SPACE'. ++ */ ++ ++ /* ++ `OUTGOING_REG_PARM_STACK_SPACE' ++ Define this if it is the responsibility of the caller to allocate ++ the area reserved for arguments passed in registers. ++ ++ If `ACCUMULATE_OUTGOING_ARGS' is defined, this macro controls ++ whether the space for these arguments counts in the value of ++ `current_function_outgoing_args_size'. ++ */ ++ ++ /* ++ `STACK_PARMS_IN_REG_PARM_AREA' ++ Define this macro if `REG_PARM_STACK_SPACE' is defined, but the ++ stack parameters don't skip the area specified by it. ++ ++ Normally, when a parameter is not passed in registers, it is ++ placed on the stack beyond the `REG_PARM_STACK_SPACE' area. ++ Defining this macro suppresses this behavior and causes the ++ parameter to be passed on the stack in its natural location. ++ */ ++ ++ #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0 ++ /* ++ A C expression that should indicate the number of bytes of its own ++ arguments that a function pops on returning, or 0 if the function ++ pops no arguments and the caller must therefore pop them all after ++ the function returns. ++ ++ FUNDECL is a C variable whose value is a tree node that describes ++ the function in question. Normally it is a node of type ++ `FUNCTION_DECL' that describes the declaration of the function. ++ From this you can obtain the DECL_MACHINE_ATTRIBUTES of the ++ function. ++ ++ FUNTYPE is a C variable whose value is a tree node that describes ++ the function in question. Normally it is a node of type ++ `FUNCTION_TYPE' that describes the data type of the function. ++ From this it is possible to obtain the data types of the value and ++ arguments (if known). ++ ++ When a call to a library function is being considered, FUNDECL ++ will contain an identifier node for the library function. Thus, if ++ you need to distinguish among various library functions, you can ++ do so by their names. Note that "library function" in this ++ context means a function used to perform arithmetic, whose name is ++ known specially in the compiler and was not mentioned in the C ++ code being compiled. ++ ++ STACK-SIZE is the number of bytes of arguments passed on the ++ stack. If a variable number of bytes is passed, it is zero, and ++ argument popping will always be the responsibility of the calling ++ function. ++ ++ On the Vax, all functions always pop their arguments, so the ++ definition of this macro is STACK-SIZE. On the 68000, using the ++ standard calling convention, no functions pop their arguments, so ++ the value of the macro is always 0 in this case. But an ++ alternative calling convention is available in which functions ++ that take a fixed number of arguments pop them but other functions ++ (such as `printf') pop nothing (the caller pops all). When this ++ convention is in use, FUNTYPE is examined to determine whether a ++ function takes a fixed number of arguments. ++ */ ++ ++ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) (function_arg (&(CUM), MODE, TYPE, NAMED)) ++ /*XXX optimize ++ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0 ++ A C expression that controls whether a function argument is passed ++ in a register, and which register. ++ ++ The arguments are CUM, which summarizes all the previous ++ arguments; MODE, the machine mode of the argument; TYPE, the data ++ type of the argument as a tree node or 0 if that is not known ++ (which happens for C support library functions); and NAMED, which ++ is 1 for an ordinary argument and 0 for nameless arguments that ++ correspond to `...' in the called function's prototype. ++ ++ The value of the expression is usually either a `reg' RTX for the ++ hard register in which to pass the argument, or zero to pass the ++ argument on the stack. ++ ++ For machines like the Vax and 68000, where normally all arguments ++ are pushed, zero suffices as a definition. ++ ++ The value of the expression can also be a `parallel' RTX. This is ++ used when an argument is passed in multiple locations. The mode ++ of the of the `parallel' should be the mode of the entire ++ argument. The `parallel' holds any number of `expr_list' pairs; ++ each one describes where part of the argument is passed. In each ++ `expr_list', the first operand can be either a `reg' RTX for the ++ hard register in which to pass this part of the argument, or zero ++ to pass the argument on the stack. If this operand is a `reg', ++ then the mode indicates how large this part of the argument is. ++ The second operand of the `expr_list' is a `const_int' which gives ++ the offset in bytes into the entire argument where this part ++ starts. ++ ++ The usual way to make the ANSI library `stdarg.h' work on a machine ++ where some arguments are usually passed in registers, is to cause ++ nameless arguments to be passed on the stack instead. This is done ++ by making `FUNCTION_ARG' return 0 whenever NAMED is 0. ++ ++ You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the ++ definition of this macro to determine if this argument is of a ++ type that must be passed in the stack. If `REG_PARM_STACK_SPACE' ++ is not defined and `FUNCTION_ARG' returns non-zero for such an ++ argument, the compiler will abort. If `REG_PARM_STACK_SPACE' is ++ defined, the argument will be computed in the stack and then ++ loaded into a register. ++ */ ++ ++ /* ++ `FUNCTION_INCOMING_ARG (CUM, MODE, TYPE, NAMED)' ++ Define this macro if the target machine has "register windows", so ++ that the register in which a function sees an arguments is not ++ necessarily the same as the one in which the caller passed the ++ argument. ++ ++ For such machines, `FUNCTION_ARG' computes the register in which ++ the caller passes the value, and `FUNCTION_INCOMING_ARG' should be ++ defined in a similar fashion to tell the function being called ++ where the arguments will arrive. ++ ++ If `FUNCTION_INCOMING_ARG' is not defined, `FUNCTION_ARG' serves ++ both purposes. ++ */ ++ ++ ++ /* #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) function_arg_partial_nregs (CUM, MODE, TYPE, NAMED) */ ++ #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0 ++ /*XXX optimize ++ A C expression for the number of words, at the beginning of an ++ argument, must be put in registers. The value must be zero for ++ arguments that are passed entirely in registers or that are ++ entirely pushed on the stack. ++ ++ On some machines, certain arguments must be passed partially in ++ registers and partially in memory. On these machines, typically ++ the first N words of arguments are passed in registers, and the ++ rest on the stack. If a multi-word argument (a `double' or a ++ structure) crosses that boundary, its first few words must be ++ passed in registers and the rest must be pushed. This macro tells ++ the compiler when this occurs, and how many of the words should go ++ in registers. ++ ++ `FUNCTION_ARG' for these arguments should return the first ++ register to be used by the caller for this argument; likewise ++ `FUNCTION_INCOMING_ARG', for the called function. ++ */ ++ ++ /* ++ `FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, NAMED)' ++ A C expression that indicates when an argument must be passed by ++ reference. If nonzero for an argument, a copy of that argument is ++ made in memory and a pointer to the argument is passed instead of ++ the argument itself. The pointer is passed in whatever way is ++ appropriate for passing a pointer to that type. ++ ++ On machines where `REG_PARM_STACK_SPACE' is not defined, a suitable ++ definition of this macro might be ++ #define FUNCTION_ARG_PASS_BY_REFERENCE\ ++ (CUM, MODE, TYPE, NAMED) \ ++ MUST_PASS_IN_STACK (MODE, TYPE) ++ */ ++ ++ /* ++ `FUNCTION_ARG_CALLEE_COPIES (CUM, MODE, TYPE, NAMED)' ++ If defined, a C expression that indicates when it is the called ++ function's responsibility to make a copy of arguments passed by ++ invisible reference. Normally, the caller makes a copy and passes ++ the address of the copy to the routine being called. When ++ FUNCTION_ARG_CALLEE_COPIES is defined and is nonzero, the caller ++ does not make a copy. Instead, it passes a pointer to the "live" ++ value. The called function must not modify this value. If it can ++ be determined that the value won't be modified, it need not make a ++ copy; otherwise a copy must be made. ++ */ ++ ++ typedef struct avr_args { ++ int nregs; /* # registers available for passing */ ++ int regno; /* next available register number */ ++ } CUMULATIVE_ARGS; ++ /* ++ A C type for declaring a variable that is used as the first ++ argument of `FUNCTION_ARG' and other related values. For some ++ target machines, the type `int' suffices and can hold the number ++ of bytes of argument so far. ++ ++ There is no need to record in `CUMULATIVE_ARGS' anything about the ++ arguments that have been passed on the stack. The compiler has ++ other variables to keep track of that. For target machines on ++ which all arguments are passed on the stack, there is no need to ++ store anything in `CUMULATIVE_ARGS'; however, the data structure ++ must exist and should not be empty, so use `int'. ++ */ ++ ++ #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) init_cumulative_args (&(CUM), FNTYPE, LIBNAME, INDIRECT) ++ ++ /*XXX optimize ++ A C statement (sans semicolon) for initializing the variable CUM ++ for the state at the beginning of the argument list. The variable ++ has type `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node ++ for the data type of the function which will receive the args, or 0 ++ if the args are to a compiler support library function. The value ++ of INDIRECT is nonzero when processing an indirect call, for ++ example a call through a function pointer. The value of INDIRECT ++ is zero for a call to an explicitly named function, a library ++ function call, or when `INIT_CUMULATIVE_ARGS' is used to find ++ arguments for the function being compiled. ++ ++ When processing a call to a compiler support library function, ++ LIBNAME identifies which one. It is a `symbol_ref' rtx which ++ contains the name of the function, as a string. LIBNAME is 0 when ++ an ordinary C function call is being processed. Thus, each time ++ this macro is called, either LIBNAME or FNTYPE is nonzero, but ++ never both of them at once. ++ */ ++ ++ /* ++ `INIT_CUMULATIVE_INCOMING_ARGS (CUM, FNTYPE, LIBNAME)' ++ Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of ++ finding the arguments for the function being compiled. If this ++ macro is undefined, `INIT_CUMULATIVE_ARGS' is used instead. ++ ++ The value passed for LIBNAME is always 0, since library routines ++ with special calling conventions are never compiled with GNU CC. ++ The argument LIBNAME exists for symmetry with ++ `INIT_CUMULATIVE_ARGS'. ++ */ ++ ++ #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ ++ (function_arg_advance (&CUM, MODE, TYPE, NAMED)) ++ ++ /*XXX optimize ++ A C statement (sans semicolon) to update the summarizer variable ++ CUM to advance past an argument in the argument list. The values ++ MODE, TYPE and NAMED describe that argument. Once this is done, ++ the variable CUM is suitable for analyzing the *following* ++ argument with `FUNCTION_ARG', etc. ++ ++ This macro need not do anything if the argument in question was ++ passed on the stack. The compiler knows how to track the amount ++ of stack space used for arguments without any special help. ++ */ ++ ++ /* ++ `FUNCTION_ARG_PADDING (MODE, TYPE)' ++ If defined, a C expression which determines whether, and in which ++ direction, to pad out an argument with extra space. The value ++ should be of type `enum direction': either `upward' to pad above ++ the argument, `downward' to pad below, or `none' to inhibit ++ padding. ++ ++ The *amount* of padding is always just enough to reach the next ++ multiple of `FUNCTION_ARG_BOUNDARY'; this macro does not control ++ it. ++ ++ This macro has a default definition which is right for most ++ systems. For little-endian machines, the default is to pad ++ upward. For big-endian machines, the default is to pad downward ++ for an argument of constant size shorter than an `int', and upward ++ otherwise. ++ */ ++ /* ++ `FUNCTION_ARG_BOUNDARY (MODE, TYPE)' ++ If defined, a C expression that gives the alignment boundary, in ++ bits, of an argument with the specified mode and type. If it is ++ not defined, `PARM_BOUNDARY' is used for all arguments. ++ */ ++ ++ #define FUNCTION_ARG_REGNO_P(r) function_arg_regno_p(r) ++ /* ++ A C expression that is nonzero if REGNO is the number of a hard ++ register in which function arguments are sometimes passed. This ++ does *not* include implicit arguments such as the static chain and ++ the structure-value address. On many machines, no registers can be ++ used for this purpose since all function arguments are pushed on ++ the stack. ++ */ ++ ++ /* ++ `TRADITIONAL_RETURN_FLOAT' ++ Define this macro if `-traditional' should not cause functions ++ declared to return `float' to convert the value to `double'. ++ */ ++ ++ extern int avr_reg_order[]; ++ ++ #define RET_REGISTER avr_ret_register () ++ ++ #define FUNCTION_VALUE(VALTYPE, FUNC) avr_function_value (VALTYPE, FUNC) ++ /* ++ A C expression to create an RTX representing the place where a ++ function returns a value of data type VALTYPE. VALTYPE is a tree ++ node representing a data type. Write `TYPE_MODE (VALTYPE)' to get ++ the machine mode used to represent that type. On many machines, ++ only the mode is relevant. (Actually, on most machines, scalar ++ values are returned in the same place regardless of mode). ++ ++ The value of the expression is usually a `reg' RTX for the hard ++ register where the return value is stored. The value can also be a ++ `parallel' RTX, if the return value is in multiple places. See ++ `FUNCTION_ARG' for an explanation of the `parallel' form. ++ ++ If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same ++ promotion rules specified in `PROMOTE_MODE' if VALTYPE is a scalar ++ type. ++ ++ If the precise function being called is known, FUNC is a tree node ++ (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This ++ makes it possible to use a different value-returning convention ++ for specific functions when all their calls are known. ++ ++ `FUNCTION_VALUE' is not used for return vales with aggregate data ++ types, because these are returned in another way. See ++ `STRUCT_VALUE_REGNUM' and related macros, below. ++ */ ++ ++ /* ++ `FUNCTION_OUTGOING_VALUE (VALTYPE, FUNC)' ++ Define this macro if the target machine has "register windows" so ++ that the register in which a function returns its value is not the ++ same as the one in which the caller sees the value. ++ ++ For such machines, `FUNCTION_VALUE' computes the register in which ++ the caller will see the value. `FUNCTION_OUTGOING_VALUE' should be ++ defined in a similar fashion to tell the function where to put the ++ value. ++ ++ If `FUNCTION_OUTGOING_VALUE' is not defined, `FUNCTION_VALUE' ++ serves both purposes. ++ ++ `FUNCTION_OUTGOING_VALUE' is not used for return vales with ++ aggregate data types, because these are returned in another way. ++ See `STRUCT_VALUE_REGNUM' and related macros, below. ++ */ ++ ++ #define LIBCALL_VALUE(MODE) avr_libcall_value (MODE) ++ /* ++ A C expression to create an RTX representing the place where a ++ library function returns a value of mode MODE. If the precise ++ function being called is known, FUNC is a tree node ++ (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This ++ makes it possible to use a different value-returning convention ++ for specific functions when all their calls are known. ++ ++ Note that "library function" in this context means a compiler ++ support routine, used to perform arithmetic, whose name is known ++ specially by the compiler and was not mentioned in the C code being ++ compiled. ++ ++ The definition of `LIBRARY_VALUE' need not be concerned aggregate ++ data types, because none of the library functions returns such ++ types. ++ */ ++ ++ #define FUNCTION_VALUE_REGNO_P(N) ((N) == RET_REGISTER) ++ /* ++ A C expression that is nonzero if REGNO is the number of a hard ++ register in which the values of called function may come back. ++ ++ A register whose use for returning values is limited to serving as ++ the second of a pair (for a value of type `double', say) need not ++ be recognized by this macro. So for most machines, this definition ++ suffices: ++ ++ #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0) ++ ++ If the machine has register windows, so that the caller and the ++ called function use different registers for the return value, this ++ macro should recognize only the caller's register numbers. ++ */ ++ ++ /* ++ `APPLY_RESULT_SIZE' ++ Define this macro if `untyped_call' and `untyped_return' need more ++ space than is implied by `FUNCTION_VALUE_REGNO_P' for saving and ++ restoring an arbitrary return value. ++ */ ++ ++ ++ #define RETURN_IN_MEMORY(TYPE) ((TYPE_MODE (TYPE) == BLKmode) \ ++ ? int_size_in_bytes (TYPE) > 8 \ ++ : 0) ++ /* ++ A C expression which can inhibit the returning of certain function ++ values in registers, based on the type of value. A nonzero value ++ says to return the function value in memory, just as large ++ structures are always returned. Here TYPE will be a C expression ++ of type `tree', representing the data type of the value. ++ ++ Note that values of mode `BLKmode' must be explicitly handled by ++ this macro. Also, the option `-fpcc-struct-return' takes effect ++ regardless of this macro. On most systems, it is possible to ++ leave the macro undefined; this causes a default definition to be ++ used, whose value is the constant 1 for `BLKmode' values, and 0 ++ otherwise. ++ ++ Do not use this macro to indicate that structures and unions ++ should always be returned in memory. You should instead use ++ `DEFAULT_PCC_STRUCT_RETURN' to indicate this. ++ */ ++ ++ #define DEFAULT_PCC_STRUCT_RETURN 0 ++ /* ++ Define this macro to be 1 if all structure and union return values ++ must be in memory. Since this results in slower code, this should ++ be defined only if needed for compatibility with other compilers ++ or with an ABI. If you define this macro to be 0, then the ++ conventions used for structure and union return values are decided ++ by the `RETURN_IN_MEMORY' macro. ++ ++ If not defined, this defaults to the value 1. ++ */ ++ ++ /* ++ #define STRUCT_VALUE_REGNUM RET_REGISTER ++ If the structure value address is passed in a register, then ++ `STRUCT_VALUE_REGNUM' should be the number of that register. ++ */ ++ ++ #define STRUCT_VALUE 0 ++ /* ++ If the structure value address is not passed in a register, define ++ `STRUCT_VALUE' as an expression returning an RTX for the place ++ where the address is passed. If it returns 0, the address is ++ passed as an "invisible" first argument. ++ */ ++ ++ /* ++ STRUCT_VALUE_INCOMING_REGNUM ++ On some architectures the place where the structure value address ++ is found by the called function is not the same place that the ++ caller put it. This can be due to register windows, or it could ++ be because the function prologue moves it to a different place. ++ ++ If the incoming location of the structure value address is in a ++ register, define this macro as the register number. ++ */ ++ #define STRUCT_VALUE_INCOMING 0 ++ /* ++ If the incoming location is not a register, then you should define ++ `STRUCT_VALUE_INCOMING' as an expression for an RTX for where the ++ called function should find the value. If it should find the ++ value on the stack, define this to create a `mem' which refers to ++ the frame pointer. A definition of 0 means that the address is ++ passed as an "invisible" first argument. ++ */ ++ ++ /* ++ `PCC_STATIC_STRUCT_RETURN' ++ Define this macro if the usual system convention on the target ++ machine for returning structures and unions is for the called ++ function to return the address of a static variable containing the ++ value. ++ ++ Do not define this if the usual system convention is for the ++ caller to pass an address to the subroutine. ++ ++ This macro has effect in `-fpcc-struct-return' mode, but it does ++ nothing when you use `-freg-struct-return' mode. ++ */ ++ ++ /* ++ `DEFAULT_CALLER_SAVES' ++ Define this macro if function calls on the target machine do not ++ preserve any registers; in other words, if `CALL_USED_REGISTERS' ++ has 1 for all registers. This macro enables `-fcaller-saves' by ++ default. Eventually that option will be enabled by default on all ++ machines and both the option and this macro will be eliminated. ++ */ ++ ++ /* ++ `CALLER_SAVE_PROFITABLE (REFS, CALLS)' ++ A C expression to determine whether it is worthwhile to consider ++ placing a pseudo-register in a call-clobbered hard register and ++ saving and restoring it around each function call. The expression ++ should be 1 when this is worth doing, and 0 otherwise. ++ ++ If you don't define this macro, a default is used which is good on ++ most machines: `4 * CALLS < REFS'. ++ */ ++ ++ #define FUNCTION_PROLOGUE(FILE, SIZE) function_prologue (FILE, SIZE) ++ /* ++ A C compound statement that outputs the assembler code for entry ++ to a function. The prologue is responsible for setting up the ++ stack frame, initializing the frame pointer register, saving ++ registers that must be saved, and allocating SIZE additional bytes ++ of storage for the local variables. SIZE is an integer. FILE is ++ a stdio stream to which the assembler code should be output. ++ ++ The label for the beginning of the function need not be output by ++ this macro. That has already been done when the macro is run. ++ ++ To determine which registers to save, the macro can refer to the ++ array `regs_ever_live': element R is nonzero if hard register R is ++ used anywhere within the function. This implies the function ++ prologue should save register R, provided it is not one of the ++ call-used registers. (`FUNCTION_EPILOGUE' must likewise use ++ `regs_ever_live'.) ++ ++ On machines that have "register windows", the function entry code ++ does not save on the stack the registers that are in the windows, ++ even if they are supposed to be preserved by function calls; ++ instead it takes appropriate steps to "push" the register stack, ++ if any non-call-used registers are used in the function. ++ ++ On machines where functions may or may not have frame-pointers, the ++ function entry code must vary accordingly; it must set up the frame ++ pointer if one is wanted, and not otherwise. To determine whether ++ a frame pointer is in wanted, the macro can refer to the variable ++ `frame_pointer_needed'. The variable's value will be 1 at run ++ time in a function that needs a frame pointer. *Note ++ Elimination::. ++ ++ The function entry code is responsible for allocating any stack ++ space required for the function. This stack space consists of the ++ regions listed below. In most cases, these regions are allocated ++ in the order listed, with the last listed region closest to the ++ top of the stack (the lowest address if `STACK_GROWS_DOWNWARD' is ++ defined, and the highest address if it is not defined). You can ++ use a different order for a machine if doing so is more convenient ++ or required for compatibility reasons. Except in cases where ++ required by standard or by a debugger, there is no reason why the ++ stack layout used by GCC need agree with that used by other ++ compilers for a machine. ++ ++ * A region of `current_function_pretend_args_size' bytes of ++ uninitialized space just underneath the first argument ++ arriving on the stack. (This may not be at the very start of ++ the allocated stack region if the calling sequence has pushed ++ anything else since pushing the stack arguments. But ++ usually, on such machines, nothing else has been pushed yet, ++ because the function prologue itself does all the pushing.) ++ This region is used on machines where an argument may be ++ passed partly in registers and partly in memory, and, in some ++ cases to support the features in `varargs.h' and `stdargs.h'. ++ ++ * An area of memory used to save certain registers used by the ++ function. The size of this area, which may also include ++ space for such things as the return address and pointers to ++ previous stack frames, is machine-specific and usually ++ depends on which registers have been used in the function. ++ Machines with register windows often do not require a save ++ area. ++ ++ * A region of at least SIZE bytes, possibly rounded up to an ++ allocation boundary, to contain the local variables of the ++ function. On some machines, this region and the save area ++ may occur in the opposite order, with the save area closer to ++ the top of the stack. ++ ++ * Optionally, when `ACCUMULATE_OUTGOING_ARGS' is defined, a ++ region of `current_function_outgoing_args_size' bytes to be ++ used for outgoing argument lists of the function. *Note ++ Stack Arguments::. ++ ++ Normally, it is necessary for the macros `FUNCTION_PROLOGUE' and ++ `FUNCTION_EPILOGE' to treat leaf functions specially. The C ++ variable `leaf_function' is nonzero for such a function. ++ */ ++ ++ /* XXX optimize later ++ #define EXIT_IGNORE_STACK 1 ++ Define this macro as a C expression that is nonzero if the return ++ instruction or the function epilogue ignores the value of the stack ++ pointer; in other words, if it is safe to delete an instruction to ++ adjust the stack pointer before a return from the function. ++ ++ Note that this macro's value is relevant only for functions for ++ which frame pointers are maintained. It is never safe to delete a ++ final stack adjustment in a function that has no frame pointer, ++ and the compiler knows this regardless of `EXIT_IGNORE_STACK'. ++ */ ++ ++ #define EPILOGUE_USES(REGNO) 0 ++ /* ++ Define this macro as a C expression that is nonzero for registers ++ are used by the epilogue or the `return' pattern. The stack and ++ frame pointer registers are already be assumed to be used as ++ needed. ++ */ ++ ++ #define FUNCTION_EPILOGUE(FILE, SIZE) function_epilogue (FILE, SIZE) ++ /* ++ A C compound statement that outputs the assembler code for exit ++ from a function. The epilogue is responsible for restoring the ++ saved registers and stack pointer to their values when the ++ function was called, and returning control to the caller. This ++ macro takes the same arguments as the macro `FUNCTION_PROLOGUE', ++ and the registers to restore are determined from `regs_ever_live' ++ and `CALL_USED_REGISTERS' in the same way. ++ ++ On some machines, there is a single instruction that does all the ++ work of returning from the function. On these machines, give that ++ instruction the name `return' and do not define the macro ++ `FUNCTION_EPILOGUE' at all. ++ ++ Do not define a pattern named `return' if you want the ++ `FUNCTION_EPILOGUE' to be used. If you want the target switches ++ to control whether return instructions or epilogues are used, ++ define a `return' pattern with a validity condition that tests the ++ target switches appropriately. If the `return' pattern's validity ++ condition is false, epilogues will be used. ++ ++ On machines where functions may or may not have frame-pointers, the ++ function exit code must vary accordingly. Sometimes the code for ++ these two cases is completely different. To determine whether a ++ frame pointer is wanted, the macro can refer to the variable ++ `frame_pointer_needed'. The variable's value will be 1 when ++ compiling a function that needs a frame pointer. ++ ++ Normally, `FUNCTION_PROLOGUE' and `FUNCTION_EPILOGUE' must treat ++ leaf functions specially. The C variable `leaf_function' is ++ nonzero for such a function. *Note Leaf Functions::. ++ ++ On some machines, some functions pop their arguments on exit while ++ others leave that for the caller to do. For example, the 68020 ++ when given `-mrtd' pops arguments in functions that take a fixed ++ number of arguments. ++ ++ Your definition of the macro `RETURN_POPS_ARGS' decides which ++ functions pop their own arguments. `FUNCTION_EPILOGUE' needs to ++ know what was decided. The variable that is called ++ `current_function_pops_args' is the number of bytes of its ++ arguments that a function should pop. *Note Scalar Return::. ++ */ ++ ++ /* ++ `DELAY_SLOTS_FOR_EPILOGUE' ++ Define this macro if the function epilogue contains delay slots to ++ which instructions from the rest of the function can be "moved". ++ The definition should be a C expression whose value is an integer ++ representing the number of delay slots there. ++ ++ `ELIGIBLE_FOR_EPILOGUE_DELAY (INSN, N)' ++ A C expression that returns 1 if INSN can be placed in delay slot ++ number N of the epilogue. ++ ++ The argument N is an integer which identifies the delay slot now ++ being considered (since different slots may have different rules of ++ eligibility). It is never negative and is always less than the ++ number of epilogue delay slots (what `DELAY_SLOTS_FOR_EPILOGUE' ++ returns). If you reject a particular insn for a given delay slot, ++ in principle, it may be reconsidered for a subsequent delay slot. ++ Also, other insns may (at least in principle) be considered for ++ the so far unfilled delay slot. ++ ++ The insns accepted to fill the epilogue delay slots are put in an ++ RTL list made with `insn_list' objects, stored in the variable ++ `current_function_epilogue_delay_list'. The insn for the first ++ delay slot comes first in the list. Your definition of the macro ++ `FUNCTION_EPILOGUE' should fill the delay slots by outputting the ++ insns in this list, usually by calling `final_scan_insn'. ++ ++ You need not define this macro if you did not define ++ `DELAY_SLOTS_FOR_EPILOGUE'. ++ */ ++ ++ /* ++ `ASM_OUTPUT_MI_THUNK (FILE, THUNK_FNDECL, DELTA, FUNCTION)' ++ A C compound statement that outputs the assembler code for a thunk ++ function, used to implement C++ virtual function calls with ++ multiple inheritance. The thunk acts as a wrapper around a ++ virtual function, adjusting the implicit object parameter before ++ handing control off to the real function. ++ ++ First, emit code to add the integer DELTA to the location that ++ contains the incoming first argument. Assume that this argument ++ contains a pointer, and is the one used to pass the `this' pointer ++ in C++. This is the incoming argument *before* the function ++ prologue, e.g. `%o0' on a sparc. The addition must preserve the ++ values of all other incoming arguments. ++ ++ After the addition, emit code to jump to FUNCTION, which is a ++ `FUNCTION_DECL'. This is a direct pure jump, not a call, and does ++ not touch the return address. Hence returning from FUNCTION will ++ return to whoever called the current `thunk'. ++ ++ The effect must be as if FUNCTION had been called directly with ++ the adjusted first argument. This macro is responsible for ++ emitting all of the code for a thunk function; `FUNCTION_PROLOGUE' ++ and `FUNCTION_EPILOGUE' are not invoked. ++ ++ The THUNK_FNDECL is redundant. (DELTA and FUNCTION have already ++ been extracted from it.) It might possibly be useful on some ++ targets, but probably not. ++ ++ If you do not define this macro, the target-independent code in ++ the C++ frontend will generate a less efficient heavyweight thunk ++ that calls FUNCTION instead of jumping to it. The generic ++ approach does not support varargs. ++ */ ++ ++ /* ++ `__builtin_saveregs ()' ++ Use this built-in function to save the argument registers in ++ memory so that the varargs mechanism can access them. Both ANSI ++ and traditional versions of `va_start' must use ++ `__builtin_saveregs', unless you use `SETUP_INCOMING_VARARGS' (see ++ below) instead. ++ ++ On some machines, `__builtin_saveregs' is open-coded under the ++ control of the macro `EXPAND_BUILTIN_SAVEREGS'. On other machines, ++ it calls a routine written in assembler language, found in ++ `libgcc2.c'. ++ ++ Code generated for the call to `__builtin_saveregs' appears at the ++ beginning of the function, as opposed to where the call to ++ `__builtin_saveregs' is written, regardless of what the code is. ++ This is because the registers must be saved before the function ++ starts to use them for its own purposes. ++ ++ `__builtin_args_info (CATEGORY)' ++ Use this built-in function to find the first anonymous arguments in ++ registers. ++ ++ In general, a machine may have several categories of registers ++ used for arguments, each for a particular category of data types. ++ (For example, on some machines, floating-point registers are used ++ for floating-point arguments while other arguments are passed in ++ the general registers.) To make non-varargs functions use the ++ proper calling convention, you have defined the `CUMULATIVE_ARGS' ++ data type to record how many registers in each category have been ++ used so far ++ ++ `__builtin_args_info' accesses the same data structure of type ++ `CUMULATIVE_ARGS' after the ordinary argument layout is finished ++ with it, with CATEGORY specifying which word to access. Thus, the ++ value indicates the first unused register in a given category. ++ ++ Normally, you would use `__builtin_args_info' in the implementation ++ of `va_start', accessing each category just once and storing the ++ value in the `va_list' object. This is because `va_list' will ++ have to update the values, and there is no way to alter the values ++ accessed by `__builtin_args_info'. ++ ++ `__builtin_next_arg (LASTARG)' ++ This is the equivalent of `__builtin_args_info', for stack ++ arguments. It returns the address of the first anonymous stack ++ argument, as type `void *'. If `ARGS_GROW_DOWNWARD', it returns ++ the address of the location above the first anonymous stack ++ argument. Use it in `va_start' to initialize the pointer for ++ fetching arguments from the stack. Also use it in `va_start' to ++ verify that the second parameter LASTARG is the last named argument ++ of the current function. ++ ++ `__builtin_classify_type (OBJECT)' ++ Since each machine has its own conventions for which data types are ++ passed in which kind of register, your implementation of `va_arg' ++ has to embody these conventions. The easiest way to categorize the ++ specified data type is to use `__builtin_classify_type' together ++ with `sizeof' and `__alignof__'. ++ ++ `__builtin_classify_type' ignores the value of OBJECT, considering ++ only its data type. It returns an integer describing what kind of ++ type that is--integer, floating, pointer, structure, and so on. ++ ++ The file `typeclass.h' defines an enumeration that you can use to ++ interpret the values of `__builtin_classify_type'. ++ ++ These machine description macros help implement varargs: ++ ++ `EXPAND_BUILTIN_SAVEREGS (ARGS)' ++ If defined, is a C expression that produces the machine-specific ++ code for a call to `__builtin_saveregs'. This code will be moved ++ to the very beginning of the function, before any parameter access ++ are made. The return value of this function should be an RTX that ++ contains the value to use as the return of `__builtin_saveregs'. ++ ++ The argument ARGS is a `tree_list' containing the arguments that ++ were passed to `__builtin_saveregs'. ++ ++ If this macro is not defined, the compiler will output an ordinary ++ call to the library function `__builtin_saveregs'. ++ ++ `SETUP_INCOMING_VARARGS (ARGS_SO_FAR, MODE, TYPE,' ++ PRETEND_ARGS_SIZE, SECOND_TIME) This macro offers an alternative ++ to using `__builtin_saveregs' and defining the macro ++ `EXPAND_BUILTIN_SAVEREGS'. Use it to store the anonymous register ++ arguments into the stack so that all the arguments appear to have ++ been passed consecutively on the stack. Once this is done, you ++ can use the standard implementation of varargs that works for ++ machines that pass all their arguments on the stack. ++ ++ The argument ARGS_SO_FAR is the `CUMULATIVE_ARGS' data structure, ++ containing the values that obtain after processing of the named ++ arguments. The arguments MODE and TYPE describe the last named ++ argument--its machine mode and its data type as a tree node. ++ ++ The macro implementation should do two things: first, push onto the ++ stack all the argument registers *not* used for the named ++ arguments, and second, store the size of the data thus pushed into ++ the `int'-valued variable whose name is supplied as the argument ++ PRETEND_ARGS_SIZE. The value that you store here will serve as ++ additional offset for setting up the stack frame. ++ ++ Because you must generate code to push the anonymous arguments at ++ compile time without knowing their data types, ++ `SETUP_INCOMING_VARARGS' is only useful on machines that have just ++ a single category of argument register and use it uniformly for ++ all data types. ++ ++ If the argument SECOND_TIME is nonzero, it means that the ++ arguments of the function are being analyzed for the second time. ++ This happens for an inline function, which is not actually ++ compiled until the end of the source file. The macro ++ `SETUP_INCOMING_VARARGS' should not generate any instructions in ++ this case. ++ */ ++ ++ #define STRICT_ARGUMENT_NAMING 1 ++ /* ++ Define this macro if the location where a function argument is ++ passed depends on whether or not it is a named argument. ++ ++ This macro controls how the NAMED argument to `FUNCTION_ARG' is ++ set for varargs and stdarg functions. With this macro defined, ++ the NAMED argument is always true for named arguments, and false ++ for unnamed arguments. If this is not defined, but ++ `SETUP_INCOMING_VARARGS' is defined, then all arguments are ++ treated as named. Otherwise, all named arguments except the last ++ are treated as named. ++ */ ++ ++ ++ #define HAVE_POST_INCREMENT 1 ++ ++ /* ++ Define this macro if the machine supports post-increment ++ addressing. ++ ++ */ ++ #define HAVE_PRE_DECREMENT 1 ++ /* ++ #define HAVE_PRE_INCREMENT ++ #define HAVE_POST_DECREMENT ++ */ ++ /* ++ Similar for other kinds of addressing. ++ */ ++ ++ #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X) ++ /* ++ A C expression that is 1 if the RTX X is a constant which is a ++ valid address. On most machines, this can be defined as ++ `CONSTANT_P (X)', but a few machines are more restrictive in which ++ constant addresses are supported. ++ ++ `CONSTANT_P' accepts integer-values expressions whose values are ++ not explicitly known, such as `symbol_ref', `label_ref', and ++ `high' expressions and `const' arithmetic expressions, in addition ++ to `const_int' and `const_double' expressions. ++ */ ++ ++ #define MAX_REGS_PER_ADDRESS 2 ++ /* ++ A number, the maximum number of registers that can appear in a ++ valid memory address. Note that it is up to you to specify a ++ value equal to the maximum number that `GO_IF_LEGITIMATE_ADDRESS' ++ would ever accept. ++ */ ++ ++ #ifdef REG_OK_STRICT ++ # define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \ ++ { \ ++ if (legitimate_address_p (mode, operand, 1)) \ ++ goto ADDR; \ ++ } ++ # else ++ # define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \ ++ { \ ++ if (legitimate_address_p (mode, operand, 0)) \ ++ goto ADDR; \ ++ } ++ #endif ++ /*XXX ++ A C compound statement with a conditional `goto LABEL;' executed ++ if X (an RTX) is a legitimate memory address on the target machine ++ for a memory operand of mode MODE. ++ ++ It usually pays to define several simpler macros to serve as ++ subroutines for this one. Otherwise it may be too complicated to ++ understand. ++ ++ This macro must exist in two variants: a strict variant and a ++ non-strict one. The strict variant is used in the reload pass. It ++ must be defined so that any pseudo-register that has not been ++ allocated a hard register is considered a memory reference. In ++ contexts where some kind of register is required, a pseudo-register ++ with no hard register must be rejected. ++ ++ The non-strict variant is used in other passes. It must be ++ defined to accept all pseudo-registers in every context where some ++ kind of register is required. ++ ++ Compiler source files that want to use the strict variant of this ++ macro define the macro `REG_OK_STRICT'. You should use an `#ifdef ++ REG_OK_STRICT' conditional to define the strict variant in that ++ case and the non-strict variant otherwise. ++ ++ Subroutines to check for acceptable registers for various purposes ++ (one for base registers, one for index registers, and so on) are ++ typically among the subroutines used to define ++ `GO_IF_LEGITIMATE_ADDRESS'. Then only these subroutine macros ++ need have two variants; the higher levels of macros may be the ++ same whether strict or not. ++ ++ Normally, constant addresses which are the sum of a `symbol_ref' ++ and an integer are stored inside a `const' RTX to mark them as ++ constant. Therefore, there is no need to recognize such sums ++ specifically as legitimate addresses. Normally you would simply ++ recognize any `const' as legitimate. ++ ++ Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant ++ sums that are not marked with `const'. It assumes that a naked ++ `plus' indicates indexing. If so, then you *must* reject such ++ naked constant sums as illegitimate addresses, so that none of ++ them will be given to `PRINT_OPERAND_ADDRESS'. ++ ++ On some machines, whether a symbolic address is legitimate depends ++ on the section that the address refers to. On these machines, ++ define the macro `ENCODE_SECTION_INFO' to store the information ++ into the `symbol_ref', and then check for it here. When you see a ++ `const', you will have to look inside it to find the `symbol_ref' ++ in order to determine the section. *Note Assembler Format::. ++ ++ The best way to modify the name string is by adding text to the ++ beginning, with suitable punctuation to prevent any ambiguity. ++ Allocate the new name in `saveable_obstack'. You will have to ++ modify `ASM_OUTPUT_LABELREF' to remove and decode the added text ++ and output the name accordingly, and define `STRIP_NAME_ENCODING' ++ to access the original name string. ++ ++ You can check the information stored here into the `symbol_ref' in ++ the definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and ++ `PRINT_OPERAND_ADDRESS'. ++ */ ++ ++ /* ++ `REG_OK_FOR_BASE_P (X)' ++ A C expression that is nonzero if X (assumed to be a `reg' RTX) is ++ valid for use as a base register. For hard registers, it should ++ always accept those which the hardware permits and reject the ++ others. Whether the macro accepts or rejects pseudo registers ++ must be controlled by `REG_OK_STRICT' as described above. This ++ usually requires two variant definitions, of which `REG_OK_STRICT' ++ controls the one actually used. ++ */ ++ #define REG_OK_FOR_BASE_NOSTRICT_P(X) \ ++ (REGNO (X) >= FIRST_PSEUDO_REGISTER || REG_OK_FOR_BASE_STRICT_P(X)) ++ ++ #define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X)) ++ ++ #ifdef REG_OK_STRICT ++ # define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X) ++ #else ++ # define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NOSTRICT_P (X) ++ #endif ++ ++ /* ++ A C expression that is just like `REG_OK_FOR_BASE_P', except that ++ that expression may examine the mode of the memory reference in ++ MODE. You should define this macro if the mode of the memory ++ reference affects whether a register may be used as a base ++ register. If you define this macro, the compiler will use it ++ instead of `REG_OK_FOR_BASE_P'. ++ */ ++ #define REG_OK_FOR_INDEX_P(X) 0 ++ /* ++ A C expression that is nonzero if X (assumed to be a `reg' RTX) is ++ valid for use as an index register. ++ ++ The difference between an index register and a base register is ++ that the index register may be scaled. If an address involves the ++ sum of two registers, neither one of them scaled, then either one ++ may be labeled the "base" and the other the "index"; but whichever ++ labeling is used must fit the machine's constraints of which ++ registers may serve in each capacity. The compiler will try both ++ labelings, looking for one that is valid, and will reload one or ++ both registers only if neither labeling works. ++ */ ++ ++ #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \ ++ { \ ++ rtx orig_x = (X); \ ++ (X) = legitimize_address (X, OLDX, MODE); \ ++ if (memory_address_p (MODE, X)) \ ++ goto WIN; \ ++ } ++ /* ++ #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) ++ A C compound statement that attempts to replace X with a valid ++ memory address for an operand of mode MODE. WIN will be a C ++ statement label elsewhere in the code; the macro definition may use ++ ++ GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN); ++ ++ to avoid further processing if the address has become legitimate. ++ ++ X will always be the result of a call to `break_out_memory_refs', ++ and OLDX will be the operand that was given to that function to ++ produce X. ++ ++ The code generated by this macro should not alter the substructure ++ of X. If it transforms X into a more legitimate form, it should ++ assign X (which will always be a C variable) a new value. ++ ++ It is not necessary for this macro to come up with a legitimate ++ address. The compiler has standard ways of doing so in all cases. ++ In fact, it is safe for this macro to do nothing. But often a ++ machine-dependent strategy can generate better code. ++ */ ++ ++ #define XEXP_(X,Y) (X) ++ #define LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_LEVELS, WIN) \ ++ do { \ ++ if ((GET_CODE (X) == POST_INC || GET_CODE (X) == PRE_DEC)) \ ++ { \ ++ push_reload (XEXP (X,0), XEXP (X,0), &XEXP (X,0), &XEXP (X,0), \ ++ POINTER_REGS, GET_MODE (X),GET_MODE (X) , 0, 0, \ ++ OPNUM, RELOAD_OTHER); \ ++ goto WIN; \ ++ } \ ++ if (GET_CODE (X) == PLUS \ ++ && REG_P (XEXP (X, 0)) \ ++ && GET_CODE (XEXP (X, 1)) == CONST_INT \ ++ && INTVAL (XEXP (X, 1)) >= 1) \ ++ { \ ++ int fit = INTVAL (XEXP (X, 1)) <= (64 - GET_MODE_SIZE (MODE)); \ ++ if (fit) \ ++ { \ ++ if (reg_equiv_address[REGNO (XEXP (X, 0))] != 0) \ ++ { \ ++ int regno = REGNO (XEXP (X, 0)); \ ++ rtx mem = make_memloc (X, regno); \ ++ push_reload (XEXP (mem,0), NULL_PTR, &XEXP (mem,0), NULL_PTR, \ ++ POINTER_REGS, Pmode, VOIDmode, 0, 0, \ ++ 1, ADDR_TYPE (TYPE)); \ ++ push_reload (mem, NULL_RTX, &XEXP (X, 0), NULL_PTR, \ ++ BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \ ++ OPNUM, TYPE); \ ++ goto WIN; \ ++ } \ ++ push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL_PTR, \ ++ BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \ ++ OPNUM, TYPE); \ ++ goto WIN; \ ++ } \ ++ else if (! (frame_pointer_needed && XEXP (X,0) == frame_pointer_rtx)) \ ++ { \ ++ push_reload (X, NULL_RTX, &X, NULL_PTR, \ ++ POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \ ++ OPNUM, TYPE); \ ++ goto WIN; \ ++ } \ ++ } \ ++ } while(0) ++ /* ++ A C compound statement that attempts to replace X, which is an ++ address that needs reloading, with a valid memory address for an ++ operand of mode MODE. WIN will be a C statement label elsewhere ++ in the code. It is not necessary to define this macro, but it ++ might be useful for performance reasons. ++ ++ For example, on the i386, it is sometimes possible to use a single ++ reload register instead of two by reloading a sum of two pseudo ++ registers into a register. On the other hand, for number of RISC ++ processors offsets are limited so that often an intermediate ++ address needs to be generated in order to address a stack slot. ++ By defining LEGITIMIZE_RELOAD_ADDRESS appropriately, the ++ intermediate addresses generated for adjacent some stack slots can ++ be made identical, and thus be shared. ++ ++ *Note*: This macro should be used with caution. It is necessary ++ to know something of how reload works in order to effectively use ++ this, and it is quite easy to produce macros that build in too ++ much knowledge of reload internals. ++ ++ *Note*: This macro must be able to reload an address created by a ++ previous invocation of this macro. If it fails to handle such ++ addresses then the compiler may generate incorrect code or abort. ++ ++ The macro definition should use `push_reload' to indicate parts ++ that need reloading; OPNUM, TYPE and IND_LEVELS are usually ++ suitable to be passed unaltered to `push_reload'. ++ ++ The code generated by this macro must not alter the substructure of ++ X. If it transforms X into a more legitimate form, it should ++ assign X (which will always be a C variable) a new value. This ++ also applies to parts that you change indirectly by calling ++ `push_reload'. ++ ++ The macro definition may use `strict_memory_address_p' to test if ++ the address has become legitimate. ++ ++ If you want to change only a part of X, one standard way of doing ++ this is to use `copy_rtx'. Note, however, that is unshares only a ++ single level of rtl. Thus, if the part to be changed is not at the ++ top level, you'll need to replace first the top leve It is not ++ necessary for this macro to come up with a legitimate address; ++ but often a machine-dependent strategy can generate better code. ++ */ ++ ++ #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ ++ { if (GET_CODE (ADDR) == POST_INC \ ++ || GET_CODE (ADDR) == PRE_DEC) \ ++ goto LABEL; \ ++ } ++ /* ++ A C statement or compound statement with a conditional `goto ++ LABEL;' executed if memory address X (an RTX) can have different ++ meanings depending on the machine mode of the memory reference it ++ is used for or if the address is valid for some modes but not ++ others. ++ ++ Autoincrement and autodecrement addresses typically have ++ mode-dependent effects because the amount of the increment or ++ decrement is the size of the operand being addressed. Some ++ machines have other mode-dependent addresses. Many RISC machines ++ have no mode-dependent addresses. ++ ++ You may assume that ADDR is a valid address for the machine. ++ */ ++ #define LEGITIMATE_CONSTANT_P(X) 1 ++ /* ++ A C expression that is nonzero if X is a legitimate constant for ++ an immediate operand on the target machine. You can assume that X ++ satisfies `CONSTANT_P', so you need not check this. In fact, `1' ++ is a suitable definition for this macro on machines where anything ++ `CONSTANT_P' is valid. ++ */ ++ ++ /* ++ `DONT_RECORD_EQUIVALENCE (NOTE)' ++ A C expression that is nonzero if the `REG_EQUAL' note X should not ++ be promoted to a `REG_EQUIV' note. ++ ++ Define this macro if NOTE refers to a constant that must be ++ accepted by `LEGITIMATE_CONSTANT_P', but must not appear as an ++ immediate operand. ++ ++ Most machine descriptions do not need to define this macro. ++ */ ++ ++ ++ ++ #define CONST_COSTS(x,CODE,OUTER_CODE) \ ++ case CONST_INT: \ ++ if (OUTER_CODE == PLUS \ ++ || OUTER_CODE == IOR \ ++ || OUTER_CODE == AND \ ++ || OUTER_CODE == MINUS \ ++ || OUTER_CODE == SET \ ++ || INTVAL (x) == 0) \ ++ return 2; \ ++ if (OUTER_CODE == COMPARE \ ++ && INTVAL (x) >= 0 \ ++ && INTVAL (x) <= 255) \ ++ return 2; \ ++ case CONST: \ ++ case LABEL_REF: \ ++ case SYMBOL_REF: \ ++ return 4; \ ++ case CONST_DOUBLE: \ ++ return 4; ++ ++ /* ++ A part of a C `switch' statement that describes the relative costs ++ of constant RTL expressions. It must contain `case' labels for ++ expression codes `const_int', `const', `symbol_ref', `label_ref' ++ and `const_double'. Each case must ultimately reach a `return' ++ statement to return the relative cost of the use of that kind of ++ constant value in an expression. The cost may depend on the ++ precise value of the constant, which is available for examination ++ in X, and the rtx code of the expression in which it is contained, ++ found in OUTER_CODE. ++ ++ CODE is the expression code--redundant, since it can be obtained ++ with `GET_CODE (X)'. ++ */ ++ ++ #define DEFAULT_RTX_COSTS(x, code, outer_code) \ ++ { \ ++ int cst = default_rtx_costs (x, code, outer_code); \ ++ if (cst>0) \ ++ return cst; \ ++ else if (cst<0) \ ++ total += -cst; \ ++ break; \ ++ } ++ ++ /*XXX ?-?-? ++ Like `CONST_COSTS' but applies to nonconstant RTL expressions. ++ This can be used, for example, to indicate how costly a multiply ++ instruction is. In writing this macro, you can use the construct ++ `COSTS_N_INSNS (N)' to specify a cost equal to N fast ++ instructions. OUTER_CODE is the code of the expression in which X ++ is contained. ++ ++ This macro is optional; do not define it if the default cost ++ assumptions are adequate for the target machine. ++ */ ++ ++ #define ADDRESS_COST(ADDRESS) avr_address_cost (ADDRESS) ++ ++ /* ++ An expression giving the cost of an addressing mode that contains ++ ADDRESS. If not defined, the cost is computed from the ADDRESS ++ expression and the `CONST_COSTS' values. ++ ++ For most CISC machines, the default cost is a good approximation ++ of the true cost of the addressing mode. However, on RISC ++ machines, all instructions normally have the same length and ++ execution time. Hence all addresses will have equal costs. ++ ++ In cases where more than one form of an address is known, the form ++ with the lowest cost will be used. If multiple forms have the ++ same, lowest, cost, the one that is the most complex will be used. ++ ++ For example, suppose an address that is equal to the sum of a ++ register and a constant is used twice in the same basic block. ++ When this macro is not defined, the address will be computed in a ++ register and memory references will be indirect through that ++ register. On machines where the cost of the addressing mode ++ containing the sum is no higher than that of a simple indirect ++ reference, this will produce an additional instruction and ++ possibly require an additional register. Proper specification of ++ this macro eliminates this overhead for such machines. ++ ++ Similar use of this macro is made in strength reduction of loops. ++ ++ ADDRESS need not be valid as an address. In such a case, the cost ++ is not relevant and can be any value; invalid addresses need not be ++ assigned a different cost. ++ ++ On machines where an address involving more than one register is as ++ cheap as an address computation involving only one register, ++ defining `ADDRESS_COST' to reflect this can cause two registers to ++ be live over a region of code where only one would have been if ++ `ADDRESS_COST' were not defined in that manner. This effect should ++ be considered in the definition of this macro. Equivalent costs ++ should probably only be given to addresses with different numbers ++ of registers on machines with lots of registers. ++ ++ This macro will normally either not be defined or be defined as a ++ constant. ++ */ ++ ++ #define REGISTER_MOVE_COST(FROM, TO) ((FROM) == STACK_REG ? 6 : \ ++ (TO) == STACK_REG ? 12 \ ++ : 2) ++ /* ++ A C expression for the cost of moving data from a register in class ++ FROM to one in class TO. The classes are expressed using the ++ enumeration values such as `GENERAL_REGS'. A value of 2 is the ++ default; other values are interpreted relative to that. ++ ++ It is not required that the cost always equal 2 when FROM is the ++ same as TO; on some machines it is expensive to move between ++ registers if they are not general registers. ++ ++ If reload sees an insn consisting of a single `set' between two ++ hard registers, and if `REGISTER_MOVE_COST' applied to their ++ classes returns a value of 2, reload does not check to ensure that ++ the constraints of the insn are met. Setting a cost of other than ++ 2 will allow reload to verify that the constraints are met. You ++ should do this if the `movM' pattern's constraints do not allow ++ such copying. ++ */ ++ #define MEMORY_MOVE_COST(MODE,CLASS,IN) ((MODE)==QImode ? 2 : \ ++ (MODE)==HImode ? 4 : \ ++ (MODE)==SImode ? 8 : \ ++ (MODE)==SFmode ? 8 : 16) ++ /* ++ A C expression for the cost of moving data of mode M between a ++ register and memory. A value of 4 is the default; this cost is ++ relative to those in `REGISTER_MOVE_COST'. ++ ++ If moving between registers and memory is more expensive than ++ between two registers, you should define this macro to express the ++ relative cost. ++ */ ++ /* ++ #define BRANCH_COST 2 ++ A C expression for the cost of a branch instruction. A value of 1 ++ is the default; other values are interpreted relative to that. ++ ++ Here are additional macros which do not specify precise relative ++ costs, but only that certain actions are more expensive than GNU CC ++ would ordinarily expect. ++ */ ++ ++ #define SLOW_BYTE_ACCESS 0 ++ /* ++ Define this macro as a C expression which is nonzero if accessing ++ less than a word of memory (i.e. a `char' or a `short') is no ++ faster than accessing a word of memory, i.e., if such access ++ require more than one instruction or if there is no difference in ++ cost between byte and (aligned) word loads. ++ ++ When this macro is not defined, the compiler will access a field by ++ finding the smallest containing object; when it is defined, a ++ fullword load will be used if alignment permits. Unless bytes ++ accesses are faster than word accesses, using word accesses is ++ preferable since it may eliminate subsequent memory access if ++ subsequent accesses occur to other fields in the same word of the ++ structure, but to different bytes. ++ ++ `SLOW_ZERO_EXTEND' ++ Define this macro if zero-extension (of a `char' or `short' to an ++ `int') can be done faster if the destination is a register that is ++ known to be zero. ++ ++ If you define this macro, you must have instruction patterns that ++ recognize RTL structures like this: ++ ++ (set (strict_low_part (subreg:QI (reg:SI ...) 0)) ...) ++ ++ and likewise for `HImode'. ++ ++ `SLOW_UNALIGNED_ACCESS' ++ Define this macro to be the value 1 if unaligned accesses have a ++ cost many times greater than aligned accesses, for example if they ++ are emulated in a trap handler. ++ ++ When this macro is non-zero, the compiler will act as if ++ `STRICT_ALIGNMENT' were non-zero when generating code for block ++ moves. This can cause significantly more instructions to be ++ produced. Therefore, do not set this macro non-zero if unaligned ++ accesses only add a cycle or two to the time for a memory access. ++ ++ If the value of this macro is always zero, it need not be defined. ++ ++ `DONT_REDUCE_ADDR' ++ Define this macro to inhibit strength reduction of memory ++ addresses. (On some machines, such strength reduction seems to do ++ harm rather than good.) ++ ++ `MOVE_RATIO' ++ The number of scalar move insns which should be generated instead ++ of a string move insn or a library call. Increasing the value ++ will always make code faster, but eventually incurs high cost in ++ increased code size. ++ ++ If you don't define this, a reasonable default is used. ++ */ ++ ++ #define NO_FUNCTION_CSE ++ /* ++ Define this macro if it is as good or better to call a constant ++ function address than to call an address kept in a register. ++ */ ++ ++ #define NO_RECURSIVE_FUNCTION_CSE ++ /* ++ Define this macro if it is as good or better for a function to call ++ itself with an explicit address than to call an address kept in a ++ register. ++ ++ `ADJUST_COST (INSN, LINK, DEP_INSN, COST)' ++ A C statement (sans semicolon) to update the integer variable COST ++ based on the relationship between INSN that is dependent on ++ DEP_INSN through the dependence LINK. The default is to make no ++ adjustment to COST. This can be used for example to specify to ++ the scheduler that an output- or anti-dependence does not incur ++ the same cost as a data-dependence. ++ ++ `ADJUST_PRIORITY (INSN)' ++ A C statement (sans semicolon) to update the integer scheduling ++ priority `INSN_PRIORITY(INSN)'. Reduce the priority to execute ++ the INSN earlier, increase the priority to execute INSN later. ++ Do not define this macro if you do not need to adjust the ++ scheduling priorities of insns. ++ */ ++ ++ ++ #define TEXT_SECTION_ASM_OP \ ++ avr_change_section (AS_STR ("\tseg flash.code", ".section .text")) ++ /* ++ A C expression whose value is a string containing the assembler ++ operation that should precede instructions and read-only data. ++ Normally `".text"' is right. ++ */ ++ ++ extern char * avr_data_section_name; ++ #define DATA_SECTION_ASM_OP \ ++ avr_change_section (avr_data_section_name) ++ /* ++ A C expression whose value is a string containing the assembler ++ operation to identify the following data as writable initialized ++ data. Normally `".data"' is right. ++ */ ++ ++ /* ++ `SHARED_SECTION_ASM_OP' ++ If defined, a C expression whose value is a string containing the ++ assembler operation to identify the following data as shared data. ++ If not defined, `DATA_SECTION_ASM_OP' will be used. ++ */ ++ ++ extern char * avr_bss_section_name; ++ #define BSS_SECTION_ASM_OP \ ++ avr_change_section (avr_bss_section_name) ++ /* ++ If defined, a C expression whose value is a string containing the ++ assembler operation to identify the following data as ++ uninitialized global data. If not defined, and neither ++ `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined, ++ uninitialized global data will be output in the data section if ++ `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be ++ used. ++ */ ++ ++ /* ++ `SHARED_BSS_SECTION_ASM_OP' ++ If defined, a C expression whose value is a string containing the ++ assembler operation to identify the following data as ++ uninitialized global shared data. If not defined, and ++ `BSS_SECTION_ASM_OP' is, the latter will be used. ++ */ ++ /* ++ `INIT_SECTION_ASM_OP' ++ If defined, a C expression whose value is a string containing the ++ assembler operation to identify the following data as ++ initialization code. If not defined, GNU CC will assume such a ++ section does not exist. ++ */ ++ #define EXTRA_SECTIONS in_progmem ++ /* ++ `EXTRA_SECTIONS' ++ A list of names for sections other than the standard two, which are ++ `in_text' and `in_data'. You need not define this macro on a ++ system with no other sections (that GCC needs to use). ++ */ ++ #define EXTRA_SECTION_FUNCTIONS \ ++ \ ++ void \ ++ progmem_section() \ ++ { \ ++ if (in_section != in_progmem) \ ++ { \ ++ fprintf (asm_out_file, AS_STR ("seg flash.progmem\n", \ ++ ".section .progmem.gcc_sw_table\n")); \ ++ in_section = in_progmem; \ ++ } \ ++ } ++ /* ++ `EXTRA_SECTION_FUNCTIONS' ++ One or more functions to be defined in `varasm.c'. These ++ functions should do jobs analogous to those of `text_section' and ++ `data_section', for your additional sections. Do not define this ++ macro if you do not define `EXTRA_SECTIONS'. ++ */ ++ #define READONLY_DATA_SECTION data_section ++ /*XXX ++ On most machines, read-only variables, constants, and jump tables ++ are placed in the text section. If this is not the case on your ++ machine, this macro should be defined to be the name of a function ++ (either `data_section' or a function defined in `EXTRA_SECTIONS') ++ that switches to the section to be used for read-only items. ++ ++ If these items should be placed in the text section, this macro ++ should not be defined. ++ */ ++ ++ /* ++ `SELECT_SECTION (EXP, RELOC)' ++ A C statement or statements to switch to the appropriate section ++ for output of EXP. You can assume that EXP is either a `VAR_DECL' ++ node or a constant of some sort. RELOC indicates whether the ++ initial value of EXP requires link-time relocations. Select the ++ section by calling `text_section' or one of the alternatives for ++ other sections. ++ ++ Do not define this macro if you put all read-only variables and ++ constants in the read-only data section (usually the text section). ++ */ ++ ++ /* ++ `SELECT_RTX_SECTION (MODE, RTX)' ++ A C statement or statements to switch to the appropriate section ++ for output of RTX in mode MODE. You can assume that RTX is some ++ kind of constant in RTL. The argument MODE is redundant except in ++ the case of a `const_int' rtx. Select the section by calling ++ `text_section' or one of the alternatives for other sections. ++ ++ Do not define this macro if you put all constants in the read-only ++ data section. ++ */ ++ ++ #define JUMP_TABLES_IN_TEXT_SECTION 1 ++ /* ++ Define this macro if jump tables (for `tablejump' insns) should be ++ output in the text section, along with the assembler instructions. ++ Otherwise, the readonly data section is used. ++ ++ This macro is irrelevant if there is no separate readonly data ++ section. ++ */ ++ ++ #define ENCODE_SECTION_INFO(DECL) encode_section_info(DECL) ++ /* ++ Define this macro if references to a symbol must be treated ++ differently depending on something about the variable or function ++ named by the symbol (such as what section it is in). ++ ++ The macro definition, if any, is executed immediately after the ++ rtl for DECL has been created and stored in `DECL_RTL (DECL)'. ++ The value of the rtl will be a `mem' whose address is a ++ `symbol_ref'. ++ ++ The usual thing for this macro to do is to record a flag in the ++ `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified ++ name string in the `symbol_ref' (if one bit is not enough ++ information). ++ */ ++ ++ #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \ ++ (VAR) = (SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*' || (SYMBOL_NAME)[0] == '@'); ++ /* ++ `STRIP_NAME_ENCODING (VAR, SYM_NAME)' ++ Decode SYM_NAME and store the real name part in VAR, sans the ++ characters that encode section info. Define this macro if ++ `ENCODE_SECTION_INFO' alters the symbol's name string. ++ */ ++ /* ++ `UNIQUE_SECTION_P (DECL)' ++ A C expression which evaluates to true if DECL should be placed ++ into a unique section for some target-specific reason. If you do ++ not define this macro, the default is `0'. Note that the flag ++ `-ffunction-sections' will also cause functions to be placed into ++ unique sections. ++ */ ++ ++ #define UNIQUE_SECTION(DECL, RELOC) unique_section (DECL, RELOC) ++ /* ++ `UNIQUE_SECTION (DECL, RELOC)' ++ A C statement to build up a unique section name, expressed as a ++ STRING_CST node, and assign it to `DECL_SECTION_NAME (DECL)'. ++ RELOC indicates whether the initial value of EXP requires ++ link-time relocations. If you do not define this macro, GNU CC ++ will use the symbol name prefixed by `.' as the section name. ++ */ ++ ++ ++ #define ASM_FILE_START(STREAM) asm_file_start (STREAM) ++ /* ++ A C expression which outputs to the stdio stream STREAM some ++ appropriate text to go at the start of an assembler file. ++ ++ Normally this macro is defined to output a line containing ++ `#NO_APP', which is a comment that has no effect on most ++ assemblers but tells the GNU assembler that it can save time by not ++ checking for certain assembler constructs. ++ ++ On systems that use SDB, it is necessary to output certain ++ commands; see `attasm.h'. ++ */ ++ ++ #define ASM_FILE_END(STREAM) asm_file_end (STREAM) ++ /* ++ A C expression which outputs to the stdio stream STREAM some ++ appropriate text to go at the end of an assembler file. ++ ++ If this macro is not defined, the default is to output nothing ++ special at the end of the file. Most systems don't require any ++ definition. ++ ++ On systems that use SDB, it is necessary to output certain ++ commands; see `attasm.h'. ++ */ ++ ++ /* Defined in dbxelf.h ++ #define ASM_IDENTIFY_GCC(FILE) {} ++ A C statement to output assembler commands which will identify the ++ object file as having been compiled with GNU CC (or another GNU ++ compiler). ++ ++ If you don't define this macro, the string `gcc_compiled.:' is ++ output. This string is calculated to define a symbol which, on ++ BSD systems, will never be defined for any other reason. GDB ++ checks for the presence of this symbol when reading the symbol ++ table of an executable. ++ ++ On non-BSD systems, you must arrange communication with GDB in ++ some other fashion. If GDB is not used on your system, you can ++ define this macro with an empty body. ++ */ ++ ++ #define ASM_COMMENT_START " ; " ++ /* ++ A C string constant describing how to begin a comment in the target ++ assembler language. The compiler assumes that the comment will ++ end at the end of the line. ++ */ ++ ++ #define ASM_APP_ON "/* #APP */\n" ++ /* ++ A C string constant for text to be output before each `asm' ++ statement or group of consecutive ones. Normally this is ++ `"#APP"', which is a comment that has no effect on most assemblers ++ but tells the GNU assembler that it must check the lines that ++ follow for all valid assembler constructs. ++ */ ++ ++ #define ASM_APP_OFF "/* #NOAPP */\n" ++ /* ++ A C string constant for text to be output after each `asm' ++ statement or group of consecutive ones. Normally this is ++ `"#NO_APP"', which tells the GNU assembler to resume making the ++ time-saving assumptions that are valid for ordinary compiler ++ output. ++ */ ++ ++ #if 0 ++ #define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \ ++ fprintf (STREAM, "/* file: %s */\n", NAME) ++ #endif ++ /* ++ A C statement to output COFF information or DWARF debugging ++ information which indicates that filename NAME is the current ++ source file to the stdio stream STREAM. ++ ++ This macro need not be defined if the standard form of output for ++ the file format in use is appropriate. ++ */ ++ ++ #define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) fprintf (STREAM,"/* line: %d */\n",LINE) ++ /* ++ A C statement to output DBX or SDB debugging information before ++ code for line number LINE of the current source file to the stdio ++ stream STREAM. ++ ++ This macro need not be defined if the standard form of debugging ++ information for the debugger in use is appropriate. ++ */ ++ /* ++ `ASM_OUTPUT_IDENT (STREAM, STRING)' ++ A C statement to output something to the assembler file to handle a ++ `#ident' directive containing the text STRING. If this macro is ++ not defined, nothing is output for a `#ident' directive. ++ */ ++ ++ #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \ ++ asm_output_section_name(FILE, DECL, NAME, RELOC) ++ /* ++ `ASM_OUTPUT_SECTION_NAME (STREAM, DECL, NAME, RELOC)' ++ A C statement to output something to the assembler file to switch ++ to section NAME for object DECL which is either a `FUNCTION_DECL', ++ a `VAR_DECL' or `NULL_TREE'. RELOC indicates whether the initial ++ value of EXP requires link-time relocations. Some target formats ++ do not support arbitrary sections. Do not define this macro in ++ such cases. ++ ++ At present this macro is only used to support section attributes. ++ When this macro is undefined, section attributes are disabled. ++ */ ++ #define OBJC_PROLOGUE {} ++ /* ++ A C statement to output any assembler statements which are ++ required to precede any Objective C object definitions or message ++ sending. The statement is executed only when compiling an ++ Objective C program. ++ */ ++ ++ ++ ++ #define ASM_OUTPUT_DOUBLE(STREAM, VALUE) fprintf (STREAM, "no double float %.20e\n", VALUE) ++ #define ASM_OUTPUT_FLOAT(STREAM, VALUE) asm_output_float (STREAM, VALUE) ++ /* ++ `ASM_OUTPUT_LONG_DOUBLE (STREAM, VALUE)' ++ `ASM_OUTPUT_THREE_QUARTER_FLOAT (STREAM, VALUE)' ++ `ASM_OUTPUT_SHORT_FLOAT (STREAM, VALUE)' ++ `ASM_OUTPUT_BYTE_FLOAT (STREAM, VALUE)' ++ A C statement to output to the stdio stream STREAM an assembler ++ instruction to assemble a floating-point constant of `TFmode', ++ `DFmode', `SFmode', `TQFmode', `HFmode', or `QFmode', ++ respectively, whose value is VALUE. VALUE will be a C expression ++ of type `REAL_VALUE_TYPE'. Macros such as ++ `REAL_VALUE_TO_TARGET_DOUBLE' are useful for writing these ++ definitions. ++ */ ++ ++ ++ #define ASM_OUTPUT_INT(FILE, VALUE) \ ++ ( fprintf (FILE, AS_STR ("\tdc.l ", "\t.long ")), \ ++ output_addr_const (FILE, (VALUE)), \ ++ fputs ("\n", FILE)) ++ ++ /* Likewise for `short' and `char' constants. */ ++ ++ #define ASM_OUTPUT_SHORT(FILE,VALUE) asm_output_short(FILE,VALUE) ++ #define ASM_OUTPUT_CHAR(FILE,VALUE) asm_output_char(FILE,VALUE) ++ ++ /* ++ `ASM_OUTPUT_QUADRUPLE_INT (STREAM, EXP)' ++ A C statement to output to the stdio stream STREAM an assembler ++ instruction to assemble an integer of 16, 8, 4, 2 or 1 bytes, ++ respectively, whose value is VALUE. The argument EXP will be an ++ RTL expression which represents a constant value. Use ++ `output_addr_const (STREAM, EXP)' to output this value as an ++ assembler expression. ++ ++ For sizes larger than `UNITS_PER_WORD', if the action of a macro ++ would be identical to repeatedly calling the macro corresponding to ++ a size of `UNITS_PER_WORD', once for each word, you need not define ++ the macro. ++ */ ++ ++ ++ #define ASM_OUTPUT_BYTE(FILE,VALUE) asm_output_byte (FILE,VALUE) ++ /* ++ A C statement to output to the stdio stream STREAM an assembler ++ instruction to assemble a single byte containing the number VALUE. ++ */ ++ #define ASM_BYTE_OP AS_STR("dc.b ",".byte ") ++ /* ++ A C string constant giving the pseudo-op to use for a sequence of ++ single-byte constants. If this macro is not defined, the default ++ is `"byte"'. ++ */ ++ ++ #define ASM_OUTPUT_ASCII(FILE, P, SIZE) avr_output_ascii (FILE,P,SIZE) ++ /* ++ `ASM_OUTPUT_ASCII (STREAM, PTR, LEN)' ++ output_ascii (FILE, P, SIZE) ++ A C statement to output to the stdio stream STREAM an assembler ++ instruction to assemble a string constant containing the LEN bytes ++ at PTR. PTR will be a C expression of type `char *' and LEN a C ++ expression of type `int'. ++ ++ If the assembler has a `.ascii' pseudo-op as found in the Berkeley ++ Unix assembler, do not define the macro `ASM_OUTPUT_ASCII'. ++ */ ++ /* ++ `CONSTANT_POOL_BEFORE_FUNCTION' ++ You may define this macro as a C expression. You should define the ++ expression to have a non-zero value if GNU CC should output the ++ constant pool for a function before the code for the function, or ++ a zero value if GNU CC should output the constant pool after the ++ function. If you do not define this macro, the usual case, GNU CC ++ will output the constant pool before the function. ++ */ ++ /* ++ `ASM_OUTPUT_POOL_PROLOGUE (FILE FUNNAME FUNDECL SIZE)' ++ A C statement to output assembler commands to define the start of ++ the constant pool for a function. FUNNAME is a string giving the ++ name of the function. Should the return type of the function be ++ required, it can be obtained via FUNDECL. SIZE is the size, in ++ bytes, of the constant pool that will be written immediately after ++ this call. ++ ++ If no constant-pool prefix is required, the usual case, this macro ++ need not be defined. ++ */ ++ /* ++ `ASM_OUTPUT_SPECIAL_POOL_ENTRY (FILE, X, MODE, ALIGN, LABELNO, JUMPTO)' ++ A C statement (with or without semicolon) to output a constant in ++ the constant pool, if it needs special treatment. (This macro ++ need not do anything for RTL expressions that can be output ++ normally.) ++ ++ The argument FILE is the standard I/O stream to output the ++ assembler code on. X is the RTL expression for the constant to ++ output, and MODE is the machine mode (in case X is a `const_int'). ++ ALIGN is the required alignment for the value X; you should ++ output an assembler directive to force this much alignment. ++ ++ The argument LABELNO is a number to use in an internal label for ++ the address of this pool entry. The definition of this macro is ++ responsible for outputting the label definition at the proper ++ place. Here is how to do this: ++ ++ ASM_OUTPUT_INTERNAL_LABEL (FILE, "LC", LABELNO); ++ ++ When you output a pool entry specially, you should end with a ++ `goto' to the label JUMPTO. This will prevent the same pool entry ++ from being output a second time in the usual manner. ++ ++ You need not define this macro if it would do nothing. ++ */ ++ /* ++ `CONSTANT_AFTER_FUNCTION_P (EXP)' ++ Define this macro as a C expression which is nonzero if the ++ constant EXP, of type `tree', should be output after the code for a ++ function. The compiler will normally output all constants before ++ the function; you need not define this macro if this is OK. ++ */ ++ /* ++ `ASM_OUTPUT_POOL_EPILOGUE (FILE FUNNAME FUNDECL SIZE)' ++ A C statement to output assembler commands to at the end of the ++ constant pool for a function. FUNNAME is a string giving the name ++ of the function. Should the return type of the function be ++ required, you can obtain it via FUNDECL. SIZE is the size, in ++ bytes, of the constant pool that GNU CC wrote immediately before ++ this call. ++ ++ If no constant-pool epilogue is required, the usual case, you need ++ not define this macro. ++ */ ++ ++ ++ #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == '\n' \ ++ || (!TARGET_AVA && (C) == '$')) ++ /* ++ #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == '~') ++ Define this macro as a C expression which is nonzero if C is used ++ as a logical line separator by the assembler. ++ ++ If you do not define this macro, the default is that only the ++ character `;' is treated as a logical line separator. ++ */ ++ ++ #define ASM_OPEN_PAREN "(" ++ #define ASM_CLOSE_PAREN ")" ++ /* ++ These macros are defined as C string constant, describing the ++ syntax in the assembler for grouping arithmetic expressions. The ++ following definitions are correct for most assemblers: ++ ++ #define ASM_OPEN_PAREN "(" ++ #define ASM_CLOSE_PAREN ")" ++ ++ These macros are provided by `real.h' for writing the definitions of ++ `ASM_OUTPUT_DOUBLE' and the like: ++ */ ++ /* ++ `REAL_VALUE_TO_TARGET_SINGLE (X, L)' ++ `REAL_VALUE_TO_TARGET_DOUBLE (X, L)' ++ `REAL_VALUE_TO_TARGET_LONG_DOUBLE (X, L)' ++ These translate X, of type `REAL_VALUE_TYPE', to the target's ++ floating point representation, and store its bit pattern in the ++ array of `long int' whose address is L. The number of elements in ++ the output array is determined by the size of the desired target ++ floating point data type: 32 bits of it go in each `long int' array ++ element. Each array element holds 32 bits of the result, even if ++ `long int' is wider than 32 bits on the host machine. ++ ++ The array element values are designed so that you can print them ++ out using `fprintf' in the order they should appear in the target ++ machine's memory. ++ ++ `REAL_VALUE_TO_DECIMAL (X, FORMAT, STRING)' ++ This macro converts X, of type `REAL_VALUE_TYPE', to a decimal ++ number and stores it as a string into STRING. You must pass, as ++ STRING, the address of a long enough block of space to hold the ++ result. ++ ++ The argument FORMAT is a `printf'-specification that serves as a ++ suggestion for how to format the output string. ++ */ ++ ++ ++ #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \ ++ do { \ ++ if (TARGET_AVA) \ ++ { \ ++ bss_section (); \ ++ fprintf (STREAM,"public "); \ ++ assemble_name (STREAM, NAME); \ ++ fprintf (STREAM, \ ++ ":\n\tds.b %d\t/* common label size: %d, rounded: %d */\n", \ ++ ROUNDED, SIZE, ROUNDED); \ ++ } \ ++ else \ ++ { \ ++ fputs ("\t.comm ", (STREAM)); \ ++ assemble_name ((STREAM), (NAME)); \ ++ fprintf ((STREAM), ",%d\n", (SIZE)); \ ++ } \ ++ } while (0) ++ /* ++ A C statement (sans semicolon) to output to the stdio stream ++ STREAM the assembler definition of a common-label named NAME whose ++ size is SIZE bytes. The variable ROUNDED is the size rounded up ++ to whatever alignment the caller wants. ++ ++ Use the expression `assemble_name (STREAM, NAME)' to output the ++ name itself; before and after that, output the additional ++ assembler syntax for defining the name, and a newline. ++ ++ This macro controls how the assembler definitions of uninitialized ++ common global variables are output. ++ */ ++ /* ++ `ASM_OUTPUT_ALIGNED_COMMON (STREAM, NAME, SIZE, ALIGNMENT)' ++ Like `ASM_OUTPUT_COMMON' except takes the required alignment as a ++ separate, explicit argument. If you define this macro, it is used ++ in place of `ASM_OUTPUT_COMMON', and gives you more flexibility in ++ handling the required alignment of the variable. The alignment is ++ specified as the number of bits. ++ */ ++ /* ++ `ASM_OUTPUT_SHARED_COMMON (STREAM, NAME, SIZE, ROUNDED)' ++ If defined, it is similar to `ASM_OUTPUT_COMMON', except that it ++ is used when NAME is shared. If not defined, `ASM_OUTPUT_COMMON' ++ will be used. ++ */ ++ ++ /* ++ #define ASM_OUTPUT_BSS(STREAM, DECL, NAME, SIZE, ROUNDED) asm_output_bss(STREAM, DECL, NAME, SIZE, ROUNDED) ++ A C statement (sans semicolon) to output to the stdio stream ++ STREAM the assembler definition of uninitialized global DECL named ++ NAME whose size is SIZE bytes. The variable ROUNDED is the size ++ rounded up to whatever alignment the caller wants. ++ ++ Try to use function `asm_output_bss' defined in `varasm.c' when ++ defining this macro. If unable, use the expression `assemble_name ++ (STREAM, NAME)' to output the name itself; before and after that, ++ output the additional assembler syntax for defining the name, and ++ a newline. ++ ++ This macro controls how the assembler definitions of uninitialized ++ global variables are output. This macro exists to properly ++ support languages like `c++' which do not have `common' data. ++ However, this macro currently is not defined for all targets. If ++ this macro and `ASM_OUTPUT_ALIGNED_BSS' are not defined then ++ `ASM_OUTPUT_COMMON' or `ASM_OUTPUT_ALIGNED_COMMON' is used. ++ ++ `ASM_OUTPUT_ALIGNED_BSS (STREAM, DECL, NAME, SIZE, ALIGNMENT)' ++ Like `ASM_OUTPUT_BSS' except takes the required alignment as a ++ separate, explicit argument. If you define this macro, it is used ++ in place of `ASM_OUTPUT_BSS', and gives you more flexibility in ++ handling the required alignment of the variable. The alignment is ++ specified as the number of bits. ++ ++ Try to use function `asm_output_aligned_bss' defined in file ++ `varasm.c' when defining this macro. ++ ++ `ASM_OUTPUT_SHARED_BSS (STREAM, DECL, NAME, SIZE, ROUNDED)' ++ If defined, it is similar to `ASM_OUTPUT_BSS', except that it is ++ used when NAME is shared. If not defined, `ASM_OUTPUT_BSS' will ++ be used. ++ */ ++ ++ #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) \ ++ do { \ ++ if (TARGET_AVA) \ ++ { \ ++ bss_section (); \ ++ assemble_name (STREAM, NAME); \ ++ fprintf (STREAM, ":\tds.b %d\n", (SIZE)); \ ++ } \ ++ else \ ++ { \ ++ fputs ("\t.lcomm ", (STREAM)); \ ++ assemble_name ((STREAM), (NAME)); \ ++ fprintf ((STREAM), ",%d\n", (SIZE)); \ ++ } \ ++ } while (0) ++ /* ++ A C statement (sans semicolon) to output to the stdio stream ++ STREAM the assembler definition of a local-common-label named NAME ++ whose size is SIZE bytes. The variable ROUNDED is the size ++ rounded up to whatever alignment the caller wants. ++ ++ Use the expression `assemble_name (STREAM, NAME)' to output the ++ name itself; before and after that, output the additional ++ assembler syntax for defining the name, and a newline. ++ ++ This macro controls how the assembler definitions of uninitialized ++ static variables are output. ++ */ ++ /* ++ `ASM_OUTPUT_ALIGNED_LOCAL (STREAM, NAME, SIZE, ALIGNMENT)' ++ Like `ASM_OUTPUT_LOCAL' except takes the required alignment as a ++ separate, explicit argument. If you define this macro, it is used ++ in place of `ASM_OUTPUT_LOCAL', and gives you more flexibility in ++ handling the required alignment of the variable. The alignment is ++ specified as the number of bits. ++ */ ++ /* ++ `ASM_OUTPUT_SHARED_LOCAL (STREAM, NAME, SIZE, ROUNDED)' ++ If defined, it is similar to `ASM_OUTPUT_LOCAL', except that it is ++ used when NAME is shared. If not defined, `ASM_OUTPUT_LOCAL' will ++ be used. ++ */ ++ ++ ++ #define ASM_OUTPUT_LABEL(STREAM, NAME) \ ++ { \ ++ if (TARGET_AVA && make_it_public) \ ++ { \ ++ make_it_public = 0; \ ++ fprintf (STREAM, "public "); \ ++ } \ ++ assemble_name (STREAM, NAME); \ ++ fprintf (STREAM, ":\n"); \ ++ } ++ /* ++ A C statement (sans semicolon) to output to the stdio stream ++ STREAM the assembler definition of a label named NAME. Use the ++ expression `assemble_name (STREAM, NAME)' to output the name ++ itself; before and after that, output the additional assembler ++ syntax for defining the name, and a newline. ++ */ ++ ++ #undef TYPE_ASM_OP ++ #undef SIZE_ASM_OP ++ #undef WEAK_ASM_OP ++ #define TYPE_ASM_OP ".type" ++ #define SIZE_ASM_OP ".size" ++ #define WEAK_ASM_OP ".weak" ++ /* Define the strings used for the special svr4 .type and .size directives. ++ These strings generally do not vary from one system running svr4 to ++ another, but if a given system (e.g. m88k running svr) needs to use ++ different pseudo-op names for these, they may be overridden in the ++ file which includes this one. */ ++ ++ ++ #undef TYPE_OPERAND_FMT ++ #define TYPE_OPERAND_FMT "@%s" ++ /* The following macro defines the format used to output the second ++ operand of the .type assembler directive. Different svr4 assemblers ++ expect various different forms for this operand. The one given here ++ is just a default. You may need to override it in your machine- ++ specific tm.h file (depending upon the particulars of your assembler). */ ++ ++ ++ #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ ++ do { \ ++ if (!TARGET_AVA) \ ++ { \ ++ fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ ++ assemble_name (FILE, NAME); \ ++ putc (',', FILE); \ ++ fprintf (FILE, TYPE_OPERAND_FMT, "function"); \ ++ putc ('\n', FILE); \ ++ } \ ++ ASM_OUTPUT_LABEL (FILE, NAME); \ ++ } while (0) ++ /* ++ `ASM_DECLARE_FUNCTION_NAME (STREAM, NAME, DECL)' ++ A C statement (sans semicolon) to output to the stdio stream ++ STREAM any text necessary for declaring the name NAME of a ++ function which is being defined. This macro is responsible for ++ outputting the label definition (perhaps using ++ `ASM_OUTPUT_LABEL'). The argument DECL is the `FUNCTION_DECL' ++ tree node representing the function. ++ ++ If this macro is not defined, then the function name is defined in ++ the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). ++ */ ++ ++ #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ ++ do { \ ++ if (!flag_inhibit_size_directive && !TARGET_AVA) \ ++ { \ ++ char label[256]; \ ++ static int labelno; \ ++ labelno++; \ ++ ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \ ++ ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \ ++ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ ++ assemble_name (FILE, (FNAME)); \ ++ fprintf (FILE, ","); \ ++ assemble_name (FILE, label); \ ++ fprintf (FILE, "-"); \ ++ assemble_name (FILE, (FNAME)); \ ++ putc ('\n', FILE); \ ++ } \ ++ } while (0) ++ /* ++ `ASM_DECLARE_FUNCTION_SIZE (STREAM, NAME, DECL)' ++ A C statement (sans semicolon) to output to the stdio stream ++ STREAM any text necessary for declaring the size of a function ++ which is being defined. The argument NAME is the name of the ++ function. The argument DECL is the `FUNCTION_DECL' tree node ++ representing the function. ++ ++ If this macro is not defined, then the function size is not ++ defined. ++ */ ++ ++ #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ ++ do { \ ++ if (!TARGET_AVA) \ ++ { \ ++ fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ ++ assemble_name (FILE, NAME); \ ++ putc (',', FILE); \ ++ fprintf (FILE, TYPE_OPERAND_FMT, "object"); \ ++ putc ('\n', FILE); \ ++ size_directive_output = 0; \ ++ if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \ ++ { \ ++ size_directive_output = 1; \ ++ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ ++ assemble_name (FILE, NAME); \ ++ fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ ++ } \ ++ } \ ++ ASM_OUTPUT_LABEL(FILE, NAME); \ ++ } while (0) ++ /* ++ `ASM_DECLARE_OBJECT_NAME (STREAM, NAME, DECL)' ++ A C statement (sans semicolon) to output to the stdio stream ++ STREAM any text necessary for declaring the name NAME of an ++ initialized variable which is being defined. This macro must ++ output the label definition (perhaps using `ASM_OUTPUT_LABEL'). ++ The argument DECL is the `VAR_DECL' tree node representing the ++ variable. ++ ++ If this macro is not defined, then the variable name is defined in ++ the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). ++ */ ++ ++ #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \ ++ do { \ ++ char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ ++ if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \ ++ && ! AT_END && TOP_LEVEL \ ++ && DECL_INITIAL (DECL) == error_mark_node \ ++ && !size_directive_output \ ++ && !TARGET_AVA) \ ++ { \ ++ size_directive_output = 1; \ ++ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ ++ assemble_name (FILE, name); \ ++ fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ ++ } \ ++ } while (0) ++ /* ++ `ASM_FINISH_DECLARE_OBJECT (STREAM, DECL, TOPLEVEL, ATEND)' ++ A C statement (sans semicolon) to finish up declaring a variable ++ name once the compiler has processed its initializer fully and ++ thus has had a chance to determine the size of an array when ++ controlled by an initializer. This is used on systems where it's ++ necessary to declare something about the size of the object. ++ ++ If you don't define this macro, that is equivalent to defining it ++ to do nothing. ++ */ ++ ++ ++ #define ESCAPES \ ++ "\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ ++ \0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ ++ \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\ ++ \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\ ++ \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ ++ \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ ++ \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ ++ \1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1" ++ /* A table of bytes codes used by the ASM_OUTPUT_ASCII and ++ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table ++ corresponds to a particular byte value [0..255]. For any ++ given byte value, if the value in the corresponding table ++ position is zero, the given character can be output directly. ++ If the table value is 1, the byte must be output as a \ooo ++ octal escape. If the tables value is anything else, then the ++ byte value should be output as a \ followed by the value ++ in the table. Note that we can use standard UN*X escape ++ sequences for many control characters, but we don't use ++ \a to represent BEL because some svr4 assemblers (e.g. on ++ the i386) don't know about that. Also, we don't use \v ++ since some versions of gas, such as 2.2 did not accept it. */ ++ ++ #define STRING_LIMIT ((unsigned) 64) ++ #define STRING_ASM_OP ".string" ++ /* Some svr4 assemblers have a limit on the number of characters which ++ can appear in the operand of a .string directive. If your assembler ++ has such a limitation, you should define STRING_LIMIT to reflect that ++ limit. Note that at least some svr4 assemblers have a limit on the ++ actual number of bytes in the double-quoted string, and that they ++ count each character in an escape sequence as one byte. Thus, an ++ escape sequence like \377 would count as four bytes. ++ ++ If your target assembler doesn't support the .string directive, you ++ should define this to zero. ++ */ ++ ++ extern int make_it_public; ++ #define ASM_GLOBALIZE_LABEL(STREAM, NAME) asm_globalize_label (STREAM, NAME) ++ /* ++ fprintf (STREAM, "\tpublic\t"); \ ++ assemble_name (STREAM, NAME); \ ++ fprintf (STREAM, "\n"); \ ++ A C statement (sans semicolon) to output to the stdio stream ++ STREAM some commands that will make the label NAME global; that ++ is, available for reference from other files. Use the expression ++ `assemble_name (STREAM, NAME)' to output the name itself; before ++ and after that, output the additional assembler syntax for making ++ that name global, and a newline. ++ */ ++ /* ++ `ASM_WEAKEN_LABEL' ++ A C statement (sans semicolon) to output to the stdio stream ++ STREAM some commands that will make the label NAME weak; that is, ++ available for reference from other files but only used if no other ++ definition is available. Use the expression `assemble_name ++ (STREAM, NAME)' to output the name itself; before and after that, ++ output the additional assembler syntax for making that name weak, ++ and a newline. ++ ++ If you don't define this macro, GNU CC will not support weak ++ symbols and you should not define the `SUPPORTS_WEAK' macro. ++ ++ `SUPPORTS_WEAK' ++ A C expression which evaluates to true if the target supports weak ++ symbols. ++ ++ If you don't define this macro, `defaults.h' provides a default ++ definition. If `ASM_WEAKEN_LABEL' is defined, the default ++ definition is `1'; otherwise, it is `0'. Define this macro if you ++ want to control weak symbol support with a compiler flag such as ++ `-melf'. ++ ++ `MAKE_DECL_ONE_ONLY' ++ A C statement (sans semicolon) to mark DECL to be emitted as a ++ public symbol such that extra copies in multiple translation units ++ will be discarded by the linker. Define this macro if your object ++ file format provides support for this concept, such as the `COMDAT' ++ section flags in the Microsoft Windows PE/COFF format, and this ++ support requires changes to DECL, such as putting it in a separate ++ section. ++ ++ `SUPPORTS_WEAK' ++ A C expression which evaluates to true if the target supports ++ one-only semantics. ++ ++ If you don't define this macro, `varasm.c' provides a default ++ definition. If `MAKE_DECL_ONE_ONLY' is defined, the default ++ definition is `1'; otherwise, it is `0'. Define this macro if you ++ want to control weak symbol support with a compiler flag, or if ++ setting the `DECL_ONE_ONLY' flag is enough to mark a declaration to ++ be emitted as one-only. ++ */ ++ ++ #define ASM_OUTPUT_EXTERNAL(STREAM, DECL, NAME) asm_output_external(STREAM, DECL, NAME) ++ /* ++ A C statement (sans semicolon) to output to the stdio stream ++ STREAM any text necessary for declaring the name of an external ++ symbol named NAME which is referenced in this compilation but not ++ defined. The value of DECL is the tree node for the declaration. ++ ++ This macro need not be defined if it does not need to output ++ anything. The GNU assembler and most Unix assemblers don't ++ require anything. ++ */ ++ ++ #define ASM_OUTPUT_EXTERNAL_LIBCALL(STREAM, SYMREF) asm_output_external_libcall(STREAM, SYMREF) ++ /* ++ A C statement (sans semicolon) to output on STREAM an assembler ++ pseudo-op to declare a library function name external. The name ++ of the library function is given by SYMREF, which has type `rtx' ++ and is a `symbol_ref'. ++ ++ This macro need not be defined if it does not need to output ++ anything. The GNU assembler and most Unix assemblers don't ++ require anything. ++ */ ++ ++ /* ++ #define ASM_OUTPUT_LABELREF(STREAM, NAME) ++ A C statement (sans semicolon) to output to the stdio stream ++ STREAM a reference in assembler syntax to a label named NAME. ++ This should add `_' to the front of the name, if that is customary ++ on your operating system, as it is in most Berkeley Unix systems. ++ This macro is used in `assemble_name'. ++ */ ++ ++ #define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) \ ++ fprintf(STREAM, AS_STR("%s%d:\n", \ ++ ".%s%d:\n"), PREFIX, NUM) ++ /* ++ A C statement to output to the stdio stream STREAM a label whose ++ name is made from the string PREFIX and the number NUM. ++ ++ It is absolutely essential that these labels be distinct from the ++ labels used for user-level functions and variables. Otherwise, ++ certain programs will have name conflicts with internal labels. ++ ++ It is desirable to exclude internal labels from the symbol table ++ of the object file. Most assemblers have a naming convention for ++ labels that should be excluded; on many systems, the letter `L' at ++ the beginning of a label has this effect. You should find out what ++ convention your system uses, and follow it. ++ ++ The usual definition of this macro is as follows: ++ ++ fprintf (STREAM, "L%s%d:\n", PREFIX, NUM) ++ */ ++ ++ #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \ ++ sprintf (STRING, AS_STR ("*%s%d", \ ++ "*.%s%d"), PREFIX, NUM) ++ /* ++ A C statement to store into the string STRING a label whose name ++ is made from the string PREFIX and the number NUM. ++ ++ This string, when output subsequently by `assemble_name', should ++ produce the output that `ASM_OUTPUT_INTERNAL_LABEL' would produce ++ with the same PREFIX and NUM. ++ ++ If the string begins with `*', then `assemble_name' will output ++ the rest of the string unchanged. It is often convenient for ++ `ASM_GENERATE_INTERNAL_LABEL' to use `*' in this way. If the ++ string doesn't start with `*', then `ASM_OUTPUT_LABELREF' gets to ++ output the string, and may change it. (Of course, ++ `ASM_OUTPUT_LABELREF' is also part of your machine description, so ++ you should know what it does on your machine.) ++ */ ++ #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ ++ ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \ ++ sprintf ((OUTPUT), AS_STR ("%s_I_%d","%s.%d"), (NAME), (LABELNO))) ++ ++ /* ++ A C expression to assign to OUTVAR (which is a variable of type ++ `char *') a newly allocated string made from the string NAME and ++ the number NUMBER, with some suitable punctuation added. Use ++ `alloca' to get space for the string. ++ ++ The string will be used as an argument to `ASM_OUTPUT_LABELREF' to ++ produce an assembler label for an internal static variable whose ++ name is NAME. Therefore, the string must be such as to result in ++ valid assembler code. The argument NUMBER is different each time ++ this macro is executed; it prevents conflicts between ++ similarly-named internal static variables in different scopes. ++ ++ Ideally this string should not be a valid C identifier, to prevent ++ any conflict with the user's own symbols. Most assemblers allow ++ periods or percent signs in assembler symbols; putting at least ++ one of these between the name and the number will suffice. ++ */ ++ /*XXX ++ #define ASM_OUTPUT_DEF(STREAM, NAME, VALUE) fprintf (STREAM, "equ\t%s = %d\n", NAME, VALUE) ++ A C statement to output to the stdio stream STREAM assembler code ++ which defines (equates) the symbol NAME to have the value VALUE. ++ ++ If SET_ASM_OP is defined, a default definition is provided which is ++ correct for most systems. ++ */ ++ ++ /* ++ `ASM_OUTPUT_WEAK_ALIAS (STREAM, NAME, VALUE)' ++ A C statement to output to the stdio stream STREAM assembler code ++ which defines (equates) the weak symbol NAME to have the value ++ VALUE. ++ ++ Define this macro if the target only supports weak aliases; define ++ ASM_OUTPUT_DEF instead if possible. ++ */ ++ /* ++ `OBJC_GEN_METHOD_LABEL (BUF, IS_INST, CLASS_NAME, CAT_NAME, SEL_NAME)' ++ Define this macro to override the default assembler names used for ++ Objective C methods. ++ ++ The default name is a unique method number followed by the name of ++ the class (e.g. `_1_Foo'). For methods in categories, the name of ++ the category is also included in the assembler name (e.g. ++ `_1_Foo_Bar'). ++ ++ These names are safe on most systems, but make debugging difficult ++ since the method's selector is not present in the name. ++ Therefore, particular systems define other ways of computing names. ++ ++ BUF is an expression of type `char *' which gives you a buffer in ++ which to store the name; its length is as long as CLASS_NAME, ++ CAT_NAME and SEL_NAME put together, plus 50 characters extra. ++ ++ The argument IS_INST specifies whether the method is an instance ++ method or a class method; CLASS_NAME is the name of the class; ++ CAT_NAME is the name of the category (or NULL if the method is not ++ in a category); and SEL_NAME is the name of the selector. ++ ++ On systems where the assembler can handle quoted names, you can ++ use this macro to provide more human-readable names. ++ */ ++ #define HAS_INIT_SECTION 1 ++ /* ++ `HAS_INIT_SECTION' ++ If defined, `main' will not call `__main' as described above. ++ This macro should be defined for systems that control the contents ++ of the init section on a symbol-by-symbol basis, such as OSF/1, ++ and should not be defined explicitly for systems that support ++ `INIT_SECTION_ASM_OP'. ++ */ ++ ++ #define REGISTER_NAMES { \ ++ "r0","r1","r2","r3","r4","r5","r6","r7", \ ++ "r8","r9","r10","r11","r12","r13","r14","r15", \ ++ "r16","r17","r18","r19","r20","r21","r22","r23", \ ++ "r24","r25","r26","r27","r28","r29","r30","r31", \ ++ "__SPL__","__SPH__","argL","argH"} ++ /* ++ A C initializer containing the assembler's names for the machine ++ registers, each one as a C string constant. This is what ++ translates register numbers in the compiler into assembler ++ language. ++ */ ++ /* ++ `ADDITIONAL_REGISTER_NAMES' ++ If defined, a C initializer for an array of structures containing ++ a name and a register number. This macro defines additional names ++ for hard registers, thus allowing the `asm' option in declarations ++ to refer to registers using alternate names. ++ */ ++ /* ++ `ASM_OUTPUT_OPCODE (STREAM, PTR)' ++ Define this macro if you are using an unusual assembler that ++ requires different names for the machine instructions. ++ ++ The definition is a C statement or statements which output an ++ assembler instruction opcode to the stdio stream STREAM. The ++ macro-operand PTR is a variable of type `char *' which points to ++ the opcode name in its "internal" form--the form that is written ++ in the machine description. The definition should output the ++ opcode name to STREAM, performing any translation you desire, and ++ increment the variable PTR to point at the end of the opcode so ++ that it will not be output twice. ++ ++ In fact, your macro definition may process less than the entire ++ opcode name, or more than the opcode name; but if you want to ++ process text that includes `%'-sequences to substitute operands, ++ you must take care of the substitution yourself. Just be sure to ++ increment PTR over whatever text should not be output normally. ++ ++ If you need to look at the operand values, they can be found as the ++ elements of `recog_operand'. ++ ++ If the macro definition does nothing, the instruction is output in ++ the usual way. ++ */ ++ ++ #define FINAL_PRESCAN_INSN(insn, operand, nop) final_prescan_insn (insn, operand,nop) ++ /* ++ `FINAL_PRESCAN_INSN (INSN, OPVEC, NOPERANDS)' ++ If defined, a C statement to be executed just prior to the output ++ of assembler code for INSN, to modify the extracted operands so ++ they will be output differently. ++ ++ Here the argument OPVEC is the vector containing the operands ++ extracted from INSN, and NOPERANDS is the number of elements of ++ the vector which contain meaningful data for this insn. The ++ contents of this vector are what will be used to convert the insn ++ template into assembler code, so you can change the assembler ++ output by changing the contents of the vector. ++ ++ This macro is useful when various assembler syntaxes share a single ++ file of instruction patterns; by defining this macro differently, ++ you can cause a large class of instructions to be output ++ differently (such as with rearranged operands). Naturally, ++ variations in assembler syntax affecting individual insn patterns ++ ought to be handled by writing conditional output routines in ++ those patterns. ++ ++ If this macro is not defined, it is equivalent to a null statement. ++ */ ++ /* ++ `FINAL_PRESCAN_LABEL' ++ If defined, `FINAL_PRESCAN_INSN' will be called on each ++ `CODE_LABEL'. In that case, OPVEC will be a null pointer and ++ NOPERANDS will be zero. ++ */ ++ #define PRINT_OPERAND(STREAM, X, CODE) print_operand (STREAM, X, CODE) ++ /* ++ A C compound statement to output to stdio stream STREAM the ++ assembler syntax for an instruction operand X. X is an RTL ++ expression. ++ ++ CODE is a value that can be used to specify one of several ways of ++ printing the operand. It is used when identical operands must be ++ printed differently depending on the context. CODE comes from the ++ `%' specification that was used to request printing of the ++ operand. If the specification was just `%DIGIT' then CODE is 0; ++ if the specification was `%LTR DIGIT' then CODE is the ASCII code ++ for LTR. ++ ++ If X is a register, this macro should print the register's name. ++ The names can be found in an array `reg_names' whose type is `char ++ *[]'. `reg_names' is initialized from `REGISTER_NAMES'. ++ ++ When the machine description has a specification `%PUNCT' (a `%' ++ followed by a punctuation character), this macro is called with a ++ null pointer for X and the punctuation character for CODE. ++ */ ++ ++ #define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '~') ++ /* ++ `PRINT_OPERAND_PUNCT_VALID_P (CODE)' ++ A C expression which evaluates to true if CODE is a valid ++ punctuation character for use in the `PRINT_OPERAND' macro. If ++ `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no ++ punctuation characters (except for the standard one, `%') are used ++ in this way. ++ */ ++ ++ #define PRINT_OPERAND_ADDRESS(STREAM, X) print_operand_address(STREAM, X) ++ /* XXX ++ A C compound statement to output to stdio stream STREAM the ++ assembler syntax for an instruction operand that is a memory ++ reference whose address is X. X is an RTL expression. ++ ++ On some machines, the syntax for a symbolic address depends on the ++ section that the address refers to. On these machines, define the ++ macro `ENCODE_SECTION_INFO' to store the information into the ++ `symbol_ref', and then check for it here. *Note Assembler ++ Format::. ++ */ ++ /* ++ `DBR_OUTPUT_SEQEND(FILE)' ++ A C statement, to be executed after all slot-filler instructions ++ have been output. If necessary, call `dbr_sequence_length' to ++ determine the number of slots filled in a sequence (zero if not ++ currently outputting a sequence), to decide how many no-ops to ++ output, or whatever. ++ ++ Don't define this macro if it has nothing to do, but it is helpful ++ in reading assembly output if the extent of the delay sequence is ++ made explicit (e.g. with white space). ++ ++ Note that output routines for instructions with delay slots must be ++ prepared to deal with not being output as part of a sequence (i.e. ++ when the scheduling pass is not run, or when no slot fillers could ++ be found.) The variable `final_sequence' is null when not ++ processing a sequence, otherwise it contains the `sequence' rtx ++ being output. ++ */ ++ ++ #define USER_LABEL_PREFIX "" ++ /* ++ `LOCAL_LABEL_PREFIX' ++ `REGISTER_PREFIX' ++ `IMMEDIATE_PREFIX' ++ If defined, C string expressions to be used for the `%R', `%L', ++ `%U', and `%I' options of `asm_fprintf' (see `final.c'). These ++ are useful when a single `md' file must support multiple assembler ++ formats. In that case, the various `tm.h' files can define these ++ macros differently. ++ */ ++ /* ++ `ASSEMBLER_DIALECT' ++ If your target supports multiple dialects of assembler language ++ (such as different opcodes), define this macro as a C expression ++ that gives the numeric index of the assembler language dialect to ++ use, with zero as the first variant. ++ ++ If this macro is defined, you may use constructs of the form ++ `{option0|option1|option2...}' in the output templates of patterns ++ (*note Output Template::.) or in the first argument of ++ `asm_fprintf'. This construct outputs `option0', `option1' or ++ `option2', etc., if the value of `ASSEMBLER_DIALECT' is zero, one ++ or two, etc. Any special characters within these strings retain ++ their usual meaning. ++ ++ If you do not define this macro, the characters `{', `|' and `}' ++ do not have any special meaning when used in templates or operands ++ to `asm_fprintf'. ++ ++ Define the macros `REGISTER_PREFIX', `LOCAL_LABEL_PREFIX', ++ `USER_LABEL_PREFIX' and `IMMEDIATE_PREFIX' if you can express the ++ variations in assemble language syntax with that mechanism. Define ++ `ASSEMBLER_DIALECT' and use the `{option0|option1}' syntax if the ++ syntax variant are larger and involve such things as different ++ opcodes or operand order. ++ */ ++ ++ #define ASM_OUTPUT_REG_PUSH(STREAM, REGNO) \ ++ { \ ++ if (REGNO > 31) \ ++ fatal("regno error in push"); \ ++ fprintf (STREAM, "\tpush\tr%d", REGNO); \ ++ } ++ /* ++ A C expression to output to STREAM some assembler code which will ++ push hard register number REGNO onto the stack. The code need not ++ be optimal, since this macro is used only when profiling. ++ */ ++ ++ #define ASM_OUTPUT_REG_POP(STREAM, REGNO) \ ++ { \ ++ if (REGNO > 31) \ ++ fatal("regno error in pop"); \ ++ fprintf (STREAM, "\tpop\tr%d", REGNO); \ ++ } ++ /* ++ A C expression to output to STREAM some assembler code which will ++ pop hard register number REGNO off of the stack. The code need ++ not be optimal, since this macro is used only when profiling. ++ */ ++ ++ /* ++ #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, VALUE, REL) ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) ++ A C statement to output to the stdio stream STREAM an assembler ++ pseudo-instruction to generate a difference between two labels. ++ VALUE and REL are the numbers of two internal labels. The ++ definitions of these labels are output using ++ `ASM_OUTPUT_INTERNAL_LABEL', and they must be printed in the same ++ way here. For example, ++ ++ fprintf (STREAM, "\t.word L%d-L%d\n", ++ VALUE, REL) ++ ++ You must provide this macro on machines where the addresses in a ++ dispatch table are relative to the table's own address. If ++ defined, GNU CC will also use this macro on all machines when ++ producing PIC. ++ */ ++ ++ #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \ ++ fprintf (STREAM, AS_STR ("\tdc.w (L%d)/2\n", "\t.word pm(.L%d)\n"), VALUE); ++ /* ++ This macro should be provided on machines where the addresses in a ++ dispatch table are absolute. ++ ++ The definition should be a C statement to output to the stdio ++ stream STREAM an assembler pseudo-instruction to generate a ++ reference to a label. VALUE is the number of an internal label ++ whose definition is output using `ASM_OUTPUT_INTERNAL_LABEL'. For ++ example, ++ ++ fprintf (STREAM, "\t.word L%d\n", VALUE) ++ */ ++ ++ #define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) \ ++ progmem_section (), ASM_OUTPUT_INTERNAL_LABEL (STREAM, PREFIX, NUM) ++ ++ /* ++ `ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)' ++ Define this if the label before a jump-table needs to be output ++ specially. The first three arguments are the same as for ++ `ASM_OUTPUT_INTERNAL_LABEL'; the fourth argument is the jump-table ++ which follows (a `jump_insn' containing an `addr_vec' or ++ `addr_diff_vec'). ++ ++ This feature is used on system V to output a `swbeg' statement for ++ the table. ++ ++ If this macro is not defined, these labels are output with ++ `ASM_OUTPUT_INTERNAL_LABEL'. ++ */ ++ /* ++ `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)' ++ Define this if something special must be output at the end of a ++ jump-table. The definition should be a C statement to be executed ++ after the assembler code for the table is written. It should write ++ the appropriate code to stdio stream STREAM. The argument TABLE ++ is the jump-table insn, and NUM is the label-number of the ++ preceding label. ++ ++ If this macro is not defined, nothing special is output at the end ++ of the jump-table. ++ */ ++ ++ /* ++ `ASM_OUTPUT_ALIGN_CODE (FILE)' ++ A C expression to output text to align the location counter in the ++ way that is desirable at a point in the code that is reached only ++ by jumping. ++ ++ This macro need not be defined if you don't want any special ++ alignment to be done at such a time. Most machine descriptions do ++ not currently define the macro. ++ */ ++ /* ++ `ASM_OUTPUT_LOOP_ALIGN (FILE)' ++ A C expression to output text to align the location counter in the ++ way that is desirable at the beginning of a loop. ++ ++ This macro need not be defined if you don't want any special ++ alignment to be done at such a time. Most machine descriptions do ++ not currently define the macro. ++ */ ++ ++ #define ASM_OUTPUT_SKIP(STREAM, n) \ ++ fprintf (STREAM, AS_STR ("\tds.b %d\n", \ ++ "\t.skip %d,0\n"), n) ++ /* ++ A C statement to output to the stdio stream STREAM an assembler ++ instruction to advance the location counter by NBYTES bytes. ++ Those bytes should be zero when loaded. NBYTES will be a C ++ expression of type `int'. ++ */ ++ ++ /* ++ #define ASM_NO_SKIP_IN_TEXT ++ Define this macro if `ASM_OUTPUT_SKIP' should not be used in the ++ text section because it fails put zeros in the bytes that are ++ skipped. This is true on many Unix systems, where the pseudo-op ++ to skip bytes produces no-op instructions rather than zeros when ++ used in the text section. ++ */ ++ ++ #define ASM_OUTPUT_ALIGN(STREAM, POWER) ++ /*XXX ++ A C statement to output to the stdio stream STREAM an assembler ++ command to advance the location counter to a multiple of 2 to the ++ POWER bytes. POWER will be a C expression of type `int'. ++ */ ++ ++ /* ++ `PREDICATE_CODES' ++ Define this if you have defined special-purpose predicates in the ++ file `MACHINE.c'. This macro is called within an initializer of an ++ array of structures. The first field in the structure is the name ++ of a predicate and the second field is an array of rtl codes. For ++ each predicate, list all rtl codes that can be in expressions ++ matched by the predicate. The list should have a trailing comma. ++ Here is an example of two entries in the list for a typical RISC ++ machine: ++ ++ #define PREDICATE_CODES \ ++ {"gen_reg_rtx_operand", {SUBREG, REG}}, \ ++ {"reg_or_short_cint_operand", {SUBREG, REG, CONST_INT}}, ++ ++ Defining this macro does not affect the generated code (however, ++ incorrect definitions that omit an rtl code that may be matched by ++ the predicate can cause the compiler to malfunction). Instead, it ++ allows the table built by `genrecog' to be more compact and ++ efficient, thus speeding up the compiler. The most important ++ predicates to include in the list specified by this macro are ++ thoses used in the most insn patterns. ++ */ ++ #define CASE_VECTOR_MODE HImode ++ /* ++ An alias for a machine mode name. This is the machine mode that ++ elements of a jump-table should have. ++ */ ++ /* ++ #define CASE_VECTOR_PC_RELATIVE ++ Define this macro if jump-tables should contain relative addresses. ++ */ ++ /* ++ `CASE_DROPS_THROUGH' ++ Define this if control falls through a `case' insn when the index ++ value is out of range. This means the specified default-label is ++ actually ignored by the `case' insn proper. ++ */ ++ ++ #define CASE_VALUES_THRESHOLD 17 ++ /* ++ `CASE_VALUES_THRESHOLD' ++ Define this to be the smallest number of different values for ++ which it is best to use a jump-table instead of a tree of ++ conditional branches. The default is four for machines with a ++ `casesi' instruction and five otherwise. This is best for most ++ machines. ++ */ ++ #undef WORD_REGISTER_OPERATIONS ++ /* ++ Define this macro if operations between registers with integral ++ mode smaller than a word are always performed on the entire ++ register. Most RISC machines have this property and most CISC ++ machines do not. ++ */ ++ /* ++ `LOAD_EXTEND_OP (MODE)' ++ Define this macro to be a C expression indicating when insns that ++ read memory in MODE, an integral mode narrower than a word, set the ++ bits outside of MODE to be either the sign-extension or the ++ zero-extension of the data read. Return `SIGN_EXTEND' for values ++ of MODE for which the insn sign-extends, `ZERO_EXTEND' for which ++ it zero-extends, and `NIL' for other modes. ++ ++ This macro is not called with MODE non-integral or with a width ++ greater than or equal to `BITS_PER_WORD', so you may return any ++ value in this case. Do not define this macro if it would always ++ return `NIL'. On machines where this macro is defined, you will ++ normally define it as the constant `SIGN_EXTEND' or `ZERO_EXTEND'. ++ */ ++ /* ++ `SHORT_IMMEDIATES_SIGN_EXTEND' ++ Define this macro if loading short immediate values into registers ++ sign extends. ++ */ ++ /* ++ `IMPLICIT_FIX_EXPR' ++ An alias for a tree code that should be used by default for ++ conversion of floating point values to fixed point. Normally, ++ `FIX_ROUND_EXPR' is used. ++ */ ++ /* ++ `FIXUNS_TRUNC_LIKE_FIX_TRUNC' ++ Define this macro if the same instructions that convert a floating ++ point number to a signed fixed point number also convert validly ++ to an unsigned one. ++ */ ++ ++ #define EASY_DIV_EXPR TRUNC_DIV_EXPR ++ /* ++ An alias for a tree code that is the easiest kind of division to ++ compile code for in the general case. It may be `TRUNC_DIV_EXPR', ++ `FLOOR_DIV_EXPR', `CEIL_DIV_EXPR' or `ROUND_DIV_EXPR'. These four ++ division operators differ in how they round the result to an ++ integer. `EASY_DIV_EXPR' is used when it is permissible to use ++ any of those kinds of division and the choice should be made on ++ the basis of efficiency. ++ */ ++ ++ #define MOVE_MAX 4 ++ /* ++ The maximum number of bytes that a single instruction can move ++ quickly between memory and registers or between two memory ++ locations. ++ */ ++ /* ++ `MAX_MOVE_MAX' ++ The maximum number of bytes that a single instruction can move ++ quickly between memory and registers or between two memory ++ locations. If this is undefined, the default is `MOVE_MAX'. ++ Otherwise, it is the constant value that is the largest value that ++ `MOVE_MAX' can have at run-time. ++ */ ++ /* ++ `SHIFT_COUNT_TRUNCATED' ++ A C expression that is nonzero if on this machine the number of ++ bits actually used for the count of a shift operation is equal to ++ the number of bits needed to represent the size of the object ++ being shifted. When this macro is non-zero, the compiler will ++ assume that it is safe to omit a sign-extend, zero-extend, and ++ certain bitwise `and' instructions that truncates the count of a ++ shift operation. On machines that have instructions that act on ++ bitfields at variable positions, which may include `bit test' ++ instructions, a nonzero `SHIFT_COUNT_TRUNCATED' also enables ++ deletion of truncations of the values that serve as arguments to ++ bitfield instructions. ++ ++ If both types of instructions truncate the count (for shifts) and ++ position (for bitfield operations), or if no variable-position ++ bitfield instructions exist, you should define this macro. ++ ++ However, on some machines, such as the 80386 and the 680x0, ++ truncation only applies to shift operations and not the (real or ++ pretended) bitfield operations. Define `SHIFT_COUNT_TRUNCATED' to ++ be zero on such machines. Instead, add patterns to the `md' file ++ that include the implied truncation of the shift instructions. ++ ++ You need not define this macro if it would always have the value ++ of zero. ++ */ ++ ++ #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 ++ /* ++ A C expression which is nonzero if on this machine it is safe to ++ "convert" an integer of INPREC bits to one of OUTPREC bits (where ++ OUTPREC is smaller than INPREC) by merely operating on it as if it ++ had only OUTPREC bits. ++ ++ On many machines, this expression can be 1. ++ ++ When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for ++ modes for which `MODES_TIEABLE_P' is 0, suboptimal code can result. ++ If this is the case, making `TRULY_NOOP_TRUNCATION' return 0 in ++ such cases may improve things. ++ */ ++ ++ /* ++ #define STORE_FLAG_VALUE 1 ++ A C expression describing the value returned by a comparison ++ operator with an integral mode and stored by a store-flag ++ instruction (`sCOND') when the condition is true. This ++ description must apply to *all* the `sCOND' patterns and all the ++ comparison operators whose results have a `MODE_INT' mode. ++ ++ A value of 1 or -1 means that the instruction implementing the ++ comparison operator returns exactly 1 or -1 when the comparison is ++ true and 0 when the comparison is false. Otherwise, the value ++ indicates which bits of the result are guaranteed to be 1 when the ++ comparison is true. This value is interpreted in the mode of the ++ comparison operation, which is given by the mode of the first ++ operand in the `sCOND' pattern. Either the low bit or the sign ++ bit of `STORE_FLAG_VALUE' be on. Presently, only those bits are ++ used by the compiler. ++ ++ If `STORE_FLAG_VALUE' is neither 1 or -1, the compiler will ++ generate code that depends only on the specified bits. It can also ++ replace comparison operators with equivalent operations if they ++ cause the required bits to be set, even if the remaining bits are ++ undefined. For example, on a machine whose comparison operators ++ return an `SImode' value and where `STORE_FLAG_VALUE' is defined as ++ `0x80000000', saying that just the sign bit is relevant, the ++ expression ++ ++ (ne:SI (and:SI X (const_int POWER-OF-2)) (const_int 0)) ++ ++ can be converted to ++ ++ (ashift:SI X (const_int N)) ++ ++ where N is the appropriate shift count to move the bit being ++ tested into the sign bit. ++ ++ There is no way to describe a machine that always sets the ++ low-order bit for a true value, but does not guarantee the value ++ of any other bits, but we do not know of any machine that has such ++ an instruction. If you are trying to port GNU CC to such a ++ machine, include an instruction to perform a logical-and of the ++ result with 1 in the pattern for the comparison operators and let ++ us know (*note How to Report Bugs: Bug Reporting.). ++ ++ Often, a machine will have multiple instructions that obtain a ++ value from a comparison (or the condition codes). Here are rules ++ to guide the choice of value for `STORE_FLAG_VALUE', and hence the ++ instructions to be used: ++ ++ * Use the shortest sequence that yields a valid definition for ++ `STORE_FLAG_VALUE'. It is more efficient for the compiler to ++ "normalize" the value (convert it to, e.g., 1 or 0) than for ++ the comparison operators to do so because there may be ++ opportunities to combine the normalization with other ++ operations. ++ ++ * For equal-length sequences, use a value of 1 or -1, with -1 ++ being slightly preferred on machines with expensive jumps and ++ 1 preferred on other machines. ++ ++ * As a second choice, choose a value of `0x80000001' if ++ instructions exist that set both the sign and low-order bits ++ but do not define the others. ++ ++ * Otherwise, use a value of `0x80000000'. ++ ++ Many machines can produce both the value chosen for ++ `STORE_FLAG_VALUE' and its negation in the same number of ++ instructions. On those machines, you should also define a pattern ++ for those cases, e.g., one matching ++ ++ (set A (neg:M (ne:M B C))) ++ ++ Some machines can also perform `and' or `plus' operations on ++ condition code values with less instructions than the corresponding ++ `sCOND' insn followed by `and' or `plus'. On those machines, ++ define the appropriate patterns. Use the names `incscc' and ++ `decscc', respectively, for the patterns which perform `plus' or ++ `minus' operations on condition code values. See `rs6000.md' for ++ some examples. The GNU Superoptizer can be used to find such ++ instruction sequences on other machines. ++ ++ You need not define `STORE_FLAG_VALUE' if the machine has no ++ store-flag instructions. ++ */ ++ /* ++ `FLOAT_STORE_FLAG_VALUE' ++ A C expression that gives a non-zero floating point value that is ++ returned when comparison operators with floating-point results are ++ true. Define this macro on machine that have comparison ++ operations that return floating-point values. If there are no ++ such operations, do not define this macro. ++ */ ++ #define Pmode HImode ++ /* ++ An alias for the machine mode for pointers. On most machines, ++ define this to be the integer mode corresponding to the width of a ++ hardware pointer; `SImode' on 32-bit machine or `DImode' on 64-bit ++ machines. On some machines you must define this to be one of the ++ partial integer modes, such as `PSImode'. ++ ++ The width of `Pmode' must be at least as large as the value of ++ `POINTER_SIZE'. If it is not equal, you must define the macro ++ `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to ++ `Pmode'. ++ */ ++ ++ #define FUNCTION_MODE HImode ++ /* ++ An alias for the machine mode used for memory references to ++ functions being called, in `call' RTL expressions. On most ++ machines this should be `QImode'. ++ */ ++ /* 1 3 */ ++ #define INTEGRATE_THRESHOLD(DECL) (1 + (3 * list_length (DECL_ARGUMENTS (DECL)) / 2)) ++ ++ /* ++ `INTEGRATE_THRESHOLD (DECL)' ++ A C expression for the maximum number of instructions above which ++ the function DECL should not be inlined. DECL is a ++ `FUNCTION_DECL' node. ++ ++ The default definition of this macro is 64 plus 8 times the number ++ of arguments that the function accepts. Some people think a larger ++ threshold should be used on RISC machines. ++ */ ++ /* ++ `SCCS_DIRECTIVE' ++ Define this if the preprocessor should ignore `#sccs' directives ++ and print no error message. ++ */ ++ /* ++ `NO_IMPLICIT_EXTERN_C' ++ Define this macro if the system header files support C++ as well ++ as C. This macro inhibits the usual method of using system header ++ files in C++, which is to pretend that the file's contents are ++ enclosed in `extern "C" {...}'. ++ */ ++ /* ++ `HANDLE_PRAGMA (STREAM, NODE)' ++ Define this macro if you want to implement any pragmas. If ++ defined, it is a C expression whose value is 1 if the pragma was ++ handled by the function. The argument STREAM is the stdio input ++ stream from which the source text can be read. NODE is the tree ++ node for the identifier after the `#pragma'. ++ ++ It is generally a bad idea to implement new uses of `#pragma'. The ++ only reason to define this macro is for compatibility with other ++ compilers that do support `#pragma' for the sake of any user ++ programs which already use it. ++ */ ++ ++ #define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \ ++ valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS) ++ /* ++ `VALID_MACHINE_DECL_ATTRIBUTE (DECL, ATTRIBUTES, IDENTIFIER, ARGS)' ++ If defined, a C expression whose value is nonzero if IDENTIFIER ++ with arguments ARGS is a valid machine specific attribute for DECL. ++ The attributes in ATTRIBUTES have previously been assigned to DECL. ++ */ ++ ++ #define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) \ ++ valid_machine_type_attribute(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) ++ /* ++ `VALID_MACHINE_TYPE_ATTRIBUTE (TYPE, ATTRIBUTES, IDENTIFIER, ARGS)' ++ If defined, a C expression whose value is nonzero if IDENTIFIER ++ with arguments ARGS is a valid machine specific attribute for TYPE. ++ The attributes in ATTRIBUTES have previously been assigned to TYPE. ++ */ ++ /* ++ `COMP_TYPE_ATTRIBUTES (TYPE1, TYPE2)' ++ If defined, a C expression whose value is zero if the attributes on ++ TYPE1 and TYPE2 are incompatible, one if they are compatible, and ++ two if they are nearly compatible (which causes a warning to be ++ generated). ++ ++ `SET_DEFAULT_TYPE_ATTRIBUTES (TYPE)' ++ If defined, a C statement that assigns default attributes to newly ++ defined TYPE. ++ */ ++ ++ #define DOLLARS_IN_IDENTIFIERS 0 ++ /* ++ Define this macro to control use of the character `$' in identifier ++ names. 0 means `$' is not allowed by default; 1 means it is ++ allowed. 1 is the default; there is no need to define this macro ++ in that case. This macro controls the compiler proper; it does ++ not affect the preprocessor. ++ */ ++ ++ #define NO_DOLLAR_IN_LABEL 1 ++ /* ++ Define this macro if the assembler does not accept the character ++ `$' in label names. By default constructors and destructors in ++ G++ have `$' in the identifiers. If this macro is defined, `.' is ++ used instead. ++ */ ++ ++ #define NO_DOT_IN_LABEL !!TARGET_AVA ++ /* ++ Define this macro if the assembler does not accept the character ++ `.' in label names. By default constructors and destructors in G++ ++ have names that use `.'. If this macro is defined, these names ++ are rewritten to avoid `.'. ++ */ ++ /* ++ `DEFAULT_MAIN_RETURN' ++ Define this macro if the target system expects every program's ++ `main' function to return a standard "success" value by default ++ (if no other value is explicitly returned). ++ ++ The definition should be a C statement (sans semicolon) to ++ generate the appropriate rtl instructions. It is used only when ++ compiling the end of `main'. ++ */ ++ /* ++ `HAVE_ATEXIT' ++ Define this if the target system supports the function `atexit' ++ from the ANSI C standard. If this is not defined, and ++ `INIT_SECTION_ASM_OP' is not defined, a default `exit' function ++ will be provided to support C++. ++ */ ++ /* ++ `EXIT_BODY' ++ Define this if your `exit' function needs to do something besides ++ calling an external function `_cleanup' before terminating with ++ `_exit'. The `EXIT_BODY' macro is only needed if netiher ++ `HAVE_ATEXIT' nor `INIT_SECTION_ASM_OP' are defined. ++ */ ++ /* ++ `INSN_SETS_ARE_DELAYED (INSN)' ++ Define this macro as a C expression that is nonzero if it is safe ++ for the delay slot scheduler to place instructions in the delay ++ slot of INSN, even if they appear to use a resource set or ++ clobbered in INSN. INSN is always a `jump_insn' or an `insn'; GNU ++ CC knows that every `call_insn' has this behavior. On machines ++ where some `insn' or `jump_insn' is really a function call and ++ hence has this behavior, you should define this macro. ++ ++ You need not define this macro if it would always return zero. ++ ++ `INSN_REFERENCES_ARE_DELAYED (INSN)' ++ Define this macro as a C expression that is nonzero if it is safe ++ for the delay slot scheduler to place instructions in the delay ++ slot of INSN, even if they appear to set or clobber a resource ++ referenced in INSN. INSN is always a `jump_insn' or an `insn'. ++ On machines where some `insn' or `jump_insn' is really a function ++ call and its operands are registers whose use is actually in the ++ subroutine it calls, you should define this macro. Doing so ++ allows the delay slot scheduler to move instructions which copy ++ arguments into the argument registers into the delay slot of INSN. ++ ++ You need not define this macro if it would always return zero. ++ */ ++ ++ #define MACHINE_DEPENDENT_REORG(INSN) machine_dependent_reorg (INSN) ++ /* ++ In rare cases, correct code generation requires extra machine ++ dependent processing between the second jump optimization pass and ++ delayed branch scheduling. On those machines, define this macro ++ as a C statement to act on the code starting at INSN. ++ */ ++ /* ++ `MULTIPLE_SYMBOL_SPACES' ++ Define this macro if in some cases global symbols from one ++ translation unit may not be bound to undefined symbols in another ++ translation unit without user intervention. For instance, under ++ Microsoft Windows symbols must be explicitly imported from shared ++ libraries (DLLs). ++ */ ++ ++ #define GIV_SORT_CRITERION(X, Y) \ ++ if (GET_CODE ((X)->add_val) == CONST_INT \ ++ && GET_CODE ((Y)->add_val) == CONST_INT) \ ++ return INTVAL ((X)->add_val) - INTVAL ((Y)->add_val); ++ ++ /* ++ `GIV_SORT_CRITERION(GIV1, GIV2)' ++ In some cases, the strength reduction optimization pass can ++ produce better code if this is defined. This macro controls the ++ order that induction variables are combined. This macro is ++ particularly useful if the target has limited addressing modes. ++ For instance, the SH target has only positive offsets in ++ addresses. Thus sorting to put the smallest address first allows ++ the most combinations to be found. ++ */ ++ /* ++ `ISSUE_RATE' ++ A C expression that returns how many instructions can be issued at ++ the same time if the machine is a superscalar machine. This is ++ only used by the `Haifa' scheduler, and not the traditional ++ scheduler. ++ */ ++ ++ ++ ++ /* Define results of standard character escape sequences. */ ++ #define TARGET_BELL 007 ++ #define TARGET_BS 010 ++ #define TARGET_TAB 011 ++ #define TARGET_NEWLINE 012 ++ #define TARGET_VT 013 ++ #define TARGET_FF 014 ++ #define TARGET_CR 015 ++ ++ ++ ++ /* Output assembler code for a block containing the constant parts ++ of a trampoline, leaving space for the variable parts. ++ ++ H8/300 ++ vvvv context ++ 1 0000 7900xxxx mov.w #0x1234,r3 ++ 2 0004 5A00xxxx jmp @0x1234 ++ ^^^^ function ++ ++ H8/300H ++ vvvvvvvv context ++ 2 0000 7A00xxxxxxxx mov.l #0x12345678,er3 ++ 3 0006 5Axxxxxx jmp @0x123456 ++ ^^^^^^ function ++ */ ++ ++ #define TRAMPOLINE_TEMPLATE(FILE) fatal ("Trampolines not supported\n") ++ ++ /* Length in units of the trampoline for entering a nested function. */ ++ ++ #define TRAMPOLINE_SIZE 4 ++ ++ /* Emit RTL insns to initialize the variable parts of a trampoline. ++ FNADDR is an RTX for the address of the function's pure code. ++ CXT is an RTX for the static chain value for the function. */ ++ ++ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ ++ { \ ++ emit_move_insn (gen_rtx (MEM, HImode, plus_constant ((TRAMP), 2)), CXT); \ ++ emit_move_insn (gen_rtx (MEM, HImode, plus_constant ((TRAMP), 6)), FNADDR); \ ++ } ++ /* Store in cc_status the expressions ++ that the condition codes will describe ++ after execution of an instruction whose pattern is EXP. ++ Do not alter them if the instruction would not alter the cc's. */ ++ ++ #define NOTICE_UPDATE_CC(EXP, INSN) notice_update_cc(EXP, INSN) ++ ++ /* The add insns don't set overflow in a usable way. */ ++ #define CC_OVERFLOW_UNUSABLE 01000 ++ /* The mov,and,or,xor insns don't set carry. That's ok though as the ++ Z bit is all we need when doing unsigned comparisons on the result of ++ these insns (since they're always with 0). However, conditions.h has ++ CC_NO_OVERFLOW defined for this purpose. Rename it to something more ++ understandable. */ ++ #define CC_NO_CARRY CC_NO_OVERFLOW ++ ++ ++ /* Output assembler code to FILE to increment profiler label # LABELNO ++ for profiling a function entry. */ ++ ++ #define FUNCTION_PROFILER(FILE, LABELNO) \ ++ fprintf (FILE, "/* profiler %d */", (LABELNO)) ++ ++ ++ /* Define the information needed to generate branch and scc insns. This is ++ stored from the compare operation. Note that we can't use "rtx" here ++ since it hasn't been defined! */ ++ extern struct rtx_def *avr_compare_op0, *avr_compare_op1; ++ extern struct rtx_def * (*avr_compare_gen)(); ++ extern int avr_compare_fp_p; ++ ++ ++ /* ++ #define EXTRA_CC_MODES PMmode ++ A list of names to be used for additional modes for condition code ++ values in registers (*note Jump Patterns::.). These names are ++ added to `enum machine_mode' and all have class `MODE_CC'. By ++ convention, they should start with `CC' and end with `mode'. ++ ++ You should only define this macro if your machine does not use ++ `cc0' and only if additional modes are required. ++ */ ++ /* ++ #define EXTRA_CC_NAMES "PMmode" ++ A list of C strings giving the names for the modes listed in ++ `EXTRA_CC_MODES'. For example, the Sparc defines this macro and ++ `EXTRA_CC_MODES' as ++ ++ #define EXTRA_CC_MODES CC_NOOVmode, CCFPmode, CCFPEmode ++ #define EXTRA_CC_NAMES "CC_NOOV", "CCFP", "CCFPE" ++ ++ This macro is not required if `EXTRA_CC_MODES' is not defined. ++ */ ++ ++ /* ++ #define SELECT_CC_MODE(OP, X, Y) CCmode ++ Returns a mode from class `MODE_CC' to be used when comparison ++ operation code OP is applied to rtx X and Y. For example, on the ++ Sparc, `SELECT_CC_MODE' is defined as (see *note Jump Patterns::. ++ for a description of the reason for this definition) ++ ++ #define SELECT_CC_MODE(OP,X,Y) \ ++ (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ ++ ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode) \ ++ : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS \ ++ || GET_CODE (X) == NEG) \ ++ ? CC_NOOVmode : CCmode)) ++ ++ You need not define this macro if `EXTRA_CC_MODES' is not defined. ++ */ ++ ++ /* ++ #define CANONICALIZE_COMPARISON(CODE, OP0, OP1) (CODE) = canonicalize_comparison(CODE,&(OP0), &(OP1)) ++ One some machines not all possible comparisons are defined, but ++ you can convert an invalid comparison into a valid one. For ++ example, the Alpha does not have a `GT' comparison, but you can ++ use an `LT' comparison instead and swap the order of the operands. ++ ++ On such machines, define this macro to be a C statement to do any ++ required conversions. CODE is the initial comparison code and OP0 ++ and OP1 are the left and right operands of the comparison, ++ respectively. You should modify CODE, OP0, and OP1 as required. ++ ++ GNU CC will not assume that the comparison resulting from this ++ macro is valid but will see if the resulting insn matches a ++ pattern in the `md' file. ++ ++ You need not define this macro if it would never change the ++ comparison code or operands. ++ */ ++ ++ /* ++ `FIRST_INSN_ADDRESS' ++ When the `length' insn attribute is used, this macro specifies the ++ value to be assigned to the address of the first insn in a ++ function. If not specified, 0 is used. ++ */ ++ #define ADJUST_INSN_LENGTH(INSN, LENGTH) (LENGTH =\ ++ adjust_insn_length (INSN, LENGTH)) ++ /* ++ If defined, modifies the length assigned to instruction INSN as a ++ function of the context in which it is used. LENGTH is an lvalue ++ that contains the initially computed length of the insn and should ++ be updated with the correct length of the insn. If updating is ++ required, INSN must not be a varying-length insn. ++ ++ This macro will normally not be required. A case in which it is ++ required is the ROMP. On this machine, the size of an `addr_vec' ++ insn must be increased by two to compensate for the fact that ++ alignment may be required. ++ */ ++ ++ #define TARGET_MEM_FUNCTIONS ++ /* ++ `TARGET_MEM_FUNCTIONS' ++ Define this macro if GNU CC should generate calls to the System V ++ (and ANSI C) library functions `memcpy' and `memset' rather than ++ the BSD functions `bcopy' and `bzero'. ++ */ ++ ++ /* ++ `SWITCH_TAKES_ARG (CHAR)' ++ A C expression which determines whether the option `-CHAR' takes ++ arguments. The value should be the number of arguments that ++ option takes-zero, for many options. ++ ++ By default, this macro is defined as `DEFAULT_SWITCH_TAKES_ARG', ++ which handles the standard options properly. You need not define ++ `SWITCH_TAKES_ARG' unless you wish to add additional options which ++ take arguments. Any redefinition should call ++ `DEFAULT_SWITCH_TAKES_ARG' and then check for additional options. ++ ++ `WORD_SWITCH_TAKES_ARG (NAME)' ++ A C expression which determines whether the option `-NAME' takes ++ arguments. The value should be the number of arguments that ++ option takes-zero, for many options. This macro rather than ++ `SWITCH_TAKES_ARG' is used for multi-character option names. ++ ++ By default, this macro is defined as ++ `DEFAULT_WORD_SWITCH_TAKES_ARG', which handles the standard options ++ properly. You need not define `WORD_SWITCH_TAKES_ARG' unless you ++ wish to add additional options which take arguments. Any ++ redefinition should call `DEFAULT_WORD_SWITCH_TAKES_ARG' and then ++ check for additional options. ++ ++ `SWITCH_CURTAILS_COMPILATION (CHAR)' ++ A C expression which determines whether the option `-CHAR' stops ++ compilation before the generation of an executable. The value is ++ boolean, non-zero if the option does stop an executable from being ++ generated, zero otherwise. ++ ++ By default, this macro is defined as ++ `DEFAULT_SWITCH_CURTAILS_COMPILATION', which handles the standard ++ options properly. You need not define ++ `SWITCH_CURTAILS_COMPILATION' unless you wish to add additional ++ options which affect the generation of an executable. Any ++ redefinition should call `DEFAULT_SWITCH_CURTAILS_COMPILATION' and ++ then check for additional options. ++ ++ `SWITCHES_NEED_SPACES' ++ A string-valued C expression which enumerates the options for which ++ the linker needs a space between the option and its argument. ++ ++ If this macro is not defined, the default value is `""'. ++ */ ++ ++ #define CPP_SPEC "\ ++ %{!mmcu=*:-DAVR_AT90S8515} \ ++ %{mmcu=at90s2313:-DAVR_AT90S2313} \ ++ %{mmcu=at90s2323:-DAVR_AT90S2323} \ ++ %{mmcu=at90s2333:-DAVR_AT90S2333} \ ++ %{mmcu=at90s2343:-DAVR_AT90S2343} \ ++ %{mmcu=attiny22:-DAVR_ATtiny22} \ ++ %{mmcu=at90s4433:-DAVR_AT90S4433} \ ++ %{mmcu=at90s4414:-DAVR_AT90S4414} \ ++ %{mmcu=at90s4434:-DAVR_AT90S4434} \ ++ %{mmcu=at90s8515:-DAVR_AT90S8515} \ ++ %{mmcu=at90s8535:-DAVR_AT90S8535} \ ++ %{mmcu=atmega603:-DAVR_ATmega603} \ ++ %{mmcu=atmega103:-DAVR_ATmega103} \ ++ %{mint8:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long -D__INT_MAX__=127} \ ++ %{!mint*:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int -D__INT_MAX__=32767} \ ++ %{posix:-D_POSIX_SOURCE}" ++ /* ++ A C string constant that tells the GNU CC driver program options to ++ pass to CPP. It can also specify how to translate options you ++ give to GNU CC into options for GNU CC to pass to the CPP. ++ ++ Do not define this macro if it does not need to do anything. ++ */ ++ ++ #define NO_BUILTIN_SIZE_TYPE ++ /* ++ If this macro is defined, the preprocessor will not define the ++ builtin macro `__SIZE_TYPE__'. The macro `__SIZE_TYPE__' must ++ then be defined by `CPP_SPEC' instead. ++ ++ This should be defined if `SIZE_TYPE' depends on target dependent ++ flags which are not accessible to the preprocessor. Otherwise, it ++ should not be defined. ++ */ ++ ++ #define NO_BUILTIN_PTRDIFF_TYPE ++ /* ++ If this macro is defined, the preprocessor will not define the ++ builtin macro `__PTRDIFF_TYPE__'. The macro `__PTRDIFF_TYPE__' ++ must then be defined by `CPP_SPEC' instead. ++ ++ This should be defined if `PTRDIFF_TYPE' depends on target ++ dependent flags which are not accessible to the preprocessor. ++ Otherwise, it should not be defined. ++ ++ `SIGNED_CHAR_SPEC' ++ A C string constant that tells the GNU CC driver program options to ++ pass to CPP. By default, this macro is defined to pass the option ++ `-D__CHAR_UNSIGNED__' to CPP if `char' will be treated as ++ `unsigned char' by `cc1'. ++ ++ Do not define this macro unless you need to override the default ++ definition. ++ */ ++ ++ #define CC1_SPEC "%{!mmcu*:-mmcu=at90s8515} %{profile:-p}" ++ /* ++ A C string constant that tells the GNU CC driver program options to ++ pass to `cc1'. It can also specify how to translate options you ++ give to GNU CC into options for GNU CC to pass to the `cc1'. ++ ++ Do not define this macro if it does not need to do anything. ++ */ ++ ++ /* ++ `CC1PLUS_SPEC' ++ A C string constant that tells the GNU CC driver program options to ++ pass to `cc1plus'. It can also specify how to translate options ++ you give to GNU CC into options for GNU CC to pass to the ++ `cc1plus'. ++ ++ Do not define this macro if it does not need to do anything. ++ */ ++ ++ #define ASM_SPEC "%{mava:-favr_noendianbug}" ++ /* ++ A C string constant that tells the GNU CC driver program options to ++ pass to the assembler. It can also specify how to translate ++ options you give to GNU CC into options for GNU CC to pass to the ++ assembler. See the file `sun3.h' for an example of this. ++ ++ Do not define this macro if it does not need to do anything. ++ */ ++ ++ #define ASM_FINAL_SPEC "" ++ /* ++ A C string constant that tells the GNU CC driver program how to ++ run any programs which cleanup after the normal assembler. ++ Normally, this is not needed. See the file `mips.h' for an ++ example of this. ++ ++ Do not define this macro if it does not need to do anything. ++ */ ++ ++ #define LINK_SPEC "\ ++ %{mava:--motorola -favr_noendianbug} \ ++ %{!mava: \ ++ %{!mmcu*:-m avr85xx} \ ++ %{mmcu=atmega603:-m avrmega603} \ ++ %{mmcu=atmega103:-m avrmega103} \ ++ %{mmcu=at90s2313:-m avr23xx} \ ++ %{mmcu=at90s2323:-m avr23xx} \ ++ %{mmcu=attiny22:-m avr23xx} \ ++ %{mmcu=at90s2333:-m avr23xx} \ ++ %{mmcu=at90s2343:-m avr23xx} \ ++ %{mmcu=at90s4433:-m avr4433} \ ++ %{mmcu=at90s4414:-m avr44xx} \ ++ %{mmcu=at90s4434:-m avr44xx} \ ++ %{mmcu=at90s8535:-m avr85xx} \ ++ %{mmcu=at90s8515:-m avr85xx}}" ++ ++ /* ++ A C string constant that tells the GNU CC driver program options to ++ pass to the linker. It can also specify how to translate options ++ you give to GNU CC into options for GNU CC to pass to the linker. ++ ++ Do not define this macro if it does not need to do anything. ++ */ ++ ++ #define LIB_SPEC "\ ++ %{mava: \ ++ %{!mmcu*:libgcc.o%s libc/%s} \ ++ %{mmcu=atmega*:libgcc-mega.o%s libc-mega/%s} \ ++ %{mmcu=at90s*|mmcu=attiny22:libgcc.o%s libc/%s}} \ ++ %{!mava: \ ++ %{!mmcu*|mmcu=at90s*|mmcu=attiny22: -lc} \ ++ %{mmcu=atmega*: -lc-mega}}" ++ /* ++ Another C string constant used much like `LINK_SPEC'. The ++ difference between the two is that `LIB_SPEC' is used at the end ++ of the command given to the linker. ++ ++ If this macro is not defined, a default is provided that loads the ++ standard C library from the usual place. See `gcc.c'. ++ */ ++ ++ #define LIBGCC_SPEC "\ ++ %{!mava: \ ++ %{mmcu=atmega*:-lgcc-mega} \ ++ %{!mmcu*|mmcu=at90s*|mmcu=attiny22:-lgcc}}" ++ /* ++ Another C string constant that tells the GNU CC driver program how ++ and when to place a reference to `libgcc.a' into the linker ++ command line. This constant is placed both before and after the ++ value of `LIB_SPEC'. ++ ++ If this macro is not defined, the GNU CC driver provides a default ++ that passes the string `-lgcc' to the linker unless the `-shared' ++ option is specified. ++ */ ++ ++ #define STARTFILE_SPEC "%{mava:%(crt_ava)} %{!mava:%(crt_binutils)}" ++ /* ++ Another C string constant used much like `LINK_SPEC'. The ++ difference between the two is that `STARTFILE_SPEC' is used at the ++ very beginning of the command given to the linker. ++ ++ If this macro is not defined, a default is provided that loads the ++ standard C startup file from the usual place. See `gcc.c'. ++ */ ++ ++ #define ENDFILE_SPEC "\ ++ %{mava: \ ++ %{!mmcu*:crtn.o%s} \ ++ %{mmcu=atmega*:crtn-mega.o%s} \ ++ %{mmcu=at90s*:crtn.o%s} \ ++ }" ++ /* ++ Another C string constant used much like `LINK_SPEC'. The ++ difference between the two is that `ENDFILE_SPEC' is used at the ++ very end of the command given to the linker. ++ ++ Do not define this macro if it does not need to do anything. ++ */ ++ ++ #define CRT_AVA_SPECS "\ ++ %{!mmcu*:crt1-8515.o%s} \ ++ %{mmcu=atmega603:crt1-mega603.o%s} \ ++ %{mmcu=atmega103:crt1-mega103.o%s} \ ++ %{mmcu=at90s2313:crt1-2313.o%s} \ ++ %{mmcu=at90s2323:crt1-2323.o%s} \ ++ %{mmcu=attiny22:crt1-tiny22.o%s} \ ++ %{mmcu=at90s2333:crt1-2333.o%s} \ ++ %{mmcu=at90s2343:crt1-2343.o%s} \ ++ %{mmcu=at90s4433:crt1-4433.o%s} \ ++ %{mmcu=at90s4414:crt1-4414.o%s} \ ++ %{mmcu=at90s4434:crt1-4434.o%s} \ ++ %{mmcu=at90s8535:crt1-8535.o%s} \ ++ %{mmcu=at90s8515:crt1-8515.o%s}" ++ ++ #define CRT_BINUTILS_SPECS "\ ++ %{!mmcu*:gcrt1-8515.o%s} \ ++ %{mmcu=atmega603:gcrt1-mega603.o%s} \ ++ %{mmcu=atmega103:gcrt1-mega103.o%s} \ ++ %{mmcu=at90s2313:gcrt1-2313.o%s} \ ++ %{mmcu=at90s2323:gcrt1-2323.o%s} \ ++ %{mmcu=attiny22:gcrt1-tiny22.o%s} \ ++ %{mmcu=at90s2333:gcrt1-2333.o%s} \ ++ %{mmcu=at90s2343:gcrt1-2343.o%s} \ ++ %{mmcu=at90s4433:gcrt1-4433.o%s} \ ++ %{mmcu=at90s4414:gcrt1-4414.o%s} \ ++ %{mmcu=at90s4434:gcrt1-4434.o%s} \ ++ %{mmcu=at90s8535:gcrt1-8535.o%s} \ ++ %{mmcu=at90s8515:gcrt1-8515.o%s}" ++ ++ #define EXTRA_SPECS \ ++ {"crt_ava", CRT_AVA_SPECS}, \ ++ {"crt_binutils", CRT_BINUTILS_SPECS}, ++ /* ++ `EXTRA_SPECS' ++ Define this macro to provide additional specifications to put in ++ the `specs' file that can be used in various specifications like ++ `CC1_SPEC'. ++ ++ The definition should be an initializer for an array of structures, ++ containing a string constant, that defines the specification name, ++ and a string constant that provides the specification. ++ ++ Do not define this macro if it does not need to do anything. ++ ++ `EXTRA_SPECS' is useful when an architecture contains several ++ related targets, which have various `..._SPECS' which are similar ++ to each other, and the maintainer would like one central place to ++ keep these definitions. ++ ++ For example, the PowerPC System V.4 targets use `EXTRA_SPECS' to ++ define either `_CALL_SYSV' when the System V calling sequence is ++ used or `_CALL_AIX' when the older AIX-based calling sequence is ++ used. ++ ++ The `config/rs6000/rs6000.h' target file defines: ++ ++ #define EXTRA_SPECS \ ++ { "cpp_sysv_default", CPP_SYSV_DEFAULT }, ++ ++ #define CPP_SYS_DEFAULT "" ++ ++ The `config/rs6000/sysv.h' target file defines: ++ #undef CPP_SPEC ++ #define CPP_SPEC \ ++ "%{posix: -D_POSIX_SOURCE } \ ++ %{mcall-sysv: -D_CALL_SYSV } %{mcall-aix: -D_CALL_AIX } \ ++ %{!mcall-sysv: %{!mcall-aix: %(cpp_sysv_default) }} \ ++ %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}" ++ ++ #undef CPP_SYSV_DEFAULT ++ #define CPP_SYSV_DEFAULT "-D_CALL_SYSV" ++ ++ while the `config/rs6000/eabiaix.h' target file defines ++ `CPP_SYSV_DEFAULT' as: ++ ++ #undef CPP_SYSV_DEFAULT ++ #define CPP_SYSV_DEFAULT "-D_CALL_AIX" ++ */ ++ /* This is undefined macro for collect2 disabling */ ++ #define LINKER_NAME "%{mava:ava} %{!mava:ld}" ++ ++ #define LINK_LIBGCC_SPECIAL ++ ++ /* ++ `LINK_LIBGCC_SPECIAL' ++ Define this macro if the driver program should find the library ++ `libgcc.a' itself and should not pass `-L' options to the linker. ++ If you do not define this macro, the driver program will pass the ++ argument `-lgcc' to tell the linker to do the search and will pass ++ `-L' options to it. ++ ++ `LINK_LIBGCC_SPECIAL_1' ++ Define this macro if the driver program should find the library ++ `libgcc.a'. If you do not define this macro, the driver program ++ will pass the argument `-lgcc' to tell the linker to do the search. ++ This macro is similar to `LINK_LIBGCC_SPECIAL', except that it does ++ not affect `-L' options. ++ */ ++ ++ #define LINK_COMMAND_SPEC "\ ++ %{!fsyntax-only: \ ++ %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n}\ ++ %{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\ ++ %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ ++ %{static:} %{!mava: %{L*} %D} %o\ ++ %{!nostdlib:%{!nodefaultlibs:%G %L %G}}\ ++ %{!A:%{!nostdlib:%{!nostartfiles:%E}}}\ ++ %{T*}\ ++ \n }}}}}}"; ++ ++ /* ++ A C string constant giving the complete command line need to ++ execute the linker. When you do this, you will need to update ++ your port each time a change is made to the link command line ++ within `gcc.c'. Therefore, define this macro only if you need to ++ completely redefine the command line for invoking the linker and ++ there is no other way to accomplish the effect you need. ++ ++ `MULTILIB_DEFAULTS' ++ Define this macro as a C expression for the initializer of an ++ array of string to tell the driver program which options are ++ defaults for this target and thus do not need to be handled ++ specially when using `MULTILIB_OPTIONS'. ++ ++ Do not define this macro if `MULTILIB_OPTIONS' is not defined in ++ the target makefile fragment or if none of the options listed in ++ `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. ++ ++ `RELATIVE_PREFIX_NOT_LINKDIR' ++ Define this macro to tell `gcc' that it should only translate a ++ `-B' prefix into a `-L' linker option if the prefix indicates an ++ absolute file name. ++ ++ `STANDARD_EXEC_PREFIX' ++ Define this macro as a C string constant if you wish to override ++ the standard choice of `/usr/local/lib/gcc-lib/' as the default ++ prefix to try when searching for the executable files of the ++ compiler. ++ ++ `MD_EXEC_PREFIX' ++ If defined, this macro is an additional prefix to try after ++ `STANDARD_EXEC_PREFIX'. `MD_EXEC_PREFIX' is not searched when the ++ `-b' option is used, or the compiler is built as a cross compiler. ++ ++ `STANDARD_STARTFILE_PREFIX' ++ Define this macro as a C string constant if you wish to override ++ the standard choice of `/usr/local/lib/' as the default prefix to ++ try when searching for startup files such as `crt0.o'. ++ ++ `MD_STARTFILE_PREFIX' ++ If defined, this macro supplies an additional prefix to try after ++ the standard prefixes. `MD_EXEC_PREFIX' is not searched when the ++ `-b' option is used, or when the compiler is built as a cross ++ compiler. ++ ++ `MD_STARTFILE_PREFIX_1' ++ If defined, this macro supplies yet another prefix to try after the ++ standard prefixes. It is not searched when the `-b' option is ++ used, or when the compiler is built as a cross compiler. ++ ++ `INIT_ENVIRONMENT' ++ Define this macro as a C string constant if you wish to set ++ environment variables for programs called by the driver, such as ++ the assembler and loader. The driver passes the value of this ++ macro to `putenv' to initialize the necessary environment ++ variables. ++ ++ `LOCAL_INCLUDE_DIR' ++ Define this macro as a C string constant if you wish to override ++ the standard choice of `/usr/local/include' as the default prefix ++ to try when searching for local header files. `LOCAL_INCLUDE_DIR' ++ comes before `SYSTEM_INCLUDE_DIR' in the search order. ++ ++ Cross compilers do not use this macro and do not search either ++ `/usr/local/include' or its replacement. ++ ++ `SYSTEM_INCLUDE_DIR' ++ Define this macro as a C string constant if you wish to specify a ++ system-specific directory to search for header files before the ++ standard directory. `SYSTEM_INCLUDE_DIR' comes before ++ `STANDARD_INCLUDE_DIR' in the search order. ++ ++ Cross compilers do not use this macro and do not search the ++ directory specified. ++ ++ `STANDARD_INCLUDE_DIR' ++ Define this macro as a C string constant if you wish to override ++ the standard choice of `/usr/include' as the default prefix to try ++ when searching for header files. ++ ++ Cross compilers do not use this macro and do not search either ++ `/usr/include' or its replacement. ++ ++ `STANDARD_INCLUDE_COMPONENT' ++ The "component" corresponding to `STANDARD_INCLUDE_DIR'. See ++ `INCLUDE_DEFAULTS', below, for the description of components. If ++ you do not define this macro, no component is used. ++ ++ `INCLUDE_DEFAULTS' ++ Define this macro if you wish to override the entire default ++ search path for include files. For a native compiler, the default ++ search path usually consists of `GCC_INCLUDE_DIR', ++ `LOCAL_INCLUDE_DIR', `SYSTEM_INCLUDE_DIR', ++ `GPLUSPLUS_INCLUDE_DIR', and `STANDARD_INCLUDE_DIR'. In addition, ++ `GPLUSPLUS_INCLUDE_DIR' and `GCC_INCLUDE_DIR' are defined ++ automatically by `Makefile', and specify private search areas for ++ GCC. The directory `GPLUSPLUS_INCLUDE_DIR' is used only for C++ ++ programs. ++ ++ The definition should be an initializer for an array of structures. ++ Each array element should have four elements: the directory name (a ++ string constant), the component name, and flag for C++-only ++ directories, and a flag showing that the includes in the directory ++ don't need to be wrapped in `extern `C'' when compiling C++. Mark ++ the end of the array with a null element. ++ ++ The component name denotes what GNU package the include file is ++ part of, if any, in all upper-case letters. For example, it might ++ be `GCC' or `BINUTILS'. If the package is part of the a ++ vendor-supplied operating system, code the component name as `0'. ++ ++ For example, here is the definition used for VAX/VMS: ++ ++ #define INCLUDE_DEFAULTS \ ++ { \ ++ { "GNU_GXX_INCLUDE:", "G++", 1, 1}, \ ++ { "GNU_CC_INCLUDE:", "GCC", 0, 0}, \ ++ { "SYS$SYSROOT:[SYSLIB.]", 0, 0, 0}, \ ++ { ".", 0, 0, 0}, \ ++ { 0, 0, 0, 0} \ ++ } ++ ++ Here is the order of prefixes tried for exec files: ++ ++ 1. Any prefixes specified by the user with `-B'. ++ ++ 2. The environment variable `GCC_EXEC_PREFIX', if any. ++ ++ 3. The directories specified by the environment variable ++ `COMPILER_PATH'. ++ ++ 4. The macro `STANDARD_EXEC_PREFIX'. ++ ++ 5. `/usr/lib/gcc/'. ++ ++ 6. The macro `MD_EXEC_PREFIX', if any. ++ ++ Here is the order of prefixes tried for startfiles: ++ ++ 1. Any prefixes specified by the user with `-B'. ++ ++ 2. The environment variable `GCC_EXEC_PREFIX', if any. ++ ++ 3. The directories specified by the environment variable ++ `LIBRARY_PATH' (native only, cross compilers do not use this). ++ ++ 4. The macro `STANDARD_EXEC_PREFIX'. ++ ++ 5. `/usr/lib/gcc/'. ++ ++ 6. The macro `MD_EXEC_PREFIX', if any. ++ ++ 7. The macro `MD_STARTFILE_PREFIX', if any. ++ ++ 8. The macro `STANDARD_STARTFILE_PREFIX'. ++ ++ 9. `/lib/'. ++ ++ 10. `/usr/lib/'. ++ ++ */ ++ ++ #define TEST_HARD_REG_CLASS(CLASS, REGNO) \ ++ TEST_HARD_REG_BIT (reg_class_contents[ (int) (CLASS)], REGNO) ++ ++ /* #define PRESERVE_DEATH_INFO_REGNO_P(r) 1 */ ++ ++ /* Note that the other files fail to use these ++ in some of the places where they should. */ ++ ++ #if defined(__STDC__) || defined(ALMOST_STDC) ++ #define AS2(a,b,c) #a " " #b "," #c ++ #define AS2C(b,c) " " #b "," #c ++ #define AS3(a,b,c,d) #a " " #b "," #c "," #d ++ #define AS1(a,b) #a " " #b ++ #else ++ #define AS1(a,b) "a b" ++ #define AS2(a,b,c) "a b,c" ++ #define AS2C(b,c) " b,c" ++ #define AS3(a,b,c,d) "a b,c,d" ++ #endif ++ #define OUT_AS1(a,b) output_asm_insn (AS1(a,b), operands) ++ #define OUT_AS2(a,b,c) output_asm_insn (AS2(a,b,c), operands) ++ #define CR_TAB "\n\t" ++ ++ extern void asm_output_external_libcall (); ++ extern void asm_output_external (); ++ extern void avr_output_ascii (); ++ extern void unique_section (); ++ extern void encode_section_info (); ++ extern void asm_output_section_name (); ++ extern int legitimate_address_p (); ++ extern int function_arg_regno_p (); ++ extern int valid_machine_type_attribute (); ++ extern int valid_machine_decl_attribute (); ++ extern void machine_dependent_reorg (); ++ extern void asm_file_start (); ++ extern void asm_file_end (); ++ ++ extern void avr_init_once (); ++ extern void avr_override_options (); ++ extern void init_cumulative_args (); ++ extern void function_arg_advance (); ++ extern struct rtx_def *function_arg (); ++ extern struct rtx_def *gen_cmphi_1s (); ++ extern struct rtx_def *gen_cmpsi_1s (); ++ extern int compare_diff_p (struct rtx_def *); ++ extern char * output_cmpHI (); ++ extern char * output_cmpSI (); ++ extern char * out_movqi_r_mr (); ++ extern char * out_movqi_mr_r (); ++ extern char * out_movhi_r_mr (); ++ extern char * out_movsi_r_mr (); ++ extern char * out_movhi_mr_r (); ++ extern char * out_movsi_mr_r (); ++ extern char * output_movsisf(); ++ extern char * out_tstsi (); ++ extern char * out_tsthi (); ++ extern char * ret_cond_branch (); ++ extern char * ashlqi3_out (); ++ extern char * ashlhi3_out (); ++ extern char * ashlsi3_out (); ++ ++ extern char * ashrqi3_out (); ++ extern char * ashrhi3_out (); ++ extern char * ashrsi3_out (); ++ ++ extern char * lshrqi3_out (); ++ extern char * lshrhi3_out (); ++ extern char * lshrsi3_out (); ++ extern char * avr_change_section (); ++ extern struct rtx_def * avr_function_value (); ++ extern int avr_address_cost (struct rtx_def *); ++ extern int avr_ret_register (); ++ extern enum reg_class class_likely_spilled_p (); ++ extern enum reg_class preferred_reload_class (); ++ extern enum reg_class avr_regno_reg_class (int); ++ extern int extra_constraint (); ++ extern enum reg_class avr_reg_class_from_letter (); ++ extern int class_max_nregs (); ++ extern struct rtx_def * legitimize_address (); ++ extern int adjust_insn_length (struct rtx_def *, int); ++ extern struct rtx_def * avr_libcall_value (); ++ extern char *output_reload_inhi (struct rtx_def *, struct rtx_def **, int); ++ extern char *output_reload_insisf (struct rtx_def *, struct rtx_def **, int); ++ ++ /* ++ Define this macro as a C statement that declares additional library ++ routines renames existing ones. `init_optabs' calls this macro ++ after initializing all the normal library routines. ++ */ ++ #define INIT_TARGET_OPTABS \ ++ { \ ++ smul_optab->handlers[(int) QImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_mulqi3"); \ ++ \ ++ sdiv_optab->handlers[(int) QImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_divqi3"); \ ++ \ ++ smod_optab->handlers[(int) QImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_modqi3"); \ ++ \ ++ udiv_optab->handlers[(int) QImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_udivqi3"); \ ++ \ ++ umod_optab->handlers[(int) QImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_umodqi3"); \ ++ \ ++ smul_optab->handlers[(int) HImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_mulhi3"); \ ++ \ ++ sdiv_optab->handlers[(int) HImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_divhi3"); \ ++ \ ++ smod_optab->handlers[(int) HImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_modhi3"); \ ++ \ ++ udiv_optab->handlers[(int) HImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_udivhi3"); \ ++ \ ++ umod_optab->handlers[(int) HImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_umodhi3"); \ ++ \ ++ smul_optab->handlers[(int) SImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_mulsi3"); \ ++ \ ++ sdiv_optab->handlers[(int) SImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_divsi3"); \ ++ \ ++ smod_optab->handlers[(int) SImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_modsi3"); \ ++ \ ++ udiv_optab->handlers[(int) SImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_udivsi3"); \ ++ \ ++ umod_optab->handlers[(int) SImode].libfunc \ ++ = gen_rtx (SYMBOL_REF, Pmode, "_umodsi3"); \ ++ avr_init_once(); \ ++ } ++ ++ /* Temporary register r0 */ ++ #define TMP_REGNO 0 ++ ++ /* zero register r1 */ ++ #define ZERO_REGNO 1 ++ ++ extern struct rtx_def *tmp_reg_rtx; ++ extern struct rtx_def *zero_reg_rtx; ++ ++ #define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT ++ ++ /* Define to use software floating point emulator for REAL_ARITHMETIC and ++ decimal <-> binary conversion. */ ++ #define REAL_ARITHMETIC ++ ++ /* Make DWARF2 an option, but keep DBX as the default for now. ++ Use -gdwarf-2 to turn on DWARF2. */ ++ /*#define DWARF2_DEBUGGING_INFO*/ ++ ++ #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG ++ ++ #define DBX_REGISTER_NUMBER(r) r ++ ++ /* Get the standard ELF stabs definitions. */ ++ #include "dbxelf.h" ++ ++ #undef ASM_IDENTIFY_GCC ++ #define ASM_IDENTIFY_GCC(FILE) \ ++ do \ ++ { \ ++ if (write_symbols != DBX_DEBUG) \ ++ fputs (AS_STR ("","gcc2_compiled.:\n"), FILE); \ ++ } \ ++ while (0) ++ +diff -Nrc3p gcc-2.95.2.orig/gcc/config/avr/libgcc.S gcc-2.95.2/gcc/config/avr/libgcc.S +*** gcc-2.95.2.orig/gcc/config/avr/libgcc.S Sat Dec 18 17:50:17 1999 +--- gcc-2.95.2/gcc/config/avr/libgcc.S Thu Dec 23 22:36:37 1999 +*************** +*** 0 **** +--- 1,664 ---- ++ /* -*- Mode: Asm -*- */ ++ ++ #ifdef ASSEMBLER_AVA ++ # define TEXT_SEG(x) seg removable flash.code.##x ++ # define GLOBAL(x) ++ # define FUNCTION(x) ++ # define ENDFUNC ++ # define LABEL(x) public _##x##: ++ #else ++ # define TEXT_SEG(x) .section .text.libgcc ; x ++ # define GLOBAL(x) .global _##x ++ # define FUNCTION(x) .func _##x ++ # define LABEL(x) _##x##: ++ # define ENDFUNC .endfunc ++ #endif /* ASSEMBLER_AVA */ ++ ++ ++ #ifdef ASSEMBLER_AVA ++ # define Lmulqi3 ++ # define Lmulhi3 ++ # define Lmulsi3 ++ # define Lumodqi3 ++ # define Ludivqi3 ++ # define Lmodqi3 ++ # define Ldivqi3 ++ # define Lumodhi3 ++ # define Ludivhi ++ # define Lmodhi3 ++ # define Ldivhi3 ++ # define Lumodsi3 ++ # define Ludivsi3 ++ # define Lmodsi3 ++ # define Ldivsi3 ++ # define Lprologue ++ # define Lepilogue ++ # define L__exit ++ #endif ++ ++ #define __zero_reg__ r1 ++ #define __tmp_reg__ r0 ++ #define __SREG__ 0x3f ++ #define __SP_H__ 0x3e ++ #define __SP_L__ 0x3d ++ ++ /******************************************************* ++ Multiplication 8 x 8 ++ *******************************************************/ ++ #if defined (Lmulqi3) ++ ++ #define r_arg2 r25 /* multiplicand */ ++ #define r_arg1 r24 /* multiplier */ ++ #define r_res __tmp_reg__ /* result */ ++ ++ TEXT_SEG(mulqi3) ++ GLOBAL (mulqi3) ++ FUNCTION (mulqi3) ++ LABEL(mulqi3) ++ ++ GLOBAL (umulqi3) ++ LABEL(umulqi3) ++ clr r_res ; clear result ++ __mulqi3_loop: ++ sbrc r_arg1,0 ++ add r_res,r_arg2 ++ add r_arg2,r_arg2 ; shift multiplicand ++ breq __mulqi3_exit ; while multiplicand != 0 ++ lsr r_arg1 ; ++ brne __mulqi3_loop ; exit if multiplier = 0 ++ __mulqi3_exit: ++ mov r_arg1,r_res ; result to return register ++ ret ++ ++ #undef r_arg2 ++ #undef r_arg1 ++ #undef r_res ++ ++ ENDFUNC ++ #endif /* defined (Lmulqi3) */ ++ ++ ++ /******************************************************* ++ Multiplication 16 x 16 ++ *******************************************************/ ++ #if defined (Lmulhi3) ++ #define r_arg1L r24 /* multiplier Low */ ++ #define r_arg1H r25 /* multiplier High */ ++ #define r_arg2L r22 /* multiplicand Low */ ++ #define r_arg2H r23 /* multiplicand High */ ++ #define r_resL r20 /* result Low */ ++ #define r_resH r21 /* result High */ ++ ++ TEXT_SEG(mulhi3) ++ GLOBAL (mulhi3) ++ FUNCTION (mulhi3) ++ LABEL(mulhi3) ++ ++ GLOBAL (umulhi3) ++ LABEL(umulhi3) ++ ++ clr r_resH ; clear result ++ clr r_resL ; clear result ++ __mulhi3_loop: ++ sbrs r_arg1L,0 ++ rjmp __mulhi3_skip1 ++ add r_resL,r_arg2L ; result + multiplicand ++ adc r_resH,r_arg2H ++ __mulhi3_skip1: ++ add r_arg2L,r_arg2L ; shift multiplicand ++ adc r_arg2H,r_arg2H ++ ++ cpc r_arg2L,__zero_reg__ ++ breq __mulhi3_exit ; while multiplicand != 0 ++ ++ lsr r_arg1H ; gets LSB of multiplier ++ ror r_arg1L ++ cpc r_arg1H,__zero_reg__ ++ brne __mulhi3_loop ; exit if multiplier = 0 ++ __mulhi3_exit: ++ mov r_arg1H,r_resH ; result to return register ++ mov r_arg1L,r_resL ++ ret ++ ++ #undef r_arg1L ++ #undef r_arg1H ++ #undef r_arg2L ++ #undef r_arg2H ++ #undef r_resL ++ #undef r_resH ++ ++ ENDFUNC ++ #endif /* defined (Lmulhi3) */ ++ ++ #if defined (Lmulsi3) ++ /******************************************************* ++ Multiplication 32 x 32 ++ *******************************************************/ ++ #define r_arg1L r22 /* multiplier Low */ ++ #define r_arg1H r23 ++ #define r_arg1HL r24 ++ #define r_arg1HH r25 /* multiplier High */ ++ ++ ++ #define r_arg2L r18 /* multiplicand Low */ ++ #define r_arg2H r19 ++ #define r_arg2HL r20 ++ #define r_arg2HH r21 /* multiplicand High */ ++ ++ #define r_resL r26 /* result Low */ ++ #define r_resH r27 ++ #define r_resHL r30 ++ #define r_resHH r31 /* result High */ ++ ++ ++ TEXT_SEG(mulsi3) ++ GLOBAL (mulsi3) ++ FUNCTION (mulsi3) ++ LABEL(mulsi3) ++ ++ GLOBAL (umulsi3) ++ LABEL(umulsi3) ++ clr r_resHH ; clear result ++ clr r_resHL ; clear result ++ clr r_resH ; clear result ++ clr r_resL ; clear result ++ __mulsi3_loop: ++ sbrs r_arg1L,0 ++ rjmp __mulsi3_skip1 ++ add r_resL,r_arg2L ; result + multiplicand ++ adc r_resH,r_arg2H ++ adc r_resHL,r_arg2HL ++ adc r_resHH,r_arg2HH ++ __mulsi3_skip1: ++ add r_arg2L,r_arg2L ; shift multiplicand ++ adc r_arg2H,r_arg2H ++ adc r_arg2HL,r_arg2HL ++ adc r_arg2HH,r_arg2HH ++ ++ lsr r_arg1HH ; gets LSB of multiplier ++ ror r_arg1HL ++ ror r_arg1H ++ ror r_arg1L ++ brne __mulsi3_loop ++ sbiw r_arg1HL,0 ++ cpc r_arg1H,r_arg1L ++ brne __mulsi3_loop ; exit if multiplier = 0 ++ __mulsi3_exit: ++ mov r_arg1HH,r_resHH ; result to return register ++ mov r_arg1HL,r_resHL ++ mov r_arg1H,r_resH ++ mov r_arg1L,r_resL ++ ret ++ #undef r_arg1L ++ #undef r_arg1H ++ #undef r_arg1HL ++ #undef r_arg1HH ++ ++ ++ #undef r_arg2L ++ #undef r_arg2H ++ #undef r_arg2HL ++ #undef r_arg2HH ++ ++ #undef r_resL ++ #undef r_resH ++ #undef r_resHL ++ #undef r_resHH ++ ++ ENDFUNC ++ #endif /* defined (Lmulsi3) */ ++ ++ /******************************************************* ++ Division 8 / 8 => (result + remainder) ++ *******************************************************/ ++ #define r_rem r26 /* remainder */ ++ #define r_arg1 r25 /* dividend */ ++ #define r_arg2 r24 /* divisor */ ++ #define r_cnt r27 /* loop count */ ++ ++ #if defined (Lumodqi3) ++ ++ TEXT_SEG(divqi3) ++ GLOBAL (umodqi3) ++ FUNCTION (umodqi3) ++ LABEL(umodqi3) ++ clt ++ rcall _udivqi3 ++ mov r24,r_rem ++ ret ++ ENDFUNC ++ #endif /* defined (Lumodqi3) */ ++ ++ #if defined (Ludivqi3) ++ ++ TEXT_SEG(divqi3) ++ GLOBAL (udivqi3) ++ FUNCTION (udivqi3) ++ LABEL(udivqi3) ++ clr __tmp_reg__ ++ rjmp _divqi_raw ++ ENDFUNC ++ #endif /* defined (Ludivqi3) */ ++ ++ #if defined (Lmodqi3) ++ ++ TEXT_SEG (divqi3) ++ GLOBAL (moqhi3) ++ FUNCTION (moqhi3) ++ LABEL (modqi3) ++ rcall _divqi3 ++ mov r24,r_rem ++ ret ++ ENDFUNC ++ #endif /* defined (Lmodqi3) */ ++ ++ #if defined (Ldivqi3) ++ ++ TEXT_SEG(divqi3) ++ GLOBAL (divqi3) ++ FUNCTION (divqi3) ++ LABEL(divqi3) ++ bst r_arg1,7 ; store sign of divident ++ mov __tmp_reg__,r_arg1 ++ eor __tmp_reg__,r_arg2; r0.7 is sign of result ++ sbrc r_arg1,7 ++ neg r_arg1 ; divident negative : negate ++ sbrc r_arg2,7 ++ neg r_arg2 ; divisor negative : negate ++ GLOBAL (divqi_raw) ++ LABEL (divqi_raw) ++ sub r_rem,r_rem ; clear remainder and carry ++ ldi r_cnt,9 ; init loop counter ++ rjmp __divqi3_ep ; jump to entry point ++ __divqi3_loop: ++ rol r_rem ; shift dividend into remainder ++ cp r_rem,r_arg2 ; compare remainder & divisor ++ brcs __divqi3_ep ; remainder <= divisor ++ sub r_rem,r_arg2 ; restore remainder ++ __divqi3_ep: ++ rol r_arg1 ; shift dividend (with CARRY) ++ dec r_cnt ; decrement loop counter ++ brne __divqi3_loop ; loop ++ com r_arg1 ; complement result ++ ; because C flag was complemented in loop ++ brtc __divqi3_1 ++ neg r_rem ; correct remainder sign ++ __divqi3_1: ++ sbrc __tmp_reg__,7 ++ neg r_arg1 ; correct result sign ++ __divqi3_exit: ++ mov r24,r_arg1 ; put result to return register ++ ret ++ ENDFUNC ++ #endif /* defined (Ldivqi3) */ ++ ++ #undef r_rem ++ #undef r_arg1 ++ #undef r_arg2 ++ #undef r_cnt ++ ++ ++ /******************************************************* ++ Division 16 / 16 => (result + remainder) ++ *******************************************************/ ++ #define r_remL r26 /* remainder Low */ ++ #define r_remH r27 /* remainder High */ ++ ++ #define r_arg1L r24 /* dividend Low */ ++ #define r_arg1H r25 /* dividend High */ ++ ++ #define r_arg2L r22 /* divisor Low */ ++ #define r_arg2H r23 /* divisor High */ ++ ++ #define r_cnt r21 /* loop count */ ++ #if defined (Lumodhi3) ++ ++ TEXT_SEG (divhi3) ++ GLOBAL (umodhi3) ++ FUNCTION (umodhi3) ++ LABEL (umodhi3) ++ clt ++ rcall _udivhi3 ++ GLOBAL (umodhi3_ret) ++ LABEL (umodhi3_ret) ++ mov r24,r_remL ++ mov r25,r_remH ++ ret ++ ENDFUNC ++ #endif /* defined (Lumodhi3) */ ++ ++ #if defined (Ludivhi3) ++ ++ TEXT_SEG (divhi3) ++ GLOBAL (udivhi3) ++ FUNCTION (udivhi3) ++ LABEL (udivhi3) ++ clr __tmp_reg__ ++ rjmp _divhi_raw ++ ENDFUNC ++ #endif /* defined (Ludivhi3) */ ++ ++ #if defined (Lmodhi3) ++ ++ TEXT_SEG (divhi3) ++ GLOBAL (modhi3) ++ FUNCTION (modhi3) ++ LABEL (modhi3) ++ GLOBAL (div) ++ LABEL (div) ++ rcall _divhi3 ++ mov r22,r24 ; needed for div () function ++ mov r23,r25 ++ rjmp _umodhi3_ret ++ ENDFUNC ++ #endif /* defined (Lmodhi3) */ ++ ++ ++ #if defined (Ldivhi3) ++ ++ TEXT_SEG (divhi3) ++ GLOBAL (divhi3) ++ FUNCTION (divhi3) ++ LABEL (divhi3) ++ bst r_arg1H,7 ; store sign of divident ++ mov __tmp_reg__,r_arg1H ++ eor __tmp_reg__,r_arg2H ; r0.7 is sign of result ++ brtc __divhi3_skip1 ++ com r_arg1H ++ neg r_arg1L ; divident negative : negate ++ sbci r_arg1H,0xff ++ __divhi3_skip1: ++ tst r_arg2H ++ brpl __divhi3_skip2 ++ com r_arg2H ++ neg r_arg2L ; divisor negative : negate ++ sbci r_arg2H,0xff ++ __divhi3_skip2: ++ GLOBAL (divhi_raw) ++ LABEL (divhi_raw) ++ sub r_remL,r_remL ++ sub r_remH,r_remH ; clear remainder and carry ++ ldi r_cnt,17 ; init loop counter ++ rjmp __divhi3_ep ; jump to entry point ++ __divhi3_loop: ++ rol r_remL ; shift dividend into remainder ++ rol r_remH ++ cp r_remL,r_arg2L ; compare remainder & divisor ++ cpc r_remH,r_arg2H ++ brcs __divhi3_ep ; remainder < divisor ++ sub r_remL,r_arg2L ; restore remainder ++ sbc r_remH,r_arg2H ++ __divhi3_ep: ++ rol r_arg1L ; shift dividend (with CARRY) ++ rol r_arg1H ++ dec r_cnt ; decrement loop counter ++ brne __divhi3_loop ; loop ++ brtc __divhi3_1 ++ com r_remH ++ neg r_remL ; correct remainder sign ++ sbci r_remH,0xff ++ __divhi3_1: ++ tst __tmp_reg__ ++ brpl __divhi3_exit ++ adiw r_arg1L,1 ; correct result sign ++ ret ++ __divhi3_exit: ++ com r_arg1L ++ com r_arg1H ++ ret ++ ENDFUNC ++ #endif /* defined (Ldivhi3) */ ++ ++ #undef r_remH ++ #undef r_remL ++ ++ #undef r_arg1H ++ #undef r_arg1L ++ ++ #undef r_arg2H ++ #undef r_arg2L ++ ++ #undef r_cnt ++ ++ /******************************************************* ++ Division 32 / 32 => (result + remainder) ++ *******************************************************/ ++ #define r_remHH r31 /* remainder High */ ++ #define r_remHL r30 ++ #define r_remH r27 ++ #define r_remL r26 /* remainder Low */ ++ ++ #define r_arg1HH r25 /* dividend High */ ++ #define r_arg1HL r24 ++ #define r_arg1H r23 ++ #define r_arg1L r22 /* dividend Low */ ++ ++ #define r_arg2HH r21 /* divisor High */ ++ #define r_arg2HL r20 ++ #define r_arg2H r19 ++ #define r_arg2L r18 /* divisor Low */ ++ ++ #define r_cnt r17 /* loop count */ ++ ++ #if defined (Lumodsi3) ++ ++ TEXT_SEG(divsi3) ++ GLOBAL (umodsi3) ++ FUNCTION (umodsi3) ++ LABEL(umodsi3) ++ clt ++ rcall _udivsi3 ++ GLOBAL (umodsi3_ret) ++ LABEL (umodsi3_ret) ++ mov r25,r_remHH ++ mov r24,r_remHL ++ mov r23,r_remH ++ mov r22,r_remL ++ GLOBAL (cleanup) ++ LABEL (cleanup) ++ ret ++ ENDFUNC ++ #endif /* defined (Lumodsi3) */ ++ ++ #if defined (Ludivsi3) ++ ++ TEXT_SEG(divsi3) ++ GLOBAL (udivsi3) ++ FUNCTION (udivsi3) ++ LABEL(udivsi3) ++ clr __tmp_reg__ ++ rjmp _divsi_raw ++ ENDFUNC ++ #endif /* defined (Ludivsi3) */ ++ ++ #if defined (Lmodsi3) ++ ++ TEXT_SEG (divsi3) ++ GLOBAL (modsi3) ++ FUNCTION (modsi3) ++ LABEL (modsi3) ++ GLOBAL (ldiv) ++ LABEL (ldiv) ++ rcall _divsi3 ++ mov r18,r22 /* Needed for ldiv */ ++ mov r19,r23 ++ mov r20,r24 ++ mov r21,r25 ++ rjmp _umodsi3_ret ++ ENDFUNC ++ #endif /* defined (Lmodsi3) */ ++ ++ #if defined (Ldivsi3) ++ ++ TEXT_SEG(divsi3) ++ GLOBAL (divsi3) ++ FUNCTION (divsi3) ++ LABEL(divsi3) ++ bst r_arg1HH,7 ; store sign of divident ++ mov __tmp_reg__,r_arg1HH ++ eor __tmp_reg__,r_arg2HH ; r0.7 is sign of result ++ brtc __divsi3_skip1 ++ com r_arg1HH ++ com r_arg1HL ++ com r_arg1H ++ neg r_arg1L ; divident negative : negate ++ sbci r_arg1H, 0xff ++ sbci r_arg1HL,0xff ++ sbci r_arg1HH,0xff ++ __divsi3_skip1: ++ tst r_arg2HH ++ brpl __divsi3_skip2 ++ com r_arg2HH ++ com r_arg2HL ++ com r_arg2H ++ neg r_arg2L ; divisor negative : negate ++ sbci r_arg2H, 0xff ++ sbci r_arg2HL,0xff ++ sbci r_arg2HH,0xff ++ __divsi3_skip2: ++ GLOBAL (divsi_raw) ++ LABEL (divsi_raw) ++ push r_cnt ++ sub r_remL,r_remL ++ sub r_remH,r_remH ++ sub r_remHL,r_remHL ++ sub r_remHH,r_remHH ; clear remainder and carry ++ ldi r_cnt,33 ; init loop counter ++ rjmp __divsi3_ep ; jump to entry point ++ __divsi3_loop: ++ rol r_remL ; shift dividend into remainder ++ rol r_remH ++ rol r_remHL ++ rol r_remHH ++ cp r_remL,r_arg2L ; compare remainder & divisor ++ cpc r_remH,r_arg2H ++ cpc r_remHL,r_arg2HL ++ cpc r_remHH,r_arg2HH ++ brcs __divsi3_ep ; remainder <= divisor ++ sub r_remL,r_arg2L ; restore remainder ++ sbc r_remH,r_arg2H ++ sbc r_remHL,r_arg2HL ++ sbc r_remHH,r_arg2HH ++ __divsi3_ep: ++ rol r_arg1L ; shift dividend (with CARRY) ++ rol r_arg1H ++ rol r_arg1HL ++ rol r_arg1HH ++ dec r_cnt ; decrement loop counter ++ brne __divsi3_loop ; loop ++ pop r_cnt ++ brtc __divsi3_1 ++ com r_remHH ++ com r_remHL ++ com r_remH ++ neg r_remL ; correct remainder sign ++ sbci r_remH, 0xff ++ sbci r_remHL,0xff ++ sbci r_remHH,0xff ++ __divsi3_1: ++ rol __tmp_reg__ ++ brcc __divsi3_exit ++ adc r_arg1L,__zero_reg__; correct result sign ++ adc r_arg1H,__zero_reg__ ++ adc r_arg1HL,__zero_reg__ ++ adc r_arg1HH,__zero_reg__ ++ ret ++ __divsi3_exit: ++ com r_arg1L ++ com r_arg1H ++ com r_arg1HL ++ com r_arg1HH ++ ret ++ ENDFUNC ++ #endif /* defined (Ldivsi3) */ ++ ++ /********************************** ++ * This is a prologue subroutine ++ **********************************/ ++ #if defined (Lprologue) ++ ++ TEXT_SEG (_prologue_saves) ++ GLOBAL (_prologue_saves__) ++ FUNCTION (_prologue_saves__) ++ LABEL (_prologue_saves__) ++ push r2 ++ push r3 ++ push r4 ++ push r5 ++ push r6 ++ push r7 ++ push r8 ++ push r9 ++ push r10 ++ push r11 ++ push r12 ++ push r13 ++ push r14 ++ push r15 ++ push r16 ++ push r17 ++ push r28 ++ push r29 ++ in r28,__SP_L__ ++ in r29,__SP_H__ ++ sbiw r26,0 ++ breq _prologue_end ++ sub r28,r26 ++ sbc r29,r27 ++ in __tmp_reg__,__SREG__ ++ cli ++ out __SP_L__,r28 ++ out __SREG__,__tmp_reg__ ++ out __SP_H__,r29 ++ _prologue_end: ++ ijmp ++ ENDFUNC ++ #endif /* defined (Lprologue) */ ++ ++ /* ++ * This is a epilogue subroutine ++ */ ++ #if defined (Lepilogue) ++ ++ TEXT_SEG (_epilogue_restores) ++ GLOBAL (_epilogue_restores__) ++ FUNCTION (_epilogue_restores__) ++ LABEL (_epilogue_restores__) ++ ldd r2,Y+18 ++ ldd r3,Y+17 ++ ldd r4,Y+16 ++ ldd r5,Y+15 ++ ldd r6,Y+14 ++ ldd r7,Y+13 ++ ldd r8,Y+12 ++ ldd r9,Y+11 ++ ldd r10,Y+10 ++ ldd r11,Y+9 ++ ldd r12,Y+8 ++ ldd r13,Y+7 ++ ldd r14,Y+6 ++ ldd r15,Y+5 ++ ldd r16,Y+4 ++ ldd r17,Y+3 ++ ldd r26,Y+2 ++ ldd r27,Y+1 ++ add r28,r30 ++ adc r29,__zero_reg__ ++ in __tmp_reg__,__SREG__ ++ cli ++ out __SP_L__,r28 ++ out __SREG__,__tmp_reg__ ++ out __SP_H__,r29 ++ mov r28,r26 ++ mov r29,r27 ++ ret ++ #endif /* defined (Lepilogue) */ ++ ++ #ifdef L__exit ++ TEXT_SEG(exit) ++ GLOBAL (exit) ++ FUNCTION (exit) ++ LABEL(exit) ++ rjmp _exit ++ ENDFUNC ++ #endif +\ No newline at end of file +diff -Nrc3p gcc-2.95.2.orig/gcc/config/avr/t-avr gcc-2.95.2/gcc/config/avr/t-avr +*** gcc-2.95.2.orig/gcc/config/avr/t-avr Sat Dec 18 17:50:17 1999 +--- gcc-2.95.2/gcc/config/avr/t-avr Thu Nov 25 22:44:42 1999 +*************** +*** 0 **** +--- 1,67 ---- ++ CROSS_LIBGCC1 = libgcc1-asm.a ++ LIB1ASMSRC = avr/libgcc.S ++ LIB1ASMFUNCS = \ ++ mulqi3 \ ++ mulhi3 \ ++ mulsi3 \ ++ umodqi3 \ ++ udivqi3 \ ++ modqi3 \ ++ divqi3 \ ++ umodhi3 \ ++ udivhi3 \ ++ modhi3 \ ++ divhi3 \ ++ umodsi3 \ ++ udivsi3 \ ++ modsi3 \ ++ divsi3 \ ++ prologue \ ++ epilogue \ ++ __exit ++ ++ # libgcc... ++ ifeq ($(TARGET_ASSEMBLER), ava) ++ LIBGCC = libgcc.o libgcc-mega.o ++ INSTALL_LIBGCC = install-libgcc-ava ++ endif ++ ++ LIBGCC1_TEST = ++ ++ # We do not have DF or DI types, so fake out the libgcc2 compilation. ++ TARGET_LIBGCC2_CFLAGS = -DDF=SF -Dinhibit_libc ++ #LIBGCC2 = $(LIBGCC1) ++ ++ LIBGCC_AVA = libgcc.o libgcc-mega.o ++ ++ fp-bit.c: $(srcdir)/config/fp-bit.c $(srcdir)/config/avr/t-avr ++ echo '#define FLOAT' > fp-bit.c ++ echo '#define FLOAT_ONLY' >> fp-bit.c ++ echo '#define CMPtype QItype' >> fp-bit.c ++ echo '#define DF SF' >> fp-bit.c ++ echo '#define DI SI' >> fp-bit.c ++ echo '#define FLOAT_BIT_ORDER_MISMATCH' >> fp-bit.c ++ echo '#define SMALL_MACHINE' >> fp-bit.c ++ echo 'typedef int QItype __attribute__ ((mode (QI)));' >> fp-bit.c ++ cat $(srcdir)/config/fp-bit.c >> fp-bit.c ++ ++ install-libgcc-ava: $(LIBGCC_AVA) ++ $(INSTALL_DATA) libgcc.o $(libsubdir)/libgcc.o ++ $(INSTALL_DATA) libgcc-mega.o $(libsubdir)/libgcc-mega.o ++ ++ AR_FOR_TARGET = avr-ar ++ RANLIB_FOR_TARGET = avr-ranlib ++ ++ FPBIT = fp-bit.c ++ #fp-bit.c ++ ++ # Internal AVR port variable ++ AVA_LIB_FILE = $(srcdir)/config/avr/libgcc.S ++ ++ libgcc.o: $(AVA_LIB_FILE) ++ $(GCC_FOR_TARGET) -DASSEMBLER_AVA -E -P -o $(objdir)/libgcc.s $(srcdir)/config/avr/libgcc.S ++ ava -favr_noendianbug -AAT90S8515 -o $(objdir)/libgcc.o $(objdir)/libgcc.s ++ ++ libgcc-mega.o: $(AVA_LIB_FILE) ++ $(GCC_FOR_TARGET) -DASSEMBLER_AVA -P -E -mmcu=atmega603 -o $(objdir)/libgcc-mega.s $(srcdir)/config/avr/libgcc.S ++ ava -favr_noendianbug -AATmega603 -o $(objdir)/libgcc-mega.o $(objdir)/libgcc-mega.s +diff -Nrc3p gcc-2.95.2.orig/gcc/config/avr/xm-avr.h gcc-2.95.2/gcc/config/avr/xm-avr.h +*** gcc-2.95.2.orig/gcc/config/avr/xm-avr.h Sat Dec 18 17:50:17 1999 +--- gcc-2.95.2/gcc/config/avr/xm-avr.h Sun Oct 31 00:01:25 1999 +*************** +*** 0 **** +--- 1 ---- ++ #include "tm.h" +diff -Nrc3p gcc-2.95.2.orig/gcc/ginclude/va-avr.h gcc-2.95.2/gcc/ginclude/va-avr.h +*** gcc-2.95.2.orig/gcc/ginclude/va-avr.h Sat Dec 18 17:50:17 1999 +--- gcc-2.95.2/gcc/ginclude/va-avr.h Thu Nov 25 23:29:08 1999 +*************** +*** 0 **** +--- 1,49 ---- ++ /* stdarg/vararg support for the ATMEL AVR microcontroller */ ++ ++ /* Define __gnuc_va_list. */ ++ ++ #ifndef __GNUC_VA_LIST ++ #define __GNUC_VA_LIST ++ typedef void *__gnuc_va_list; ++ #endif ++ ++ /* If this is for internal libc use, don't define anything but ++ __gnuc_va_list. */ ++ #if defined (_STDARG_H) || defined (_VARARGS_H) ++ ++ /* In GCC version 2, we want an ellipsis at the end of the declaration ++ of the argument list. GCC version 1 can't parse it. */ ++ ++ #if __GNUC__ > 1 ++ #define __va_ellipsis ... ++ #else ++ #define __va_ellipsis ++ #endif ++ ++ #define __va_rounded_size(TYPE) sizeof (TYPE) ++ ++ #ifdef _STDARG_H ++ ++ #define va_start(AP,LASTARG) \ ++ (AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG))) ++ ++ #else /* _VARARGS_H */ ++ ++ #define va_alist __builtin_va_alist ++ /* The ... causes current_function_varargs to be set in cc1. */ ++ #define va_dcl int __builtin_va_alist; __va_ellipsis ++ #define va_start(AP) AP = (void *) &__builtin_va_alist ++ ++ #endif /* _VARARGS_H */ ++ ++ /* This is for little-endian machines; small args are padded upward. */ ++ #define va_arg(AP, TYPE) \ ++ (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ ++ *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))) ++ ++ #define va_end(AP) ((void) 0) ++ ++ /* Copy __gnuc_va_list into another variable of this type. */ ++ #define __va_copy(dest, src) (dest) = (src) ++ ++ #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ +diff -Nrc3p gcc-2.95.2.orig/gcc/ginclude/stdarg.h gcc-2.95.2/gcc/ginclude/stdarg.h +*** gcc-2.95.2.orig/gcc/ginclude/stdarg.h Sun Aug 1 23:09:54 1999 +--- gcc-2.95.2/gcc/ginclude/stdarg.h Thu Nov 25 23:29:05 1999 +*************** +*** 62,67 **** +--- 62,70 ---- + #if defined (_TMS320C4x) || defined (_TMS320C3x) + #include + #else ++ #ifdef __AVR__ ++ #include "va-avr.h" ++ #else + + /* Define __gnuc_va_list. */ + +*************** void va_end (__gnuc_va_list); /* Define +*** 121,126 **** +--- 124,130 ---- + + #endif /* _STDARG_H */ + ++ #endif /* not AVR */ + #endif /* not TMS320C3x or TMS320C4x */ + #endif /* not v850 */ + #endif /* not mn10200 */ +diff -Nrc3p gcc-2.95.2.orig/gcc/ginclude/varargs.h gcc-2.95.2/gcc/ginclude/varargs.h +*** gcc-2.95.2.orig/gcc/ginclude/varargs.h Sun Aug 1 23:09:55 1999 +--- gcc-2.95.2/gcc/ginclude/varargs.h Thu Nov 25 23:29:10 1999 +*************** +*** 60,65 **** +--- 60,68 ---- + #if defined (_TMS320C4x) || defined (_TMS320C3x) + #include + #else ++ #ifdef __AVR__ ++ #include "va-avr.h" ++ #else + + #ifdef __NeXT__ + +*************** typedef void *__gnuc_va_list; +*** 140,145 **** +--- 143,149 ---- + /* Copy __gnuc_va_list into another variable of this type. */ + #define __va_copy(dest, src) (dest) = (src) + ++ #endif /* not AVR */ + #endif /* not TMS320C3x or TMS320C4x */ + #endif /* not v850 */ + #endif /* not mn10200 */ +diff -Nrc3p gcc-2.95.2.orig/gcc/invoke.texi gcc-2.95.2/gcc/invoke.texi +*** gcc-2.95.2.orig/gcc/invoke.texi Sat Oct 30 20:13:09 1999 +--- gcc-2.95.2/gcc/invoke.texi Thu Nov 25 23:28:57 1999 +*************** in the following sections. +*** 409,414 **** +--- 409,418 ---- + -m32032 -m32332 -m32532 -m32081 -m32381 -mmult-add -mnomult-add + -msoft-float -mrtd -mnortd -mregparam -mnoregparam -msb -mnosb + -mbitfield -mnobitfield -mhimem -mnohimem ++ ++ @emph{AVR Options} ++ -mmcu=@var{mcu} -msize -minit-stack=@var{n} -mtarget-include ++ -mno-interrupts -mcall-prologues -mava + @end smallexample + + @item Code Generation Options +*************** that macro, which enables you to change +*** 3125,3130 **** +--- 3129,3135 ---- + * V850 Options:: + * ARC Options:: + * NS32K Options:: ++ * AVR Options:: + @end menu + + @node M680x0 Options +*************** Put functions, data, and readonly data i +*** 5975,5980 **** +--- 5980,6017 ---- + by default. This can be overridden with the @code{section} attribute. + @xref{Variable Attributes}. + ++ @end table ++ ++ @node AVR Options ++ @subsection AVR Options ++ @cindex AVR Options ++ ++ These options are defined for AVR implementations: ++ ++ @table @code ++ @item -mmcu=@var{mcu} ++ Specify ATMEL AVR mcu (at90s23xx,attiny22,at90s44xx,at90s85xx,atmega603, ++ atmega103). ++ ++ @item -msize ++ Output instruction size's to the asm file ++ ++ @item -minit-stack=@var{N} ++ Specify the initial stack address ++ ++ @item -mtarget-include ++ Add line @samp{#include "target.inc"} to front of asm file ++ ++ @item -mno-interrupts ++ Generated code is not compatible with hardware interrupts. ++ Code size will be smaller. ++ ++ @item -mcall-prologues ++ Functions prologues/epilogues expanded as call to appropriate ++ subroutines. Code size will be smaller. ++ ++ @item -mava ++ Use AVA as assembler and linker. + @end table + + @node NS32K Options +diff -Nrc3p gcc-2.95.2.orig/gcc/install.texi gcc-2.95.2/gcc/install.texi +*** gcc-2.95.2.orig/gcc/install.texi Sun Aug 1 23:09:55 1999 +--- gcc-2.95.2/gcc/install.texi Thu Nov 25 23:28:55 1999 +*************** Here are the possible CPU types: +*** 726,732 **** + + @quotation + @c gmicro, alliant, spur and tahoe omitted since they don't work. +! 1750a, a29k, alpha, arm, c@var{n}, clipper, dsp16xx, elxsi, h8300, + hppa1.0, hppa1.1, i370, i386, i486, i586, i860, i960, m32r, m68000, m68k, + m88k, mips, mipsel, mips64, mips64el, ns32k, powerpc, powerpcle, + pyramid, romp, rs6000, sh, sparc, sparclite, sparc64, vax, we32k. +--- 726,732 ---- + + @quotation + @c gmicro, alliant, spur and tahoe omitted since they don't work. +! 1750a, a29k, alpha, arm, avr, c@var{n}, clipper, dsp16xx, elxsi, h8300, + hppa1.0, hppa1.1, i370, i386, i486, i586, i860, i960, m32r, m68000, m68k, + m88k, mips, mipsel, mips64, mips64el, ns32k, powerpc, powerpcle, + pyramid, romp, rs6000, sh, sparc, sparclite, sparc64, vax, we32k. +*************** particular configuration. +*** 945,950 **** +--- 945,958 ---- + + @item a29k-*-bsd + AMD Am29050 used in a system running a variant of BSD Unix. ++ ++ @item avr ++ ATMEL AVR-family micro controllers. These are used in embedded ++ applications. There are no standard Unix configurations. ++ Supports following MCU's: ++ - AT90S8515 ++ - ATmega603/603L ++ - ATmega103/103L + + @item decstation-* + MIPS-based DECstations can support three different personalities: +diff -Nrc3p gcc-2.95.2.orig/gcc/extend.texi gcc-2.95.2/gcc/extend.texi +*** gcc-2.95.2.orig/gcc/extend.texi Sun Aug 1 23:09:48 1999 +--- gcc-2.95.2/gcc/extend.texi Mon Dec 13 22:30:51 1999 +*************** function is an interrupt handler. The c +*** 1657,1662 **** +--- 1657,1681 ---- + entry and exit sequences suitable for use in an interrupt handler when this + attribute is present. + ++ Interrupt handler functions on the AVR processors ++ Use this option on the AVR to indicate that the specified ++ function is an interrupt handler. The compiler will generate function ++ entry and exit sequences suitable for use in an interrupt handler when this ++ attribute is present. Interrupts will be enabled inside function. ++ ++ @item signal ++ @cindex signal handler functions on the AVR processors ++ Use this option on the AVR to indicate that the specified ++ function is an signal handler. The compiler will generate function ++ entry and exit sequences suitable for use in an signal handler when this ++ attribute is present. Interrupts will be disabled inside function. ++ ++ @item naked ++ @cindex function without a prologue/epilogue code on the AVR processors ++ Use this option on the AVR to indicate that the specified ++ function don't have a prologue/epilogue. The compiler don't generate ++ function entry and exit sequences. ++ + @item model (@var{model-name}) + @cindex function addressability on the M32R/D + Use this attribute on the M32R/D to set the addressability of an object, +diff -Nrc3p gcc-2.95.2.orig/gcc/md.texi gcc-2.95.2/gcc/md.texi +*** gcc-2.95.2.orig/gcc/md.texi Sun Aug 1 23:10:00 1999 +--- gcc-2.95.2/gcc/md.texi Thu Nov 25 23:29:00 1999 +*************** A floating point constant (in @code{asm} +*** 1351,1356 **** +--- 1351,1416 ---- + independent @samp{E} or @samp{F} instead) + @end table + ++ @item AVR family---@file{avr.h} ++ @table @code ++ @item l ++ Registers from r0 to r15 ++ ++ @item a ++ Registers from r16 to r23 ++ ++ @item d ++ Registers from r16 to r31 ++ ++ @item w ++ Register from r24 to r31. This registers can be used in @samp{addw} command ++ ++ @item e ++ Pointer register (r26 - r31) ++ ++ @item b ++ Base pointer register (r28 - r31) ++ ++ @item t ++ Temporary register r0 ++ ++ @item x ++ Register pair X (r27:r26) ++ ++ @item y ++ Register pair Y (r29:r28) ++ ++ @item z ++ Register pair Z (r31:r30) ++ ++ @item I ++ Constant greater than -1, less than 64 ++ ++ @item J ++ Constant greater than -64, less than 1 ++ ++ @item K ++ Constant integer 2 ++ ++ @item L ++ Constant integer 0 ++ ++ @item M ++ Constant that fits in 8 bits ++ ++ @item N ++ Constant integer -1 ++ ++ @item O ++ Constant integer 8 ++ ++ @item P ++ Constant integer 1 ++ ++ @item G ++ A floating point constant 0.0 ++ @end table ++ + @item IBM RS6000---@file{rs6000.h} + @table @code + @item b +diff -Nrc3p gcc-2.95.2.orig/gcc/configure.in gcc-2.95.2/gcc/configure.in +*** gcc-2.95.2.orig/gcc/configure.in Sat Oct 30 20:13:07 1999 +--- gcc-2.95.2/gcc/configure.in Sat Oct 30 22:26:10 1999 +*************** changequote([,])dnl +*** 2721,2726 **** +--- 2721,2728 ---- + pdp11-*-bsd) + tm_file="${tm_file} pdp11/2bsd.h" + ;; ++ avr-*-*) ++ ;; + pdp11-*-*) + ;; + ns32k-*-openbsd*) +diff -Nrc3p gcc-2.95.2.orig/gcc/Makefile.in gcc-2.95.2/gcc/Makefile.in +*** gcc-2.95.2.orig/gcc/Makefile.in Sat Aug 21 17:11:52 1999 +--- gcc-2.95.2/gcc/Makefile.in Thu Nov 25 23:28:47 1999 +*************** USER_H = $(srcdir)/ginclude/stdarg.h $(s +*** 157,162 **** +--- 157,163 ---- + $(srcdir)/ginclude/va-m32r.h $(srcdir)/ginclude/va-sh.h \ + $(srcdir)/ginclude/va-v850.h $(srcdir)/ginclude/va-arc.h \ + $(srcdir)/ginclude/iso646.h $(srcdir)/ginclude/va-ppc.h \ ++ $(srcdir)/ginclude/va-avr.h \ + $(srcdir)/ginclude/va-c4x.h $(EXTRA_HEADERS) $(LANG_EXTRA_HEADERS) \ + $(srcdir)/ginclude/proto.h $(srcdir)/ginclude/stdbool.h + +diff -Nrc3p gcc-2.95.2.orig/config.sub gcc-2.95.2/config.sub +*** gcc-2.95.2.orig/config.sub Sat Aug 21 17:11:51 1999 +--- gcc-2.95.2/config.sub Thu Nov 25 23:29:50 1999 +*************** case $basic_machine in +*** 168,174 **** + | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | alpha | alphaev5 | alphaev56 | alphapca56 | alphaev6 \ + | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ +! | 1750a | dsp16xx | pdp11 \ + | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ + | mipstx39 | mipstx39el \ + | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x) +--- 168,174 ---- + | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | alpha | alphaev5 | alphaev56 | alphapca56 | alphaev6 \ + | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ +! | 1750a | dsp16xx | pdp11 | avr \ + | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ + | mipstx39 | mipstx39el \ + | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x) +diff -Nrc3p gcc-2.95.2.orig/gcc/expr.c gcc-2.95.2/gcc/expr.c +*** gcc-2.95.2.orig/gcc/expr.c Sun Aug 1 23:09:47 1999 +--- gcc-2.95.2/gcc/expr.c Wed Dec 15 23:03:14 1999 +*************** emit_move_insn_1 (x, y) +*** 2710,2720 **** + X with a reference to the stack pointer. */ + if (push_operand (x, GET_MODE (x))) + { + anti_adjust_stack (GEN_INT (GET_MODE_SIZE (GET_MODE (x)))); +! x = change_address (x, VOIDmode, stack_pointer_rtx); +! } + #endif +! + /* Show the output dies here. This is necessary for pseudos; + hard regs shouldn't appear here except as return values. + We never want to emit such a clobber after reload. */ +--- 2710,2732 ---- + X with a reference to the stack pointer. */ + if (push_operand (x, GET_MODE (x))) + { ++ rtx ptr_rtx = stack_pointer_rtx; + anti_adjust_stack (GEN_INT (GET_MODE_SIZE (GET_MODE (x)))); +! #if defined (STACK_POINTER_OFFSET) || defined (STACK_DYNAMIC_OFFSET) +! { +! rtx addend; +! #ifdef STACK_DYNAMIC_OFFSET +! addend = GEN_INT (STACK_DYNAMIC_OFFSET (current_function_decl)); +! #else +! addend = GEN_INT (STACK_POINTER_OFFSET); +! #endif +! ptr_rtx = gen_rtx (PLUS, Pmode, stack_pointer_rtx, addend); +! } + #endif +! x = change_address (x, VOIDmode, ptr_rtx); +! } +! #endif +! + /* Show the output dies here. This is necessary for pseudos; + hard regs shouldn't appear here except as return values. + We never want to emit such a clobber after reload. */ +diff -Nrc3p gcc-2.95.2.orig/gcc/final.c gcc-2.95.2/gcc/final.c +*** gcc-2.95.2.orig/gcc/final.c Sun Aug 1 23:09:48 1999 +--- gcc-2.95.2/gcc/final.c Sat Dec 11 20:21:59 1999 +*************** shorten_branches (first) +*** 1271,1277 **** + * GET_MODE_SIZE (GET_MODE (body))); + /* Alignment is handled by ADDR_VEC_ALIGN. */ + } +! else if (asm_noperands (body) >= 0) + insn_lengths[uid] = asm_insn_count (body) * insn_default_length (insn); + else if (GET_CODE (body) == SEQUENCE) + { +--- 1271,1277 ---- + * GET_MODE_SIZE (GET_MODE (body))); + /* Alignment is handled by ADDR_VEC_ALIGN. */ + } +! else if (GET_CODE (body) == ASM_INPUT || asm_noperands (body) >= 0) + insn_lengths[uid] = asm_insn_count (body) * insn_default_length (insn); + else if (GET_CODE (body) == SEQUENCE) + { +*************** shorten_branches (first) +*** 1291,1297 **** + int inner_uid = INSN_UID (inner_insn); + int inner_length; + +! if (asm_noperands (PATTERN (XVECEXP (body, 0, i))) >= 0) + inner_length = (asm_insn_count (PATTERN (inner_insn)) + * insn_default_length (inner_insn)); + else +--- 1291,1298 ---- + int inner_uid = INSN_UID (inner_insn); + int inner_length; + +! if (GET_CODE (PATTERN (XVECEXP (body, 0, i))) == ASM_INPUT +! || asm_noperands (PATTERN (XVECEXP (body, 0, i))) >= 0) + inner_length = (asm_insn_count (PATTERN (inner_insn)) + * insn_default_length (inner_insn)); + else --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-empty-struct-init.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-empty-struct-init.dpatch @@ -0,0 +1,75 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +To: gcc-patches at gcc dot gnu dot org +# DP: Subject: empty struct initializer fix +# DP: From: Richard Henderson +# DP: Date: Sun, 20 Feb 2000 00:33:40 -0800 + +Fixes + + struct empty { }; + struct something { + int spacer; + struct empty foo; + int bar; + }; + + struct something X = { + foo: (struct empty) { }, + bar: 1, + }; + +which used to abort. + + +r~ + + * c-typeck.c (add_pending_init): Don't abort for multiple + fields at the same offset. + (pending_init_member): Test the correct member. + +--- gcc/c-typeck.c.orig Wed Feb 23 18:38:30 2000 ++++ gcc/c-typeck.c Wed Feb 23 18:38:35 2000 +@@ -5846,7 +5846,7 @@ + p = *q; + if (tree_int_cst_lt (purpose, p->purpose)) + q = &p->left; +- else if (tree_int_cst_lt (p->purpose, purpose)) ++ else if (p->purpose != purpose) + q = &p->right; + else + abort (); +@@ -5860,8 +5860,7 @@ + if (tree_int_cst_lt (DECL_FIELD_BITPOS (purpose), + DECL_FIELD_BITPOS (p->purpose))) + q = &p->left; +- else if (tree_int_cst_lt (DECL_FIELD_BITPOS (p->purpose), +- DECL_FIELD_BITPOS (purpose))) ++ else if (p->purpose != purpose) + q = &p->right; + else + abort (); +@@ -6046,7 +6045,7 @@ + { + while (p) + { +- if (tree_int_cst_equal (field, p->purpose)) ++ if (field == p->purpose) + return 1; + else if (tree_int_cst_lt (field, p->purpose)) + p = p->left; --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-m68k-pic.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-m68k-pic.dpatch @@ -0,0 +1,62 @@ +#! /bin/sh -e + +# DP: Two patches by Andreas Schwab to fix -fpic and loop optimization. +# DP: Another patch by Andreas Schwab to fix %a5 restauration in some cases. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +------------------------------------------------------------------------------ +--- gcc/config/m68k/m68k.c~ Mon Aug 2 06:51:08 1999 ++++ gcc/config/m68k/m68k.c Fri Oct 22 11:47:09 1999 +@@ -356,7 +356,7 @@ + mask &= ~ (1 << (15 - FRAME_POINTER_REGNUM)); + num_saved_regs--; + } +- if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM]) ++ if (flag_pic && current_function_uses_pic_offset_table) + { + mask |= 1 << (15 - PIC_OFFSET_TABLE_REGNUM); + num_saved_regs++; +@@ -493,7 +493,10 @@ + for (regno = 0 ; regno < FIRST_PSEUDO_REGISTER ; regno++) + if (regs_ever_live[regno] && ! call_used_regs[regno]) + return 0; +- ++ ++ if (flag_pic && current_function_uses_pic_offset_table) ++ return 0; ++ + return 1; + } + +@@ -568,7 +571,7 @@ + nregs++; + mask |= 1 << regno; + } +- if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM]) ++ if (flag_pic && current_function_uses_pic_offset_table) + { + nregs++; + mask |= 1 << PIC_OFFSET_TABLE_REGNUM; +@@ -1334,8 +1337,6 @@ + gen_rtx_PLUS (Pmode, + pic_offset_table_rtx, orig)); + current_function_uses_pic_offset_table = 1; +- if (reload_in_progress) +- regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1; + RTX_UNCHANGING_P (pic_ref) = 1; + emit_move_insn (reg, pic_ref); + return reg; --- gcc-2.95-2.95.4.ds15.orig/debian/patches/libstdc++-bastring.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/libstdc++-bastring.dpatch @@ -0,0 +1,63 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +/* +From: Richard Kettlewell +To: submit@bugs.debian.org +Subject: Bug#46550: basic_string can't be instantiated +Date: Sun, 3 Oct 1999 22:49:50 +0100 + +Package: libstdc++2.9-dev +Version: 2.91.60-5 + +Hi, + +This ought to work, but it doesn't: + +------------------------------------------------------------------------ +lyonesse$ cat t.cc +*/ + +#include + +template basic_string; + +/* +lyonesse$ c++ -c t.cc +/usr/include/g++-2/std/bastring.h: In method `const __wchar_t * basic_string<__wchar_t,string_char_traits<__wchar_t>,__default_alloc_template >::c_str<__wchar_t, string_char_traits<__wchar_t>, alloc>() const': +t.cc:3: instantiated from here +/usr/include/g++-2/std/bastring.h:301: return to `const __wchar_t *' from `char *' +lyonesse$ +------------------------------------------------------------------------ + +# DP: Here is a patch to /usr/include/g++-2/std/bastring.h which makes it +# DP: work for me (though note that I have not tested the c_str() method as +# DP: such): + +------------------------------------------------------------------------ +--- libstdc++/std/bastring.h.orig Sun Oct 3 22:32:06 1999 ++++ libstdc++/std/bastring.h Sun Oct 3 22:36:17 1999 +@@ -332,7 +332,8 @@ + + public: + const charT* c_str () const +- { if (length () == 0) return ""; terminate (); return data (); } ++ { const charT* null_str = ""; ++ if (length () == 0) return null_str; terminate (); return data (); } + void resize (size_type n, charT c); + void resize (size_type n) + { resize (n, eos ()); } --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-mips-reg_zero.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-mips-reg_zero.dpatch @@ -0,0 +1,77 @@ +#! /bin/sh -e + +src=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + src=$3/gcc +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p1 < $0 + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p1 < $0 + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +diff -up --recursive --new-file gcc-2.95.3.macro/gcc/config/mips/mips.md gcc-2.95.3/gcc/config/mips/mips.md +--- gcc-2.95.3.macro/gcc/config/mips/mips.md Tue Jun 29 01:59:20 1999 ++++ gcc-2.95.3/gcc/config/mips/mips.md Mon Apr 23 17:16:12 2001 +@@ -2441,17 +2441,11 @@ + { + if (GENERATE_BRANCHLIKELY) + { +- if (GET_CODE (operands[1]) == CONST_INT) +- return \"%(beql\\t%0,$0,1f\\n\\tbreak\\t%2\\n1:%)\"; +- else +- return \"%(beql\\t%0,%1,1f\\n\\tbreak\\t%2\\n1:%)\"; ++ return \"%(beql\\t%0,%z1,1f\\n\\tbreak\\t%2\\n1:%)\"; + } + else + { +- if (GET_CODE (operands[1]) == CONST_INT) +- return \"%(bne\\t%0,$0,1f\\n\\tnop\\n\\tbreak\\t%2\\n1:%)\"; +- else +- return \"%(bne\\t%0,%1,1f\\n\\tnop\\n\\tbreak\\t%2\\n1:%)\"; ++ return \"%(bne\\t%0,%z1,1f\\n\\tnop\\n\\tbreak\\t%2\\n1:%)\"; + } + } + return \"\"; +@@ -2485,10 +2479,7 @@ + if (! have_dep_anti) + { + /* No branch delay slots on mips16. */ +- if (GET_CODE (operands[1]) == CONST_INT) +- return \"%(bnez\\t%0,1f\\n\\tbreak\\t%2\\n1:%)\"; +- else +- return \"%(bne\\t%0,%1,1f\\n\\tbreak\\t%2\\n1:%)\"; ++ return \"%(bne\\t%0,%z1,1f\\n\\tbreak\\t%2\\n1:%)\"; + } + return \"\"; + }" +@@ -4678,7 +4669,7 @@ move\\t%0,%z4\\n\\ + + if ((INTVAL (offset) & 3) == 0 + && (mem_addr == stack_pointer_rtx || mem_addr == frame_pointer_rtx)) +- return \"sw\\t%1,%0\"; ++ return \"sw\\t%z1,%0\"; + + return \"usw\\t%z1,%0\"; + }" +@@ -4737,7 +4728,7 @@ move\\t%0,%z4\\n\\ + + if ((INTVAL (offset) & 7) == 0 + && (mem_addr == stack_pointer_rtx || mem_addr == frame_pointer_rtx)) +- return \"sd\\t%1,%0\"; ++ return \"sd\\t%z1,%0\"; + + return \"usd\\t%z1,%0\"; + }" --- gcc-2.95-2.95.4.ds15.orig/debian/patches/libf2c-mkstemp.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/libf2c-mkstemp.dpatch @@ -0,0 +1,106 @@ +#! /bin/sh -e + +# DP: use mkstemp in libf2c/libI77 +# DP: taken from http://gcc.gnu.org/ml/gcc-patches/2000-11/msg00708.html + +src=libf2c/libI77 +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + src=$3/libf2c/libI77 +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p0 < $0 + cd $src && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 + cd $src && autoconf + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +*** libf2c/libI77/configure.in.orig Mon Nov 13 18:55:06 2000 +--- libf2c/libI77/configure.in Tue Nov 14 20:49:05 2000 +*************** else +*** 130,133 **** +--- 130,134 ---- + fi + ++ AC_CHECK_FUNCS(mkstemp) + AC_CHECK_FUNCS(tempnam) + + + +--- libf2c/libI77/open.c Mon May 10 16:40:59 1999 ++++ libf2c/libI77/open.c Sun Jul 1 13:20:43 2001 +@@ -133,10 +133,11 @@ + #endif + { unit *b; + integer rv; +- char buf[256], *s; ++ char buf[256], *s, *env; + cllist x; + int ufmt; + FILE *tf; ++ int fd, len; + #ifndef NON_UNIX_STDIO + int n; + #endif +@@ -209,6 +210,19 @@ + case 's': + case 'S': + b->uscrtch=1; ++#ifdef HAVE_MKSTEMP /* Allow use of TMPDIR preferentially. */ ++ env = getenv("TMPDIR"); ++ if (!env) env = getenv("TEMP"); ++ if (!env) env = "/tmp"; ++ len = strlen(env); ++ if (len > 256 - sizeof "/tmp.FXXXXXX") ++ err (a->oerr, 132, "open"); ++ strcpy(buf, env); ++ strcat(buf, "/tmp.FXXXXXX"); ++ fd = mkstemp(buf); ++ if (fd == -1 || close(fd)) ++ err (a->oerr, 132, "open"); ++#else /* ! defined (HAVE_MKSTEMP) */ + #ifdef HAVE_TEMPNAM /* Allow use of TMPDIR preferentially. */ + s = tempnam (0, buf); + if (strlen (s) >= sizeof (buf)) +@@ -223,6 +237,7 @@ + (void) mktemp(buf); + #endif + #endif /* ! defined (HAVE_TEMPNAM) */ ++#endif /* ! defined (HAVE_MKSTEMP) */ + goto replace; + case 'n': + case 'N': + +Example code: + + PROGRAM TEMP + CHARACTER*20 LINE + OPEN(UNIT=3,STATUS='SCRATCH') + WRITE(3,*)'HELLO, WORLD' + PAUSE + REWIND(3) + PAUSE + READ(3,'(a)')LINE + CLOSE(3) + PAUSE + PRINT*,LINE + END + +[ Bootstrapped and tested on i686-pc-linux-gnu ] + +-- +Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290 +Saturnushof 14, 3738 XG Maartensdijk, The Netherlands +GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html +GNU Fortran 95: http://g95.sourceforge.net/ (under construction) --- gcc-2.95-2.95.4.ds15.orig/debian/patches/libf2c-alpha.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/libf2c-alpha.dpatch @@ -0,0 +1,30 @@ +#! /bin/sh -e + +# DP: build libf2c with -mieee on alpha. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- libf2c/Makefile.in~ Sat Aug 7 07:36:10 1999 ++++ libf2c/Makefile.in Mon Mar 4 20:44:36 2002 +@@ -55,7 +55,7 @@ + RANLIB = @RANLIB@ + + CC = @CC@ +-CFLAGS = @CFLAGS@ ++CFLAGS = -mieee @CFLAGS@ + + # List of variables to pass to sub-makes. + # Quote this way so that it can be used to set shell variables too. --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-gas-hidden.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-gas-hidden.dpatch @@ -0,0 +1,457 @@ +#! /bin/sh -e + +src=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + src=$3/gcc +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p1 -l < $0 + cd $src && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p1 -l < $0 + cd $src && autoconf + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +2000-04-29 Richard Henderson + + * config/alpha/crtbegin.asm: Use C comments instead of #. + Mark __dso_handle hidden. + +2000-02-16 Richard Henderson + + * configure.in (alpha-linux*, alpha-netbsd) [extra_parts]: + Add crtbeginS.o and crtendS.o. + * alpha/elf.h (STARTFILE_SPEC): Use crtbeginS.o. + (ENDFILE_SPEC): Use crtendS.o. + * alpha/t-crtbe (crtbeginS.o, crtendS.o): New targets. + + * alpha/crtbegin.asm (__do_frame_takedown): Merge into ... + (__do_global_dtors_aux): ... here. Call __cxa_finalize if + shared and present. + (__dso_handle): New variable. + +2000-04-04 Ulrich Drepper + + * acconfig.h: Add HAVE_GAS_HIDDEN. + * config.in: Regenerated. + * configure.in: Add test for .hidden pseudo-op in gas. + * configure: Regenerated. + * crtstuff.c: Include auto-host.h. + Emit additional .hidden pseudo-op for __dso_handle if the + assembler knows about it. + +--- gcc-2.95.x/gcc/config/alpha/t-crtbe.jj Wed Dec 16 22:01:05 1998 ++++ gcc-2.95.x/gcc/config/alpha/t-crtbe Mon Aug 13 11:08:08 2001 +@@ -3,7 +3,13 @@ T = disable + + # Assemble startup files. + crtbegin.o: $(srcdir)/config/alpha/crtbegin.asm $(GCC_PASSES) +- $(GCC_FOR_TARGET) -c -o crtbegin.o -x assembler $(srcdir)/config/alpha/crtbegin.asm ++ $(GCC_FOR_TARGET) -c -o crtbegin.o -x assembler-with-cpp -I. $(srcdir)/config/alpha/crtbegin.asm + + crtend.o: $(srcdir)/config/alpha/crtend.asm $(GCC_PASSES) +- $(GCC_FOR_TARGET) -c -o crtend.o -x assembler $(srcdir)/config/alpha/crtend.asm ++ $(GCC_FOR_TARGET) -c -o crtend.o -x assembler $(srcdir)/config/alpha/crtend.asm ++ ++crtbeginS.o: $(srcdir)/config/alpha/crtbegin.asm $(GCC_PASSES) ++ $(GCC_FOR_TARGET) -DSHARED -c -o crtbeginS.o -x assembler-with-cpp -I. $(srcdir)/config/alpha/crtbegin.asm ++ ++crtendS.o: $(srcdir)/config/alpha/crtend.asm $(GCC_PASSES) ++ $(GCC_FOR_TARGET) -c -o crtendS.o -x assembler -I. $(srcdir)/config/alpha/crtend.asm +--- gcc-2.95.x/gcc/config/alpha/elf.h.jj Mon Jun 21 22:15:10 1999 ++++ gcc-2.95.x/gcc/config/alpha/elf.h Mon Aug 13 11:09:13 2001 +@@ -513,7 +513,7 @@ do { \ + #define STARTFILE_SPEC \ + "%{!shared: \ + %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\ +- crti.o%s crtbegin.o%s" ++ crti.o%s %{shared:crtbeginS.o%s}%{!shared:crtbegin.o%s}" + + /* Provide a ENDFILE_SPEC appropriate for ELF. Here we tack on the + magical crtend.o file which provides part of the support for +@@ -522,7 +522,7 @@ do { \ + + #undef ENDFILE_SPEC + #define ENDFILE_SPEC \ +- "crtend.o%s crtn.o%s" ++ "%{shared:crtendS.o%s}%{!shared:crtend.o%s} crtn.o%s" + + /* We support #pragma. */ + #define HANDLE_SYSV_PRAGMA +--- gcc-2.95.x/gcc/crtstuff.c 2001/04/03 10:34:32 1.18.4.1 ++++ gcc-2.95.x/gcc/crtstuff.c 2001/08/09 06:56:33 +@@ -55,6 +55,7 @@ Boston, MA 02111-1307, USA. */ + #include "defaults.h" + #include + #include "frame.h" ++#include "auto-host.h" + + /* We do not want to add the weak attribute to the declarations of these + routines in frame.h because that will cause the definition of these +@@ -134,7 +135,29 @@ typedef void (*func_ptr) (void); + #ifdef INIT_SECTION_ASM_OP + + #ifdef OBJECT_FORMAT_ELF ++/* Declare the __dso_handle variable. It should have a unique value ++ in every shared-object; in a main program its value is zero. The ++ object should in any case be protected. This means the instance ++ in one DSO or the main program is not used in another object. The ++ dynamic linker takes care of this. */ ++ ++/* XXX Ideally the following should be implemented using ++ __attribute__ ((__visibility__ ("hidden"))) ++ but the __attribute__ support is not yet there. */ ++#ifdef HAVE_GAS_HIDDEN ++asm (".hidden\t__dso_handle"); ++#endif ++ ++#ifdef CRTSTUFFS_O ++void *__dso_handle = &__dso_handle; ++#else ++void *__dso_handle = 0; ++#endif + ++/* The __cxa_finalize function may not be available so we use only a ++ weak declaration. */ ++extern void __cxa_finalize (void *) TARGET_ATTRIBUTE_WEAK; ++ + /* Run all the global destructors on exit from the program. */ + + /* Some systems place the number of pointers in the first word of the +@@ -164,6 +187,11 @@ __do_global_dtors_aux (void) + + if (completed) + return; ++ ++#ifdef CRTSTUFFS_O ++ if (__cxa_finalize) ++ __cxa_finalize (__dso_handle); ++#endif + + while (*p) + { +--- gcc-2.95.x/gcc/configure.in.jj Wed Oct 13 09:58:02 1999 ++++ gcc-2.95.x/gcc/configure.in Mon Aug 13 11:11:39 2001 +@@ -608,7 +608,7 @@ changequote([,])dnl + tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h" + target_cpu_default="MASK_GAS" + tmake_file="t-linux t-linux-gnulibc1 alpha/t-linux alpha/t-crtbe alpha/t-ieee" +- extra_parts="crtbegin.o crtend.o" ++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" + xmake_file=none + gas=yes gnu_ld=yes + if test x$enable_threads = xyes; then +@@ -619,7 +619,7 @@ changequote([,])dnl + tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h" + target_cpu_default="MASK_GAS" + tmake_file="t-linux alpha/t-linux alpha/t-crtbe alpha/t-ieee" +- extra_parts="crtbegin.o crtend.o" ++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" + xmake_file=none + gas=yes gnu_ld=yes + if test x$enable_threads = xyes; then +@@ -630,7 +630,7 @@ changequote([,])dnl + tm_file="${tm_file} alpha/elf.h alpha/netbsd.h alpha/netbsd-elf.h" + target_cpu_default="MASK_GAS" + tmake_file="alpha/t-crtbe alpha/t-ieee" +- extra_parts="crtbegin.o crtend.o" ++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" + xmake_file=none + gas=yes gnu_ld=yes + ;; +@@ -4052,6 +4052,21 @@ EOF + rm -f conftest.s conftest.o conftest.nm1 conftest.nm2 + fi + AC_MSG_RESULT($gcc_cv_as_subsections) ++ ++AC_MSG_CHECKING(assembler hidden support) ++gcc_cv_as_hidden= ++if test x$gcc_cv_as != x; then ++ # Check if we have .hidden ++ echo " .hidden foobar" > conftest.s ++ echo "foobar:" >> conftest.s ++ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then ++ AC_DEFINE(HAVE_GAS_HIDDEN, 1, ++ [Define if your assembler supports .hidden.]) ++ gcc_cv_as_hidden="yes" ++ fi ++ rm -f conftest.s conftest.o conftest.nm1 conftest.nm2 ++fi ++AC_MSG_RESULT($gcc_cv_as_hidden) + + AC_MSG_CHECKING(assembler instructions) + gcc_cv_as_instructions= +--- gcc-2.95.x/gcc/config.in.jj Mon Oct 25 10:02:08 1999 ++++ gcc-2.95.x/gcc/config.in Wed Jun 13 12:45:56 2001 +2 the beginning of your section */ + #undef HAVE_GAS_SUBSECTION_ORDERING + ++/* Define if your assembler supports .hidden. */ ++#undef HAVE_GAS_HIDDEN ++ + /* Define if your assembler uses the old HImode fild and fist notation. */ + #undef HAVE_GAS_FILDS_FISTS + + + + +--- gcc-2.95.x/gcc/config/alpha/crtbegin.asm.old Sat Sep 1 16:03:53 2001 ++++ gcc-2.95.x/gcc/config/alpha/crtbegin.asm Sat Sep 1 16:03:36 2001 +@@ -1,42 +1,46 @@ +- # Copyright (C) 1996, 1998 Free Software Foundation, Inc. +- # Contributed by Richard Henderson (rth@tamu.edu) +- # +- # This file is free software; you can redistribute it and/or modify it +- # under the terms of the GNU General Public License as published by the +- # Free Software Foundation; either version 2, or (at your option) any +- # later version. +- # +- # In addition to the permissions in the GNU General Public License, the +- # Free Software Foundation gives you unlimited permission to link the +- # compiled version of this file with other programs, and to distribute +- # those programs without any restriction coming from the use of this +- # file. (The General Public License restrictions do apply in other +- # respects; for example, they cover modification of the file, and +- # distribution when not linked into another program.) +- # +- # This file is distributed in the hope that it will be useful, but +- # WITHOUT ANY WARRANTY; without even the implied warranty of +- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- # General Public License for more details. +- # +- # You should have received a copy of the GNU General Public License +- # along with this program; see the file COPYING. If not, write to +- # the Free Software Foundation, 59 Temple Place - Suite 330, +- # Boston, MA 02111-1307, USA. +- # +- # As a special exception, if you link this library with files +- # compiled with GCC to produce an executable, this does not cause +- # the resulting executable to be covered by the GNU General Public License. +- # This exception does not however invalidate any other reasons why +- # the executable file might be covered by the GNU General Public License. +- +- # +- # Heads of the constructor/destructor lists. +- # +- +- # The __*TOR_LIST__ symbols are not global because when this file is used +- # in a shared library, we do not want the symbol to fall over to the +- # application's lists. ++/* Copyright (C) 1996, 1998 Free Software Foundation, Inc. ++ * Contributed by Richard Henderson (rth@tamu.edu) ++ * ++ * This file is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License as published by the ++ * Free Software Foundation; either version 2, or (at your option) any ++ * later version. ++ * ++ * In addition to the permissions in the GNU General Public License, the ++ * Free Software Foundation gives you unlimited permission to link the ++ * compiled version of this file with other programs, and to distribute ++ * those programs without any restriction coming from the use of this ++ * file. (The General Public License restrictions do apply in other ++ * respects; for example, they cover modification of the file, and ++ * distribution when not linked into another program.) ++ * ++ * This file is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; see the file COPYING. If not, write to ++ * the Free Software Foundation, 59 Temple Place - Suite 330, ++ * Boston, MA 02111-1307, USA. ++ * ++ * As a special exception, if you link this library with files ++ * compiled with GCC to produce an executable, this does not cause ++ * the resulting executable to be covered by the GNU General Public License. ++ * This exception does not however invalidate any other reasons why ++ * the executable file might be covered by the GNU General Public License. ++ */ ++ ++#include "auto-host.h" ++ ++/* ++ * Heads of the constructor/destructor lists. ++ */ ++ ++/* The __*TOR_LIST__ symbols are not global because when this file is used ++ * in a shared library, we do not want the symbol to fall over to the ++ * application's lists. ++ */ + + .section .ctors,"aw" + +@@ -53,35 +57,35 @@ + .section .eh_frame,"aw" + __EH_FRAME_BEGIN__: + +- # +- # Fragment of the ELF _fini routine that invokes our dtor cleanup. +- # ++/* ++ * Fragment of the ELF _fini routine that invokes our dtor cleanup. ++ */ + + .section .fini,"ax" + +- # Since the bits of the _fini function are spread across many +- # object files, each potentially with its own GP, we must +- # assume we need to load ours. Further, our .fini section +- # can easily be more than 4MB away from our .text bits so we +- # can't use bsr. ++ /* Since the bits of the _fini function are spread across many ++ object files, each potentially with its own GP, we must ++ assume we need to load ours. Further, our .fini section ++ can easily be more than 4MB away from our .text bits so we ++ can't use bsr. */ + + br $29,1f + 1: ldgp $29,0($29) + jsr $26,__do_global_dtors_aux + ldgp $29,0($26) + +- # Ideally this call would go in crtend.o, except that we can't +- # get hold of __EH_FRAME_BEGIN__ there. ++ /* Ideally this call would go in crtend.o, except that we can't ++ get hold of __EH_FRAME_BEGIN__ there */ + + jsr $26,__do_frame_takedown + +- # Must match the alignment we got from crti.o else we get +- # zero-filled holes in our _fini function and then SIGILL. ++ /* Must match the alignment we got from crti.o else we get ++ zero-filled holes in our _fini function and then SIGILL. */ + .align 3 + +- # +- # Fragment of the ELF _init routine that sets up the frame info. +- # ++/* ++ * Fragment of the ELF _init routine that sets up the frame info. ++ */ + + .section .init,"ax" + br $29,1f +@@ -89,32 +93,68 @@ + jsr $26,__do_frame_setup + .align 3 + +- # +- # Invoke our destructors in order. +- # ++/* ++ * Invoke our destructors in order. ++ */ + + .data + +- # Support recursive calls to exit. ++/* Support recursive calls to exit. */ + $ptr: .quad __DTOR_LIST__ + ++/* A globally unique widget for c++ local destructors to hang off. ++ ++ This has a unique value in every dso; in the main program its ++ value is zero. The object should be protected. This means the ++ instance in any dso or the main program is not used in any other ++ dso. The dynamic linker takes care of this. */ ++ ++ .global __dso_handle ++ .type __dso_handle,@object ++ .size __dso_handle,8 ++#ifdef SHARED ++.section .data ++ .align 3 ++__dso_handle: ++ .quad __dso_handle ++#else ++.section .bss ++ .align 3 ++__dso_handle: ++ .zero 8 ++#endif ++#ifdef HAVE_GAS_HIDDEN ++ .hidden __dso_handle ++#endif ++ + .text + + .align 3 + .ent __do_global_dtors_aux + + __do_global_dtors_aux: ++ ldgp $29,0($27) + lda $30,-16($30) + .frame $30,16,$26,0 + stq $9,8($30) + stq $26,0($30) + .mask 0x4000200,-16 +- .prologue 0 ++ .prologue 1 + ++#ifdef SHARED ++ /* Do c++ local destructors. */ ++ lda $1,__cxa_finalize ++ beq $1,2f ++ lda $16,__dso_handle ++ jsr $26,__cxa_finalize ++ ldgp $29,0($26) ++2: ++#endif + lda $9,$ptr + br 1f + 0: stq $1,0($9) + jsr $26,($27) ++ ldgp $29,0($26) + 1: ldq $1,0($9) + ldq $27,8($1) + addq $1,8,$1 +@@ -127,11 +167,11 @@ + + .end __do_global_dtors_aux + +- # +- # Install our frame info. +- # ++/* ++ * Install our frame info. ++ */ + +- # ??? How can we rationally keep this size correct? ++/* ??? How can we rationally keep this size correct? */ + + .section .bss + .type $object,@object +@@ -164,9 +204,9 @@ + + .end __do_frame_setup + +- # +- # Remove our frame info. +- # ++/* ++ * Remove our frame info. ++ */ + + .align 3 + .ent __do_frame_takedown +@@ -191,3 +231,6 @@ + + .weak __register_frame_info + .weak __deregister_frame_info ++#ifdef SHARED ++.weak __cxa_finalize ++#endif --- gcc-2.95-2.95.4.ds15.orig/debian/patches/cpp-dos-newlines.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/cpp-dos-newlines.dpatch @@ -0,0 +1,94 @@ +#! /bin/sh -e + +# All lines beginning with `# DPATCH:' are a description of the patch. +# DP: Handle DOS newlines after backslashes. +# DP: Patch from http://www.cygnus.com/ml/egcs/1999-Jan/0784.html + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- gcc/cccp.c.orig Thu Jun 24 15:11:40 1999 ++++ gcc/cccp.c Mon Aug 9 12:21:55 1999 +@@ -1023,7 +1023,8 @@ + retrying if necessary. If MAX_READ_LEN is defined, read at most + that bytes at a time. Return a negative value if an error occurs, + otherwise return the actual number of bytes read, +- which must be LEN unless end-of-file was reached. */ ++ which may be < LEN if CRs have been skipped, though we try not to do ++ that. */ + + static int + safe_read (desc, ptr, len) +@@ -1032,6 +1033,7 @@ + int len; + { + int left, rcount, nchars; ++ char *rptr; + + left = len; + while (left > 0) { +@@ -1051,8 +1053,20 @@ + } + if (nchars == 0) + break; +- ptr += nchars; ++ ++ /* CRLF pairs, found with Unix when processing DOS files, ++ throw off backslash-newline removal. ++ Therefore, CRs are thrown away here. */ + left -= nchars; ++ rptr = ptr; ++ while(nchars--) ++ { ++ if(*rptr == '\r' && *(rptr+1) == '\n') ++ left++; ++ else ++ *ptr++ = *rptr; ++ rptr++; ++ } + } + return len - left; + } +@@ -2085,8 +2099,8 @@ + for (;;) { + cnt = safe_read (f, (char *) fp->buf + size, bsize - size); + if (cnt < 0) goto perror; /* error! */ ++ if (cnt == 0) break; /* End of file */ + size += cnt; +- if (size != bsize) break; /* End of file */ + bsize *= 2; + fp->buf = (U_CHAR *) xrealloc (fp->buf, bsize + 2); + } +@@ -5024,6 +5038,8 @@ + map_list_ptr->map_list_map = ptr; + + while ((ch = getc (f)) != '\n') ++ if (ch == '\r') ++ continue; + if (ch == EOF) + break; + } +@@ -5256,9 +5272,9 @@ + i = safe_read (f, (char *) fp->buf + st_size, bsize - st_size); + if (i < 0) + goto nope; /* error! */ +- st_size += i; +- if (st_size != bsize) ++ if (i == 0) + break; /* End of file */ ++ st_size += i; + bsize *= 2; + fp->buf = (U_CHAR *) xrealloc (fp->buf, bsize + 2); + } --- gcc-2.95-2.95.4.ds15.orig/debian/patches/arm-tune.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/arm-tune.dpatch @@ -0,0 +1,74 @@ +#! /bin/sh -e + +# DP: ARM patch for default tuning and optimized return + +src=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + src=$3/gcc +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p1 --fuzz 10 < $0 + cd $src && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p1 --fuzz 10 < $0 + cd $src && autoconf + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- src/gcc/config/arm/arm.c 2001/05/24 21:09:05 1.146 ++++ src/gcc/config/arm/arm.c 2001/06/17 19:10:22 +@@ -430,6 +430,32 @@ arm_override_options () + abort (); + + insn_flags = sel->flags; ++ ++#ifdef TARGET_TUNE_DEFAULT ++ /* If the user didn't specify tuning either, use the target's ++ preferred flags. */ ++ if (tune_flags == 0) ++ { ++ struct processors * tunesel; ++ struct cpu_default * tunedef; ++ ++ for (tunedef = cpu_defaults; tunedef->name; tunedef++) ++ if (tunedef->cpu == TARGET_TUNE_DEFAULT) ++ break; ++ ++ if (tunedef->name == NULL) ++ abort (); ++ ++ for (tunesel = all_cores; tunesel->name != NULL; tunesel++) ++ if (streq (tunedef->name, tunesel->name)) ++ break; ++ ++ if (tunesel->name == NULL) ++ abort (); ++ ++ tune_flags = tunesel->flags; ++ } ++#endif + + /* Now check to see if the user has specified some command line + switch that require certain abilities from the cpu. */ +--- src/gcc/config/arm/linux-elf.h 2001/04/16 18:30:36 1.25 ++++ src/gcc/config/arm/linux-elf.h 2001/06/17 19:10:24 +@@ -248,6 +249,9 @@ const_section () \ + + /* Get the standard ELF stabs definitions. */ + #include "dbxelf.h" ++ ++/* Tune for StrongARM by default. This turns on load scheduling. */ ++#define TARGET_TUNE_DEFAULT TARGET_CPU_strongarm + + #include "arm/elf.h" + #include "arm/linux-gas.h" --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gpc-2.95.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gpc-2.95.dpatch @@ -0,0 +1,33 @@ +#! /bin/sh -e + +# DP: The gpc patch from the gpc tarball. + +pdir=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="$3/gcc" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +gpc_gcc_patch=$pdir/p/diffs/gcc-2.95.diff +gpc_gcc_patch=debian/patches/gcc-2.95.diff + +case "$1" in + -patch) + # keep the backup files ... to regenerate p/diffs/${gpc_gcc_patch} + # dan@debian.org: no, don't. Apply it by hand if you need to regen. + # get the patch from the gpc source + echo Using patch file ${gpc_gcc_patch} + patch -d $pdir -f -p1 < ${gpc_gcc_patch} + ;; + -unpatch) + # get the patch from the gpc source + echo Using patch file ${gpc_gcc_patch} + patch -d $pdir -f -R -p1 < ${gpc_gcc_patch} + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-names.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-names.dpatch @@ -0,0 +1,99 @@ +#! /bin/sh -e + +# DP: versioned gcc names + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +diff -r -u src-old/gcc/Makefile.in src-native/gcc/Makefile.in +--- src-old/gcc/Makefile.in Mon Dec 18 16:38:16 2000 ++++ src-native/gcc/Makefile.in Tue Dec 19 20:53:48 2000 +@@ -2265,15 +2265,15 @@ + # Remake the info files. + + doc: info +-info: cpp.info gcc.info lang.info ++info: cpp-2.95.info gcc-2.95.info lang.info + +-cpp.info: $(srcdir)/cpp.texi +- $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o cpp.info $(srcdir)/cpp.texi ++cpp-2.95.info: $(srcdir)/cpp.texi ++ $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o cpp-2.95.info $(srcdir)/cpp.texi + +-gcc.info: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \ ++gcc-2.95.info: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \ + $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \ + $(srcdir)/tm.texi $(srcdir)/gcov.texi +- $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o gcc.info $(srcdir)/gcc.texi ++ $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o gcc-2.95.info $(srcdir)/gcc.texi + + dvi: gcc.dvi cpp.dvi lang.dvi + +@@ -2420,6 +2420,8 @@ + -rm -f cexp.c cexp.output TAGS + -rm -f cpp.info* cpp.??s cpp.*aux + -rm -f gcc.info* gcc.??s gcc.*aux ++ -rm -f gcc-2.95.info* gcc-2.95.??s gcc-2.95.*aux ++ -rm -f cpp-2.95.info* cpp-2.95.??s cpp-2.95.*aux + # + # Entry points `install' and `uninstall'. + # Also use `install-collect2' to install collect2 when the config files don't. +@@ -2575,18 +2577,18 @@ + # $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir + # to do the install. + install-info: doc installdirs lang.install-info +- -rm -f $(infodir)/cpp.info* $(infodir)/gcc.info* +- for f in cpp.info* gcc.info*; do \ ++ -rm -f $(infodir)/cpp-2.95.info* $(infodir)/gcc-2.95.info* ++ for f in cpp-2.95.info* gcc-2.95.info*; do \ + $(INSTALL_DATA) $$f $(infodir)/$$f; \ + done + -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ + if [ -f $(infodir)/dir ] ; then \ +- for f in cpp.info gcc.info; do \ ++ for f in cpp-2.95.info gcc-2.95.info; do \ + install-info --dir-file=$(infodir)/dir $(infodir)/$$f; \ + done; \ + else true; fi; \ + else true; fi; +- -chmod a-x $(infodir)/cpp.info* $(infodir)/gcc.info* ++ -chmod a-x $(infodir)/cpp-2.95.info* $(infodir)/gcc-2.95.info* + + # Install the man pages. + install-man: installdirs $(srcdir)/gcc.1 $(srcdir)/cccp.1 lang.install-man +diff -r -u src-old/gcc/cpp.texi src-native/gcc/cpp.texi +--- src-old/gcc/cpp.texi Tue May 18 01:37:18 1999 ++++ src-native/gcc/cpp.texi Tue Dec 19 20:56:05 2000 +@@ -5,7 +5,7 @@ + @ifinfo + @dircategory Programming + @direntry +-* Cpp: (cpp). The GNU C preprocessor. ++* Cpp-2.95: (cpp-2.95). The GNU C preprocessor (Version 2.95.x). + @end direntry + @end ifinfo + +diff -r -u src-old/gcc/gcc.texi src-native/gcc/gcc.texi +--- src-old/gcc/gcc.texi Fri Feb 18 18:19:28 2000 ++++ src-native/gcc/gcc.texi Tue Dec 19 20:56:03 2000 +@@ -82,7 +82,7 @@ + @ifinfo + @dircategory Programming + @direntry +-* gcc: (gcc). The GNU Compiler Collection. ++* gcc-2.95: (gcc-2.95). The GNU Compiler Collection (Version 2.95.x). + @end direntry + @ifset INTERNALS + @ifset USING --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-doc.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-doc.dpatch @@ -0,0 +1,61 @@ +#! /bin/sh -e + +# DP: extend.texi (Nested Functions): Update URL of Usenix paper. +# DP: invoke.texi Fix typo (-fstd -> -std). + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +2000-11-25 Matthias Klose + + * extend.texi (Nested Functions): Update URL of Usenix paper. + * invoke.texi Fix typo (-fstd -> -std). + +--- gcc/extend.texi~ Wed Apr 14 07:34:34 1999 ++++ gcc/extend.texi Fri Nov 24 21:12:49 2000 +@@ -372,7 +372,7 @@ + + GNU CC implements taking the address of a nested function using a + technique called @dfn{trampolines}. A paper describing them is +-available as @samp{http://master.debian.org/~karlheg/Usenix88-lexic.pdf}. ++available as @samp{http://people.debian.org/~karlheg/Usenix88-lexic.pdf}. + + A nested function can jump to a label inherited from a containing + function, provided the label was explicitly declared in the containing +--- gcc/invoke.texi~ Fri Mar 30 06:33:00 2001 ++++ gcc/invoke.texi Mon Apr 23 18:29:29 2001 +@@ -94,7 +94,7 @@ + @item C Language Options + @xref{C Dialect Options,,Options Controlling C Dialect}. + @smallexample +--ansi -fstd -fallow-single-precision -fcond-mismatch -fno-asm ++-ansi -std -fallow-single-precision -fcond-mismatch -fno-asm + -fno-builtin -ffreestanding -fhosted -fsigned-bitfields -fsigned-char + -funsigned-bitfields -funsigned-char -fwritable-strings + -traditional -traditional-cpp -trigraphs +@@ -668,7 +668,7 @@ + The functions @code{alloca}, @code{abort}, @code{exit}, and + @code{_exit} are not builtin functions when @samp{-ansi} is used. + +-@item -fstd= ++@item -std= + Determine the language standard. A value for this option must be provided; + possible values are + +@@ -6788,4 +6788,3 @@ + + @xref{Protoize Caveats}, for more information on how to use + @code{protoize} successfully. +- --- gcc-2.95-2.95.4.ds15.orig/debian/patches/libio-names.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/libio-names.dpatch @@ -0,0 +1,30 @@ +#! /bin/sh -e + +# DP: versioned iostream info names + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- libio/iostream.texi Wed May 6 23:08:51 1998 ++++ libio/iostream.texi Fri Dec 22 12:04:40 2000 +@@ -10,7 +10,7 @@ + @ifinfo + @format + START-INFO-DIR-ENTRY +-* iostream: (iostream). The C++ input/output facility. ++* iostream-2.95: (iostream-2.95). The C++ input/output facility (GCC 2.95.x). + END-INFO-DIR-ENTRY + @end format + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gpc-names.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gpc-names.dpatch @@ -0,0 +1,117 @@ +#! /bin/sh -e + +# DP: versioned gpc names + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- src-old/gcc/p/doc/en/gpc.texi Mon Oct 9 09:32:26 2000 ++++ src-native/gcc/p/doc/en/gpc.texi Tue Dec 19 21:04:21 2000 +@@ -28,11 +28,11 @@ + + @dircategory GNU programming tools + @direntry +-* GPC: (gpc). The GNU Pascal Compiler. ++* GPC-2.95: (gpc-2.95). The GNU Pascal Compiler. + @end direntry + @dircategory Individual utilities + @direntry +-* GPC: (gpc)Invoking GPC. The GNU Pascal Compiler. ++* GPC-2.95: (gpc-2.95)Invoking GPC. The GNU Pascal Compiler. + @end direntry + + @c Version numbers appear twice: in lowercase and capitalized for headlines. + +--- src/gcc/p/Make-lang.in~ 2003-08-31 10:13:01.000000000 +0200 ++++ src/gcc/p/Make-lang.in 2003-08-31 10:20:51.000000000 +0200 +@@ -711,42 +711,42 @@ + pascal.start.encap: + pascal.rest.encap: + +-pascal.info: $(srcdir)/p/doc/info/gpc.info \ +- $(srcdir)/p/doc/info/gpcs.info \ +- $(srcdir)/p/doc/info/gpcs-de.info \ +- $(srcdir)/p/doc/info/gpc-hr.info \ +- $(srcdir)/p/doc/info/gpcs-hr.info \ +- $(srcdir)/p/doc/info/gpc-es.info \ +- $(srcdir)/p/doc/info/gpcs-es.info ++pascal.info: $(srcdir)/p/doc/info/gpc-2.95.info \ ++ $(srcdir)/p/doc/info/gpcs-2.95.info \ ++ $(srcdir)/p/doc/info/gpcs-de-2.95.info \ ++ $(srcdir)/p/doc/info/gpc-hr-2.95.info \ ++ $(srcdir)/p/doc/info/gpcs-hr-2.95.info \ ++ $(srcdir)/p/doc/info/gpc-es-2.95.info \ ++ $(srcdir)/p/doc/info/gpcs-es-2.95.info + pascal.dvi: gpc.dvi + +-$(srcdir)/p/doc/info/gpc.info: $(GPC_TEXI_EN) ++$(srcdir)/p/doc/info/gpc-2.95.info: $(GPC_TEXI_EN) + [ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info" +- $(MAKEINFO_EN) -o $(srcdir)/p/doc/info/gpc.info gpc.texi ++ $(MAKEINFO_EN) -o $(srcdir)/p/doc/info/gpc-2.95.info gpc.texi + +-$(srcdir)/p/doc/info/gpcs.info: $(GPC_TEXI_EN) ++$(srcdir)/p/doc/info/gpcs-2.95.info: $(GPC_TEXI_EN) + [ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info" +- $(MAKEINFO_EN) --no-split -o $(srcdir)/p/doc/info/gpcs.info gpcs.texi ++ $(MAKEINFO_EN) --no-split -o $(srcdir)/p/doc/info/gpcs-2.95.info gpcs.texi + +-$(srcdir)/p/doc/info/gpcs-de.info: $(GPC_TEXI_DE) ++$(srcdir)/p/doc/info/gpcs-de-2.95.info: $(GPC_TEXI_DE) + [ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info" +- $(MAKEINFO_DE) --no-split -o $(srcdir)/p/doc/info/gpcs-de.info gpcs.texi ++ $(MAKEINFO_DE) --no-split -o $(srcdir)/p/doc/info/gpcs-de-2.95.info gpcs.texi + +-$(srcdir)/p/doc/info/gpc-hr.info: $(GPC_TEXI_HR) ++$(srcdir)/p/doc/info/gpc-hr-2.95.info: $(GPC_TEXI_HR) + [ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info" +- $(MAKEINFO_HR) -o $(srcdir)/p/doc/info/gpc-hr.info gpc.texi ++ $(MAKEINFO_HR) -o $(srcdir)/p/doc/info/gpc-hr-2.95.info gpc.texi + +-$(srcdir)/p/doc/info/gpcs-hr.info: $(GPC_TEXI_HR) ++$(srcdir)/p/doc/info/gpcs-hr-2.95.info: $(GPC_TEXI_HR) + [ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info" +- $(MAKEINFO_HR) --no-split -o $(srcdir)/p/doc/info/gpcs-hr.info gpcs.texi ++ $(MAKEINFO_HR) --no-split -o $(srcdir)/p/doc/info/gpcs-hr-2.95.info gpcs.texi + +-$(srcdir)/p/doc/info/gpc-es.info: $(GPC_TEXI_ES) ++$(srcdir)/p/doc/info/gpc-es-2.95.info: $(GPC_TEXI_ES) + [ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info" +- $(MAKEINFO_ES) -o $(srcdir)/p/doc/info/gpc-es.info gpc.texi ++ $(MAKEINFO_ES) -o $(srcdir)/p/doc/info/gpc-es-2.95.info gpc.texi + +-$(srcdir)/p/doc/info/gpcs-es.info: $(GPC_TEXI_ES) ++$(srcdir)/p/doc/info/gpcs-es-2.95.info: $(GPC_TEXI_ES) + [ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info" +- $(MAKEINFO_ES) --no-split -o $(srcdir)/p/doc/info/gpcs-es.info gpcs.texi ++ $(MAKEINFO_ES) --no-split -o $(srcdir)/p/doc/info/gpcs-es-2.95.info gpcs.texi + + gpc.dvi: $(GPC_TEXI_EN) + TEXINPUTS=$(srcdir)/p/doc:$(srcdir)/p/doc/images:$$TEXINPUTS \ +@@ -942,11 +942,11 @@ + fi + + pascal.install-info: pascal.install-info-man-dirs pascal.info +- rm -f $(DESTDIR)$(infodir)/gpc.info* $(DESTDIR)$(infodir)/gpcs.info* $(DESTDIR)$(infodir)/gpcs-de.info* $(DESTDIR)$(infodir)/gpcs-hr.info* $(DESTDIR)$(infodir)/gpcs-es.info* +- for f in `cd $(srcdir)/p/doc/info && echo gpc.info* gpcs*.info*`; do \ ++ rm -f $(DESTDIR)$(infodir)/gpc*.info* $(DESTDIR)$(infodir)/gpcs*.info* $(DESTDIR)$(infodir)/gpcs-de*.info* $(DESTDIR)$(infodir)/gpcs-hr*.info* $(DESTDIR)$(infodir)/gpcs-es*.info* ++ for f in `cd $(srcdir)/p/doc/info && echo gpc-2.95.info* gpcs*.info*`; do \ + $(INSTALL_DATA) $(srcdir)/p/doc/info/$$f $(DESTDIR)$(infodir)/$$f || exit 1; \ + done +- chmod a-x $(DESTDIR)$(infodir)/gpc.info* $(DESTDIR)$(infodir)/gpcs.info* $(DESTDIR)$(infodir)/gpcs-de.info* $(DESTDIR)$(infodir)/gpcs-hr.info* $(DESTDIR)$(infodir)/gpcs-es.info* ++ chmod a-x $(DESTDIR)$(infodir)/gpc*.info* $(DESTDIR)$(infodir)/gpcs*.info* $(DESTDIR)$(infodir)/gpcs-de*.info* $(DESTDIR)$(infodir)/gpcs-hr*.info* $(DESTDIR)$(infodir)/gpcs-es*.info* + + pascal.install-man: pascal.install-info-man-dirs $(srcdir)/p/doc/en/gpc.1 $(srcdir)/p/doc/generated/gpc-run.1 + -if [ -f gpc1$(exeext) ]; then \ --- gcc-2.95-2.95.4.ds15.orig/debian/patches/libio-doc.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/libio-doc.dpatch @@ -0,0 +1,43 @@ +#! /bin/sh -e + +# DP: iostream.texi (Files): Use octal numbers in examples. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +2000-11-25 Matthias Klose + + * iostream.texi (Files): Use octal numbers in examples. + +--- libio/iostream.texi~ Wed May 6 23:08:51 1998 ++++ libio/iostream.texi Fri Nov 24 21:57:57 2000 +@@ -1233,7 +1233,7 @@ + + @noindent + The last optional argument @var{prot} is specific to Unix-like systems; +-it specifies the file protection (by default @samp{644}). ++it specifies the file protection (by default @samp{0644}). + @end deftypefn + + @deftypefn Method void ifstream::open (const char* @var{fname} @w{[, int} @var{mode} @w{[, int} @var{prot}]]) +@@ -1265,7 +1265,7 @@ + file, just as described for @code{ifstream::ifstream}. + + The last optional argument @var{prot} specifies the file protection (by +-default @samp{644}). ++default @samp{0644}). + @end deftypefn + + @deftypefn Destructor {} ofstream::~ofstream () --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-messages.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-messages.dpatch @@ -0,0 +1,132 @@ +#! /bin/sh -e + +# All lines beginning with `# DPATCH:' are a description of the patch. +# DP: avoid setlocale(LC_MESSAGES, ...) not to set LC_MESSAGES, because +# DP: some environment except for setting LANG=C fail to display libc +# DP: message. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +2002-01-20 GOTO Masanori + + * cccp.c: avoid setlocale(LC_MESSAGES, ...) if MULTIBYTE_CHARS is not set. + * collect2.c: likewise. + * cppmain.c: likewise. + * gcc.c: likewise. + * gcov.c: likewise. + * protoize.c: likewise. + * toplev.c: likewise. + +--- gcc.vanilla/cccp.c Wed Sep 19 13:32:46 2001 ++++ gcc/cccp.c Sun Jan 20 00:56:45 2002 +@@ -1246,7 +1246,9 @@ + #endif + + #ifdef HAVE_LC_MESSAGES ++#ifdef MULTIBYTE_CHARS + setlocale (LC_MESSAGES, ""); ++#endif + #endif + (void) bindtextdomain (PACKAGE, localedir); + (void) textdomain (PACKAGE); +--- gcc.vanilla/collect2.c Fri Jan 26 04:39:42 2001 ++++ gcc/collect2.c Sun Jan 20 00:57:10 2002 +@@ -1018,7 +1018,9 @@ + #endif + + #ifdef HAVE_LC_MESSAGES ++#ifdef MULTIBYTE_CHARS + setlocale (LC_MESSAGES, ""); ++#endif + #endif + (void) bindtextdomain (PACKAGE, localedir); + (void) textdomain (PACKAGE); +--- gcc.vanilla/cppmain.c Tue May 11 00:24:36 1999 ++++ gcc/cppmain.c Sun Jan 20 00:57:39 2002 +@@ -53,7 +53,9 @@ + progname = p; + + #ifdef HAVE_LC_MESSAGES ++#ifdef MULTIBYTE_CHARS + setlocale (LC_MESSAGES, ""); ++#endif + #endif + (void) bindtextdomain (PACKAGE, localedir); + (void) textdomain (PACKAGE); +--- gcc.vanilla/gcc.c Wed Oct 3 13:33:43 2001 ++++ gcc/gcc.c Sun Jan 20 00:58:00 2002 +@@ -4654,7 +4654,9 @@ + programname = p; + + #ifdef HAVE_LC_MESSAGES ++#ifdef MULTIBYTE_CHARS + setlocale (LC_MESSAGES, ""); ++#endif + #endif + (void) bindtextdomain (PACKAGE, localedir); + (void) textdomain (PACKAGE); +--- gcc.vanilla/gcov.c Sat Apr 17 04:52:19 1999 ++++ gcc/gcov.c Sun Jan 20 00:58:30 2002 +@@ -227,7 +227,9 @@ + char **argv; + { + #ifdef HAVE_LC_MESSAGES ++#ifdef MULTIBYTE_CHARS + setlocale (LC_MESSAGES, ""); ++#endif + #endif + (void) bindtextdomain (PACKAGE, localedir); + (void) textdomain (PACKAGE); +--- gcc.vanilla/protoize.c Sat Apr 17 04:52:36 1999 ++++ gcc/protoize.c Sun Jan 20 00:56:14 2002 +@@ -4559,7 +4559,9 @@ + pname = pname ? pname+1 : argv[0]; + + #ifdef HAVE_LC_MESSAGES ++#ifdef MULTIBYTE_CHARS + setlocale (LC_MESSAGES, ""); ++#endif + #endif + (void) bindtextdomain (PACKAGE, localedir); + (void) textdomain (PACKAGE); +--- gcc.vanilla/toplev.c Sat Apr 7 13:32:43 2001 ++++ gcc/toplev.c Sun Jan 20 00:59:14 2002 +@@ -4791,7 +4791,9 @@ + #endif + + #ifdef HAVE_LC_MESSAGES ++#ifdef MULTIBYTE_CHARS + setlocale (LC_MESSAGES, ""); ++#endif + #endif + (void) bindtextdomain (PACKAGE, localedir); + (void) textdomain (PACKAGE); + + +The test result of this patch: + +gotom@celesta:~/debian/sample/gcc/gcc-2.95-2.95.4.ds8/build-native/gcc> ./xgcc aaa +xgcc: aaa: No such file or directory +xgcc: No input files +gotom@celesta:~/debian/sample/gcc/gcc-2.95-2.95.4.ds8/build-native/gcc> setenv | grep LANG +LANG=ja_JP.eucJP + +-- gotom + + +-- +To UNSUBSCRIBE, email to debian-gcc-request@lists.debian.org +with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org --- gcc-2.95-2.95.4.ds15.orig/debian/patches/libgcc-umodsi3.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/libgcc-umodsi3.dpatch @@ -0,0 +1,84 @@ +#! /bin/sh -e + +# DP: + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +From: Phil Blundell +To: 130394@bugs.debian.org, control@bugs.debian.org +Cc: 130394-submitter@bugs.debian.org +Subject: Bug#130394: [ARM] gcc misunhandle % with unsigned long operands +Date: 15 Feb 2002 14:25:42 +0000 + +reassign 130394 gcc-2.95 +severity 130394 important +forwarded 130394 gcc-gnats@gcc.gnu.org +tags 130394 + patch +tags 130394 + upstream +tags 130394 + fixed +retitle 130394 [PR 5700] [ARM; fixed in 3.0] bug in __umodsi3 +thanks + +The reason this one didn't show up with a cross-compiler is that the bug +is in the division support routine itself, rather than the compiler +proper. + +I haven't tested it yet, but I suspect this patch may fix the problem. + +# DP: 2000-08-22 Nick Clifton +# DP: +# DP: * config/arm/lib1funcs.asm (__umodsi3): Before performing any +# DP: restorative additions, test for bottom bits of IP being set, +# DP: rather than relying upon the RORs not matching. +# DP: (__modsi3): Ditto. + +Index: lib1funcs.asm +=================================================================== +RCS file: /cvs/gcc/gcc/gcc/config/arm/lib1funcs.asm,v +retrieving revision 1.7 +diff -u -r1.7 lib1funcs.asm +--- gcc/config/arm/lib1funcs.asm 1999/04/07 13:53:02 1.7 ++++ gcc/config/arm/lib1funcs.asm 2002/02/15 14:17:36 +@@ -215,6 +215,13 @@ + @ then none of the below will match, since the bit in ip will not be + @ in the bottom nibble. + ands overdone, overdone, #0xe0000000 ++ @ If we terminated early, because dividend became zero, then the ++ @ bit in ip will not be in the bottom nibble, and we should not ++ @ perform the additions below. We must test for this though ++ @ (rather relying upon the TSTs to prevent the additions) since ++ @ the bit in ip could be in the top two bits which might then match ++ @ with one of the smaller RORs. ++ tstne ip, #0x7 + RETc(eq) pc, lr @ No fixups needed + tst overdone, ip, ror #3 + addne dividend, dividend, divisor, lsr #3 +@@ -397,6 +404,13 @@ + @ then none of the below will match, since the bit in ip will not be + @ in the bottom nibble. + ands overdone, overdone, #0xe0000000 ++ @ If we terminated early, because dividend became zero, then the ++ @ bit in ip will not be in the bottom nibble, and we should not ++ @ perform the additions below. We must test for this though ++ @ (rather relying upon the TSTs to prevent the additions) since ++ @ the bit in ip could be in the top two bits which might then match ++ @ with one of the smaller RORs. ++ tstne ip, #0x7 + beq Lgot_result + tst overdone, ip, ror #3 + addne dividend, dividend, divisor, lsr #3 + + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/68060-build.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/68060-build.dpatch @@ -0,0 +1,36 @@ +#! /bin/sh -e + +# DP: A patch needed to bootstrap on the m68k 68060. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- gcc/Makefile.in.orig Tue Oct 13 20:59:05 1998 ++++ gcc/Makefile.in Tue Oct 13 20:59:15 1998 +@@ -69,7 +69,7 @@ + XCFLAGS = + TCFLAGS = + # -W -Wall warnings are disabled for releases. +-CFLAGS = -g ++CFLAGS = -g -O + BOOT_CFLAGS = -O2 $(CFLAGS) + #WARN_CFLAGS = -W -Wall + # These exists to be overridden by the x-* and t-* files, respectively. + +It is switching _on_ optimization. Is it for the first stage compiler or for +more? + +Ciao, +Christian. --- gcc-2.95-2.95.4.ds15.orig/debian/patches/bootstrap.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/bootstrap.dpatch @@ -0,0 +1,179 @@ +#! /bin/sh -e + +# DP: Make bootstrap: restartable at any point +# DP: From: Donn Terry + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +#: + + + + + + + + +Make bootstrap: restartable at any point. + +This is in response to a discussion on this topic. This is "take 2" | +which should work with parallel builds, though I haven't tested that. | + +When doing a make bootstrap, it's hard to know (at least when +not throughly versed in the process details) how to restart +after making a fix. In general, retyping "make bootstrap" +will do the wrong thing (particularly if the host and target +compilers object files are incompatible!) + +This change keeps track of the stages completed. The old +bootstrap2[234] (and *-lean) targets are rewritten, but work the +same. + +I've tested this by doing a make bootstrap (on CVS sources as of | +last night) and by typing 'make bootstrap' after it's done, | +in which case it thinks a moment and does nothing. (Which is exactly +the right answer.) + +I've also done a complete regression, with no surprises. | + +I tested whether stopping/restarting at a few arbitrary points along the +way works with older sources, but haven't tested it real recently, +except to do a ^C halfway through a testbuild at one point. | +Again, if it works at all, it should work as well as it ever did. +I specficially did test it during the period where make bootstrap +wasn't succeeding for me, and it helped a LOT in being able to pick up +where I left off. + +An interesting side-effect: make bootstrap-lean after a make bootstrap | +JUST cleans out stage1, with no unwanted consequences. | + + +Fri May 28 15:27:02 1999 Donn Terry (donn@interix.com) + * Makefile.in: restructure bootstrap stages to allow + clean restart after failure. + +diff -urP egcs.source.old/gcc/Makefile.in egcs.source/gcc/Makefile.in +--- egcs.source.old/gcc/Makefile.in Sun May 23 13:39:21 1999 ++++ egcs.source/gcc/Makefile.in Thu May 27 16:59:42 1999 +@@ -2360,6 +2360,8 @@ clean: mostlyclean intl.clean lang.clean + rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \ + fi ; fi + -rm -fr stage1 stage2 stage3 stage4 ++ -rm -f boot_stage_a boot_stage_b boot_stage_c boot_stage_d ++ -rm -f boot_stage_e boot_stage_f + + # Delete all files that users would normally create + # while building and installing GCC. +@@ -2924,33 +2926,83 @@ diff: + $(LANG_DIFF_EXCLUDES) \ + gcc-$(oldversion) gcc-$(version) > gcc-$(oldversion)-$(version).diff + +-bootstrap bootstrap-lean: force ++ + # Only build the C compiler for stage1, because that is the only one that + # we can guarantee will build with the native compiler, and also it is the + # only thing useful for building stage2. +- $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" +- $(MAKE) stage1 ++boot_stage_a: ++ +$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" ++ touch boot_stage_a ++ echo ---------------------- stage a complete --------------------- ++ ++boot_stage_b: ++ +$(MAKE) stage1 ++ touch boot_stage_b ++ echo ---------------------- stage b complete --------------------- ++ + # This used to define ALLOCA as empty, but that would lead to bad results + # for a subsequent `make install' since that would not have ALLOCA empty. + # To prevent `make install' from compiling alloca.o and then relinking cc1 + # because alloca.o is newer, we permit these recursive makes to compile + # alloca.o. Then cc1 is newer, so it won't have to be relinked. +- $(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)" +- $(MAKE) stage2 +- -if test $@ = bootstrap-lean; then rm -rf stage1; else true; fi +- $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)" ++boot_stage_c: ++ +$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)" ++ touch boot_stage_c ++ echo ---------------------- stage c complete --------------------- + +-bootstrap2 bootstrap2-lean: force +- $(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)" +- $(MAKE) stage2 +- -if test $@ = bootstrap2-lean; then rm -rf stage1; else true; fi +- $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)" ++boot_stage_d: ++ +$(MAKE) stage2 ++ touch boot_stage_d ++ echo ---------------------- stage d complete --------------------- + +-bootstrap3 bootstrap3-lean: force +- $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)" ++boot_stage_e: ++ +$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)" ++ touch boot_stage_e ++ echo ---------------------- stage e complete --------------------- ++ ++# Only bootstrap4 uses stage f. ++boot_stage_f: ++ +$(MAKE) CC="stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage3/ LANGUAGES="$(LANGUAGES)" ++ touch boot_stage_f ++ echo ---------------------- stage f complete --------------------- ++ ++boot_clean_stage1: ++ rm -rf stage1 ++ ++# This next little bit is the way it is for parallel builds. It's simply ++# a chain of stages which DO have to be done sequentially. ++ ++bootstrap_a: boot_stage_a ++bootstrap_b: bootstrap_a boot_stage_b ++bootstrap_c: bootstrap_b boot_stage_c ++bootstrap_d: bootstrap_c boot_stage_d ++bootstrap_e: bootstrap_d boot_stage_e ++bootstrap: force bootstrap_e ++ ++bootstrap-lean_a: boot_stage_a ++bootstrap-lean_b: bootstrap-lean_a boot_stage_b ++bootstrap-lean_c: bootstrap-lean_b boot_stage_c ++bootstrap-lean_d: bootstrap-lean_c boot_stage_d ++bootstrap-lean_e: bootstrap-lean_d boot_clean_stage1 ++bootstrap-lean_f: bootstrap-lean_e boot_stage_e ++bootstrap-lean: force bootstrap-lean_f ++ ++bootstrap2_c: boot_stage_c ++bootstrap2_d: bootstrap2_c boot_stage_d ++bootstrap2_e: bootstrap2_d boot_stage_e ++bootstrap2: force bootstrap2_e ++ ++bootstrap2-lean_c: boot_stage_c ++bootstrap2-lean_d: bootstrap2-lean_c boot_stage_d ++bootstrap2-lean_e: bootstrap2-lean_d boot_clean_stage1 ++bootstrap2-lean_f: bootstrap2-lean_e boot_stage_e ++bootstrap2-lean: force bootstrap2-lean_f ++ ++bootstrap3 bootstrap3-lean: force boot_stage_e ++ ++# Only bootstrap4 uses stage f. ++bootstrap4 bootstrap4-lean: force boot_stage_f + +-bootstrap4 bootstrap4-lean: force +- $(MAKE) CC="stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage3/ LANGUAGES="$(LANGUAGES)" + + # Compare the object files in the current directory with those in the + # stage2 directory. --- gcc-2.95-2.95.4.ds15.orig/debian/patches/arm-pic.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/arm-pic.dpatch @@ -0,0 +1,100 @@ +#! /bin/sh -e + +# DP: Some fixes for ARM from Philip Blundell + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 --fuzz 10 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 --fuzz 10 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + + +Fri Jul 16 10:29:48 1999 Philip Blundell + + * config/arm/arm.c (legitimize_pic_address): Handle LABEL_REF + correctly. + (arm_poke_function_name): Avoid warning. + * config/arm/arm.h (LEGITIMATE_CONSTANT_P): Allow anything when + generating PIC. + (GO_IF_LEGITIMATE_INDEX): Fix handling of HImode values. + (LEGITIMATE_PIC_OPERAND): Disallow references to labels. + +--- gcc/config/arm/arm.c 1999/06/19 06:34:36 1.43.4.5 ++++ gcc/config/arm/arm.c 1999/07/16 09:27:53 +@@ -1528,7 +1528,20 @@ legitimize_pic_address (orig, mode, reg) + return gen_rtx_PLUS (Pmode, base, offset); + } + else if (GET_CODE (orig) == LABEL_REF) +- current_function_uses_pic_offset_table = 1; ++ { ++ current_function_uses_pic_offset_table = 1; ++ ++ if (NEED_PLT_GOT) ++ { ++ rtx pic_ref, address = gen_reg_rtx (Pmode); ++ ++ emit_insn (gen_pic_load_addr (address, orig)); ++ pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, ++ address); ++ emit_move_insn (address, pic_ref); ++ return address; ++ } ++ } + + return orig; + } +--- gcc/config/arm/arm.h 1999/06/19 05:37:07 1.34.4.3 ++++ gcc/config/arm/arm.h 1999/07/16 09:28:04 +@@ -1378,9 +1378,11 @@ do { \ + + On the ARM, allow any integer (invalid ones are removed later by insn + patterns), nice doubles and symbol_refs which refer to the function's +- constant pool XXX. */ +-#define LEGITIMATE_CONSTANT_P(X) (! label_mentioned_p (X)) ++ constant pool XXX. + ++ When generating PIC code, allow anything. */ ++#define LEGITIMATE_CONSTANT_P(X) (flag_pic || ! label_mentioned_p (X)) ++ + /* Symbols in the text segment can be accessed without indirecting via the + constant pool; it may take an extra binary operation, but this is still + faster than indirecting via memory. Don't do this when not optimizing, +@@ -1813,12 +1814,13 @@ extern int arm_pic_register; + + #define FINALIZE_PIC arm_finalize_pic () + +-/* We can't directly access anything that contains a symbol, ++/* We can't directly access anything that contains a symbol or label, + nor can we indirect via the constant pool. */ + #define LEGITIMATE_PIC_OPERAND_P(X) \ +- (! symbol_mentioned_p (X) \ ++ (! symbol_mentioned_p (X) && ! label_mentioned_p (X) \ + && (! CONSTANT_POOL_ADDRESS_P (X) \ +- || ! symbol_mentioned_p (get_pool_constant (X)))) ++ || (! symbol_mentioned_p (get_pool_constant (X))) \ ++ && (! label_mentioned_p (get_pool_constant (X))))) + + /* We need to know when we are making a constant pool; this determines + whether data needs to be in the GOT or can be referenced via a GOT +--- gcc/config/arm/arm.md 1999/06/02 06:43:14 1.27.4.2 ++++ gcc/config/arm/arm.md 1999/07/16 09:28:31 +@@ -2627,7 +2627,8 @@ + : preserve_subexpressions_p ())); + DONE; + } +- if (CONSTANT_P (operands[1]) && flag_pic) ++ if ((CONSTANT_P (operands[1]) || symbol_mentioned_p (operands[1]) ++ || label_mentioned_p (operands[1])) && flag_pic) + operands[1] = legitimize_pic_address (operands[1], SImode, + ((reload_in_progress + || reload_completed) + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/arm-const-double.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/arm-const-double.dpatch @@ -0,0 +1,41 @@ +#! /bin/sh -e + +# DP: ARM patch for const_double, courtesy Richard Earnshaw + +src=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + src=$3/gcc +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p1 --fuzz 10 < $0 + cd $src && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p1 --fuzz 10 < $0 + cd $src && autoconf + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- src/gcc/config/arm/arm.c.old Sun Jun 17 18:36:06 2001 ++++ src/gcc/config/arm/arm.c Sun Jun 17 18:36:40 2001 +@@ -2416,6 +2416,11 @@ + if (GET_CODE (x) == SYMBOL_REF) + return 1; + ++ /* CONST_DOUBLE can contain a symbol ref for its in-memory ++ representation. We are not interested about that case here. */ ++ if (GET_CODE (x) == CONST_DOUBLE) ++ return 0; ++ + fmt = GET_RTX_FORMAT (GET_CODE (x)); + for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--) + { --- gcc-2.95-2.95.4.ds15.orig/debian/patches/arm-output-int.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/arm-output-int.dpatch @@ -0,0 +1,125 @@ +#! /bin/sh -e + +# DP: ARM patch for large constant generation + +src=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + src=$3/gcc +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p1 --fuzz 10 < $0 + cd $src && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p1 --fuzz 10 < $0 + cd $src && autoconf + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- src/gcc/config/arm/arm.c 2001/01/25 14:03:24 1.43.4.8 ++++ src/gcc/config/arm/arm.c 2001/06/23 12:07:08 +@@ -722,6 +722,33 @@ arm_split_constant (code, mode, val, tar + return arm_gen_constant (code, mode, val, target, source, subtargets, 1); + } + ++static int ++count_insns_for_constant (HOST_WIDE_INT remainder, int i) ++{ ++ HOST_WIDE_INT temp1; ++ int num_insns = 0; ++ do ++ { ++ int end; ++ ++ if (i <= 0) ++ i += 32; ++ if (remainder & (3 << (i - 2))) ++ { ++ end = i - 8; ++ if (end < 0) ++ end += 32; ++ temp1 = remainder & ((0x0ff << end) ++ | ((i < end) ? (0xff >> (32 - end)) : 0)); ++ remainder &= ~temp1; ++ num_insns++; ++ i -= 6; ++ } ++ i -= 2; ++ } while (remainder); ++ return num_insns; ++} ++ + /* As above, but extra parameter GENERATE which, if clear, suppresses + RTL generation. */ + int +@@ -1178,7 +1205,7 @@ arm_gen_constant (code, mode, val, targe + We start by looking for the largest block of zeros that are aligned on + a 2-bit boundary, we then fill up the temps, wrapping around to the + top of the word when we drop off the bottom. +- In the worst case this code should produce no more than four insns. */ ++ In the worst case this code should produce no more than four insns. */ + { + int best_start = 0; + int best_consecutive_zeros = 0; +@@ -1187,9 +1214,9 @@ arm_gen_constant (code, mode, val, targe + { + int consecutive_zeros = 0; + +- if (! (remainder & (3 << i))) ++ if (!(remainder & (3 << i))) + { +- while ((i < 32) && ! (remainder & (3 << i))) ++ while ((i < 32) && !(remainder & (3 << i))) + { + consecutive_zeros += 2; + i += 2; +@@ -1202,10 +1229,37 @@ arm_gen_constant (code, mode, val, targe + i -= 2; + } + } ++ ++ /* So long as it won't require any more insns to do so, it's ++ desirable to emit a small constant (in bits 0...9) in the last ++ insn. This way there is more chance that it can be combined with ++ a later addressing insn to form a pre-indexed load or store ++ operation. Consider: ++ ++ *((volatile int *)0xe0000100) = 1; ++ *((volatile int *)0xe0000110) = 2; ++ ++ We want this to wind up as: ++ ++ mov rA, #0xe0000000 ++ mov rB, #1 ++ str rB, [rA, #0x100] ++ mov rB, #2 ++ str rB, [rA, #0x110] ++ ++ rather than having to synthesize both large constants from scratch. ++ ++ Therefore, we calculate how many insns would be required to emit ++ the constant starting from `best_start', and also starting from ++ zero (ie with bit 31 first to be output). If `best_start' doesn't ++ yield a shorter sequence, we may as well use zero. */ ++ if (best_start != 0 ++ && ((((unsigned HOST_WIDE_INT) 1) << best_start) < remainder) ++ && (count_insns_for_constant (remainder, 0) <= ++ count_insns_for_constant (remainder, best_start))) ++ best_start = 0; + +- /* Now start emitting the insns, starting with the one with the highest +- bit set: we do this so that the smallest number will be emitted last; +- this is more likely to be combinable with addressing insns. */ ++ /* Now start emitting the insns. */ + i = best_start; + do + { --- gcc-2.95-2.95.4.ds15.orig/debian/patches/cpp-macro-doc.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/cpp-macro-doc.dpatch @@ -0,0 +1,113 @@ +#! /bin/sh -e + +# DP: cpp.texi: add a node documenting macro varargs. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +Sat Aug 7 14:56:50 1999 Matthias Klose + + * cpp.texi: cpp.texi: add a node documenting macro varargs (copied + from extend.texi. + +--- gcc/cpp.texi~ Wed May 19 13:22:57 1999 ++++ gcc/cpp.texi Sat Aug 7 14:53:42 1999 +@@ -542,6 +542,7 @@ + * Simple Macros:: Macros that always expand the same way. + * Argument Macros:: Macros that accept arguments that are substituted + into the macro expansion. ++* Macro Varargs:: Macros with variable number of arguments. + * Predefined:: Predefined macros that are always available. + * Stringification:: Macro arguments converted into string constants. + * Concatenation:: Building tokens from parts taken from macro arguments. +@@ -645,7 +646,7 @@ + that the result of its expansion is checked for more macro names. + @xref{Cascaded Macros}. + +-@node Argument Macros, Predefined, Simple Macros, Macros ++@node Argument Macros, Macro Varargs, Simple Macros, Macros + @subsection Macros with Arguments + @cindex macros with argument + @cindex arguments in macro definitions +@@ -799,7 +800,68 @@ + the left parenthesis; it's the @emph{definition} where it matters whether + there is a space. + +-@node Predefined, Stringification, Argument Macros, Macros ++@node Macro Varargs, Predefined, Argument Macros, Macros ++@subsection Macros with Variable Numbers of Arguments ++@cindex variable number of arguments ++@cindex macro with variable arguments ++@cindex rest argument (in macro) ++ ++In GNU C, a macro can accept a variable number of arguments, much as a ++function can. The syntax for defining the macro looks much like that ++used for a function. Here is an example: ++ ++@example ++#define eprintf(format, args...) \ ++ fprintf (stderr, format , ## args) ++@end example ++ ++Here @code{args} is a @dfn{rest argument}: it takes in zero or more ++arguments, as many as the call contains. All of them plus the commas ++between them form the value of @code{args}, which is substituted into ++the macro body where @code{args} is used. Thus, we have this expansion: ++ ++@example ++eprintf ("%s:%d: ", input_file_name, line_number) ++@expansion{} ++fprintf (stderr, "%s:%d: " , input_file_name, line_number) ++@end example ++ ++@noindent ++Note that the comma after the string constant comes from the definition ++of @code{eprintf}, whereas the last comma comes from the value of ++@code{args}. ++ ++The reason for using @samp{##} is to handle the case when @code{args} ++matches no arguments at all. In this case, @code{args} has an empty ++value. In this case, the second comma in the definition becomes an ++embarrassment: if it got through to the expansion of the macro, we would ++get something like this: ++ ++@example ++fprintf (stderr, "success!\n" , ) ++@end example ++ ++@noindent ++which is invalid C syntax. @samp{##} gets rid of the comma, so we get ++the following instead: ++ ++@example ++fprintf (stderr, "success!\n") ++@end example ++ ++This is a special feature of the GNU C preprocessor: @samp{##} before a ++rest argument that is empty discards the preceding sequence of ++non-whitespace characters from the macro definition. (If another macro ++argument precedes, none of it is discarded.) ++ ++It might be better to discard the last preprocessor token instead of the ++last preceding sequence of non-whitespace characters; in fact, we may ++someday change this feature to do so. We advise you to write the macro ++definition so that the preceding sequence of non-whitespace characters ++is just a single token, so that the meaning will not change if we change ++the definition of this feature. ++ ++@node Predefined, Stringification, Macro Varargs, Macros + @subsection Predefined Macros + + @cindex predefined macros --- gcc-2.95-2.95.4.ds15.orig/debian/patches/cross-libc-version.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/cross-libc-version.dpatch @@ -0,0 +1,33 @@ +#! /bin/sh -e + +# DP: Change default libc API version for cross-compiling to 6.2 (glibc 2.2) + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- config.if~ Sun Oct 18 17:37:10 1998 ++++ config.if Thu Feb 15 03:38:02 2001 +@@ -76,8 +76,8 @@ + exit 1 + fi + else +- # Cross compiling. Assume glibc 2.1. +- libc_interface=-libc6.1- ++ # Cross compiling. Assume glibc 2.2. ++ libc_interface=-libc6.2- + fi + ;; + *) + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/g77-docs.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/g77-docs.dpatch @@ -0,0 +1,60 @@ +#! /bin/sh -e + +# DP: Update g77 documentation as proposed in +# DP: http://gcc.gnu.org/ml/gcc-bugs/1999-11/msg00846.html + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + + +Sat Nov 18 13:54:49 2000 Matthias Klose + + * g77.texi (Floating-point Exception Handling, Floating-point + precision): Adjust example to work with glibc (>= 2.1). + + +--- gcc/f/g77.texi~ Mon Jun 21 13:58:54 1999 ++++ gcc/f/g77.texi Sat Nov 18 13:49:43 2000 +@@ -12144,8 +12144,10 @@ + static void __attribute__ ((constructor)) + trapfpe () + @{ +- __setfpucw (_FPU_DEFAULT & +- ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM)); ++ fpu_control_t cw = ++ _FPU_DEFAULT & ++ ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM); ++ _FPU_SETCW(cw); + @} + @end smallexample + +--- gcc/f/g77.texi~ Sun Nov 19 12:12:31 2000 ++++ gcc/f/g77.texi Sun Nov 19 17:29:05 2000 +@@ -10476,9 +10476,12 @@ + for turning on floating-point exceptions + (@pxref{Floating-point Exception Handling}). + The control word could be set to double precision by +-replacing the @code{__setfpucw} call with one like this: ++replacing the @code{__setfpucw} call or the @code{_FPU_SETCW} macro with one like this: + @smallexample +- __setfpucw ((_FPU_DEFAULT & ~_FPU_EXTENDED) | _FPU_DOUBLE); ++@{ ++ fpu_control_t cw = (_FPU_DEFAULT & ~_FPU_EXTENDED) | _FPU_DOUBLE; ++ _FPU_SETCW(cw); ++@} + @end smallexample + (It is not clear whether this has any effect on the operation of the GNU + maths library, but we have no evidence of it causing trouble.) + --- gcc-2.95-2.95.4.ds15.orig/debian/patches/libstdc++-sstream.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/libstdc++-sstream.dpatch @@ -0,0 +1,32 @@ +#! /bin/sh -e + +# DP: * sstream (std::stringbuf::overflow): double size of buffer. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# append the patch here and adjust the -p? flag in the patch calls. + +--- src-native/libstdc++/sstream~ Tue Dec 5 06:32:17 2000 ++++ src-native/libstdc++/sstream Tue Jun 26 07:11:03 2001 +@@ -106,7 +106,7 @@ + if (c != EOF) + { + streamsize old_stream_len = stream_len; +- stream_len += 1; ++ stream_len += stream_len + 1; + char_type* new_stream = new char_type[stream_len]; + memcpy(new_stream, stream, old_stream_len); + delete[] stream; --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc-manpage.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc-manpage.dpatch @@ -0,0 +1,37 @@ +#! /bin/sh -e + +# DP: Document exit codes. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +Wed Oct 20 22:55:23 1999 Matthias Klose + + * gcc.1: Document exit codes. + +--- gcc/gcc.1.orig Thu Oct 21 12:52:54 1999 ++++ gcc/gcc.1 Thu Oct 21 12:53:15 1999 +@@ -4141,6 +4141,11 @@ + if available, else + .B /tmp\c + \&). ++.SH "EXIT STATUS" ++Normally the exit status is 0, if compilation or link edit are successful, ++and nonzero else. The option ++.B -Werror ++treats each warning as an error. + .SH "SEE ALSO" + cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1). + .br --- gcc-2.95-2.95.4.ds15.orig/debian/patches/glibc-version.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/glibc-version.dpatch @@ -0,0 +1,32 @@ +#! /bin/sh -e + +# DP: fix glibc version at 2.2 + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- config.if~ 2002-11-14 07:56:16.000000000 +0100 ++++ config.if 2002-11-14 07:59:07.000000000 +0100 +@@ -69,6 +69,10 @@ + then + libc_interface=-libc6.`./$dummy`- + rm -f $dummy.c $dummy ++ # Debian: stay at -libc6.2- ++ if [ "${libc_interface}" = "-libc6.3-" ]; then ++ libc_interface=-libc6.2- ++ fi + else + # It should never happen. + echo "Cannot find the GNU C library minor version number." >&2 --- gcc-2.95-2.95.4.ds15.orig/debian/patches/arm-gcc4-fix.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/arm-gcc4-fix.dpatch @@ -0,0 +1,36 @@ +#! /bin/sh -e + +# DP: gcc4 build fix for arm (invalid lvalue in assignment) + +src=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + src=$3/gcc +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p0 --fuzz 10 < $0 + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p0 --fuzz 10 < $0 + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- gcc/config/arm/arm.c.orig 2001-01-25 20:39:56.000000000 +0100 ++++ gcc/config/arm/arm.c 2005-10-27 18:00:57.000000000 +0200 +@@ -527,7 +527,7 @@ + if ((TARGET_SOFT_FLOAT || arm_fpu != FP_HARD) && (tune_flags & FL_MODE32) == 0) + flag_schedule_insns = flag_schedule_insns_after_reload = 0; + +- arm_prog_mode = TARGET_APCS_32 ? PROG_MODE_PROG32 : PROG_MODE_PROG26; ++ arm_prgmode = TARGET_APCS_32 ? PROG_MODE_PROG32 : PROG_MODE_PROG26; + + if (structure_size_string != NULL) + { --- gcc-2.95-2.95.4.ds15.orig/debian/patches/gcc4-fix.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/gcc4-fix.dpatch @@ -0,0 +1,37 @@ +#!/bin/sh -e + +# DP: gcc4 build fix (invalid lvalue in increment) + +src=gcc +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + src=$3/gcc +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p0 --fuzz 10 < $0 + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p0 --fuzz 10 < $0 + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- include/obstack.h.orig 1998-09-05 12:25:19.000000000 +0000 ++++ include/obstack.h 2005-10-28 10:38:29.000000000 +0000 +@@ -417,7 +417,8 @@ + ({ struct obstack *__o = (OBSTACK); \ + if (__o->next_free + sizeof (void *) > __o->chunk_limit) \ + _obstack_newchunk (__o, sizeof (void *)); \ +- *((void **)__o->next_free)++ = ((void *)datum); \ ++ *((void **)__o->next_free) = ((void *)datum); \ ++ __o->next_free += sizeof (void *); \ + (void) 0; }) + + # define obstack_int_grow(OBSTACK,datum) \ --- gcc-2.95-2.95.4.ds15.orig/debian/patches/arm-big-endian.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/arm-big-endian.dpatch @@ -0,0 +1,89 @@ +#! /bin/sh -e + +dir= +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + dir="$3/" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p0 < $0 + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- gcc/config/arm/elf.h.orig 2005-10-11 13:14:35.000000000 +0200 ++++ gcc/config/arm/elf.h 2005-10-11 13:17:23.000000000 +0200 +@@ -146,12 +146,12 @@ + #define JUMP_TABLES_IN_TEXT_SECTION 1 + + #ifndef ASM_SPEC +-#define ASM_SPEC "%{mbig-endian:-EB} %{mcpu=*:-m%*} %{march=*:-m%*} \ ++#define ASM_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} %{mcpu=*:-m%*} %{march=*:-m%*} \ + %{mapcs-*:-mapcs-%*} %{mthumb-interwork:-mthumb-interwork} %{mapcs-float:mfloat}" + #endif + + #ifndef LINK_SPEC +-#define LINK_SPEC "%{mbig-endian:-EB} -X" ++#define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} -X" + #endif + + /* Run-time Target Specification. */ +--- gcc/config/arm/arm.h.orig 2005-10-11 13:14:42.000000000 +0200 ++++ gcc/config/arm/arm.h 2005-10-11 13:17:23.000000000 +0200 +@@ -209,8 +209,8 @@ + %{!mlittle-endian:%{!mbig-endian:%(cpp_endian_default)}} \ + " + +-/* Default is little endian, which doesn't define anything. */ +-#define CPP_ENDIAN_DEFAULT_SPEC "" ++/* Default is big endian, which defines __ARMEB__ */ ++#define CPP_ENDIAN_DEFAULT_SPEC "-D__ARMEB__" + + #define CC1_SPEC "" + +--- gcc/config/arm/linux-elf.h.orig 2005-10-11 13:15:07.000000000 +0200 ++++ gcc/config/arm/linux-elf.h 2005-10-11 13:17:52.000000000 +0200 +@@ -30,13 +30,13 @@ + + #ifndef SUBTARGET_DEFAULT_APCS26 + /* Default is to use APCS-32 mode. */ +-# define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_SHORT_BYTE) ++# define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_SHORT_BYTE | ARM_FLAG_BIG_END) + # ifdef SUBTARGET_OLD_LINKER + # define SUBTARGET_EXTRA_LINK_SPEC \ + " %{mapcs-26:-m elf32arm26} %{!mapcs-26:-m elf32arm}" + # else /* new linker */ + # define SUBTARGET_EXTRA_LINK_SPEC \ +- " %{mapcs-26:-m armelf_linux26} %{!mapcs-26:-m armelf_linux} -p" ++ " %{mapcs-26:-m armelfb_linux26} %{!mapcs-26:-m armelfb_linux} -p" + # endif + # define SUBTARGET_EXTRA_ASM_SPEC \ + " %{mapcs-26:-mapcs-26} %(!mapcs-26:-mapcs-32}" +@@ -48,7 +48,7 @@ + " %{mapcs-32:-m elf32arm} %{!mapcs-32:-m elf32arm26}" + # else /* new linker */ + # define SUBTARGET_LINK_SPEC \ +- " %{mapcs-32:-m armelf_linux} %{!mapcs-32:-m armelf_linux26} -p" ++ " %{mapcs-32:-m armelfb_linux} %{!mapcs-32:-m armelfb_linux26} -p" + # endif + # define SUBTARGET_EXTRA_ASM_SPEC \ + " %{mapcs-32:-mapcs-32} %(!mapcs-32:-mapcs-26}" +@@ -98,7 +98,7 @@ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ + -X \ +- %{mbig-endian:-EB}" \ ++ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ + SUBTARGET_EXTRA_LINK_SPEC + + #undef CPP_PREDEFINES --- gcc-2.95-2.95.4.ds15.orig/debian/patches/p-make-lang.dpatch +++ gcc-2.95-2.95.4.ds15/debian/patches/p-make-lang.dpatch @@ -0,0 +1,56 @@ +#! /bin/sh -e + +# DP: Quote the arguments to sed in the Pascal Make-lang.in. + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- gcc/p/Make-lang.in.old 2006-01-31 12:15:09.000000000 +0000 ++++ gcc/p/Make-lang.in 2006-01-31 12:16:05.000000000 +0000 +@@ -570,20 +570,20 @@ + # Exclude patched files from language-independent object file list. + # Not necessary for gcc-3 since for a library (libbackend.a), the linker does this automatically. + p/stamp-gbe: stamp-objlist Makefile +- sed -e 's: ../: :g;\ +- s: convert.o::g;\ +- s: dbxout.o::g;\ +- s: dwarf2out.o::g;\ +- s: emit-rtl.o::g;\ +- s: expr.o::g;\ +- s: fold-const.o::g;\ +- s: function.o::g;\ +- s: integrate.o::g;\ +- s: optabs.o::g;\ +- s: stmt.o::g;\ +- s: stor-layout.o::g;\ +- s: toplev.o::g;\ +- s: tree.o::g' "$<" > "$@" || { rm -f "$@"; false; } ++ sed -e 's: ../: :g;'\ ++' s: convert.o::g;'\ ++' s: dbxout.o::g;'\ ++' s: dwarf2out.o::g;'\ ++' s: emit-rtl.o::g;'\ ++' s: expr.o::g;'\ ++' s: fold-const.o::g;'\ ++' s: function.o::g;'\ ++' s: integrate.o::g;'\ ++' s: optabs.o::g;'\ ++' s: stmt.o::g;'\ ++' s: stor-layout.o::g;'\ ++' s: toplev.o::g;'\ ++' s: tree.o::g' "$<" > "$@" || { rm -f "$@"; false; } + + gpc1$(exeext): $(P) $(GPC_GCC_VERSION_DEPS) $(GPC_OBJS) $(LIBDEPS) + @grep "@@ PATCHED FOR GPC 20030218 @@" $(srcdir)/stor-layout.c > /dev/null || \ --- gcc-2.95-2.95.4.ds15.orig/debian/protoize-2.95.postinst +++ gcc-2.95-2.95.4.ds15/debian/protoize-2.95.postinst @@ -0,0 +1,17 @@ +#! /bin/sh -e + +#DEBHELPER# + +if [ "$1" = "configure" ]; then if [ -d /usr/doc -a ! -e /usr/doc/protoize -a -d /usr/share/doc/protoize ]; then ln -sf ../share/doc/protoize /usr/doc/protoize; fi; fi + +# alternative for versioned names +#if [ -n "$pkg_ver" ]; then +# pri="`echo $pkg_ver | tr -cd 0-9`" +# update-alternatives \ +# --install /usr/bin/protoize protoize /usr/bin/protoize$pkg_ver $pri \ +# --slave /usr/share/man/man1/protoize.1.gz protoize.1.gz \ +# /usr/share/man/man1/protoize$pkg_ver.1.gz \ +# --slave /usr/bin/unprotoize unprotoize /usr/bin/unprotoize$pkg_ver \ +# --slave /usr/share/man/man1/unprotoize.1.gz unprotoize.1.gz \ +# /usr/share/man/man1/unprotoize$pkg_ver.1.gz +#fi --- gcc-2.95-2.95.4.ds15.orig/debian/TODO +++ gcc-2.95-2.95.4.ds15/debian/TODO @@ -0,0 +1,102 @@ +- Fix the failure to open debian/control by one of the early awks + (appears during clean target) + +- Clean up the sprawl of debian/rules. I'm sure there are neater + ways to do some of it; perhaps split it up into some more files? + Partly done. + +- The following bugs are still open; please step forward and have a look + at http://www.debian.org/Bugs/db/ma/lDebian_GCC_maintainers,gcc,packages.debian.org,.html + + In the Debian source package you can find some bug related files in + the debian/bugs directory. + +#2910: GCC accepts multi-line strings without \ or " " &c + + Forwarded to egcs-bugs@egcs.cygnus.com + +#12253: GCC has undocumented syntax for functions definitions with attributes + + Forwarded to gcc-bugs@gcc.gnu.org + +#21255: g++ has some troubles with nested templates + + Better error message in gcc-2.95.2. Need to verify. + +#22769: egcs exceptions don't work with Tcl + + Asked bug submitter, if this can be closed. + TODO: document in README.Bugs and close. + +#25824: gcc: could give better error message when /tmp gets full. + + TODO (Still in gcc-2.95.2) + +#27516: g++ optimisation gets NaN and Inf confuses +#37154: Error in optimizing exp(-Inf) using egcc or g++ (merged) + + Forwarded to egcs-bugs@egcs.cygnus.com. + Reassigned to libc6-dev + +#31416: g++ crashes when no optimisation is used. hoewever it compiles + with -O2. + +#31546: g77 2.91 does not compile what g77 2.90 used to + + Don't know how to test this for newer versions. + Reasked submitter in Oct 1999. + +#33037: gpc crashes (internal error) when using -O + + Wait for next gpc snapshot. + +#33786: egcs optimization error + + Still in 2.95.2. + Kernel maintainer insists, that this is a bug in gcc, + gcc upstream maintainers think otherwise. + +#33975: Suggested g++ warning: changed semantics of conditional expressions + + Forwarded to egcs@egcs.cygnus.com. + +#34876: vtable thunks implementation is broken +#35477: gcc: egcs C++ class mishandling. (merged) + + Forwarded to egcs-bugs@egcs.cygnus.com. + Work in progress. + Still in gcc-2.96 19991021 + +#35215: jade: can't build tex docs of php3 + + Needs to be tested with 2.91.66 and 2.93.x + m68k only problem? + +XXXXXXXXXXXXXXXXXXXXXXXXX +#35628: libstdc++2.9-glibc2.1: ios::ate not working + reproducable with 2.10_2.95.2-0pre2 + +#36600: multiset forward iterator is const + + Waiting for input from bug submitter. Test with 2.93.x + +#36876: Erratic behaviour of gcc/egcc on pentium + + Forwarded to egcs-bugs@egcs.cygnus.com + +#44446: [m68k] mico compile fails because exception support appears broken + + can be fixed by not applying libstdc++-out-of-mem.dpatch; + Unknown, why __EXCEPTIONS is set. See bug report archive for details. + +#46062: [sparc] build fails in all-target-boehm-gc + + wait until libgcj merges the recent gc changes and/or uses + the "system" libgc. + +#47212: [m68k] libg++272_2.7.2.8-1 build failure + + Unknown, why ... + Make a temporary glibc-2.0 based environment to build libg++272? + + --- gcc-2.95-2.95.4.ds15.orig/debian/README.sparc +++ gcc-2.95-2.95.4.ds15/debian/README.sparc @@ -0,0 +1,60 @@ +The patch below is applied in gcc-2.95. Message forwarding in +the GNUstep framework (gstep-base) relies on this. I didn't experience +any side effects of this "workaround" on a sparc Solaris +platform. However this workaround affects the all compilers of the egcs +package. + +From: Richard Henderson +To: Matthias.Klose@cs.tu-berlin.de, scottc@net-community.com +Subject: Re: patch for expand_builtin_apply for sparc architecture +Date: Mon, 16 Feb 1998 05:11:32 -0800 + +In article <199802160833.JAA11275.cygnus.egcs.bugs@gargleblaster.cs.tu-berlin.de>, +Matthias Klose wrote: +>The following patch fixes the generation of an 'unimp 4095' +>instruction for the expansion of __builtin_apply on the sparc +>architecture; fix by Scott Christley (), but +>doesn't seem to be submitted to the the egcs list. + +You'll have to submit a test case and an explanation of why you think +this is correct. The Sparc32 ABI calls for an unimp instruction to +be emitted following calls to functions that return structures. The +0-4095 immediate is commentary, but that's all the room in that field +so we cannot simply remove the mask. + +My guess is that it is yet another example of why __builtin_apply +is inadequate for the needs of all but completely stack-based calling +conventions and should not be used. + + +r~ + +*** gcc/config/sparc/sparc.md.orig Mon Aug 31 18:26:17 1998 +--- gcc/config/sparc/sparc.md Mon Aug 31 18:37:56 1998 +*************** +*** 5715,5720 **** +--- 5715,5721 ---- + #endif + + if (! TARGET_ARCH64 && INTVAL (operands[3]) != 0) ++ #if 0 + emit_call_insn + (gen_rtx_PARALLEL (VOIDmode, + gen_rtvec (3, gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx), +*************** +*** 5721,5726 **** +--- 5722,5735 ---- + GEN_INT (INTVAL (operands[3]) & 0xfff), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_REG (Pmode, 15))))); ++ #else ++ emit_call_insn ++ (gen_rtx_PARALLEL (VOIDmode, ++ gen_rtvec (3, gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx), ++ operands[3], ++ gen_rtx_CLOBBER (VOIDmode, ++ gen_rtx_REG (Pmode, 15))))); ++ #endif + else + emit_call_insn + (gen_rtx_PARALLEL (VOIDmode, --- gcc-2.95-2.95.4.ds15.orig/debian/NEWS.gcc +++ gcc-2.95-2.95.4.ds15/debian/NEWS.gcc @@ -0,0 +1,1336 @@ +Noteworthy changes in GCC 2.95.3 +-------------------------------- + + GCC 2.95.3 + +January 11, 2001 + +The GNU project and the GCC developers are pleased to announce the +prerelease of GCC version 2.95.3. GCC used to stand for the GNU C +Compiler, but since the compiler supports several other languages +aside from C, it now stands for the GNU Compiler Collection. + +This is a minor release to address several bugs in the GCC version +2.95.2 release. + + +Generic bugfixes and improvements + +* Fix numerous problems that caused incorrect optimization in the + register reloading code. +* Fix numerous problems that caused incorrect optimization in the loop + optimizer. +* Fix aborts in the functions build_insn_chain and scan_loops under + some circumstances. +* Fix an alias analysis bug. +* Fix an infinite compilation bug in the combiner. +* A few problems with complex number support have been fixed. +* It is no longer possible for gcc to act as a fork bomb when + installed incorrectly. +* The -fpack-struct option should be recognized now. +* Fixed a bug that caused incorrect code to be generated due to a lost + stack adjustment. + +Platform specific bugfixes and improvements + +* Support building ARM toolchains hosted on Windows. +* Fix attribute calculations in ARM toolchains. +* arm-linux support has been improved. +* Fix a PIC failure on sparc targets. +* On ix86 targets, the regparm attribute should now work reliably. +* Several updates for the h8300 port. + +The whole suite has been extensively regression tested and package +tested. It should be reliable and suitable for widespread use. + + +Noteworthy changes in GCC 2.95.2 +-------------------------------- + + GCC 2.95.2 + + October 27, 1999 + + The GNU project and the GCC developers are pleased to announce the + release of GCC version 2.95.2. GCC used to stand for the GNU C + Compiler, but since the compiler supports several other languages + aside from C, it now stands for the GNU Compiler Collection. + + This is a minor release to address several bugs in the GCC version + 2.95.1 release. + + The -fstrict-aliasing is not enabled by default for GCC 2.95.2. While + the optimizations performed by -fstrict-aliasing are valid according + to the C and C++ standards, the optimization have caused some + problems, particularly with old non-conforming code. + + The GCC developers are experimenting with ways to warn users about + code which violates the C/C++ standards, but those warnings are not + ready for widespread use at this time. Rather than wait for those + warnings the GCC developers have choosen to disable -fstrict-aliasing + by default for the GCC 2.95.2 release. + + We strongly encourage developers to find and fix code which violates + the C/C++ standards as -fstrict-aliasing may be enabled by default in + future releases. Use the option -fstrict-aliasing to re-enable these + optimizations. + + * Generic bugfixes and improvements + + Fix incorrectly optimized memory reference in global common + subexpression elimination (GCSE) optimization pass. + + Fix code generation bug in regmove.c in which it could + incorrectly change a "const" value. + + Fix bug in optimization of conditionals involving volatile + memory references. + + Avoid over-allocation of stack space for some procedures. + + Fixed bug in the compiler which caused incorrect optimization + of an obscure series of bit manipulations, shifts and + arithmetic. + + Fixed register allocator bug which caused teTeX to be + mis-compiled on Sparc targets. + + Avoid incorrect optimization of degenerate case statements + for certain targets such as the ARM. + + Fix out of range memory reference in the jump optimizer. + + Avoid dereferencing null pointer in fix-header. + + Fix test for GCC specific features so that it is possible to + bootstrap with gcc-2.6.2 and older versions of GCC. + + Fix typo in scheduler which could potentially cause out of + range memory accesses. + + Avoid incorrect loop reversal which caused incorrect code for + certain loops on PowerPC targets. + + Avoid incorrect optimization of switch statements on certain + targets (for example the ARM). + * Platform specific bugfixes and improvements + + Work around bug in Sun V5.0 compilers which caused bootstrap + comparison failures on Sparc targets. + + Fix Sparc backend bug which caused aborts in final.c. + + Fix sparc-hal-solaris2* configuration fragments. + + Fix bug in sparc block profiling. + + Fix obscure code generation bug for the PARISC targets. + + Define __STDC_EXT__ for HPUX configurations. + + Various POWERPC64 code generation bugfixes. + + Fix abort for PPC targets using ELF (ex GNU/Linux). + + Fix collect2 problems for AIX targets. + + Correct handling of .file directive for PPC targets. + + Fix bug in fix_trunc x86 patterns. + + Fix x86 port to correctly pop the FP stack for functions that + return structures in memory. + + Fix minor bug in strlen x86 pattern. + + Use stabs debugging instead of dwarf1 for x86-solaris + targets. + + Fix template repository code to handle leading underscore in + mangled names. + + Fix weak/weak alias support for OpenBSD. + + GNU/Linux for the ARM has C++ compatible include files. + * Language & Runtime specific fixes. + + Fix handling of constructor attribute in the C front-end + which caused problems building the Chill runtime library on + some targets. + + Fix minor problem merging type qualifiers in the C front-end. + + Fix aliasing bug for pointers and references (C/C++). + + Fix incorrect "non-constant initializer bug" when + -traditional or -fwritable-strings is enabled. + + Fix build error for Chill front-end on SunOS. + + Do not complain about duplicate instantiations when using + -frepo (C++) + + Fix array bounds handling in C++ front-end which caused + problems with dwarf debugging information in some + circumstances. + + Fix minor namespace problem. + + Fix problem linking java programs. + + +Noteworthy changes in GCC 2.95.1 +-------------------------------- + + GCC 2.95.1 + + This is a minor release to address several bugs in the GCC version + 2.95 release. + + * Generic bugfixes and improvements + + Various documentation fixes related to the GCC/EGCS merger. + + Fix memory management bug which could lead to spurious + aborts, core dumps or random parsing errors in the compiler. + + Fix a couple bugs in the dwarf1 and dwarf2 debug record + support. + + Fix infinite loop in the CSE optimizer. + + Avoid undefined behavior in compiler FP emulation code + + Fix install problem when prefix is overridden on the make + install command. + + Fix problem with unwanted installation of assert.h on some + systems. + + Fix problem with finding the wrong assembler in a single tree + build. + + Avoid increasing the known alignment of a register that is + already known to be a pointer. + * Platform specific bugfixes and improvements + + Codegen bugfix for prologue/epilogue for cpu32 target. + + Fix long long code generation bug for the Coldfire target. + + Fix various aborts in the SH compiler. + + Fix bugs in libgcc support library for the SH. + + Fix alpha ev6 code generation bug. + + Fix problems with EXIT_SUCCESS/EXIT_FAILURE redefinitions on + AIX platforms. + + Fix -fpic code generation bug for rs6000/ppc svr4 targets. + + Fix varargs/stdarg code generation bug for rs6000/ppc svr4 + targets. + + Fix weak symbol handling for rs6000/ppc svr4 targets. + + Fix various problems with 64bit code generation for the + rs6000/ppc port. + + Fix codegen bug which cuased tetex to be mis-compiled on the + x86 + + Fix compiler abort in new cfg code exposed by x86 port. + + Fix out of range array reference in code convert flat + registers to the x87 stacked FP register file. + + Fix minor vxworks configuration bug + + Fix return type of bsearch for SunOS 4.x. + * Language & Runtime specific fixes. + + The G++ signature extension has been deprecated. It will be + removed in the next major release of G++. Use of signatures + will result in a warning from the compiler. + + Several bugs relating to templates and namespaces were fixed. + + A bug that caused crashes when combining templates with -g on + DWARF1 platforms was fixed. + + Pointers-to-members, virtual functions, and multiple + inheritance should now work together correctly. + + Some code-generation bugs relating to function try blocks + were fixed. + + G++ is a little bit more lenient with certain archaic + constructs than in GCC 2.95. + + Fix to prevent shared library version #s from bring truncated + to 1 digit + + Fix missing std:: in the libstdc++ library. + + Fix stream locking problems in libio. + + Fix problem in java compiler driver. + +Noteworthy changes in GCC 2.95 +------------------------------ + + * General Optimizer Improvements: + + Localized register spilling to improve speed and code density + especially on small register class machines. + + Global CSE using lazy code motion algorithms. + + Improved global constant/copy propagation. + + Improved control flow graph analysis and manipulation. + + Local dead store elimination. + + Memory Load hoisting/store sinking in loops. + + Type based alias analysis is enabled by default. Note this feature + will expose bugs in the Linux kernel. Please refer to the FAQ for + additional information on this issue. + + Major revamp of GIV detection, combination and simplification + to improve loop performance. + + Major improvements to register allocation and reloading. + * New Languages and Language specific improvements + + Many C++ improvements. + + Many Fortran improvements. + + Java front-end has been integrated. A runtime library is available + separately. + + ISO C9X support + + Chill front-end and runtime has been integrated. + + Boehm garbage collector support in libobjc. + + More support for various pragmas which appear in vendor + include files + * New Targets and Target Specific Improvements + + Sparc backend rewrite. + + -mschedule=8000 will optimize code for PA8000 class processors; + -mpa-risc-2-0 will generate code for PA2.0 processors + + Various micro-optimizations for the ia32 port. K6 optimizations + + Compiler will attempt to align doubles in the stack on the + ia32 port + + Alpha EV6 support + + PowerPC 750 + + c3x, c4x + + HyperSparc + + SparcLite86x + + sh4 + + Support for new systems (OpenBSD, FreeBSD, UWIN, Interix, + arm-linux) + + vxWorks targets include support for vxWorks threads + + StrongARM 110 and ARM9 support added. ARM Scheduling parameters + rewritten. + + Various changes to the MIPS port to avoid assembler macros, which + + Various performance improvements to the i960 port. + + Major rewrite of ns32k port in turn improves performance + * Other significant improvements + + Ability to dump cfg information and display it using vcg. + + The new faster scheme for fixing vendor header files is enabled + by default. + + Experimental internationalization support. + + multibyte character support + + Some compile-time speedups for pathological problems + + Better support for complex types + * Plus the usual mountain of bugfixes + * Core compiler is based on the gcc2 development tree from Sept 30, 1998, + so we have all of the features found in GCC 2.8. + +Noteworthy changes in GCC after EGCS 1.1. +----------------------------------------- + +Target specific NEWS + + RS6000/PowerPC: -mcpu=401 was added as an alias for -mcpu=403. -mcpu=e603e + was added to do -mcpu=603e and -msoft-float. + +Noteworthy changes in GCC for EGCS 1.1. +--------------------------------------- + +The compiler now implements global common subexpression elimination (gcse) as +well as global constant/copy propagation. (link to gcse page). + +More major improvements have been made to the alias analysis code. A new +option to allow front-ends to provide alias information to the optimizers +has also been added (-fstrict-aliasing). -fstrict-aliasing is off by default +now, but will be enabled by default in the future. (link to alias page) + +Major changes continue in the exception handling support. This release +includes some changes to reduce static overhead for exception handling. It +also includes some major changes to the setjmp/longjmp based EH mechanism to +make it less pessimistic. And finally, major infrastructure improvements +to the dwarf2 EH mechanism have been made to make our EH support extensible. + +We have fixed the infamous security problems with temporary files. + +The "regmove" optimization pass has been nearly completely rewritten. It now +uses much more information about the target to determine profitability of +transformations. + +The compiler now recomputes register usage information immediately before +register allocation. Previously such information was only not kept up to +date after instruction combination which led to poor register allocation +choices by our priority based register allocator. + +The register reloading phase of the compiler has been improved to better +optimize spill code. This primarily helps targets which generate lots of +spills (like the x86 ports and many register poor embedded ports). + +A few changes in the heuristics used by the register allocator and scheduler +have been made which can significantly improve performance for certain +applications. + +The compiler's branch shortening algorithms have been significantly improved +to work better on targets which align jump targets. + +The compiler now supports the "ADDRESSOF" optimization which can significantly +reduce the overhead for certain inline calls (and inline calls in general). + +The compiler now supports a code size optimization switch (-Os). When enabled +the compiler will prefer optimizations which improve code size over those +which improve code speed. + +The compiler has been improved to completely eliminate library calls which +compute constant values. This is particularly useful on machines which +do not have integer mul/div or floating point support on-chip. + +GCC now supports a "--help" option to print detailed help information. + +cpplib has been greatly improved. It is probably useable for some sites now +(major missing feature is trigraphs). + +Memory footprint for the compiler has been significantly reduced for certain +pathalogical cases. + +Build time improvements for targets which support lots of sched parameters +(alpha and mips primarily). + +Compile time for certain programs using large constant initializers has been +improved (effects glibc significantly). + +Plus an incredible number of infrastructure changes, warning fixes, bugfixes +and local optimizations. + +Various improvements have been made to better support cross compilations. They +are still not easy, but they are improving. + +Target specific NEWS + + Sparc: Now includes V8 plus and V9 support, lots of tuning for Ultrasparcs + and uses the Haifa scheduler by default. + + Alpha: EV6 tuned, optimized expansion of memcpy/bzero. + + x86: Data in the static store is aligned per Intel recommendations. Jump + targets are aligned per Intel recommendations. Improved epilogue + sequences for Pentium chips. Backend improvements which should help + register allocation on all x86 variants. Support for PPro conditional + move instructions has been fixed and enabled. Random changes + throughout the port to make generated code more Pentium friendly. + Improved support for 64bit integer operations. + Unixware 7, a System V Release 5 target is now supported. + SCO OpenServer targets can support GAS. See gcc/INSTALL for details. + + RS6000/PowerPC: Includes AIX4.3 support as well as PowerPC64 support. + Haifa instruction scheduling is enabled by default now. + + MIPS: Multiply/Multiply-Add support has been largely rewritten to generate + more efficient code. Includes mips16 support. + + M68K: Various micro-optimizations and Coldfire fixes. + + M32r: Major improvements to this port. + + Arm: Includes Thumb and super interworking support. + +EGCS includes all gcc2 changes up to and including the June 9, 1998 snapshot. + + +Noteworthy changes in GCC version 2.8.1 +--------------------------------------- + +Numerous bugs have been fixed and some minor performance +improvements (compilation speed) have been made. + +Noteworthy changes in GCC version 2.8.0 +--------------------------------------- + +A major change in this release is the addition of a framework for +exception handling, currently used by C++. Many internal changes and +optimization improvements have been made. These increase the +maintainability and portability of GCC. GCC now uses autoconf to +compute many host parameters. + +The following lists changes that add new features or targets. + +See cp/NEWS for new features of C++ in this release. + +New tools and features: + + The Dwarf 2 debugging information format is supported on ELF systems, and + is the default for -ggdb where available. It can also be used for C++. + The Dwarf version 1 debugging format is also permitted for C++, but + does not work well. + + gcov.c is provided for test coverage analysis and branch profiling + analysis is also supported; see -fprofile-arcs, -ftest-coverage, + and -fbranch-probabilities. + + Support for the Checker memory checking tool. + + New switch, -fstack-check, to check for stack overflow on systems that + don't have such built into their ABI. + + New switches, -Wundef and -Wno-undef to warn if an undefined identifier + is evaluated in an #if directive. + + Options -Wall and -Wimplicit now cause GCC to warn about implicit int + in declarations (e.g. `register i;'), since the C Standard committee + has decided to disallow this in the next revision of the standard; + -Wimplicit-function-declarations and -Wimplicit-int are subsets of + this. + + Option -Wsign-compare causes GCC to warn about comparison of signed and + unsigned values. + + Add -dI option of cccp for cxref. + +New features in configuration, installation and specs file handling: + + New option --enable-c-cpplib to configure script. + + You can use --with-cpu on the configure command to specify the default + CPU that GCC should generate code for. + + The -specs=file switch allows you to override default specs used in + invoking programs like cc1, as, etc. + + Allow including one specs file from another and renaming a specs + variable. + + You can now relocate all GCC files with a single environment variable + or a registry entry under Windows 95 and Windows NT. + +Changes in Objective-C: + + The Objective-C Runtime Library has been made thread-safe. + + The Objective-C Runtime Library contains an interface for creating + mutexes, condition mutexes, and threads; it requires a back-end + implementation for the specific platform and/or thread package. + Currently supported are DEC/OSF1, IRIX, Mach, OS/2, POSIX, PCThreads, + Solaris, and Windows32. The --enable-threads parameter can be used + when configuring GCC to enable and select a thread back-end. + + Objective-C is now configured as separate front-end language to GCC, + making it more convenient to conditionally build it. + + The internal structures of the Objective-C Runtime Library have + changed sufficiently to warrant a new version number; now version 8. + Programs compiled with an older version must be recompiled. + + The Objective-C Runtime Library can be built as a DLL on Windows 95 + and Windows NT systems. + + The Objective-C Runtime Library implements +load. + +The following new targets are supported (see also list under each +individual CPU below): + + Embedded target m32r-elf. + Embedded Hitachi Super-H using ELF. + RTEMS real-time system on various CPU targets. + ARC processor. + NEC V850 processor. + Matsushita MN10200 processor. + Matsushita MN10300 processor. + Sparc and PowerPC running on VxWorks. + Support both glibc versions 1 and 2 on Linux-based GNU systems. + +New features for DEC Alpha systems: + + Allow detailed specification of IEEE fp support: + -mieee, -mieee-with-inexact, and -mieee-conformant + -mfp-trap-mode=xxx, -mfp-round-mode=xxx, -mtrap-precision=xxx + -mcpu=xxx for CPU selection + Support scheduling parameters for EV5. + Add support for BWX, CIX, and MAX instruction set extensions. + Support Linux-based GNU systems. + Support VMS. + +Additional supported processors and systems for MIPS targets: + + MIPS4 instruction set. + R4100, R4300 and R5000 processors. + N32 and N64 ABI. + IRIX 6.2. + SNI SINIX. + +New features for Intel x86 family: + + Add scheduling parameters for Pentium and Pentium Pro. + Support stabs on Solaris-x86. + Intel x86 processors running the SCO OpenServer 5 family. + Intel x86 processors running DG/UX. + Intel x86 using Cygwin32 or Mingw32 on Windows 95 and Windows NT. + +New features for Motorola 68k family: + + Support for 68060 processor. + More consistent switches to specify processor. + Motorola 68k family running AUX. + 68040 running pSOS, ELF object files, DBX debugging. + Coldfire variant of Motorola m68k family. + +New features for the HP PA RISC: + + -mspace and -mno-space + -mlong-load-store and -mno-long-load-store + -mbig-switch -mno-big-switch + + GCC on the PA requires either gas-2.7 or the HP assembler; for best + results using GAS is highly recommended. GAS is required for -g and + exception handling support. + +New features for SPARC-based systems: + + The ultrasparc cpu. + The sparclet cpu, supporting only a.out file format. + Sparc running SunOS 4 with the GNU assembler. + Sparc running the Linux-based GNU system. + Embedded Sparc processors running the ELF object file format. + -mcpu=xxx + -mtune=xxx + -malign-loops=xxx + -malign-jumps=xxx + -malign-functions=xxx + -mimpure-text and -mno-impure-text + + Options -mno-v8 and -mno-sparclite are no longer supported on SPARC + targets. Options -mcypress, -mv8, -msupersparc, -msparclite, -mf930, + and -mf934 are deprecated and will be deleted in GCC 2.9. Use + -mcpu=xxx instead. + +New features for rs6000 and PowerPC systems: + + Solaris 2.51 running on PowerPC's. + The Linux-based GNU system running on PowerPC's. + -mcpu=604e,602,603e,620,801,823,mpc505,821,860,power2 + -mtune=xxx + -mrelocatable-lib, -mno-relocatable-lib + -msim, -mmve, -memb + -mupdate, -mno-update + -mfused-madd, -mno-fused-madd + + -mregnames + -meabi + -mcall-linux, -mcall-solaris, -mcall-sysv-eabi, -mcall-sysv-noeabi + -msdata, -msdata=none, -msdata=default, -msdata=sysv, -msdata=eabi + -memb, -msim, -mmvme + -myellowknife, -mads + wchar_t is now of type long as per the ABI, not unsigned short. + -p/-pg support + -mcpu=403 now implies -mstrict-align. + Implement System V profiling. + + Aix 4.1 GCC targets now default to -mcpu=common so that programs + compiled can be moved between rs6000 and powerpc based systems. A + consequence of this is that -static won't work, and that some programs + may be slightly slower. + + You can select the default value to use for -mcpu=xxx on rs6000 and + powerpc targets by using the --with-cpu=xxx option when configuring the + compiler. In addition, a new options, -mtune=xxx was added that + selects the machine to schedule for but does not select the + architecture level. + + Directory names used for storing the multilib libraries on System V + and embedded PowerPC systems have been shortened to work with commands + like tar that have fixed limits on pathname size. + +New features for the Hitachi H8/300(H): + + -malign-300 + -ms (for the Hitachi H8/S processor) + -mint32 + +New features for the ARM: + + -march=xxx, -mtune=xxx, -mcpu=xxx + Support interworking with Thumb code. + ARM processor with a.out object format, COFF, or AOF assembler. + ARM on "semi-hosted" platform. + ARM running NetBSD. + ARM running the Linux-based GNU system. + +New feature for Solaris systems: + + GCC installation no longer makes a copy of system include files, + thus insulating GCC better from updates to the operating system. + + +Noteworthy changes in GCC version 2.7.2 +--------------------------------------- + +A few bugs have been fixed (most notably the generation of an +invalid assembler opcode on some RS/6000 systems). + +Noteworthy changes in GCC version 2.7.1 +--------------------------------------- + +This release fixes numerous bugs (mostly minor) in GCC 2.7.0, but +also contains a few new features, mostly related to specific targets. + +Major changes have been made in code to support Windows NT. + +The following new targets are supported: + + 2.9 BSD on PDP-11 + Linux on m68k + HP/UX version 10 on HP PA RISC (treated like version 9) + DEC Alpha running Windows NT + +When parsing C, GCC now recognizes C++ style `//' comments unless you +specify `-ansi' or `-traditional'. + +The PowerPC System V targets (powerpc-*-sysv, powerpc-*-eabi) now use the +calling sequence specified in the System V Application Binary Interface +Processor Supplement (PowerPC Processor ABI Supplement) rather than the calling +sequence used in GCC version 2.7.0. That calling sequence was based on the AIX +calling sequence without function descriptors. To compile code for that older +calling sequence, either configure the compiler for powerpc-*-eabiaix or use +the -mcall-aix switch when compiling and linking. + +Noteworthy changes in GCC version 2.7.0 +--------------------------------------- + +GCC now works better on systems that use ".obj" and ".exe" instead of +".o" and no extension. This involved changes to the driver program, +gcc.c, to convert ".o" names to ".obj" and to GCC's Makefile to use +".obj" and ".exe" in filenames that are not targets. In order to +build GCC on such systems, you may need versions of GNU make and/or +compatible shells. At this point, this support is preliminary. + +Object file extensions of ".obj" and executable file extensions of +".exe" are allowed when using appropriate version of GNU Make. + +Numerous enhancements were made to the __attribute__ facility including +more attributes and more places that support it. We now support the +"packed", "nocommon", "noreturn", "volatile", "const", "unused", +"transparent_union", "constructor", "destructor", "mode", "section", +"align", "format", "weak", and "alias" attributes. Each of these +names may also be specified with added underscores, e.g., "__packed__". +__attribute__ may now be applied to parameter definitions, function +definitions, and structure, enum, and union definitions. + +GCC now supports returning more structures in registers, as specified by +many calling sequences (ABIs), such as on the HP PA RISC. + +A new option '-fpack-struct' was added to automatically pack all structure +members together without holes. + +There is a new library (cpplib) and program (cppmain) that at some +point will replace cpp (aka cccp). To use cppmain as cpp now, pass +the option CCCP=cppmain to make. The library is already used by the +fix-header program, which should speed up the fixproto script. + +New options for supported targets: + + GNU on many targets. + NetBSD on MIPS, m68k, VAX, and x86. + LynxOS on x86, m68k, Sparc, and RS/6000. + VxWorks on many targets. + + Windows/NT on x86 architecture. Initial support for Windows/NT on Alpha + (not fully working). + + Many embedded targets, specifically UDI on a29k, aout, coff, elf, + and vsta "operating systems" on m68k, m88k, mips, sparc, and x86. + +Additional support for x86 (i386, i486, and Pentium): + + Work with old and new linkers for Linux-based GNU systems, + supporting both a.out and ELF. + FreeBSD on x86. + Stdcall convention. + -malign-double, -mregparm=, -malign-loops= and -malign-jumps= switches. + On ISC systems, support -Xp like -posix. + +Additions for RS/6000: + + Instruction scheduling information for PowerPC 403. + AIX 4.1 on PowerPC. + -mstring and -mno-string. + -msoft-float and floating-point emulation included. + Preliminary support for PowerPC System V.4 with or without the GNU as. + Preliminary support for EABI. + Preliminary support for 64-bit systems. + Both big and little endian systems. + +New features for MIPS-based systems: + + r4650. + mips4 and R8000. + Irix 6.0. + 64-bit ABI. + Allow dollar signs in labels on SGI/Irix 5.x. + +New support for HP PA RISC: + + Generation of PIC (requires binutils-2.5.2.u6 or later). + HP-UX version 9 on HP PA RISC (dynamically links even with -g). + Processor variants for HP PA RISC: 700, 7100, and 7100LC. + Automatic generation of long calls when needed. + -mfast-indirect-calls for kernels and static binaries. + + The called routine now copies arguments passed by invisible reference, + as required by the calling standard. + +Other new miscellaneous target-specific support: + + -mno-multm on a29k. + -mold-align for i960. + Configuration for "semi-hosted" ARM. + -momit-leaf-frame-pointer for M88k. + SH3 variant of Hitachi Super-H and support both big and little endian. + +Changes to Objective-C: + + Bare-bones implementation of NXConstantString has been added, + which is invoked by the @"string" directive. + + Class * has been changed to Class to conform to the NextSTEP and + OpenStep runtime. + + Enhancements to make dynamic loading easier. + + The module version number has been updated to Version 7, thus existing + code will need to be recompiled to use the current run-time library. + +GCC now supports the ISO Normative Addendum 1 to the C Standard. +As a result: + + The header defines macros for C programs written + in national variants of ISO 646. + + The following digraph tokens are supported: + <: :> <% %> %: %:%: + These behave like the following, respectively: + [ ] { } # ## + + Digraph tokens are supported unless you specify the `-traditional' + option; you do not need to specify `-ansi' or `-trigraphs'. Except + for contrived and unlikely examples involving preprocessor + stringizing, digraph interpretation doesn't change the meaning of + programs; this is unlike trigraph interpretation, which changes the + meanings of relatively common strings. + + The macro __STDC_VERSION__ has the value 199409L. + + As usual, for full conformance to the standard, you also need a + C library that conforms. + +The following lists changes that have been made to g++. If some +features mentioned below sound unfamiliar, you will probably want to +look at the recently-released public review copy of the C++ Working +Paper. For PostScript and PDF (Adobe Acrobat) versions, see the +archive at ftp://research.att.com/dist/stdc++/WP. For HTML and ASCII +versions, see ftp://ftp.cygnus.com/pub/g++. On the web, see +http://www.cygnus.com/~mrs/wp-draft. + +The scope of variables declared in the for-init-statement has been changed +to conform to http://www.cygnus.com/~mrs/wp-draft/stmt.html#stmt.for; as a +result, packages such as groff 1.09 will not compile unless you specify the +-fno-for-scope flag. PLEASE DO NOT REPORT THIS AS A BUG; this is a change +mandated by the C++ standardization committee. + +Binary incompatibilities: + + The builtin 'bool' type is now the size of a machine word on RISC targets, + for code efficiency; it remains one byte long on CISC targets. + + Code that does not use #pragma interface/implementation will most + likely shrink dramatically, as g++ now only emits the vtable for a + class in the translation unit where its first non-inline, non-abstract + virtual function is defined. + + Classes that do not define the copy constructor will sometimes be + passed and returned in registers. This may illuminate latent bugs in + your code. + +Support for automatic template instantiation has *NOT* been added, due +to a disagreement over design philosophies. + +Support for exception handling has been improved; more targets are now +supported, and throws will use the RTTI mechanism to match against the +catch parameter type. Optimization is NOT SUPPORTED with +-fhandle-exceptions; no need to report this as a bug. + +Support for Run-Time Type Identification has been added with -frtti. +This support is still in alpha; one major restriction is that any file +compiled with -frtti must include . + +Preliminary support for namespaces has been added. This support is far +from complete, and probably not useful. + +Synthesis of compiler-generated constructors, destructors and +assignment operators is now deferred until the functions are used. + +The parsing of expressions such as `a ? b : c = 1' has changed from +`(a ? b : c) = 1' to `a : b ? (c = 1)'. + +The code generated for testing conditions, especially those using || +and &&, is now more efficient. + +The operator keywords and, and_eq, bitand, bitor, compl, not, not_eq, +or, or_eq, xor and xor_eq are now supported. Use -ansi or +-foperator-names to enable them. + +The 'explicit' keyword is now supported. 'explicit' is used to mark +constructors and type conversion operators that should not be used +implicitly. + +g++ now accepts the typename keyword, though it currently has no +semantics; it can be a no-op in the current template implementation. +You may want to start using it in your code, however, since the +pending rewrite of the template implementation to compile STL properly +(perhaps for 2.8.0, perhaps not) will require you to use it as +indicated by the current draft. + +Handling of user-defined type conversion has been overhauled so that +type conversion operators are now found and used properly in +expressions and function calls. + +-fno-strict-prototype now only applies to function declarations with +"C" linkage. + +g++ now warns about 'if (x=0)' with -Wparentheses or -Wall. + +#pragma weak and #pragma pack are supported on System V R4 targets, as +are various other target-specific #pragmas supported by gcc. + +new and delete of const types is now allowed (with no additional +semantics). + +Explicit instantiation of template methods is now supported. Also, +'inline template class foo;' can be used to emit only the vtable +for a template class. + +With -fcheck-new, g++ will check the return value of all calls to +operator new, and not attempt to modify a returned null pointer. + +The template instantiation code now handles more conversions when +passing to a parameter that does not depend on template arguments. +This means that code like 'string s; cout << s;' now works. + +Invalid jumps in a switch statement past declarations that require +initializations are now caught. + +Functions declared 'extern inline' now have the same linkage semantics +as inline member functions. On supported targets, where previously +these functions (and vtables, and template instantiations) would have +been defined statically, they will now be defined as weak symbols so +that only one out-of-line definition is used. + +collect2 now demangles linker output, and c++filt has become part of +the gcc distribution. + +Noteworthy changes in GCC version 2.6.3: + +A few more bugs have been fixed. + +Noteworthy changes in GCC version 2.6.2: + +A few bugs have been fixed. + +Names of attributes can now be preceded and followed by double underscores. + +Noteworthy changes in GCC version 2.6.1: + +Numerous (mostly minor) bugs have been fixed. + +The following new configurations are supported: + + GNU on x86 (instead of treating it like MACH) + NetBSD on Sparc and Motorola 68k + AIX 4.1 on RS/6000 and PowerPC systems + Sequent DYNIX/ptx 1.x and 2.x. + Both COFF and ELF configurations on AViiON without using /bin/gcc + Windows/NT on x86 architecture; preliminary + AT&T DSP1610 digital signal processor chips + i960 systems on bare boards using COFF + PDP11; target only and not extensively tested + +The -pg option is now supported for Alpha under OSF/1 V3.0 or later. + +Files with an extension of ".c++" are treated as C++ code. + +The -Xlinker and -Wl arguments are now passed to the linker in the +position they were specified on the command line. This makes it +possible, for example, to pass flags to the linker about specific +object files. + +The use of positional arguments to the configure script is no longer +recommended. Use --target= to specify the target; see the GCC manual. + +The 386 now supports two new switches: -mreg-alloc= changes +the default register allocation order used by the compiler, and +-mno-wide-multiply disables the use of the mul/imul instructions that +produce 64 bit results in EAX:EDX from 32 bit operands to do long long +multiplies and 32-bit division by constants. + +Noteworthy changes in GCC version 2.6.0: + +Numerous bugs have been fixed, in the C and C++ front-ends, as +well as in the common compiler code. + +This release includes the C, Objective-C, and C++ compilers. However, +we have moved the files for the C++ compiler (G++) files to a +subdirectory, cp. Subsequent releases of GCC will split these files +to a separate TAR file. + +The G++ team has been tracking the development of the ANSI standard for C++. +Here are some new features added from the latest working paper: + + * built-in boolean type 'bool', with constants 'true' and 'false'. + * array new and delete (operator new [] and delete []). + * WP-conforming lifetime of temporaries. + * explicit instantiation of templates (template class A;), + along with an option (-fno-implicit-templates) to disable emission + of implicitly instantiated templates, obsoletes -fexternal-templates. + * static member constants (static const int foo = 4; within the + class declaration). + +Many error messages have been improved to tell the user more about the +problem. Conformance checking with -pedantic-errors has been +improved. G++ now compiles Fresco. + +There is now an experimental implementation of virtual functions using +thunks instead of Cfront-style vtables, enabled with -fvtable-thunks. +This option also enables a heuristic which causes the compiler to only +emit the vtable in the translation unit where its first non-inline +virtual function is defined; using this option and +-fno-implicit-templates, users should be able to avoid #pragma +interface/implementation altogether. + +Signatures have been added as a GNU C++ extension. Using the option +-fhandle-signatures, users are able to turn on recognition of +signatures. A short introduction on signatures is in the section +`Extension to the C++ Language' in the manual. + +The `g++' program is now a C program, rather than a shell script. + +Lots and lots and lots of bugs fixes, in nested types, access control, +pointers to member functions, the parser, templates, overload +resolution, etc, etc. + +There have been two major enhancements to the Objective-C compiler: + +1) Added portability. It now runs on Alpha, and some problems with + message forwarding have been addressed on other platforms. + +2) Selectors have been redefined to be pointers to structs like: + { void *sel_id, char *sel_types }, where the sel_id is the unique + identifier, the selector itself is no longer unique. + + Programmers should use the new function sel_eq to test selector + equivalence. + +The following major changes have been made to the base compiler and +machine-specific files. + +- The MIL-STD-1750A is a new port, but still preliminary. + +- The h8/300h is now supported; both the h8/300 and h8/300h ports come + with 32 bit IEEE 754 software floating point support. + +- The 64-bit Sparc (v9) and 64-bit MIPS chips are supported. + +- NetBSD is supported on m68k, Intel x86, and pc523 systems and FreeBSD + on x86. + +- COFF is supported on x86, m68k, and Sparc systems running LynxOS. + +- 68K systems from Bull and Concurrent are supported and System V + Release 4 is supported on the Atari. + +- GCC supports GAS on the Motorola 3300 (sysV68) and debugging + (assuming GAS) on the Plexus 68K system. (However, GAS does not yet + work on those systems). + +- System V Release 4 is supported on MIPS (Tandem). + +- For DG/UX, an ELF configuration is now supported, and both the ELF + and BCS configurations support ELF and COFF object file formats. + +- OSF/1 V2.0 is supported on Alpha. + +- Function profiling is also supported on Alpha. + +- GAS and GDB is supported for Irix 5 (MIPS). + +- "common mode" (code that will run on both POWER and PowerPC + architectures) is now supported for the RS/6000 family; the + compiler knows about more PPC chips. + +- Both NeXTStep 2.1 and 3 are supported on 68k-based architectures. + +- On the AMD 29k, the -msoft-float is now supported, as well as + -mno-sum-in-toc for RS/6000, -mapp-regs and -mflat for Sparc, and + -membedded-pic for MIPS. + +- GCC can now convert division by integer constants into the equivalent + multiplication and shift operations when that is faster than the + division. + +- Two new warning options, -Wbad-function-cast and + -Wmissing-declarations have been added. + +- Configurations may now add machine-specific __attribute__ options on + type; many machines support the `section' attribute. + +- The -ffast-math flag permits some optimization that violate strict + IEEE rules, such as converting X * 0.0 to 0.0. + +Noteworthy changes in GCC version 2.5.8: + +This release only fixes a few serious bugs. These include fixes for a +bug that prevented most programs from working on the RS/6000, a bug +that caused invalid assembler code for programs with a `switch' +statement on the NS32K, a G++ problem that caused undefined names in +some configurations, and several less serious problems, some of which +can affect most configuration. + +Noteworthy change in GCC version 2.5.7: + +This release only fixes a few bugs, one of which was causing bootstrap +compare errors on some systems. + +Noteworthy change in GCC version 2.5.6: + +A few backend bugs have been fixed, some of which only occur on one +machine. + +The C++ compiler in 2.5.6 includes: + + * fixes for some common crashes + * correct handling of nested types that are referenced as `foo::bar' + * spurious warnings about friends being declared static and never + defined should no longer appear + * enums that are local to a method in a class, or a class that's + local to a function, are now handled correctly. For example: + class foo { void bar () { enum { x, y } E; x; } }; + void bar () { class foo { enum { x, y } E; E baz; }; } + +Noteworthy change in GCC version 2.5.5: + +A large number of C++ bugs have been fixed. + +The fixproto script adds prototypes conditionally on __cplusplus. + +Noteworthy change in GCC version 2.5.4: + +A bug fix in passing of structure arguments for the HP-PA architecture +makes code compiled with GCC 2.5.4 incompatible with code compiled +with earlier versions (if it passes struct arguments of 33 to 64 bits, +interspersed with other types of arguments). + +Noteworthy change in gcc version 2.5.3: + +The method of "mangling" C++ function names has been changed. So you +must recompile all C++ programs completely when you start using GCC +2.5. Also, GCC 2.5 requires libg++ version 2.5. Earlier libg++ +versions won't work with GCC 2.5. (This is generally true--GCC +version M.N requires libg++ version M.N.) + +Noteworthy GCC changes in version 2.5: + +* There is now support for the IBM 370 architecture as a target. +Currently the only operating system supported is MVS; GCC does not run +on MVS, so you must produce .s files using GCC as a cross compiler, +then transfer them to MVS to assemble them. This port is not reliable +yet. + +* The Power PC is now supported. + +* The i860-based Paragon machine is now supported. + +* The Hitachi 3050 (an HP-PA machine) is now supported. + +* The variable __GNUC_MINOR__ holds the minor version number of GCC, as +an integer. For version 2.5.X, the value is 5. + +* In C, initializers for static and global variables are now processed +an element at a time, so that they don't need a lot of storage. + +* The C syntax for specifying which structure field comes next in an +initializer is now `.FIELDNAME='. The corresponding syntax for +array initializers is now `[INDEX]='. For example, + + char whitespace[256] + = { [' '] = 1, ['\t'] = 1, ['\n'] = 1 }; + +This was changed to accord with the syntax proposed by the Numerical +C Extensions Group (NCEG). + +* Complex numbers are now supported in C. Use the keyword __complex__ +to declare complex data types. See the manual for details. + +* GCC now supports `long double' meaningfully on the Sparc (128-bit +floating point) and on the 386 (96-bit floating point). The Sparc +support is enabled on Solaris 2.x because earlier system versions +(SunOS 4) have bugs in the emulation. + +* All targets now have assertions for cpu, machine and system. So you +can now use assertions to distinguish among all supported targets. + +* Nested functions in C may now be inline. Just declare them inline +in the usual way. + +* Packed structure members are now supported fully; it should be possible +to access them on any supported target, no matter how little alignment +they have. + +* To declare that a function does not return, you must now write +something like this (works only in 2.5): + + void fatal () __attribute__ ((noreturn)); + +or like this (works in older versions too): + + typedef void voidfn (); + + volatile voidfn fatal; + +It used to be possible to do so by writing this: + + volatile void fatal (); + +but it turns out that ANSI C requires that to mean something +else (which is useless). + +Likewise, to declare that a function is side-effect-free +so that calls may be deleted or combined, write +something like this (works only in 2.5): + + int computation () __attribute__ ((const)); + +or like this (works in older versions too): + + typedef int intfn (); + + const intfn computation; + +* The new option -iwithprefixbefore specifies a directory to add to +the search path for include files in the same position where -I would +put it, but uses the specified prefix just like -iwithprefix. + +* Basic block profiling has been enhanced to record the function the +basic block comes from, and if the module was compiled for debugging, +the line number and filename. A default version of the basic block +support module has been added to libgcc2 that appends the basic block +information to a text file 'bb.out'. Machine descriptions can now +override the basic block support module in the target macro file. + +New features in g++: + +* The new flag `-fansi-overloading' for C++. Use a newly implemented +scheme of argument matching for C++. It makes g++ more accurately +obey the rules set down in Chapter 13 of the Annotated C++ Reference +Manual (the ARM). This option will be turned on by default in a +future release. + +* The -finline-debug flag is now gone (it was never really used by the + compiler). + +* Recognizing the syntax for pointers to members, e.g., "foo::*bar", has been + dramatically improved. You should not get any syntax errors or incorrect + runtime results while using pointers to members correctly; if you do, it's + a definite bug. + +* Forward declaration of an enum is now flagged as an error. + +* Class-local typedefs are now working properly. + +* Nested class support has been significantly improved. The compiler + will now (in theory) support up to 240 nested classes before hitting + other system limits (like memory size). + +* There is a new C version of the `g++' driver, to replace the old + shell script. This should significantly improve the performance of + executing g++ on a system where a user's PATH environment variable + references many NFS-mounted filesystems. This driver also works + under MS-DOS and OS/2. + +* The ANSI committee working on the C++ standard has adopted a new + keyword `mutable'. This will allow you to make a specific member be + modifiable in an otherwise const class. + +Noteworthy GCC changes in version 2.4.4: + + A crash building g++ on various hosts (including m68k) has been + fixed. Also the g++ compiler no longer reports incorrect + ambiguities in some situations where they do not exist, and + const template member functions are now being found properly. + +Noteworthy GCC changes in version 2.4: + +* On each target, the default is now to return short structures +compatibly with the "usual" compiler on that target. + +For most targets, this means the default is to return all structures +in memory, like long structures, in whatever way is used on that +target. Use -freg-struct-return to enable returning short structures +(and unions) in registers. + +This change means that newly compiled binaries are incompatible with +binaries compiled with previous versions of GCC. + +On some targets, GCC is itself the usual compiler. On these targets, +the default way to return short structures is still in registers. +Use -fpcc-struct-return to tell GCC to return them in memory. + +* There is now a floating point emulator which can imitate the way all +supported target machines do floating point arithmetic. + +This makes it possible to have cross compilation to and from the VAX, +and between machines of different endianness. However, this works +only when the target machine description is updated to use the new +facilities, and not all have been updated. + +This also makes possible support for longer floating point types. +GCC 2.4 supports extended format on the 68K if you use `long double', +for targets that have a 68881. (When we have run time library +routines for extended floating point, then `long double' will use +extended format on all 68K targets.) + +We expect to support extended floating point on the i386 and Sparc in +future versions. + +* Building GCC now automatically fixes the system's header files. +This should require no attention. + +* GCC now installs an unsigned data type as size_t when it fixes the +header files (on all but a handful of old target machines). +Therefore, the bug that size_t failed to be unsigned is fixed. + +* Building and installation are now completely separate. +All new files are constructed during the build process; +installation just copies them. + +* New targets supported: Clipper, Hitachi SH, Hitachi 8300, and Sparc +Lite. + +* A totally new and much better Objective C run time system is included. + +* Objective C supports many new features. Alas, I can't describe them +since I don't use that language; however, they are the same ones +supported in recent versions of the NeXT operating system. + +* The builtin functions __builtin_apply_args, __builtin_apply and +__builtin_return let you record the arguments and returned +value of a function without knowing their number or type. + +* The builtin string variables __FUNCTION__ and __PRETTY_FUNCTION__ +give the name of the function in the source, and a pretty-printed +version of the name. The two are the same in C, but differ in C++. + +* Casts to union types do not yield lvalues. + +* ## before an empty rest argument discards the preceding sequence +of non-whitespace characters from the macro definition. +(This feature is subject to change.) + + +New features specific to C++: + +* The manual contains a new section ``Common Misunderstandings with +GNU C++'' that C++ users should read. + +* #pragma interface and #pragma implementation let you use the same +C++ source file for both interface and implementation. +However, this mechanism is still in transition. + +* Named returned values let you avoid an extra constructor call +when a function result has a class type. + +* The C++ operators ? yield min and max, respectively. + +* C++ gotos can exit a block safely even if the block has +aggregates that require destructors. + +* gcc defines the macro __GNUG__ when compiling C++ programs. + +* GNU C++ now correctly distinguishes between the prefix and postfix +forms of overloaded operator ++ and --. To avoid breaking old +code, if a class defines only the prefix form, the compiler +accepts either ++obj or obj++, unless -pedantic is used. + +* If you are using version 2.3 of libg++, you need to rebuild it with +`make CC=gcc' to avoid mismatches in the definition of `size_t'. + +Newly documented compiler options: + +-fnostartfiles + Omit the standard system startup files when linking. + +-fvolatile-global + Consider memory references to extern and global data items to + be volatile. + +-idirafter DIR + Add DIR to the second include path. + +-iprefix PREFIX + Specify PREFIX for later -iwithprefix options. + +-iwithprefix DIR + Add PREFIX/DIR to the second include path. + +-mv8 + Emit Sparc v8 code (with integer multiply and divide). +-msparclite + Emit Sparclite code (roughly v7.5). + +-print-libgcc-file-name + Search for the libgcc.a file, print its absolute file name, and exit. + +-Woverloaded-virtual + Warn when a derived class function declaration may be an error + in defining a C++ virtual function. + +-Wtemplate-debugging + When using templates in a C++ program, warn if debugging is + not yet fully available. + ++eN + Control how C++ virtual function definitions are used + (like cfront 1.x). --- gcc-2.95-2.95.4.ds15.orig/debian/gcc-2.95.postinst +++ gcc-2.95-2.95.4.ds15/debian/gcc-2.95.postinst @@ -0,0 +1,9 @@ +#! /bin/sh -e + +#DEBHELPER# + +if [ "`dpkg --print-installation-architecture`" = sparc ]; then + # Remove the old incorrect alternative + update-alternatives --remove sparc64-linux-gcc /usr/bin/gcc || true + update-alternatives --remove sparc64-linux-gcc /usr/bin/sparc64-linux-gcc-wrapper || true +fi --- gcc-2.95-2.95.4.ds15.orig/debian/gcov.1 +++ gcc-2.95-2.95.4.ds15/debian/gcov.1 @@ -0,0 +1,35 @@ +.TH GCOV 1 +.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection +.\" other parms are allowed: see man(7), man(1) +.SH NAME +gcov \- test coverage program for GNU CC +.SH SYNOPSIS +.B gcov +.I "[-b] [-v] [-n] [-l] [-f] [-o directory] sourcefile" +.br +.SH "DESCRIPTION" +This manual page documents briefly the +.BR gcov +command. +This manual page was written for the Debian GNU/Linux distribution +(but may be used by others), because the original program does not +have a manual page. +Instead, it has documentation in the GNU Info format; see below. +.PP +.B gcov +is a test coverage program. Use it in concert with GNU +CC to analyze your programs to help create more efficient, faster +running code. You can use gcov as a profiling tool to help +discover where your optimization efforts will best affect your code. You +can also use gcov along with the other profiling tool, +.B gprof +, to assess which parts of your code use the greatest amount +of computing time. +.SH "SEE ALSO" +The program is documented fully by +.IR "gcc-2.95: The GNU C compiler.", +available via the Info system. The documentation for gcov can be +found in the subsection "Gcov", under "a GNU CC test coverage program". +.SH AUTHOR +This manual page was written by the egcs maintainers for the Debian +GNU/Linux system. --- gcc-2.95-2.95.4.ds15.orig/debian/gcc-2.95-doc.postinst +++ gcc-2.95-2.95.4.ds15/debian/gcc-2.95-doc.postinst @@ -0,0 +1,6 @@ +#! /bin/sh -e + +install-info --quiet --section "Development" "Development" \ + /usr/share/info/gcc-2.95.info.gz + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/gcc-2.95-doc.prerm +++ gcc-2.95-2.95.4.ds15/debian/gcc-2.95-doc.prerm @@ -0,0 +1,5 @@ +#! /bin/sh -e + +install-info --quiet --remove gcc-2.95 + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/libg++.postinst +++ gcc-2.95-2.95.4.ds15/debian/libg++.postinst @@ -0,0 +1,7 @@ +#! /bin/sh -e + +if [ "$1" = "configure" ]; then + ldconfig +fi + +#DEBHELPER# --- gcc-2.95-2.95.4.ds15.orig/debian/README.cross +++ gcc-2.95-2.95.4.ds15/debian/README.cross @@ -0,0 +1,69 @@ +Good news, the gcc-2.95 source package will build cross-compilers +out of the box. + +It should be able to build cross-compilers for any debian +architecture as a target, although you may find it difficult to +fulfill the dependencies for every target. + +- Install the following packages (additional Build-Depends:) before + continuing: + + dpkg-cross + binutils-multiarch + binutils-${target} + + binutils-${target} is only in sid, and only for powerpc, m68k, + arm, and avr. If you are building for some other target, you'll + need to find a cross binutils some other way, i.e., by fixing + the binutils package. + +- Download (by hand, probably) the binary packages + libc6_*_${target}.deb and libc6-dev_*_${target}.deb. + +- dpkg-cross is a cool utility that mangles library and lib-dev + packages to be cross development packages. The install path + is changed (e.g.) from /usr/lib to /usr/${target}-linux/lib, + so you don't affect the native installation. Run the command + + dpkg-cross -a ${target} -b libc_*_${target}.deb + dpkg-cross -a ${target} -b libc-dev_*_${target}.deb + + This will create libc-${target}-cross_*_all.deb and + libc-dev-${target}-cross_*_all.deb. (Note that they are now + architecture independent.) Look at the packge contents, + in order to marvel at the coolness of dpkg-cross and/or to + verify that it worked: + + dpkg-deb -C libc-${target}-cross_*_all.deb + + Of course, you can do this for other development packages that + you want to install later. + +- Install the cross-libc packages created in the last step. The + gcc build process needs these to build libgcc2 and libg++. + +- Create the directory /usr/lib/gcc-lib/${target}-linux/2.95.4. + This is to overcome a buglet in the current build. Fix the version + number if it has changed. + +- Edit the file gcc-2.95-*/debian/rules.defs where it defines + TARGETS. Change this to 'TARGETS = ${target}'. + +- In order to speed up the build process, disable the regression + tests. Search for 'with_check := disabled by hand' in + gcc-2.95-*/debian/rules.defs and uncomment it. + +- In order to speed up the build process, disable building of the + Pascal compiler if you don't need it. Search for 'with_pascal + := disabled by hand' in gcc-2.95-*/debian/rules.defs and uncomment + it. + + The same thing can be done for the CHILL, Fortran and Java compilers. + +- Build using 'dpkg-buildpackage -rfakeroot'. This will take a _long_ + time, as it builds a bootstrap native compiler first, and also + builds the native packages. + + +Please send any comments/corrections to this document to +David Schleef . --- gcc-2.95-2.95.4.ds15.orig/debian/libstdc++-dbg.overrides +++ gcc-2.95-2.95.4.ds15/debian/libstdc++-dbg.overrides @@ -0,0 +1 @@ +libstdc++2.10-dbg: no-shlibs-control-file --- gcc-2.95-2.95.4.ds15.orig/debian/libg++-dbg.overrides +++ gcc-2.95-2.95.4.ds15/debian/libg++-dbg.overrides @@ -0,0 +1 @@ +libg++2.8.1.3-dbg: no-shlibs-control-file --- gcc-2.95-2.95.4.ds15.orig/debian/control +++ gcc-2.95-2.95.4.ds15/debian/control @@ -0,0 +1,255 @@ +Source: gcc-2.95 +Section: devel +Priority: optional +Maintainer: Debian GCC maintainers +Uploaders: Matthias Klose , Thiemo Seufer +Standards-Version: 3.7.2 +Build-Depends: dejagnu (>= 1.4), bzip2, binutils (>= 2.11.90.0.1-1), debhelper (>= 3.0.25), gperf (>= 2.7-3), autoconf2.13, bison-1.35, flex-old, gettext, texinfo, libgc-dev [!avr !hppa !hurd-i386], libncurses-dev, libgmp3-dev, help2man, dpkg-dev (>= 1.13.9) + +Package: gcc-2.95 +Architecture: any +Depends: ${shlibs:Depends}, cpp-2.95 (>= 1:2.95.4), cpp-2.95 (<< 1:2.95.5), binutils (>= 2.11.90.0.1-1) +Conflicts: libc5-dev, egcc (<< 2.91.63-1.1) +Replaces: egcc +Provides: c-compiler +Recommends: libc-dev +Suggests: gcc-2.95-doc (>= 1:2.95.4) +Description: The GNU C compiler + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This is the GNU C compiler, a fairly portable optimizing compiler which + supports multiple languages. This package includes support for C, C++, + and Objective C. + +Package: cpp-2.95 +Architecture: any +Section: interpreters +Depends: ${shlibs:Depends} +Replaces: g++ (<< 2.91.63-1.1) +Description: The GNU C preprocessor + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + The GNU C preprocessor is required by some utilities that use it for + macro substitutions. This package has been separated from gcc for + the benefit of those who require the preprocessor but not the + compiler. + +Package: cpp-2.95-doc +Architecture: all +Section: doc +Priority: optional +Conflicts: cpp-doc (<< 1:2.95.3) +Replaces: cpp (<= 1:2.93.12), cpp-doc (<< 1:2.95.3) +Description: Documentation for the GNU C preprocessor (cpp) + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + Documentation for the GNU C preprocessor in info format. + +Package: g++-2.95 +Architecture: any +Priority: optional +Provides: c++-compiler +Depends: ${shlibs:Depends}, gcc-2.95 (>= 1:2.95.4), gcc-2.95 (<< 1:2.95.5), libstdc++2.10-dev (>= 1:2.95.4) +Suggests: task-c++-devel +Replaces: gcc (<= 2.7.2.3-3) +Suggests: gcc-2.95-doc (>= 1:2.95.4) +Description: The GNU C++ compiler + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This is the GNU C++ compiler, a fairly portable optimizing compiler for C++. + +Package: gobjc-2.95 +Architecture: any +Priority: optional +Suggests: gcc-2.95-doc (>= 1:2.95.4) +Recommends: libgc-dev +Depends: ${shlibs:Depends}, gcc-2.95 (>= 1:2.95.4), gcc-2.95 (<< 1:2.95.5) +Provides: objc-compiler +Description: The GNU Objective-C compiler + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This is the GNU Objective-C compiler, which compiles + Objective-C on platforms supported by the gcc compiler. It uses the + gcc backend to generate optimized code. + +Package: g77-2.95 +Architecture: any +Priority: optional +Suggests: g77-2.95-doc +Depends: ${shlibs:Depends}, gcc-2.95 (>= 1:2.95.4), gcc-2.95 (<< 1:2.95.5) +Provides: fortran77-compiler +Description: The GNU Fortran 77 compiler + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This is the GNU g77 Fortran compiler, which compiles + Fortran 77 on platforms supported by the gcc compiler. It uses the + gcc backend to generate optimized code. + +Package: g77-2.95-doc +Architecture: all +Section: doc +Priority: optional +Conflicts: g77-doc (<< 1:2.95.3) +Replaces: g77 (<= 1:2.91.58-3), g77-doc (<< 1:2.95.3) +Description: Documentation for the GNU Fortran compiler (g77) + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + Documentation for the GNU Fortran 77 compiler in info format. + +Package: chill-2.95 +Architecture: any +Priority: extra +Replaces: chill +Provides: chill, chill-compiler +Depends: ${shlibs:Depends}, gcc-2.95 (>= 1:2.95.4), gcc-2.95 (<< 1:2.95.5) +Description: The GNU CHILL compiler + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This is the ITU CHILL compiler. CHILL is the "CCITT High-Level Language", + where CCITT is the old name for what is now ITU, the International + Telecommunications Union. + . + It is a language in the Modula-2 family, and targets many of the + same applications as Ada (especially large embedded systems). + CHILL was never used much in the United States, but is still + being used in Europe, Brazil, Korea, and other places. + +Package: libstdc++2.10-glibc2.2 +Architecture: any +Section: libs +Priority: optional +Depends: ${shlibs:Depends} +Description: The GNU stdc++ library + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This package contains an additional runtime library for C++ programs + built with the GNU compiler. + +Package: libstdc++2.10-dev +Architecture: any +Section: libdevel +Priority: optional +Depends: libstdc++2.10-glibc2.2 (>= 1:2.95.4), libc6-dev (>= 2.1.95) | libc-dev, g++-2.95 (>= 1:2.95.4) +Provides: libstdc++-dev +Conflicts: libg++27-dev, libg++272-dev (<< 2.7.2.8-1), libstdc++2.8-dev, libg++2.8-dev, libstdc++2.9-dev, libstdc++2.9-glibc2.1-dev +Suggests: stl-manual +Description: The GNU stdc++ library (development files) + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This package contains the headers and static library files necessary for + building C++ programs which use libstdc++. Be advised that this only works + with the GNU C++ compiler (version 2.95), and no earlier library will work it. + +Package: libstdc++2.10-dbg +Architecture: any +Section: libdevel +Priority: extra +Depends: libstdc++2.10-glibc2.2, libstdc++2.10-dev +Description: The GNU stdc++ library (debugging files) + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This package contains the shared library of libstdc++ compiled with debugging + symbols. + +Package: libg++2.8.1.3-glibc2.2 +Architecture: any +Section: libs +Priority: optional +Depends: ${shlibs:Depends} +Provides: libg++ +Conflicts: libg++2.9 (<< 2.91.56) +Replaces: libg++2.9 (<< 2.91.56), libg++2.9-ss (<< 2.91.56), libstdc++2.8-dev (<= 2.90.29-0.5) +Description: The GNU C++ extension library - runtime version + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This package contains the runtime version of the GNU classes. + +Package: libg++2.8.1.3-dev +Architecture: any +Section: libdevel +Priority: extra +Depends: libg++2.8.1.3-glibc2.2 (>= 1:2.95.4) +Provides: libg++-dev +Conflicts: libg++27-dev, libg++272-dev (<< 2.7.2.8-1), libg++2.8-dev, libg++2.9-dev (<< 2.91.56), libg++2.8.2-dev, libg++2.8.2-glibc2.1-dev +Replaces: libg++2.9-dev (<< 2.91.56), libg++2.8.2-dev, libg++2.8.2-glibc2.1-dev +Description: The GNU C++ extension library - development files + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This package contains some GNU classes. + . + This package is no longer supported upstream (as most of its + functionality is now in the standard C++ library) - do not use this + +Package: libg++2.8.1.3-dbg +Architecture: any +Section: libdevel +Priority: extra +Depends: libg++2.8.1.3-glibc2.2, libg++2.8.1.3-dev +Description: The GNU C++ extension library - debugging files + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This package contains a shared library with some GNU classes compiled + with debugging symbols. + . + This package is no longer supported upstream (as most of its + functionality is now in the standard C++ library) - do not use this + for development of new software; use libstdc++ instead. + +Package: gcc-2.95-doc +Architecture: all +Section: doc +Priority: optional +Conflicts: gcc-docs (<< 2.95.2), egcs-docs (<< 2.95), gcc-doc (<< 1:2.95.3) +Replaces: gcc (<=2.7.2.3-4.3), egcs-docs (<< 2.95), gcc-docs (<< 2.95.2), gcc-doc (<< 1:2.95.3) +Provides: gcc-docs, egcs-docs +Description: Documentation for the GNU compilers (gcc, gobjc, g++) + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + Documentation for the GNU compilers in info format. + +Package: gpc-2.95 +Architecture: any +Priority: optional +Recommends: libgmp3-dev, libncurses5-dev +Suggests: gpc-2.95-doc (>= 1:2.95.4) +Depends: ${shlibs:Depends}, gcc-2.95 (>= 1:2.95.4), gcc-2.95 (<< 1:2.95.5) +Provides: pascal-compiler +Description: The GNU Pascal compiler + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This is the GNU Pascal compiler, which compiles + Pascal on platforms supported by the gcc compiler. It uses the + gcc backend to generate optimized code. + . + The current beta release 2.2 implements Standard Pascal (ISO 7185, + level 1), a large subset of Extended Pascal (ISO 10206), and + Borland Pascal. Many Borland Pascal units supported. + +Package: gpc-2.95-doc +Architecture: all +Section: doc +Priority: optional +Conflicts: gpc-doc (<< 1:2.95.3) +Replaces: gpc (<= 2.91.58-3), gpc-doc (<< 1:2.95.3) +Description: Documentation for the GNU Pascal compiler (gpc) + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + Documentation for the GNU Pascal compiler in info format. + --- gcc-2.95-2.95.4.ds15.orig/debian/rules2 +++ gcc-2.95-2.95.4.ds15/debian/rules2 @@ -0,0 +1,1622 @@ +#! /usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This is the debhelper compatability version to use. +export DH_COMPAT=2 + +include debian/rules.defs +-include debian/rules.parameters + +include debian/rules.unpack +include debian/rules.patch + +# some tools +SHELL = /bin/bash -e # brace expansion in rules file +IR = install -p -m 644 # Install regular file +IP = install -p -m 755 # Install program +IS = install -p -m 755 # Install script + +# the recipient for the test summaries. Send with: debian/rules mail-summary +S_EMAIL = gcc@packages.debian.org gcc-testresults@gcc.gnu.org $(shell whoami) +#S_EMAIL = gcc@packages.debian.org $(shell whoami) + +CPPFLAGS = +CFLAGS = $(CPPFLAGS) +CC = cc $(CPPFLAGS) +LDFLAGS = +BOOT_CFLAGS = -g -O2 $(CPPFLAGS) + +docdir = usr/share/doc +#docdir = usr/doc + +cxx_inc_dir = g++-$(LIBSTDCXX_IF) +ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu) + lib_arlib = libstdc++-$(LIBSTDCXX_IF)$(LIBC_IF)$(CXX_IF)-$(lib_version).a + lib_marlink = libstdc++$(LIBC_IF)$(CXX_IF).a.$(LIBSTDCXX_IF) + lib_shlib = libstdc++-$(LIBSTDCXX_IF)$(LIBC_IF)$(CXX_IF)-$(lib_version).so + lib_mshlink = libstdc++$(LIBC_IF)$(CXX_IF).so.$(LIBSTDCXX_IF) + lgp_arlib = libg++-$(LIBSTDCXX_IF)$(LIBC_IF)$(CXX_IF)-$(lgp_version).a + lgp_marlink = libg++$(LIBC_IF)$(CXX_IF).a.$(LIBSTDCXX_IF) + lgp_shlib = libg++-$(LIBSTDCXX_IF)$(LIBC_IF)$(CXX_IF)-$(lgp_version).so + lgp_mshlink = libg++$(LIBC_IF)$(CXX_IF).so.$(LIBSTDCXX_IF) +else + lib_arlib = libstdc++.a.$(lib_version) + lib_marlink = + lib_shlib = libstdc++.so.$(lib_version) + lib_mshlink = + lgp_arlib = libg++.a.$(lgp_version) + lgp_marlink = + lgp_shlib = libg++.so.$(lgp_version) + lgp_mshlink = +endif +# lib_linkdir is the directory for the lib{stdc,g}++.{a,so} links + +ifeq ($(TARGET),native) +lib_linkdir = lib/gcc-lib/$(DEB_HOST_GNU_TYPE)/$(VER) +else +lib_linkdir = lib/gcc-lib/$(TARGET)-linux/$(VER) +endif + +# PF is the installation prefix for the package without the leading slash. +# It's "usr" for gcc releases; gcc snapshots go elsewhere. +ifneq ($(SNAPSHOT),yes) + PF = usr +else + PF = usr/lib/gcc-ss +endif + +ifeq ($(TARGET),native) +LIBBUILDDIR = $(DEB_HOST_GNU_TYPE) +gcc_lib_dir = $(PF)/lib/gcc-lib/$(DEB_HOST_GNU_TYPE)/$(VER) +else +LIBBUILDDIR = $(TARGET)-linux +gcc_lib_dir = $(PF)/lib/gcc-lib/$(TARGET)-linux/$(VER) +endif + +CONFARGS = -v \ + --enable-languages=$(shell echo $(enabled_languages) | tr -s ' ' ',') \ + --prefix=/$(PF) \ + --infodir=/$(PF)/share/info \ + --mandir=/$(PF)/share/man \ + --enable-shared \ + --disable-nls \ + --with-fast-fixincludes \ + --with-gnu-as \ + --with-gnu-ld +ifeq ($(with_java),yes) + CONFARGS += --enable-java-gc=boehm +else + CONFARGS += --enable-java-gc=no +endif +ifneq ($(SNAPSHOT),yes) + CONFARGS += --with-cpp-install-dir=bin +endif +ifneq ($(SNAPSHOT),no) + CONFARGS += --enable-threads=posix +else + CONFARGS += --enable-threads +endif +ifeq ($(with_gplusplus),yes) + ifneq ($(SNAPSHOT),no) + CONFARGS += --enable-libstdcxx-v3 + endif +endif +ifeq ($(with_objc)-$(with_objc_gc),yes-yes) + CONFARGS += --enable-objc-gc +endif +# MULTILIBS is one or more of "gcc g++ stdc++ chill objc g77" +# MULTIDIRS is in the format "32" or "{m68000,m68020,m68040}" +ifeq ($(DEB_HOST_GNU_TYPE),sparc64-linux-gnu) + CONFARGS += --with-cpu=ultrasparc + MULTIDIRS := 32 + MULTILIBS := gcc + ifeq ($(with_gplusplus),yes) + MULTILIBS += g++ stdc++ + endif + ifeq ($(with_chill),yes) + MULTILIBS += chill + endif + ifeq ($(with_objc),yes) + MULTILIBS += objc + endif + ifeq ($(with_fortran),yes) + MULTILIBS += g77 + endif +endif +ifeq ($(DEB_HOST_GNU_TYPE),sparc-linux-no) + CONFARGS += --with-cpu=v7 + MULTIDIRS := 64 + MULTILIBS := gcc +endif +ifeq ($(DEB_HOST_GNU_TYPE),alpha-linux-gnu) + MULTIDIRS := ieee + MULTILIBS += g77 +endif + +CONFARGS += $(DEB_HOST_GNU_TYPE) + +ifneq ($(TARGET),native) +CONFARGS += --target=$(TARGET)-linux +endif + +ifneq ($(SNAPSHOT),yes) + with_mail := no +else + # see if we can find a tiny mail program to send the success story + with_mail := $(strip $(shell if [ -x /usr/bin/mailx ]; \ + then echo yes; else echo no; fi)) +endif + +default: build + +$(configure_stamp_native): + dh_testdir + : # give information about the build process + @echo "-------------------------- Build process variables --------------------------" + @echo "Package source: $(PKGSOURCE)" + @echo "Version: $(VER)" + @echo "Base Debian version: $(DPKGVER)" + @echo -e "Configured with: $(foreach i,$(CONFARGS),$(i)\n\t)" + @echo "Using shell $(SHELL)" + @echo "Architecture: $(DEB_HOST_ARCH) (GNU: $(DEB_HOST_GNU_TYPE))" + @echo "SONAME: $(SONAME)" + @echo "CPPFLAGS: $(CPPFLAGS)" + @echo "CFLAGS: $(CFLAGS)" + @echo "LDFLAGS: $(LDFLAGS)" + @echo "BOOT_CFLAGS: $(BOOT_CFLAGS)" + @echo "Install prefix: $(PF)" + @echo "Will build a primary C compiler." +ifeq ($(with_check),yes) + @echo "Will run the testsuite." +else + @echo "Will not run the testsuite: $(with_check)" + @echo "Please install dejagnu and restart." +# false +endif +ifeq ($(with_gplusplus),yes) + @echo "Will build the C++ compiler." +else + @echo "Will not build the C++ compiler: $(with_gplusplus)" +endif +ifeq ($(with_objc_gc),yes) + @echo "Will build the extra ObjC runtime for garbage collection." +else + @echo "Will not build the extra ObjC runtime for garbage collection." +endif +ifeq ($(with_java),yes) + @echo "Will build the Java compiler." +else + @echo "Will not build the Java compiler: $(with_java)" +endif +ifeq ($(with_chill),yes) + @echo "Will build the CHILL compiler." +else + @echo "Will not build the CHILL compiler: $(with_chill)" +endif +ifeq ($(with_pascal),yes) + @echo "Will build the Pascal compiler." +else + @echo "Will not build the Pascal compiler: $(with_pascal)" +endif +ifeq ($(with_fortran),yes) + @echo "Will build the Fortran compiler." +else + @echo "Will not build the Fortran compiler: $(with_fortran)" +endif +ifeq ($(with_proto),yes) + @echo "Will build the protoize/unprotoize programs." +else + @echo "Will not build the protoize/unprotoize programs: $(with_proto)" +endif +ifeq ($(with_libgpp),yes) + @echo "Will build the deprecated g++ libraries." +else + @echo "Will not build the deprecated g++ libraries: $(with_libgpp)" +endif +ifeq ($(with_check),yes) + ifeq ($(with_mail),yes) + @echo "Will send the success story to the Debian GCC maintainers." + else + @echo "Cannot find the mailx program to send a build report to the" + @echo "Debian GCC maintainers. Please install and restart." +# false + endif +endif + @echo "-----------------------------------------------------------------------------" + @echo "" + rm -f $(configure_stamp)-$(TARGET) $(build_stamp)-$(TARGET) + : # generate debian/README.Debian + cat debian/README $(patch_stamp)-$(TARGET) > debian/README.Debian + +ifeq ($(with_pascal),yes) + echo '# dummy file' >> $(srcdir)/gcc/p/Makefile.in +endif + +#ifeq ($(with_pascal),yes) +# if [ ! -f $(srcdir)/gcc/p/config-lang.in ]; then \ +# cp -p $(srcdir)/gcc/p/config-lang.in.debian \ +# $(srcdir)/gcc/p/config-lang.in; \ +# else \ +# true; \ +# fi +#else +# if [ -f $(srcdir)/gcc/p/config-lang.in ]; then \ +# mv -f $(srcdir)/gcc/p/config-lang.in \ +# $(srcdir)/gcc/p/config-lang.in.debian; \ +# else \ +# true; \ +# fi +#endif + +# rm -f $(srcdir)/gcc/configure +# cd $(srcdir)/gcc && autoconf + rm -rf $(builddir) + mkdir $(builddir) + + rm -rf bin + mkdir bin + if [ -f /usr/bin/bison-1.35 ]; then \ + ln -s /usr/bin/bison-1.35 bin/bison; \ + else \ + ln -s /usr/bin/bison bin/bison; \ + fi + + : # configure + PATH=`pwd`/bin:$$PATH cd $(builddir) \ + && CC="$(CC)" $(srcdir)/configure $(CONFARGS) + + touch $(configure_stamp_native) + +$(configure_stamps_cross): + dh_testdir + : # give information about the build process + @echo "-------------------------- Build process variables --------------------------" + @echo "Package source: $(PKGSOURCE)" + @echo "Version: $(VER)" + @echo "Base Debian version: $(DPKGVER)" + @echo -e "Configured with: $(foreach i,$(CONFARGS),$(i)\n\t)" + @echo "Using shell $(SHELL)" + @echo "Architecture: $(DEB_HOST_ARCH) (GNU: $(DEB_HOST_GNU_TYPE))" + @echo "SONAME: $(SONAME)" + @echo "CPPFLAGS: $(CPPFLAGS)" + @echo "CFLAGS: $(CFLAGS)" + @echo "LDFLAGS: $(LDFLAGS)" + @echo "BOOT_CFLAGS: $(BOOT_CFLAGS)" + @echo "Install prefix: $(PF)" + @echo "Will build a CROSS C compiler." + + rm -rf $(builddir) + mkdir $(builddir) + + rm -rf bin + mkdir bin + ln -s /usr/bin/bison-1.35 bin/bison + + PATH=`pwd`/bin:$$PATH cd $(builddir) \ + && CC="$(CC)" $(srcdir)/configure $(CONFARGS) + + touch $@ + + +$(build_stamp_native): + dh_testdir + : # start the build + rm -f bootstrap-protocol + ( \ + set +e; \ + PATH=`pwd`/bin:$$PATH \ + $(MAKE) -C $(builddir) bootstrap-lean \ + CC="$(CC)" CFLAGS="$(CFLAGS)" \ + BISON=bison-1.35 \ + BOOT_CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(LDFLAGS)"; \ + echo $$? > status; \ + ) 2>&1 | tee bootstrap-protocol + s=`cat status`; rm -f status; test $$s -eq 0 +ifeq ($(with_gplusplus),yes) + ifeq ($(versioned_packages),yes) + sed -e 's/iostream\.info/iostream-2.95.info/g' \ + $(builddir)/$(LIBBUILDDIR)/libio/Makefile \ + > $(builddir)/$(LIBBUILDDIR)/libio/Makefile2 + mv -f $(builddir)/$(LIBBUILDDIR)/libio/Makefile2 \ + $(builddir)/$(LIBBUILDDIR)/libio/Makefile + endif + $(MAKE) -C $(builddir)/$(LIBBUILDDIR)/libio info + ifeq ($(with_libgpp),yes) + $(MAKE) -C $(builddir)/$(LIBBUILDDIR)/libg++ info + endif +endif + -chmod 755 $(srcdir)/contrib/warn_summary + if [ -x $(srcdir)/contrib/warn_summary ]; then \ + rm -f bootstrap-summary; \ + $(srcdir)/contrib/warn_summary bootstrap-protocol \ + > bootstrap-summary; \ + fi + +ifeq ($(with_fortran),yes) + : # build libg2c.a with PIC enabled + rm -rf $(builddir)/$(DEB_HOST_GNU_TYPE)/libf2c-pic + cp -a $(builddir)/$(DEB_HOST_GNU_TYPE)/libf2c \ + $(builddir)/$(DEB_HOST_GNU_TYPE)/libf2c-pic + $(MAKE) -C $(builddir)/$(DEB_HOST_GNU_TYPE)/libf2c-pic clean + $(MAKE) -C $(builddir)/$(DEB_HOST_GNU_TYPE)/libf2c-pic \ + LIBG2C=libg2c-pic.a CFLAGS="-O2 -fPIC -DPIC" +endif + +# make check ... +ifeq ($(with_check),yes) + rm -f test-protocol + + ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu) + -echo "Running testsuite ..."; \ + if [ -e /proc/meminfo ]; then \ + m=`awk '/^((Mem|Swap)Free|Cached)/{m+=$$2}END{print int(m*.9)}' \ + /proc/meminfo`; \ + else \ + m=`vmstat --free --swap-free --kilobytes|awk '{m+=$$2}END{print int(m*.9)}'`; \ + fi; \ + ulimit -m $$m; \ + echo "Limited memory for test runs to `ulimit -m`kB"; \ + $(MAKE) -C $(builddir) -k check 2>&1 | tee test-protocol + else + -echo "Running testsuite ..."; \ + $(MAKE) -C $(builddir) -k check 2>&1 | tee test-protocol + endif + + -chmod 755 $(srcdir)/contrib/test_summary + if [ -x $(srcdir)/contrib/test_summary ]; then \ + rm -f test-summary; \ + ( \ + cd $(builddir); \ + BOOT_CFLAGS="$(BOOT_CFLAGS)" LIBS=-lpthread \ + $(srcdir)/contrib/test_summary -i $(patch_stamp) -m "$(S_EMAIL)" \ + ) > raw-test-summary; \ + awk '/^cat/, /^EOF/' raw-test-summary | grep -v EOF > test-summary; \ + fi +endif +ifeq ($(with_pascal),yes) + $(MAKE) -C $(builddir)/gcc -k check-pascal + if [ -f $(builddir)/gcc/p/test/test_summary ]; then \ + echo 'BEGIN gpc-test-summary'; \ + cat $(builddir)/gcc/p/test/test_summary | tee gpc-test-summary; \ + echo 'END gpc-test-summary'; \ + else \ + echo "No gpc test results" > gpc-test-summary; \ + fi +endif + touch $(build_stamp_native) + +# make check ... +check: + rm -f test-protocol + +ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu) + -echo "Running testsuite ..."; \ + if [ -e /proc/meminfo ]; then \ + m=`awk '/^((Mem|Swap)Free|Cached)/{m+=$$2}END{print int(m*.9)}' \ + /proc/meminfo`; \ + else \ + m=`vmstat --free --swap-free --kilobytes|awk '{m+=$$2}END{print int(m*.9)}'`; \ + fi; \ + ulimit -m $$m; \ + echo "Limited memory for test runs to `ulimit -m`kB"; \ + $(MAKE) -C $(builddir) -k check 2>&1 | tee test-protocol +else + -echo "Running testsuite ..."; \ + $(MAKE) -C $(builddir) -k check 2>&1 | tee test-protocol +endif + + -chmod 755 $(srcdir)/contrib/test_summary + if [ -x $(srcdir)/contrib/test_summary ]; then \ + rm -f test-summary; \ + ( \ + cd $(builddir); \ + BOOT_CFLAGS="$(BOOT_CFLAGS)" LIBS=-lpthread \ + $(srcdir)/contrib/test_summary -i $(patch_stamp) -m "$(S_EMAIL)" \ + ) > raw-test-summary; \ + awk '/^cat/, /^EOF/' raw-test-summary | grep -v EOF > test-summary; \ + fi +ifeq ($(with_pascal),yes) + $(MAKE) -C $(builddir)/gcc -k check-pascal + if [ -f $(builddir)/gcc/p/test/test_summary ]; then \ + echo 'BEGIN gpc-test-summary'; \ + cat $(builddir)/gcc/p/test/test_summary | tee gpc-test-summary; \ + echo 'END gpc-test-summary'; \ + else \ + echo "No gpc test results" > gpc-test-summary; \ + fi +endif + +$(build_stamps_cross): + ifeq ($(with_gplusplus),yes) + PATH=`pwd`/bin:$$PATH \ + $(MAKE) -C $(builddir) LANGUAGES="c c++" BISON=bison-1.35 + else + PATH=`pwd`/bin:$$PATH \ + $(MAKE) -C $(builddir) LANGUAGES="c" BISON=bison-1.35 + endif + touch $@ + + +mail-summary: + @if [ ! -f /usr/bin/Mail ]; then \ + echo "Please install the mailx package to send the summary"; \ + exit 1; \ + fi + -chmod 755 contrib/test_summary + if [ -x contrib/test_summary ]; then \ + rm -f test-summary; \ + ( \ + cd $(builddir); \ + BOOT_CFLAGS="$(BOOT_CFLAGS)" \ + $(srcdir)/contrib/test_summary -i $(patch_stamp) -m "$(S_EMAIL)" \ + ) > raw-test-summary; \ + fi + echo -n "Send summary to $(S_EMAIL) (y/n) "; read x; \ + case "$$x" in \ + y*|Y*) cat raw-test-summary | sh; echo "Sent mail to $(S_EMAIL)";; \ + *) echo "Mail not sent.";; \ + esac + +clean: debian/control + dh_testdir + rm -f pxxx status +# remove temporary dirs used for unpacking + rm -rf $(gcc_srcdir) $(libgpp_srcdir) $(gpc_srcdir) +ifeq ($(with_pascal),yes) + rm -f $(srcdir)/gcc/p/doc/*info + rm -f $(srcdir)/gcc/p/test/{fjf51,fjf141aa,fjf199aa,magic,?,knownbugs/a.out} +endif + if [ -f $(srcdir)/gcc/p/config-lang.in.debian ]; then \ + mv -f $(srcdir)/gcc/p/config-lang.in.debian $(srcdir)/gcc/p/config-lang.in; \ + else true; fi + rm -f $(srcdir)/gcc/po/*.gmo + rm -f debian/lib{g++,stdc++}[0-9]*.{{pre,post}{inst,rm},shlibs} + rm -rf debian/tmp* + rm -f *-summary *-protocol + +# $(MAKE) -f debian/rules reverse-patches + $(MAKE) -C debian/bugs clean + rm -rf bin + + dh_clean + +# ------------------------------------------------------------------------------ +# some abbrevations for the package names and directories; +# p_XXX is the package name, d_XXX is the package directory +# these macros are only used in the binary-* targets. + +# p_gcc used only for primary compiler, p_gpc used only for pascal. +ifeq ($(SNAPSHOT),yes) + ss_suffix = -ss +endif + +ifneq ($(TARGET),native) + ss_suffix += -$(TARGET) +endif + +ifeq ($(versioned_packages),yes) + pkg_ver := -2.95 +endif + +p_gcc = gcc$(pkg_ver)$(ss_suffix) +p_cpp = cpp$(pkg_ver)$(ss_suffix) +p_cppd = cpp$(pkg_ver)-doc$(ss_suffix) +p_objc = gobjc$(pkg_ver)$(ss_suffix) +p_proto = protoize$(pkg_ver)$(ss_suffix) +p_gpp = g++$(pkg_ver)$(ss_suffix) +p_g77 = g77$(pkg_ver)$(ss_suffix) +p_g77d = g77$(pkg_ver)-doc$(ss_suffix) +p_gch = chill$(pkg_ver)$(ss_suffix) +p_java = gcj$(pkg_ver)$(ss_suffix) +p_gpc = gpc$(pkg_ver)$(ss_suffix) +p_gpcd = gpc$(pkg_ver)-doc$(ss_suffix) +p_doc = gcc$(pkg_ver)-doc$(ss_suffix) + +p_lib = libstdc++$(PKG_SONAME)$(ss_suffix) +p_dev = libstdc++$(PKG_DEV_SONAME)-dev$(ss_suffix) +p_dbg = libstdc++$(PKG_DEV_SONAME)-dbg$(ss_suffix) +p_lgp = libg++$(LGP_PKG_SONAME)$(ss_suffix) +p_lgd = libg++$(LGP_PKG_DEV_SONAME)-dev$(ss_suffix) +p_lgdbg = libg++$(LGP_PKG_DEV_SONAME)-dbg$(ss_suffix) + +d=debian/tmp-$(TARGET) + +d_gcc = debian/$(p_gcc) +d_cpp = debian/$(p_cpp) +d_cppd = debian/$(p_cppd) +d_objc = debian/$(p_objc) +d_proto = debian/$(p_proto) +d_gpp = debian/$(p_gpp) +d_g77 = debian/$(p_g77) +d_g77d = debian/$(p_g77d) +d_gch = debian/$(p_gch) +d_java = debian/$(p_java) +d_gpc = debian/$(p_gpc) +d_gpcd = debian/$(p_gpcd) +d_lib = debian/$(p_lib) +d_dev = debian/$(p_dev) +d_dbg = debian/$(p_dbg) +d_lgp = debian/$(p_lgp) +d_lgd = debian/$(p_lgd) +d_lgdbg = debian/$(p_lgdbg) +d_doc = debian/$(p_doc) +d_docs = debian/$(p_docs) + +ifeq ($(DEB_HOST_ARCH),powerpc) + p_nof = gcc$(pkg_ver)-nof$(ss_suffix) + d_nof = debian/$(p_nof) +endif + +ifeq ($(DEB_HOST_ARCH),arm) + p_softfloat = gcc$(pkg_ver)-soft-float$(ss_suffix) + d_softfloat = debian/$(p_softfloat) +endif + +ifeq ($(DEB_HOST_ARCH),armeb) + p_softfloat = gcc$(pkg_ver)-soft-float$(ss_suffix) + d_softfloat = debian/$(p_softfloat) +endif + +# gcc must be moved after g77 and g++ +# not all files $(PF)/include/*.h are part of gcc, +# but it becomes difficult to name all these files ... +dirs_gcc = \ + lib \ + $(docdir)/$(p_gcc) \ + $(PF)/bin \ + $(gcc_lib_dir)/include \ + $(PF)/share/man/man1 +ifeq ($(TARGET),native) +files_gcc = \ + $(PF)/bin/{$(TP)gcc,gcov}$(pkg_ver) \ + $(gcc_lib_dir)/{collect2,specs,cc1,libgcc.*,*.o} \ + $(PF)/share/man/man1/{$(TP)gcc,gcov}$(pkg_ver).1 \ + $(gcc_lib_dir)/include/{README,*.h} \ + $(shell for d in asm bits gnu linux; do \ + test -e $(d)/$(gcc_lib_dir)/include/$$d \ + && echo $(gcc_lib_dir)/include/$$d; \ + done) +#ifeq ($(VER),2.95.4) +# files_gcc += \ +# $(PF)/bin/egcc \ +# $(PF)/share/man/man1/egcc.1 +#endif +else +files_gcc = \ + $(PF)/bin/$(TP)gcc \ + $(gcc_lib_dir)/{collect2,specs,cc1,libgcc.*,*.o} \ + $(gcc_lib_dir)/include/{README,*.h} \ + $(shell for d in asm bits gnu linux; do \ + test -e $(d)/$(gcc_lib_dir)/include/$$d \ + && echo $(gcc_lib_dir)/include/$$d; \ + done) +ifeq ($(TARGET),powerpc) + dirs_gcc += $(gcc_lib_dir)/nof $(gcc_lib_dir)/nof/pic $(gcc_lib_dir)/pic + files_gcc += \ + $(gcc_lib_dir)/nof/{libgcc.a,*.o} \ + $(gcc_lib_dir)/nof/pic/{libgcc.a,*.o} $(gcc_lib_dir)/pic/{libgcc.a,*.o} +endif +ifeq ($(TARGET)-$(with_arm_soft_float),arm-yes) + dirs_gcc += $(gcc_lib_dir)/soft-float + files_gcc += $(gcc_lib_dir)/soft-float/{libgcc.a,*.o} +endif +ifeq ($(TARGET)-$(with_arm_soft_float),armeb-yes) + dirs_gcc += $(gcc_lib_dir)/soft-float + files_gcc += $(gcc_lib_dir)/soft-float/{libgcc.a,*.o} +endif +endif +files_gcc += \ + $(shell test -e $(d)/$(gcc_lib_dir)/SYSCALLS.c.X \ + && echo $(gcc_lib_dir)/SYSCALLS.c.X) +#files_gcc += \ +# $(gcc_lib_dir)/SYSCALLS.c.X +ifneq (,$(findstring gcc,$(MULTILIBS))) + dirs_gcc += $(gcc_lib_dir)/$(MULTIDIRS) + files_gcc += $(gcc_lib_dir)/$(MULTIDIRS)/{libgcc.a,*.o} +endif +ifeq ($(DEB_HOST_GNU_TYPE),sparc-linux-no) + files_gcc += $(PF)/bin/sparc64-linux-gcc-wrapper +endif + +ifeq ($(DEB_HOST_ARCH),powerpc) + dirs_nof = \ + $(PF)/lib/nof \ + $(gcc_lib_dir)/nof + files_nof = \ + $(PF)/lib/nof \ + $(gcc_lib_dir)/nof +endif + +ifeq ($(TARGET)-$(with_arm_soft_float),arm-yes) + dirs_softfloat = \ + $(PF)/lib/soft-float \ + $(gcc_lib_dir)/soft-float + files_softfloat = \ + $(PF)/lib/soft-float \ + $(gcc_lib_dir)/soft-float +endif + +ifeq ($(TARGET)-$(with_arm_soft_float),armeb-yes) + dirs_softfloat = \ + $(PF)/lib/soft-float \ + $(gcc_lib_dir)/soft-float + files_softfloat = \ + $(PF)/lib/soft-float \ + $(gcc_lib_dir)/soft-float +endif + +dirs_cpp = \ + $(docdir)/$(p_cpp) \ + $(PF)/share/man/man1 \ + $(PF)/bin +ifeq ($(TARGET),native) +files_cpp = \ + $(PF)/bin/cpp$(pkg_ver) \ + $(gcc_lib_dir)/cpp0 \ + $(PF)/share/man/man1/cpp$(pkg_ver).1 +else +files_cpp = \ + $(gcc_lib_dir)/cpp0 +endif +#ifeq ($(TARGET),native) +#ifneq ($(SNAPSHOT),yes) +# dirs_cpp += lib +# files_cpp += lib/cpp +#endif +#endif + +dirs_cppd = \ + $(docdir)/$(p_cppd) \ + $(PF)/share/info +files_cppd = \ + $(PF)/share/info/cpp* + +dirs_objc = \ + $(docdir)/$(p_gcc) \ + $(gcc_lib_dir)/include +files_objc = \ + $(gcc_lib_dir)/include/objc \ + $(gcc_lib_dir)/{cc1obj,libobjc*.a} +ifneq (,$(findstring objc,$(MULTILIBS))) + dirs_objc += $(gcc_lib_dir)/$(MULTIDIRS) + files_objc += $(gcc_lib_dir)/$(MULTIDIRS)/libobjc*.a +endif + +dirs_proto = \ + $(docdir)/$(p_gcc) \ + $(PF)/share/man/man1 \ + $(PF)/bin +files_proto = \ + $(PF)/bin/{protoize,unprotoize}$(pkg_ver) \ + $(PF)/share/man/man1/{protoize,unprotoize}$(pkg_ver).1 + +dirs_gpp = \ + $(docdir)/$(p_gpp) \ + $(PF)/bin \ + $(PF)/share/info \ + $(gcc_lib_dir)/include \ + $(PF)/share/man/man1 +files_gpp = \ + $(PF)/bin/$(TP)g++$(pkg_ver) \ + $(gcc_lib_dir)/cc1plus \ + $(gcc_lib_dir)/include/{new,new.h,typeinfo,exception} +ifeq ($(TARGET),native) + files_gpp += \ + $(PF)/share/man/man1/g++$(pkg_ver).1 +endif + + +dirs_g77 = \ + $(docdir)/$(p_g77) \ + $(PF)/bin \ + $(gcc_lib_dir)/include \ + $(PF)/include \ + $(PF)/share/man/man1 +files_g77 = \ + $(PF)/bin/g77$(pkg_ver) \ + $(gcc_lib_dir)/{f771,libg2c*.a} \ + $(gcc_lib_dir)/include/g2c.h \ + $(PF)/share/man/man1/g77$(pkg_ver).1 +ifneq (,$(findstring g77,$(MULTILIBS))) + dirs_g77 += $(gcc_lib_dir)/$(MULTIDIRS) + files_g77 += $(gcc_lib_dir)/$(MULTIDIRS)/libg2c.a +endif + +dirs_g77d = \ + $(docdir)/$(p_g77d) \ + $(PF)/share/info +files_g77d = \ + $(PF)/share/info/g77* + +dirs_chill = \ + $(docdir)/$(p_gch) \ + $(PF)/bin \ + $(gcc_lib_dir) \ + $(PF)/share/man/man1 \ + $(PF)/share/info + +files_chill = \ + $(PF)/bin/chill$(pkg_ver) \ + $(gcc_lib_dir)/*chill* \ + $(PF)/share/info/chill* +ifneq (,$(findstring chill,$(MULTILIBS))) + dirs_chill += $(gcc_lib_dir)/$(MULTIDIRS) + files_chill += $(gcc_lib_dir)/$(MULTIDIRS)/*chill*.{a,o} +endif + +dirs_java = \ + $(docdir)/$(p_java) \ + $(PF)/bin \ + $(PF)/share/man/man1 \ + $(gcc_lib_dir) +files_java = \ + $(PF)/bin/{gcj,gcjh,jv-scan,jcf-dump}$(pkg_ver) \ + $(gcc_lib_dir)/{jc1,jvgenmain} + +dirs_gpc = \ + $(docdir)/$(p_gpc) \ + $(PF)/bin \ + $(gcc_lib_dir)/{include,units} \ + $(PF)/share/man/man1 +files_gpc = \ + $(PF)/bin/gpc$(pkg_ver) \ + $(PF)/bin/gpc-run$(pkg_ver) \ + $(PF)/bin/binobj$(pkg_ver) \ + $(PF)/bin/gpidump$(pkg_ver) \ + $(PF)/share/man/man1/gpc$(pkg_ver).1 \ + $(PF)/share/man/man1/gpc-run$(pkg_ver).1 \ + $(PF)/share/man/man1/binobj$(pkg_ver).1 \ + $(PF)/share/man/man1/gpidump$(pkg_ver).1 \ + $(gcc_lib_dir)/{gpcpp,gpc1,libgpc.a,units} \ + $(gcc_lib_dir)/include/gpc-in-c.h +ifneq (,$(findstring gpc,$(MULTILIBS))) + dirs_gpc += $(gcc_lib_dir)/$(MULTIDIRS) + files_gpc += $(gcc_lib_dir)/$(MULTIDIRS)/libgpc.a +endif + +dirs_gpcd = \ + $(docdir)/$(p_gpcd) \ + $(PF)/share/info +files_gpcd = \ + $(docdir)/$(p_gpc)/examples/* \ + $(docdir)/$(p_gpc)/docdemos \ + $(PF)/share/info/gpc*2.95* + +dirs_lgp = \ + $(docdir)/$(p_lgp) \ + $(PF)/lib +files_lgp = \ + $(addprefix $(PF)/lib/, $(lgp_shlib) $(lgp_mshlink)) +ifneq (,$(findstring g++,$(MULTILIBS))) + dirs_lgp += $(PF)/lib/$(MULTIDIRS) + files_lgp += \ + $(addprefix $(PF)/lib/$(MULTIDIRS)/, $(lgp_shlib) $(lgp_mshlink)) +endif + +dirs_lgd = \ + $(docdir)/$(p_lgp) \ + $(PF)/bin \ + $(PF)/share/info \ + $(gcc_lib_dir) \ + $(PF)/share/man/man1 \ + $(PF)/include/$(cxx_inc_dir)/gen +files_lgd = \ + $(PF)/bin/genclass \ + $(PF)/share/man/man1/genclass.1 \ + $(PF)/share/info/libg++.info* \ + $(addprefix $(PF)/lib/, $(lgp_arlib) $(lgp_marlink)) \ + $(gcc_lib_dir)/libg++.{a,so} \ + $(PF)/include/$(cxx_inc_dir)/gen/ \ + $(PF)/include/$(cxx_inc_dir)/{$(shell cd $(srcdir)/libg++/src; \ + echo *.h | tr ' ' ,)} +ifneq (,$(findstring g++,$(MULTILIBS))) + dirs_lgd += $(gcc_lib_dir)/$(MULTIDIRS) + files_lgd += \ + $(addprefix $(PF)/lib/$(MULTILIB)/, $(lgp_arlib) $(lgp_marlink)) \ + $(gcc_lib_dir)/$(MULTIDIRS)/libg++.{a,so} +endif + +dirs_lgdbg = \ + usr/share/lintian/overrides \ + $(docdir) \ + $(PF)/lib/debug +#files_lgd = + +ifeq ($(TARGET),native) + +dirs_lib = \ + $(docdir)/$(p_lib) \ + $(PF)/lib +files_lib = \ + $(addprefix $(PF)/lib/, $(lib_shlib) $(lib_mshlink)) +ifneq (,$(findstring stdc++,$(MULTILIBS))) + dirs_lib += $(PF)/lib/$(MULTIDIRS) + files_lib += \ + $(addprefix $(PF)/lib/$(MULTIDIRS)/, $(lib_shlib) $(lib_mshlink)) +endif +else +dirs_lib = \ + $(docdir)/$(p_lib) \ + $(gcc_lib_dir) +files_lib = \ + $(addprefix $(PF)/$(TARGET)-linux/lib/, $(lib_shlib) $(lib_mshlink)) +ifneq (,$(findstring stdc++,$(MULTILIBS))) + dirs_lib += $(gcc_lib_dir)/$(MULTIDIRS) + files_lib += \ + $(addprefix $(gcc_lib_dir)/$(MULTIDIRS)/, $(lib_shlib) $(lib_mshlink)) + +endif +endif + +ifeq ($(TARGET),native) + +dirs_dev = \ + $(docdir)/$(p_lib) \ + $(PF)/share/info \ + $(PF)/lib \ + $(PF)/include/$(cxx_inc_dir)/std +# libg++-dev must be moved first !!! +# not all files in $(PF)/include/$(cxx_inc_dir)/, +# but it becomes difficult to name all these files ... +files_dev = \ + $(addprefix $(PF)/lib/, $(lib_arlib) $(lib_marlink)) \ + $(PF)/include/$(cxx_inc_dir)/ \ + $(PF)/share/info/iostream* \ + $(PF)/$(lib_linkdir)/libstdc++.{a,so} +ifneq (,$(findstring stdc++,$(MULTILIBS))) + files_dev += $(PF)/$(lib_linkdir)/$(MULTIDIRS)/libstdc++.{a,so} \ + $(addprefix $(PF)/lib/$(MULTIDIRS)/, $(lib_arlib) $(lib_marlink)) +endif +ifeq ($(DEB_HOST_GNU_SYSTEM),gnu) + files_dev += $(PF)/include/_G_config.h +endif + +else + +dirs_dev = \ + $(docdir)/$(p_lib) \ + $(PF)/lib +# libg++-dev must be moved first !!! +# not all files in $(PF)/include/$(cxx_inc_dir)/, +# but it becomes difficult to name all these files ... +files_dev = \ + $(addprefix $(PF)/$(TARGET)-linux/lib/, $(lib_arlib) $(lib_marlink)) \ + $(PF)/$(lib_linkdir)/libstdc++.{a,so} +ifneq (,$(findstring stdc++,$(MULTILIBS))) + files_dev += $(PF)/$(TARGET)-linux/lib/$(MULTIDIRS)/libstdc++.{a,so} \ + $(addprefix $(PF)/$(TARGET)-linux/lib/$(MULTIDIRS)/, $(lib_arlib) $(lib_marlink)) + +endif + +endif + +dirs_dbg = \ + usr/share/lintian/overrides \ + $(docdir) \ + $(PF)/lib/debug +files_dbg = + +dirs_doc = \ + $(docdir)/$(p_doc) \ + $(PF)/share/info +files_doc = \ + $(PF)/share/info/gcc* + +ifeq ($(TARGET)-$(with_arm_soft_float),arm-yes) + dirs_gcc += $(PF)/lib/soft-float +endif + +ifeq ($(TARGET)-$(with_arm_soft_float),armeb-yes) + dirs_gcc += $(PF)/lib/soft-float +endif + +foo-%: + echo T: $(TARGET) $(d) + echo $(dirs_gcc) + echo $(files_gcc) + echo X: test -e $(d)/$(gcc_lib_dir)/SYSCALLS.c.X \ + && echo $(gcc_lib_dir)/SYSCALLS.c.X + echo X: $(shell test -e $(d)/$(gcc_lib_dir)/SYSCALLS.c.X \ + && echo $(gcc_lib_dir)/SYSCALLS.c.X) + + +# ---------------------------------------------------------------------- +# install: $(install_stamps) first-move-stamp +$(install_stamp)-%: + dh_testdir + dh_testroot + + rm -f debian/tmp + ln -sf tmp-$(TARGET) debian/tmp + + rm -Rf $(PDIRS) + +# rm -f debian/control +# $(MAKE) -f debian/rules debian/control +#ifeq ($(TARGET),native) +# dh_clean -k +#endif + : # Install directories + rm -rf $(d)/$(PF) + + +# directories which need to be created by hand: +# $(PF)/share, because infodir and mandir are reset +# $(PF)/bin, because libio does not check for include/g++-X +# $(PF)/include/$(cxx_inc_dir), because libio does not check for include/g++-X +# $(PF)/include/$(cxx_inc_dir)/std, because libstdc++ doesn't check for g++-X/std +# $(PF)/include/$(cxx_inc_dir)/gen, because libg++ doesn't check for g++-X/gen + +# Now that we use install -D again, none. +# mkdir -p $(d)/$(PF) \ +# $(d)/$(PF)/share/doc \ +# $(d)/$(PF)/include/$(cxx_inc_dir)/{gen,std} + mkdir -p $(d)/$(PF) \ + $(d)/$(PF)/share/{info,man} \ + $(d)/$(PF)/{bin,lib} + : # Install everything +ifeq ($(TARGET),native) + ifneq ($(SNAPSHOT),yes) + PATH=$(PWD)/$(builddir)/texinfo/util:`pwd`/bin:$$PATH \ + $(MAKE) -C $(builddir) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ + BOOT_CFLAGS="$(BOOT_CFLAGS)" \ + BISON=bison-1.35 \ + INSTALL="$(IR) -D" \ + INSTALL_PROGRAM="$(IP) -D" \ + prefix=$(PWD)/$(d)/$(PF) \ + infodir=$(PWD)/$(d)/$(PF)/share/info \ + mandir=$(PWD)/$(d)/$(PF)/share/man \ + cpp_install_dir=$(PWD)/$(d)/bin install + + ifeq ($(with_fortran),yes) + PATH=$(PWD)/$(builddir)/texinfo/util:$$PATH \ + $(MAKE) -C $(builddir)/$(DEB_HOST_GNU_TYPE)/libf2c-pic \ + LIBG2C=libg2c-pic.a \ + CFLAGS="$(CFLAGS) -fPIC -DPIC" LDFLAGS="$(LDFLAGS)" \ + INSTALL="$(IR) -D" \ + INSTALL_PROGRAM="$(IP) -D" \ + prefix=$(PWD)/$(d)/$(PF) \ + infodir=$(PWD)/$(d)/$(PF)/share/info \ + mandir=$(PWD)/$(d)/$(PF)/share/man install + endif + else + PATH=$(PWD)/$(builddir)/texinfo/util:`pwd`/bin:$$PATH \ + $(MAKE) -C $(builddir) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ + BOOT_CFLAGS="$(BOOT_CFLAGS)" \ + BISON=bison-1.35 \ + INSTALL="$(IR) -D" \ + INSTALL_PROGRAM="$(IP) -D" \ + prefix=$(PWD)/$(d)/$(PF) \ + infodir=$(PWD)/$(d)/$(PF)/share/info \ + mandir=$(PWD)/$(d)/$(PF)/share/man install + endif +else + PATH=`pwd`/bin:$$PATH \ + $(MAKE) -C $(builddir) LANGUAGES="c c++" \ + BISON=bison-1.35 \ + INSTALL="$(IR) -D" \ + INSTALL_PROGRAM="$(IP) -D" \ + prefix=$(PWD)/$(d)/$(PF) \ + infodir=$(PWD)/$(d)/$(PF)/share/info \ + mandir=$(PWD)/$(d)/$(PF)/share/man install +endif + + : # Adjust installation such that we can begin moving things around: +# $(IS) debian/c89 $(d)/$(PF)/bin/ +# $(IR) debian/c89.1 $(d)/$(PF)/share/man/man1/ +ifeq ($(VER),2.95.4) + mv $(d)/$(PF)/share/man/man1/cccp.1 $(d)/$(PF)/share/man/man1/cpp.1 +endif + + : # - Remove files, which are not part of any package + rm -f $(d)/$(PF)/bin/$(DEB_HOST_GNU_TYPE)-gcc + rm -f $(d)/$(PF)/bin/{c++,c++filt} + rm -f $(d)/$(PF)/share/man/man1/c++.1 + rm -f $(d)/$(PF)/lib/libiberty.a + rm -rf $(d)/$(PF)/$(DEB_HOST_GNU_TYPE) +# rm -f $(d)/$(gcc_lib_dir)/include/{asm/posix_types.h,gnu/types.h} + + : # adjustments needed for the snapshot ... + : # rm -f $(d)/$(PF)/bin/makeinfo + + : # install package directories + dh_installdirs -p$(p_gcc) $(dirs_gcc) + dh_installdirs -p$(p_cpp) $(dirs_cpp) + dh_installdirs -p$(p_cppd) $(dirs_cppd) +ifeq ($(with_objc),yes) + dh_installdirs -p$(p_objc) $(dirs_objc) +endif +ifeq ($(with_proto),yes) + dh_installdirs -p$(p_proto) $(dirs_proto) +endif +ifeq ($(with_gplusplus),yes) + dh_installdirs -p$(p_gpp) $(dirs_gpp) +endif +ifeq ($(TARGET),native) +ifeq ($(with_fortran),yes) + dh_installdirs -p$(p_g77) $(dirs_g77) + dh_installdirs -p$(p_g77d) $(dirs_g77d) +endif +ifeq ($(with_chill),yes) + dh_installdirs -p$(p_gch) $(dirs_chill) +endif +ifeq ($(with_java),yes) + dh_installdirs -p$(p_java) $(dirs_java) +endif +ifeq ($(with_pascal),yes) + dh_installdirs -p$(p_gpc) $(dirs_gpc) + dh_installdirs -p$(p_gpcd) $(dirs_gpcd) +endif +endif +ifeq ($(with_gplusplus),yes) + dh_installdirs -p$(p_lib) $(dirs_lib) + dh_installdirs -p$(p_dev) $(dirs_dev) + dh_installdirs -p$(p_dbg) $(dirs_dbg) +endif +ifeq ($(with_libgpp),yes) + dh_installdirs -p$(p_lgp) $(dirs_lgp) + dh_installdirs -p$(p_lgd) $(dirs_lgd) + dh_installdirs -p$(p_lgdbg) $(dirs_lgdbg) +endif + dh_installdirs -p$(p_doc) $(dirs_doc) +#ifeq ($(VER),2.95.4) +# dh_installdirs -p$(p_docs) $(docdir) +#endif +ifeq ($(DEB_HOST_ARCH),powerpc) + dh_installdirs -p$(p_nof) $(dirs_nof) +endif +ifeq ($(TARGET)-$(with_arm_soft_float),arm-yes) + dh_installdirs -p$(p_softfloat) $(dirs_softfloat) +endif +ifeq ($(TARGET)-$(with_arm_soft_float),armeb-yes) + dh_installdirs -p$(p_softfloat) $(dirs_softfloat) +endif + +ifeq ($(TARGET),native) + +# first-move-stamp: $(install_stamp) + # rm -f $(install_stamp) + : # - cpp installation +#ifneq ($(SNAPSHOT),yes) +# -mkdir -p $(d)/lib +# ln -sf /usr/bin/cpp $(d)/lib/cpp +#endif +#ifneq ($(SNAPSHOT),yes) +# mv $(d)/$(PF)/bin/cpp $(d)/lib/cpp +# dh_link /lib/cpp /$(PF)/bin/cpp +#endif + $(IR) debian/gcov.1 $(d)/$(PF)/share/man/man1/ + : # - Adjust files for compiler +ifeq ($(with_proto),yes) + $(IR) debian/protoize.1 $(d)/$(PF)/share/man/man1/ + ln -f $(d)/$(PF)/share/man/man1/protoize.1 \ + $(d)/$(PF)/share/man/man1/unprotoize.1 +endif +ifeq ($(with_pascal),yes) + $(IR) debian/gpc-run.1 $(d)/$(PF)/share/man/man1/ +endif +#ifeq ($(VER),2.95.4) +# ln -sf gcc $(d)/$(PF)/bin/egcc +# ln -sf gcc.1 $(d)/$(PF)/share/man/man1/egcc.1 +#endif + +ifeq ($(with_pascal),yes) + : # adjust gpc + mkdir -p $(d)/$(PF)/share/doc/$(p_gpc) || true + mv $(d)/$(PF)/doc/gpc/demos $(d)/$(PF)/share/doc/$(p_gpc)/examples + mv $(d)/$(PF)/doc/gpc/docdemos $(d)/$(PF)/share/doc/$(p_gpc)/ + rm -f $(d)/$(PF)/bin/pc $(d)/$(PF)/share/man/man1/pc.1 +endif +ifeq ($(with_gplusplus),yes) + : # - libstdc++ iostream info files + $(IR) $(builddir)/$(LIBBUILDDIR)/libio/iostream*info* \ + $(d)/$(PF)/share/info/ + ifeq ($(with_libgpp),yes) + : # - libg++ info files and genclass man page + $(IR) $(builddir)/$(LIBBUILDDIR)/libg++/libg++.info* \ + $(d)/$(PF)/share/info/ + $(IR) debian/genclass.1 $(d)/$(PF)/share/man/man1/ + endif +endif + +ifeq ($(versioned_packages),yes) + : # rename files (versioned binaries) + for i in cpp gcc gcov; do \ + mv $(d)/$(PF)/bin/$$i $(d)/$(PF)/bin/$$i$(pkg_ver); \ + done + : # rename files (versioned man pages) + for i in cpp gcc gcov; do \ + mv $(d)/$(PF)/share/man/man1/$$i.1 \ + $(d)/$(PF)/share/man/man1/$$i$(pkg_ver).1; \ + done + ifeq ($(with_gplusplus),yes) + : # rename files (versioned binaries) + for i in g++; do \ + mv $(d)/$(PF)/bin/$$i $(d)/$(PF)/bin/$$i$(pkg_ver); \ + done + : # rename files (versioned man pages) + for i in g++; do \ + mv $(d)/$(PF)/share/man/man1/$$i.1 \ + $(d)/$(PF)/share/man/man1/$$i$(pkg_ver).1; \ + done + endif + ifeq ($(with_pascal),yes) + : # rename files (versioned pascal binaries) + for i in binobj gpc gpc-run gpidump; do \ + mv $(d)/$(PF)/bin/$$i $(d)/$(PF)/bin/$$i$(pkg_ver); \ + done + : # rename files (versioned pascal man pages) + for i in binobj gpc gpc-run gpidump; do \ + mv $(d)/$(PF)/share/man/man1/$$i.1 \ + $(d)/$(PF)/share/man/man1/$$i$(pkg_ver).1; \ + done + endif + ifeq ($(with_chill),yes) + : # rename files (versioned chill binaries) + for i in chill; do \ + mv $(d)/$(PF)/bin/$$i $(d)/$(PF)/bin/$$i$(pkg_ver); \ + done + for i in chill; do \ + ln -sf $(d)/$(PF)/bin/$$i$(pkg_ver) $(d)/$(PF)/bin/$$i; \ + done + endif + ifeq ($(with_proto),yes) + : # rename files (versioned protoize binaries) + for i in protoize unprotoize; do \ + mv $(d)/$(PF)/bin/$$i $(d)/$(PF)/bin/$$i$(pkg_ver); \ + done + : # rename files (versioned protoize man pages) + for i in protoize unprotoize; do \ + mv $(d)/$(PF)/share/man/man1/$$i.1 \ + $(d)/$(PF)/share/man/man1/$$i$(pkg_ver).1; \ + done + endif + ifeq ($(with_fortran),yes) + : # rename files (versioned g77 binaries) + for i in g77; do \ + mv $(d)/$(PF)/bin/$$i $(d)/$(PF)/bin/$$i$(pkg_ver); \ + done + : # rename files (versioned g77 man pages) + for i in g77; do \ + mv $(d)/$(PF)/share/man/man1/$$i.1 \ + $(d)/$(PF)/share/man/man1/$$i$(pkg_ver).1; \ + done + endif + ifeq ($(with_java),yes) + : # rename files (versioned java binaries) + for i in gcj gcjh jv-scan jcf-dump; do \ + mv $(d)/$(PF)/bin/$$i $(d)/$(PF)/bin/$$i$(pkg_ver); \ + done + endif +endif + + : # Move files to subpackages. + dh_movefiles -p$(p_doc) $(files_doc) +ifeq ($(DEB_HOST_ARCH),powerpc) + dh_movefiles -p$(p_nof) $(files_nof) + ifeq ($(with_gplusplus),yes) + ifeq ($(CXX_IF),1.1) + ln -s libstdc++$(LIBC_IF)$(CXX_IF).so.$(LIBSTDCXX_IF) \ + $(d_lib)/$(PF)/lib/libstdc++$(LIBC_IF)1.so.$(LIBSTDCXX_IF) + ln -s libstdc++$(LIBC_IF)$(CXX_IF).so.$(LIBSTDCXX_IF) \ + $(d_nof)/$(PF)/lib/libstdc++$(LIBC_IF)1.so.$(LIBSTDCXX_IF) + ifeq ($(with_libgpp),yes) + ln -s libg++$(LIBC_IF)$(CXX_IF).so.$(LIBSTDCXX_IF) \ + $(d_lgp)/$(PF)/lib/libg++$(LIBC_IF)1.so.$(LIBSTDCXX_IF) + ln -s libg++$(LIBC_IF)$(CXX_IF).so.$(LIBSTDCXX_IF) \ + $(d_nof)/$(PF)/lib/libg++$(LIBC_IF)1.so.$(LIBSTDCXX_IF) + endif + endif + endif +endif +ifeq ($(TARGET)-$(with_arm_soft_float),arm-yes) + dh_movefiles -p$(p_softfloat) $(files_softfloat) +endif +ifeq ($(TARGET)-$(with_arm_soft_float),armeb-yes) + dh_movefiles -p$(p_softfloat) $(files_softfloat) +endif + dh_movefiles -p$(p_cpp) $(files_cpp) + dh_movefiles -p$(p_cppd) $(files_cppd) +ifeq ($(with_objc),yes) + dh_movefiles -p$(p_objc) $(files_objc) +endif +ifeq ($(with_proto),yes) + dh_movefiles -p$(p_proto) $(files_proto) +endif +ifeq ($(with_fortran),yes) + dh_movefiles -p$(p_g77) $(files_g77) + dh_movefiles -p$(p_g77d) $(files_g77d) +endif +ifeq ($(with_chill),yes) + dh_movefiles -p$(p_gch) $(files_chill) +endif +ifeq ($(with_java),yes) + dh_movefiles -p$(p_java) $(files_java) +endif +ifeq ($(with_libgpp),yes) +# libg++-dev must be moved before libstdc++-dev !!! + dh_movefiles -p$(p_lgd) $(files_lgd) + dh_movefiles -p$(p_lgdbg) $(files_lgdbg) + dh_movefiles -p$(p_lgp) $(files_lgp) +# Copy the libraries in libg++ to libg++-dbg + (cd debian/$(p_lgp)/$(PF)/lib/$(lgp) ; tar cfp - .) | \ + (cd debian/$(p_lgdbg)/$(PF)/lib/debug ; tar xvfp -) +endif +ifeq ($(with_gplusplus),yes) + dh_movefiles -p$(p_dev) $(files_dev) + dh_movefiles -p$(p_dbg) $(files_dbg) + dh_movefiles -p$(p_lib) $(files_lib) +# Copy the libraries in libstdc++ to libstdc++-dbg + (cd debian/$(p_lib)/$(PF)/lib/$(lib) ; tar cfp - .) | \ + (cd debian/$(p_dbg)/$(PF)/lib/debug ; tar xvfp -) +endif +ifeq ($(with_pascal),yes) + dh_movefiles -p$(p_gpc) $(files_gpc) + dh_movefiles -p$(p_gpcd) $(files_gpcd) +endif +ifeq ($(with_gplusplus),yes) + dh_movefiles -p$(p_gpp) $(files_gpp) +endif +# gcc must be moved after g77 and g++ +ifeq ($(DEB_HOST_GNU_TYPE),sparc-linux-no) + : # compile the wrapper + $(CC) $(CFLAGS) -o $(d)/usr/bin/sparc64-linux-gcc-wrapper \ + debian/sparc64-linux-gcc-wrapper.c +endif +else # NOT NATIVE +ifeq ($(versioned_packages),yes) + : # rename files (versioned binaries) + for i in g++; do \ + mv $(d)/$(PF)/bin/$(TARGET)-linux-$$i $(d)/$(PF)/bin/$(TARGET)-linux-$$i$(pkg_ver); \ + done +endif + + dh_movefiles -p$(p_cpp) $(files_cpp) +ifeq ($(with_gplusplus),yes) + dh_movefiles -p$(p_dev) $(files_dev) + dh_movefiles -p$(p_dbg) $(files_dbg) + dh_movefiles -p$(p_lib) $(files_lib) + dh_movefiles -p$(p_gpp) $(files_gpp) +endif +endif # NATIVE + dh_movefiles -p$(p_gcc) $(files_gcc) + + touch $(install_stamp)-$* +# touch first-move-stamp + +usr_doc_files = debian/{README.Debian,README.Bugs} \ + $(shell test -f $(srcdir)/FAQ && echo $(srcdir)/FAQ) +ifneq ($(SNAPSHOT),no) + usr_doc_files += debian/README.snapshot +endif +ifeq ($(with_check),yes) + usr_doc_files += test-summary +endif +ifeq ($(DEB_HOST_ARCH),sparc) + usr_doc_files += debian/README.sparc +endif + +ifeq ($(DEB_HOST_ARCH),powerpc) + ifeq ($(CXX_IF),1.1) + libstdc_eh_ver := $(empty_random_variable) (>= 2.91.63) + endif +endif + +# ---------------------------------------------------------------------- +# Build architecture-dependent files here. +# binary-arch: build install +$(binary_stamp)-arch-%: + dh_testdir + dh_testroot + + rm -f debian/tmp + ln -sf tmp-$(TARGET) debian/tmp + + : # Install documentation and changelogs +ifeq ($(TARGET),native) + ifeq ($(with_objc),yes) + dh_installchangelogs -a -N$(p_objc) -N$(p_proto) -N$(p_dev) \ + -N$(p_lgd) -N$(p_dbg) -N$(p_lgdbg) + dh_installdocs -a -A -N$(p_objc) -N$(p_proto) -N$(p_dev) -N$(p_lgd) \ + -N$(p_dbg) -N$(p_lgdbg) $(usr_doc_files) + else + dh_installchangelogs -a -N$(p_proto) -N$(p_dev) \ + -N$(p_lgd) -N$(p_dbg) -N$(p_lgdbg) + dh_installdocs -a -A -N$(p_proto) -N$(p_dev) -N$(p_lgd) \ + -N$(p_dbg) -N$(p_lgdbg) $(usr_doc_files) + endif +else + dh_installchangelogs -a -N$(p_proto) -N$(p_dev) \ + -N$(p_lgd) -N$(p_dbg) -N$(p_lgdbg) $(NOT_PACKAGES) + dh_installdocs -a -A -N$(p_proto) -N$(p_dev) -N$(p_lgd) \ + -N$(p_dbg) -N$(p_lgdbg) $(NOT_PACKAGES) $(usr_doc_files) +endif + dh_installdocs -p$(p_gcc) $(srcdir)/gcc/BUGS debian/README.cross + cp -p debian/NEWS.gcc $(d_gcc)/$(docdir)/$(p_gcc)/NEWS +ifeq ($(TARGET),native) + ifeq ($(with_objc),yes) + ln -sf $(p_gcc) $(d_objc)/$(docdir)/$(p_objc) + endif + ifeq ($(with_proto),yes) + ln -sf $(p_gcc) $(d_proto)/$(docdir)/$(p_proto) + endif + ifeq ($(with_fortran),yes) + dh_installdocs -p$(p_g77) $(srcdir)/gcc/f/{NEWS,BUGS} + $(IR) $(srcdir)/libf2c/README $(d_g77)/$(docdir)/$(p_g77)/README.libf2c + endif + ifeq ($(with_gplusplus),yes) + dh_installdocs -p$(p_gpp) $(srcdir)/gcc/{cp/NEWS,BUGS} debian/README.C++ + $(IR) $(srcdir)/libio/NEWS $(d_dev)/$(docdir)/$(p_lib)/NEWS.libio + $(IR) $(srcdir)/libstdc++/NEWS debian/README.C++ \ + $(d_dev)/$(docdir)/$(p_lib)/ + ln -sf $(p_lib) $(d_dev)/$(docdir)/$(p_dev) + ln -sf $(p_lib) $(d_dbg)/$(docdir)/$(p_dbg) + endif +ifeq ($(with_libgpp),yes) + $(IR) $(srcdir)/libg++/NEWS $(d_lgd)/$(docdir)/$(p_lgp)/ + ln -sf $(p_lgp) $(d_lgd)/$(docdir)/$(p_lgd) + ln -sf $(p_lgp) $(d_lgdbg)/$(docdir)/$(p_lgdbg) +endif +ifeq ($(with_pascal),yes) + dh_installdocs -p$(p_gpc) $(srcdir)/gcc/p/{AUTHORS,README,NEWS} + $(IR) $(srcdir)/gcc/p/FAQ $(d_gpc)/$(docdir)/$(p_gpc)/FAQ.gpc +# $(IR) $(srcdir)/gcc/p/BUGS $(d_gpc)/$(docdir)/$(p_gpc)/BUGS.gpc + $(IR) $(srcdir)/gcc/p/test/README \ + $(d_gpc)/$(docdir)/$(p_gpc)/README.gpc-test + if [ -f gpc-test-summary ]; then \ + rm -f $(d_gpc)/$(docdir)/$(p_gpc)/test-summary; \ + $(IR) gpc-test-summary $(d_gpc)/$(docdir)/$(p_gpc)/; \ + fi +endif +ifeq ($(with_java),yes) + dh_installdocs -p$(p_java) debian/README.java +endif +ifeq ($(with_chill),yes) + dh_installdocs -p$(p_gch) $(srcdir)/gcc/ch/README +endif + : # Install man pages and undocumented links +# dh_installmanpages -a $(NOT_PACKAGES) +ifeq ($(with_java),yes) + ifeq ($(versioned_packages),yes) + dh_undocumented -p$(p_java) {gcj,gcjh,jv-scan,jcf-dump}$(pkg_ver).1 + else + dh_undocumented -p$(p_java) {gcj,gcjh,jv-scan,jcf-dump}.1 + endif +endif +ifeq ($(with_chill),yes) + ifeq ($(versioned_packages),yes) + dh_undocumented -p$(p_gch) chill$(pkg_ver).1 + dh_undocumented -p$(p_gch) chill.1 + else + dh_undocumented -p$(p_gch) chill.1 + endif +endif + + : # remove empty directories, when all components are in place + for d in `find debian -depth -type d -empty 2> /dev/null`; do \ + while rmdir $$d 2> /dev/null; do d=`dirname $$d`; done; \ + done +endif # NATIVE + + : # strip executables and libraries + dh_strip -a -Xdebug $(NOT_PACKAGES) + + : # in the snapshot package the man pages aren't compressed by default. + dh_compress -a $(NOT_PACKAGES) +ifeq ($(TARGET),native) +ifeq ($(with_libgpp),yes) + : # link libg++ doc files to libstdc++ doc files + for i in $(usr_doc_files); do \ + b=`basename $$i`; \ + if [ -e $(d_lib)/$(docdir)/$(p_lib)/$$b ]; then \ + ln -sf ../$(p_lib)/$$b $(d_lgp)/$(docdir)/$(p_lgp)/$$b; \ + else \ + ln -sf ../$(p_lib)/$$b.gz $(d_lgp)/$(docdir)/$(p_lgp)/$$b.gz; \ + fi; \ + done +endif +endif # NATIVE + dh_fixperms -a $(NOT_PACKAGES) + +# when dh_installdeb is called from the snapshot package, the postinst/prerm +# packages are intentionally not called: +# - we don't want to call update-info for the snapshot ... +# - gcc-ss doesn't provide an alternative for cc +# - libstdc++ and libg++ don't call ldconfig, user should set LD_LIBRARY_PATH +# dh_makeshlibs -a +ifneq ($(SNAPSHOT),yes) + ifeq ($(with_gplusplus),yes) + ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu) + ifeq ($(DEB_HOST_ARCH),powerpc) + echo "libstdc++$(LIBC_IF)$(CXX_IF) $(LIBSTDCXX_IF) libstdc++$(PKG_SONAME)$(libstdc_eh_ver) (>= $(lib_pkg_req_version))" \ + > debian/$(p_lib).shlibs + else + echo "libstdc++$(LIBC_IF)$(CXX_IF) $(LIBSTDCXX_IF) libstdc++$(PKG_SONAME) (>= $(lib_pkg_req_version))" \ + > debian/$(p_lib).shlibs + endif + else + echo "libstdc++ $(lib_version) libstdc++$(PKG_SONAME) (>= $(lib_pkg_req_version))" > debian/$(p_lib).shlibs + endif + endif + ifeq ($(with_libgpp),yes) + echo "libg++$(LIBC_IF)$(CXX_IF) $(LIBSTDCXX_IF) libg++$(LGP_PKG_SONAME)" \ + > debian/$(p_lgp).shlibs + endif +endif + +ifeq ($(with_libgpp),yes) + b=libg++; \ + for ext in preinst postinst prerm postrm; do \ + for t in '' -dev -dbg; do \ + if [ -z "$$t" ]; then v=$(LGP_PKG_SONAME); else v=$(LGP_PKG_DEV_SONAME); fi; \ + if [ -f debian/$$b$$t.$$ext ]; then \ + cp -pf debian/$$b$$t.$$ext debian/$$b$$v$$t$(TS).$$ext; \ + fi; \ + done; \ + done + mkdir -p $(d_lgdbg)/usr/share/lintian/overrides || true + cp -p debian/libg++-dbg.overrides \ + $(d_lgdbg)/usr/share/lintian/overrides/$(p_lgdbg) +endif +ifeq ($(with_gplusplus),yes) + b=libstdc++; \ + for ext in preinst postinst prerm postrm; do \ + for t in '' -dev -dbg; do \ + if [ -z "$$t" ]; then v=$(PKG_SONAME); else v=$(PKG_DEV_SONAME); fi; \ + if [ -f debian/$$b$$t.$$ext ]; then \ + cp -pf debian/$$b$$t.$$ext debian/$$b$$v$$t$(TS).$$ext; \ + fi; \ + done; \ + done + mkdir -p $(d_dbg)/usr/share/lintian/overrides || true + cp -p debian/libstdc++-dbg.overrides \ + $(d_dbg)/usr/share/lintian/overrides/$(p_dbg) +endif + +# : # help out debhelper ;-) +#ifeq ($(with_objc),yes) +# for p in $(p_dev) $(p_dbg) $(p_lgd) $(p_lgdbg) $(p_objc); do \ +# echo 'if [ "$$1" = "configure" ];'" then if [ -d /usr/doc -a ! -e /usr/doc/$$p -a -d /usr/share/doc/$$p ]; then ln -sf ../share/doc/$$p /usr/doc/$$p; fi; fi" >> debian/$$p.postinst.debhelper; \ +# echo 'if [ \( "$$1" = "upgrade" -o "$$1" = "remove" \)'" -a -L /usr/doc/$$p ]; then rm -f /usr/doc/$$p; fi" >> debian/$$p.prerm.debhelper; \ +# done +#else +# for p in $(p_dev) $(p_dbg) $(p_lgd) $(p_lgdbg); do \ +# echo 'if [ "$$1" = "configure" ];'" then if [ -d /usr/doc -a ! -e /usr/doc/$$p -a -d /usr/share/doc/$$p ]; then ln -sf ../share/doc/$$p /usr/doc/$$p; fi; fi" >> debian/$$p.postinst.debhelper; \ +# echo 'if [ \( "$$1" = "upgrade" -o "$$1" = "remove" \)'" -a -L /usr/doc/$$p ]; then rm -f /usr/doc/$$p; fi" >> debian/$$p.prerm.debhelper; \ +# done +#endif + +# alternatives are disabled +#ifeq ($(versioned_packages),yes) +# pv=`echo $(pkg_ver) | tr -d .`; \ +# echo "pkg_ver=$$pv" >> debian/postinst.debhelper; \ +# echo "pkg_ver=$$pv" >> debian/prerm.debhelper; \ +# for p in $(p_cpp) $(p_gpp) $(p_g77) $(p_proto) $(p_gpc) \ +# $(p_gch) $(p_java) $(p_dev); \ +# do \ +# echo "pkg_ver=$$pv" >> debian/$$p.postinst.debhelper; \ +# echo "pkg_ver=$$pv" >> debian/$$p.prerm.debhelper; \ +# done +#endif + +ifeq ($(TARGET),native) + ifeq ($(with_gplusplus),yes) + : # dh_shlibdeps ... I hope I got it correct now ... + : # we don't want the dep. on libstdc++, it's hardwired in control + ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu) + echo "libstdc++$(LIBC_IF)$(CXX_IF) $(LIBSTDCXX_IF) $(p_lib) (>= $(lib_pkg_req_version))" \ + > debian/shlibs.local + else + echo "libstdc++ $(lib_version) $(p_lib) (>= $(lib_pkg_req_version))" > debian/shlibs.local + endif + endif +# LD_LIBRARY_PATH=$(d_lib)/usr/lib dh_shlibdeps -a $(NOT_PACKAGES) + dh_shlibdeps -l:$(d_lib)/usr/lib: -a $(NOT_PACKAGES) +else + : Oh what a 'orrible 'ack + for p in $(MY_CROSS_PACKAGES); do \ + cp debian/cpp-2.95.substvars debian/$$p.substvars; \ + done +endif +ifneq ($(SNAPSHOT),yes) + dh_installdeb -a $(NOT_PACKAGES) +endif + dh_gencontrol -a -u-v1:$(DPKGVER) $(NOT_PACKAGES) + for p in `dh_listpackages -a $(NOT_PACKAGES)`; do \ + if grep -H '^Architecture' debian/$$p/DEBIAN/control; then \ + : ; \ + else \ + echo "Missing architecture line: $$p"; \ + s=error; \ + fi; \ + done; \ + if [ "$$s" = error ]; then \ + echo "dpkg-gencontrol generated control file without 'Architecture:' line"; \ + echo "This error should not appear when building with dpkg-dev-1.8.x"; \ + exit 1; \ + fi + dh_md5sums -a $(NOT_PACKAGES) + dh_builddeb -a $(NOT_PACKAGES) +ifeq ($(with_check),yes) + : # Send Email about sucessfull build. + # cat raw-test-summary | sh; echo "Sent mail to $(S_EMAIL)" +endif + touch $(binary_stamp)-arch-$* + +# ---------------------------------------------------------------------- +# Build architecture-independent files here. +# binary-indep: build install +$(binary_stamp)-indep-%: +ifeq ($(TARGET),native) + dh_testdir + dh_testroot + + rm -f debian/tmp + ln -sf tmp-$(TARGET) debian/tmp + +#ifeq ($(VER),2.95.4) +# dh_installdocs -i -N$(p_docs) $(NOT_PACKAGES) +# dh_installchangelogs -i -N$(p_docs) $(NOT_PACKAGES) +# ln -sf $(p_doc) $(d_docs)/$(docdir)/$(p_docs) +#else + dh_installdocs -i $(NOT_PACKAGES) + dh_installchangelogs -i $(NOT_PACKAGES) +#endif + +# dh_installexamples -i $(NOT_PACKAGES) +# dh_installmenu -i $(NOT_PACKAGES) +# dh_installinit -i $(NOT_PACKAGES) +# dh_installcron -i $(NOT_PACKAGES) +# dh_installmanpages -i $(NOT_PACKAGES) +# dh_undocumented + + : # remove empty directories, when all components are in place +ifeq ($(with_pascal),yes) + for d in `find $(d_doc) $(d_g77d) $(d_gpcd) \ + -depth -type d -empty 2> /dev/null`; do \ + while rmdir $$d 2> /dev/null; do d=`dirname $$d`; done; \ + done +else + for d in `find $(d_doc) $(d_g77d) \ + -depth -type d -empty 2> /dev/null`; do \ + while rmdir $$d 2> /dev/null; do d=`dirname $$d`; done; \ + done +endif + + dh_compress -i $(NOT_PACKAGES) -X.pas + dh_fixperms -i $(NOT_PACKAGES) +# dh_suidregister -i $(NOT_PACKAGES) +ifneq ($(SNAPSHOT),yes) + dh_installdeb -i $(NOT_PACKAGES) +endif + dh_gencontrol -i -u-v1:$(DPKGVER) $(NOT_PACKAGES) + dh_md5sums -i $(NOT_PACKAGES) + dh_builddeb -i $(NOT_PACKAGES) +endif # NATIVE + touch $(binary_stamp)-indep-$* + + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +binary: binary-indep binary-arch + +-include debian/rules2.hack + +ifeq ($(binary_hack),arch) +$(binary_stamp)-%: $(binary_stamp)-arch-% + touch $(binary_stamp)-$* +else +ifeq ($(binary_hack),indep) +$(binary_stamp)-%: $(binary_stamp)-indep-% + touch $(binary_stamp)-$* +else +$(binary_stamp)-%: $(binary_stamp)-indep-% $(binary_stamp)-arch-% + touch $(binary_stamp)-$* +endif +endif + +.PHONY: build clean binary-indep binary-arch binary --- gcc-2.95-2.95.4.ds15.orig/debian/control.in +++ gcc-2.95-2.95.4.ds15/debian/control.in @@ -0,0 +1,447 @@ +#if 0 +Macros used: +PN - the package name (takes the base name as arg) +PRI - priority, takes one arg, the priority. + +The following macros must be defined, when called: + SNAPSHOT (if snapshot) + FAKE (if fake snapshot building as main) + SRCNAME + CV - current binary package version (2.xx.yy), no epochs and debian numbers + NV - next version of CV + ARCH - architecture name + TARGET - target for cross compilers + + The architecture will also be defined (-D__i386__, -D__powerpc__, etc.) + + FIRST_PRIMARY is set to the version (including Debian revision) of the first + gcc package for i486, m68k and sparc. +#endif + +#ifndef SRCNAME +# error undefined macro: SRCNAME +#endif +#ifndef CV +# error undefined macro: CV +#endif +#ifndef NV +# error undefined macro: NV +#endif +#ifndef ARCH +# error undefined macro: ARCH +#endif + +#ifndef TARGET +# define PN(n) n +# define PRI(p) p +# define MAINTAINER Debian GCC maintainers +#else +# define PN(n) n ## _TARGET_ +# define PRI(p) p +#endif + +Source: SRCNAME +Section: devel +Priority: PRI(optional) +Maintainer: MAINTAINER +Uploaders: Matthias Klose , Thiemo Seufer +Standards-Version: 3.7.2 +Build-Depends: dejagnu (>= 1.4), bzip2, _BINUTILS_ (>= BINUTILSV), debhelper (>= 3.0.25), gperf (>= 2.7-3), autoconf2.13, bison-1.35, flex-old, gettext, texinfo, libgc-dev [libgc_no_archs], libncurses-dev, libgmp3-dev, help2man, dpkg-dev (>= 1.13.9) + +NEWLINE + +Package: PN(gcc_PV_) +Architecture: any +#ifdef VPKGS +Depends: ${shlibs:Depends}, PN(cpp_PV_) (>= CV), PN(cpp_PV_) (<< NV), _BINUTILS_ (>= BINUTILSV) +#ifdef FIRST_PRIMARY +#ifdef __sparc__ +Conflicts: libc5-dev, egcc (<< FIRST_PRIMARY), egcs64 (<< 1:19980921-3) +#else +Conflicts: libc5-dev, egcc (<< FIRST_PRIMARY) +#endif +Replaces: egcc +Provides: c-compiler_TARGET_ +#else // not FIRST_PRIMARY +Conflicts: libc5-dev +Provides: c-compiler_TARGET_ +#endif +#else // no VPKGS +Depends: ${shlibs:Depends}, PN(cpp_PV_) (>= CV), PN(cpp_PV_) (<< NV), _BINUTILS_ (>= BINUTILSV) +#ifdef FIRST_PRIMARY +#ifdef __sparc__ +Conflicts: libc5-dev, egcc (<< FIRST_PRIMARY), egcs64 (<< 1:19980921-3) +#else +Conflicts: libc5-dev, egcc (<< FIRST_PRIMARY) +#endif +Replaces: egcc +Provides: egcc_TARGET_, c-compiler_TARGET_ +#else // not FIRST_PRIMARY +Conflicts: libc5-dev +Replaces: gcc-ss (<< NV) +Provides: c-compiler_TARGET_ +#endif +#endif // VPKGS +Recommends: libc-dev +Suggests: PN(gcc_PV_-doc) (>= CV) +Description: The GNU C compiler + SNAPSHOT_WARNING + This is the GNU C compiler, a fairly portable optimizing compiler which + supports multiple languages. This package includes support for C, C++, + and Objective C. + +Package: PN(cpp_PV_) +Architecture: any +Section: interpreters +#ifdef VPKGS +Depends: ${shlibs:Depends} +#ifdef FIRST_PRIMARY +Replaces: g++ (<< FIRST_PRIMARY) +#endif +#else // no VPKGS +Depends: ${shlibs:Depends} +#ifdef FIRST_PRIMARY +Replaces: g++ (<< FIRST_PRIMARY) +#endif +#endif // VPKGS +Description: The GNU C preprocessor + SNAPSHOT_WARNING + The GNU C preprocessor is required by some utilities that use it for + macro substitutions. This package has been separated from gcc for + the benefit of those who require the preprocessor but not the + compiler. + +Package: PN(cpp_PV_-doc) +Architecture: all +Section: doc +Priority: PRI(optional) +#ifdef VPKGS +Conflicts: cpp-doc (<< 1:2.95.3) +Replaces: cpp (<= 1:2.93.12), cpp-doc (<< 1:2.95.3) +#else +Replaces: cpp (<= 1:2.93.12) +#endif +Description: Documentation for the GNU C preprocessor (cpp) + SNAPSHOT_WARNING + Documentation for the GNU C preprocessor in info format. + +#ifdef GPLUSPLUS +#ifndef __target_is_avr__ +Package: PN(g++_PV_) +Architecture: any +Priority: PRI(optional) +#ifdef VPKGS +Provides: c++-compiler_TARGET_ +Depends: ${shlibs:Depends}, PN(gcc_PV_) (>= CV), PN(gcc_PV_) (<< NV), PN(libstdc++_LIB_DEV_SO_-dev) (>= CV) +Suggests: task-c++-devel +Replaces: gcc (<= 2.7.2.3-3) +#else // VPKGS +Provides: c++-compiler_TARGET_ +Depends: ${shlibs:Depends}, PN(gcc) (>= CV), PN(gcc) (<< NV), PN(libstdc++_LIB_DEV_SO_-dev) (>= CV) +Suggests: task-c++-devel +Replaces: gcc (<= 2.7.2.3-3) +#endif // VPKGS +Suggests: PN(gcc_PV_-doc) (>= CV) +Description: The GNU C++ compiler + SNAPSHOT_WARNING + This is the GNU C++ compiler, a fairly portable optimizing compiler for C++. +#endif +#endif + +#ifdef PROTOIZE +Package: PN(protoize_PV_) +Architecture: any +Priority: PRI(optional) +Depends: ${shlibs:Depends}, PN(gcc_PV_) (>= CV), PN(gcc_PV_) (<< NV) +Description: Create/remove ANSI prototypes from C code + SNAPSHOT_WARNING + 'protoize' can be used to add prototypes to a program, thus converting + the program to ANSI C in one respect. The companion program 'unprotoize' + does the reverse: it removes argument types from any prototypes + that are found. +#endif + +#ifdef OBJC +Package: PN(gobjc_PV_) +Architecture: any +Priority: PRI(optional) +Suggests: PN(gcc_PV_-doc) (>= CV) +#ifdef OBJC_GC +Recommends: libgc-dev +#endif +#ifdef VPKGS +Depends: ${shlibs:Depends}, PN(gcc_PV_) (>= CV), PN(gcc_PV_) (<< NV) +Provides: objc-compiler_TARGET_ +#else +Depends: ${shlibs:Depends}, PN(gcc_PV_) (>= CV), PN(gcc_PV_) (<< NV) +Provides: objc-compiler_TARGET_ +#endif +Description: The GNU Objective-C compiler + SNAPSHOT_WARNING + This is the GNU Objective-C compiler, which compiles + Objective-C on platforms supported by the gcc compiler. It uses the + gcc backend to generate optimized code. +#endif + +Package: PN(g77_PV_) +Architecture: any +Priority: PRI(optional) +Suggests: PN(g77_PV_-doc) +#ifdef VPKGS +Depends: ${shlibs:Depends}, PN(gcc_PV_) (>= CV), PN(gcc_PV_) (<< NV) +Provides: fortran77-compiler_TARGET_ +#else +Depends: ${shlibs:Depends}, PN(gcc_PV_) (>= CV), PN(gcc_PV_) (<< NV) +Provides: fortran77-compiler_TARGET_ +#endif +Description: The GNU Fortran 77 compiler + SNAPSHOT_WARNING + This is the GNU g77 Fortran compiler, which compiles + Fortran 77 on platforms supported by the gcc compiler. It uses the + gcc backend to generate optimized code. + +#ifdef FORTRAN +Package: PN(g77_PV_-doc) +Architecture: all +Section: doc +Priority: PRI(optional) +#ifdef VPKGS +Conflicts: g77-doc (<< 1:2.95.3) +Replaces: g77 (<= 1:2.91.58-3), g77-doc (<< 1:2.95.3) +#endif +Description: Documentation for the GNU Fortran compiler (g77) + SNAPSHOT_WARNING + Documentation for the GNU Fortran 77 compiler in info format. +#endif + +#ifdef _CHILL +Package: PN(chill_PV_) +Architecture: any +Priority: PRI(extra) +Replaces: chill +Provides: chill, chill-compiler_TARGET_ +#ifdef VPKGS +Depends: ${shlibs:Depends}, PN(gcc_PV_) (>= CV), PN(gcc_PV_) (<< NV) +#else +Depends: ${shlibs:Depends}, PN(gcc_PV_) (>= CV), PN(gcc_PV_) (<< NV) +#endif +Description: The GNU CHILL compiler + SNAPSHOT_WARNING + This is the ITU CHILL compiler. CHILL is the "CCITT High-Level Language", + where CCITT is the old name for what is now ITU, the International + Telecommunications Union. + . + It is a language in the Modula-2 family, and targets many of the + same applications as Ada (especially large embedded systems). + CHILL was never used much in the United States, but is still + being used in Europe, Brazil, Korea, and other places. +#endif + +#ifdef JAVA +Package: PN(gcj_PV_) +Architecture: any +Priority: PRI(optional) +#ifdef VPKGS +Depends: ${shlibs:Depends}, java-common, PN(gcc_PV_) (>= CV), PN(gcc_PV_) (<< NV), libgcj0-dev (>= 1:2.95.1-5) | libgcj-dev +Provides: java-compiler_TARGET_ +#else +Depends: ${shlibs:Depends}, java-common, PN(gcc_PV_) (>= CV), PN(gcc_PV_) (<< NV), libgcj0-dev (>= 1:2.95.1-5) | libgcj-dev +Provides: java-compiler_TARGET_ +#endif +Description: The GNU compiler for Java(TM) + SNAPSHOT_WARNING + GCJ is a front end to the GCC compiler which can natively compile both + Java(tm) source and bytecode files. The compiler can also generate class + files. + . + Currently the compiler source parser does not understand JDK 1.1 extensions + to the Java programming language. For instance, it does not support + inner classes. +#endif + +#ifdef GPLUSPLUS +#ifndef __target_is_avr__ +Package: PN(libstdc++_LIB_SO_) +Architecture: any +Section: libs +Priority: PRI(optional) +Depends: ${shlibs:Depends} +Description: The GNU stdc++ library + SNAPSHOT_WARNING + This package contains an additional runtime library for C++ programs + built with the GNU compiler. +#endif + +#ifndef __target_is_avr__ +Package: PN(libstdc++_LIB_DEV_SO_-dev) +Architecture: any +Section: libdevel +Priority: PRI(optional) +#ifdef VPKGS +Depends: PN(libstdc++_LIB_SO_) (>= CV), LIBC_DEV (>= 2.1.95) | libc-dev, PN(g++_PV_) (>= CV) +#else +Depends: PN(libstdc++_LIB_SO_) (>= CV), LIBC_DEV (>= 2.1.3) | libc-dev, PN(g++_PV_) (>= CV) +#endif +Provides: libstdc++-dev_TARGET_ +Conflicts: libg++27-dev, libg++272-dev (<< 2.7.2.8-1), libstdc++2.8-dev, libg++2.8-dev, libstdc++2.9-dev, libstdc++2.9-glibc2.1-dev +Suggests: stl-manual +Description: The GNU stdc++ library (development files) + SNAPSHOT_WARNING + This package contains the headers and static library files necessary for + building C++ programs which use libstdc++. Be advised that this only works + with the GNU C++ compiler (version 2.95), and no earlier library will work it. + +Package: PN(libstdc++_LIB_DEV_SO_-dbg) +Architecture: any +Section: libdevel +Priority: PRI(extra) +Depends: PN(libstdc++_LIB_SO_), PN(libstdc++_LIB_DEV_SO_-dev) +Description: The GNU stdc++ library (debugging files) + SNAPSHOT_WARNING + This package contains the shared library of libstdc++ compiled with debugging + symbols. +#endif +#endif // GPLUSPLUS + +#ifdef LIBGPP +Package: PN(libg++_LGP_SO_) +Architecture: any +Section: libs +Priority: PRI(optional) +Depends: ${shlibs:Depends} +#ifndef SNAPSHOT +Provides: libg++_TARGET_ +Conflicts: libg++2.9 (<< 2.91.56) +Replaces: libg++2.9 (<< 2.91.56), libg++2.9-ss (<< 2.91.56), libstdc++2.8-dev (<= 2.90.29-0.5) +#else +Conflicts: libg++_LGP_SO_ (>= CV) +#endif +Description: The GNU C++ extension library - runtime version + SNAPSHOT_WARNING + This package contains the runtime version of the GNU classes. + +Package: PN(libg++_LGP_DEV_SO_-dev) +Architecture: any +Section: libdevel +Priority: PRI(extra) +Depends: PN(libg++_LGP_SO_) (>= CV) +#ifndef SNAPSHOT +Provides: libg++-dev_TARGET_ +Conflicts: libg++27-dev, libg++272-dev (<< 2.7.2.8-1), libg++2.8-dev, libg++2.9-dev (<< 2.91.56), libg++2.8.2-dev, libg++2.8.2-glibc2.1-dev +Replaces: libg++2.9-dev (<< 2.91.56), libg++2.8.2-dev, libg++2.8.2-glibc2.1-dev +#else +Conflicts: PN(libg++2.8-dev), PN(libg++2.9-dev), PN(libg++2.8.2-dev), PN(libg++2.8.2-glibc2.1-dev), libg++_LGP_DEV_SO_-dev (>= CV), libg++_LGP_SO_-dev (>= CV) +Replaces: PN(libg++2.8-dev), PN(libg++2.9-dev), PN(libg++2.8.2-dev), PN(libg++2.8.2-glibc2.1-dev) +#endif +Description: The GNU C++ extension library - development files + SNAPSHOT_WARNING + This package contains some GNU classes. + . + This package is no longer supported upstream (as most of its + functionality is now in the standard C++ library) - do not use this + +Package: PN(libg++_LGP_DEV_SO_-dbg) +Architecture: any +Section: libdevel +Priority: PRI(extra) +Depends: PN(libg++_LGP_SO_), PN(libg++_LGP_DEV_SO_-dev) +Description: The GNU C++ extension library - debugging files + SNAPSHOT_WARNING + This package contains a shared library with some GNU classes compiled + with debugging symbols. + . + This package is no longer supported upstream (as most of its + functionality is now in the standard C++ library) - do not use this + for development of new software; use libstdc++ instead. +#endif // LIBGPP + +Package: PN(gcc_PV_-doc) +Architecture: all +Section: doc +Priority: PRI(optional) +#ifdef VPKGS +Conflicts: gcc-docs (<< 2.95.2), egcs-docs (<< 2.95), gcc-doc (<< 1:2.95.3) +Replaces: gcc (<=2.7.2.3-4.3), egcs-docs (<< 2.95), gcc-docs (<< 2.95.2), gcc-doc (<< 1:2.95.3) +Provides: gcc-docs, egcs-docs +#else +Conflicts: gcc-docs (<< 2.95.2), egcs-docs (<< 2.95) +Replaces: gcc (<=2.7.2.3-4.3), egcs-docs (<< 2.95), gcc-docs (<< 2.95.2) +Provides: egcs-docs +#endif +Description: Documentation for the GNU compilers (gcc, gobjc, g++) + SNAPSHOT_WARNING + Documentation for the GNU compilers in info format. + +#ifdef PASCAL +Package: PN(gpc_PV_) +Architecture: any +Priority: PRI(optional) +Recommends: libgmp3-dev, libncurses5-dev +Suggests: PN(gpc_PV_-doc) (>= CV) +#ifdef VPKGS +Depends: ${shlibs:Depends}, PN(gcc_PV_) (>= CV), PN(gcc_PV_) (<< NV) +Provides: pascal-compiler_TARGET_ +#else +Depends: ${shlibs:Depends}, PN(gcc_PV_) (>= CV), PN(gcc_PV_) (<< NV) +Provides: pascal-compiler_TARGET_ +#endif +Description: The GNU Pascal compiler + SNAPSHOT_WARNING + This is the GNU Pascal compiler, which compiles + Pascal on platforms supported by the gcc compiler. It uses the + gcc backend to generate optimized code. + . + The current beta release 2.2 implements Standard Pascal (ISO 7185, + level 1), a large subset of Extended Pascal (ISO 10206), and + Borland Pascal. Many Borland Pascal units supported. + +Package: PN(gpc_PV_-doc) +Architecture: all +Section: doc +Priority: PRI(optional) +#ifdef VPKGS +Conflicts: gpc-doc (<< 1:2.95.3) +Replaces: gpc (<= 2.91.58-3), gpc-doc (<< 1:2.95.3) +#else +Replaces: gpc (<= 2.91.58-3) +#endif +Description: Documentation for the GNU Pascal compiler (gpc) + SNAPSHOT_WARNING + Documentation for the GNU Pascal compiler in info format. +#endif + +#if defined(__powerpc__) +Package: PN(gcc_PV_-nof) +Architecture: any +Priority: PRI(optional) +Depends: ${shlibs:Depends}, PN(gcc_PV_) (>= CV), PN(gcc_PV_) (<< NV) +#ifdef VPKGS +Conflicts: egcs-nof +Replaces: egcs-nof +#else +Conflicts: egcs-nof +Replaces: egcs-nof +#endif +Description: The no-floating-point gcc libraries + SNAPSHOT_WARNING + These are versions of basic static libraries such as libgcc.a compiled + with the -msoft-float option, for CPUs without a floating-point unit. +#endif + +#if (defined(__arm__) || defined(__ARMEB__)) && defined(ARM_SOFT_FLOAT) +Package: PN(gcc_PV_-soft-float) +Architecture: any +Priority: PRI(optional) +Depends: ${shlibs:Depends}, PN(gcc_PV_) (>= CV), PN(gcc_PV_) (<< NV) +#ifdef VPKGS +Conflicts: egcs-soft-float +Replaces: egcs-soft-float +#else +Conflicts: egcs-soft-float +Replaces: egcs-soft-float +#endif +Description: The soft-floating-point gcc libraries + SNAPSHOT_WARNING + These are versions of basic static libraries such as libgcc.a compiled + with the -msoft-float option, for CPUs without a floating-point unit. +#endif --- gcc-2.95-2.95.4.ds15.orig/debian/changelog +++ gcc-2.95-2.95.4.ds15/debian/changelog @@ -0,0 +1,2555 @@ +gcc-2.95 (2.95.4.ds15-27) unstable; urgency=low + + * libstdc++2.10-dev: Fix libc-dev dependency. + * Remove references to removed tasks. + + -- Matthias Klose Thu, 13 Jul 2006 16:23:33 +0000 + +gcc-2.95 (2.95.4.ds15-26) unstable; urgency=low + + * Do not build g77 on alpha (FTBFS). Closes: #373098. + + -- Matthias Klose Sat, 1 Jul 2006 09:08:19 +0000 + +gcc-2.95 (2.95.4.ds15-25) unstable; urgency=low + + * Matthias Klose + + * Add big-endian arm (armeb) support (Lennert Buytenhek). + Closes: #336064. + * Generate the control file explicitely (debian/rules control-file) + still using cpp-2.95, remove the build dependency on cpp-2.95. + Closes: #336061. + * Fix build failure with new make. Closes: #350688. + + * Thiemo Seufer + + * Provide the canonical chill compiler. + * Update standards version. + * Fix some lintian warnings by adjusting the build dependencies + * Fix changelog formatting. + + -- Thiemo Seufer Tue, 06 Jun 2006 02:14:15 +0100 + +gcc-2.95 (2.95.4.ds15-24) unstable; urgency=low + + * Thiemo Seufer + + * Remove sparc-gcc4-fix.dpatch again, fix sparc FTBFS + (Closes: #339703). + + -- Thiemo Seufer Wed, 16 Nov 2005 14:48:52 +0100 + +gcc-2.95 (2.95.4.ds15-23) unstable; urgency=low + + * Thiemo Seufer + + * Acknowledge NMU. + * Use gcc 4 fix on all architectures. + * Add myself to Uploaders. + + * Matthias Klose + + * Add build dependency on dpkg-dev (>= 1.13.9). + + -- Thiemo Seufer Mon, 14 Nov 2005 19:44:31 +0100 + +gcc-2.95 (2.95.4.ds15-22.1) unstable; urgency=low + + * Non-maintainer upload. + * fix ftbfs on sparc (closes: #326506) + * fix ftbfs due to new dpkg-dev, patch from Lennert Buytenhek + (closes: #323512) + * fix ftbfs on arm, patch from Lennert Buytenhek (closes: #336057) + + -- Blars Blarson Fri, 28 Oct 2005 18:58:39 +0000 + +gcc-2.95 (2.95.4.ds15-22) unstable; urgency=low + + * Add build dependency on help2man. + + -- Matthias Klose Wed, 10 Mar 2004 06:07:43 +0100 + +gcc-2.95 (2.95.4.ds15-21) unstable; urgency=low + + * Update gpc to gpc-20030830. + + -- Matthias Klose Tue, 9 Mar 2004 21:23:24 +0100 + +gcc-2.95 (2.95.4.ds14-20) unstable; urgency=low + + * Removed dependencies on unversioned gxx-2.95 packages. + Actually not done in -18. + + -- Matthias Klose Fri, 2 Jan 2004 13:05:27 +0100 + +gcc-2.95 (2.95.4.ds14-19) unstable; urgency=low + + * Fix names of info docs (closes: #215813, #215838). + * Install debug libraries in /usr/lib/debug (closes: #163667, #158762). + * README.Debian now points to /usr/share/doc/gcc/README.Debian. + Closes: #169632. + + -- Matthias Klose Wed, 15 Oct 2003 07:45:40 +0200 + +gcc-2.95 (2.95.4.ds14-18) unstable; urgency=low + + * Adjust build dependencies (closes: #200670). + * Removed dependencies on unversioned gxx-2.95 packages. + * Remove pre-woody conflicts/replaces. + * Adjust sections and priorities. + * Rename info docs to gxx-2.95.info (closes: #150357). + * Build-Depend/Depend on libgc-dev (closes: #215716). + * Update standards version to 3.6.1. + + -- Matthias Klose Tue, 14 Oct 2003 19:56:56 +0200 + +gcc-2.95 (2.95.4.ds14-17) unstable; urgency=low + + * Fix arm-profile.dpatch (s/NEED_PLT_RELOC/NEED_PLT_GOT/) (Phil Blundell). + Closes: #183990. + + -- Matthias Klose Thu, 6 Mar 2003 07:15:12 +0100 + +gcc-2.95 (2.95.4.ds14-16) unstable; urgency=low + + * Install gpc-run (closes: #179511). + * README.Debian: Cleanup and reference /usr/share/doc/gcc/README.Debian. + + -- Matthias Klose Sun, 23 Feb 2003 21:24:16 +0100 + +gcc-2.95 (2.95.4.ds14-15) unstable; urgency=high + + * The "do-upload-the-debs-you-checked-and-no-other-debs" release. + Closes: #169003, #168991, #168998. + + -- Matthias Klose Thu, 14 Nov 2002 07:42:14 +0100 + +gcc-2.95 (2.95.4.ds14-14) unstable; urgency=low + + * Fix glibc version at 2.2 for libstdc++2.10 package and soname. + + -- Matthias Klose Tue, 12 Nov 2002 19:05:31 +0100 + +gcc-2.95 (2.95.4.ds14-13) unstable; urgency=low + + * Disable libg++ for cross builds (closes: #164582). + * Correct libc-dev dependency on the Hurd (closes: #163238). + * Build-depend on bison-1.35. + * gpc-updates.dpatch: Fix build failure for mips and mipsel. + * Disable g++ on the Hurd (closes: #163234). + * Don't compress Pascal example files. + * Install more gpc doc files. + * Install gpc-run script (undocumented). + + -- Matthias Klose Wed, 23 Oct 2002 22:34:03 +0200 + +gcc-2.95 (2.95.4.ds14-12) unstable; urgency=low + + * Updated Pascal to 20020910 alpha release. + + -- Matthias Klose Mon, 23 Sep 2002 21:28:46 +0200 + +gcc-2.95 (2.95.4.ds13-11) unstable; urgency=low + + * Add ARM patch for profiling, closes: #153261 + + -- Phil Blundell Wed, 31 Jul 2002 18:20:01 +0100 + +gcc-2.95 (2.95.4.ds13-10) unstable; urgency=low + + * chill: remove info docs on package removal (closes: #146850). + * Updated s390 patch. Fixes several internal compiler errors (Gerhard Tonn). + + -- Matthias Klose Sun, 14 Jul 2002 19:57:23 +0200 + +gcc-2.95 (2.95.4.ds13-9) unstable; urgency=low + + * Final gpc-2.1 release. + * Don't build the protoize-2.95 package anymore. + + -- Matthias Klose Sat, 11 May 2002 10:06:10 +0200 + +gcc-2.95 (2.95.4.ds12-8) unstable; urgency=medium + + * Updated gpc to 2.1 RC 7. Fixes among other building with -pipe + and usinf the gmp unit to work with gmp-4.0 (closes: #144123). + + -- Matthias Klose Sat, 27 Apr 2002 16:05:30 +0200 + +gcc-2.95 (2.95.4.ds11-7) unstable; urgency=low + + * Update gcov manpage (closes: #138665). + + -- Matthias Klose Sat, 13 Apr 2002 01:51:44 +0200 + +gcc-2.95 (2.95.4.ds11-6) unstable; urgency=low + + * Updated gpc to 2.1 RC 6. + + -- Matthias Klose Sat, 13 Apr 2002 01:51:44 +0200 + +gcc-2.95 (2.95.4.ds10-5) unstable; urgency=low + + * Add self to Uploaders + * Updated gpc to 2.1 RC 4. + * Remove ineffectual libf2c-alpha patch; note -mieee multilib for + Fortran on Alpha (closes: #136359) + + -- Philip Blundell Wed, 20 Mar 2002 23:28:40 +0000 + +gcc-2.95 (2.95.4.ds9-4) unstable; urgency=low + + * Build libf2c-pic with -mieee as well on alpha-linux (closes: #136359). + + -- Matthias Klose Sun, 10 Mar 2002 00:45:27 +0100 + +gcc-2.95 (2.95.4.ds9-3) unstable; urgency=medium + + * Updated s390 patch fixing several internal compiler errors (Gerhard Tonn). + * New patch by Phil Blundell to fix scalapack build error on m68k. + Closes: #129573. + * New patch backported by Phil Blundell fixing misunhandlng % with unsigned + long operands on arm. Closes: #130394. + * Build libf2c with -mieee on alpha-linux (closes: #136359). + * Updated gpc to next release candidate. + + -- Matthias Klose Mon, 4 Mar 2002 20:55:42 +0100 + +gcc-2.95 (2.95.4.ds8-2) unstable; urgency=medium + + * Disable the testsuite in this upload. We have the test results from + the previous upload. Fixes the bootstrap error on arm (gpc testsuite). + Closes: #128422. + * Correct the gcc version number. We use the gcc-2_95-branch, with the + last change in 2001-10-02. This is NOT an 2.95.4 upstream release. + * Fix incorrectly generated CHILL package description, which makes + the package description quiet unreadable (closes: #127928). + * Reenable Pascal for mips (check by Christoph Martin) and mipsel. + Run the testsuite for these architectures. + * g77/README.libg2c.Debian: New file mentioning `libg2c-pic'. + * Disbale NLS; gettext support in gcc 2.95 is known not to work. + Closes: #129294. + + -- Matthias Klose Sat, 26 Jan 2002 11:38:47 +0100 + +gcc-2.95 (2.95.4.ds8-1) unstable; urgency=medium + + * Build with "BOOT_CFLAGS = -g -O2"; for some reason we built with -O3, + which caused boostrap errors in gpc on arm, sparc, s390 and m68k. + * Update package description pointing to date of last CVS update + (closes: #126316). Decouple the numbering of the Debian release number + from the last update in the CVS. Seems to be misleading... This is + still not an upstream release. Upstream developers claim in lk, this + compiler is "flakey at best". See + http://lists.debian.org/debian-gcc/2001/debian-gcc-200112/msg00159.html + * XXX-2.95-doc packages conflict/replace old (2.95.2) xxx-doc packages. + * debian/patches/strength-red.dpatch: New patch. + * Apply gpc upstream patch (closes: #126240). + * Reenable the gpc testsuite. + + -- Matthias Klose Thu, 3 Jan 2002 19:40:06 +0100 + +gcc-2.95 (2.95.4.ds7-0.011223) unstable; urgency=medium + + * Undo debian/patches/libstdc++-sstream.dpatch. Closes #109073, #115978. + Reopens #92524, #100571. The patch breaks debian/bugs/bug-115978.cc. + * Updated gpc sources to CVS 20011222 (gpc-2.1 release candidate 1). + * Correct chill package description (closes: #118227). + * Reenable building chill on m68k (closes: #118754). + + -- Matthias Klose Sun, 23 Dec 2001 11:07:43 +0100 + +gcc-2.95 (2.95.4.ds6-0.011006) unstable; urgency=low + + * Updated sources to CVS 20011006 (last change 20011002). Fixes #114216. + * Updated gpc sources to 20010924. + + -- Matthias Klose Sat, 6 Oct 2001 15:24:17 +0200 + +gcc-2.95 (2.95.4.ds5-0.010902) unstable; urgency=low + + * Updated sources to CVS 20010901 (last change 20010829). + One change for alpha. + * debian/patches/m68k-reload.dpatch: New patch (Roman Zippel). + Fixes #89023. + * Add gcc-3.0.1 testsuite; note, that the test-summary file is meaningful + only in comparision with the test-summary file in the gcc-3.0 package. + + -- Matthias Klose Sun, 2 Sep 2001 14:04:38 +0200 + +gcc-2.95 (2.95.4.ds4-0.010827) unstable; urgency=low + + * Depend on libgc6-dev, not libgc5-dev, which got obsolete (during + the freeze ...). However adds s390 and hurd-i386 support + (closes: #110191). + + -- Matthias Klose Sun, 26 Aug 2001 23:33:52 +0200 + +gcc-2.95 (2.95.4.ds4-0.010826) unstable; urgency=low + + * Build libg2c.a with -fPIC -DPIC and name the result libg2c-pic.a. + Link with this library to avoid linking with non-pic code. + Use this library when building dynamically loadable objects (python + modules, gimp plugins, ...), which need to be linked against g2c or + a library which is linked against g2c (i.e. lapack). Packages needing + '-lg2c-pic' must have a build dependency on + 'g77-2.95 (>= 1:2.95.4-0.010826). + + -- Matthias Klose Sun, 26 Aug 2001 13:59:03 +0200 + +gcc-2.95 (2.95.4.ds4-0.010825) unstable; urgency=low + + * debian/patches/gcc-gas-hidden.dpatch: Updated. Disable for + alpha and s390. + * debian/patches/gcc-s390.dpatch: Updated patch (Gerhard Tonn). + + -- Matthias Klose Thu, 16 Aug 2001 22:39:32 +0200 + +gcc-2.95 (2.95.4.ds4-0.010810) unstable; urgency=low + + * Exclude libgc5-dev from build depends on s390 (closes: #107191). + * Enable ObjC GC on m68k. + * debian/patches/gcc-s390.dpatch: Updated patch (Gerhard Tonn). + * Tighten libstdc++ shlib dependency to 010810 (#107743). + + -- Matthias Klose Fri, 10 Aug 2001 19:04:02 +0200 + +gcc-2.95 (2.95.4.ds4-0.010721) unstable; urgency=low + + * m68k md fix (closes: #105622) (Roman Zippel). + * debian/rules2: Disable non-functional ulimit on Hurd (closes: #105884). + * debian/patches/gcc-s390.dpatch: Updated patch (Gerhard Tonn). + * debian/patches/gcc-gas-hidden.dpatch: Don't apply for alpha. + + -- Matthias Klose Sat, 21 Jul 2001 12:44:23 +0200 + +gcc-2.95 (2.95.4.ds4-0.010703) unstable; urgency=low + + * libf2c/libI77: Use mkstemp in open.c (closes: #100543). + * debian/patches/gcc-gas-hidden.dpatch: New patch. + * Add gcc-3.0 testsuite; note, that the test-summary is meaningful + only in comparision with the test-summary file from 3.0. + + -- Matthias Klose Tue, 3 Jul 2001 07:22:41 +0200 + +gcc-2.95 (2.95.4.ds3-0.010629) unstable; urgency=low + + * The 2.95.4.ds2-0.010604 got lost in 2.95.4.ds3-0.010628. Readded. + + -- Matthias Klose Fri, 29 Jun 2001 23:52:26 +0200 + +gcc-2.95 (2.95.4.ds3-0.010628) unstable; urgency=low + + * Updated sources to CVS 20010628 (last change 20010619). + * Updated gpc (20010623). + * fix libstdc++-dev's prerm (closes #102191). + * debian/patches/libstdc++-sstream.dpatch: New patch (closes #92524, #100571). + * debian/control.in: Add Uploaders: field. + * debian/patches/arm-tune.dpatch, debian/patches/arm-output-int.dpatch: New + patches. + + -- Matthias Klose Thu, 28 Jun 2001 21:47:39 +0200 + +gcc-2.95 (2.95.4.ds2-0.010604) unstable; urgency=low + + * Call autoconf in gcc-mips.linux.dpatch; depend on autoconf2.13 + * Update patch for s390 arch (Gerhard Tonn ). + * Add mips reg_zero patch (Ryan Murray ). + + -- Matthias Klose Mon, 28 May 2001 19:10:29 +0200 + +gcc-2.95 (2.95.4.ds2-0.010522) unstable; urgency=low + + * Updated to CVS 20010522 (gcc-2_95-branch). + * Updated gpc (20010516). + * Don't install drivers for pascal variants. + * Add libncurses5-dev to build dependencies (needed for libg++ check). + Closes #97769. + + -- Matthias Klose Sat, 26 May 2001 22:55:13 +0200 + +gcc-2.95 (2.95.4.ds1-0.010506) unstable; urgency=low + + * Fix build problem. That was a bug in the rules files, exposed + by dpkg-1.9's changed dpkg-buildpackage script. Thanks to Roderich Schupp. + Fixes #96436. + + -- Matthias Klose Sun, 6 May 2001 14:42:03 +0200 + +gcc-2.95 (2.95.4.ds1-0.010502) unstable; urgency=low + + * Update fsirl patch to 010501 (fixes #95955, #95969, #95978). + Fixes building of glibc. + * Apparently we do have a problem with dpkg-dev-1.9, which does + create control files with missing 'Architecture:' lines. Fixes + are welcome. + * debian/gpc-2.95.prerm: Fix typo (#95358). + * Disable fsirl patch for alpha again. + * Update date in gcc version string to be able to identify the + exact Debian version. + * Now that gcj-3.0 is in the archives, disable building gcj-2.95. + + -- Matthias Klose Fri, 4 May 2001 19:49:05 +0200 + +gcc-2.95 (2.95.4.ds1-0.010424) unstable; urgency=high + + * Apply updated ppc-fsirl patch (function.c removed) for all archs again. + urgency=high for powerpc. + * Remove patches included in ppc-fsirl patch: ppc-descriptions, ppc-ice. + * Correct build dependency (hurd-i386) (#94038). + * debian/rules2: Get free memory correctly on hurd (#94127). + * close #68452: ash is available on sparc and doesn't have any + special build rules for sparc. + * close #79882: bind-8.2.3 compiles fine on i386. + * Alpha related bug fixed in 2.95.3 (closes #94137). + * Fix typo in docs (-fstdc -> -stdc). Closes #94894, #94899. + * Not a bug: #93481 (see report). + + -- Matthias Klose Tue, 24 Apr 2001 23:10:11 +0200 + +gcc-2.95 (2.95.4.ds1-0.010407) unstable; urgency=low + + * New upstream version (gcc-2_95-branch). + * Fixes #93278 (at least as long the ppc-fsirl-patch isn't applied). + * New gpc snapshot (20010409). + * Remove patches applied upstream: arm-section, gcc-i386-pic-kludge, + libstdc++-bastring. + * Reenable snapshot warning. + + -- Matthias Klose Thu, 12 Apr 2001 00:34:17 +0200 + +gcc-2.95 (2.95.3.ds5-11) unstable; urgency=medium + + * Upload with urgency=medium. 2.95.3-9 didn't go to testing before + 2.95.3-10 was uploaded. + * debian/rules.{defs,patch}: Build fixes for mipsel. + * debian/rules2: Build fixes for cross compiler (David Schleef). + * debian/patches/ppc-fsirl-updates.dpatch: Updated to 20010403 version. + * Remove snapshot warning (fixes #92771). + * debian/README.cross: New file submitted by David Schleef + + -- Matthias Klose Thu, 12 Apr 2001 00:34:17 +0200 + +gcc-2.95 (2.95.3.ds5-10) unstable; urgency=low + + * Fix binary-arch target (#90390). + * Suggest correct task-devel-common package (fixes #92022). + * debian/README: Add hint to upstream ChangeLogs in the source packages + (addresses #90355). + * Change priority of libg++ packages to extra (deprecated). + + -- Matthias Klose Thu, 29 Mar 2001 22:08:45 +0200 + +gcc-2.95 (2.95.3.ds5-9) unstable; urgency=high + + * Really fix #89976 (fixes #90370). + * Disable ppc-fsirl-updates patch for alpha. + * New patch: gcc-i386-pic-kludge (apply ASAP, Ben Collins). Fixes #91512. + + -- Matthias Klose Tue, 27 Mar 2001 23:40:16 +0100 + +gcc-2.95 (2.95.3.ds5-8) unstable; urgency=low + + * Final 2.95.3 release. + * debian/patches/libstdc++-bastring2.dpatch: Change var name not to + yield shadow warnings (#84158). + * debian/gpc-2.95.preinst: Remove doc directory (#89976). + * Tighten binutils dependency (2.11.90.0.1-1). + * debian/patches/gcc-version.dpatch: Add 'Debian' to version string. + * debian/patches/{gcc-weaksym,gcc-mips-mad}.dpatch: New. + + -- Matthias Klose Sun, 18 Mar 2001 16:59:41 +0100 + +gcc-2.95 (2.95.3.ds4-7) testing unstable; urgency=low + + * Fix cross compiler builds (patch by Steve Langasek ) + * Remove second part of gcc-m68k-pic patch, also in ppc-fsirl-updates + (reported by Michael Fedrowitz). Fixes #88237. + * Bug 86356 fixed by ppc-fsirl-updates. + * Remove alpha-mi-thunk patch; request from Christopher C. Chimelis. + + -- Matthias Klose Sat, 3 Mar 2001 16:23:34 +0100 + +gcc-2.95 (2.95.3.ds4-6) testing unstable; urgency=low + + * Updated to gcc-2.95.3, fourth test release. + * debian/patches/arm-section.dpatch: New patch submitted by Phil Blundell. + * debian/patches/ppc-fsirl-updates.dpatch: New patch; removed + ppc-andrew-dwarf-eh patch. Applied for all architecture. Submitted + by Dan Jacobowitz. (#85570, #86929). + * debian/rules.conf: Fix libc-dev for Hurd (#87131). + * debian/patches/cross-libc-version.dpatch: Fix by Steve Langasek (#87516). + + -- Matthias Klose Sat, 24 Feb 2001 22:43:02 +0100 + +gcc-2.95 (2.95.3.ds3-5) testing unstable; urgency=low + + * For each binary compiler package xxx-2.95 add a dependency on + xxx (>= 1:2.95.3-2). Fixes #85135, #85141, #85154, #85222, #85539, + #85570, #85578. + * Fix typos. Add note about gcc-2.97 to README (fixes #85180). + + -- Matthias Klose Mon, 12 Feb 2001 01:19:59 +0100 + +gcc-2.95 (2.95.3.ds3-4) unstable; urgency=low + + * Updated to gcc-2.95.3, third test release. + * Updated s390 patch from Chu-yeon Park (#82712). + * debian/patches/arm-exception: Patch submitted by Phil Blundell. + * Updated debian/README. + + -- Matthias Klose Thu, 25 Jan 2001 21:12:41 +0100 + +gcc-2.95 (2.95.3.ds2-3) unstable; urgency=low + + * Updated to gcc-2.95.3-prerelease. + * debian/NEWS.gcc: Updated. + * Revert back to gpc-20001218; bootstrap problems on some architectures. + + -- Matthias Klose Thu, 11 Jan 2001 20:48:57 +0100 + +gcc-2.95 (2.95.3.ds1-2.010107) unstable; urgency=low + + * First upload this year ;-) + * Updated to gcc-2.95.3 test release 1, removed integrated Debian patches. + * Updated to gpc 20010107. + * Changed source package name. It's not allowed anymore to overwrite + source packages with different content. Introducing a 'debian source + element' (.ds), which is stripped again from the version number + for the binary packages. + * Applied patches for mips architecture (#81014). + Disable java and pascal for mips. + * Fixed in 2.95.3: #70710. + * debian/patches/gcc-default-arch.dpatch: Set i386 as "default". + + -- Matthias Klose Mon, 8 Jan 2001 00:16:46 +0100 + +gcc-2.95 (2.95.3-2.001231) unstable; urgency=low + + * Last upload this year ;-) + * NOTE: This is still not a final release, but taken from the + CVS gcc-2_95-branch (20001229). It has been regression tested on + alpha, arm, i386, powerpc and sucessfully built for m68k and sparc. + * Reenable gcj for sparc. + + -- Matthias Klose Sun, 31 Dec 2000 10:50:46 +0000 + +gcc-2.95 (2.95.3-2.001229) unstable; urgency=low + + * Dec 29 (and final) patch kit. + * Remove alternatives and unversioned binaries and man pages. + * debian/patches/arm-*: Updated patches by Philip Blundell . + * TODO: README.Debian needs an update ... + + -- Matthias Klose Fri, 29 Dec 2000 19:04:26 +0000 + +gcc-2.95 (2.95.3-2.001224) experimental; urgency=low + + * New upstream version 2.95.3 experimental (CVS 20001222). + * debian/control.in: Versioned package names, removal of snapshot logic. + Remove fake gcc-docs package. + * Reserve -1 release numbers for woody. + * Updated to gpc-20001218. + * Disable chill for m68k. + + -- Matthias Klose Sun, 24 Dec 2000 10:18:57 +0000 + +gcc (2.95.2-19) unstable; urgency=low + + * Added testsuite-20001207 from current snapshots. We'll need results + for 2.95.2 to make sure there are no regressions against that release. + Dear build daemons and porters to other architectures, please send an + email to gcc-testresults@gcc.gnu.org. + You can do this by running "debian/rules mail-summary". + * Updated to gpc-20001206. + * Added S/390 patch prepared by Chu-yeon Park (#78983). + * debian/patches/libio.dpatch: Fix iostream doc (fixes #77647). + * debian/patches/gcc-doc.dpatch: Update URL (fixes #77542). + * debian/patches/gcc-reload1.dpatch Patch from the gcc-bug list which + fixes a problem in "long long" on i[345]86 (i686 was not affected). + + -- Matthias Klose Sat, 9 Dec 2000 12:30:32 +0100 + +gcc (2.95.2-18) unstable; urgency=low + + * debian/control.in: Fix syntax errors (fixes #76146, #76458). + Disable gpc on the hurd by request (#75686). + * debian/patches/arm-various.dpatch: Patches from Philip Blundell + for ARM arch (fixes #75801). + * debian/patches/gcc-alpha-mi-thunk.dpatch: Patches from Chris Chimelis + for alpha arch. + * debian/patches/g77-docs.dpatch: Adjust g77 docs (fixes #72594). + * Update gpc to gpc-20001118. + * Reenable gpc for alpha. + * debian/README.C++: Merge debian/README.libstdc++ and C++ FAQ information + provided by Matt Zimmermann. + * Build gcj only on architectures, where libgcj-2.95.1 can be built as well. + Probably needs some adjustments ... + * Conditionalize for chill, fortran, java, objc and chill. + + * NOT APPLIED: + debian/patches/libstdc++-bastring.dpatch: Apply fix (fixes #75759). + + -- Matthias Klose Sun, 19 Nov 2000 10:40:41 +0100 + +gcc (2.95.2-17) unstable; urgency=low + + * Disable gpc for alpha. + * Include gpc-cpp in gpc package (fixes #74492). + * Don't build gcc-docs compatibility package anymore. + + -- Matthias Klose Wed, 11 Oct 2000 06:16:53 +0200 + +gcc (2.95.2-16) unstable; urgency=low + + * Applied the emdebian/cross compiler patch and documentation + (Frank Smith ). + * Applied patch for avr target (Hakan Ardo ). + * debian/control.in: Add awk to Build-Depends. + Tighten libc6-dev dependency for libstdc++-dev (fixes #73031, + #72531, #72534). + * Disable libobjc_gc for m68k again (fixes #74380). + * debian/patches/arm-namespace.dpatch: Apply patch from Philip + Blundell to fix name space pollution on arm + (fixes #70937). + * Fix more warnings in STL headers (fixes #69352, #71943). + + -- Matthias Klose Mon, 9 Oct 2000 21:51:41 +0200 + +gcc (2.95.2-15) unstable; urgency=low + + * debian/control.in: Add libgc5-dev to build depends (fixes #67015). + * debian/rules.def: Build GC enabled ObjC runtime for sparc. + * Bug #58741 fixed (in some version since 2.95.2-5). + * debian/control.in: Recommend librx1g-dev, libgmp2-dev, libncurses5-dev + (unit dependencies). + * Patches from Marcus Brinkmann for the hurd (fixes #67763): + - debian/rules.defs: Disable objc_gc on hurd-i386. + Disable libg++ on GNU systems. + - debian/rules2: Set correct names of libstdc++/libg++ + libraries on GNU systems. + Write out correct shlibs and shlibs.local file content. + - Keep _G_config.h for the Hurd. + * Apply patch for ObjC linker warnings. + * Don't apply gcj backport patch for sparc. + * Apply libio compatability patch + * debian/glibcver.sh: generate appropriate version for glibc + * debian/rules.conf: for everything after glibc 2.1, we always append + "-glibc$(ver)" to the C++ libs for linux. + * Back down gpc to -13 version (-14 wont compile on anything but i386 + and m68k becuase of gpc). + * Remove extraneous and obsolete sparc64 patches/files from debian/* + + -- Ben Collins Thu, 21 Sep 2000 08:08:35 -0400 + +gcc (2.95.2-14) unstable; urgency=low + + * Update gpc patch. + + -- Matthias Klose Wed, 5 Jul 2000 20:51:16 +0200 + +gcc (2.95.2-13) frozen unstable; urgency=low + + * Update debian/README: document how to compile 2.0.xx kernels; don't + register gcc272 as an alternative for gcc (closes #62419). + Clarify compiler setup (closes #65548). + * debian/control.in: Make libstdc++-dev depend on current version of g++. + * Undo CVS update from release -8 (problems on alpha, #55263). + + -- Matthias Klose Mon, 19 Jun 2000 23:06:48 +0200 + +gcc (2.95.2-12e4) frozen unstable; urgency=low + + * Added C++ packages + + -- Frank Smith Thu, 6 Jul 2000 12:00:00 -0400 + +gcc (2.95.2-12e3) frozen unstable; urgency=low + + * Regen to fix ARM tools. + + -- Frank Smith Fri, 29 Jun 2000 12:00:00 -0400 + +gcc (2.95.2-12e2) frozen unstable; urgency=low + + * Mostly testing out the process of bumping up the rev number. + Let's try appending an 'e' and the Embedded Debian subversion. + + -- Frank Smith Wed, 21 Jun 2000 12:00:00 -0400 + +gcc (2.95.2-12.1) frozen unstable; urgency=low + + * First working version of cross gcc/cpp packages + + -- Frank Smith Wed, 14 Jun 2000 12:00:00 -0400 + +gcc (2.95.2-12) frozen unstable; urgency=low + + * debian/gpc.postinst: Correct typo introduced with -11 (fixes #64193). + * debian/patches/gcc-rs600.dpatch: ppc codegen fix (fixes #63933). + + -- Matthias Klose Sun, 21 May 2000 15:56:05 +0200 + +gcc (2.95.2-11) frozen unstable; urgency=medium + + * Upload to unstable again (fixes critical #63784). + * Fix doc-base files (fixes important #63810). + * gpc wasn't built in -10 (fixes #63977). + * Make /usr/bin/pc an alternative (fixes #63888). + * Add SYSCALLS.c.X to gcc package. + + -- Matthias Klose Sun, 14 May 2000 22:17:44 +0200 + +gcc (2.95.2-10) frozen; urgency=low + + * debian/control.in: make gcc conflict on any version of egcc + (slink to potato upgrade problem, fixes grave #62084). + * Build protoize programs, separate out in new package (fixes #59436, + #62911). + * Create dummy gcc-docs package for smooth update from slink (fixes #62537). + * Add doc-base support for all -doc packages (fixes #63380). + + -- Matthias Klose Mon, 1 May 2000 22:24:28 +0200 + +gcc (2.95.2-9) frozen unstable; urgency=low + + * Disable the sparc-bi-arch.dpatch (patch from Ben Collins, built + for sparc as NMU 8.1) (fixes critical #61529 and #61511). + "Seems that when you compile gcc 2.95.x for sparc64-linux and compile + sparc32 programs, the code is not the same as sparc-linux compile for + sparc32 (this is a bug, and is fixed in gcc 2.96 CVS)." + * debian/patches/gcj-vs-iconv.dpatch: Option '--encoding' for + encoding of input files. Patch from Tom Tromey + backported to 2.95.2 (fixes #42895). + Compile a Latin-1 encoded file with `gcj --encoding=Latin1 ...'. + * debian/control.in: gcc, g++ and gobjc suggest their corresponding + task packages (fixes #59623). + + -- Matthias Klose Sat, 8 Apr 2000 20:19:15 +0200 + +gcc (2.95.2-8) frozen unstable; urgency=low + + * Post-2.95.2 CVS updates of the gcc-2_95-branch until 20000313. + * debian/rules2: configure with --enable-java-gc=no for sparc. Fixes + gcj side of #60535. + * debian/rules.patch: Disable gcc-emit-rtl patch for all archs but + alpha. Disable g++-is-tree patch ("just for 2.95.1"). + * debian/README: Update for gcc-2.95. + + -- Matthias Klose Mon, 27 Mar 2000 00:03:16 +0200 + +gcc (2.95.2-7) frozen unstable; urgency=low + + * debian/patches/gcc-empty-struct-init.dpatch; Apply patch from + http://gcc.gnu.org/ml/gcc-patches/2000-02/msg00637.html. Fixes + compilation of 2.3.4x kernels. + * debian/patches/gcc-emit-rtl.dpatch: Apply patch from David Huggins-Daines + (backport from 2.96 CVS to fix #55263). + * debian/patches/gcc-pointer-arith.dpatch: Apply patch from Jim Kingdon + (backport from 2.96 CVS to fix #54951). + + -- Matthias Klose Thu, 2 Mar 2000 23:16:43 +0100 + +gcc (2.95.2-6) frozen unstable; urgency=low + + * Post-2.95.2 CVS updates of the gcc-2_95-branch until 20000220. + * Remove dangling symlink probably left over from libstdc++2.9 + package (fixes #53661). + * debian/patches/gcc-alpha-complex-float.dpatch: Fixed patch by + David Huggins-Daines (fixes #58486). + * debian/g++.{postinst,prerm}: Remove outdated g++FAQ registration + (fixes #58253). + * debian/control.in: gcc-doc replaces gcc-docs (fixes #58108). + * debian/rules2: Include some fixed headers (asm, bits, linux, ...). + * debian/patches/{gcc-alpha-ev5-fix,libstdc++-valarray}.dpatch: Remove. + Applied upstream. + * debian/patches/libstdc++-bastring.dpatch: Add patch from + sicard@bigruth.solsoft.fr (fixes #56715). + + -- Matthias Klose Sun, 20 Feb 2000 15:08:13 +0100 + +gcc (2.95.2-5) frozen unstable; urgency=low + + * Post-2.95.2 CVS updates of the gcc-2_95-branch until 20000116. + * Add more build dependencies (fixes #53204). + * debian/patches/gcc-alpha-complex-float.dpatch: Patch from + Joel Klecker to compile glibc correctly on alpha. + "Should fix the g77 problems too." + * debian/patches/{libio,libstdc++-wall2}.dpatch. Remove patches + applied upstream. + + -- Matthias Klose Sun, 16 Jan 2000 19:16:54 +0100 + +gcc (2.95.2-4) unstable; urgency=low + + * debian/patches/libio.dpatch: Patch from Martin v. Loewis. + (fixes: #35628). + * debian/patches/libstdc++-deque.dpatch: Patch from Martin v. Loewis. + (fixes: #52689). + * debian/control.in: Updated Build-Depends, removed outdated README.build. + Fixes #51246. + * Tighten dependencies to cpp (>= 2.95.2-4) (closes: #50294). + * debian/rules.patch: Really do not apply patches/gcj-backport.dpatch. + Fixes #51636. + * Apply updated sparc-bi-arch.dpatch from Ben Collins. + * libstdc++: Define wstring type, if __ENABLE_WSTRING is defined. Request + from the author of the War FTP Daemon for Linux ("Jarle Aase" + ). + * debain/g++.preinst: Remove dangling sysmlinks (fixes #52359). + + -- Matthias Klose Sun, 19 Dec 1999 21:53:48 +0100 + +gcc (2.95.2-3) unstable; urgency=low + + * debian/rules2: Don't install $(gcc_lib_dir)/include/asm; these are + headers fixed for glibc-1.x (closes: #49434). + * debian/patches/cpp-dos-newlines.dpatch: Keep CR's without + following LF (closes: #49186). + * Bug #37358 (internal compiler errors when building vdk_0.6.0-5) + fixed in gcc-2.95.? (closes: #37358). + * Apply patch gcc-alpha-ev5-fix from Richard Henderson + (should fix #48527 and #46963). + * debian/README.Bugs: Documented non bug #44554. + * Applied patch from Alexandre Oliva to fix gpc boostrap on alpha. + Reenabled gpc on all architectures. + * Post-2.95.2 CVS updates of the gcc-2_95-branch until 19991108. + * Explicitely generate postinst/prerm chunks for usr/doc transition. + debhelper currently doesn't handle generation for packages with + symlinked directories. + * debian/patches/libstdc++-wall3.dpatch: Fix warnings in stl_deque.h + and stl_rope.h (closes: #46444, #46720). + * debian/patches/gcj-backport.dpatch: Add file, don't apply (yet). + + -- Matthias Klose Wed, 10 Nov 1999 18:58:45 +0100 + +gcc (2.95.2-2) unstable; urgency=low + + * New gpc-19991030 snapshot. + * Post-2.95.2 CVS updates of the gcc-2_95-branch until 19991103. + * Reintegrated sparc patches (bcollins@debian.org), which were lost + in 2.95.2-1. + * debian/rules2: Only install $(gcc_lib_dir)/include/asm, when existing. + * debian/patches/gpc-2.95.{dpatch,diff}: updated patch to drop + initialization in stor-layout.c. + * debian/NEWS.gcc: Updated for gcc-2.95.2. + * debian/bugs/bug-...: Removed testcases for fixed bugs. + * debian/patches/...dpatch: Removed patches applied upstream. + * debian/{rules2,g++.postinst,g++.prerm}: Handle c++ alternative. + * debian/changelog: Merged gcc272, egcs and snapshot changelogs. + + -- Matthias Klose Tue, 2 Nov 1999 23:09:23 +0200 + +gcc (2.95.2-1.1) unstable; urgency=low + + * Most of the powerpc patches have been applied upstream. Remove all + but ppc-ice, ppc-andrew-dwarf-eh, and ppc-descriptions. + * mulilib-install.dpatch was definitely a bad idea. Fix it properly + by using install -D. + * Also, don't make directories before installing any more. Simplifies + rules a (tiny) bit. + * Do not build with LDFLAGS=-s. Everything gets stripped out anyway by + dh_strip -a -X_debug; so leave the binaries in the build tree with + debugging symbols for simplified debugging of the packages. + + -- Daniel Jacobowitz Sat, 30 Oct 1999 12:40:12 -0400 + +gcc (2.95.2-1) unstable; urgency=low + + * gcc-2.95.2 release (taken from the CVS archive). -fstrict-aliasing + is disabled upstream. + + -- Matthias Klose Mon, 25 Oct 1999 10:26:19 +0200 + +gcc (2.95.2-0pre4) unstable; urgency=low + + * Updated to cvs updates of the gcc-2_95-branch until 19991021. + * Updated gpc to gpc-19991018 snapshot (closes: #33037, #47453). + Enable gpc for all architectures ... + * Document gcc exit codes (closes: #43863). + * According to the bug submitter (Sergey V Kovalyov ) + the original source of these CERN librarties is outdated now. The latest + version of cernlibs compiles and works fine with slink (closes #31546). + * According to the bug submitter (Gergely Madarasz ), + the problem triggered on i386 cannot be reproduced with the current + jade and php3 versions anymore (closes: #35215). + * Replace corrupted m68k-pic.dpatch (from Roman Hodek and Andreas Schwab + and apply to + all architectures (closes: #48011). + * According to the bug submitter (Herbert Xu ) + this bug "probably has been fixed". Setting it to severity "fixed" + (fixes: #39616), will close it later ... + * debian/README.Bugs: Document throwing C++ exceptions "through" C + libraries (closes: #22769). + + -- Matthias Klose Fri, 22 Oct 1999 20:33:00 +0200 + +gcc (2.95.2-0pre3) unstable; urgency=low + + * Updated to cvs updates of the gcc-2_95-branch until 19991019. + * Apply NMU patches (closes: #46217). + * debian/control.in: Fix egcs64 conflict-dependency for sparc + architecture (closes: #47088). + * debian/rules2: dbg-packages share doc dir with lib packages + (closes #45067). + * debian/patches/gcj-debian-policy.dpatch: Patch from Stephane + Bortzmeyer to conform to Debian policy (closes: #44463). + * debian/bugs/bug-*: Added test cases for new bug reports. + * debian/patches/libstdc++-bastring.dpatch: Patch by Richard Kettlewell + (closes #46550). + * debian/rules.patch: Apply libstdc++-wall2 patch (closes #46609). + * debian/README: Fix typo (closes: #45253). + * debian/control.in: Remove primary/secondary distinction; + dbg-packages don't provide their normal counterparts (closes #45206). + * debian/rules.patch: gcc-combine patch applied upstream. + * debian/rules2: Only use mail if with_check is set (off by default). + * debian/rules.conf: Tighten binutils dependency to 2.9.5.0.12. + + -- Matthias Klose Tue, 19 Oct 1999 20:33:00 +0200 + +gcc (2.95.2-0pre2.0.2) unstable; urgency=HIGH (for m68k) + + * Binary-only NMU for m68k as quick fix for another bug; the patch + is in CVS already, too. + * Applied another patch by Andreas Schwab to fix %a5 restauration in + some cases. + + -- Roman Hodek Thu, 30 Sep 1999 16:09:15 +0200 + +gcc (2.95.2-0pre2.0.1) unstable; urgency=HIGH (for m68k) + + * Binary-only NMU for m68k as quick fix for serious bugs; the patches + are already checked into gcc CVS and should be in the next official + version, too. + * Applied two patches by Andreas Schwab to fix -fpic and loop optimization. + + -- Roman Hodek Mon, 27 Sep 1999 15:32:49 +0200 + +gcc (2.95.2-0pre2) unstable; urgency=low + + * Fixed in 2.95.2 (closes: #43478). + * Previous version had Pascal examples missing in doc directory. + + -- Matthias Klose Wed, 8 Sep 1999 22:18:17 +0200 + +gcc (2.95.2-0pre1) unstable; urgency=low + + * Updated to cvs updates of the gcc-2_95-branch until 19990828. + * Apply work around memory corruption (just for 2.95.1) by + Daniel Jacobowitz . + * debian/patches/libstdc++-wall2.dpatch: Patch from Franck Sicard + to fix some warnings (closes: #44670). + * debian/patches/libstdc++-valarray.dpatch: Patch from Hideaki Fujitani + to fix a bug in valarray_array.h. + * Applied NMU from Jim Pick minus the jump.c and fold-const.c patches + already in the gcc-2_95-branch (closes: #44690). + * Conform to debian-java policy (closes: #44463). + * Move docs to /usr/share/doc (closes: #44782). + * Remove debian/patches/gcc-align.dpatch applied upstream. + * debian/*.postinst: Call install-info only, when configuring. + * debian/*.{postinst,prerm}: Add #DEBHELPER# comments to handle + /usr/doc -> /usr/share/doc transition. + + -- Matthias Klose Wed, 8 Sep 1999 22:18:17 +0200 + +gcc (2.95.1-2.1) unstable; urgency=low + + * Non-maintainer upload. + * ARM platform no longer needs library-prefix patch. + * Updated patches from Philip Blundell. + + -- Jim Pick Wed, 8 Sep 1999 20:14:07 -0700 + +gcc (2.95.1-2) unstable; urgency=low + + * debian/gcc.{postinst,prerm}: gcc provides an alternative for + sparc64-linux-gcc. + * Applied patch from Ben Collins to enable bi-architecture (32/64) + support for sparc. + * Rebuild debian/control and debian/rules.parameters after unpacking. + * debian/rules2: binary-indep. Conditionalize on with_pascal. + + -- Matthias Klose Sat, 4 Sep 1999 13:47:30 +0200 + +gcc (2.95.1-1) unstable; urgency=low + + * Updated to release gcc-2.95.1 and cvs updates of the gcc-2_95-branch + until 19990828. + * debian/README.gcc: Updated NEWS file to include 2.95 and 2.95.1 news. + * debian/README.java: New file. + * debian/rules.defs: Disabled gpc for alpha, arm. Disabled ObjC-GC + for alpha. + * debian/rules [clean]: Remove debian/rules.parameters. + * debian/rules2 [binary-arch]: Call dh_shlibdeps with LD_LIBRARY_PATH set + to installation dir of libstdc++. Why isn't this the default? + * debian/control.in: *-dev packages do not longer conflict with + libg++272-dev package. + * Apply http://egcs.cygnus.com/ml/gcc-patches/1999-08/msg00599.html. + * Only define BAD_THROW_ALLOC, when using exceptions (fixes #43462). + * For ObjC (when configured with GC) recommend libgc4-dev, not libgc4. + * New version of 68060 build patch. + * debian/rules.conf: For m68k, depend on binutils version 2.9.1. + + -- Matthias Klose Sat, 28 Aug 1999 18:16:31 +0200 + +gcc (2.95.1-0pre2) unstable; urgency=medium + + * gpc is back again (fixes grave #43022). + * debian/patches/gpc-updates.dpatch: Patches sent to upstream authors. + * Work around the fatal dependtry assertion failure bug in dpkg (hint + from "Antti-Juhani Kaijanaho" , fixes important #43072). + + -- Matthias Klose Mon, 16 Aug 1999 19:34:14 +0200 + +gcc (2.95.1-0pre1) unstable; urgency=low + + * Updated to cvs 19990815 gcc-2_95-branch; included install docs and + FAQ from 2.95 release; upload source package as well. + * Source package contains tarballs only (gcc, libg++, installdocs). + * debian/rules: Splitted into debian/rules{,.unpack,.patch,.conf,2}. + * debian/gcc.postinst: s/any key/RETURN; warn only when upgrading from + pre 2.95 version; reference /usr/doc, not /usr/share/doc. + * Checked syntax for attributes of functions; checked for #35068; + checked for bad gmon.out files (at least with libc6 2.1.2-0pre5 and + binutils 2.9.1.0.25-2 the problem doesn't show up anymore). + * debian/patches/cpp-macro-doc.dpatch: Document macro varargs in cpp.texi. + * gcc is primary compiler for all platforms but m68k. Setting + severity of #22513 to fixed. + * debian/patches/gcc-default-arch.dpatch: New patch to enable generation + of i386 instruction as default (fixes #42743). + * debian/rules: Removed outdated gcc NEWS file (fixes #42742). + * debian/patches/libstdc++-out-of-mem.dpatch: Throw exception instead + of aborting when out of memory (fixes #42622). + * debian/patches/cpp-dos-newlines.dpatch: Handle ibackslashes after + DOS newlines (fixes #29240). + * Fixed in gcc-2.95.1: #43001. + * Bugs closed in this version: + Closes: #11525, #12253, #22513, #29240, #35068, #36182, #42584, #42585, + #42602, #42622, #42742 #42743, #43001, #43002. + + -- Matthias Klose Sun, 15 Aug 1999 10:31:50 +0200 + +gcc (2.95-3) unstable; urgency=high + + * Provide /lib/cpp again (fixes important bug #42524). + * Updated to cvs 19990805 gcc-2_95-branch. + * Build with the default scheduler. + * Apply install-multilib patch from Dan Jacobowitz. + * Apply revised cpp-A- patch from Dan Jacobowitz. + + -- Matthias Klose Fri, 6 Aug 1999 07:25:19 +0200 + +gcc (2.95-2) unstable; urgency=low + + * Remove /lib/cpp. This driver uses files from /usr/lib/gcc-lib anyway. + * The following bugs are fixed (compared to egcs-1.1.2). + Closes: #4429, #20889, #21122, #26369, #28417, #28261, #31416, #35261, + #35900, #35906, #38246, #38872, #39098, #39526, #40659, #40991, #41117, + #41290, #41302, #41313. + * The following by Joel Klecker: + - Adopt dpkg-architecture variables. + - Go back to SHELL = bash -e or it breaks where /bin/sh is not bash. + - Disabled the testsuite, it is not included in the gcc 2.95 release. + + -- Matthias Klose Sat, 31 Jul 1999 18:00:42 +0200 + +gcc (2.95-1) unstable; urgency=low + + * Update for official gcc-2.95 release. + * Built without gpc. + * debian/rules: Remove g++FAQ from rules, which is outdated. + For ix86, build for i386, not i486. + * Apply patch from Jim Pick for building multilib package on arm. + + -- Matthias Klose Sat, 31 Jul 1999 16:38:21 +0200 + +gcc (2.95-0pre10) unstable; urgency=low + + * Use ../builddir-gcc-$(VER) by default instead of ./builddir; upstream + strongly advises configuring outside of the source tree, and it makes + some things much easier. + * Add patch to prevent @local branches to weak symbols on powerpc (fixes + apt compilation). + * Add patch to make cpp -A- work as expected. + * Renamed debian/patches/ppc-library-prefix.dpatch to library-prefix.dpatch; + apply on all architectures. + * debian/control.in: Remove snapshot dependencies. + * debian/*.postinst: Reflect use of /usr/share/{info,man}. + + -- Daniel Jacobowitz Thu, 22 Jul 1999 19:27:12 -0400 + +gcc (2.95-0pre9) unstable; urgency=low + + * The following bugs are fixed (compared to egcs-1.1.2): #4429, #20889, + #21122, #26369, #28417, #28261, #35261, #38246, #38872, #39526, #40659, + #40991, #41117, #41290. + * Updated to CVS gcc-19990718 snapshot. + * debian/control.in: Removed references to egcs in descriptions. + Changed gcj's Recommends libgcj-dev to Depends. + * debian/rules: Apply ppc-library-prefix for alpha as well. + * debian/patches/arm-config.dpatch: Updated patch sent by Jim Pick. + + -- Matthias Klose Sun, 18 Jul 1999 12:21:07 +0200 + +gcc (2.95-0pre8) unstable; urgency=low + + * Updated CVS. + * debian/copyright: s%doc/copyright%share/common-licenses% + * debian/README.Bugs: s/egcs.cygnus.com/gcc.gnu.org/ s/egcs-bugs/gcc-bugs/ + * debian/patches/reporting.dpatch: Remake diff for current sources. + * debian/libstdc++-dev.postinst: It's /usr/share/info/iostream.info. + * debian/rules: Current dejagnu snapshot reports a framework version + of 1.3.1. + + -- Joel Klecker Sun, 18 Jul 1999 02:09:57 -0700 + +gcc-snapshot (19990714-0pre6) experimental; urgency=low + + * Updated to CVS gcc-19990714 snapshot. + * Applied ARM patch (#40515). + * Converted DOS style linefeeds in debian/patches/ppc-* files. + * debian/rules: Reflect change in gcc/version.c; use sh -e as shell: + for some obscure reason, bash -e doesn't work. + * Reflect version change for libstdc++ (2.10). Remove libg++-name + patch; libg++ now has version 2.8.1.3. Removed libc version from + the package name. + + -- Matthias Klose Wed, 14 Jul 1999 18:43:57 +0200 + +gcc-snapshot (19990625-0pre5.1) experimental; urgency=low + + * Non-maintainer upload. + * Added ARM specific patch. + + -- Jim Pick Tue, 29 Jun 1999 22:36:08 -0700 + +gcc-snapshot (19990625-0pre5) experimental; urgency=low + + * Updated to CVS gcc-19990625 snapshot. + + -- Matthias Klose Fri, 25 Jun 1999 16:11:53 +0200 + +gcc-snapshot (19990609-0pre4.1) experimental; urgency=low + + * Added and re-added a few last PPC patches. + + -- Daniel Jacobowitz Sat, 12 Jun 1999 16:48:01 -0500 + +gcc-snapshot (19990609-0pre4) experimental; urgency=low + + * Updated to CVS egcs-19990611 snapshot. + + -- Matthias Klose Fri, 11 Jun 1999 10:20:09 +0200 + +gcc-snapshot (19990609-0pre3) experimental; urgency=low + + * CVS gcc-19990609 snapshot. + * New gpc-19990607 snapshot. + + -- Matthias Klose Wed, 9 Jun 1999 19:40:44 +0200 + +gcc-snapshot (19990524-0pre1) experimental; urgency=low + + * egcs-19990524 snapshot. + * First snapshot of the gcc-2_95-branch. egcs-1.2 is renamed to gcc-2.95, + which is now the "official" successor to gcc-2.8.1. The full version + name is: gcc-2.95 19990521 (prerelease). + * debian/control.in: Changed maintainers to `Debian GCC maintainers'. + * Moved all version numbers to epoch 1. + * debian/rules: Major changes. The support for secondary compilers + was already removed for the egcs-1.2 snapshots. Many fixes by + Joel Klecker . + - Send mail to Debian maintainers for successful builds. + - Fix VER and VERNO sed expressions. + - Replace remaining GNUARCH occurrences. + * New gpc snapshot (but don't build). + * debian/patches/valarray.dpatch: Backport from libstdc++-v3. + * debian/gcc-doc.*: Info is now gcc.info* (Joel Klecker ). + * Use cpp driver provided by the package. + * New script c89 (fixes #28261). + + -- Matthias Klose Sat, 22 May 1999 16:10:36 +0200 + +egcs (1.1.2-2) unstable; urgency=low + + * Integrate NMU's for arm and sparc (fixes #37582, #36857). + * Apply patch for the Hurd (fixes #37753). + * Describe open bugs in TODO.Debian. Please have a look if you can help. + * Update README / math functions section (fixes #35906). + * Done by J.H.M. Dassen (Ray) : + - At Richard Braakman's request, made -dbg packages for libstdc++ + and libg++. + - Provide egcc(1) (fixes lintian error). + + -- Matthias Klose Sun, 16 May 1999 14:30:56 +0200 + +egcs-snapshot (19990502-1) experimental; urgency=low + + * New snapshot. + + -- Matthias Klose Thu, 6 May 1999 11:51:02 +0200 + +egcs-snapshot (19990418-2) experimental; urgency=low + + * Merged Rays changes to build debug packages. + + -- Matthias Klose Wed, 21 Apr 1999 16:54:56 +0200 + +egcs-snapshot (19990418-1) experimental; urgency=low + + * New snapshot. + * Disable cpplib. + + -- Matthias Klose Mon, 19 Apr 1999 11:32:19 +0200 + +egcs (1.1.2-1.2) unstable; urgency=low + + * NMU for arm + * Added arm-optimizer.dpatch with optimizer workaround for ARM + + -- Jim Pick Mon, 19 Apr 1999 06:17:13 -0700 + +egcs (1.1.2-1.1) unstable; urgency=low + + * NMU for sparc + * Included dpatch to modify the references to gcc/crtstuff.c so that + __register_frame_info is not a weak reference. This allows potato to + remain binary compatible with slink, while still retaining compatibility + with other sparc/egcs1.1.2 distributions. Diff in .dpatch format has + been sent to the maintainer with a note it may not be needed for 1.1.3. + + -- Ben Collins Tue, 27 Apr 1999 10:15:03 -0600 + +egcs (1.1.2-1) unstable; urgency=low + + * Final egcs-1.1.2 release built for potato as primary compiler + for all architectures except m68k. + + -- J.H.M. Dassen (Ray) Thu, 8 Apr 1999 13:14:29 +0200 + +egcs-snapshot (19990321-1) experimental; urgency=low + + * New snapshot. + * Disable gpc. + * debian/rules: Simplified (no secondary compiler, bumped all versions + to same epoch, libapi patch is included upstream). + * Separated out cpp documentation to cpp-doc package. + * Fixed in this version: #28417. + + -- Matthias Klose Tue, 23 Mar 1999 02:11:18 +0100 + +egcs (1.1.2-0slink2) stable; urgency=low + + * Applied H.J.Lu's egcs-19990315.linux patch. + * Install faq.html and egcs-1.1.2 announcment. + + -- Matthias Klose Tue, 23 Mar 1999 01:14:54 +0100 + +egcs (1.1.2-0slink1) stable; urgency=low + + * Final egcs-1.1.2 release; compiled with glibc-2.0 for slink on i386. + * debian/control.in: gcc provides egcc, when FIRST_PRIMARY defined. + * Fixes #30767, #32278, #34252, #34352. + * Don't build the libstdc++.so.2.9 library on architectures, which have + switched to glibc-2.1. + + -- Matthias Klose Wed, 17 Mar 1999 12:55:59 +0100 + +egcs (1.1.1.63-2.2) unstable; urgency=low + + * Non-maintainer upload. + * Incorporate patch from Joel Klecker to fix snapshot packages + by moving/removing the application of libapi. + * Disable the new libstdc++-dev-config and the postinst message in + glibc 2.1 versions. + + -- Daniel Jacobowitz Mon, 12 Mar 1999 14:16:02 -0500 + +egcs (1.1.1.63-2.1) unstable; urgency=low + + * Non-maintainer upload. + * Compile with glibc 2.1 release version. + * New upstream version egcs-1.1.2 pre3. + * Miscellaneous rules updates (see changelog.snapshot). + * New set of powerpc-related patches from Franz Sirl, + . + * Disable libgcc.dpatch (new solution implemented upstream). Remove it. + * Also pass $target to config.if. + * Enable Dwarf2 EH for powerpc. Bump the C++ binary version. No + loss in -backwards- compatibility as far as I can tell, so add a + compatibility symlink, and add to shlibs file. + * Add --no-backup-if-mismatch to the debian/patches/*.dpatch files, + to prevent bogus .orig's in diffs. + * Merged with (unreleased) 1.1.1.62-1 and 1.1.1.63-{1,2} packages from + Matthias Klose . + * Stop adding a backwards compatibility link for egcs-nof on powerpc. + To my knowledge, nothing uses it. Do add the libstdc++ API change + link, though. + + -- Daniel Jacobowitz Mon, 8 Mar 1999 14:24:01 -0500 + +egcs (1.1.1.63-2) stable; urgency=low + + * Provide a libstdc++ with a shared object name, which is compatible + to other distributions. Documented the change in README.Debian, + the libstdc++-2.9.postinst and the libstdc++-dev-config script. + + -- Matthias Klose Fri, 12 Mar 1999 00:36:20 +0100 + +egcs (1.1.1.63-1.1) unstable; urgency=low + + * Non-Maintainer release. + * Build against glibc 2.1. + * Make egcs the primary compiler on i386. + * Also confilct with egcc (<< FIRST_PRIMARY) + if FIRST_PRIMARY is defined. + (this tells dpkg that gcc completely obsoletes egcc) + * Remove hjl-12 patch again, HJL says it should not be + necessary with egcs 1.1.2. + (as per forwarded reply from Christopher Chimelis) + * Apply libapi patch in clean target before regenerating debian/control + and remove the patch afterward. Otherwise, the libstdc++ and libg++ + package names are generated wrong on a glibc 2.1 system. + + -- Joel Klecker Tue, 9 Mar 1999 15:31:02 -0800 + +egcs (1.1.1.63-1) unstable; urgency=low + + * New upstream version egcs-1.1.1-pre3. + * Applied improved libstdc++ warning patch from Rob Browning. + + -- Matthias Klose Tue, 9 Mar 1999 16:14:07 +0100 + +egcs (1.1.1.62-1) unstable; urgency=low + + * New upstream version egcs-1.1.1-pre2. + * New upstream version libg++-2.8.1.3. + * Readded ARM support + * Readded hjl-12 per request from Christopher C Chimelis + + + -- Matthias Klose Fri, 26 Feb 1999 09:54:01 +0100 + +egcs-snapshot (19990224-0.1) experimental; urgency=low + + * New snapshot. + * Add the ability to disable CPPLIB by setting CPPLIB=no in + the environment. + * Disable gpc for powerpc; I spent a long time getting it to + make correctly, and then it goes and ICEs. + + -- Daniel Jacobowitz Tue, 24 Feb 1999 23:34:12 -0500 + +egcs (1.1.1.61-1) unstable; urgency=low + + * New upstream version egcs-1.1.1-pre1. + * debian/control.in: Applied patch from bug report #32987. + * Split up H.J.Lu's hjl-19990115-linux patch into several small + chunks: libapi, arm-mips, libgcc, hjl-other. The changelog.Linux + aren't included in the separate chunks. Please refer to the + unmodified hjl-19990115-linux patch file in the egcs source pkg. + * Apply warning patch to fix the annoying spew you get if you try to + use ropes or deques with -Wall (which makes -Wall mostly useless for + spotting errors in your own code). Fixes #32996. + * debian/rules: Unapply patches in the exact reverse order they were + applied. + + -- Matthias Klose Sat, 20 Feb 1999 22:06:21 +0100 + +egcs (1.1.1-5) frozen unstable; urgency=medium + + * Move libgcc.map file to g++ package, where gcc is the secondary + compiler (fixes #32329, #32605, #32631). + * Prepare to rename libstdc++2.9 package for glibc-2.1 (fixes #32148). + * Apply NMU patch for arm architecure (fixes #32367). + * Don't apply hjl-12 patch for alpha architectures (requested by the + alpha developers, Christopher C Chimelis ). + * Call makeinfo with --no-validate to fix obscure build failure on alpha. + * Build gpc info files in doc subdirectory. + * Remove c++filt diversion (C++ name demangling patch is now in binutils, + fixes #30820 and #32502). + + -- Matthias Klose Sun, 31 Jan 1999 23:19:35 +0100 + +egcs (1.1.1-4.1) unstable; urgency=low + + * Non-maintainer upload. + * Pascal doesn't build for ARM. + + -- Jim Pick Sun, 24 Jan 1999 16:13:34 -0800 + +egcs (1.1.1-4) frozen unstable; urgency=high + + * Don't strip compiler libraries libgcc.a libobjc.a libg2c.a libgpc.a + * Move Pascal examples to the right place (fixes #32149, part 1). + * Add dependencies for switching from secondary to primary compiler, + if FIRST_PRIMARY is defined (fixes #32149, part 2). + + -- Matthias Klose Wed, 20 Jan 1999 16:51:30 +0100 + +egcs (1.1.1-3) frozen unstable; urgency=low + + * Updated with the H.J.Lu's hjl-19990115-linux patch (fixes the + __register_frame_info problems, mips and arm port included). + * Update gpc to 19990118 (beta release candidate). + * Strip static libraries (fixes #31247 and #31248). + * Changed maintainer address. + + -- Matthias Klose Tue, 19 Jan 1999 16:34:28 +0100 + +egcs (1.1.1-2) frozen unstable; urgency=low + + * Moved egcs-docs, g77-doc and gpc-doc packages to doc section. + * Downgraded Recommends: egcs-docs to Suggests: egcs-docs dependencies + (for archs, where egcs is the primary compiler). + * Add 'Suggests: stl-manual' dependency to libstdc++2.9-dev. + * Applied one more alpha patch: + ftp://ftp.yggdrasil.com/private/hjl/egcs/1.1.1/egcs-1.1.1.diff.12.gz + * Applied PPro optimization patch. + * Apply emit-rtl-nan patch. + * Upgraded to libg++-2.8.1.2a-19981218.tar.gz. + * Upgraded to gpc-19981218. + * Make symlinks for gobjc, libstdc++2.9-dev and libg++2.8.2 doc directories. + + -- Matthias Klose Wed, 23 Dec 1998 18:04:53 +0200 + +egcs-snapshot (19981211-1) experimental; urgency=low + + * New snapshot. + * Adapted gpc to egcs-2.92.x (BOOT_CFLAGS must include -g). + * New libg++-2.8.1.2a-19981209.tar.gz. + * debian/rules: new target mail-summary. + + -- Matthias Klose Fri, 11 Dec 1998 18:14:53 +0200 + +egcs (1.1.1-1) frozen unstable; urgency=high + + * Final egcs-1.1.1 release. + * The last version depended on a versioned libc6 again. + * Add lost dependency for libg++ on libstdc++. + * Added debian-libstdc++.sh script to generate a libstdc++ on a Linux + system, which doesn't use the libapi patch. + + -- Matthias Klose Wed, 2 Dec 1998 12:06:15 +0200 + +egcs (1.1.0.91.59-2) frozen unstable; urgency=high + + * Fixes bugs from libc6 2.0.7u-6 upload without dependency line + Conflicts: libstdc++-2.9 (<< 2.91.59): #30019, #30066, #30078. + * debian/copyright: Updated URLs. + * gcc --help now mentions /usr/doc/debian/bug-reporting.txt. + * Install README.Debian and include information about patches applied. + * Depend on unversioned libc6 on i386, such that libstdc++2.9 can be used + on a hamm system. + + -- Matthias Klose Fri, 27 Nov 1998 18:32:02 +0200 + +egcs (1.1.0.91.59-1) frozen unstable; urgency=low + + * This is egcs-1.1.1 prerelease #3, compiled with libc6 2.0.7u-6. + * Added dependency for libstdc++2.9-dev on g++ (fixes #29631). + * Package g77 provides f77 (fixes #29817). + * Already fixed in earlier egcs-1.1 releases: #2493, #25271, #10620. + * Bugs reported for gcc-2.7.x and fixed in the egcs version of gcc: + #2493, #4430, #4954, #5367, #6047, #10612, #12375, #20606, #24788, #26100. + * Upgraded libg++ to libg++-2.8.1.2a-19981114. + * Upgraded gpc to gpc-19981124. + * Close #25869: egcs and splay maintainers are unable to reproduce this + bug with the current Debian packages. Bug submitter doesn't respond. + * Close #25407: egcs maintainer cannot reproduce this bug with the current + Debian compiler. Bug submitter doesn't respond. + * Use debhelper 1.2.7 for building. + * Replace the libstdc++ and libg++ compatibility links with fake libraries. + + -- Matthias Klose Wed, 25 Nov 1998 12:11:42 +0200 + +egcs (1.1.0.91.58-5) frozen unstable; urgency=low + + * Applied patch to build on the m68060. + * Added c++filt and c++filt.1 to the g++ package. + * Updated gpc to gpc-981105; fixes some regressions compared to egcs-1.1. + * Separated out g77 and gpc doumentation to new packages g77-doc and gpc-doc. + * Closed bugs (#22158). + * Close #20248; on platforms where gas and gld are the default versions, + it makes no difference to configure with or without enable-ld. + * Close #24349. The bugs are in the amulet source. + See http://www.cs.cmu.edu/afs/cs/project/amulet/www/FAQ.html#GCC28x + * Rename gcc.info* files to egcs.info* (fixes #24088). + * Documented known bugs (and workarounds) in BUGS.Debian. + * Fixed demangling of C++ names (fixes #28787). + * Applied patch form aspell to libstdc++/stl/stl_rope.h. + * Updated from cvs 16 Nov 1998. + + -- Matthias Klose Tue, 17 Nov 1998 09:41:24 +0200 + +egcs-snapshot (19981115-2) experimental; urgency=low + + * New snapshot. Disabled gpc. + * New packages g77-doc and gpc-doc. + + -- Matthias Klose Mon, 16 Nov 1998 12:48:09 +0200 + +egcs (1.1.0.91.58-3) frozen unstable; urgency=low + + * Previous version installed in potato, not slink. + * Updated from cvs 3 Nov 1998. + + -- Matthias Klose Tue, 3 Nov 1998 18:34:44 +0200 + +egcs (1.1.0.91.58-2) unstable; urgency=low + + * [debian/rules]: added targets to apply and unapply patches. + * [debian/README.patches]: New file. + * Moved patches dir to debian/patches. debian/rules has to select + the patches to apply. + * Manual pages for genclass and gcov (fixes #5995, #20950, #22196). + * Apply egcs-1.1-reload patch needed for powerpc architecture. + * Fixed bugs (#17768, #20252, #25508, #27788). + * Reapplied alpha patch (#20875). + * Fixes first part of #22513, extended README.Debian (combining C & C++). + * Already fixed in earlier egcs-1.1 releases: #17963, #20252, #20524, + #20640, #22450, #24244, #24288, #28520. + + -- Matthias Klose Fri, 30 Oct 1998 13:41:45 +0200 + +egcs (1.1.0.91.58-1) experimental; urgency=low + + * New upstream version. That's the egcs-1.1.1 prerelease plus patches from + the cvs archive upto 29 Oct 1998. + * Merged files from the egcs and snapshot packages. + * Updated libg++ to libg++-2.8.1.2 (although the Debian package name is still + 2.8.2). + * Moved patches dir to patches-1.1. + * Dan Jacobowitz: + * This is a snapshot from the egcs_1_1_branch, with + libapi, reload, builtin-apply, and egcs patches from + the debian/patches/ dir applied, along with the egcs-gpc-patches + and gcc/p/diffs/gcc-egcs-2.91.55.diff. + * Conditionalize gcj and chill (since they aren't in this branch). + * Fake snapshots drop the -snap-main. + + -- Matthias Klose Thu, 29 Oct 1998 15:15:19 +0200 + +egcs-snapshot (1.1-19981019-5.1) experimental; urgency=low + + * This is a snapshot from the egcs_1_1_branch, with + libapi, reload, builtin-apply, and egcs patches from + the debian/patches/ dir applied, along with the egcs-gpc-patches + and gcc/p/diffs/gcc-egcs-2.91.55.diff. + * Conditionalize gcj and chill (since they aren't in this + branch). + * Fake snapshots drop the -snap-main. + + -- Daniel Jacobowitz Mon, 19 Oct 1998 22:19:23 -0400 + +egcs (1.1b-5) unstable; urgency=low + + * [debian/control.in] Fixed typo in dependencies (#28076, #28087, #28092). + + -- J.H.M. Dassen (Ray) Sun, 18 Oct 1998 22:56:51 +0200 + +egcs (1.1b-4) unstable; urgency=low + + * Strengthened g++ dependency on libstdc++_LIB_SO_-dev from + `Recommends' to `Depends'. + * Updated README.Debian for egcs-1.1. + * Updated TODO. + + -- Matthias Klose Thu, 15 Oct 1998 12:38:47 +0200 + +egcs-snapshot (19981005-0.1) experimental; urgency=low + + * Make libstdc++2.9-snap-main and libg++-snap-main provide + their mainstream equivalents and put those equivalents into + their shlibs file. + * Package gcj, the GNU Compiler for Java(TM). + + * New upstream version of egcs (The -regcs_latest_snapshot branch). + * Build without libg++ entirely. + * Leave out gpc for now - the internals are sufficiently different + that it does not trivially compile. + * Include an experimental reload patch for powerpc - this is, + in the words of its author, not release quality, but it allows + powerpc linuxthreads to function. + * On architectures where we are the primary compiler, let snapshots + build with --prefix=/usr and conflict with the stable versions. + * Package chill, a front end for the language Chill. + * Other applied patches from debian/patches/: egcs-patches and + builtin-apply-patch. + * Use reload.c revision 1.43 to avoid a nasty bug. + + -- Daniel Jacobowitz Wed, 7 Oct 1998 00:27:42 -0400 + +egcs (1.1b-3.1) unstable; urgency=low + + * NMU to fix the egcc -> gcc link once and for all + + -- Christopher C. Chimelis Tue, 22 Sep 1998 16:11:19 -0500 + +egcs (1.1b-3) unstable; urgency=low + + * Oops. The egcc -> gcc link on archs where gcc is egcc was broken. + Thanks to Chris Chimelis for pointing this out. + + -- J.H.M. Dassen (Ray) Mon, 21 Sep 1998 20:51:35 +0200 + +egcs (1.1b-2) unstable; urgency=low + + * New upstream spellfix release (Debian revision is 2 as the internal + version numbers didn't change). + * Added egcc -> gcc symlink on architectures where egcc is the primary C + compiler. Thus, maintainers of packages that require egcc, can now + simply use "egcc" without conditionals. + * Porters: we hope/plan to make egcs's gcc the default C compiler on all + platforms once the 2.2.x kernels are available. Please test this version + thoroughly, and give us a GO / NO GO for your architecture. + * Some symbols cpp used to predefine were removed upstream in order to clean + up the cpp namespace, but imake requires them for determining the proper + settings for LinuxMachineDefines (see /usr/X11R6/lib/X11/{Imake,linux}.cf), + thus we put them back. Thanks to Paul Slootman for reporting his imake + problems on Alpha. + * [gcc/config/alpha/linux.h] Added -D__alpha to CPP_PREDEFINES . + Thanks to Chris Chimelis for the alpha-only 1.1a-1.1 NMU which fixed + this already. + * [gcc/config/i386/linux.h] Added -D__i386__ to CPP_PREDEFINES . + * [gcc/config/sparc/linux.h] Has -Dsparc in CPP_PREDEFINES . + * [gcc/config/sparc/linux64.h] Has -Dsparc in CPP_PREDEFINES . + * [gcc/config/m68k/linux.h] Has -Dmc68000 in CPP_PREDEFINES . + * [gcc/config/rs6000/linux.h] Has -Dpowerpc in CPP_PREDEFINES . + * [gcc/config/arm/linux.h] Has -Darm in CPP_PREDEFINES . + * [gcc/config/i386/gnu.h] Has -Di386 in CPP_PREDEFINES . + * Small fixes and updates in README. + * Changes affecting the source package only: + * [gcc/Makefile.in, gcc/cp/Make-lang.in, gcc/p/Make-lang.in] + Daniel Jacobowitz: Ugly hacks of various kinds to make cplib2.txt get + properly regenerated with multilib. + * [debian/TODO] Created. + * [INSTALL/index.html] Fixed broken link. + + -- J.H.M. Dassen (Ray) Sun, 20 Sep 1998 14:05:15 +0200 + +egcs (1.1a-1) unstable; urgency=low + + * New upstream release. + * Added README.libstdc++ . + * Updated Standards-Version. + * Matthias: + * Downgraded gobjc dependency on egcs-docs from Recommends: to Suggests: . + * [libg++/Makefile.in] Patched not to rely on a `-f' flag of `ln'. + + -- J.H.M. Dassen (Ray) Wed, 2 Sep 1998 19:57:43 +0200 + +egcs (1.1-1) unstable; urgency=low + + * egcs-1.1 prerelease (from the last Debian package only the version file + changed). + * "Final" gpc Beta 2.1 gpc-19980830. + * Included libg++ and gpc in the .orig tarball. so that diffs are getting + smaller. + * debian/control.in: Changed maintainer address to galenh-egcs@debian.org. + * debian/copyright: Updated URLs. + + -- Matthias Klose Mon, 31 Aug 1998 12:43:13 +0200 + +egcs (1.0.99.56-0.1) unstable; urgency=low + + * New upstream snapshot 19980830 from CVS (called egcs-1.1 19980830). + * New libg++ snapshot 980828. + * Put all patches patches subdirectory; see patches/README in the source. + * debian/control.in: readded for libg++2.8.2-dev: + Replaces: libstdc++2.8-dev (<= 2.90.29-0.5) + * Renamed libg++2.9 package to libg++2.8.2. + * gcc/p/gpc-decl.c: Fix from Peter@Gerwinski.de; fixes optimization errors. + * patches/gpc-patch2: Fix from Peter@Gerwinski.de; fixes alpha errors. + * debian/rules: New configuration flag for building with and without + libstdc++api patch; untested without ... + + -- Matthias Klose Sun, 30 Aug 1998 12:04:22 +0200 + +egcs (1.0.99-0.6) unstable; urgency=low + + * PowerPC fixes. + * On powerpc, generate the -msoft-float libs and package them + as egcs-nof. + * Fix signed char error in gpc. + * Create a libg++.so.2.9 compatibility symlink. + + -- Daniel Jacobowitz Tue, 25 Aug 1998 11:44:09 -0400 + +egcs (1.0.99-0.5) unstable; urgency=low + + * New upstream snapshot 19980824. + * New gpc snapshot gpc-980822; reenabled gpc for alpha. + + -- Matthias Klose Tue, 25 Aug 1998 01:21:08 +0200 + +egcs (1.0.99-0.4) unstable; urgency=low + + * New upstream snapshot 19980819. Should build glibc 2.0.9x on PPC. + + -- Matthias Klose Wed, 19 Aug 1998 14:18:07 +0200 + +egcs (1.0.99-0.3) unstable; urgency=low + + * New upstream snapshot 19980816. + * debian/rules: build correct debian/control and debian/*.shlibs + * Enabled Haifa scheduler for ix86. + + -- Matthias Klose Mon, 17 Aug 1998 16:29:35 +0200 + +egcs (1.0.99-0.2) unstable; urgency=low + + * New upstream snapshot: egcs-19980812, minor changes only. + * Fixes for building on `primary' targets. + * Disabled gpc on `alpha' architecture. + * Uses debhelper 1.1.6 + * debian/control.in: Replace older snapshot versions in favor of newer + normal versions. + * debian/rules: Fixes building of binary-arch target only. + + -- Matthias Klose Thu, 13 Aug 1998 11:59:41 +0200 + +egcs (1.0.99-0.1) unstable; urgency=low + + * New upstream version: pre egcs-1.1 version. + * Many changes ... for details see debian/changelog.snapshot in the + source package. + * New packages libstdc++2.9 and libstdc++2.9-dev. + * New libg++ snapshot 980731: new packages libg++2.9 and libg++2.9-dev. + * New gpc snapshot gpc-980729: new package gpc. + * Uses debhelper 1.1 + + -- Matthias Klose Mon, 10 Aug 1998 13:00:27 +0200 + +egcs-snapshot (19980803-4) experimental; urgency=low + + * rebuilt debian/control. + + -- Matthias Klose Wed, 5 Aug 1998 08:51:47 +0200 + +egcs-snapshot (19980803-3) experimental; urgency=low + + * debian/rules: fix installation locations of NEWS, header and + `undocumented' files. + * man pages aren't compressed for the snapshot package. + + -- Matthias Klose Tue, 4 Aug 1998 17:34:31 +0200 + +egcs-snapshot (19980803-2) experimental; urgency=low + + * debian/rules: Uses debhelper. Old in debian/rules.old. + renamed postinst, prerm files for use with debhelper. + * debian/{libg++2.9,libstdc++2.9}/postinst: call ldconfig only, + when called for configure. + * egcs-docs is architecture independent package. + * new libg++ snapshot 980731. + * installed libstdc++ api patch (still buggy). + + -- Matthias Klose Mon, 3 Aug 1998 13:20:59 +0200 + +egcs-snapshot (19980729-1) experimental; urgency=low + + * New snapshot version 19980729 from CVS archive. + * New gpc snapshot gpc-980729. + * Let gcc/configure decide about using the Haifa scheduler. + * Remove -DDEBIAN. That was needed for the security improvements with + regard to the /tmp problem. egcs-1.1 chooses another approach. + * Save test-protocol and extract gpc errors to gpc-test-summary. + * Tighten binutils dependency to 2.9.1. + * debian/rules: new build-info target + * debian/{control.in,rules}: _SO_ and BINUTILSV substitution. + * debian/rules: add dependency for debian/control. + * debian/rules: remove bin/c++filt + * TODO: next version will use debhelper; the unorganized moving of + files becomes unmanageable ... + * TODO: g++ headers in stdc++ package? check! + + -- Matthias Klose Thu, 30 Jul 1998 12:10:20 +0200 + +egcs-snapshot (19980721-1) experimental; urgency=low + + * Unreleased. Infinite loops in executables made by gpc. + + -- Matthias Klose Wed, 22 Jul 1998 18:07:20 +0200 + +egcs-snapshot (19980715-1) experimental; urgency=low + + * New snapshot version from CVS archive. + * New gpc snapshot gpc-980715. + * New libg++ version libg++-2.8.2-980708. Changed versioning + schema for library. The major versions of libc, libstdc++ and the + g++ interface are coded in the library name. Use this new schema, + but provide a symlink to our previous schema, since the library + seems to be binary compatible. + * [debian/rules]: Fixed bug in build target, when bootstrap returns + with an error + + -- Matthias Klose Wed, 15 Jul 1998 10:55:05 +0200 + +egcs-snapshot (19980701-1) experimental; urgency=low + + * New snapshot version from CVS archive. + Two check programs in libg++ had to be manually killed to finish the + testsuite (tBag and tSet). + * New gpc snapshot gpc-980629. + * Incorporated debian/rules changes from egcs-1.0.3a-0.5 (but don't remove + gcc/cp/parse.c gcc/c-parse.c gcc/c-parse.y gcc/objc/objc-parse.c + gcc/objc/objc-parse.y, since these files are part of the release). + * Disable the -DMKTEMP_EACH_FILE -DHAVE_MKSTEMP -DDEBIAN flags for the + snapshot. egcs-1.1 will have another solution. + * Don't bootstrap the snapshot with -fno-force-mem. Internal compiler + error :-( + * libf2c.a and f2c.h have changed names to libg2c.a and g2c.h and + have moved again into the gcc-lib dir. They are installed under + libg2c.a and g2c.h. Is it necessary to provide links f2c -> g2c ? + * debian/rules: reflect change of build dir of libraries. + + -- Matthias Klose Wed, 2 Jul 1998 13:15:28 +0200 + +egcs-snapshot (19980628-0.1) experimental; urgency=low + + * New upstream snapshot version. + * Non-maintainer upload; Matthias appears to be absent currently. + * Updated shlibs. + * Merged changes from regular egcs: + * [debian/control] Tightened dependency on binutils to 2.8.1.0.23 or + newer, as according to INSTALL/SPECIFIC PowerPC (and possibly Sparc) + need this. + * [debian/rules] Clean up some generated files outside builddir, + so the .diff.gz becomes smaller. + * [debian/rules] Partial sync/update with the one for the regular egcs + version. + * [debian/rules] Make gcc/p/configure executable. + + -- J.H.M. Dassen (Ray) Wed, 1 Jul 1998 07:12:15 +0200 + +egcs (1.0.3a-0.6) frozen unstable; urgency=low + + * Some libg++ development files were in libstdc++2.8-dev rather than + libg++2.8-dev. Fixed this and dealt with upgrading from the earlier + versions (fixes #23908; this bug is not marked release-critical, but + is annoying and can be quite confusing for users. Therefore, I think + this fix should go in 2.0). + + -- J.H.M. Dassen (Ray) Tue, 30 Jun 1998 11:10:14 +0200 + +egcs (1.0.3a-0.5) frozen unstable; urgency=low + + * Fixed location of .hP files (Fixes #23448). + * [debian/rules] simplified extraction of the files for libg++2.8-dev. + + -- J.H.M. Dassen (Ray) Wed, 17 Jun 1998 09:33:41 +0200 + +egcs (1.0.3a-0.4) frozen unstable; urgency=low + + * [gcc/gcc.c] There is one call to choose_temp_base for determining the + tempdir to be used only; #ifdef HAVE_MKSTEMP delete the tempfile created + as a side effect. (fixes #23123 for egcs). + * [gcc/collect2.c] There's still a vulnerability here; I don't see how + I can fix it without leaving behind tempfiles though. + * [debian/control] Tightened dependency on binutils to 2.8.1.0.23 or + newer, as according to INSTALL/SPECIFIC PowerPC (and possibly Sparc) + need this. + * [debian/rules] Clean up some generated files outside builddir, so the + .diff.gz becomes smaller. + + -- J.H.M. Dassen (Ray) Sat, 13 Jun 1998 09:06:52 +0200 + +egcs-snapshot (19980608-1) experimental; urgency=low + + * New snapshot version. + + -- Matthias Klose Tue, 9 Jun 1998 14:07:44 +0200 + +egcs (1.0.3a-0.3) frozen unstable; urgency=high (security fixes) + + * [gcc/toplev.c] set flag_force_mem to 1 at optimisation level 3 or higher. + This works around #17768 which is considered release-critical. + * Changes by Matthias: + * [debian/README] Documentation of the compiler situation for Objective C. + * [debian/rules, debian/control.*] Generate control file from a master + file. + * [debian/rules] Updates for Pascal and Fortran parts; brings it in sync + with the one for the egcs snapshots. + * Use the recommended settings LDFLAGS=-s CFLAGS= BOOT_CFLAGS='-O2'. + * Really compile -DMKTEMP_EACH_FILE -DHAVE_MKSTEMP (really fixes #19453 + for egcs). + * [gcc/gcc.c] A couple of temp files weren't marked for deletion. + + -- J.H.M. Dassen (Ray) Sun, 31 May 1998 22:56:22 +0200 + +egcs (1.0.3a-0.2) frozen unstable; urgency=high (security fixes) + + * Security improvements with regard to the /tmp problem + (gcc opens predictably named files in TMPDIR which can be abused via + symlinks) (Fixes #19453 for egcs). + * Compile -DMKTEMP_EACH_FILE to ensure the %u name is generated randomly + every time; affects gcc/gcc.c . + * [gcc/choose-temp.c, libiberty/choose-temp.c]: use mktemp(3) if compiled + -DUSE_MKSTEMP . + * Security improvements: don't use the result of choose_temp_base in a + predictable fashion. + [gcc/gcc.c]: + * @c, @objective-c: use random name rather then tempbasename.i for + intermediate preprocessor output (%g.i -> %d%u). + * @c, @objective-c: use random name rather then tempbasename.s for + intermediate compiler output (%g.s -> %d%u). + * @c, @objective-c, @cpp-output, @assembler-with-cpp: switched + "as [-o output file] " to + "as [-o output file]". + * @c, @objective-c, @assembler-with-cpp: use previous random name + (cc1|cpp output) rather then tempbasename.s for intermediate assembler + input (%g.s -> %U) + [gcc/f/lang-specs.h]: + * @f77-cpp-input: use random name rather then tempbasename.i for + intermediate cpp output (%g.i -> %d%u). + * @f77-cpp-input: use previous random name (cpp output) rather than + tempbasename.i for f771 input (%g.i -> %U). + * @f77-cpp-input: switched + "as [-o output file] " to + "as [-o output file]". + * @f77-cpp-input: use random name rather then tempbasename.s for + intermediate compiler output (%g.s -> %d%u). + * @ratfor: use random name rather then tempbasename.i for + intermediate ratfor output (%g.f -> %d%u). + * @ratfor: use previous random name (ratfor output) rather than + tempbasename.i for f771 input (%g.f -> %U). + * @ratfor: use random name rather then tempbasename.s for + intermediate compiler output (%g.s -> %d%u). + * @ratfor: switched + "as [-o output file] " to + "as [-o output file]". + * @ratfor: use previous random name + (ratfor output) rather then tempbasename.s for intermediate assembler + input (%g.s -> %U). + * @f77: use random name rather then tempbasename.s for + intermediate ratfor output (%g.f -> %d%u). + * @ratfor: use previous random name (ratfor output) rather than + tempbasename.i for f771 input (%g.f -> %U). + * @ratfor: use random name rather then tempbasename.s for + intermediate compiler output (%g.s -> %d%u). + * @ratfor: switched + "as [-o output file] " to + "as [-o output file]". + * @ratfor: use previous random name + (ratfor output) rather then tempbasename.s for intermediate assembler + input (%g.s -> %U). + * @f77: use random name rather then tempbasename.s for + intermediate compiler output (%g.s -> %d%u). + * @f77: switched + "as [-o output file] " to + "as [-o output file]". + * @ratfor: use random name rather then tempbasename.s for + intermediate compiler output (%g.s -> %U). + * Run the testsuite (this requires the dejagnu package in experimental; + unfortunately, it is difficult to distinguish this version from the one + in frozen). + if possible, and log the results in warn_summary and bootstrap-summary. + * [gcc/choose-temp.c, libiberty/choose-temp.c]: s|returh|return| in + comment. + * Added notes on the Debian compiler setup [debian/README] to the + development packages. + * Matthias: + * [libg++/etc/lf/Makefile.in] Replaced "-ltermcap" by "-lncurses". + * [debian/rules] Updated so it can be used for both egcs releases and + snapshots easily; added support for the GNU Pascal Compiler gpc. + * [contrib/test_summary, contrib/warn_summary] Added from CVS. + * Run compiler checks and include results in /usr/doc/. + * Updates to the README. + * [debian/rules] Use assignments to speed up startup. + * [debian/rules] Show the important variables at the start of the build + process. + * [debian/control.secondary] Added a dependency of gobjc on egcc on + architectures where egcs provides the secondary compiler, as + /usr/bin/egcc is the compiler driver for gobjc. (Fixes #22829). + * [debian/control.*] Bumped Standards-Version; used shorter version + numbers in the dependency relationships (esthetic difference only); + fixed typo. + + -- J.H.M. Dassen (Ray) Tue, 26 May 1998 21:47:41 +0200 + +egcs-snapshot (19980525-1) experimental; urgency=low + + * New snapshot version. + + -- Matthias Klose Tue, 26 May 1998 18:04:06 +0200 + +egcs-snapshot (19980517-1) experimental; urgency=low + + * "Initial" release of the egcs-snapshot package; many debian/* files + derived from the egcs-1.0.3a-0.1 package (maintained by Galen Hazelwood + , NMU's by J.H.M. Dassen (Ray) ) + * The egcs-snapshot packages can coexist with the packages of the + egcs release. Package names have a '-ss' appended. + * All packages are installed in a separate tree (/usr/lib/egcs-ss following + the FHSS). + * Made all snapshot packages extra, all snapshot packages conflict + with correspondent egcs packages, which are newer than the snapshot. + * Included libg++-2.8.1-980505. + * Included GNU Pascal (gpc-980511). + * Haifa scheduler enabled for all snapshot packages. + * Run compiler checks and include results in /usr/doc/. + * Further information in /usr/doc//README.snapshot. + + -- Matthias Klose Wed, 20 May 1998 11:14:06 +0200 + +egcs (1.0.3a-0.1) frozen unstable; urgency=low + + * New upstream release egcs-2.90.29 980515 (egcs-1.0.3 release) + (we were using 1.0.3-prerelease). This includes the Haifa patches + we had since 1.0.3-0.2 and the gcc/objc/thr-posix.c patch we had + since 1.0.3-0.1; the differences with 1.0.3-prerelease + patches + we had is negligable. + * iostream info documentation was in the wrong package (libg++2.8-dev). + Now it's in libstdc++2.8-dev. (Thanks to Jens Rosenboom for bringing + this to my attention). As 1.0.3-0.3 didn't make it out of Incoming, + I'm not adding "Replaces:" for this; folks who had 1.0.3-0.3 installed + already know enough to use --force-overwrite. + * [gcc/objc/objc-act.c] Applied patch Matthias Klose supplied me with that + demangles Objective C method names in gcc error messages. + * Explicitly disable Haifa scheduling on Alpha, to make it easier to use + this package's diff with egcs snapshots, which may turn on Haifa + scheduling even though it is still unstable. (Requested by Chris Chimelis) + * Don't run "configure" again if builddir already exists (makes it faster + to restart builds in case one is hacking internals). Requested by + Johnnie Ingram. + * [gcc/gbl-ctors.h] Don't use extern declaration for atexit on glibc 2.1 + and higher (the prototype has probably changed; having the declaration + broke Sparc compiles). + * [debian/rules] Determine all version number automatically (from the + version string in gcc/version.c). + * [debian/copyright] Updated FTP locations; added text about libg++ (fixes + #22465). + + -- J.H.M. Dassen (Ray) Sat, 16 May 1998 17:41:44 +0200 + +egcs (1.0.3-0.3) frozen unstable; urgency=low + + * Made an "egcs-doc" package containing documentation for egcs (e)gcc, + g++, gobjc, so that administrators can choose whether to have this + documenation or the documentation that comes with the GNU gcc package. + Dependency on this is Recommends: on architectures where egcs provides + the primary C compiler; Suggests: on the others (where GNU gcc is still + the primary C compiler). + * Use the g++ FAQ from gcc/cp rather than libg++, as that version is more + up to date. + * Added iostream info documentation to libstdc++2.8-dev. + + -- J.H.M. Dassen (Ray) Wed, 13 May 1998 08:46:10 +0200 + +egcs (1.0.3-0.2) frozen unstable; urgency=low + + * Added libg++ that works with egcs, found at + ftp://ftp.yggdrasil.com/private/hjl/libg++-2.8.1-980505.tar.gz + (fixes #20587 (Severity: important)). + * The "libg++" and "libg++-dev" virtual packages now refer to the GNU + extensions. + * Added the g++ FAQ that comes with libg++ to the g++ package. + * libg++/Makefile.in: added $(srcdir) to rule for g++FAQ.info so that it + builds OK in builddir. + * Added -D__i386__ to the cpp predefines on intel. + * Patches Matthias supplied me with: + * Further 1.0.3 prerelease patches from CVS. + This includes patches to the Haifa scheduler. Alpha porters, please + check if this makes the Haifa scheduler OK again. + * Objective C patches from CVS. + + -- J.H.M. Dassen (Ray) Fri, 8 May 1998 14:43:20 +0200 + +egcs (1.0.3-0.1) frozen unstable; urgency=low (high for maintainers that use objc) + + * bug fixes only in new upstream version + * Applied patches from egcs CVS archive (egcs_1_03_prerelease) + (see gcc/ChangeLog in the egcs source package). + * libstdc++2.8-dev no longer Provides: libg++-dev (fixes #21153). + * libstdc++2.8-dev now Conflicts: libg++27-dev (bo), + libg++272-dev (hamm) [regular packages] rather than + Conflicts: libg++-dev [virtual package] to prepare the way for "libg++" + to be used as a virtual package for a new libg++ package (i.e. an up to + date one, which not longer contains libstdc++, but only the GNU + extensions) that is compatible with the egcs g++ packages. Such a package + isn't available yet. Joel Klecker tried building libg++2.8.1.1a within + egcs's libstdc++ setup, but it appears to need true gcc 2.8.1 . + * Filed Severity: important bugs against wxxt1-dev (#21707) because these + still depend on libg++-dev, which is removed in this version. + A fixed libsidplay1-dev has already been uploaded. + * libstdc++2.8 is now Section: base and Priority: required (as dselect is + linked against it). + * Disabled Haifa scheduling on Alpha again; Chris Chimelis reported + that this caused problems on some machines. + * [gcc/extend.texi] + ftp://maya.idiap.ch/pub/tmb/usenix88-lexic.ps.Z is no longer available; + use http://master.debian.org/~karlheg/Usenix88-lexic.pdf . + (fixes the egcs part of #20002). + * Updated Standards-Version. + * Changed chmod in debian/rules at Johnie Ingram's request. + * Rather than hardwire the Debian part of the packages' version number, + extract it from debian/changelog . + * Use gcc/objc/thr-posix.c from 980418 egcs snapshot to make objc work. + (Fixes #21192). + * Applied workaround for the GNUstep packages on sparc systems. + See README.sparc (on sparc packages only) in the doc directory. + This affects the other compilers as well. + * Already done in 1.0.2-0.7: the gobjc package now provides a virtual + package objc-compiler. + + -- Matthias Klose Tue, 28 Apr 1998 14:13:23 +0200 + +egcs (1.0.2-0.7) frozen unstable; urgency=low + + * Separated out Objective-C compiler. + * Applied patch from http://www.cygnus.com/ml/egcs/1998-Apr/0614.html + + -- Matthias Klose Fri, 17 Apr 1998 10:25:48 +0200 + +egcs (1.0.2-0.6) frozen unstable; urgency=low + + * Due to upstream changes (libg++ is now only the GNU specific C++ + classes, and is no longer maintained; libstdc++ contains the C++ + standard library, including STL), the virtual "libg++-dev" + package's meaning has become confusing. Therefore, new or updated + packages should no longer use the virtual "libg++-dev" package. + * Corrected g++'s Recommends to libstdc++2.8-dev (>=2.90.27-0.1). + The previous version had Recommends: libstdc++-dev (>=2.90.27-0.1) + which doesn't work, as libstc++-dev is a virtual package. + * Bumped Standards-Version. + + -- J.H.M. Dassen (Ray) Tue, 14 Apr 1998 11:52:08 +0200 + +egcs (1.0.2-0.5) frozen unstable; urgency=low (high for maintainers of packages that use libstdc++) + + * Modified shlibs file for libstdc++ to generate versioned dependencies, + as it is not link compatible with the 1.0.1-x versions in + project/experimental. (Fixes #20247, #20033) + Packages depending on libstd++ should be recompiled to fix their + dependencies. + * Strenghtened g++'s Recommends: libstdc++-dev to the 1.0.2 version or + newer. + * Fixed problems with the unknown(7) symlink for gcov. + * Reordering links now works. + + -- Adam Heath Sun, 12 Apr 1998 13:09:30 -0400 + +egcs (1.0.2-0.4) frozen unstable; urgency=low + + * Unreleased. This is the version Adam Heath received from me. + * Replaces: gcc (<= 2.7.2.3-3) so that the overlap with the older gcc + packages (including bo's gcc_2.7.2.1-8) is handled properly + (fixes #19931, #19672, #20217, #20593). + * Alpha architecture (fixes #20875): + * Patched gcc/config/alpha/linux.h for the gmon functions to operate + properly. + * Made egcs the primary C compiler. + * Enabled Hafia scheduling. + * Lintian-detected problems: + * E: libstdc++2.8: ldconfig-symlink-before-shlib-in-deb usr/lib/libstdc++.so.2.8 + * E: egcc: binary-without-manpage gcov + Reported as wishlist bug; added link to undocumented(7). + * W: libstdc++2.8: non-standard-executable-perm usr/lib/libstdc++.so.2.8.0 0555 + * E: libstdc++2.8: shlib-with-executable-bit usr/lib/libstdc++.so.2.8.0 0555 + + -- J.H.M. Dassen (Ray) Fri, 10 Apr 1998 14:46:46 +0200 + +egcs (1.0.2-0.3) frozen unstable; urgency=low + + * Really fixed dependencies. + + -- J.H.M. Dassen (Ray) Mon, 30 Mar 1998 11:30:26 +0200 + +egcs (1.0.2-0.2) frozen unstable; urgency=low + + * Fixed dependencies. + + -- J.H.M. Dassen (Ray) Sat, 28 Mar 1998 13:58:58 +0100 + +egcs (1.0.2-0.1) frozen unstable; urgency=low + + * New upstream version; it now has -Di386 in CPP_PREDEFINES. + * Only used the debian/* patches from 1.0.1-2; the rest of it appears + to be in 1.0.2 already. + + -- J.H.M. Dassen (Ray) Fri, 27 Mar 1998 11:47:14 +0100 + +egcs (1.0.1-2) unstable; urgency=low + + * Integrated pre-release 1.0.2 patches + * Split out g++ + * egcs may now provide either the primary or secondary C compiler + + -- Galen Hazelwood Sat, 14 Mar 1998 14:15:32 -0700 + +egcs (1.0.1-1) unstable; urgency=low + + * New upstream version + * egcs is now the standard Debian gcc! + * gcc now provides c-compiler (#15248 et al.) + * g77 now provides fortran77-compiler + * g77 dependencies now correct (#16991) + * /usr/doc/gcc/changelog.gz now has correct permissions (#16139) + + -- Galen Hazelwood Sat, 7 Feb 1998 19:22:30 -0700 + +egcs (1.0-1) experimental; urgency=low + + * First official release + From late September until the release, I was unable to get any + snapshot to compile... + + -- Galen Hazelwood Thu, 4 Dec 1997 16:30:11 -0700 + +egcs (970917-1) experimental; urgency=low + + * New upstream snapshot (There's a lot of stuff here as well, including + a new libstdc++, but it _still_ won't build...) + * eg77 driver now works properly + + -- Galen Hazelwood Wed, 17 Sep 1997 20:44:29 -0600 + +egcs (970904-1) experimental; urgency=low + + * New upstream snapshot + + -- Galen Hazelwood Sun, 7 Sep 1997 18:25:06 -0600 + +egcs (ss-970814-1) experimental; urgency=low + + * Initial packaging (of initial snapshot!) + + -- Galen Hazelwood Wed, 20 Aug 1997 00:36:28 +0000 + +gcc272 (2.7.2.3-12) unstable; urgency=low + + * Compiled on a glibc-2.0 based system. + * Reflect move of manpage to /usr/share in gcc.postinst as well. + * Moved gcc272-docs to section doc, priority optional. + + -- Matthias Klose Sat, 28 Aug 1999 13:42:13 +0200 + +gcc272 (2.7.2.3-11) unstable; urgency=low + + * Follow Debian policy for GNU system type (fixes #42657). + * config/i386/linux.h: Remove %[cpp_cpu] from CPP_SPEC. Stops gcc-2.95 + complaining about obsolete spec operators (using gcc -V 2.7.2.3). + Patch suggested by Zack Weinberg . + + -- Matthias Klose Sun, 15 Aug 1999 20:12:21 +0200 + +gcc272 (2.7.2.3-10) unstable; urgency=low + + * Renamed source package to gcc272. The egcs source package is renamed + to gcc, because it's now the "official" GNU C compiler. + * Changed maintainer address to "Debian GCC maintainers". + * Install info and man stuff to /usr/share. + + -- Matthias Klose Thu, 27 May 1999 12:29:23 +0200 + +gcc (2.7.2.3-9) unstable; urgency=low + + * debian/{postinst,prerm}-doc: handle gcc272.info, not gcc.info. + Fixes #36306. + + -- Matthias Klose Tue, 20 Apr 1999 07:32:58 +0200 + +gcc (2.7.2.3-8) unstable; urgency=low + + * Make gcc-2.7 the secondary compiler. Rename gcc package to gcc272. + On i386, sparc and m68k, this package is compiled against glibc2.0. + * The cpp package is built from the egcs source package. + + -- Matthias Klose Mon, 29 Mar 1999 22:48:50 +0200 + +gcc (2.7.2.3-7) frozen unstable; urgency=low + + * Separated out ObjC compiler to gobjc27 package. + * Changed maintainer address. + * Synchronized README.Debian with egcs-1.1.1-3. + + -- Matthias Klose Tue, 29 Dec 1998 19:05:26 +0100 + +gcc (2.7.2.3-6) frozen unstable; urgency=low + + * Link with -lc on i386, m68k, sparc, when building shared libraries + (fixes #25122). + + -- Matthias Klose Thu, 3 Dec 1998 12:12:12 +0200 + +gcc (2.7.2.3-5) frozen unstable; urgency=low + + * Updated maintainer info. + * Updated Standards-Version; made lintian-clean. + * gcc-docs can coexist with the latest egcs-docs, so added (<= version) to + the Conflicts. + * Updated the README and renamed it to README.Debian . + * Put a reference to /usr/doc/gcc/README.Debian in the info docs. + * Updated description of g++272 . + * Clean up generated info files, to keep the diff small. + + -- J.H.M. Dassen (Ray) Tue, 17 Nov 1998 20:05:59 +0100 + +gcc (2.7.2.3-4.8) frozen unstable; urgency=high + + * Non-maintainer release + * Fix type in extended description + * Removed wrong test in postinst + * Add preinst to clean up some stuff from an older gcc package properly + and stop man complaining about dangling symlinks + + -- Wichert Akkerman Fri, 17 Jul 1998 18:48:32 +0200 + +gcc (2.7.2.3-4.7) frozen unstable; urgency=high + + * Really fixed gcc-docs postinst (Fixes #23470), so that `gcc-docs' + becomes installable. + + -- J.H.M. Dassen (Ray) Mon, 15 Jun 1998 07:53:40 +0200 + +gcc (2.7.2.3-4.6) frozen unstable; urgency=high + + * [gcc.c] There is one call to choose_temp_base for determining the + tempdir to be used only; + #ifdef HAVE_MKSTEMP delete the tempfile created as a side effect. + (fixes #23123 for gcc). + * gcc-docs postinst was broken (due to a broken line) (fixes #23391, #23401). + * [debian/control] description for gcc-docs said `egcs' where it should have + said `gcc' (fixes #23396). + + -- J.H.M. Dassen (Ray) Thu, 11 Jun 1998 12:48:50 +0200 + +gcc (2.7.2.3-4.5) frozen unstable; urgency=high + + * The previous version left temporary files behind, as they were not + marked for deletion afterwards. + + -- J.H.M. Dassen (Ray) Sun, 31 May 1998 22:49:14 +0200 + +gcc (2.7.2.3-4.4) frozen unstable; urgency=high (security fixes) + + * Security improvements with regard to the /tmp problem + (gcc opens predictably named files in TMPDIR which can be abused via + symlinks) (Fixes #19453 for gcc): + * Compile -DMKTEMP_EACH_FILE to ensure the %u name is generated randomly + every time; affects gcc/gcc.c . + * [cp/g++.c, collect2.c, gcc.c] If compiled -DHAVE_MKSTEMP use mkstemp(3) + rather than mktemp(3). + * Security improvements: don't use the result of choose_temp_base in a + predictable fashion. + [gcc.c]: + * @c, @objective-c: use random name rather then tempbasename.i for + intermediate preprocessor output (%g.i -> %d%u). + * @c, @objective-c: use random name rather then tempbasename.s for + intermediate compiler output (%g.s -> %d%u). + * @c, @objective-c, @cpp-output, @assembler-with-cpp: switched + "as [-o output file] " to + "as [-o output file]". + * @c, @objective-c, @assembler-with-cpp: use previous random name + (cc1|cpp output) rather then tempbasename.s for intermediate assembler + input (%g.s -> %U) + [f/lang-specs.h]: + * @f77-cpp-input: use random name rather then tempbasename.i for + intermediate cpp output (%g.i -> %d%u). + * @f77-cpp-input: use previous random name (cpp output) rather than + tempbasename.i for f771 input (%g.i -> %U). + * @f77-cpp-input: switched + "as [-o output file] " to + "as [-o output file]". + * @f77-cpp-input: use random name rather then tempbasename.s for + intermediate compiler output (%g.s -> %d%u). + * @ratfor: use random name rather then tempbasename.i for + intermediate ratfor output (%g.f -> %d%u). + * @ratfor: use previous random name (ratfor output) rather than + tempbasename.i for f771 input (%g.f -> %U). + * @ratfor: use random name rather then tempbasename.s for + intermediate compiler output (%g.s -> %d%u). + * @ratfor: switched + "as [-o output file] " to + "as [-o output file]". + * @ratfor: use previous random name + (ratfor output) rather then tempbasename.s for intermediate assembler + input (%g.s -> %U). + * @f77: use random name rather then tempbasename.s for + intermediate ratfor output (%g.f -> %d%u). + * @ratfor: use previous random name (ratfor output) rather than + tempbasename.i for f771 input (%g.f -> %U). + * @ratfor: use random name rather then tempbasename.s for + intermediate compiler output (%g.s -> %d%u). + * @ratfor: switched + "as [-o output file] " to + "as [-o output file]". + * @ratfor: use previous random name + (ratfor output) rather then tempbasename.s for intermediate assembler + input (%g.s -> %U). + * @f77: use random name rather then tempbasename.s for + intermediate compiler output (%g.s -> %d%u). + * @f77: switched + "as [-o output file] " to + "as [-o output file]". + * @ratfor: use random name rather then tempbasename.s for + intermediate compiler output (%g.s -> %U). + + -- J.H.M. Dassen (Ray) Sat, 30 May 1998 17:27:03 +0200 + +gcc (2.7.2.3-4.3) frozen unstable; urgency=high + + * The "alpha" patches from -4 affected a lot more than alpha support, + and in all likeliness broke compilation of libc6 2.0.7pre3-1 + and 2.0.7pre1-4 . I removed them by selective application of the + diff between -4 and -4. (should fix #22292). + * Fixed reference to the trampolines paper (fixes #20002 for Debian; + this still needs to be forwarded). + * This is for frozen too. (obsoletes #22390 (request to move -4.2 to + frozen)). + * Split of gcc-docs package, so that the gcc can be succesfully installed + on systems that have egcs-docs installed. + * Added the README on the compiler situation that's already in the egcs + packages. + * Use the recommended settings LDFLAGS=-s CFLAGS= BOOT_CFLAGS='-O2'. + + -- J.H.M. Dassen (Ray) Thu, 28 May 1998 20:03:59 +0200 + +gcc (2.7.2.3-4.2) unstable; urgency=low + + * Still for unstable, as I have received no feedback about the g++272 + package yet. + * gcc now Provides: objc-compiler . + * Clean up /etc/alternatives/{g++,g++.1.gz} if they are dangling. + (fixes #19765, #20563) + + -- J.H.M. Dassen (Ray) Wed, 22 Apr 1998 12:40:45 +0200 + +gcc (2.7.2.3-4.1) unstable; urgency=low + + * Bumped Standards-Version. + * Forked off a g++272 package (e.g. for code that uses the GNU extensions + in libg++); for now this is in "unstable" only; feedback appreciated. + * Some cleanup (lintian): permissions, absolute link, gzip manpage. + + -- J.H.M. Dassen (Ray) Fri, 17 Apr 1998 13:05:25 +0200 + +gcc (2.7.2.3-4) unstable; urgency=low + + * Added alpha patches + * Only build C and objective-c compilers, split off g++ + + -- Galen Hazelwood Sun, 8 Mar 1998 21:16:39 -0700 + +gcc (2.7.2.3-3) unstable; urgency=low + + * Added patches for m68k + * Added patches for sparc (#13968) + + -- Galen Hazelwood Fri, 17 Oct 1997 18:25:21 -0600 + +gcc (2.7.2.3-2) unstable; urgency=low + + * Added g77 support (g77 0.5.21) + + -- Galen Hazelwood Wed, 10 Sep 1997 18:44:54 -0600 + +gcc (2.7.2.3-1) unstable; urgency=low + + * New upstream version + * Now using pristine source + * Removed misplaced paragraph in cpp.texi (#10877) + * Fix security bug for temporary files (#5298) + * Added Suggests: libg++-dev (#12335) + * Patched objc/thr-posix.c to support conditions (#12502) + + -- Galen Hazelwood Mon, 8 Sep 1997 12:20:07 -0600 + +gcc (2.7.2.2-7) unstable; urgency=low + + * Made cc and c++ managed through alternates mechanism (for egcs) + + -- Galen Hazelwood Tue, 19 Aug 1997 22:37:03 +0000 + +gcc (2.7.2.2-6) unstable; urgency=low + + * Tweaked Objective-C thread support (#11069) + + -- Galen Hazelwood Wed, 9 Jul 1997 11:56:57 -0600 + +gcc (2.7.2.2-5) unstable; urgency=low + + * More updated m68k patches + * Now conflicts with libc5-dev (#10006, #10112) + * More strict Depends: cpp, prevents version mismatch (#9954) + + -- Galen Hazelwood Thu, 19 Jun 1997 01:29:02 -0600 + +gcc (2.7.2.2-4) unstable; urgency=low + + * Moved to unstable + * Temporarily removed fortran support (waiting for new g77) + * Updated m68k patches + + -- Galen Hazelwood Fri, 9 May 1997 13:35:14 -0600 + +gcc (2.7.2.2-3) experimental; urgency=low + + * Built against libc6 (fixes bug #8511) + + -- Galen Hazelwood Fri, 4 Apr 1997 13:30:10 -0700 + +gcc (2.7.2.2-2) experimental; urgency=low + + * Fixed configure to build crt{begin,end}S.o on i386 + + -- Galen Hazelwood Tue, 11 Mar 1997 16:15:02 -0700 + +gcc (2.7.2.2-1) experimental; urgency=low + + * Built for use with libc6-dev (experimental purposes only!) + * Added m68k patches from Andreas Schwab + + -- Galen Hazelwood Fri, 7 Mar 1997 12:44:17 -0700 + +gcc (2.7.2.1-7) unstable; urgency=low + + * Patched to support g77 0.5.20 + + -- Galen Hazelwood Thu, 6 Mar 1997 22:20:23 -0700 + +gcc (2.7.2.1-6) unstable; urgency=low + + * Added (small) manpage for protoize/unprotoize (fixes bug #6904) + * Removed -lieee from specs file (fixes bug #7741) + * No longer builds aout-gcc + + -- Galen Hazelwood Mon, 3 Mar 1997 11:10:20 -0700 + +gcc (2.7.2.1-5) unstable; urgency=low + + * debian/control now lists cpp in section "interpreters" + * Re-added Objective-c patches for unstable + + -- Galen Hazelwood Wed, 22 Jan 1997 10:27:52 -0700 + +gcc (2.7.2.1-4) stable unstable; urgency=low + + * Changed original source file so dpkg-source -x works + * Removed Objective-c patches (unsafe for stable) + * Built against rex's libc, so fixes placed in -3 are available to + those still using rex + + -- Galen Hazelwood Tue, 21 Jan 1997 11:11:53 -0700 + +gcc (2.7.2.1-3) unstable; urgency=low + + * New (temporary) maintainer + * Updated to new standards and source format + * Integrated aout-gcc into gcc source package + * Demoted aout-gcc to Priority "extra" + * cpp package description more clear (fixes bug #5428) + * Removed cpp "Replaces: gcc" (fixes bug #5762) + * Minor fix to invoke.texi (fixes bug #2909) + * Added latest Objective-C patches for GNUstep people (fixes bug #4657) + + -- Galen Hazelwood Sun, 5 Jan 1997 09:57:36 -0700 + +Previous changes: + +Re-split into completely separate cpp and gcc packages (Bug#3838). + +Local variables: +mode: debian-changelog +End: --- gcc-2.95-2.95.4.ds15.orig/debian/README.Debian +++ gcc-2.95-2.95.4.ds15/debian/README.Debian @@ -0,0 +1,147 @@ + The Debian GNU Compiler Collection Setup + ======================================== + +Please see the README.Debian in /usr/share/doc/gcc, contained in the +gcc package for a description of the setup of the different compiler +versions. + + +Maintainers of these packages +----------------------------- + +Matthias Klose +Ray Dassen +Philip Blundell (arm-linux) +Ben Collins (sparc-linux) +Christopher C. Chimelis (alpha-linux) +Dan Jacobowitz (powerpc-linux) +Gerhard Tonn (s390-linux) +Roman Zippel (m68k-linux) + +=============================================================================== + +Patches applied in this version: + +gcc-version: + +glibc-version: + fix glibc version at 2.2 + +libg++-update: + 2000-03-12 Manfred Hollstein + + * Fix.h (Fix::Rep): Move definition into public context. + +bootstrap: + Make bootstrap: restartable at any point + From: Donn Terry + +cpp-macro-doc: + cpp.texi: add a node documenting macro varargs. + +gcc-default-arch: + set the default architecture to i386; even if gcc is configured + with i386-linux, it builds with Pentium instructions, tuned for i386. + +libstdc++-out-of-mem: + Throw exception instead of aborting when out of memory + +libstdc++-wstring: + enable definition of wstring type, if __ENABLE_WSTRING is defined. + +libstdc++-bastring: + Here is a patch to /usr/include/g++-2/std/bastring.h which makes it + work for me (though note that I have not tested the c_str() method as + such): + +gcc-manpage: + Document exit codes. + +cpp-dos-newlines: + Handle DOS newlines after backslashes. + Patch from http://www.cygnus.com/ml/egcs/1999-Jan/0784.html + +libio-doc: + iostream.texi (Files): Use octal numbers in examples. + +gcc-doc: + extend.texi (Nested Functions): Update URL of Usenix paper. + invoke.texi Fix typo (-fstd -> -std). + +strength-red: + From: Alan Modra + To: gcc-patches@gcc.gnu.org + Subject: gcc-2.95 strength reduction fix + Date: Mon, 3 Dec 2001 14:51:31 +1030 + This particular problem was fixed on the mainline by + http://gcc.gnu.org/ml/gcc-patches/2000-04/msg00576.html, which is a + much nicer fix than the following but a minimal change may be preferred + for the 2.95 branch. + + * loop.c (strength_reduce ): Set up maybe_multiple for givs. + (record_giv): Pass in maybe_multiple. + (find_mem_givs): Likewise. + +gcc-messages: + avoid setlocale(LC_MESSAGES, ...) not to set LC_MESSAGES, because + some environment except for setting LANG=C fail to display libc + message. + +gcc4-fix: + gcc4 build fix (invalid lvalue in increment) + +gcc-gas-hidden: + +ppc-fsirl-updates: + Various updates from Franz Sirl, including DWARF EH support. + ftp://devel.linuxppc.org/users/fsirl/ + this patch includes the following Debian patches: + - gcc-weaksym + excluded: + - gcc/version.c + - objc-testsuite + +gcc-names: + versioned gcc names + +libio-names: + versioned iostream info names + +chill-names: + versioned gcc names + +g77-docs: + Update g77 documentation as proposed in + http://gcc.gnu.org/ml/gcc-bugs/1999-11/msg00846.html + +libf2c-mkstemp: + use mkstemp in libf2c/libI77 + taken from http://gcc.gnu.org/ml/gcc-patches/2000-11/msg00708.html + +g77-names: + versioned g77 names + +libobjc: + Find header file for Boehm garbage collector. + +objc-data-references: + Subject: PATCH: use non-readonly data section for objc references + From: Todd Vierling + +reporting: + --help gives hint to /usr/share/doc/debian/bug-reporting.txt + +gpc-2.95: + The gpc patch from the gpc tarball. + +gpc-update-makefile: + +gpc-update9: + - Fix a spurious error message in Extended Pascal mode. + - Correctly handle access to packed fields + +gpc-names: + versioned gpc names + +p-make-lang: + Quote the arguments to sed in the Pascal Make-lang.in. --- gcc-2.95-2.95.4.ds15.orig/debian/rules.conf +++ gcc-2.95-2.95.4.ds15/debian/rules.conf @@ -0,0 +1,242 @@ +# -*- makefile -*- +# rules.conf +# - used to build debian/control and debian/rules.parameters +# - assumes unpacked sources + +TARGET=native + +include debian/rules.defs + +# FIRST_PRIMARY - first gcc version built as primary compiler +ifeq ($(DEB_HOST_GNU_TYPE),i486-linux-gnu) + FIRST_PRIMARY = 2.91.63-1.1 +endif +ifeq ($(DEB_HOST_ARCH),sparc) + FIRST_PRIMARY = 2.91.66-1 +endif +ifeq ($(DEB_HOST_ARCH),m68k) + FIRST_PRIMARY = 2.95-1 +endif + +# The binutils version needed. +# The oldest suitable versions for the various platforms can be found in +# INSTALL/specific.html ; we take a tighter dependency if possible to be on +# the safe side (something like newest( version in stable, versions for the +# various platforms in INSTALL/specific.html) ). +ifeq ($(SNAPSHOT),no) + BINUTILSV = 2.11.90.0.1-1 + with_libstdcxx_v3=no + libstdcxx_dir=libstdc++ +else + BINUTILSV = 2.11.90.0.1-1 + with_libstdcxx_v3=yes + libstdcxx_dir=libstdc++-v3 +endif + +# The version number can be found in gcc/version.c e.g. +# char *version_string = "2.95 19990710 (prerelease)"; +VER := $(strip $(shell grep version_string $(srcdir)/gcc/version.c \ + | sed -e 's/^.*= *"//' -e 's/ .*$$//')) +# The numeric part of the gcc version number (x.yy.zz) +VERNO := $(strip $(shell echo $(VER) | sed -e 's/gcc-//')) +NEXTVERNO := $(shell echo $(VERNO) | awk -F. '{OFS="."; $$NF = $$NF+1; print}') +# The base version number for the gcc packages. +DPKGVER := $(VERNO)-$(shell dpkg-parsechangelog \ + | awk -F- '/^Version:/ {print $$NF}') + +# the libc version installed for this system. +GLIBC_VER := $(shell sh debian/glibcver.sh) + +# libstdc++ versions and name +ifeq ($(with_libstdcxx_v3),no) + lib_version := $(strip $(shell awk -F= '/^VERSION/ {print $$NF}' $(srcdir)/$(libstdcxx_dir)/Makefile.in)) +else + lib_version := $(strip $(shell sed -n '/^ *AM_INIT_AUTOMAKE/s/.*, *\([0-9].*[0-9]\).*/\1/p' $(srcdir)/$(libstdcxx_dir)/aclocal.m4)) +endif + +lib_pkg_req_version := 1:2.95.4-15 + +SONAME := $(shell echo $(lib_version) | sed -e 's/\.[0-9]$$//') + +ifeq ($(with_libgpp),yes) + lgp_version := $(strip $(shell awk -F= '/^VERSION/ {print $$NF}' $(srcdir)/libg++/Makefile.in)) + # package name has to be different than libg++2.8 + LGPSONAME = $(lgp_version) +endif + +if_config := $(shell cd $(srcdir); \ + topsrcdir=$(srcdir); \ + target_os=$(DEB_HOST_GNU_SYSTEM); \ + target=$(DEB_HOST_GNU_TYPE); \ + enable_libstdcxx_v3=$(with_libstdcxx_v3); \ + . config.if >/dev/null 2>&1; \ + echo $$libstdcxx_interface $$cxx_interface $$libc_interface) +LIBSTDCXX_IF := $(word 1, $(if_config)) +CXX_IF := $(word 2, $(if_config)) +LIBC_IF := $(word 3, $(if_config)) + +ifeq ($(VER),2.95.4) +ctrl_flags = -DCV=1:$(VERNO) -DNV=1:$(NEXTVERNO) \ + -DBINUTILSV=$(BINUTILSV) -DSRCNAME=$(PKGSOURCE) \ + -D__$(DEB_HOST_GNU_CPU)__ -DARCH=$(DEB_HOST_GNU_CPU) +else +ctrl_flags = -DCV=1:$(VERNO) -DNV=1:$(NEXTVERNO) \ + -DBINUTILSV=$(BINUTILSV) -DSRCNAME=$(PKGSOURCE) \ + -D__$(DEB_HOST_GNU_CPU)__ -DARCH=$(DEB_HOST_GNU_CPU) +endif +ctrl_flags += -DPRIMARY +ifneq ($(FIRST_PRIMARY),) + ctrl_flags += -DFIRST_PRIMARY="$(FIRST_PRIMARY)" +endif +ifeq ($(with_pascal),yes) + ctrl_flags += -DPASCAL +endif +ifeq ($(with_objc),yes) + ctrl_flags += -DOBJC +endif +ifeq ($(with_objc_gc),yes) + ctrl_flags += -DOBJC_GC +endif +ifeq ($(with_libgpp),yes) + ctrl_flags += -DLIBGPP +endif +ifeq ($(with_java),yes) + ctrl_flags += -DJAVA +endif +ifeq ($(with_gplusplus),yes) + ctrl_flags += -DGPLUSPLUS +endif +ifeq ($(with_chill),yes) + ctrl_flags += -D_CHILL +endif +ifeq ($(with_fortran),yes) + ctrl_flags += -DFORTRAN +endif +ifeq ($(with_proto),yes) + ctrl_flags += -DPROTOIZE +endif + +ifeq ($(versioned_packages),yes) + PKG_VERSION := 2.95 + ctrl_flags += -DVPKGS + version_dash = - +endif + +ifeq ($(DEB_HOST_GNU_CPU),alpha) + ctrl_flags += -DLIBC_DEV=libc6.1-dev +else + ifeq ($(DEB_HOST_GNU_TYPE),i486-gnu) + ctrl_flags += -DLIBC_DEV=libc0.3-dev + else + ctrl_flags += -DLIBC_DEV=libc6-dev + endif +endif + +ifeq ($(with_arm_soft_float),yes) + ctrl_flags += -DARM_SOFT_FLOAT +endif + +ifeq ($(SNAPSHOT),no) + snap_awk = {next} + snap_awk = {print " NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch\n (dated 2001-10-02).\n ."; next} +else + ctrl_flags += -DSNAPSHOT + snap_awk = {print " [ This is a developer snapshot. Don'\''t use it for production."; print " Please read /usr/doc//README.snapshot! ]"; print " ."; next} + ifeq ($(SNAPSHOT),fake) + ctrl_flags += -DFAKE + endif +endif +ctrl_flags += -Ui386 + +PKG_DEV_SONAME = +LGP_PKG_DEV_SONAME = + +ifeq ($(GLIBC_VER),2.1) +# removed for libstdc++-2.10 for alpha and i386. +# ifeq ($(findstring $(DEB_HOST_ARCH),alpha i386 m68k),$(DEB_HOST_ARCH)) + ifeq ($(findstring $(DEB_HOST_ARCH),m68k),$(DEB_HOST_ARCH)) + PKG_SONAME = $(SONAME)-glibc2.1 + LGP_PKG_SONAME = $(LGPSONAME)-glibc2.1 + PKG_DEV_SONAME = $(SONAME)-glibc2.1 + LGP_PKG_DEV_SONAME = $(LGPSONAME)-glibc2.1 + else + PKG_SONAME = $(SONAME) + LGP_PKG_SONAME = $(LGPSONAME) + endif +else + ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu) + PKG_SONAME = $(SONAME)-glibc$(GLIBC_VER) + LGP_PKG_SONAME = $(LGPSONAME)-glibc$(GLIBC_VER) + else + PKG_SONAME = $(SONAME) + LGP_PKG_SONAME = $(LGPSONAME) + endif +endif +ifeq ($(PKG_DEV_SONAME),) + PKG_DEV_SONAME = $(SONAME) + LGP_PKG_DEV_SONAME = $(LGPSONAME) +endif + +control: parameters-file + +control-file: + cpp-2.95 -P $(ctrl_flags) debian/control.in \ + | awk '/^ *$$/ && x !~ /^ / {next} /SNAPSHOT_WARNING/ $(snap_awk) /NEWLINE/ {print ""; next} {print; x=$$0}' | sed -e '/^[^ ]/s/ */ /g' -e 's/ *\([,)]\)/\1/g' -e 's/ *$$//' \ + | sed -e 's/_LIB_SO_/$(PKG_SONAME)/g' \ + -e 's/_LGP_SO_/$(LGP_PKG_SONAME)/g' \ + -e 's/_LIB_DEV_SO_/$(PKG_DEV_SONAME)/g' \ + -e 's/_LGP_DEV_SO_/$(LGP_PKG_DEV_SONAME)/g' \ + -e 's/_BINUTILS_/binutils/g' \ + -e 's/libgc_no_archs/$(foreach arch,$(libgc_no_archs),!$(arch))/g' \ + -e 's/lib_pkg_req_version/$(lib_pkg_req_version)/g' \ + -e 's/_TARGET_//g' \ + -e 's/_PV_/$(version_dash)$(PKG_VERSION)/g' \ + > debian/control.tmp + cp debian/control.tmp debian/control.native +ifneq ($(TARGETS),) + for i in $(TARGETS); do \ + cpp-2.95 -P $(ctrl_flags) -Dhej -D__target_is_$$i"__" -DTARGET=$$i debian/control.in \ + | awk '/^ *$$/ && x !~ /^ / {next} /SNAPSHOT_WARNING/ $(snap_awk) /NEWLINE/ {print ""; next} {print; x=$$0}' | sed -e '/^[^ ]/s/ */ /g' -e 's/ *\([,)]\)/\1/g' -e 's/ *$$//' \ + | sed -e 's/_LIB_SO_/$(PKG_SONAME)/g' \ + -e 's/_LGP_SO_/$(LGP_PKG_SONAME)/g' \ + -e 's/_LIB_DEV_SO_/$(PKG_DEV_SONAME)/g' \ + -e 's/_LGP_DEV_SO_/$(LGP_PKG_DEV_SONAME)/g' \ + -e "s/_TARGET_/-$$i/g" \ + -e "s/_BINUTILS_/binutils-$$i/g" \ + -e 's/lib_pkg_req_version/$(lib_pkg_req_version)/g' \ + -e 's/_PV_/$(version_dash)$(PKG_VERSION)/g' \ + | awk 'BEGIN { RS = "\n([ \t]*\n)+"} { if ($$0 ~ /Package: (gcc|cpp|g\+\+)-$(PKG_VERSION)-'$$i'/) print $$0 "\n"} \ + { if ($$0 ~ /Package: libstdc\+\+[0-9\.]+-(dev-|glibc[0-9\.]+-)'$$i'/) print $$0 "\n"}' \ + >> debian/control.tmp ; \ + done +endif + [ -e debian/control ] \ + && cmp -s debian/control debian/control.tmp \ + && rm -f debian/control.tmp && exit 0; \ + mv debian/control.tmp debian/control; touch $(control_stamp) + + +parameters-file: + rm -f debian/rules.parameters.tmp + ( \ + echo '# configuration parameters taken from upstream source files'; \ + echo 'VER := $(VER)'; \ + echo 'DPKGVER := $(DPKGVER)'; \ + echo 'SONAME := $(SONAME)'; \ + echo 'LGPSONAME := $(LGPSONAME)'; \ + echo 'PKG_SONAME := $(PKG_SONAME)'; \ + echo 'PKG_DEV_SONAME := $(PKG_DEV_SONAME)'; \ + echo 'lib_version := $(lib_version)'; \ + echo 'lib_pkg_req_version:= $(lib_pkg_req_version)'; \ + echo 'lgp_version := $(lgp_version)'; \ + echo 'LGP_PKG_SONAME := $(LGP_PKG_SONAME)'; \ + echo 'LGP_PKG_DEV_SONAME:= $(LGP_PKG_DEV_SONAME)'; \ + echo 'LIBC_IF := $(LIBC_IF)'; \ + echo 'CXX_IF := $(CXX_IF)'; \ + echo 'LIBSTDCXX_IF := $(LIBSTDCXX_IF)'; \ + ) > debian/rules.parameters.tmp + [ -e debian/rules.parameters ] \ + && cmp -s debian/rules.parameters debian/rules.parameters.tmp \ + && rm -f debian/rules.parameters.tmp && exit 0; \ + mv debian/rules.parameters.tmp debian/rules.parameters; \ + touch $(control_stamp) --- gcc-2.95-2.95.4.ds15.orig/debian/rules.defs +++ gcc-2.95-2.95.4.ds15/debian/rules.defs @@ -0,0 +1,253 @@ +# -*- makefile -*- +# definitions used in more than one Makefile / rules file + +SHELL = /bin/bash -e # brace expansion used in rules file +PWD := $(shell pwd) +srcdir = $(PWD)/src-$(TARGET) +builddir = $(PWD)/build-$(TARGET) +stampdir = stamps + +# TP: Target Prefix. Used primarily as a prefix for cross tool +# names (e.g. powerpc-linux-gcc). +# TS: Target Suffix. Used primarily at the end of cross compiler +# package names (e.g. gcc-powerpc). +# CT: Unused. I forget what this was supposed to be for :-) +# +# Note: This scheme assumes targets are *-linux. At some point +# in the future I'd like to work on generalizing this to allow +# for non-linux targets. My thought is that when specifying +# target names in TARGETS, if it doesn't contain a '-', we'll +# assume Linux. If it *does* contain a '-', we'll *not* make +# that assumption, and handle it properly in these rules files. + +ifneq ($(TARGET),native) + TP = $(TARGET)-linux- + CT = $(TARGET)-linux + TS = -$(TARGET) +else + TP = + CT = + TS = +endif + +# architecture dependent variables +DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) +ifneq ($(TARGET),native) + ifneq ($(TARGET),) + DEB_HOST_ARCH = $(TARGET) + endif +endif +DEB_HOST_GNU_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) +DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM) +DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) + +# --------------------------------------------------------------------------- +# which binary packages are built? + +# The name of the source package // better: set SNAPSHOT explicitely +PKGSOURCE := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2;exit 0}') + +ifneq ($(PKGSOURCE),gcc) + versioned_packages := yes +endif +SNAPSHOT = no + +enabled_languages := + +with_gplusplus := yes +# if g++ doesn't build on some target, disable it ... +ifeq ($(TARGET),avr) + with_gplusplus := disabled for architecture $(DEB_HOST_ARCH) +endif +ifeq ($(DEB_HOST_ARCH),hurd-i386) + with_gplusplus := disabled for architecture $(DEB_HOST_ARCH) +endif + +ifeq ($(with_gplusplus),yes) + enabled_languages += c++ +endif + +# debugging versions of libstdc++ (and libg++, if built) +with_debug := yes + +# build the libg++ library (deprecated) +with_libgpp := no +ifeq ($(with_gplusplus),yes) + ifeq ($(DEB_HOST_GNU_SYSTEM),linux-gnu) + with_libgpp := yes + endif +endif +ifneq ($(TARGET),native) + with_libgpp := disabled for cross builds +endif + +# See, if the GNU pascal compiler is found +with_pascal := yes +# if pascal doesn't build on some target, disable it ... +ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),enabled-for-all)) + with_pascal := disabled for architecture $(DEB_HOST_ARCH) +endif +ifneq ($(DEB_HOST_ARCH),i386) + ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),avr)) + with_pascal := disabled for architecture $(DEB_HOST_ARCH) + endif +endif +# disable the GNU pascal compiler by hand +#with_pascal := disabled by hand + +ifeq ($(with_pascal),yes) + enabled_languages += pascal +endif + +with_objc := yes +# the ObjC runtime with garbage collection enabled needs the Boehm GC +with_objc_gc := yes +# disable ObjC garbage collection library (needs libgc) +libgc_no_archs := avr hppa hurd-i386 +ifneq ($(DEB_HOST_ARCH),i386) + ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),$(libgc_no_archs))) + with_objc_gc := disabled for architecture $(DEB_HOST_ARCH) + endif +#else +# with_objc := bootstrap failure on i386 when building libobjc +endif + +ifeq ($(with_objc),yes) + enabled_languages += objc +endif + +with_java := no +# build gcj only on architectures, where libgcj-2.95.1 can be built as well. +#ifneq ($(DEB_HOST_ARCH),i386) +# ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),arm avr hurd-i386 m68k mipsel mips)) +# with_java := disabled for architecture $(DEB_HOST_ARCH) +# endif +#endif + +ifeq ($(with_java),yes) + enabled_languages += java +endif + +with_chill := yes +#ifeq ($(DEB_HOST_ARCH),m68k) +# with_chill := disabled for architecture $(DEB_HOST_ARCH) +#endif + +ifeq ($(with_chill),yes) + enabled_languages += CHILL +endif + +with_fortran := yes +ifeq ($(DEB_HOST_ARCH),alpha) + with_fortran := disabled for architecture $(DEB_HOST_ARCH) +endif + +ifeq ($(with_fortran),yes) + enabled_languages += f77 +endif + +with_proto := no + +ifeq ($(SNAPSHOT),no) + with_check := no +else + with_check := yes +endif +# enabled to get results for catching regressions with gcc-2.95.3 builds. +with_check := yes +ifeq ($(DEB_HOST_ARCH),hurd-i386) + with_check := disabled for architecture $(DEB_HOST_ARCH) +endif +# If you don't want to run the gcc testsuite, set `with_check' to `no' +with_check := disabled by hand + +#ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),mipsel mips)) +# with_check := yes +#else +# with_check := disabled (no change to previous upload) +#endif + +with_arm_soft_float := disabled + +unpack_stamp := $(stampdir)/01-unpack-stamp +patch_stamp := $(stampdir)/02-patch-stamp +control_stamp := $(stampdir)/03-control-stamp +configure_stamp := $(stampdir)/04-configure-stamp +build_stamp := $(stampdir)/05-build-stamp +install_stamp := $(stampdir)/06-install-stamp +binary_stamp := $(stampdir)/07-binary-stamp + +TARGETS= # avr arm powerpc + +unpack_stamps := $(unpack_stamp)-native \ + $(foreach i,$(TARGETS),$(unpack_stamp)-$(i)) + +patch_stamps := $(patch_stamp)-native \ + $(foreach i,$(TARGETS),$(patch_stamp)-$(i)) + +control_stamps := $(control_stamp)-native \ + $(foreach i,$(TARGETS),$(control_stamp)-$(i)) + +configure_stamps_cross := $(foreach i,$(TARGETS),$(configure_stamp)-$(i)) +configure_stamp_native := $(configure_stamp)-native +configure_stamps := $(configure_stamp_native) $(configure_stamps_cross) + +build_stamps_cross := $(foreach i,$(TARGETS),$(build_stamp)-$(i)) +build_stamp_native := $(build_stamp)-native +build_stamps := $(build_stamp_native) $(build_stamps_cross) + +install_stamps_cross := $(foreach i,$(TARGETS),$(install_stamp)-$(i)) +install_stamp_native := $(install_stamp)-native +install_stamps := $(install_stamp_native) $(install_stamps_cross) + +binary_stamps_cross := $(foreach i,$(TARGETS),$(binary_stamp)-$(i)) +binary_stamp_native := $(binary_stamp)-native +binary_stamps := $(binary_stamp_native) $(binary_stamps_cross) + +# A list of all of the native compiler related packages. +# +NATIVE_PACKAGES := $(shell grep Package debian/control.native \ + | awk '{print $$2}') + +# A list of all of the native and cross compiler related +# packages, for all TARGETs in TARGETS. +# +ALL_PACKAGES := $(shell grep Package debian/control | awk '{print $$2}') + +# A list of all of the cross compiler related packages, for all +# TARGETs in TARGETS: +# CROSS_PACKAGES = ALL_PACKAGES - NATIVE_PACKAGES +# +CROSS_PACKAGES = $(filter-out $(NATIVE_PACKAGES),$(ALL_PACKAGES)) + +# For the TARGET currently being built, a list of cross compiler +# packages related to the *other* TARGETs: +# OTHER_CROSS_PACKAGES = CROSS_PACKAGES - CROSS_PACKAGES(TARGET) +# +OTHER_CROSS_PACKAGES = $(filter-out %-$(TARGET), $(CROSS_PACKAGES)) + +# For the TARGET currently being built, a list of cross compiler +# packages related to *this* (i.e. MY) TARGET: +# +MY_CROSS_PACKAGES = $(filter %-$(TARGET), $(CROSS_PACKAGES)) + +# NOT_PACKAGES: A list of debhelper -N options to specify the +# packages *not* related to the native or cross configuration +# currently being built. When building a native compiler, +# you are not building CROSS_PACKAGES. When building a +# specific cross compiler, you are not building NATIVE_PACKAGES or +# OTHER_CROSS_PACKAGES. +# PDIRS: A list of the debian/PACKAGE_NAME directories +# related to the native or cross configuration currently being +# built. +# +ifeq ($(TARGET),native) + NOT_PACKAGES = $(addprefix -N,$(CROSS_PACKAGES)) + PDIRS = $(foreach i,$(NATIVE_PACKAGES),debian/$(i)) +else + NOT_PACKAGES = $(addprefix -N,$(NATIVE_PACKAGES) $(OTHER_CROSS_PACKAGES)) + PDIRS = $(foreach i,$(filter %-$(TARGET), $(CROSS_PACKAGES)),debian/$(i)) +endif + +stamp-dir: + if [ -d $(stampdir) ]; then true; else mkdir $(stampdir); fi --- gcc-2.95-2.95.4.ds15.orig/debian/rules.parameters +++ gcc-2.95-2.95.4.ds15/debian/rules.parameters @@ -0,0 +1,15 @@ +# configuration parameters taken from upstream source files +VER := 2.95.4 +DPKGVER := 2.95.4-26 +SONAME := 2.10 +LGPSONAME := 2.8.1.3 +PKG_SONAME := 2.10-glibc2.2 +PKG_DEV_SONAME := 2.10 +lib_version := 2.10.0 +lib_pkg_req_version:= 1:2.95.4-15 +lgp_version := 2.8.1.3 +LGP_PKG_SONAME := 2.8.1.3-glibc2.2 +LGP_PKG_DEV_SONAME:= 2.8.1.3 +LIBC_IF := -libc6.2- +CXX_IF := 2 +LIBSTDCXX_IF := 3 --- gcc-2.95-2.95.4.ds15.orig/debian/control.native +++ gcc-2.95-2.95.4.ds15/debian/control.native @@ -0,0 +1,255 @@ +Source: gcc-2.95 +Section: devel +Priority: optional +Maintainer: Debian GCC maintainers +Uploaders: Matthias Klose , Thiemo Seufer +Standards-Version: 3.7.2 +Build-Depends: dejagnu (>= 1.4), bzip2, binutils (>= 2.11.90.0.1-1), debhelper (>= 3.0.25), gperf (>= 2.7-3), autoconf2.13, bison-1.35, flex-old, gettext, texinfo, libgc-dev [!avr !hppa !hurd-i386], libncurses-dev, libgmp3-dev, help2man, dpkg-dev (>= 1.13.9) + +Package: gcc-2.95 +Architecture: any +Depends: ${shlibs:Depends}, cpp-2.95 (>= 1:2.95.4), cpp-2.95 (<< 1:2.95.5), binutils (>= 2.11.90.0.1-1) +Conflicts: libc5-dev, egcc (<< 2.91.63-1.1) +Replaces: egcc +Provides: c-compiler +Recommends: libc-dev +Suggests: gcc-2.95-doc (>= 1:2.95.4) +Description: The GNU C compiler + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This is the GNU C compiler, a fairly portable optimizing compiler which + supports multiple languages. This package includes support for C, C++, + and Objective C. + +Package: cpp-2.95 +Architecture: any +Section: interpreters +Depends: ${shlibs:Depends} +Replaces: g++ (<< 2.91.63-1.1) +Description: The GNU C preprocessor + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + The GNU C preprocessor is required by some utilities that use it for + macro substitutions. This package has been separated from gcc for + the benefit of those who require the preprocessor but not the + compiler. + +Package: cpp-2.95-doc +Architecture: all +Section: doc +Priority: optional +Conflicts: cpp-doc (<< 1:2.95.3) +Replaces: cpp (<= 1:2.93.12), cpp-doc (<< 1:2.95.3) +Description: Documentation for the GNU C preprocessor (cpp) + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + Documentation for the GNU C preprocessor in info format. + +Package: g++-2.95 +Architecture: any +Priority: optional +Provides: c++-compiler +Depends: ${shlibs:Depends}, gcc-2.95 (>= 1:2.95.4), gcc-2.95 (<< 1:2.95.5), libstdc++2.10-dev (>= 1:2.95.4) +Suggests: task-c++-devel +Replaces: gcc (<= 2.7.2.3-3) +Suggests: gcc-2.95-doc (>= 1:2.95.4) +Description: The GNU C++ compiler + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This is the GNU C++ compiler, a fairly portable optimizing compiler for C++. + +Package: gobjc-2.95 +Architecture: any +Priority: optional +Suggests: gcc-2.95-doc (>= 1:2.95.4) +Recommends: libgc-dev +Depends: ${shlibs:Depends}, gcc-2.95 (>= 1:2.95.4), gcc-2.95 (<< 1:2.95.5) +Provides: objc-compiler +Description: The GNU Objective-C compiler + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This is the GNU Objective-C compiler, which compiles + Objective-C on platforms supported by the gcc compiler. It uses the + gcc backend to generate optimized code. + +Package: g77-2.95 +Architecture: any +Priority: optional +Suggests: g77-2.95-doc +Depends: ${shlibs:Depends}, gcc-2.95 (>= 1:2.95.4), gcc-2.95 (<< 1:2.95.5) +Provides: fortran77-compiler +Description: The GNU Fortran 77 compiler + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This is the GNU g77 Fortran compiler, which compiles + Fortran 77 on platforms supported by the gcc compiler. It uses the + gcc backend to generate optimized code. + +Package: g77-2.95-doc +Architecture: all +Section: doc +Priority: optional +Conflicts: g77-doc (<< 1:2.95.3) +Replaces: g77 (<= 1:2.91.58-3), g77-doc (<< 1:2.95.3) +Description: Documentation for the GNU Fortran compiler (g77) + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + Documentation for the GNU Fortran 77 compiler in info format. + +Package: chill-2.95 +Architecture: any +Priority: extra +Replaces: chill +Provides: chill, chill-compiler +Depends: ${shlibs:Depends}, gcc-2.95 (>= 1:2.95.4), gcc-2.95 (<< 1:2.95.5) +Description: The GNU CHILL compiler + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This is the ITU CHILL compiler. CHILL is the "CCITT High-Level Language", + where CCITT is the old name for what is now ITU, the International + Telecommunications Union. + . + It is a language in the Modula-2 family, and targets many of the + same applications as Ada (especially large embedded systems). + CHILL was never used much in the United States, but is still + being used in Europe, Brazil, Korea, and other places. + +Package: libstdc++2.10-glibc2.2 +Architecture: any +Section: libs +Priority: optional +Depends: ${shlibs:Depends} +Description: The GNU stdc++ library + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This package contains an additional runtime library for C++ programs + built with the GNU compiler. + +Package: libstdc++2.10-dev +Architecture: any +Section: libdevel +Priority: optional +Depends: libstdc++2.10-glibc2.2 (>= 1:2.95.4), libc6-dev (>= 2.1.95) | libc-dev, g++-2.95 (>= 1:2.95.4) +Provides: libstdc++-dev +Conflicts: libg++27-dev, libg++272-dev (<< 2.7.2.8-1), libstdc++2.8-dev, libg++2.8-dev, libstdc++2.9-dev, libstdc++2.9-glibc2.1-dev +Suggests: stl-manual +Description: The GNU stdc++ library (development files) + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This package contains the headers and static library files necessary for + building C++ programs which use libstdc++. Be advised that this only works + with the GNU C++ compiler (version 2.95), and no earlier library will work it. + +Package: libstdc++2.10-dbg +Architecture: any +Section: libdevel +Priority: extra +Depends: libstdc++2.10-glibc2.2, libstdc++2.10-dev +Description: The GNU stdc++ library (debugging files) + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This package contains the shared library of libstdc++ compiled with debugging + symbols. + +Package: libg++2.8.1.3-glibc2.2 +Architecture: any +Section: libs +Priority: optional +Depends: ${shlibs:Depends} +Provides: libg++ +Conflicts: libg++2.9 (<< 2.91.56) +Replaces: libg++2.9 (<< 2.91.56), libg++2.9-ss (<< 2.91.56), libstdc++2.8-dev (<= 2.90.29-0.5) +Description: The GNU C++ extension library - runtime version + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This package contains the runtime version of the GNU classes. + +Package: libg++2.8.1.3-dev +Architecture: any +Section: libdevel +Priority: extra +Depends: libg++2.8.1.3-glibc2.2 (>= 1:2.95.4) +Provides: libg++-dev +Conflicts: libg++27-dev, libg++272-dev (<< 2.7.2.8-1), libg++2.8-dev, libg++2.9-dev (<< 2.91.56), libg++2.8.2-dev, libg++2.8.2-glibc2.1-dev +Replaces: libg++2.9-dev (<< 2.91.56), libg++2.8.2-dev, libg++2.8.2-glibc2.1-dev +Description: The GNU C++ extension library - development files + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This package contains some GNU classes. + . + This package is no longer supported upstream (as most of its + functionality is now in the standard C++ library) - do not use this + +Package: libg++2.8.1.3-dbg +Architecture: any +Section: libdevel +Priority: extra +Depends: libg++2.8.1.3-glibc2.2, libg++2.8.1.3-dev +Description: The GNU C++ extension library - debugging files + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This package contains a shared library with some GNU classes compiled + with debugging symbols. + . + This package is no longer supported upstream (as most of its + functionality is now in the standard C++ library) - do not use this + for development of new software; use libstdc++ instead. + +Package: gcc-2.95-doc +Architecture: all +Section: doc +Priority: optional +Conflicts: gcc-docs (<< 2.95.2), egcs-docs (<< 2.95), gcc-doc (<< 1:2.95.3) +Replaces: gcc (<=2.7.2.3-4.3), egcs-docs (<< 2.95), gcc-docs (<< 2.95.2), gcc-doc (<< 1:2.95.3) +Provides: gcc-docs, egcs-docs +Description: Documentation for the GNU compilers (gcc, gobjc, g++) + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + Documentation for the GNU compilers in info format. + +Package: gpc-2.95 +Architecture: any +Priority: optional +Recommends: libgmp3-dev, libncurses5-dev +Suggests: gpc-2.95-doc (>= 1:2.95.4) +Depends: ${shlibs:Depends}, gcc-2.95 (>= 1:2.95.4), gcc-2.95 (<< 1:2.95.5) +Provides: pascal-compiler +Description: The GNU Pascal compiler + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + This is the GNU Pascal compiler, which compiles + Pascal on platforms supported by the gcc compiler. It uses the + gcc backend to generate optimized code. + . + The current beta release 2.2 implements Standard Pascal (ISO 7185, + level 1), a large subset of Extended Pascal (ISO 10206), and + Borland Pascal. Many Borland Pascal units supported. + +Package: gpc-2.95-doc +Architecture: all +Section: doc +Priority: optional +Conflicts: gpc-doc (<< 1:2.95.3) +Replaces: gpc (<= 2.91.58-3), gpc-doc (<< 1:2.95.3) +Description: Documentation for the GNU Pascal compiler (gpc) + NOTE: This is not a final release, but taken from the CVS gcc-2_95-branch + (dated 2001-10-02). + . + Documentation for the GNU Pascal compiler in info format. + --- gcc-2.95-2.95.4.ds15.orig/debian/rules.patch +++ gcc-2.95-2.95.4.ds15/debian/rules.patch @@ -0,0 +1,233 @@ +# -*- makefile -*- +# rules to patch the unpacked files in the source directory +# --------------------------------------------------------------------------- +# various rules to unpack addons and (un)apply patches. +# - patch / apply-patches +# - unpatch / reverse-patches + +# all_patches - check if all patches apply cleanly +# min_patches - build without "code changing" patches: vanilla 2.95.x + +patchdir = debian/patches + +ifneq ($(TARGET),native) +DEB_HOST_ARCH = $(TARGET) +endif + +# which patches should be applied? +#debian_patches = #vendor +#debian_patches += patch-kit + +debian_patches = gcc-version glibc-version +all_patches = gcc-version +min_patches = + +ifneq ($(TARGET),native) + debian_patches += cross-libc-version +endif + +ifeq ($(with_java),yes) + ifeq ($(SNAPSHOT),no) + debian_patches += gcj-debian-policy + else + debian_patches += gcj-2.96-debian-policy + endif +endif +all_patches += gcj-debian-policy +min_patches += gcj-debian-policy + +ifeq ($(with_libgpp),yes) + debian_patches += libg++-update +endif +all_patches += libg++-update +min_patches += libg++-update + +#ifeq ($(with_check),yes) +# debian_patches += testsuite-current +#endif +#all_patches += testsuite-current +#min_patches += testsuite-current + +ifeq ($(with_check),yes) + debian_patches += testsuite-3.0 +endif +all_patches += testsuite-3.0 +min_patches += testsuite-3.0 + +ifeq ($(SNAPSHOT),no) +debian_patches += bootstrap cpp-macro-doc \ + gcc-default-arch \ + libstdc++-out-of-mem libstdc++-wstring \ + libstdc++-bastring \ + gcc-manpage cpp-dos-newlines libio-doc gcc-doc \ + strength-red gcc-messages gcc4-fix +all_patches += bootstrap cpp-macro-doc \ + gcc-default-arch \ + libstdc++-out-of-mem libstdc++-wstring \ + libstdc++-bastring \ + gcc-manpage cpp-dos-newlines libio-doc gcc-doc \ + strength-red gcc-messages gcc4-fix +min_patches += bootstrap cpp-macro-doc \ + libio-doc gcc-doc + +ifneq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),alpha s390)) + debian_patches += gcc-gas-hidden + all_patches += gcc-gas-hidden +endif + +# fsirl patch: temporarily disabled for alpha +ifneq ($(DEB_HOST_GNU_CPU),alpha) + debian_patches += ppc-fsirl-updates + all_patches += ppc-fsirl-updates +else + # these are included in the fsirl patch + debian_patches += gcc-weaksym + all_patches += gcc-weaksym +endif + +ifeq ($(versioned_packages),yes) + debian_patches += gcc-names libio-names +endif +all_patches += gcc-names libio-names +min_patches += gcc-names libio-names + +ifeq ($(versioned_packages)-$(with_chill),yes-yes) + debian_patches += chill-names +endif +all_patches += chill-names +min_patches += chill-names + +ifeq ($(with_fortran),yes) + debian_patches += g77-docs libf2c-mkstemp + ifeq ($(versioned_packages),yes) + debian_patches += g77-names + endif +endif +all_patches += g77-docs g77-names libf2c-mkstemp +min_patches += g77-names + +ifeq ($(with_objc),yes) + debian_patches += libobjc objc-data-references +endif +all_patches += libobjc objc-data-references +min_patches += libobjc + +ifeq ($(with_java),yes) + debian_patches += gcj-vs-iconv +endif +all_patches += gcj-vs-iconv + +debian_patches += reporting # applied after gcc-cvs-updates +all_patches += reporting # applied after gcc-cvs-updates + +#debian_patches += gcc-empty-struct-init +#all_patches += gcc-empty-struct-init + +ifeq ($(with_pascal),yes) + debian_patches += gpc-2.95 gpc-update-makefile gpc-update9 + ifeq ($(versioned_packages),yes) + debian_patches += gpc-names + endif +endif +all_patches += gpc-2.95 gpc-names +min_patches += gpc-2.95 gpc-names + +ifeq ($(DEB_HOST_GNU_CPU),alpha) + debian_patches += gcc-alpha-complex-float +endif +all_patches += gcc-alpha-complex-float + +ifeq ($(DEB_HOST_ARCH),arm) + debian_patches += arm-pic arm-nested-func arm-various arm-exception \ + arm-const-double arm-tune arm-output-int libgcc-umodsi3 \ + arm-profile arm-gcc4-fix +endif +ifeq ($(DEB_HOST_ARCH),armeb) + debian_patches += arm-pic arm-nested-func arm-various arm-exception \ + arm-const-double arm-tune arm-output-int libgcc-umodsi3 \ + arm-profile arm-gcc4-fix arm-big-endian +endif +all_patches += arm-pic arm-nested-func arm-various arm-exception \ + arm-const-double arm-tune arm-output-int libgcc-umodsi3 \ + arm-profile arm-gcc4-fix arm-big-endian + +ifeq ($(DEB_HOST_ARCH),m68k) + debian_patches += 68060-build gcc-m68k-pic m68k-md m68k-reload g77-m68k-pic +endif +all_patches += 68060-build gcc-m68k-pic m68k-md m68k-reload + +ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),mips mipsel)) + debian_patches += gcc-mips-linux gcc-mips-linux-abi gcc-mips-linux-ctors \ + gcc-mips-mad gcc-mips-reg_zero +endif +all_patches += gcc-mips-linux gcc-mips-linux-abi gcc-mips-linux-ctors \ + gcc-mips-mad gcc-mips-reg_zero + +ifeq ($(DEB_HOST_ARCH),powerpc) +# debian_patches += +endif +#all_patches += + +ifeq ($(DEB_HOST_ARCH),sparc) + debian_patches += sparc32-rfi builtin-apply #sparc-bi-arch +endif +all_patches += sparc32-rfi builtin-apply #sparc-bi-arch + +endif + +ifeq ($(TARGET),avr) + debian_patches += gcc-core-2.95.2-avr-1.1 +endif +# conflicts with gcc-s390 +#all_patches += gcc-core-2.95.2-avr-1.1 + +ifeq ($(DEB_HOST_ARCH),s390) + debian_patches += gcc-s390 +endif +# conflicts with gcc-core-2.95.2-avr-1.1 +#all_patches += gcc-s390 + +debian_patches += p-make-lang + +# testing only +#debian_patches := $(all_patches) +#debian_patches := $(min_patches) + +patch: $(patch_stamp) + echo $(debian_patches) +apply-patches: $(patch_stamp) + +$(patch_stamp)-$(TARGET): $(unpack_stamps) \ + $(foreach p,$(debian_patches),$(patch_stamp)-$(TARGET)-$(p)) + echo -e "\nPatches applied in this version:" > pxxx + for i in $(debian_patches); do \ + echo -e "\n$$i:" >> pxxx; \ + sed -n 's/^# *DP: */ /p' debian/patches/$$i.dpatch >> pxxx; \ + done + mv -f pxxx $@ + +reverse-patches: unpatch +unpatch: + for stamp in none `ls -1t $(patch_stamp)-*`; do \ + case "$$stamp" in none|patched-stamp|patched-\*) continue; esac; \ + patch=`echo $$stamp | sed -e 's,$(patch_stamp)-,,'`; \ + echo "trying to revert patch $$patch ..."; \ + if [ -x $(patchdir)/$$patch.dpatch ]; then true; else \ + chmod +x $(patchdir)/$$patch.dpatch; fi; \ + if $(patchdir)/$$patch.dpatch -unpatch -d $(srcdir); then \ + echo "reverted $$patch patch."; \ + rm -f $$stamp; \ + else \ + echo "error in reverting $$patch patch."; \ + exit 1; \ + fi; \ + done + rm -f patched-stamp + +$(patch_stamp)-$(TARGET)-%: $(patchdir)/%.dpatch + if [ -x $< ]; then true; else chmod +x $<; fi + if [ -f $@ ]; then \ + echo "$* patches already applied."; exit 1; \ + fi + $< -patch -d $(srcdir) + echo "$* patches applied." > $@