This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bug-report: aligment of vtable is greater, that maximum object file aligment


[ egcs dropped, egcs-patches added, egcs-bugs retained, Alexandre
dropped becuase we know he's on one or more of these lists. ]

> Synopsis:     aligment of vtable is greater than maximum object file
> aligment
> Release:      egcs-2.91.57 19980901 (egcs-1.1 release)
> Envirowment:
>       SCO Open Server version 5.04
> Description:
>      
>       During compiling some programs, egcs produce the next warning:
> 
> STL/STLASEqualityCollection.h:45: warning: alignment of `vtable for
> class
> STLASEqualityIterator_const<set<OBVarVar<CORBA_Any>,AnyUniversalLess,__default_alloc_template<false,0>
> > >' is greater than maximum object file alignment. Using 4.


I can confirm that the current snapshots on OpenServer do the same thing
in either ELF or COFF modes.  If I feed that same preprocessed source
to my Linux box, cc1plus takes a crash.  The problem seems to be with
one of my own patches.  But that doesn't have anything to do with what
you're seeing.

 * c-pragma.c (handle_pragma_token): Test for null tree before 
   dereferencing TREE_CODE.

Index: c-pragma.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/c-pragma.c,v
retrieving revision 1.11
diff -u -p -r1.11 c-pragma.c
--- c-pragma.c  1998/10/11 21:05:04     1.11
+++ c-pragma.c  1998/10/15 03:41:19
@@ -385,7 +385,7 @@ handle_pragma_token (string, token)

     case ps_left:

-      if (TREE_CODE(token) == INTEGER_CST)
+      if (token && TREE_CODE(token) == INTEGER_CST)
        align = TREE_INT_CST_LOW(token);
       else
        align = atoi (string);

Once that is fixed, Linux doesn't show this error.  Aaaaah.  I
see.  It includes ../linux.h which includes svr4.h which defines
MAX_OFILE_ALIGNMENT to a largish value.

Please try this patch to sco5.h.  You'll have to rebuild varasm.o and
let it rebuild cc1plus.  I can't test that this actually WORKS or is
even necessary; only that it avoids the warning and results in code
that'll still assemble in both COFF and ELF.  Since this isn't triggered
by the testsuites, I'll have to rely on you to tell me if this patch
makes things better or worse for you.

 * sco5.h (MAX_OFILE_ALIGNMENT): Define as in svr4.h


Index: gcc/config/i386/sco5.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/i386/sco5.h,v
retrieving revision 1.19
diff -u -p -r1.19 sco5.h
--- sco5.h      1998/09/19 22:25:53     1.19
+++ sco5.h      1998/10/15 03:53:41
@@ -921,6 +921,13 @@ dtors_section ()                                   \

 #define TARGET_MEM_FUNCTIONS

+/* Biggest alignment supported by the object file format of this
+   machine.  Use this macro to limit the alignment which can be
+   specified using the `__attribute__ ((aligned (N)))' construct.  If
+   not defined, the default value is `BIGGEST_ALIGNMENT'.  */
+
+#define MAX_OFILE_ALIGNMENT (32768*8)
+
 /*
 Here comes some major hackery to get the crt stuff to compile properly.
 Since we can (and do) compile for both COFF and ELF environments, we



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]