]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Darwin, PPC] Check for out of range asm values.
authorIain Sandoe <iain@sandoe.co.uk>
Thu, 24 Oct 2019 14:53:28 +0000 (14:53 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Thu, 24 Oct 2019 14:53:28 +0000 (14:53 +0000)
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.

gcc/ChangeLog:

2019-10-24  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline
2019-10-23  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: r277405

gcc/ChangeLog
gcc/config/rs6000/darwin.h

index 302d392e1442e7c3454055171796b74b8f4f8358..78fb07342cf88fae9a63ff43ae4d6bfad327b1f0 100644 (file)
@@ -1,3 +1,8 @@
+2019-10-24  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-23  Peter Bergner  <bergner@linux.ibm.com>
 
        Backport from mainline
index 98ecf0ad2fe66150d61606861db5825fb662b9b1..6f750c69e0e7b06c523ac1af7f18a4673a64faf1 100644 (file)
@@ -291,9 +291,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)); \