Summary: | clang segfault when compiling with -march=bonnel (CPUTYPE=atom in make.conf) | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Mike Cui <cuicui> | ||||
Component: | bin | Assignee: | Dimitry Andric <dim> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | dim, toolchain | ||||
Priority: | --- | Keywords: | crash | ||||
Version: | 11.3-RELEASE | Flags: | koobs:
mfc-stable12?
koobs: mfc-stable11? |
||||
Hardware: | amd64 | ||||||
OS: | Any | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 240700 | ||||||
Attachments: |
|
Description
Mike Cui
2019-09-30 02:54:19 UTC
Created attachment 207950 [details]
Preprocessed C file and script
A commit references this bug: Author: dim Date: Mon Sep 30 19:24:21 UTC 2019 New revision: 352915 URL: https://svnweb.freebsd.org/changeset/base/352915 Log: Pull in r357528 from upstream llvm trunk (by Craig Topper): [X86] Check MI.isConvertibleTo3Addr() before calling convertToThreeAddress in X86FixupLEAs. X86FixupLEAs just assumes convertToThreeAddress will return nullptr for any instruction that isn't convertible. But the code in convertToThreeAddress for X86 assumes that any instruction coming in has at least 2 operands and that the second one is a register. But those properties aren't guaranteed of all instructions. We should check the instruction property first. Pull in r365720 from upstream llvm trunk (by Craig Topper): [X86] Don't convert 8 or 16 bit ADDs to LEAs on Atom in FixupLEAPass. We use the functions that convert to three address to do the conversion, but changing an 8 or 16 bit will cause it to create a virtual register. This can't be done after register allocation where this pass runs. I've switched the pass completely to a white list of instructions that can be converted to LEA instead of a blacklist that was incorrect. This will avoid surprises if we enhance the three address conversion function to include additional instructions in the future. Fixes PR42565. This should fix assertions/segfaults when compiling certain ports with CPUTYPE=atom. PR: 240928 MFC after: 3 days Changes: head/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Thanks Dimitry ^Triage: Leave mfc-* flags open until merge. @Dimitry, if this needs to be merged to releng/12.1 for 12.1-RELEASE, please add bug 240700 to this issues "Blocks" field A commit references this bug: Author: dim Date: Thu Oct 3 06:08:05 UTC 2019 New revision: 353031 URL: https://svnweb.freebsd.org/changeset/base/353031 Log: MFC r352915: Pull in r357528 from upstream llvm trunk (by Craig Topper): [X86] Check MI.isConvertibleTo3Addr() before calling convertToThreeAddress in X86FixupLEAs. X86FixupLEAs just assumes convertToThreeAddress will return nullptr for any instruction that isn't convertible. But the code in convertToThreeAddress for X86 assumes that any instruction coming in has at least 2 operands and that the second one is a register. But those properties aren't guaranteed of all instructions. We should check the instruction property first. Pull in r365720 from upstream llvm trunk (by Craig Topper): [X86] Don't convert 8 or 16 bit ADDs to LEAs on Atom in FixupLEAPass. We use the functions that convert to three address to do the conversion, but changing an 8 or 16 bit will cause it to create a virtual register. This can't be done after register allocation where this pass runs. I've switched the pass completely to a white list of instructions that can be converted to LEA instead of a blacklist that was incorrect. This will avoid surprises if we enhance the three address conversion function to include additional instructions in the future. Fixes PR42565. This should fix assertions/segfaults when compiling certain ports with CPUTYPE=atom. PR: 240928 Changes: _U stable/11/ stable/11/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp _U stable/12/ stable/12/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp A commit references this bug: Author: dim Date: Thu Oct 3 16:22:56 UTC 2019 New revision: 353053 URL: https://svnweb.freebsd.org/changeset/base/353053 Log: Merge r353031 from stable/12: Pull in r357528 from upstream llvm trunk (by Craig Topper): [X86] Check MI.isConvertibleTo3Addr() before calling convertToThreeAddress in X86FixupLEAs. X86FixupLEAs just assumes convertToThreeAddress will return nullptr for any instruction that isn't convertible. But the code in convertToThreeAddress for X86 assumes that any instruction coming in has at least 2 operands and that the second one is a register. But those properties aren't guaranteed of all instructions. We should check the instruction property first. Pull in r365720 from upstream llvm trunk (by Craig Topper): [X86] Don't convert 8 or 16 bit ADDs to LEAs on Atom in FixupLEAPass. We use the functions that convert to three address to do the conversion, but changing an 8 or 16 bit will cause it to create a virtual register. This can't be done after register allocation where this pass runs. I've switched the pass completely to a white list of instructions that can be converted to LEA instead of a blacklist that was incorrect. This will avoid surprises if we enhance the three address conversion function to include additional instructions in the future. Fixes PR42565. This should fix assertions/segfaults when compiling certain ports with CPUTYPE=atom. Approved by: re (kib) PR: 240928 Changes: _U releng/12.1/ releng/12.1/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp |