From 49686677ed7aa84d05b0c5db8eb28f06ebb5e529 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Sun, 20 Jan 2019 18:53:13 +0000 Subject: [PATCH] [D] Don't predefine GNU_StackGrowsDown on every target. Every back-end defines STACK_GROWS_DOWNWARD, the condition should instead be checking whether it was defined as 1 or 0. gcc/d/ChangeLog: 2019-01-20 Iain Buclaw * d-builtins.cc (d_init_versions): Check value of STACK_GROWS_DOWNWARD. From-SVN: r268106 --- gcc/d/ChangeLog | 5 +++++ gcc/d/d-builtins.cc | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog index aa3bb7f9041..32160db1d36 100644 --- a/gcc/d/ChangeLog +++ b/gcc/d/ChangeLog @@ -1,3 +1,8 @@ +2019-01-20 Iain Buclaw + + * d-builtins.cc (d_init_versions): Check value of + STACK_GROWS_DOWNWARD. + 2019-01-20 Iain Buclaw * d-codegen.cc (identity_compare_p): Return false if seen built-in diff --git a/gcc/d/d-builtins.cc b/gcc/d/d-builtins.cc index 564e8c6a7b1..b0a315a3ed9 100644 --- a/gcc/d/d-builtins.cc +++ b/gcc/d/d-builtins.cc @@ -417,9 +417,8 @@ d_init_versions (void) if (!targetm.have_tls) VersionCondition::addPredefinedGlobalIdent ("GNU_EMUTLS"); -#ifdef STACK_GROWS_DOWNWARD - VersionCondition::addPredefinedGlobalIdent ("GNU_StackGrowsDown"); -#endif + if (STACK_GROWS_DOWNWARD) + VersionCondition::addPredefinedGlobalIdent ("GNU_StackGrowsDown"); /* Should define this anyway to set us apart from the competition. */ VersionCondition::addPredefinedGlobalIdent ("GNU_InlineAsm"); -- 2.30.2