Skip to content

Commit

Permalink
Fix old gcc build (#91845)
Browse files Browse the repository at this point in the history
  • Loading branch information
am11 authored Oct 9, 2023
1 parent 63a375e commit 94f2122
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/coreclr/debug/createdump/crashinfounix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ CrashInfo::VisitModule(uint64_t baseAddress, std::string& moduleName)
m_runtimeBaseAddress = baseAddress;

// explicit initialization for old gcc support; instead of just runtimeInfo { }
RuntimeInfo runtimeInfo { .Signature = { }, .Version = 0, .RuntimeModuleIndex = { }, .DacModuleIndex = { }, .DbiModuleIndex = { } };
RuntimeInfo runtimeInfo { .Signature = { }, .Version = 0, .RuntimeModuleIndex = { }, .DacModuleIndex = { }, .DbiModuleIndex = { }, .RuntimeVersion = { } };
if (ReadMemory((void*)(baseAddress + symbolOffset), &runtimeInfo, sizeof(RuntimeInfo)))
{
if (strcmp(runtimeInfo.Signature, RUNTIME_INFO_SIGNATURE) == 0)
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/jit/hwintrinsicxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3623,7 +3623,8 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
impAppendTree(gtUnusedValNode(*val3), CHECK_SPILL_ALL, impCurStmtDI);
}

switch (info.oper1)
// cast in switch clause is needed for old gcc
switch ((TernaryLogicOperKind)info.oper1)
{
case TernaryLogicOperKind::Select:
{
Expand Down
12 changes: 6 additions & 6 deletions src/coreclr/jit/valuenum.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,12 @@ class ValueNumStore
static const unsigned VNFOA_KnownNonNullShift = 5;
static const unsigned VNFOA_SharedStaticShift = 6;

static_assert(unsigned(VNFOA_IllegalGenTreeOp) == (1 << VNFOA_IllegalGenTreeOpShift));
static_assert(unsigned(VNFOA_Commutative) == (1 << VNFOA_CommutativeShift));
static_assert(unsigned(VNFOA_Arity1) == (1 << VNFOA_ArityShift));
static_assert(VNFOA_ArityMask == (VNFOA_MaxArity << VNFOA_ArityShift));
static_assert(unsigned(VNFOA_KnownNonNull) == (1 << VNFOA_KnownNonNullShift));
static_assert(unsigned(VNFOA_SharedStatic) == (1 << VNFOA_SharedStaticShift));
static_assert_no_msg(unsigned(VNFOA_IllegalGenTreeOp) == (1 << VNFOA_IllegalGenTreeOpShift));
static_assert_no_msg(unsigned(VNFOA_Commutative) == (1 << VNFOA_CommutativeShift));
static_assert_no_msg(unsigned(VNFOA_Arity1) == (1 << VNFOA_ArityShift));
static_assert_no_msg(VNFOA_ArityMask == (VNFOA_MaxArity << VNFOA_ArityShift));
static_assert_no_msg(unsigned(VNFOA_KnownNonNull) == (1 << VNFOA_KnownNonNullShift));
static_assert_no_msg(unsigned(VNFOA_SharedStatic) == (1 << VNFOA_SharedStaticShift));

// These enum constants are used to encode the cast operation in the lowest bits by VNForCastOper
enum VNFCastAttrib
Expand Down

0 comments on commit 94f2122

Please sign in to comment.