This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: i686 architecture behaviour in gcc
- From: Jim Wilson <wilson at specifix dot com>
- To: David Fernandez <dfernandez at cct dot co dot uk>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 02 Mar 2006 16:59:57 -0800
- Subject: Re: i686 architecture behaviour in gcc
- References: <1141307124.6356.38.camel@software.cct.co.uk>
David Fernandez wrote:
Can anyone explain why has been chosen that -march=i686 makes the
compiler change the normal behaviour, and zero-expand unsigned short
parameters into 32-bit registers by all means?
You failed to mention the gcc version, and your testcase doesn't
actually use any unsigned short parameters unless you forgot to mention
something important, like a macro, or an uncommon command line option.
So I can't actually reproduce your problem with the testcase that you
gave unless I modify it.
Anyways, I've seen a similar problem reported before, so I am guessing
this is related to this patch:
http://gcc.gnu.org/ml/gcc-patches/2000-02/msg00890.html
So, yes, this was done for a good reason, because it results in faster
PentiumPro code on average. Though it does result in some unnecessary
extra instructions in some unfortunate cases, like this one. If you
don't have a PentiumPro processor, then you may not want to use this
option. Pentium 2 through 4 do not have this problem.
See also PR 15184 in our bugzilla database on our web site.
--
Jim Wilson, GNU Tools Support, http://www.specifix.com