TARGET_VTABLE_ENTRY_ALIGN defaults to POINTER_SIZE, which is 20 for msp430-elf -mlarge.
g++.dg/torture/pr41257.C ICEs after the invalid alignment of 20 is set. > during GIMPLE pass: slp > gcc/testsuite/g++.dg/torture/pr41257.C: In function 'void bar()': > gcc/testsuite/g++.dg/torture/pr41257.C:17:6: internal compiler error: in > dr_analyze_innermost, at tree-data-ref.c:911 > 17 | void bar() > | ^~~ > 0x1427a98 dr_analyze_innermost(innermost_loop_behavior*, tree_node*, loop*, > gimple const*) > gcc/build/../gcc/tree-data-ref.c:910 > 0x14285ab create_data_ref(edge_def*, loop*, tree_node*, gimple*, bool, bool) > gcc/build/../gcc/tree-data-ref.c:1241 > 0x1428965 find_data_references_in_stmt(loop*, gimple*, vec<data_reference*, > va_heap, vl_ptr>*) > gcc/build/../gcc/tree-data-ref.c:5089 > 0x1440d5d vect_find_stmt_data_reference(loop*, gimple*, vec<data_reference*, > va_heap, vl_ptr>*) > gcc/build/../gcc/tree-vect-data-refs.c:3949 > 0x1034f0e vect_slp_bb(basic_block_def*) > gcc/build/../gcc/tree-vect-slp.c:3020 > 0x10381ea execute > gcc/build/../gcc/tree-vectorizer.c:1295 Pointer alignment is always 16 for MSP430, the attached patch (committed to trunk) sets TARGET_VTABLE_ENTRY_ALIGN to 16 for MSP430. This fixes the above ICE.
Index: gcc/ChangeLog =================================================================== --- gcc/ChangeLog (revision 267228) +++ gcc/ChangeLog (revision 267229) @@ -1,3 +1,7 @@ +2018-12-18 Jozef Lawrynowicz <joze...@mittosystems.com> + + * config/msp430/msp430.h: Define TARGET_VTABLE_ENTRY_ALIGN. + 2018-12-18 Jakub Jelinek <ja...@redhat.com> PR target/88513 Index: gcc/config/msp430/msp430.h =================================================================== --- gcc/config/msp430/msp430.h (revision 267228) +++ gcc/config/msp430/msp430.h (revision 267229) @@ -159,6 +159,11 @@ #define PTR_SIZE (TARGET_LARGE ? 4 : 2) #define POINTERS_EXTEND_UNSIGNED 1 +/* TARGET_VTABLE_ENTRY_ALIGN defaults to POINTER_SIZE, which is 20 for + TARGET_LARGE. Pointer alignment is always 16 for MSP430, so set explicitly + here. */ +#define TARGET_VTABLE_ENTRY_ALIGN 16 + #define ADDR_SPACE_NEAR 1 #define ADDR_SPACE_FAR 2