This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug debug/86257] Program compiled with fPIC crashes while stepping over thread-local variable GDB


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)
...

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]