Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Mar 2019 18:19:45 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r345073 - head/contrib/llvm/lib/Target/X86
Message-ID:  <201903121819.x2CIJjpZ002589@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Tue Mar 12 18:19:44 2019
New Revision: 345073
URL: https://svnweb.freebsd.org/changeset/base/345073

Log:
  Revert r308867 (which was originally committed in the clang390-import
  project branch):
  
    Work around LLVM PR30879, which is about a bad interaction between
    X86 Call Frame Optimization on i386 and libunwind, by disallowing the
    optimization for i386-freebsd12.
  
    This should fix some instances of broken exception handling when
    frame pointers are omitted, in particular some unittests run during
    the build of editors/libreoffice.
  
    This hack will be removed as soon as upstream has implemented a more
    permanent fix for this problem.
  
  And indeed, after r345018 and r345019, which updated LLVM libunwind to
  the most recent version, the above workaround is no longer needed.  The
  upstream commit which fixed this is:
  
    https://llvm.org/viewvc/llvm-project?view=revision&revision=292723
  
  Specifically, 32 bit (i386-freebsd) executables optimized with omitted
  frame pointers and Call Frame Optimization should now behave correctly
  when a C++ exception is thrown, and the stack is unwound.
  
  Upstream PR:	https://llvm.org/bugs/show_bug.cgi?id=30879
  PR:		236062
  MFC after:	1 month
  X-MFC-With:	r344779

Modified:
  head/contrib/llvm/lib/Target/X86/X86CallFrameOptimization.cpp
Directory Properties:
  head/   (props changed)
  head/contrib/llvm/   (props changed)

Modified: head/contrib/llvm/lib/Target/X86/X86CallFrameOptimization.cpp
==============================================================================
--- head/contrib/llvm/lib/Target/X86/X86CallFrameOptimization.cpp	Tue Mar 12 17:04:48 2019	(r345072)
+++ head/contrib/llvm/lib/Target/X86/X86CallFrameOptimization.cpp	Tue Mar 12 18:19:44 2019	(r345073)
@@ -139,11 +139,6 @@ bool X86CallFrameOptimization::isLegal(MachineFunction
   if (NoX86CFOpt.getValue())
     return false;
 
-  // Work around LLVM PR30879 (bad interaction between CFO and libunwind)
-  if (STI->isTargetFreeBSD() && STI->is32Bit() &&
-      STI->getTargetTriple().getOSMajorVersion() >= 12)
-    return false;
-
   // We can't encode multiple DW_CFA_GNU_args_size or DW_CFA_def_cfa_offset
   // in the compact unwind encoding that Darwin uses. So, bail if there
   // is a danger of that being generated.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903121819.x2CIJjpZ002589>