[PowerPC] Recent branch too far breakage

I'm using a recent revision of TOT (280704) to build clang/LLVM for PowerPC64 little endian. I'm getting an assembler error when building PPCInstPrinter.cpp:

The error is:

/tmp/PPCInstPrinter-84c835.s: Assembler messages:
/tmp/PPCInstPrinter-84c835.s:7671: Error: operand out of range (0x0000000000008004 is not between 0xffffffffffff8000 and 0x0000000000007ffc)

The offending line is the bne branch in this snippet:

.LBB24_787:
         ld 3, 16(29)
         ld 4, 24(29)
         sub 4, 4, 3
         rldicl 4, 4, 60, 4
         cmplwi 0, 4, 3
         bne 0, .LBB24_2630

Could this be because of a recent change in the PowerPC code generator or just because PPCInstPrinter.cpp changed a bit and exposed a pre-existing bug?

-Rich

Hi Rich,

It is hard to tell, but there was a bug fix made to the branch relaxation code; perhaps the fix was not bug free -- Could this have been caused by r280626?

-Hal

From: "Hal Finkel via llvm-dev" <llvm-dev@lists.llvm.org>
To: "Richard Pennington" <rich@pennware.com>
Cc: llvm-dev@lists.llvm.org
Sent: Wednesday, September 7, 2016 7:37:50 AM
Subject: Re: [llvm-dev] [PowerPC] Recent branch too far breakage

Hi Rich,

It is hard to tell, but there was a bug fix made to the branch
relaxation code; perhaps the fix was not bug free -- Could this have
been caused by r280626?

Is this a release or a debug build?

-Hal

From: "Hal Finkel via llvm-dev" <llvm-dev@lists.llvm.org>
To: "Richard Pennington" <rich@pennware.com>
Cc: llvm-dev@lists.llvm.org
Sent: Wednesday, September 7, 2016 7:37:50 AM
Subject: Re: [llvm-dev] [PowerPC] Recent branch too far breakage

Hi Rich,

It is hard to tell, but there was a bug fix made to the branch
relaxation code; perhaps the fix was not bug free -- Could this have
been caused by r280626?

Is this a release or a debug build?

  -Hal

Hi Hal,

This occurred between r279916 and r280704, so it could have been r280626. I'll try to revert it in my code and see if the problem goes away.
It is a release build.

-Rich

Hi Rich,

r283086 should fix this.

Thanks again,
Hal

Hi Hal,

It is fixed. Thanks!

-Rich