home *** CD-ROM | disk | FTP | other *** search
/ Programming Win32 Under the API / ProgrammingWin32UnderTheApiPatVillani.iso / patches / gcc-2_95_2-x86-win32-patches.zi / gcc-2.95.2-patches / broken-down / gcc-2.95.2-msvc-bitfield-pack.diff < prev    next >
Encoding:
Text File  |  1999-11-08  |  18.4 KB  |  484 lines

  1. gcc/ChangeLog.mk
  2. ================
  3.  
  4. Sun Jul  4 13:18:23 1999  Mumit Khan  <khan@xraylith.wisc.edu>
  5.  
  6.     * i386/cygwin.h (PCC_BITFIELD_TYPE_MATTERS): Fix typo and 
  7.     define to be 1.
  8.     (GROUP_BITFIELDS_BY_ALIGN): Define.
  9.  
  10. Mon Apr 26 12:25:41 1999 Donn Terry (donn@interix.com)
  11.  
  12.     * flags.h (flag_native_struct): New boolean.
  13.     * tree.h (TYPE_NATIVE): New macro.
  14.     (tree_type): Add native_flag.
  15.     * c-common.c (attrs): Add A_NATIVE, A_GCC_PACK to enum.
  16.     (init_attributes): Set them up.
  17.     (decl_attributes): Parse them, setting flag_native_struct.
  18.     * c-decl.c (start_struct): Propigate TYPE_NATIVE.
  19.     * stor-layout.c (layout_record): Honor GROUP_BITFIELDS_BY_ALIGN.
  20.     (layout_union): Likewise.
  21.     * toplev.c (lang_independent_options): Add native-struct and
  22.     gcc-struct flags.
  23.     (flag_native_struct): Initialize.
  24.     * config/i386/i386-interix.h (PCC_BITFIELD_TYPE_TEST): remove.
  25.     * config/alpha/alpha-interix.h (PCC_BITFIELD_TYPE_TEST): remove.
  26.  
  27. gcc/cp/ChangeLog.mk
  28. ====================
  29.  
  30. Mon Apr 26 12:25:41 1999 Donn Terry (donn@interix.com)
  31.  
  32.     * decl.c (xref_tag): Init TYPE_PACKED and TYPE_NATIVE from globals.
  33.     * pt.c (instantiate_class_template): Propigate TYPE_NATIVE.
  34.  
  35. Index: gcc-2.95.2/gcc/c-common.c
  36. ===================================================================
  37. RCS file: /homes/khan/src/CVSROOT/gcc-2.95.2/gcc/c-common.c,v
  38. retrieving revision 1.1.1.1
  39. diff -u -3 -p -r1.1.1.1 c-common.c
  40. --- gcc-2.95.2/gcc/c-common.c    1999/11/05 01:09:41    1.1.1.1
  41. +++ gcc-2.95.2/gcc/c-common.c    1999/11/05 06:24:52
  42. @@ -54,7 +54,9 @@ int skip_evaluation;
  43.  enum attrs {A_PACKED, A_NOCOMMON, A_COMMON, A_NORETURN, A_CONST, A_T_UNION,
  44.          A_NO_CHECK_MEMORY_USAGE, A_NO_INSTRUMENT_FUNCTION,
  45.          A_CONSTRUCTOR, A_DESTRUCTOR, A_MODE, A_SECTION, A_ALIGNED,
  46. -        A_UNUSED, A_FORMAT, A_FORMAT_ARG, A_WEAK, A_ALIAS};
  47. +        A_UNUSED, A_FORMAT, A_FORMAT_ARG, A_WEAK, A_ALIAS,
  48. +        A_NATIVE, A_GCC_PACK,
  49. +        };
  50.  
  51.  enum format_type { printf_format_type, scanf_format_type,
  52.             strftime_format_type };
  53. @@ -377,6 +379,8 @@ static void
  54.  init_attributes ()
  55.  {
  56.    add_attribute (A_PACKED, "packed", 0, 0, 0);
  57. +  add_attribute (A_NATIVE, "native_struct", 0, 0, 0);
  58. +  add_attribute (A_GCC_PACK, "gcc_struct", 0, 0, 0);
  59.    add_attribute (A_NOCOMMON, "nocommon", 0, 0, 1);
  60.    add_attribute (A_COMMON, "common", 0, 0, 1);
  61.    add_attribute (A_NORETURN, "noreturn", 0, 0, 1);
  62. @@ -500,6 +504,24 @@ decl_attributes (node, attributes, prefi
  63.          DECL_PACKED (decl) = 1;
  64.        /* We can't set DECL_PACKED for a VAR_DECL, because the bit is
  65.           used for DECL_REGISTER.  It wouldn't mean anything anyway.  */
  66. +      else
  67. +        warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
  68. +      break;
  69. +
  70. +    case A_NATIVE:
  71. +      /* It only applies to the whole struct */
  72. +      if (is_type)
  73. +        TYPE_NATIVE (type) = 1;
  74. +      /* it doesn't mean anything to variables */
  75. +      else
  76. +        warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
  77. +      break;
  78. +
  79. +    case A_GCC_PACK:
  80. +      /* It only applies to the whole struct */
  81. +      if (is_type)
  82. +        TYPE_NATIVE (type) = 0;
  83. +      /* it doesn't mean anything to variables */
  84.        else
  85.          warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
  86.        break;
  87. Index: gcc-2.95.2/gcc/c-decl.c
  88. ===================================================================
  89. RCS file: /homes/khan/src/CVSROOT/gcc-2.95.2/gcc/c-decl.c,v
  90. retrieving revision 1.2
  91. diff -u -3 -p -r1.2 c-decl.c
  92. --- gcc-2.95.2/gcc/c-decl.c    1999/11/05 05:54:33    1.2
  93. +++ gcc-2.95.2/gcc/c-decl.c    1999/11/05 06:24:53
  94. @@ -5743,6 +5743,7 @@ start_struct (code, name)
  95.      {
  96.        C_TYPE_BEING_DEFINED (ref) = 1;
  97.        TYPE_PACKED (ref) = flag_pack_struct;
  98. +      TYPE_NATIVE (ref) = flag_native_struct;
  99.        if (TYPE_FIELDS (ref))
  100.      error ((code == UNION_TYPE ? "redefinition of `union %s'"
  101.          : "redefinition of `struct %s'"),
  102. @@ -5757,6 +5758,7 @@ start_struct (code, name)
  103.    pushtag (name, ref);
  104.    C_TYPE_BEING_DEFINED (ref) = 1;
  105.    TYPE_PACKED (ref) = flag_pack_struct;
  106. +  TYPE_NATIVE (ref) = flag_native_struct;
  107.    return ref;
  108.  }
  109.  
  110. Index: gcc-2.95.2/gcc/flags.h
  111. ===================================================================
  112. RCS file: /homes/khan/src/CVSROOT/gcc-2.95.2/gcc/flags.h,v
  113. retrieving revision 1.1.1.1
  114. diff -u -3 -p -r1.1.1.1 flags.h
  115. --- gcc-2.95.2/gcc/flags.h    1999/11/05 01:09:42    1.1.1.1
  116. +++ gcc-2.95.2/gcc/flags.h    1999/11/05 06:24:53
  117. @@ -447,6 +447,9 @@ extern int flag_gnu_linker;
  118.  /* Tag all structures with __attribute__(packed) */
  119.  extern int flag_pack_struct;
  120.  
  121. +/* Tag all structures with __attribute__(native_struct) */
  122. +extern int flag_native_struct;
  123. +
  124.  /* This flag is only tested if alias checking is enabled.
  125.     0 if pointer arguments may alias each other.  True in C.
  126.     1 if pointer arguments may not alias each other but may alias
  127. Index: gcc-2.95.2/gcc/stor-layout.c
  128. ===================================================================
  129. RCS file: /homes/khan/src/CVSROOT/gcc-2.95.2/gcc/stor-layout.c,v
  130. retrieving revision 1.1.1.1
  131. diff -u -3 -p -r1.1.1.1 stor-layout.c
  132. --- gcc-2.95.2/gcc/stor-layout.c    1999/11/05 01:09:45    1.1.1.1
  133. +++ gcc-2.95.2/gcc/stor-layout.c    1999/11/05 06:24:53
  134. @@ -333,6 +333,26 @@ layout_decl (decl, known_align)
  135.     The return value is a list of static members of the record.
  136.     They still need to be laid out.  */
  137.  
  138. +/* To repreise: PCC_BITFIELD_TYPE_MATTERS is a flag (which must be a valid
  139. +   expression) to force alignment to follow a different set of alignment
  140. +   rules (more like "other compilers", whatever that means).
  141. +
  142. +   In some systems, it can be a dynamic test for the "native" flag applied
  143. +   to a structure.  In others it may not be.
  144. +
  145. +   It may also be just part of the solution.  The flag GROUP_BITFIELDS_BY_ALIGN
  146. +   causes structures to be aligned according to additional rules (beyond
  147. +   those of PCC...) (that coincide with Windows alignment). */
  148. +
  149. +/* G_B_B_A means that a change in the required alignment of a sequence
  150. +   of bitfields causes the next one to be aligned to whatever alignment
  151. +   it needs.  Otherwise with P_B_T_M, bitfields are forced to align only
  152. +   by zero-sized fields.  With neither, gcc default alignment (fairly
  153. +   tightly packed), prevails.  So noone goes astray, sanity check. */
  154. +#if defined(GROUP_BITFIELDS_BY_ALIGN) && !defined(PCC_BITFIELD_TYPE_MATTERS)
  155. +You must define PCC_BITFIELD_TYPE_MATTERS to use GROUP_BITFIELDS_BY_ALIGN
  156. +#endif
  157. +
  158.  static tree
  159.  layout_record (rec)
  160.       tree rec;
  161. @@ -351,6 +371,7 @@ layout_record (rec)
  162.    /* Once we start using VAR_SIZE, this is the maximum alignment
  163.       that we know VAR_SIZE has.  */
  164.    register int var_align = BITS_PER_UNIT;
  165. +  int last_align = -1;
  166.  
  167.  #ifdef STRUCTURE_SIZE_BOUNDARY
  168.    /* Packed structures don't need to have minimum size.  */
  169. @@ -402,35 +423,111 @@ layout_record (rec)
  170.  
  171.  #ifndef PCC_BITFIELD_TYPE_MATTERS
  172.        record_align = MAX (record_align, desired_align);
  173. -#else
  174. +#else /* [ */
  175.        if (PCC_BITFIELD_TYPE_MATTERS && TREE_TYPE (field) != error_mark_node
  176.        && DECL_BIT_FIELD_TYPE (field)
  177.        && ! integer_zerop (TYPE_SIZE (TREE_TYPE (field))))
  178.      {
  179. -      /* For these machines, a zero-length field does not
  180. -         affect the alignment of the structure as a whole.
  181. -         It does, however, affect the alignment of the next field
  182. -         within the structure.  */
  183. -      if (! integer_zerop (DECL_SIZE (field)))
  184. -        record_align = MAX ((int)record_align, desired_align);
  185. -      else if (! DECL_PACKED (field))
  186. -        desired_align = TYPE_ALIGN (TREE_TYPE (field));
  187. -      /* A named bit field of declared type `int'
  188. -         forces the entire structure to have `int' alignment.  */
  189. -      if (DECL_NAME (field) != 0)
  190. +#ifdef GROUP_BITFIELDS_BY_ALIGN
  191. +      if (!GROUP_BITFIELDS_BY_ALIGN)
  192. +#endif
  193.          {
  194. -          int type_align = TYPE_ALIGN (TREE_TYPE (field));
  195. -          if (maximum_field_alignment != 0)
  196. -        type_align = MIN (type_align, maximum_field_alignment);
  197. -          else if (DECL_PACKED (field))
  198. -        type_align = MIN (type_align, BITS_PER_UNIT);
  199. +          /* For these machines, a zero-length field does not
  200. +         affect the alignment of the structure as a whole.
  201. +         It does, however, affect the alignment of the next field
  202. +         within the structure.  */
  203. +          if (! integer_zerop (DECL_SIZE (field)))
  204. +        record_align = MAX ((int)record_align, desired_align);
  205. +          else if (! DECL_PACKED (field))
  206. +        desired_align = TYPE_ALIGN (TREE_TYPE (field));
  207. +          /* A named bit field of declared type e.g. `int'
  208. +         forces the entire structure to have `int' alignment.  */
  209. +          if (DECL_NAME (field) != 0)
  210. +        {
  211. +          int type_align = TYPE_ALIGN (TREE_TYPE (field));
  212. +          if (maximum_field_alignment != 0)
  213. +            type_align = MIN (type_align, maximum_field_alignment);
  214. +          else if (DECL_PACKED (field))
  215. +            type_align = MIN (type_align, BITS_PER_UNIT);
  216.  
  217. -          record_align = MAX ((int)record_align, type_align);
  218. +          record_align = MAX ((int)record_align, type_align);
  219. +        }
  220. +        }
  221. +#ifdef GROUP_BITFIELDS_BY_ALIGN /* [ */
  222. +      else 
  223. +        {
  224. +          /* For these, a zero size bitfield is only meaningful when
  225. +         immediately following another bitfield.  If if follows
  226. +         a non-bitfield, it's COMPLETELY ignored.  Just to add
  227. +         to the confusion, a zero size bitfield is NOT considered
  228. +         a prior bitfield for this rule, so two zero-size bitfields
  229. +         in a row cause the second to be ignored.
  230. +
  231. +         Hey... don't blame me: I'm just trying to do what they
  232. +         did.  */
  233. +
  234. +          if (DECL_PACKED (field)) {
  235. +          /* Already done */
  236. +          }
  237. +          else if (integer_zerop (DECL_SIZE (field)) && last_align == -1) 
  238. +        {
  239. +          /* Completely ignore it */
  240. +          desired_align = 1;
  241. +            }
  242. +          else 
  243. +        {
  244. +          int type_align;
  245. +          int proposed_record_align;
  246. +
  247. +          proposed_record_align 
  248. +              = type_align 
  249. +              = TYPE_ALIGN (TREE_TYPE (field));
  250. +
  251. +          /* A zero size forces both field and record alignment,
  252. +             *if* it wasn't ignored above.  Non-zero size forces
  253. +             record alignment, too. */
  254. +              if (integer_zerop (DECL_SIZE (field)))
  255. +              desired_align = type_align;
  256. +
  257. +          /* Apply ceilings on record alignment */
  258. +          if (maximum_field_alignment != 0)
  259. +            proposed_record_align = 
  260. +            MIN (proposed_record_align, maximum_field_alignment);
  261. +          else if (DECL_PACKED (field))
  262. +            proposed_record_align = 
  263. +            MIN (proposed_record_align, BITS_PER_UNIT);
  264. +
  265. +          record_align = MAX ((int)record_align, proposed_record_align);
  266. +
  267. +          /* We only change alignment if it changes; else leave things
  268. +             alone. */
  269. +          if (last_align != type_align)
  270. +              desired_align = MAX(last_align,type_align);
  271. +
  272. +          /* Zero size resets the "saw bitfield" state. */
  273. +          if (integer_zerop (DECL_SIZE (field)))
  274. +              last_align = -1;
  275. +          else
  276. +              last_align = type_align;
  277. +        }
  278.          }
  279. +#endif /* ] */
  280.      }
  281.        else
  282. -    record_align = MAX ((int)record_align, desired_align);
  283. +    {
  284. +#ifdef GROUP_BITFIELDS_BY_ALIGN
  285. +      /* Note: last_align can never be different from -1 unless
  286. +         the GROUP_BITFIELDS_BY_ALIGN stuff is enabled.
  287. +
  288. +         If the prior field caused an alignment, NOW is when
  289. +         we honor it. */
  290. +      if (last_align != -1) 
  291. +         desired_align = MAX(desired_align, last_align);
  292. +      last_align = -1;
  293.  #endif
  294. +      record_align = MAX ((int)record_align, desired_align);
  295. +    }
  296. +#endif  /* ] */
  297.  
  298.        /* Does this field automatically have alignment it needs
  299.       by virtue of the fields that precede it and the record's
  300. @@ -636,12 +733,23 @@ layout_union (rec)
  301.  
  302.        /* Union must be at least as aligned as any field requires.  */
  303.  
  304. -      union_align = MAX (union_align, DECL_ALIGN (field));
  305. +#ifdef GROUP_BITFIELDS_BY_ALIGN
  306. +      /* However, bitfields don't count in this case */
  307. +      if (!GROUP_BITFIELDS_BY_ALIGN
  308. +      || !DECL_BIT_FIELD_TYPE (field))
  309. +#endif
  310. +          union_align = MAX (union_align, DECL_ALIGN (field));
  311.  
  312.  #ifdef PCC_BITFIELD_TYPE_MATTERS
  313.        /* On the m88000, a bit field of declare type `int'
  314. -     forces the entire union to have `int' alignment.  */
  315. -      if (PCC_BITFIELD_TYPE_MATTERS && DECL_BIT_FIELD_TYPE (field))
  316. +     forces the entire union to have `int' alignment.
  317. +     However, if GROUP_BITFIELDS_BY_ALIGN is true, we don't
  318. +     do this. */
  319. +      if (PCC_BITFIELD_TYPE_MATTERS && DECL_BIT_FIELD_TYPE (field)
  320. +#ifdef GROUP_BITFIELDS_BY_ALIGN
  321. +         && !GROUP_BITFIELDS_BY_ALIGN
  322. +#endif
  323. +      )
  324.      union_align = MAX (union_align, TYPE_ALIGN (TREE_TYPE (field)));
  325.  #endif
  326.  
  327. Index: gcc-2.95.2/gcc/toplev.c
  328. ===================================================================
  329. RCS file: /homes/khan/src/CVSROOT/gcc-2.95.2/gcc/toplev.c,v
  330. retrieving revision 1.1.1.1
  331. diff -u -3 -p -r1.1.1.1 toplev.c
  332. --- gcc-2.95.2/gcc/toplev.c    1999/11/05 01:09:45    1.1.1.1
  333. +++ gcc-2.95.2/gcc/toplev.c    1999/11/05 06:24:53
  334. @@ -731,9 +731,15 @@ int flag_gnu_linker = 0;
  335.  int flag_gnu_linker = 1;
  336.  #endif
  337.  
  338. -/* Tag all structures with __attribute__(packed) */
  339. +/* Tag all structures with __attribute__(packed) off */
  340.  int flag_pack_struct = 0;
  341.  
  342. +/* Tag all structures with __attribute__(native_struct) off */
  343. +#ifndef DEFAULT_NATIVE_STRUCT
  344. +#define DEFAULT_NATIVE_STRUCT 0
  345. +#endif
  346. +int flag_native_struct = DEFAULT_NATIVE_STRUCT;
  347. +
  348.  /* Emit code to check for stack overflow; also may cause large objects
  349.     to be allocated dynamically.  */
  350.  int flag_stack_check;
  351. @@ -957,6 +963,10 @@ lang_independent_options f_options[] =
  352.     "Do the full regmove optimization pass"},
  353.    {"pack-struct", &flag_pack_struct, 1,
  354.     "Pack structure members together without holes" },
  355. +  {"native-struct", &flag_native_struct, 1,
  356. +   "Pack structure members consistent with some other (native) compiler" },
  357. +  {"gcc-struct", &flag_native_struct, 0,
  358. +   "Pack structure members using gcc default rules" },
  359.    {"stack-check", &flag_stack_check, 1,
  360.     "Insert stack checking code into the program" },
  361.    {"argument-alias", &flag_argument_noalias, 0,
  362. Index: gcc-2.95.2/gcc/tree.h
  363. ===================================================================
  364. RCS file: /homes/khan/src/CVSROOT/gcc-2.95.2/gcc/tree.h,v
  365. retrieving revision 1.1.1.1
  366. diff -u -3 -p -r1.1.1.1 tree.h
  367. --- gcc-2.95.2/gcc/tree.h    1999/11/05 01:09:45    1.1.1.1
  368. +++ gcc-2.95.2/gcc/tree.h    1999/11/05 06:24:53
  369. @@ -875,10 +875,15 @@ struct tree_block
  370.     the same way that the first union alternative would be passed.  */
  371.  #define TYPE_TRANSPARENT_UNION(NODE) (TYPE_CHECK (NODE)->type.transparent_union_flag)
  372.  
  373. -/* Indicated that objects of this type should be laid out in as
  374. +/* Indicates that objects of this type should be laid out in as
  375.     compact a way as possible.  */
  376.  #define TYPE_PACKED(NODE) (TYPE_CHECK (NODE)->type.packed_flag)
  377.  
  378. +/* Indicates that objects of this type should be layed out as the
  379. +   native compiler does; if a compile line option (or default state)
  380. +   turns this on, then turning it OFF should result in gnu alignment. */
  381. +#define TYPE_NATIVE(NODE) ((NODE)->type.native_flag)
  382. +
  383.  struct tree_type
  384.  {
  385.    char common[sizeof (struct tree_common)];
  386. @@ -900,6 +905,7 @@ struct tree_type
  387.    unsigned needs_constructing_flag : 1;
  388.    unsigned transparent_union_flag : 1;
  389.    unsigned packed_flag : 1;
  390. +  unsigned native_flag : 1;
  391.    unsigned restrict_flag : 1;
  392.  
  393.    unsigned lang_flag_0 : 1;
  394. @@ -909,7 +915,7 @@ struct tree_type
  395.    unsigned lang_flag_4 : 1;
  396.    unsigned lang_flag_5 : 1;
  397.    unsigned lang_flag_6 : 1;
  398. -  /* room for 3 more bits */
  399. +  /* room for 2 more bits */
  400.  
  401.    unsigned int align;
  402.    union tree_node *pointer_to;
  403. Index: gcc-2.95.2/gcc/config/alpha/alpha-interix.h
  404. ===================================================================
  405. RCS file: /homes/khan/src/CVSROOT/gcc-2.95.2/gcc/config/alpha/alpha-interix.h,v
  406. retrieving revision 1.1.1.1
  407. diff -u -3 -p -r1.1.1.1 alpha-interix.h
  408. --- gcc-2.95.2/gcc/config/alpha/alpha-interix.h    1999/11/05 01:09:49    1.1.1.1
  409. +++ gcc-2.95.2/gcc/config/alpha/alpha-interix.h    1999/11/05 06:24:53
  410. @@ -206,7 +206,6 @@ while (0)
  411.  #define HOST_PTR_AS_INT unsigned long
  412.  
  413.  #define PCC_BITFIELD_TYPE_MATTERS 1
  414. -#define PCC_BITFIELD_TYPE_TEST TYPE_NATIVE(rec)
  415.  #define GROUP_BITFIELDS_BY_ALIGN TYPE_NATIVE(rec)
  416.  
  417.  /* DWARF2 Unwinding doesn't work with exception handling yet. */
  418. Index: gcc-2.952.2/gcc/config/i386/cygwin.h
  419. ===================================================================
  420. RCS file: /homes/khan/src/CVSROOT/gcc-2.95.2/gcc/config/i386/cygwin.h,v
  421. retrieving revision 1.1.1.1
  422. diff -u -3 -p -r1.1.1.1 cygwin.h
  423. --- gcc-2.952.2/gcc/config/i386/cygwin.h    1999/11/05 01:09:55    1.1.1.1
  424. +++ gcc-2.952.2/gcc/config/i386/cygwin.h    1999/11/05 06:24:53
  425. @@ -515,8 +515,9 @@ extern void i386_pe_asm_file_end STDIO_P
  426.  #define BIGGEST_ALIGNMENT 128
  427.  
  428.  /* A bitfield declared as `int' forces `int' alignment for the struct.  */
  429. -#undef PCC_BITFIELDS_TYPE_MATTERS
  430. -#define PCC_BITFIELDS_TYPE_MATTERS 0
  431. +#undef PCC_BITFIELD_TYPE_MATTERS
  432. +#define PCC_BITFIELD_TYPE_MATTERS 1
  433. +#define GROUP_BITFIELDS_BY_ALIGN TYPE_NATIVE(rec)
  434.  
  435.  /* Enable alias attribute support.  */
  436.  #ifndef SET_ASM_OP
  437. Index: gcc-2.95.2/gcc/config/i386/i386-interix.h
  438. ===================================================================
  439. RCS file: /homes/khan/src/CVSROOT/gcc-2.95.2/gcc/config/i386/i386-interix.h,v
  440. retrieving revision 1.1.1.1
  441. diff -u -3 -p -r1.1.1.1 i386-interix.h
  442. --- gcc-2.95.2/gcc/config/i386/i386-interix.h    1999/11/05 01:09:55    1.1.1.1
  443. +++ gcc-2.95.2/gcc/config/i386/i386-interix.h    1999/11/05 06:24:53
  444. @@ -412,7 +412,6 @@ while (0)
  445.  #define HOST_PTR_AS_INT unsigned long
  446.  
  447.  #define PCC_BITFIELD_TYPE_MATTERS 1
  448. -#define PCC_BITFIELD_TYPE_TEST TYPE_NATIVE(rec)
  449.  #define GROUP_BITFIELDS_BY_ALIGN TYPE_NATIVE(rec)
  450.  
  451.  /* The following two flags are usually "off" for i386, because some non-gnu
  452. Index: gcc-2.95.2/gcc/cp/decl.c
  453. ===================================================================
  454. RCS file: /homes/khan/src/CVSROOT/gcc-2.95.2/gcc/cp/decl.c,v
  455. retrieving revision 1.4
  456. diff -u -3 -p -r1.4 decl.c
  457. --- gcc-2.95.2/gcc/cp/decl.c    1999/07/04 18:09:40    1.4
  458. +++ gcc-2.95.2/gcc/cp/decl.c    1999/07/04 18:14:05
  459. @@ -12713,6 +12713,9 @@ xref_tag (code_type_node, name, globaliz
  460.        /* Class types don't nest the way enums do.  */
  461.        class_binding_level = (struct binding_level *)0;
  462.  #endif
  463. +      TYPE_PACKED (ref) = flag_pack_struct;
  464. +      TYPE_NATIVE (ref) = flag_native_struct;
  465. +
  466.        pushtag (name, ref, globalize);
  467.        class_binding_level = old_b;
  468.      }
  469. Index: gcc-2.95.2/gcc/cp/pt.c
  470. ===================================================================
  471. RCS file: /homes/khan/src/CVSROOT/gcc-2.95.2/gcc/cp/pt.c,v
  472. retrieving revision 1.2
  473. diff -u -3 -p -r1.2 pt.c
  474. --- gcc-2.95.2/gcc/cp/pt.c    1999/06/14 21:22:33    1.2
  475. +++ gcc-2.95.2/gcc/cp/pt.c    1999/07/04 18:14:05
  476. @@ -4878,6 +4878,7 @@ instantiate_class_template (type)
  477.    TYPE_USES_VIRTUAL_BASECLASSES (type)
  478.      = TYPE_USES_VIRTUAL_BASECLASSES (pattern);
  479.    TYPE_PACKED (type) = TYPE_PACKED (pattern);
  480. +  TYPE_NATIVE (type) = TYPE_NATIVE (pattern);
  481.    TYPE_ALIGN (type) = TYPE_ALIGN (pattern);
  482.    TYPE_FOR_JAVA (type) = TYPE_FOR_JAVA (pattern); /* For libjava's JArray<T> */
  483.    if (ANON_AGGR_TYPE_P (pattern))
  484.