aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2019-10-26 10:43:40 +0000
committerIain Sandoe <iains@gcc.gnu.org>2019-10-26 10:43:40 +0000
commit8c3da58491261f0f1f98970335262f8c8fe20a24 (patch)
treea75a6b7e74da76b0bff4e008498f8a90de686d75
parente393660afe197450d8d545db653b78e70857c76c (diff)
downloadgcc-8c3da58491261f0f1f98970335262f8c8fe20a24.zip
gcc-8c3da58491261f0f1f98970335262f8c8fe20a24.tar.gz
gcc-8c3da58491261f0f1f98970335262f8c8fe20a24.tar.bz2
[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 <iain@sandoe.co.uk> * config/rs6000/darwin.h (ASM_OUTPUT_MAX_SKIP_ALIGN):Guard against out of range max skip or log values. From-SVN: r277471
-rw-r--r--gcc/config/rs6000/darwin.h4
-rw-r--r--gcc/testsuite/ChangeLog5
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index a04072a..f8cc225 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 fa3f17d..1028a20 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-10-26 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/rs6000/darwin.h (ASM_OUTPUT_MAX_SKIP_ALIGN):Guard
+ against out of range max skip or log values.
+
2019-10-25 Richard Earnshaw <rearnsha@arm.com>
Backport from mainline