2011-01-31 Alan Modra * config/rs6000/rs6000.c (print_operand): Rearrange addends in toc relative expressions as we do in print_operand_address. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 169426) +++ gcc/config/rs6000/rs6000.c (revision 169427) @@ -16182,7 +16182,18 @@ print_operand (FILE *file, rtx x, int co output_address (XEXP (x, 0)); } else - output_addr_const (file, x); + { + if (toc_relative_expr_p (x)) + /* This hack along with a corresponding hack in + rs6000_output_addr_const_extra arranges to output addends + where the assembler expects to find them. eg. + (const (plus (unspec [symbol_ref ("x") tocrel]) 4)) + without this hack would be output as "x@toc+4". We + want "x+4@toc". */ + output_addr_const (file, tocrel_base); + else + output_addr_const (file, x); + } return; case '&':