This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RS6000] Simplify sysv4.h TARGET_TOC
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Segher Boessenkool <segher at kernel dot crashing dot org>
- Date: Wed, 4 May 2016 08:59:19 -0400
- Subject: Re: [RS6000] Simplify sysv4.h TARGET_TOC
- Authentication-results: sourceware.org; auth=none
- References: <20160504052845 dot GV18915 at bubble dot grove dot modra dot org>
On Wed, May 4, 2016 at 1:28 AM, Alan Modra <amodra@gmail.com> wrote:
> We can use the TARGET_* defines here. There isn't any reason to use
> the underlying variable and masks. (The only reason I'm aware of to
> use them is when a target config file redefines some TARGET_* macro,
> say to 0 or 1, but you need to report an error in override_options if
> a user selects a command line option that attempts to change the
> value.) Also, TARGET_RELOCATABLE implies TARGET_MINIMAL_TOC, so there
> is no need to test TARGET_RELOCATABLE.
>
> Bootstrapped and regression tested powerpc64le-linux and
> powerpc64-linux. OK to apply?
>
> * config/rs6000/sysv4.h (TARGET_TOC): Simplify.
>
> diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
> index a4009c3..46d2b4b 100644
> --- a/gcc/config/rs6000/sysv4.h
> +++ b/gcc/config/rs6000/sysv4.h
> @@ -40,10 +40,8 @@
> #undef ASM_DEFAULT_SPEC
> #define ASM_DEFAULT_SPEC "-mppc"
>
> -#define TARGET_TOC ((rs6000_isa_flags & OPTION_MASK_64BIT) \
> - || ((rs6000_isa_flags \
> - & (OPTION_MASK_RELOCATABLE \
> - | OPTION_MASK_MINIMAL_TOC)) \
> +#define TARGET_TOC (TARGET_64BIT \
> + || (TARGET_MINIMAL_TOC \
> && flag_pic > 1) \
> || DEFAULT_ABI != ABI_V4)
Okay.
Thanks, David