This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/86257] Program compiled with fPIC crashes while stepping over thread-local variable GDB
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 22 Jun 2018 14:27:27 +0000
- Subject: [Bug debug/86257] Program compiled with fPIC crashes while stepping over thread-local variable GDB
- Auto-submitted: auto-generated
- References: <bug-86257-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86257
--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
Adding a nop before the .byte fixes this:
...
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index eb77ef3c08f..d088b1e7fe0 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -14733,7 +14733,11 @@
"TARGET_64BIT"
{
if (!TARGET_X32)
- fputs (ASM_BYTE "0x66\n", asm_out_file);
+ {
+ if (debug_info_level >= DINFO_LEVEL_TERSE)
+ fputs ("\tnop\n", asm_out_file);
+ fputs (ASM_BYTE "0x66\n", asm_out_file);
+ }
output_asm_insn
("lea{q}\t{%E1@tlsgd(%%rip), %%rdi|rdi, %E1@tlsgd[rip]}", operands);
if (TARGET_SUN_TLS || flag_plt || !HAVE_AS_IX86_TLS_GET_ADDR_GOT)
...