public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Minimum GCC version to safely compile 64-bit binaries for AMD64?
@ 2005-08-31 17:52 Neil Ferguson
  2005-09-04  0:19 ` Bob Proulx
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Ferguson @ 2005-08-31 17:52 UTC (permalink / raw)
  To: gcc-help

Hi -

We are considering buying some AMD64 machines, but are presently standardised 
on GCC 3.3. We're one of those places that finds a version that works for us 
and sticks with it, so an update is hard to sell. People are especially leery 
of the latest stable release - we like our compilers to have been out there 
for a while, on the basis that they're more likely to have been exposed to 
everything the users could throw at them.

Can GCC 3.3 compile 64-bit binaries that work reliably on AMD64?

What would the minimum recommended version of GCC be? (I'd be curious to know 
even if GCC 3.3 is OK, for my own historical interest.)

I've tried searching gcc.gnu.org and with Google, but I'm having trouble 
finding an authoritative answer. As one would expect, the current up-front 
information on the GCC site focuses on 3.4 and 4.0.

Neil.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Minimum GCC version to safely compile 64-bit binaries for AMD64?
  2005-08-31 17:52 Minimum GCC version to safely compile 64-bit binaries for AMD64? Neil Ferguson
@ 2005-09-04  0:19 ` Bob Proulx
  2005-09-06 14:10   ` Neil Ferguson
  0 siblings, 1 reply; 4+ messages in thread
From: Bob Proulx @ 2005-09-04  0:19 UTC (permalink / raw)
  To: gcc-help

Neil Ferguson wrote:
> Can GCC 3.3 compile 64-bit binaries that work reliably on AMD64?

You might find it comforting to know that the Debian GNU/Linux port to
amd64 compiled almost all of the thousands of packages in Debian using
the gcc 3.3.5 compiler.  (It's unofficial because Debian has yet to
include the port in their mainstream yet.  That part is happening now.)

> What would the minimum recommended version of GCC be? (I'd be curious to 
> know even if GCC 3.3 is OK, for my own historical interest.)

Of course as bug fixes and enhancements are made the best version
increases version number.  So while 3.3 is probably okay depending
upon what you are doing that does not mean that bugs don't exist.
Version 3.4 is better and version 4.0 is better and so on and so on.

Probably the best thing is to just push forward and see how it goes.

If this is your first push into 64-bit space then the biggest problems
will be type safety in your code.

Bob

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Minimum GCC version to safely compile 64-bit binaries for AMD64?
  2005-09-04  0:19 ` Bob Proulx
@ 2005-09-06 14:10   ` Neil Ferguson
  2005-09-06 15:23     ` Bob Proulx
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Ferguson @ 2005-09-06 14:10 UTC (permalink / raw)
  To: gcc-help

Bob Proulx wrote:
> Neil Ferguson wrote:
> 
>>Can GCC 3.3 compile 64-bit binaries that work reliably on AMD64?
> 
> You might find it comforting to know that the Debian GNU/Linux port to
> amd64 compiled almost all of the thousands of packages in Debian using
> the gcc 3.3.5 compiler.  (It's unofficial because Debian has yet to
> include the port in their mainstream yet.  That part is happening now.)

Thank you; that *is* good to know.

>>What would the minimum recommended version of GCC be? (I'd be curious to 
>>know even if GCC 3.3 is OK, for my own historical interest.)
> 
> Of course as bug fixes and enhancements are made the best version
> increases version number.  So while 3.3 is probably okay depending
> upon what you are doing that does not mean that bugs don't exist.
> Version 3.4 is better and version 4.0 is better and so on and so on.

I understand.

> Probably the best thing is to just push forward and see how it goes.
> 
> If this is your first push into 64-bit space then the biggest problems
> will be type safety in your code.

It is our first push into 64-bit, and yes, you're right :)

I continued my investigation after posting to the list, and came across a 
couple of small points that might be useful to anyone else faced with the 
issue. First, the lowest version number of GCC recommended in the AMD 
documentation was GCC 3.3.3. Link to "Compiler Usage Guidelines for 64-bit 
Operating Systems on AMD64 Platforms":

 
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32035.pdf

see pages 17 (64-bit mode) and 28 (32-bit mode). These sections contain 
guidelines on useful compilation options and so forth.

There are also a couple of papers in the Proceedings of the GCC Developers 
Summit 2003 which may be of interest - "Porting to 64-bit GNU/Linux Systems" 
by Andreas Jaeger (pages 107-120) and "Porting GCC to the AMD64 Architecture" 
by Jan Hubicka (pages 79-105). These used to be available here:

     http://www.linux.org.uk/~ajh/gcc/gccsummit-2003-proceedings.pdf

but the link wasn't working when I tried it (I happen to have paper copies on 
my desk).

Neil.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Minimum GCC version to safely compile 64-bit binaries for AMD64?
  2005-09-06 14:10   ` Neil Ferguson
@ 2005-09-06 15:23     ` Bob Proulx
  0 siblings, 0 replies; 4+ messages in thread
From: Bob Proulx @ 2005-09-06 15:23 UTC (permalink / raw)
  To: gcc-help

Neil Ferguson wrote:
> Bob Proulx wrote:
> >If this is your first push into 64-bit space then the biggest problems
> >will be type safety in your code.
> 
> It is our first push into 64-bit, and yes, you're right :)

As a living I spend a lot of time supporting and porting legacy code.
I am really hoping you have a good set of tests to use.  Because it is
very painful to work with old code without any tests.  :-{

I suggest that you use at least these options to compile your
programs.  Then fix all of the warnings that are produced.

  gcc -Wall -Wmissing-prototypes -Wstrict-prototypes

In my opinion requiring prototypes for all of your code is an absolute
must and doubly so when porting from 32-bit to 64-bit.  It is just too
easy to find the original author using malloc() without a prototype in
scope or a list of other things.

Also remove any type casts from your code.  They are almost not needed
in any modern era programs.  They are a legacy holdover from a time
before prototypes.  But people are still in the habit of using them.
But legacy code tends to be full of them.

Those are my best suggestions for the moment.

Bob

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-06 15:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-31 17:52 Minimum GCC version to safely compile 64-bit binaries for AMD64? Neil Ferguson
2005-09-04  0:19 ` Bob Proulx
2005-09-06 14:10   ` Neil Ferguson
2005-09-06 15:23     ` Bob Proulx

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).