Issue with the Apple LLVM compiler 3.0...

Member
Posts: 129
Joined: 2009.03
Post: #1
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?
Quote this message in a reply
Member
Posts: 129
Joined: 2009.03
Post: #2
Just to expand a little...

It all works fine when I compile with GCC (arm6 and arm7) or LLVM - arm7.
It only doesn't work when I compile with LLVM - arm6.
Quote this message in a reply
Member
Posts: 440
Joined: 2002.09
Post: #3
I hear there are problems on armv6 when thumb is enabled and optimizations are set higher than -O0.
Quote this message in a reply
Member
Posts: 129
Joined: 2009.03
Post: #4
Hi Frank,

I had it on optimization level 0 (debug). Anyhow, it turns out it is a bug in the ARM6 code generated by LLVM (relating to the indexes for accessing class variables). Have filed a bug report with Apple.

If it wasn't for older devices, I could just do away with ARM6. I wonder what % of active devices (people buying games) are ARM6 these days? Are there any stats on that?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
This wasn't thumb code by the way. The bug was to do with storing to an ivar more than some number of bytes into an object.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  what compiler for iPhone OS 3.0? captainfreedom 4 5,264 Dec 21, 2010 02:37 AM
Last Post: Frank C.
  Accessing the GCC compiler flags Madrayken 6 5,655 Sep 19, 2009 01:18 AM
Last Post: OneSadCookie