Bug 232911 - Assembly code crashes clang
Summary: Assembly code crashes clang
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-toolchain (Nobody)
URL: https://bugs.llvm.org/show_bug.cgi?id...
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-02 16:15 UTC by Yuri Victorovich
Modified: 2020-10-05 18:11 UTC (History)
1 user (show)

See Also:


Attachments
c++ testcase (3.97 KB, text/plain)
2018-11-02 16:15 UTC, Yuri Victorovich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2018-11-02 16:15:34 UTC
Created attachment 198890 [details]
c++ testcase

The attached testcase crashes base clang, and clang60 and clang70.

Source: the upstream author of one github project reported it: https://github.com/sadko4u/lsp-plugins/issues/10#issuecomment-435305805
Comment 1 Gerald Pfeifer freebsd_committer freebsd_triage 2018-11-04 11:19:27 UTC
Reassigning to toolchain@ ; not that the upstream bug reported by Yuri
(thanks!) now has a much smaller reproducer.
Comment 2 commit-hook freebsd_committer freebsd_triage 2020-10-05 18:09:15 UTC
A commit references this bug:

Author: dim
Date: Mon Oct  5 18:08:54 UTC 2020
New revision: 366452
URL: https://svnweb.freebsd.org/changeset/base/366452

Log:
  Merge commit 0fac1c191 from llvm git (by Craig Topper):

    [X86] Allow Yz inline assembly constraint to choose ymm0 or zmm0 when
    avx/avx512 are enabled and type is 256 or 512 bits

    gcc supports selecting ymm0/zmm0 for the Yz constraint when used with
    256 or 512 bit vector types.

    Fixes PR45806

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

  This should fix 'fatal error: error in backend: Cannot select' errors if
  assertions are disabled, or 'Assertion failed: (isVector() && "Invalid
  vector type!"), function getVectorNumElements, file
  /usr/src/contrib/llvm-project/llvm/include/llvm/CodeGen/ValueTypes.h,
  line 276.', when building the audio/lsp-plugins-lv2 port.

  Direct commit to stable/{11,12} since head has clang 11.0.0, which
  already includes this fix.

  Reported by:	yuri
  PR:		232911

Changes:
  stable/11/contrib/llvm-project/clang/lib/Basic/Targets/X86.cpp
  stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp
  stable/12/contrib/llvm-project/clang/lib/Basic/Targets/X86.cpp
  stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp