This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/53199] __builtin_bswap64 and __builtin_bswap32 generate errors if -mcpu=power6
- From: "meissner at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 02 May 2012 19:16:26 +0000
- Subject: [Bug target/53199] __builtin_bswap64 and __builtin_bswap32 generate errors if -mcpu=power6
- Auto-submitted: auto-generated
- References: <bug-53199-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53199
--- Comment #1 from Michael Meissner <meissner at gcc dot gnu.org> 2012-05-02 19:16:26 UTC ---
If you compile the following with -mcpu=power6 -m64:
long long
b64 (long long *p)
{
return __builtin_bswap64 (*p);
}
Using the -mno-avoid-indexed-addresses works around the problem. Setting
cpu=power5 works because -mcpu=power5 does not set -mavoid-indexed-addresses by
default. Setting -mcpu=power7 works because the power7 has a 64-bit load and
reverse bytes instruction.