Pull in r322056 from upstream llvm trunk (by Serguei Katkov):

[CGP] Fix Complex addressing mode for offset

  If the offset is differ in two addressing mode we can continue only
  if ScaleReg is not set due to we will use it as merge of different
  offsets.

  It should fix PR35799 and PR35805.

  Reviewers: john.brawn, reames
  Reviewed By: reames
  Subscribers: llvm-commits
  Differential Revision: https://reviews.llvm.org/D41227

This should fix "ScaledReg == nullptr" assertions when building the
graphics/xpx, mail/alpine and editors/pico-alpine ports.

Reported by:	jbeich
PR:		224866, 224995
This commit is contained in:
Dimitry Andric 2018-01-09 17:41:34 +00:00
parent 18a7633888
commit 66f8bb86f8

View File

@ -2700,8 +2700,13 @@ public:
// we still need to collect it due to original value is different.
// And later we will need all original values as anchors during
// finding the common Phi node.
// We also must reject the case when base offset is different and
// scale reg is not null, we cannot handle this case due to merge of
// different offsets will be used as ScaleReg.
if (DifferentField != ExtAddrMode::MultipleFields &&
DifferentField != ExtAddrMode::ScaleField) {
DifferentField != ExtAddrMode::ScaleField &&
(DifferentField != ExtAddrMode::BaseOffsField ||
!NewAddrMode.ScaledReg)) {
AddrModes.emplace_back(NewAddrMode);
return true;
}