This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/87927] ICE: segmentation fault with patchable_function_entry attribute for msp430-elf -mlarge
- From: "jozef.l at mittosystems dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 08 Nov 2018 00:06:09 +0000
- Subject: [Bug c/87927] ICE: segmentation fault with patchable_function_entry attribute for msp430-elf -mlarge
- Auto-submitted: auto-generated
- References: <bug-87927-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87927
--- Comment #1 from Jozef Lawrynowicz <jozef.l at mittosystems dot com> ---
Created attachment 44968
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44968&action=edit
proposed patch
In default_print_patchable_function_entry, integer_asm_op is passed
POINTER_SIZE_UNITS. For msp430-elf -mlarge, this is 3, which is not handled in
integer_asm_op, so it returns NULL.
fputs is directly writing out the return value of integer_asm_op, so when this
is NULL we are segfaulting.
Attached is a proposed patch which implements
TARGET_ASM_{,UN}ALIGNED_P{S,D,T}I_OP, so integer_asm_op will not return NULL
for values < 16.
This fixes the c-c++-common/patchable_function_entry* tests but is otherwise
untested.