https://gcc.gnu.org/g:d252ab88c331bd3a593686d44797c894d3972f6a
commit r17-6090-gd252ab88c331bd3a593686d44797c894d3972f6a Author: Juergen Christ <[email protected]> Date: Mon Nov 2 11:54:07 2026 +0100 Avoid parenthesis when printing differences involving labels. When printing differences to assembler, only SYMBOL_REF was excluded from the parenthesis branch. This lead to output like .L1-(.L2) when differences of code labels were used. Align the printing code with the printing of SYMBOL_REF, LABEL_REF, and CODE_LABEL. gcc/ChangeLog: * final.cc (output_addr_const): Adjust printing in MINUS case. Signed-off-by: Juergen Christ <[email protected]> Diff: --- gcc/final.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/final.cc b/gcc/final.cc index f8dd69bb7e2e..a25777aeeff2 100644 --- a/gcc/final.cc +++ b/gcc/final.cc @@ -3789,7 +3789,9 @@ output_addr_const (FILE *file, rtx x) fprintf (file, "-"); if ((CONST_INT_P (XEXP (x, 1)) && INTVAL (XEXP (x, 1)) >= 0) || GET_CODE (XEXP (x, 1)) == PC - || GET_CODE (XEXP (x, 1)) == SYMBOL_REF) + || GET_CODE (XEXP (x, 1)) == SYMBOL_REF + || GET_CODE (XEXP (x, 1)) == LABEL_REF + || GET_CODE (XEXP (x, 1)) == CODE_LABEL) output_addr_const (file, XEXP (x, 1)); else {
