MSP430 RedHat Toolchain Generating Invalid Calls

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

MSP430 RedHat Toolchain Generating Invalid Calls

Wylder Keane
Hey,



Not sure if this is the place to be asking this, but here goes. I’ve been
trying to get a large project to build with the msp430 RedHat gcc 4.9
toolchain and have been seeing some really weird errors. It seems to be
generating a call to a special helper method for shifting unsigned 64bit
integers but it is trying to link to a nonexistent version of it.



The call it’s trying to link to is __mspabi_slll_47 which doesn’t make
sense as far as I can tell because there aren’t 47 registers… (assuming
that’s what the 47 means because there are __mspabi_slll_[1-15] calls that
do exist and looking at the gcc machine definition file it seems to be in
line with that).



Here’s the assembly dump from the call it’s trying to link. I’ve been able
to find the line of code that causes this but can’t reproduce it in an
isolated case and I can't post the code because it's under NDA.



 682     .loc 1 185 0

 683     MOV.W   16(R1), R12

 684     MOV.W   #0, R13

 685     CALL    #__mspabi_slll_47



It may be useful to note that when doing an objdump of the libgcc.a file
this symbol is declared but not defined. This might be a compiler bug, or
it may be my misuse of the toolchain.



Here are the flags I compiled with:



-mmcu=msp430x -O0 -Os –fno-exceptions –fno-rtti –D__MSP430FR5969 -Wextra
-ffunction-sections -fdata-sections



My only thought is that this is an obscure bug or something wrong with the
CMake toolchain invoking the compiler.



Toolchain was built from these instructions:



http://sourceforge.net/apps/mediawiki/mspgcc/index.php?title=Install:redhat


Thanks for any help, if this isn't the right place to ask this let me know
and I'll post there instead.


-Wylder

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: MSP430 RedHat Toolchain Generating Invalid Calls

DJ Delorie

The _47 implies it's trying to shift by 47 bits (not registers).
However, the "slll" variant is for longs (32-bit) and the helpers only
go up to 15 bits (after that, it's supposed to use the variable-count
helper instead).

Maybe that will help you get a sharable test case, because that's what
I need to debug it ;-)

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: MSP430 RedHat Toolchain Generating Invalid Calls

Wylder Keane-2
In reply to this post by Wylder Keane
That makes sense but it's strange because I'm not attempting to shift by 47
bits.. supposed to be 8 bits. Even stranger, I found a way to reproduce it
by accident today. Apparently printf() causes the error, but I had removed
all printf calls earlier because it was blowing up the executable size so
it slipped by me. Maybe there's something I'm doing wrong in my makefile
that's causing the error so I've attached the sample, makefile and linker
scripts (which were slightly modified) used to build it.

Environment:  Ubuntu 12.04.03 LTS x86_64



On Thu, Dec 5, 2013 at 7:26 PM, DJ Delorie <[hidden email]> wrote:

>
> The _47 implies it's trying to shift by 47 bits (not registers).
> However, the "slll" variant is for longs (32-bit) and the helpers only
> go up to 15 bits (after that, it's supposed to use the variable-count
> helper instead).
>
> Maybe that will help you get a sharable test case, because that's what
> I need to debug it ;-)
>

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: MSP430 RedHat Toolchain Generating Invalid Calls

DJ Delorie

I ran the Makefile in your zip using the latest FSF builds and
it... just worked :-P

Which version of gcc are you using?  I.e. "msp430-elf-gcc -v" ?

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: MSP430 RedHat Toolchain Generating Invalid Calls

Wylder Keane
This version is the one I was using... not the latest. Sorry for the
red-herring...

Old-Version:
Using built-in specs.
COLLECT_GCC=msp430-elf-gcc
Target: msp430-elf
Configured with: ../gcc-trunk/configure --target=msp430-elf
--enable-languages=c,c++ --with-newlib=yes
Thread model: single
gcc version 4.9.0 20130618 (experimental) (GCC)

I rebuilt the toolchain somewhat recently and I get an internal compiler
error so I was using the older version because it seemed to get further
along in the code. I'll checkout the latest gcc code and try another
rebuild.

Here's a quick paste of the internal error I was getting.  I'll try to
reproduce it in a sample soon...

Newer-Version:
Using built-in specs.
COLLECT_GCC=msp430-elf-gcc
Target: msp430-elf
Configured with: ../gcc-trunk/configure --target=msp430-elf
--enable-languages=c,c++ --with-newlib=yes
Thread model: single
gcc version 4.9.0 20131126 (experimental) (GCC)


Internal-Error: (Note the Status type is an enum)

error: stmt (0x2b4c0ca5d720) marked modified after optimization pass:
    Status init(void) {
           ^
# .MEM_4 = VDEF <.MEM_1(D)>
_5 = GpioDriver::init (&gpio_driver_singleton.instance);
gpio_driver.cpp:232:11: internal compiler error: verify_ssa failed
0xc9cb2c verify_ssa(bool)
../../gcc-trunk/gcc/tree-ssa.c:1096
0xa750fe execute_function_todo
../../gcc-trunk/gcc/passes.c:1844
0xa75af3 execute_todo
../../gcc-trunk/gcc/passes.c:1877
0xa7768b execute_one_ipa_transform_pass
../../gcc-trunk/gcc/passes.c:2062
0xa7768b execute_all_ipa_transforms()
../../gcc-trunk/gcc/passes.c:2093
0x8209ba expand_function
../../gcc-trunk/gcc/cgraphunit.c:1756
0x822810 expand_all_functions
../../gcc-trunk/gcc/cgraphunit.c:1868
0x822810 compile()
../../gcc-trunk/gcc/cgraphunit.c:2203
0x823004 finalize_compilation_unit()
../../gcc-trunk/gcc/cgraphunit.c:2280
0x61370a cp_write_global_declarations()
../../gcc-trunk/gcc/cp/decl2.c:4431
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

On Mon, Dec 9, 2013 at 5:52 PM, DJ Delorie <[hidden email]> wrote:

>
> I ran the Makefile in your zip using the latest FSF builds and
> it... just worked :-P
>
> Which version of gcc are you using?  I.e. "msp430-elf-gcc -v" ?
>
msp430-elf-gcc (GCC) 4.9.0 20130618 (experimental)

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users