Problems with Apple LLVM compiler 3.0

Discussion in 'Game Development (Technical)' started by Jamie W, Dec 8, 2011.

  1. Jamie W

    Original Member Indie Author

    Joined:
    Apr 16, 2006
    Messages:
    1,211
    Likes Received:
    0
    Hello,

    Is anyone else having issues with the Apple LLVM compiler 3.0? (iOS Xcode 4.2).

    I've just had (something like) the following C++ code running:

    void
    Class::Function()
    {
    WORD Var;

    Var = m_Var++;
    // do something with Var..
    }

    Okay, so m_Var is a member of class 'Class'.

    When I run this code, compiled with the Apple LLVM compiler 3.0, Var is set, but m_Var is not incremented.

    When I switch to the LLVM GCC 4.2 compiler, it works (is incremented).

    What's going on? Is the Apple LLVM compiler 3.0 buggy?
     
  2. bantamcitygames

    Administrator Original Member Indie Author Greenlit

    Joined:
    Jul 27, 2004
    Messages:
    1,737
    Likes Received:
    79
    I don't know Apple LLVM at all, but what is m_Var initialized to? Some compilers may init to zero, some may not.
     
  3. Jamie W

    Original Member Indie Author

    Joined:
    Apr 16, 2006
    Messages:
    1,211
    Likes Received:
    0
    m_var is set initially to 2, outside the scope of this function, before it gets called..
     
  4. Jamie W

    Original Member Indie Author

    Joined:
    Apr 16, 2006
    Messages:
    1,211
    Likes Received:
    0
  5. Jamie W

    Original Member Indie Author

    Joined:
    Apr 16, 2006
    Messages:
    1,211
    Likes Received:
    0
    Turns out it is a bug in the ARM6 code generated by LLVM. Have filed a bug report with Apple. Feel free to close this thread.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer