#358 Shift operations may produce invalid assembly code


To reproduce:
1. Download Contiki from git
2. Go back to commit 10f64c0ce8199e6c25f137326c6c1550b600329c (which is currently HEAD)
3. Apply the attached patch
4. Go into {contiki_dir}/examples/er-rest-example
5. Execute "make TARGET=wismote"

You'll get the following error:

msp430-gcc -DUIP_CONF_IPV6=1 -DPROJECT_CONF_H=\"project-conf.h\" -DUIP_CONF_IPV6_RPL=1 -DWITH_COAP=7 -DREST=coap_rest_implementation -DUIP_CONF_TCP=0 -DCONTIKI=1 -DCONTIKI_TARGET_WISMOTE=1 -DWITH_UIP6=1 -Os -fno-strict-aliasing -ffunction-sections -Wall -mmcu=msp430f5437  -mmemory-model=medium -mcode-region=far  -I. -I../../platform/wismote/. -I../../platform/wismote/dev -I../../platform/wismote/apps -I../../platform/wismote/net -I../../cpu/msp430/f5xxx -I../../cpu/msp430/. -I../../cpu/msp430/dev -I../../core/dev -I../../core/lib -I../../core/net -I../../core/net/mac -I../../core/net/rime -I../../core/net/rpl -I../../core/sys -I../../core/cfs -I../../core/ctk -I../../core/lib/ctk -I../../core/loader -I../../core/. -I../../apps/er-coap-07 -I../../apps/erbium -I../../platform/wismote/ -DCONTIKI_VERSION_STRING=\"Contiki-2.6-625-g10f64c0\" -MMD -c ../../core/dev/sht11-sensor.c -o obj_wismote/sht11-sensor.o
/tmp/ccMBXJSF.s: Assembler messages:
/tmp/ccMBXJSF.s:1417: Error: Repeated instruction must have register mode operands
make: *** [obj_wismote/er-coap-07.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** wait: No child processes.  Stop.
1 Attachments


  • Peter A. Bigot

    Peter A. Bigot - 2013-07-04

    I can reproduce this when using gcc 4.7.0 as the basis for mspgcc. In my own Contiki development version I use gcc 4.7.2, and there the problem does not occur. This makes me think it's an upstream problem that has since been fixed (which makes sense: mspgcc's machine description should not have allowed an indirect register operand to the repeated shift instruction).

    Can you try to build mspgcc using 4.7.2 as the basis, along with the patches for [#352] and [#357], and see if the problem goes away?



    Bugs: #352
    Bugs: #357

  • Daniele Alessandrelli

    You are right, when using gcc 4.7.2 the problem does not occur.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks