Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2019 22:03:27 +0000
From:      bugzilla-noreply@freebsd.org
To:        toolchain@FreeBSD.org
Subject:   [Bug 233143] cc -mcmodel=large croaks on <ctype.h>
Message-ID:  <bug-233143-29464-mjMRy2HcwW@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-233143-29464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-233143-29464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D233143

--- Comment #3 from commit-hook@freebsd.org ---
A commit references this bug:

Author: dim
Date: Wed Feb 27 22:02:47 UTC 2019
New revision: 344639
URL: https://svnweb.freebsd.org/changeset/base/344639

Log:
  MFC r344503:

  Pull in r354756 from upstream llvm trunk (by Craig Topper):

    [X86] Fix tls variable lowering issue with large code model

    Summary:
    The problem here is the lowering for tls variable. Below is the DAG
    for the code. SelectionDAG has 11 nodes:

    t0: ch =3D EntryToken
        t8: i64,ch =3D load<(load 8 from `i8 addrspace(257)* null`,
        addrspace 257)> t0, Constant:i64<0>, undef:i64
          t10: i64 =3D X86ISD::WrapperRIP TargetGlobalTLSAddress:i64<i32*
          @x> 0 [TF=3D10]
        t11: i64,ch =3D load<(load 8 from got)> t0, t10, undef:i64
        t12: i64 =3D add t8, t11
      t4: i32,ch =3D load<(dereferenceable load 4 from @x)> t0, t12,
      undef:i64
    t6: ch =3D CopyToReg t0, Register:i32 %0, t4

    And when mcmodel is large, below instruction can NOT be folded.

      t10: i64 =3D X86ISD::WrapperRIP TargetGlobalTLSAddress:i64<i32* @x> 0
      [TF=3D10]
    t11: i64,ch =3D load<(load 8 from got)> t0, t10, undef:i64

    So "t11: i64,ch =3D load<(load 8 from got)> t0, t10, undef:i64" is
    lowered to " Morphed node: t11: i64,ch =3D MOV64rm<Mem:(load 8 from
    got)> t10, TargetConstant:i8<1>, Register:i64 $noreg,
    TargetConstant:i32<0>, Register:i32 $noreg, t0"

    When llvm start to lower "t10: i64 =3D X86ISD::WrapperRIP
    TargetGlobalTLSAddress:i64<i32* @x> 0 [TF=3D10]", it fails.

    The patch is to fold the load and X86ISD::WrapperRIP.

    Fixes PR26906

    Patch by LuoYuanke

    Reviewers: craig.topper, rnk, annita.zhang, wxiao3

    Reviewed By: rnk

    Subscribers: llvm-commits

    Tags: #llvm

    Differential Revision: https://reviews.llvm.org/D58336

  This should fix "fatal error: error in backend: Cannot select" messages
  when compiling <ctype.h> functions using -mcmodel=3Dlarge.

  Reported by:  phk
  PR:           233143

Changes:
_U  stable/11/
  stable/11/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
_U  stable/12/
  stable/12/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-233143-29464-mjMRy2HcwW>