This is the mail archive of the gcc-patches@gcc.gnu.org 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: [RS6000] Simplify sysv4.h TARGET_TOC


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


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