• 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
Re: Bus error with gcc on simple function?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bus error with gcc on simple function?


  • Subject: Re: Bus error with gcc on simple function?
  • From: Ben Weiss <email@hidden>
  • Date: Thu, 12 Apr 2007 15:17:03 -0700

Bill,

Below are the build results from Xcode 2.4.1 (this time running on a MacBook Pro, targeting x86 with SSE enabled). You may have to to add the following line of code, to properly define the vector types:

#include <Accelerate/Accelerate.h> // and link with the Accelerate framework

Any insight?

-Ben

--------

CompileC build/Test.build/Debug/Test.build/Objects-normal/i386/ Test.o /Users/benweiss/Documents/Projects/Test/Core/Source/Graphics/ Test.cpp normal i386 c++ com.apple.compilers.gcc.4_0
cd /Users/benweiss/Documents/Projects/Test/Core
/usr/bin/gcc-4.0 -x c++ -arch i386 -pipe -Wno-trigraphs -fpascal- strings -fasm-blocks -g -O0 -Wreturn-type -Wunused-variable - DMAC_ENV=1 -DTestDebug_=1 -fmessage-length=0 -ffast-math -mfix-and- continue -mmacosx-version-min=10.4 -I/Users/benweiss/Documents/ Projects/Test/Core/build/Test.build/Debug/Test.build/Test_d.hmap -F/ Users/benweiss/Documents/Projects/Test/Core/build/Debug -I/Users/ benweiss/Documents/Projects/Test/Core/build/Debug/include -I/Users/ benweiss/Documents/Projects/Test/Core/build/Test.build/Debug/ Test.build/DerivedSources -isysroot /Developer/SDKs/MacOSX10.4u.sdk - include /Library/Caches/com.apple.Xcode.501/SharedPrecompiledHeaders/ Test.xcode_Prefix-hizevdjufwddsueytcawmlhxcwwd/Test.xcode_Prefix.pch - c /Users/benweiss/Documents/Projects/Test/Core/Source/Graphics/ Test.cpp -o /Users/benweiss/Documents/Projects/Test/Core/build/ Test.build/Debug/Test.build/Objects-normal/i386/Test.o
/Users/benweiss/Documents/Projects/Test/Core/Source/Graphics/ Test.cpp: In function 'void foo()':
/Users/benweiss/Documents/Projects/Test/Core/Source/Graphics/Test.cpp: 25: warning: unused variable 'mult_'
/Users/benweiss/Documents/Projects/Test/Core/Source/Graphics/Test.cpp: 28: internal compiler error: Segmentation fault
Please submit a full bug report, with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
{standard input}:9:FATAL:.abort detected. Assembly stopping.


--------


On Apr 10, 2007, at 7:36 PM, Bill Northcott wrote:

On 10/04/2007, at 5:08 AM, Ben Weiss wrote:
there?) The crash occurs here regardless of target platform, so the
bug must be in the preprocessor somewhere.  Anyway, is this the
preferred syntax for initializing an array of vectors, or is there a
better way?

The code below compiles for me

static void foo() { #if __VEC__ typedef vector float vfloat; #elif __SSE__ typedef vFloat vfloat; #endif vfloat mult_[4] = { { 1.0f, 1.0f, 1.0f, 1.0f }, { 2.0f, 2.0f, 2.0f, 2.0f }, { 3.0f, 3.0f, 3.0f, 3.0f }, { 4.0f, 4.0f, 4.0f, 4.0f } }; }

[PM-G5BN:Public/Darwin/sse_crasher] billn% gcc -faltivec crasher.c
/usr/bin/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status
[PM-G5BN:Public/Darwin/sse_crasher] billn% gcc -v
Using built-in specs.
Target: powerpc-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5367.obj~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^ [cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 -- with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --host=powerpc- apple-darwin8 --target=powerpc-apple-darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5367)
[PM-G5BN:Public/Darwin/sse_crasher] billn%


2GHz Dual G5, 3GB, 10.4.9 and Xcode 2.4.1

What is your compile command?

Bill Northcott


_______________________________________________ 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
References: 
 >Re: Bus error with gcc on simple function? (From: Bill Northcott <email@hidden>)

  • Prev by Date: Re: Standard Tool Question
  • Next by Date: Re: Bus error with gcc on simple function?
  • Previous by thread: Re: Bus error with gcc on simple function?
  • Next by thread: Re: Bus error with gcc on simple function?
  • Index(es):
    • Date
    • Thread