[Asterisk-code-review] partial-inlining: disable partial-inlining if gcc>=8.2.1 (...asterisk[master])

Joshua C. Colp asteriskteam at digium.com
Wed Mar 13 07:24:47 CDT 2019


Joshua C. Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/11108 )

Change subject: partial-inlining: disable partial-inlining if gcc>=8.2.1
......................................................................

partial-inlining: disable partial-inlining if gcc>=8.2.1

Apply flag -fno-partial-inlining on default optimization if and only if
gcc version >= 8.2.1 (this is the current ver on Fedora and Ubuntu).
This is done to avoid a bug that causes arithmetic calculations to fail
if the following conditions are met:
1. TEST_FRAMEWORK on
2. DONT_OPTIMIZE off
3. Fedora and Ubuntu
4. GCC 8.2.1
5. There must exist a certain combination of multithreading.
6. Optimization level -O2 and -O3
7. Flag -fpartial-inline activated (default when optimization level>=2)
The following link points to a similar gcc bug reported in 2015. This leads me
to believe the bug has regressed. Note I am not able to replicate this bug
in an environment other than Asterisk + Test Framework + Test_cel because the
multithreading combination that causes it seems to be unique. Therefore I
am temporarily abandoning any thoughts of reporting the new occurrence of this
bug to gcc.gnu.org.  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65307

Change-Id: Ibd1afe60e0a38b88e85fdcd9b051004601c2f102
---
M Makefile.rules
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  mattf: Looks good to me, but someone else must approve
  Corey Farrell: Looks good to me, but someone else must approve
  Joshua C. Colp: Looks good to me, approved; Approved for Submit



diff --git a/Makefile.rules b/Makefile.rules
index b979927..c148af4 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -70,6 +70,12 @@
   endif
 endif
 
+# gcc version 8.2.1 and above must have partial-inlining disabled to avoid documented bug
+GCC_VER_GTE821:=$(shell expr `gcc --version | grep ^gcc | cut -d ' ' -f 3 | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 80201)
+ifeq ($(GCC_VER_GTE821),1)
+    OPTIMIZE+=-fno-partial-inlining
+endif
+
 ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS))$(AST_CODE_COVERAGE),no)
     _ASTCFLAGS+=$(OPTIMIZE)
 else

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11108
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ibd1afe60e0a38b88e85fdcd9b051004601c2f102
Gerrit-Change-Number: 11108
Gerrit-PatchSet: 4
Gerrit-Owner: Christian Savinovich <csavinovich at digium.com>
Gerrit-Reviewer: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua C. Colp <jcolp at digium.com>
Gerrit-Reviewer: mattf <creslin at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190313/40d1d8f2/attachment.html>


More information about the asterisk-code-review mailing list