PATCH to i386_pe_encode_section_info

Danny Smith dannysmith@clear.net.nz
Mon Jun 28 00:15:00 GMT 2004


----- Original Message -----
From: "Danny Smith" _info


| From: "Per Bothner
|
| | Danny Smith wrote:
| |
| | In general, when we see a new declaration, for some properties
| | we merge/combine properties, and for some properties it's an
| | error if the properties aren't the same.  Are you saying that
| | these attributes fall into the latter category, hence it's safe
| | and more efficient to only do the encoding teh "first" time?
| | --
|
| No, all encode_section_info does for stdcall/fastcal now is  encode
the
| RTL name.  targetm.merge_type_attributes takes care of duplicate decl
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     targetm.comp_type_attributes
| conflicts.
|
| This testcase works with or without  the stdcall encoding being
| dependent on 'first'
|

Actually the testcase succeeds ib C but fails in C++, because
targetm.comp_type_attributes doesn't
get called for the function types by cp/decl.c.

This gets tested in  cp/decl.c:decls_match:
if (same_type_p (TREE_TYPE (TREE_TYPE (olddecl)), TREE_TYPE (TREE_TYPE
(newdecl))))
but not
if (same_type_p (TREE_TYPE (olddecl), TREE_TYPE (newdecl)))


Danny

| // Test that conflicts in calling convention are diagnosed */
| // { dg-do compile { target i?86-*-* } }
|
| extern void bar(); // { dg-error "" }
| extern void  __attribute__((stdcall)) bar ();  // { dg-error "" }
|
| extern void  __attribute__((stdcall)) baz ();  // { dg-error "" }
| extern void baz(); // { dg-error "" }
|
| extern void  __attribute__((stdcall)) boz ();
| extern void __attribute__ ((fastcall)) boz(); // { dg-error "" }
|
| extern void foo(); // { dg-error "" }
| void use_foo()
|   { foo (); }
| void  __attribute__((stdcall)) foo ()
|  {} // { dg-error "" }
|
|
| Danny
|
|



More information about the Gcc-patches mailing list