[PATCH] [PowerPC] Fix __tls_get_addr sequence to avoid register assignment issues

hfinkel at anl.gov hfinkel at anl.gov
Sun Feb 8 17:40:56 PST 2015


> Maybe it needs the full clobber mask associated with a regular function call? Based on this crash, it looks like it at least also clobbers r4.


To answer my own question, Google seems to say that glibc/sysdeps/powerpc/tls-macros.h has this:

  #define __TLS_CALL_CLOBBERS						      \
  	"0", "4", "5", "6", "7", "8", "9", "10", "11", "12",		      \
  	"lr", "ctr", "cr0", "cr1", "cr5", "cr6", "cr7"

(and that's what is used by the TLS_LD/TLS_GD macros (etc.) that contain calls to __tls_get_addr.

Let's define a minimal CC reg mask that only has these registers, and apply it to the pseudo that becomes the function call (or something like that).


http://reviews.llvm.org/D7491

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list