Mspgcc 3.2.3 is crashing

View: New views
10 Messages — Rating Filter:   Alert me  

Mspgcc 3.2.3 is crashing

by Dima Kogan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, all.

I'm seeing an "Internal compiler error" trying to build some TinyOS code with a
CVS build of Mspgcc, latest as of 6/17/2008. I'm using gcc 3.2.3 (mspgcc
3.3). Here's the session:

$ /usr/msp430/lib/gcc-lib/msp430/3.2.3/cc1   code.c -mmcu=msp430x149
code.c: In function `PropagationMsgPoolP___0___Vector___get':
code.c:6863: Internal compiler error in gen_lowpart, at emit-rtl.c:1197
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$

This doesn't appear to be a new issue, since I've seen mentions of it in the
lists. GCC seems to have fixed this back in GCC 3.3, but since the stable branch
of Mspgcc hasn't progressed to 3.3, this is not useful. Using the Mspgcc port
for gcc 3.3.6 lets me build the code, but produces code that doesn't work due to
a different bug that surfaced in 3.3.

A preprocessed file that triggers the bug can be found at

http://www.cds.caltech.edu/~dkogan/code.c

Note that this is generated by TinyOS, and is thus very long and unreadable.

I also looked at the offending code. The line that GCC is complaining about is
the last line in this snippet:

typedef struct { char data[1]; } __attribute__((packed)) nx_uint8_t;
typedef struct message_t {
  nx_uint8_t header[...];
  nx_uint8_t data[28];
  nx_uint8_t footer[...];
  nx_uint8_t metadata[...];
} __attribute__((packed)) message_t;
message_t PropagationMsgPoolP___0___data[10];
return &PropagationMsgPoolP___0___data[idx];


This may not actually be the issue, though, since moving the code around changes
the reported error. Gcc actually generates a segfault at times. Does anybody
have any ideas? Currently I don't have a useable compiler. :(

Dima

       

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@...
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Re: Mspgcc 3.2.3 is crashing

by Hardy Griech :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dima Kogan wrote:
:
> $ /usr/msp430/lib/gcc-lib/msp430/3.2.3/cc1   code.c -mmcu=msp430x149
> code.c: In function `PropagationMsgPoolP___0___Vector___get':
> code.c:6863: Internal compiler error in gen_lowpart, at emit-rtl.c:1197
> Please submit a full bug report,
> with preprocessed source if appropriate.
:

Have you tried disabling HW multiplication via -mdisable-hwmul?

Hardy

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@...
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Re: Mspgcc 3.2.3 is crashing

by Hardy Griech :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dima Kogan wrote:
:
> http://www.cds.caltech.edu/~dkogan/code.c

My first reply was a little bit too short shot... ;-)

I've downloaded your code and tried to compile it with no problem
(windows/cygwin, msggcc self-built):

hardy@STCHPS376 /tmp/msp
$ msp430-gcc -Wall -mmcu=msp430x149 -o code.o code.c
code.c:2598: warning: inline function
`XE1205SendReceiveP___signalPacketReceived___runTask' given attribute
noinline
code.c:6845: warning: inline function
`XE1205SendReceiveP___signalPacketReceived___runTask' given attribute
noinline

hardy@STCHPS376 /tmp/msp
$ ls -ls
total 396
308 -rwxr-xr-x 1 hardy Kein 314941 Jun 19 08:33 code.c*
  88 -rwxr-xr-x 1 hardy Kein  87742 Jun 19 08:36 code.o*

So what are your actual compiler options?

Hardy

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@...
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Re: Mspgcc 3.2.3 is crashing

by Dima Kogan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks a lot for replying.

First off, disabling the hardware multiplier does stop the crashing! Do
you know why that is? Also, don't I need the hardware multiplier? Does
disabling it force multiplication to be done via software?

Second, I'm very intrigued that the build works for you. My compile
options are exactly as I said, with very little of interest. If I try
to build again, with your exact command, even, I get the crash:

