• 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
Possible C++ optimizer problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Possible C++ optimizer problem


  • Subject: Possible C++ optimizer problem
  • From: David Dunham <email@hidden>
  • Date: Wed, 19 Jul 2006 15:51:14 -0700

We have one app which crashes on PowerPC release builds -- works fine on Intel, or with the debugger.

It's not our normal code base -- it uses STL and the C++ string class. In other words, lots of templates.

I spent a long time trying to figure this out, and could never track it down to a real point of failure. Every time it crashes, it looks like a C++ string is damaged (but this is pretty hard to debug, given the template-based implementation -- and the fact that it's very hard to debug a release build). I thought I came up with a workaround, but that just moved the crash.

Obvious differences between what works and what doesn't:

1. gcc 4 vs gcc 3.3
2. Optimization level -O0 vs -Os
3. A few conditional things like ASSERT
4. Debug symbols

I added debug symbols to my release build, and was able to do some debugging (Xcode kept getting very confused about call stacks, and wouldn't stop at all breakpoints or show some variables). So that's not it.

I tried -O1 and my PowerPC release build seemed to work.

I tried switching my PowerPC compiler (and SDK) to 4.0 (and 10.4u), and my PowerPC release build seemed to work.

It could just be a latent bug in the code, but the area that's problematic is from an open source project and presumably works OK.

So at the moment, I'm suspecting that there's an optimizer bug in gcc 3.3 PowerPC codegen which may manifest with templated code. Does this sound at all familiar to anyone? If I can track it down at all, is it worth a Radar (since Apple's moved on to 4.0)?

David Dunham   Macintosh Game Developer   GameHouse Studios
+1 206 926 5722                http://www.gamehouse.com
    "They said it couldn't be done but sometimes it doesn't
     work out that way." -- Casey Stengel


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

  • Follow-Ups:
    • Re: Possible C++ optimizer problem
      • From: Steve Checkoway <email@hidden>
  • Prev by Date: Re: Building a library using as universal for 10.3.9 ppc from an Intel build box
  • Next by Date: Re: Possible C++ optimizer problem
  • Previous by thread: Re: Universal binary and dynamic lib problem
  • Next by thread: Re: Possible C++ optimizer problem
  • Index(es):
    • Date
    • Thread