varasm.c (assemble_variable): Emit alignment warning.
authorCatherine Moore <clm@cygnus.com>
Mon, 22 Jun 1998 09:14:09 +0000 (09:14 +0000)
committerCatherine Moore <clm@gcc.gnu.org>
Mon, 22 Jun 1998 09:14:09 +0000 (05:14 -0400)
Mon Jun 22 11:10:00 1998  Catherine Moore  <clm@cygnus.com>
        * varasm.c (assemble_variable):  Emit alignment warning.

From-SVN: r20655

gcc/ChangeLog
gcc/varasm.c

index 239c172a32ceba90340bd575bb42906595f3e472..16af1ae3d44c271bf6cd054e56059d20a3d17835 100644 (file)
@@ -1,3 +1,7 @@
+Mon Jun 22 11:10:00 1998  Catherine Moore  <clm@cygnus.com>
+
+        * varasm.c (assemble_variable):  Emit alignment warning.
+
 Mon Jun 22 08:18:46 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * Makefile.in (varasm.o): Depend on sdbout.h.
index 2d595d4786a837d33d05f80a12772b1bdbd14a56..1759f098fbb1c3329115f6d5d4423a8e84e79c16 100644 (file)
@@ -1333,7 +1333,13 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
       rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1;
       rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT)
                 * (BIGGEST_ALIGNMENT / BITS_PER_UNIT));
-
+      
+#if !defined(ASM_OUTPUT_ALIGNED_COMMON) && !defined(ASM_OUTPUT_ALIGNED_BSS)
+      if (warn_bss_align && (DECL_ALIGN (decl) / BITS_PER_UNIT) > rounded)
+         warning_with_decl 
+           (decl, "requested alignment for %s is greater than implemented alignment of %d.",rounded);
+#endif
+       
 #ifdef DBX_DEBUGGING_INFO
       /* File-scope global variables are output here.  */
       if (write_symbols == DBX_DEBUG && top_level)