From maxim at codesourcery.com Sun Feb 8 12:42:49 2009 From: maxim at codesourcery.com (Maxim Kuvyrkov) Date: Sun, 08 Feb 2009 15:42:49 +0300 Subject: [coldfire-gnu-discuss] Coldfire application/compiler problem In-Reply-To: <49838E28.5080809@meadorresearch.com> References: <49838E28.5080809@meadorresearch.com> Message-ID: <498ED349.50507@codesourcery.com> Dave Meador wrote: ... > * Tried logging first line inside the constructor - no logs are > executed, but crashes after the call to "new" > * Tried eliminating the body code of the constructor, no help > * Tried calling "new"/"delete" with sizeof(MyClass) just prior to the > real alloc and the test alloc/delete completes fine, but crashes upon > calling the alloc of "MyClass". > * Tried moving the alloc MyClass call to various other places in the > code, it crashes upon the first call every time. > > Does anyone have any ideas what this could be and how I might go about > figuring this out? Dave, Have you tried using the debugger? You can start your program on the target under gdbserver and then connect it from the host using gdb, then you can place a breakpoint on the last instruction that executes fine, continue your program execution to get to the breakpoint and then step several instructions until the crash occurs. This should at least tell you on which instruction the crash occurs. -- Maxim K. CodeSourcery From Ken.Wong at christiedigital.com Thu Feb 12 18:44:51 2009 From: Ken.Wong at christiedigital.com (Wong, Ken) Date: Thu, 12 Feb 2009 13:44:51 -0500 Subject: floating point instructions enabled by default for gcc-4.3-43 on mcf5472 processor? Message-ID: <0384B41A03232C45B676D09A0173AB1E0293412C@cdskitexg01.cds.int> I was wondering if anyone could tell me an easy way of determining whether or not code generated using the gcc-4.3-43 toolchain is generating hardware floating point instructions... I'm pretty sure it is, and I think I can go through the objdump of my code but being able to draw up a list of defaults that the compiler is using would be great. Ken. -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxim at codesourcery.com Fri Feb 13 07:28:55 2009 From: maxim at codesourcery.com (Maxim Kuvyrkov) Date: Fri, 13 Feb 2009 10:28:55 +0300 Subject: [coldfire-gnu-discuss] floating point instructions enabled by default for gcc-4.3-43 on mcf5472 processor? In-Reply-To: <0384B41A03232C45B676D09A0173AB1E0293412C@cdskitexg01.cds.int> References: <0384B41A03232C45B676D09A0173AB1E0293412C@cdskitexg01.cds.int> Message-ID: <49952137.8020006@codesourcery.com> Wong, Ken wrote: > I was wondering if anyone could tell me an easy way of determining > whether or not code generated using the gcc-4.3-43 toolchain is > generating hardware floating point instructions? > > > > I?m pretty sure it is, and I think I can go through the objdump of my > code but being able to draw up a list of defaults that the compiler is > using would be great. It depends on -mcpu= setting: if selected CPU has FPU unit (which, I believe, at the moment are only devices from 547x/548x family) then FP instructions can be generated. There is also option -msoft-float that unconditionally turns off use of FP instructions. -- Maxim From Ken.Wong at christiedigital.com Fri Feb 13 14:05:55 2009 From: Ken.Wong at christiedigital.com (Wong, Ken) Date: Fri, 13 Feb 2009 09:05:55 -0500 Subject: [coldfire-gnu-discuss] floating point instructions enabled by default for gcc-4.3-43 on mcf5472 processor? In-Reply-To: <49952137.8020006@codesourcery.com> References: <0384B41A03232C45B676D09A0173AB1E0293412C@cdskitexg01.cds.int> <49952137.8020006@codesourcery.com> Message-ID: <0384B41A03232C45B676D09A0173AB1E02934179@cdskitexg01.cds.int> Thanks for advice Maxim, our builds are currently omitting any type of -mcpu flag so that has me wondering even more which default flags I'm compiling with. :) I'll setup the mcpu flag correctly today and see if the generating objects differ significantly from my usual build. If anyone else has any advice about how to figure out what the default flags are for the toolchain, I'm all ears. Thanks, Ken. -----Original Message----- From: Maxim Kuvyrkov [mailto:maxim at codesourcery.com] Sent: Friday, February 13, 2009 2:29 AM To: Wong, Ken Cc: coldfire-gnu-discuss at codesourcery.com Subject: Re: [coldfire-gnu-discuss] floating point instructions enabled by default for gcc-4.3-43 on mcf5472 processor? Wong, Ken wrote: > I was wondering if anyone could tell me an easy way of determining > whether or not code generated using the gcc-4.3-43 toolchain is > generating hardware floating point instructions... > > > > I'm pretty sure it is, and I think I can go through the objdump of my > code but being able to draw up a list of defaults that the compiler is > using would be great. It depends on -mcpu= setting: if selected CPU has FPU unit (which, I believe, at the moment are only devices from 547x/548x family) then FP instructions can be generated. There is also option -msoft-float that unconditionally turns off use of FP instructions. -- Maxim From maxim at codesourcery.com Fri Feb 13 14:42:54 2009 From: maxim at codesourcery.com (Maxim Kuvyrkov) Date: Fri, 13 Feb 2009 17:42:54 +0300 Subject: [coldfire-gnu-discuss] floating point instructions enabled by default for gcc-4.3-43 on mcf5472 processor? In-Reply-To: <0384B41A03232C45B676D09A0173AB1E02934179@cdskitexg01.cds.int> References: <0384B41A03232C45B676D09A0173AB1E0293412C@cdskitexg01.cds.int> <49952137.8020006@codesourcery.com> <0384B41A03232C45B676D09A0173AB1E02934179@cdskitexg01.cds.int> Message-ID: <499586EE.7050703@codesourcery.com> Wong, Ken wrote: > Thanks for advice Maxim, our builds are currently omitting any type of > -mcpu flag so that has me wondering even more which default flags I'm > compiling with. :) > > I'll setup the mcpu flag correctly today and see if the generating > objects differ significantly from my usual build. > > If anyone else has any advice about how to figure out what the default > flags are for the toolchain, I'm all ears. Default -mcpu= setting depends on target you use; e.g., it's -mcpu=m5475 for m68k-linux and -mcpu=5206 for m68k-elf. One way to figure out precisely which compiler flags are being used is to let gcc compile a simple file with '-v' option and then inspect command line for cc1. Gcc is actually a driver that invokes compiler (cc1) and/or assembler (as) and/or linker (ld) depending on the parameters given. -- Maxim From Ken.Wong at christiedigital.com Fri Feb 13 15:23:01 2009 From: Ken.Wong at christiedigital.com (Wong, Ken) Date: Fri, 13 Feb 2009 10:23:01 -0500 Subject: [coldfire-gnu-discuss] floating point instructions enabled by default for gcc-4.3-43 on mcf5472 processor? In-Reply-To: <499586EE.7050703@codesourcery.com> References: <0384B41A03232C45B676D09A0173AB1E0293412C@cdskitexg01.cds.int> <49952137.8020006@codesourcery.com> <0384B41A03232C45B676D09A0173AB1E02934179@cdskitexg01.cds.int> <499586EE.7050703@codesourcery.com> Message-ID: <0384B41A03232C45B676D09A0173AB1E0293419C@cdskitexg01.cds.int> I followed your advice, and everything is exactly as you said it would be. In other words, we are compiling for the 5475 cpu by default. Thanks Maxim! Ken. -----Original Message----- From: Maxim Kuvyrkov [mailto:maxim at codesourcery.com] Sent: Friday, February 13, 2009 9:43 AM To: Wong, Ken Cc: coldfire-gnu-discuss at codesourcery.com Subject: Re: [coldfire-gnu-discuss] floating point instructions enabled by default for gcc-4.3-43 on mcf5472 processor? Wong, Ken wrote: > Thanks for advice Maxim, our builds are currently omitting any type of > -mcpu flag so that has me wondering even more which default flags I'm > compiling with. :) > > I'll setup the mcpu flag correctly today and see if the generating > objects differ significantly from my usual build. > > If anyone else has any advice about how to figure out what the default > flags are for the toolchain, I'm all ears. Default -mcpu= setting depends on target you use; e.g., it's -mcpu=m5475 for m68k-linux and -mcpu=5206 for m68k-elf. One way to figure out precisely which compiler flags are being used is to let gcc compile a simple file with '-v' option and then inspect command line for cc1. Gcc is actually a driver that invokes compiler (cc1) and/or assembler (as) and/or linker (ld) depending on the parameters given. -- Maxim