• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: XCode 2.2.1 / gcc 4.0 Peephole Bug
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Mon, 24 Apr 2006 04:42:02 -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.

http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/gcc/Local-Labels.html

Try compiling this function in XCode:

static int test(int a, int b, int c) {
if (a > b) goto mylabel;


return 1;


__label__ mylabel: return 0;
}

XCode goes into an infinite loop when I  try to compile this  Granted, it's not the correct syntactic use of the keyword __label__,  but the compiler should still handle it gracefully... And even when the __label keyword__ is properly used, it still fails to work around the original bug, which it seems is related to the inline assember. For example, the following function compiles just fine:

static int thisworks(int a, int b, int c) {
if (a > b) goto mylabel;
if (b > c) goto mylabel;


return 1;


mylabel: return 0;
}

but this one generates an error:

static int thisdoesntwork(int a, int b, int c) {
asm { cmplw a, b; bgt mylabel; }
asm { cmplw b, c; bgt mylabel; }


return 1;


mylabel: return 0;
}

Does it do the same thing there? Any ideas?

Ben
 _______________________________________________
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

References: 
 >Undefined constants from pch (From: Steve Mills <email@hidden>)
 >XCode 2.2.1 / gcc 4.0 Peephole Bug (From: Ben Weiss <email@hidden>)
 >Re: XCode 2.2.1 / gcc 4.0 Peephole Bug (From: Ben Weiss <email@hidden>)
 >Re: XCode 2.2.1 / gcc 4.0 Peephole Bug (From: Olivier Tristan <email@hidden>)

  • Prev by Date: Re: Database Development
  • Next by Date: Re: Database Development
  • Previous by thread: Re: XCode 2.2.1 / gcc 4.0 Peephole Bug
  • Next by thread: Re: XCode 2.2.1 / gcc 4.0 Peephole Bug
  • Index(es):
    • Date
    • Thread