$ msp430-gcc -Wall -mmcu=msp430x149 -o code.o code.c
code.c:2598: warning: inline function `XE1205SendReceiveP___signalPacketReceived___runTask' given attribute noinline
code.c:6845: warning: inline function `XE1205SendReceiveP___signalPacketReceived___runTask' given attribute noinline
code.c: In function `PropagationMsgPoolP___0___Vector___get':
code.c:6863: Internal compiler error in gen_lowpart, at emit-rtl.c:1197
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$

I build my mspgcc today, with the latest code from cvs. I'm using the newest
binutils with the binutils-ld patch from mspgcc. Can you tell me how/when you
built your compiler? Thank you very much.

Dima

On Thu, 19 Jun 2008 08:37:11 +0200
Hardy Griech <ntbox@...> wrote:

> Dima Kogan wrote:
> :
> > http://www.cds.caltech.edu/~dkogan/code.c
>
> My first reply was a little bit too short shot... ;-)
>
> I've downloaded your code and tried to compile it with no problem
> (windows/cygwin, msggcc self-built):
>
> hardy@STCHPS376 /tmp/msp
> $ msp430-gcc -Wall -mmcu=msp430x149 -o code.o code.c
> code.c:2598: warning: inline function
> `XE1205SendReceiveP___signalPacketReceived___runTask' given attribute
> noinline
> code.c:6845: warning: inline function
> `XE1205SendReceiveP___signalPacketReceived___runTask' given attribute
> noinline
>
> hardy@STCHPS376 /tmp/msp
> $ ls -ls
> total 396
> 308 -rwxr-xr-x 1 hardy Kein 314941 Jun 19 08:33 code.c*
>   88 -rwxr-xr-x 1 hardy Kein  87742 Jun 19 08:36 code.o*
>
> So what are your actual compiler options?
>
> Hardy
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@...
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@...
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Re: Mspgcc 3.2.3 is crashing [virus checked]

by Reinhard.Griech :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Dima,

mspgcc-users-bounces@... wrote on 19.06.2008 08:50:21:

:
> First off, disabling the hardware multiplier does stop the crashing! Do
> you know why that is? Also, don't I need the hardware multiplier? Does

:

The implementation of HW multiplication is one of my favour suspects if there are compilation problems with mspgcc.  Unfortunately I have not enough time to dig deeper into this problem.

:
> disabling it force multiplication to be done via software?

:

Disabling HW multiplication of course leads to SW emulation of the multiplication.  If you are doing a lot of muliplications and/or access to arrays/structures there will be a loss of performance.

> Second, I'm very intrigued that the build works for you. My compile
> options are exactly as I said, with very little of interest. If I try
> to build again, with your exact command, even, I get the crash:


I've built mine in February 2008.  Additionally I've applied some patches, namely 01_disable-ffunction-section_warning.patch, 02_fdata-sections.patch, 03_FUNCTION-warning-disable.patch and 04_gcc-3.2.3-msp430x24x-msp430x26x.patch.
My build script is based on the one from Grant Edwards.  But I really don't know, which of my patches made the mspgcc compile your code...

Let me hear, if you are interested in my scripts/patch files.

Hardy

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@...
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Re: Mspgcc 3.2.3 is crashing

by Dima Kogan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi.

I'd like to have access to the hardware multiplier, so it would be
great if I could get copies of your patches. They don't seem to be the
same ones as what is checked into cvs. Can you post them here so that
everybody gets a copy?

Thank you very much.

On Thu, 19 Jun 2008 09:14:47 +0200
Reinhard.Griech@... wrote:

> Hi Dima,
>
> mspgcc-users-bounces@... wrote on 19.06.2008
> 08:50:21:
>
> :
> > First off, disabling the hardware multiplier does stop the
> > crashing! Do you know why that is? Also, don't I need the hardware
> > multiplier? Does
> :
>
> The implementation of HW multiplication is one of my favour suspects
> if there are compilation problems with mspgcc.  Unfortunately I have
> not enough time to dig deeper into this problem.
>
> :
> > disabling it force multiplication to be done via software?
> :
>
> Disabling HW multiplication of course leads to SW emulation of the
> multiplication.  If you are doing a lot of muliplications and/or
> access to arrays/structures there will be a loss of performance.
>
> > Second, I'm very intrigued that the build works for you. My compile
> > options are exactly as I said, with very little of interest. If I
> > try to build again, with your exact command, even, I get the crash:
>
> I've built mine in February 2008.  Additionally I've applied some
> patches, namely 01_disable-ffunction-section_warning.patch,
> 02_fdata-sections.patch, 03_FUNCTION-warning-disable.patch and
> 04_gcc-3.2.3-msp430x24x-msp430x26x.patch.
> My build script is based on the one from Grant Edwards.  But I really
> don't know, which of my patches made the mspgcc compile your code...
>
> Let me hear, if you are interested in my scripts/patch files.
>
> Hardy

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@...
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Re: Mspgcc 3.2.3 is crashing (3rd try)

by Hardy Griech :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Dima,

Note: the .pdf is actually a .zip, you have to rename!

Dima Kogan wrote:
:
> I'd like to have access to the hardware multiplier, so it would be
> great if I could get copies of your patches. They don't seem to be the
> same ones as what is checked into cvs. Can you post them here so that
> everybody gets a copy?
:

I've attached the patches and the build script.  The build script
contains the compilation steps for the complete tool chain, while the
patches directory only contains the patches for gcc.  That means that
you have to modify it.  In the directory where msp430-build resides
there must also be gcc-core-3.2.3.tar.bz2 and gcc-g++-3.2.3.tar.bz2.

Hope you get mspgcc compiled and after that your code.c.  BTW it would
be great, if you could isolate which one of the patches actually solves
your problem.

Hardy


PS: SF seems to reject .zip files, so I've renamed the .zip to .pdf
hopefully this time it will work!


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@...
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

msp430-build.pdf (8K) Download Attachment

Re: Mspgcc 3.2.3 is crashing (3rd try)

by Hardy Griech :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hardy Griech wrote:
:
> Hope you get mspgcc compiled and after that your code.c.  BTW it would
> be great, if you could isolate which one of the patches actually solves
> your problem.
:

Funny, I've compiled the current CVS gcc3.3 with the gcc3.2.3 sources
and your code.c still compiles without crash.

So my question: what version of msp430-gcc do you have?

Hardy

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@...
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Re: Mspgcc 3.2.3 is crashing (3rd try)

by Dima Kogan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

OK. First about the patches.

01_disable-ffunction-section_warning.patch and
03_FUNCTION-warning-disable.patch apply cleanly to the freshly
checked-out cvs, and do not fix the crashing. The other two patches
don't apply cleanly, and I didn't spend a lot of time fixing the
rejected hunks, but due to your latest message, I doubt that the
patches are the responsible for your compiler stability.

The crashing I described in the email was based off of current CVS
sources. I have since moved to the prepackaged version at
http://www.tinyos.net/tinyos-2.x/doc/html/install-tinyos.html More
specifically, I'm using the msp430tools-gcc-3.2.3-20050607.i386
package. This is much older than the cvs, but works with
-mdisable-hwmul, as you suggested. The CVS would crash for me with all
various optimization settings. The packaged version does not crash
with -O0 but does die with any optimization enabled:

$ msp430-gcc  -mmcu=msp430x149 -o /tmp/ccFpbaoU.o -c  code.c -Os
code.c:2598: warning: inline function `XE1205SendReceiveP___signalPacketReceived___runTask' given attribute noinline
code.c:6845: warning: inline function `XE1205SendReceiveP___signalPacketReceived___runTask' given attribute noinline
code.c: In function `Xe1205SpiNoDmaP___0___SpiPacket___send':
code.c:8754: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$

