Re: XCode 2.2.1 / gcc 4.0 Peephole Bug
Re: XCode 2.2.1 / gcc 4.0 Peephole Bug
- Subject: Re: XCode 2.2.1 / gcc 4.0 Peephole Bug
- From: Ben Weiss <email@hidden>
- Date: Wed, 19 Apr 2006 02:23:17 -0700
On Apr 19, 2006, at 1:56 AM, Olivier Tristan wrote:
Ben Weiss wrote:
All right, so I tried it in assembly, and ran into another bug (I
think):
Given the function:
static int duplicatelabelbug(register vector unsigned short a,
register vector unsigned short b) {
register vector unsigned short vmask;
asm { vcmpgtuh. vmask, a, b; beq cr6, mylabel; };
asm { vcmpgtuh. vmask, b, a; beq cr6, mylabel; }; // <--
duplicate label??
return 0;
mylabel: return 1; // <-- label only defined once, here!
}
XCode 2.2.1 / gcc 4.0 generates: "error: duplicate label 'LASM
$mylabel' " even though the label "mylabel" is only defined once.
(CodeWarrior handles this code just fine.) Is this a gcc bug?
Hi,
It seems that this function is inlined so it duplicates the label.
You should use gcc local label
However I never used those.
Olivier,
I don't think that's the problem... This function is just a compiler
test; it's never called from anywhere, inline or otherwise. And the
actual problematic function in my codebase is huge and definitely not
inlined. (It also doesn't explain the fact that when the second line
of assembly is removed, the problem disappears.)
Thanks for the idea though... I'll see if I can make local labels
work with this somehow. The other workaround is to make several label
names and put them all in the same place, which I've verified works
around the bug, but I'd still like to see it fixed. :-/
Ben
http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/
gcc/Local-Labels.html
Hope this helps.
--
Olivier Tristan
Ultimate Sound Bank
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden