This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Drop user_defined_section_attribute, directly check DECL_SECTION_NAME instead
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Yi Yang <ahyangyi at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 11 Aug 2014 13:46:52 -0700
- Subject: Re: [PATCH] Drop user_defined_section_attribute, directly check DECL_SECTION_NAME instead
- Authentication-results: sourceware.org; auth=none
- References: <CADvRseYuH4qdmvn34OvORs4tpb4XT101NzrKBbLB6Dm=iLgKWQ at mail dot gmail dot com>
On Mon, Aug 11, 2014 at 1:41 PM, Yi Yang <ahyangyi@google.com> wrote:
> Replace checking user_defined_section_attribute with directly checking
> DECL_SECTION_NAME. The former does not work in the presence of IPA.
>
> See also: discussion on the same patch in Google branch:
> https://gcc.gnu.org/ml/gcc-patches/2014-08/msg00749.html
>
> --
>
> 2014-08-11 Yi Yang <ahyangyi@google.com>
>
> gcc:
> * bb-reorder.c (pass_partition_blocks::gate): Replace check.
> * c-family/c-common.c (handle_section_attribute): Remove
> user_defined_section_attribute
> * final.c (rest_of_handle_final): ditto
> * toplev.c (user_defined_section_attribute): ditto
> * toplev.h (user_defined_section_attribute): ditto
>
> diff --git gcc/bb-reorder.c gcc/bb-reorder.c
> index 96547c2..747831c 100644
> --- gcc/bb-reorder.c
> +++ gcc/bb-reorder.c
> @@ -95,7 +95,6 @@
> #include "expr.h"
> #include "params.h"
> #include "diagnostic-core.h"
> -#include "toplev.h" /* user_defined_section_attribute */
> #include "tree-pass.h"
> #include "df.h"
> #include "bb-reorder.h"
> @@ -2671,11 +2670,9 @@ pass_partition_blocks::gate (function *fun)
> arises. */
> return (flag_reorder_blocks_and_partition
> && optimize
> - /* See gate_handle_reorder_blocks. We should not partition if
> - we are going to omit the reordering. */
> && optimize_function_for_speed_p (fun)
> - && !DECL_COMDAT_GROUP (current_function_decl)
> - && !user_defined_section_attribute);
> + && !DECL_COMDAT_GROUP (current_function_decl);
^^^ Is this extra ';' a typo?
> + && !DECL_SECTION_NAME (current_function_decl));
> }
>
--
H.J.