Even though this crash is claimed to be a segmentation fault, instead
of an internal error, I'm pretty confident that the two really are the
same problem, since

replacing return &PropagationMsgPoolP___0___data[idx];

with return 0;

on line 6863 of code.c fixes the crash in both the packaged and cvs
versions of gcc.

Let me know if you can replicate this. No clue as to why you can build
with the latest CVS. What if you turn on optimizations?

Dima





On Fri, 20 Jun 2008 22:02:23 +0200
Hardy Griech <ntbox@...> wrote:

> Hardy Griech wrote:
> :
> > Hope you get mspgcc compiled and after that your code.c.  BTW it
> > would be great, if you could isolate which one of the patches
> > actually solves your problem.
> :
>
> Funny, I've compiled the current CVS gcc3.3 with the gcc3.2.3 sources
> and your code.c still compiles without crash.
>
> So my question: what version of msp430-gcc do you have?
>
> Hardy
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@...
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@...
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Re: Mspgcc 3.2.3 is crashing (3rd try)

by Hardy Griech :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dima Kogan wrote:
:
> Let me know if you can replicate this. No clue as to why you can build
> with the latest CVS. What if you turn on optimizations?
:

Hi Dima,

you are right, optimization immediately also reveals the problem for me:

$ msp430-gcc -Wall -mmcu=msp430x149 -O1  -o code.o code.c
code.c:2598: warning: inline function
`XE1205SendReceiveP___signalPacketReceived___runTask' given attribute
noinline
code.c:6845: warning: inline function
`XE1205SendReceiveP___signalPacketReceived___runTask' given attribute
noinline
code.c: In function `SchedulerBasicP___TaskBasic___runTask':
code.c:6880: warning: `t' might be used uninitialized in this function
code.c: In function `XE1205PhyP___Interrupt0___fired':
code.c:8992: internal error: Segmentation fault

while -mdisable-hwmul

$ msp430-gcc -Wall -mmcu=msp430x149 -O1 -mdisable-hwmul -o code.o code.c
code.c:2598: warning: inline function
`XE1205SendReceiveP___signalPacketReceived___runTask' given attribute
noinline
code.c:6845: warning: inline function
`XE1205SendReceiveP___signalPacketReceived___runTask' given attribute
noinline

makes it disappear.

Also replacing line 6863 "return &PropagationMsgPoolP___0___data[idx];"
with a simple "return 0;" solves the fault.

Anybody with more knowledge who can explain/correct the problem?

Hardy

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@...
https://lists.sourceforge.net/lists/listinfo/mspgcc-users