On Wed, Nov 18, 2026 at 02:37:29PM +0530, Avinash Jayakar wrote: > The *largetocp10 patterns expand to two instructions (addis/addi or > addis/la) but did not specify a length attribute, so they inherited the > default length of four bytes. > > In large functions this made shorten_branches underestimate the distance > to labels after such TOC address materializations. With -mtune=power10, > which enables POWER10 fusion even on older CPUs, conditional branches > that were actually outside the +/-32KB branch range could be emitted as > short branches, causing assembler errors such as: > > Error: operand out of range (0x8138 is not between ...) > > Set the length of the four affected patterns to eight bytes. > > 2026-11-18 Avinash Jayakar <[email protected]> > Assisted-by: LLM for testcase generation > > gcc/ChangeLog: > PR target/128692 > * config/rs6000/rs6000.md (*largetocp10): Set length to 8. > (*largetocp10_aix<mode>): Likewise. > (*largetocp10_plus): Likewise. > (*largetocp10_plus_aix<mode>): Likewise. > > gcc/testsuite/ChangeLog: > PR target/128692 > * gcc.target/powerpc/pr128692.c: New test.
This is ok for the master branch, and backport to active trunks that are affected by it after a break-in period. -- Michael Meissner, IBM PO Box 98, Ayer, Massachusetts, USA, 01432 email: [email protected]
