Bug 63709 - msp430 Y constraint generates unacceptable constant in large mode
Summary: msp430 Y constraint generates unacceptable constant in large mode
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-01 23:02 UTC by Peter A. Bigot
Modified: 2014-11-03 12:24 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter A. Bigot 2014-11-01 23:02:12 UTC
Building trunk gcc at SVN 217005 produces the following from make all-target:

# If this is the top-level multilib, build all the other
# multilibs.
/tmp/gcc/./gcc/xgcc -B/tmp/gcc/./gcc/ -B/usr/local/gcc-msp430-elf-dev-20141101/msp430-elf/bin/ -B/usr/local/gcc-msp430-elf-dev-20141101/msp430-elf/lib/ -isystem /usr/local/gcc-msp430-elf-dev-20141101/msp430-elf/include -isystem /usr/local/gcc-msp430-elf-dev-20141101/msp430-elf/sys-include    -g -O2 -mlarge -O2  -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -Os -ffunction-sections -fdata-sections -mhwmult=none -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -Os -ffunction-sections -fdata-sections -mhwmult=none -I. -I. -I../../.././gcc -I/opt/gcc/libgcc -I/opt/gcc/libgcc/. -I/opt/gcc/libgcc/../gcc -I/opt/gcc/libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS -o unwind-dw2.o -MT unwind-dw2.o -MD -MP -MF unwind-dw2.dep -fexceptions -c /opt/gcc/libgcc/unwind-dw2.c -fvisibility=hidden -DHIDE_EXPORTS
/tmp/ccdnPFDw.s: Assembler messages:
/tmp/ccdnPFDw.s:3439: Error: value 0xfff80000 out of extended range.
make[3]: *** [unwind-dw2.o] Error 1

The offending generated code is:

.LBB296:
        .loc 2 208 0
        CMP.B   #0, 148(R5) { JEQ       .L400
        .loc 2 209 0
        BISX.A  #-524288, 96(R10)
.LVL485:
        BRA     #.L379
.LVL486:
.L400:
        .loc 2 211 0
        ANDX.A  #524287, 96(R10)
.LVL487:

Either gcc needs to truncate values to fit within the 20-bit/16-bit limits or the check in binutils needs to be relaxed.
Comment 1 Nick Clifton 2014-11-03 11:43:21 UTC
Hi Peter,

  Sorry - this was a snafu in the assembler.  Its range checking of 20-bit immediates was not quite right.  This is now fixed however so please update your master binutils sources and try again.

Cheers
  Nick

PS.  The patch is also in the 2.25 branch...
Comment 2 Peter A. Bigot 2014-11-03 12:24:09 UTC
Confirmed fixed; thanks.