Since GCC doesn't give out any warnings on the two cases, I'm not sure if
it's nessary to output these lines.
Hi Sun, What do you think?
2011/10/11 Gang Yu <yugang...@gmail.com>
> Hi,
>
> Could a gatekeeper help review the fix for bug 878/670? Thanks
>
> The assertion case:
> static int clear_page_array[0x120 / 4];
> void clear_page(void *page) __attribute__((alias("clear_page_array")));
> with the debug compiler, we get:
> Error: Declaration of alias "clear_page" does not match its target
> "clear_page_array".
>
> Analysis:
> aliased clear_page is declared as a function with extern sclass, while its
> base sym clear_page_array is a var with local storage sclass. WGEN does not
> accept this.
>
> The code snippet is from linux kernel, and the samilar code is reported in
> bug670.
>
> In order to get compability with gnu, suggest patch below:
>
> --- a/osprey/common/com/symtab_verify.cxx
> +++ b/osprey/common/com/symtab_verify.cxx
> @@ -514,9 +514,12 @@ ST_Verify_Fields(const ST &s)
> if ( ST_storage_class (*sb) != SCLASS_UNKNOWN) {
> if ( !ST_is_weak_symbol (s) )
> - Is_True( ST_storage_class(s) == ST_storage_class(*sb),
> - (msg,"storage class, should be identical as based
> blocks"));
> -
> + {
> + /* open64.net bug878, aliased symbol storage class may not be
> equal
> + to the base. */
> + if (ST_storage_class(s) != ST_storage_class(*sb))
> + fprintf(stderr,"Warning: storage class should be identical as
> based blocks\n");
> + }
> }
> else {
> // Property 1b For blocks such as bss, SCLASS== UNKNOWN and
> EXPORT==LOCAL
> Modified osprey/wgen/wgen_decl.cxx
> diff --git a/osprey/wgen/wgen_decl.cxx b/osprey/wgen/wgen_decl.cxx
> index 371bc4e..ac50b58 100644
> --- a/osprey/wgen/wgen_decl.cxx
> +++ b/osprey/wgen/wgen_decl.cxx
> @@ -4723,7 +4723,6 @@ WGEN_Assemble_Alias (gs_t decl, gs_t target)
> else {
> Set_ST_base_idx (st, ST_st_idx (base_st));
> Set_ST_emit_symbol(st); // for cg
> - Set_ST_sclass (st, ST_sclass (base_st));
> if (ST_is_initialized (base_st))
> Set_ST_is_initialized (st);
> #ifdef KEY
> @@ -4734,9 +4733,12 @@ WGEN_Assemble_Alias (gs_t decl, gs_t target)
> #ifdef KEY
> if (!lang_cplus)
> {
> - // bug 4981: symbol class of ST must match that of the target
> - if (ST_sym_class (st) != ST_sym_class (base_st))
> - ErrMsg (EC_Ill_Alias, ST_name (st), ST_name (base_st));
> + if (ST_sym_class (st) != ST_sym_class (base_st)) {
> + /* open64.net bug 878, change the aliased sym class and type to the
> base st */
> + fprintf(stderr,"Warning: %s is aliased to %s, but not the same
> type.\n", ST_name(st), ST_name(base_st));
> + Set_ST_class(st, ST_class(base_st));
> + Set_ST_type(st,ST_type(base_st));
> + }
> // bugs 5145, 11993
> if (ST_sym_class (base_st) == CLASS_FUNC)
>
>
>
> Regards
> Gang
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2d-oct
> _______________________________________________
> Open64-devel mailing list
> Open64-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/open64-devel
>
>
--
Regards,
Lai Jian-Xin
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel