[gcc/devel/omp/gcc-9] [Darwin, PPC] Check for out of range asm values.

Tobias Burnus burnus@gcc.gnu.org
Thu Mar 5 14:16:00 GMT 2020


https://gcc.gnu.org/g:dac3f1132b182a52e9138b26ed2a551c911300d4

commit dac3f1132b182a52e9138b26ed2a551c911300d4
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Thu Oct 24 14:53:28 2019 +0000

    [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.
    
    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

Diff:
---
 gcc/ChangeLog              | 5 +++++
 gcc/config/rs6000/darwin.h | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 302d392..78fb073 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index 98ecf0a..6f750c6 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -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)); \



More information about the Gcc-cvs mailing list