[PATCH][C] Fix GNU extern inline heuristic again (fix C++ memory usage regression)
Jakub Jelinek
jakub@redhat.com
Mon Aug 27 18:25:00 GMT 2007
On Mon, Aug 27, 2007 at 11:14:58AM -0700, Ian Lance Taylor wrote:
> *************** handle_always_inline_attribute (tree *no
> *** 4864,4871 ****
> {
> if (TREE_CODE (*node) == FUNCTION_DECL)
> {
> ! /* Do nothing else, just set the attribute. We'll get at
> ! it later with lookup_attribute. */
> }
> else
> {
> --- 4864,4872 ----
> {
> if (TREE_CODE (*node) == FUNCTION_DECL)
> {
> ! /* Set the attribute and mark it for disregarding inline
> ! limits. */
> ! DECL_DISREGARD_INLINE_LIMITS (*node) = 1;
> }
> else
> {
>
>
> Is there any reason to keep the attribute, if we are setting the flag?
> That is, why not set *no_add_attrs = true?
Because always_inline is not just about disregarding inline limits,
but also that the diagnostic is required if the function can't be
for whatever reason inlined.
As DECL_DISREGARD_INLINE_LIMITS is used also for gnu89 extern inline
functions (and it should be for gnu_inline in C++ when Alex commits his
patch), it can't be used as a flag for always_inline attribute.
Jakub
More information about the Gcc-patches
mailing list