This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/78554] New: Internal Compiler Error in msp430 target with -mlarge, -O{s123}
- From: "awygle at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Nov 2016 05:18:24 +0000
- Subject: [Bug target/78554] New: Internal Compiler Error in msp430 target with -mlarge, -O{s123}
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78554
Bug ID: 78554
Summary: Internal Compiler Error in msp430 target with -mlarge,
-O{s123}
Product: gcc
Version: 6.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: awygle at gmail dot com
Target Milestone: ---
When compiling code for an MSP430 using large model (-mlarge) and any
optimization above 0, assigning the address of a global variable to an __int20
unsigned (__UINTPTR_TYPE__) which is part of a structure causes an internal
compiler error, as in the following .i file:
# 1 "test.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test.c"
unsigned char test_val = 0;
typedef __int20 unsigned reg_t;
struct holds_reg {
reg_t r0;
};
struct holds_reg ex = { 0 };
int main() {
ex.r0 = (reg_t)(&test_val);
return 0;
}
The invocation of msp430-elf-gcc:
msp430-elf-gcc -mmcu=msp430fr5969 -mlarge -O1 -save-temps test.c
test.c: In function ‘main’:
test.c:14:1: error: unrecognizable insn:
}
^
(insn 6 5 8 2 (set (mem/c:HI (reg/f:PSI 25) [2 ex.r0+0 S2 A16])
(subreg:HI (symbol_ref:PSI ("test_val") [flags 0x2] <var_decl
0x7fb37aa82090 test_val>) 0)) test.c:12 -1
(nil))
test.c:14:1: internal compiler error: in extract_insn, at recog.c:2287
0x8aa29a _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc-6.2.0/gcc/rtl-error.c:108
0x8aa2c9 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../gcc-6.2.0/gcc/rtl-error.c:116
0x882087 extract_insn(rtx_insn*)
../../gcc-6.2.0/gcc/recog.c:2287
0x6e1ba5 instantiate_virtual_regs_in_insn
../../gcc-6.2.0/gcc/function.c:1582
0x6e1ba5 instantiate_virtual_regs
../../gcc-6.2.0/gcc/function.c:1950
0x6e1ba5 execute
../../gcc-6.2.0/gcc/function.c:1999
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.
Some things which don't cause this error include assigning the address of a
variable which is local to main or assigning the address directly to a __int20
unsigned which is not part of a struct. The error does not occur on -msmall or
on -O0.