]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/19388 (MAX_OFILE_ALIGNMENT on PA HP-UX)
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Sat, 15 Jan 2005 17:10:02 +0000 (17:10 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sat, 15 Jan 2005 17:10:02 +0000 (17:10 +0000)
PR ada/19388
* pa.c (pa_asm_output_aligned_common): Warn if specified alignment
exceeds maximum alignment for global common data.
* pa64-hpux.h (MAX_OFILE_ALIGNMENT): Define to 32768.
* som.h (MAX_OFILE_ALIGNMENT): Likewise.

From-SVN: r93698

gcc/ChangeLog
gcc/config/pa/pa.c
gcc/config/pa/pa64-hpux.h
gcc/config/pa/som.h

index 0865fe74e70a5a0bc4328f565667db81291ebb19..25e38eebfa49ca689c311302ba632b95b7d8e83b 100644 (file)
@@ -1,3 +1,11 @@
+2005-01-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR ada/19388
+       * pa.c (pa_asm_output_aligned_common): Warn if specified alignment
+       exceeds maximum alignment for global common data.
+       * pa64-hpux.h (MAX_OFILE_ALIGNMENT): Define to 32768.
+       * som.h (MAX_OFILE_ALIGNMENT): Likewise.
+
 2004-01-15  Roger Sayle  <roger@eyesopen.com>
 
        * tree-ssa-dom.c (extract_range_from_cond): Correct condition.
index 762f24e1b4ef75c4a1e652197f29c638857e412e..58642d10f288e7bcceee0f4b1efaf87879a087d2 100644 (file)
@@ -8253,6 +8253,17 @@ pa_asm_output_aligned_common (FILE *stream,
                              unsigned HOST_WIDE_INT size,
                              unsigned int align)
 {
+  unsigned int max_common_align;
+
+  max_common_align = TARGET_64BIT ? 128 : (size >= 4096 ? 256 : 64);
+  if (align > max_common_align)
+    {
+      warning ("alignment (%u) for %s exceeds maximum alignment "
+              "for global common data.  Using %u",
+              align / BITS_PER_UNIT, name, max_common_align / BITS_PER_UNIT);
+      align = max_common_align;
+    }
+
   bss_section ();
 
   assemble_name (stream, name);
index 2cc6691ed7af707ed08b0cccde7ebcedd66eb2c0..fac71bd7787b7d1e7f03609eabbf0e03a419be78 100644 (file)
@@ -122,11 +122,10 @@ Boston, MA 02111-1307, USA.  */
 
    The .align directive in the HP assembler allows alignments up to
    4096 bytes.  However, the maximum alignment of a global common symbol
-   is 16 bytes using HP ld.  For consistency, we use the same limit
-   with GNU ld.  */
+   is 16 bytes using HP ld.  Unfortunately, this macro doesn't provide
+   a method to check for common symbols.  */
 #undef MAX_OFILE_ALIGNMENT
-#define MAX_OFILE_ALIGNMENT                                             \
-  (TREE_PUBLIC (decl) && DECL_COMMON (decl) ? 128 : 32768)
+#define MAX_OFILE_ALIGNMENT 32768
 
 /* Due to limitations in the target structure, it isn't currently possible
    to dynamically switch between the GNU and HP assemblers.  */
index 96dc2a9077f4b74a422cef126c215ad7e2cfc89a..2d2e93e58ea39497443a20b92eeaf753823ea7c5 100644 (file)
@@ -287,11 +287,9 @@ do {                                               \
    The .align directive in the HP assembler allows alignments up to 4096
    bytes.  However, the maximum alignment of a global common symbol is 8
    bytes for objects smaller than the page size (4096 bytes).  For larger
-   objects, the linker provides an alignment of 32 bytes.  */
-#define MAX_OFILE_ALIGNMENT                                            \
-  (TREE_PUBLIC (decl) && DECL_COMMON (decl)                            \
-   ? (host_integerp (DECL_SIZE_UNIT (decl), 1) >= 4096 ? 256 : 64)     \
-   : 32768)
+   objects, the linker provides an alignment of 32 bytes.  Unfortunately,
+   this macro doesn't provide a mechanism to test for common symbols.  */
+#define MAX_OFILE_ALIGNMENT 32768
 
 /* The SOM linker hardcodes paths into binaries.  As a result, dotdots
    must be removed from library prefixes to prevent binaries from depending