Under the following particular circumstances of a call to printf("a_particular_string_literal"), the compiled binary ends up an overly large binary (overflows MCU code memory):
Good case: printf("zz\n");
Bad case: printf("z\nz");
Specific symptoms: between the good and bad cases, the .text section grows from 0x175a (good) to 0x7f1c (bad); .rodata grows from 0x006c (good) to 0x0348 (bad) and is filled with what looks like garbage.
Just re-arranging the bytes in the string literal causes the problem to appear/disappear. Could not reproduce the problem without a call to printf (tried a simple call to function defined in a different compilation unit). If the literal is defined in static storage, then the behavior is very similar, but for these particular literals, both trigger the problem.
Makefile, compiled binaries, disassembly, and elf header listings for both cases attached.
msp430-elf-gcc --version
msp430-elf-gcc (GCC) 4.9.1 20140707 (prerelease (msp430-14r1-167)) (GNUPro 14r1) (Based on: GCC 4.8 GDB 7.7 Binutils 2.24 Newlib 2.1)