amylaar - Re: PATCH: PR 29487 (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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] |
- From: amylaar at spamcop dot net
- To: mark at codesourcery dot com
- Cc: gcc-patches at gcc dot gnu dot org, amylaar at gcc dot gnu dot org, danglin at gcc dot gnu dot org
- Date: Wed, 07 Feb 2007 06:09:56 -0500
- Subject: Re: PATCH: PR 29487
- References: <200702062356.l16Nu09B008399@sparrowhawk.codesourcery.com>
Quoting Mark Mitchell mark@codesourcery.com:
I have attacked the problem by first adding a macro DECL_REPLACEABLE_P which is true iff a function may be replaced at link-time with a functionally different definition. This macro is like binds_local_p -- but more agressive; while a COMDAT function is not binds_local_p, it is also not DECL_REPLACEABLE_P. The macro is used in the several places in the compiler that have been identified as gating the setting of TREE_NOTHROW.
That makes sense to me. However, for consistency (and run-time performance), in mainline, this macro should also be used in ipa-pure-const.c:analyze_function to replace the direct targetm.binds_local_p check.
I did not attempt to fix the other problem from PR 29487, which is that weak functions which do not throw exceptions are now emitted with exception unwind information. That problem stems from the dual use of TREE_NOTHROW. Because TREE_NOTHROW is used to indicate to the optimizers that a function does not throw, setting it for a replaceable function might confuse them. But, TREE_NOTHROW is also used to determine whether or not unwind information should be emitted for a function. I think that we don't really need a separate bit: we just need the optimizers to check "TREE_NOTHROW (callee) && !DECL_REPLACEABLE (callee)"
I disagree. Such a change will make the compiler assume that replaceble functions can throw, even when a user-provided prototype says otherwise.
- Follow-Ups:
- Re: PATCH: PR 29487
* From: Paolo Bonzini
- Re: PATCH: PR 29487
- References:
- PATCH: PR 29487
* From: Mark Mitchell
- PATCH: PR 29487
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |