diff mbox series

[d] Committed fix GNU_StackGrowsDown version always predefined

Message ID CABOHX+eBjTW0gDDoOhtck42_JbxyGqeKon=o48BFvmUn5eVhbg@mail.gmail.com
State New
Headers show
Series [d] Committed fix GNU_StackGrowsDown version always predefined | expand

Commit Message

Iain Buclaw Jan. 20, 2019, 6:53 p.m. UTC
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.
diff mbox series

Patch

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");