This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/81861] ASan pr64820.c testcase segfaults with LTO and -fstack-protector-strong
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 16 Aug 2017 13:27:34 +0000
- Subject: [Bug tree-optimization/81861] ASan pr64820.c testcase segfaults with LTO and -fstack-protector-strong
- Auto-submitted: auto-generated
- References: <bug-81861-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81861
--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
You didn't specify compile flags, but using:
-O2 -fstack-protector-strong -fsanitize=address, I get:
51: c7 82 00 80 ff 7f f1 movl $0xf1f1f1f1,0x7fff8000(%rdx)
58: f1 f1 f1
5b: c7 82 04 82 ff 7f f3 movl $0xf3f3f3f3,0x7fff8204(%rdx)
62: f3 f3 f3
65: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax
6c: 00 00
6e: 48 89 84 24 58 10 00 mov %rax,0x1058(%rsp)
75: 00
76: 31 c0 xor %eax,%eax
The insn in question is:
#(insn:TI 35 19 40 3 (parallel [
# (set (mem/v/f/c:DI (plus:DI (reg/f:DI 7 sp)
# (const_int 4184 [0x1058])) [2 D.2177+0 S8 A64])
# (unspec:DI [
# (mem/f:DI (const_int 40 [0x28]) [4
MEM[(<address-space-1> long unsigned int *)40B]+0 S8 A64 AS1])
# ] UNSPEC_SP_SET))
# (set (reg:DI 0 ax [97])
# (const_int 0 [0]))
# (clobber (reg:CC 17 flags))
# ]) "pr64820.c":13 1002 {stack_protect_set_di}
# (expr_list:REG_UNUSED (reg:CC 17 flags)
# (expr_list:REG_UNUSED (reg:DI 0 ax [97])
# (nil))))
movq %fs:40, %rax # 35 stack_protect_set_di [length = 16]
movq %rax, 4184(%rsp)
xorl %eax, %eax
Maybe LTO doesn't handle address spaces correctly?