This is the mail archive of the gcc-patches@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]

Re: [PATCH] TLS support for powerpc/powerpc64 (take 2)


	The patch is looking good.

	Is there a reason for the differences between the uses of
SYMBOL_REF_TLS_MODEL?

constant_pool_expr_1:

+      if (SYMBOL_REF_TLS_MODEL (op))
+       return 0;

	SYMBOL_REF_TLS_MODEL is not a boolean truth value.  When using it
as a truthvalue, it should be tested != 0.


rs6000_tls_symbol_ref:

+  if (GET_CODE (x) != SYMBOL_REF)
+    return 0;
+  return SYMBOL_REF_TLS_MODEL (x) != 0;

rs6000_tls_symbol_ref_1:

+  if (GET_CODE (*x) != SYMBOL_REF)
+    return 0;
+  return SYMBOL_REF_TLS_MODEL (*x);

rs6000_legitimate_address:

+  if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0)
+    return 0;

	Is there a reason that these should not be written in a similar
manner?

rs6000_tls_symbol_ref:

  return GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0

rs6000_tls_symbol_ref_1:

  return GET_CODE (*x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (*x) != 0

SYMBOL_REF_TLS_MODEL can return multiple values, so technically the
implementation does not match the description ("Return 1").


Thanks, David


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