I ran across this comment as well, so I turned on all warnings and tried to fix everything in Bullet that caused a warning - especially the uninitialized variables. Unfortunately it didn't appear to fix anything. :/gleemer wrote:I found this on the box2d board:
Porting to iphone myself.
O3 is definately the fastest, along with disabled thumb. The problem here is, with O3 you need to always initialize your variables fully.
This is because the fastest, smallest flag actually uses a local stack, and doesn't assume that new variables will be null.
By making sure all variables are nulled to begin with, you will avoid bugs with O3. Its all about making sure that new vars are not pointing to some garbage, but to null. If you make it null, it will work fine.
I think Box2D is a little lazy in places and doesn't always initialise variables with null or a value and this is why it breaks. I pulled this info off Apple site someplace, can't remember where.
iPhone and Thumb stuff
Re: iPhone and Thumb stuff
Re: iPhone and Thumb stuff
After significant trial and error, I determined that adding the following GCC flag gets rid of the problem:
-fno-regmove
I can now compile with -O3 as long as I also disable that particular optimization and everything appears to work as expected. Anyone have any idea what kind of code would cause that optimization to fail or are we maybe seeing a bug in the compiler?
EDIT: I submitted this to Apple, but since I can't figure out a good way to narrow down where, exactly, the code goes wrong, I had to attach my entire project. I don't know if that'll help them or not, but at this point it feels an awful lot like a compiler bug.
-fno-regmove
I can now compile with -O3 as long as I also disable that particular optimization and everything appears to work as expected. Anyone have any idea what kind of code would cause that optimization to fail or are we maybe seeing a bug in the compiler?
EDIT: I submitted this to Apple, but since I can't figure out a good way to narrow down where, exactly, the code goes wrong, I had to attach my entire project. I don't know if that'll help them or not, but at this point it feels an awful lot like a compiler bug.
Re: iPhone and Thumb stuff
I ran into a compiler bug that may be a dup of this bug. I fixed it by "outlining" my code (i.e., pull the offending code into a function and call it). I'm guessing there's some form of scheduling bug in -O2. I'll have to try the -fno-regmove toy.
Re: iPhone and Thumb stuff
Hi!
I tried the trick with -fno-regmove flag, and it now compiles and run fine with -O3 option.
Thanks for it
I tried the trick with -fno-regmove flag, and it now compiles and run fine with -O3 option.
Thanks for it
Re: iPhone and Thumb stuff
Hi,
I've just encountered this issue with the latest version (2.75) on the Iphone\Ipod Touch. The suggested compiler settings worked.
Erwin: I'm happy to help nut down why this is occuring. I can provide my solution or try the things requested if you'd like help with this.
My project uses Irrlicht and Bullet. I haven't noticed any weird issues with Irrlicht, so it could be something with Bullet?
Bino
I've just encountered this issue with the latest version (2.75) on the Iphone\Ipod Touch. The suggested compiler settings worked.
Erwin: I'm happy to help nut down why this is occuring. I can provide my solution or try the things requested if you'd like help with this.
My project uses Irrlicht and Bullet. I haven't noticed any weird issues with Irrlicht, so it could be something with Bullet?
Bino