Hi, This patch fixes a small logic bug, where GNU_StackGrowsDown was always predefined in the D language environment. Instead, don't define it where STACK_GROWS_DOWNWARD is defined as zero. With this, the correct libphobos code paths will now be compiled on hppa-* targets.
Bootstrapped and regression tested on x86_64-linux-gnu. Committed to trunk as r268106. -- Iain --- gcc/d/ChangeLog: 2019-01-20 Iain Buclaw <ibuc...@gdcproject.org> * d-builtins.cc (d_init_versions): Check value of STACK_GROWS_DOWNWARD. ---
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");