]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
nvptx 'TARGET_USE_LOCAL_THUNK_ALIAS_P', 'TARGET_SUPPORTS_ALIASES'
authorThomas Schwinge <thomas@codesourcery.com>
Thu, 14 Jul 2022 20:05:17 +0000 (22:05 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Tue, 12 Sep 2023 08:52:55 +0000 (10:52 +0200)
This fixes up commit f8b15e177155960017ac0c5daef8780d1127f91c
"[nvptx] Use .alias directive for mptx >= 6.3", which regressed in
particular C++ test cases if the new '-malias' flag was not active.
In that case, we have to maintain (that is now, restore) the previous
state of 'TARGET_USE_LOCAL_THUNK_ALIAS_P', 'TARGET_SUPPORTS_ALIASES'.

The remaining three regressions are to be resolved via
<https://inbox.sourceware.org/87ledgzxcl.fsf@euler.schwinge.homeip.net>
"More '#ifdef ASM_OUTPUT_DEF' -> 'if (TARGET_SUPPORTS_ALIASES)' etc.".

gcc/
* config/nvptx/nvptx.h (TARGET_USE_LOCAL_THUNK_ALIAS_P)
(TARGET_SUPPORTS_ALIASES): Define.

gcc/config/nvptx/nvptx.h

index 15a52344d4a2f046f51575fcadcabb1313b26151..129427e5654dbc2d20c058c6de625e36cab53dbc 100644 (file)
@@ -338,6 +338,11 @@ struct GTY(()) machine_function
 #define ASM_OUTPUT_DEF_FROM_DECLS(STREAM, NAME, VALUE) \
   nvptx_asm_output_def_from_decls (STREAM, NAME, VALUE)
 
+/* ..., but also override other macros to avoid 'gcc/defaults.h'-initialization
+   due to that dummy 'ASM_OUTPUT_DEF'.  */
+#define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) TARGET_SUPPORTS_ALIASES
+#define TARGET_SUPPORTS_ALIASES (nvptx_alias != 0)
+
 #define NO_DOT_IN_LABEL
 #define ASM_COMMENT_START "//"