This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bit manipulation on PowerPC
- To: <mwilliams at ase-tech-usa dot com>
- Subject: Re: Bit manipulation on PowerPC
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: 05 Feb 2001 22:43:59 -0800
- CC: gcc-bugs at gcc dot gnu dot org
- References: <852569E7.00825876.00@kxnts2.ase-tech-usa.com>
<mwilliams@ase-tech-usa.com> writes:
> Symptoms:
> When optimization is enabled, a bit manipulation expression compiles to
> incorrect assembly code. Given the value 0x00010001, the expression should
> produce 0x00000101. The assembly code produces 0x00000100. The bug
> appears to occur only when the expression is evaluated in place (i.e. using
> a single register).
>
> Version:
> Reading specs from
> C:\Tornado\host\x86-win32\lib\gcc-lib\powerpc-wrs-vxworks\cygnus-2.7.2-9601
> 26\specs
> gcc driver version cygnus-2.7.2-960126 egcs-971225 tornado 2.0 executing
> gcc version cygnus-2.7.2-960126
>
> System:
> Pentium III host running Windows 98, targeting embedded PowerPC 403 system
> running VxWorks 5.4
>
> Command line:
> gcc --save-temps -S -O1 bah.c
>
> File:
> # 1 "bah.c"
> unsigned long f(unsigned long x)
> {
> return ((x&0x003f0000)>>8)|(x&0x0000003f);
> }
This is fixed in current compilers. You should upgrade, if you can.
--
- Geoffrey Keating <geoffk@geoffk.org>