Sender: rich AT phekda DOT freeserve DOT co DOT uk Message-ID: <3EABA5AA.99B8EDE3@phekda.freeserve.co.uk> Date: Sun, 27 Apr 2003 10:40:58 +0100 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: Ben Peddell , rudd AT cyberoptics DOT com CC: DJGPP workers Subject: gcc 3.x breaks ABI compatibility? [Was: Re: Bug 00314 -- div() still broken] References: <3e9c6920$0$21928$afc38c87@> <3EA5477F DOT 2020901 AT cyberoptics DOT com> <3ea85d95$0$12489$4c41069e AT reader1 DOT ash DOT ops DOT us DOT uu DOT net> <3ea97d4c$0$19415$4c41069e AT reader1 DOT ash DOT ops DOT us DOT uu DOT net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Hello. Ben Peddell wrote: [snip] > OK. GCC 3.2.1 has -fpcc-struct-return by default in DJGPP, whilst GCC > 3.2.2 has -freg-struct-return by default in DJGPP. > GCC 3.2.2 may need to be configured to make -fpcc-struct-return the > default, to maintain compatibility with the DJGPP 2.03 libraries. Or, > the libraries may need to be re-compiled for GCC 3.2.2, and marked as such. > > These options are in `info gcc "Invoking GCC" "Code Gen Options"' After rummaging around a bit more: It's possible that 3.2.1 was broken. There were some ABI regressions in 3.2.1 that were fixed in 3.2.2: http://gcc.gnu.org/gcc-3.2/changes.html#3.2.2 PR/9506 is the one: http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=9506 gcc defaults to using -fpcc-struct-return, but what does it actually use for 2.95.2 and 3.2.2? I've just looked at the gcc 2.95.2 sources and it looks like -fpcc-struct-return (i.e.: use memory) is the default there. The gcc 3.2.2 source seems to default to using registers. See the end gcc/config/i386/djgpp.h: /* Don't default to pcc-struct-return, because gcc is the only compiler, and we want to retain compatibility with older gcc versions. */ #define DEFAULT_PCC_STRUCT_RETURN 0 Why is this defined? I couldn't see a ChangeLog entry for djgpp.h. AFAICT this breaks backwards compatibility, i.e.: the opposite of what the comment says. Is there something I'm missing? Thanks, bye, Rich =] -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]