Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


gdmarkou

Member Since 01 Jun 2008
Offline Last Active Feb 20 2014 02:38 AM

Topics I've Started

segmentation fault while calling native functions with -O2

20 December 2011 - 07:39 AM

I'm using gcc 4.6.1 under linux.
I've tried both the sdk from angelcode.com (2.22.0) and the latest revision (1080).

Without optimizations everything runs fine.

With optimizations (O1,2,3 doesn't matter) I recieve a segmentation fault from
CallCDeclFunction() in as_callfunc_x86.cpp
and this specific line :
"movl  12(%ebp), %eax \n"
(looking up the registers, both ebp and eax are 0)

The only solution I have (besides no optimization at all) is to build every file with -O2
and build as_callfunc_x86.cpp without optimizations, then link.

This way everything seems to work fine.

Other suggestions ?

PARTNERS