This is the mail archive of the 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]
Other format: [Raw text]

Re: RF[CT]: IMA repairs 2/n: maybe_apply_renaming_pragma rawrite

I decided to fix up this patch for Zack and I found it was just a
simple off by one error when handling maybe_apply_renaming_pragma.

Bootstrapped on powerpc-apple-darwin with no regressions plus I tried
the simple testcase which Rainer Orth gave and it looked to be fixed.

OK to commit if someone tests on Solaris and Tru64 (OSF) and there are
no regressions because of this patch?

Andrew Pinski

* c-pragma.c: Include target.h. Add commentary on corner
cases in redefine_extname and extern_prefix pragmas.
(handle_pragma_redefine_extname): Use GCC_BAD. Use string
comparison to detect a redundant rename, having applied
targetm.strip_name_encoding first. Warn when the pragma is
being ignored, and we would have warned about an unknown
pragma. Do not put entries on the pending rename list when
identifier_global_value returned something other than a
FUNCTION_ or VAR_DECL. Do not rename non-external or
non-"C"-linkage names.
(handle_pragma_extern_prefix): Likewise. Define unconditionally.
(maybe_apply_renaming_pragma): Likewise; also, take care not
to instantiate DECL_ASSEMBLER_NAME unnecessarily.
Unconditionally include code for #pragma extern_prefix.
(init_pragma): Unconditionally register #pragma extern_prefix
and #pragma redefine_extname.
* c-objc-common.c (has_c_linkage): New function.
* c-common.h: Prototype it.

        * target.h (targetm): Add handle_pragma_redefine_extname and
        handle_pragma_extern_prefix booleans.
        * target-def.h: Default TARGET_HANDLE_PRAGMA_REDEFINE_EXTNAME
        * system.h: Poison HANDLE_PRAGMA_REDEFINE_EXTNAME and
        * config/sol2.h, config/alpha/osf.h: Update to match.
        * cp-lang.c (has_c_linkage): New function.

Attachment: test.diff1.txt
Description: Text document

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