diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 3f97f44fa38..c92fde81b06 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -840,7 +840,8 @@ print_operand (file, x, code) if (i == -1) output_operand_lossage ("invalid %%J code"); else - fprintf (file, "%d", i + 1); + /* If we want bit 31, write a shift count of zero, not 32. */ + fprintf (file, "%d", i == 31 ? 0 : i + 1); return; case 'k':