This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bug in 19980806 and 19980814 snapshots
- To: David Edelsohn <dje at watson dot ibm dot com>
- Subject: Re: Bug in 19980806 and 19980814 snapshots
- From: Ovidiu Predescu <ovidiu at slip dot net>
- Date: Wed, 16 Sep 1998 19:59:47 -0700
- Cc: Fila Kolodny <fila at ibi dot com>, egcs at cygnus dot com
>>>>> On Tue, 15 Sep 1998 23:6:02 -0400, "David" == David Edelsohn wrote:
>>>>> Fila Kolodny writes:
Fila> I get a compile error building these snapshots for rs6000 targets.
Fila> gcc/objc/encoding.c line 801 uses the ADJUST_ALIGN_FIELD macro which
Fila> references TYPE_MODE, TREE_TYPE and ARRAY_TYPE. It seems that this was
Fila> broken as a result of the change by <ovidiu@aracnet.com> for correctly
Fila> computing the size of compound types in the presence of bitfields.
David> If Mr. Predescu wants to use those macros, he needs to include the
David> appropriate header files to define macros that one would utilize to
David> implement ADJUST_FIELD_ALIGN using gcc/stor-layout.c as a template.
David> I don't know how those headers might interact with the rest of the
David> file, so I am not going to start trying to fix it. Hopefully the
David> original author can explore more how his changes interact with a
David> greater variety of ports and update his changes appropriately.
Actually I don't want to include those macros. The idea is that encoding.c is
part of a runtime library that _cannot_ include the things defined by
stor-layout.c, tree.c and whatever other files part of the front-end part of
the compiler. The problem however is that I actually need that kind of
information in order to know the layout of structures on various machines.
The algorithm in encoding.c follows the one in stor-layout.c but works with
ObjC type encodings that are C strings instead of GCC trees. The idea is to
define the TYPE_MODE, TREE_TYPE and ARRAY_TYPE in terms of the ObjC runtime
types and encodings. I did most of this work for the other macros but I
obviously missed these, although I wonder why because I tested the code on AIX
4.1.
Anyway, try the below diff applied to encoding.c. Please let me know the
results as I no longer have access to an AIX machine.
Thanks,
Ovidiu
diff -c egcs/gcc/objc/encoding.c egcs-1.1-objc-gc/gcc/objc/encoding.c
*** egcs/gcc/objc/encoding.c Thu Sep 3 23:26:59 1998
--- egcs-1.1-objc-gc/gcc/objc/encoding.c Wed Sep 16 19:54:04 1998
***************
*** 47,55 ****
--- 47,58 ----
macros. */
#define TREE_CODE(TYPE) *TYPE
+ #define TREE_TYPE(TREE) TREE
+
#define RECORD_TYPE _C_STRUCT_B
#define UNION_TYPE _C_UNION_B
#define QUAL_UNION_TYPE _C_UNION_B
+ #define ARRAY_TYPE _C_ARY_B
#define TYPE_FIELDS(TYPE) objc_skip_typespec (TYPE)
***************
*** 57,62 ****
--- 60,66 ----
#define DFmode _C_DBL
+ #define get_inner_array_type(TYPE) objc_skip_typespec(TYPE)