================ @@ -1135,11 +1135,34 @@ static void mergeAtomic(DenseMap<unsigned, unsigned>::iterator it, }; } +static void mergeX3RegUse(DenseMap<unsigned, unsigned>::iterator it, + const InputSectionBase *oldSection, + const InputSectionBase *newSection, + unsigned int oldTag, unsigned int newTag) { + // X3/GP register usage ar incompatible and cannot be merged, with the + // exception of the UNKNOWN or 0 value + using RISCVAttrs::RISCVX3RegUse::X3RegUsage; + if (newTag == X3RegUsage::UNKNOWN) + return; + if (oldTag == X3RegUsage::UNKNOWN) { + it->getSecond() = newTag; + return; + } + if (oldTag != newTag) { + errorOrWarn(toString(oldSection) + " has x3_reg_usage=" + Twine(oldTag) + ---------------- ilovepi wrote:
Thanks. I've changed it to an error, but it's now inconsistent w/ STACK_ALIGN a few lines up. Should we change that too? https://github.com/llvm/llvm-project/pull/84598 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits