From: Iain Sandoe Date: Sat, 26 Oct 2019 10:43:40 +0000 (+0000) Subject: [Darwin, PPC] Check for out of range asm values. X-Git-Tag: releases/gcc-7.5.0~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c3da58491261f0f1f98970335262f8c8fe20a24;p=thirdparty%2Fgcc.git [Darwin, PPC] Check for out of range asm values. There are some cases in which the value for the max skip to a p2align directive can be negative. The older assembler (and GAS) just ignores these cases but newer tools produce an error. To preserve behaviour, we avoid emitting out of range values. 2019-10-26 Iain Sandoe * config/rs6000/darwin.h (ASM_OUTPUT_MAX_SKIP_ALIGN):Guard against out of range max skip or log values. From-SVN: r277471 --- diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h index a04072a5cfb9..f8cc225c4402 100644 --- a/gcc/config/rs6000/darwin.h +++ b/gcc/config/rs6000/darwin.h @@ -257,9 +257,9 @@ extern int darwin_emit_branch_islands; /* This is supported in cctools 465 and later. The macro test above prevents using it in earlier build environments. */ #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \ - if ((LOG) != 0) \ + if ((LOG) > 0) \ { \ - if ((MAX_SKIP) == 0) \ + if ((MAX_SKIP) <= 0) \ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ else \ fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fa3f17d9fbe1..1028a20f3c21 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-10-26 Iain Sandoe + + * config/rs6000/darwin.h (ASM_OUTPUT_MAX_SKIP_ALIGN):Guard + against out of range max skip or log values. + 2019-10-25 Richard Earnshaw Backport from mainline