Commit Graph

189 Commits

Author SHA1 Message Date
Jakub Jelinek d16e2ddd26 re PR tree-optimization/79390 (10% performance drop in SciMark2 LU after r242550)
PR tree-optimization/79390
	* target.h (struct noce_if_info): Declare.
	* targhooks.h (default_noce_conversion_profitable_p): Declare.
	* target.def (noce_conversion_profitable_p): New target hook.
	* ifcvt.h (struct noce_if_info): New type, moved from ...
	* ifcvt.c (struct noce_if_info): ... here.
	(noce_conversion_profitable_p): Renamed to ...
	(default_noce_conversion_profitable_p): ... this.  No longer
	static nor inline.
	(noce_try_store_flag_constants, noce_try_addcc,
	noce_try_store_flag_mask, noce_try_cmove, noce_try_cmove_arith,
	noce_convert_multiple_sets): Use targetm.noce_conversion_profitable_p
	instead of noce_conversion_profitable_p.
	* config/i386/i386.c: Include ifcvt.h.
	(ix86_option_override_internal): Don't override
	PARAM_MAX_RTL_IF_CONVERSION_INSNS default.
	(ix86_noce_conversion_profitable_p): New function.
	(TARGET_NOCE_CONVERSION_PROFITABLE_P): Redefine.
	* config/i386/x86-tune.def (X86_TUNE_ONE_IF_CONV_INSN): Adjust comment.
	* doc/tm.texi.in (TARGET_NOCE_CONVERSION_PROFITABLE_P): Add.
	* doc/tm.texi: Regenerated.

	* gcc.target/i386/pr79390.c: New test.
	* gcc.dg/ifcvt-4.c: Use -mtune-ctrl=^one_if_conv_insn for i?86/x86_64.

From-SVN: r246686
2017-04-04 19:52:27 +02:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Martin Sebor 01a4551ceb PR tree-optimization/78512 - [7 Regression] r242674 miscompiles Linux kernel
gcc/ChangeLog:

	PR tree-optimization/78512
	* config/linux.h (TARGET_PRINTF_POINTER_FORMAT): Remove.
	* config/rs6000/linux.h: Same.
	* config/rs6000/linux64.h: Same.
	* config/sol2.h: Same.
	* config/sol2.c (solaris_printf_pointer_format): Remove.
	* doc/tm.texi.in (TARGET_PRINTF_POINTER_FORMAT): Remove.
	* doc/tm.texi: Regenerate.
	* gimple-ssa-sprintf.c (format_pointer): Rempove.
	(pass_sprintf_length::compute_format_length): Return bool.
	(pass_sprintf_length::handle_gimple_call): Adjust.
	* target.def (printf_pointer_format): Remove.
	* targhooks.c (default_printf_pointer_format): Remove.
	(linux_printf_pointer_format): Same.
	* targhooks.h (default_printf_pointer_format): Remove.
	(linux_printf_pointer_format, solaris_printf_pointer_format): Same.

gcc/testsuite/ChangeLog:

	PR tree-optimization/78512
	* gcc.dg/tree-ssa/builtin-sprintf-6.c: Add test cases.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Remove test cases.

From-SVN: r242975
2016-11-29 14:08:02 -07:00
James Greenhalgh 42e02b207f [Patch 1/17] Add a new target hook for describing excess precision intentions
gcc/

	* target.def (excess_precision): New hook.
	* target.h (flt_eval_method): New.
	(excess_precision_type): Likewise.
	* targhooks.c (default_excess_precision): New.
	* targhooks.h (default_excess_precision): New.
	* doc/tm.texi.in (TARGET_C_EXCESS_PRECISION): New.
	* doc/tm.texi: Regenerate.

From-SVN: r242771
2016-11-23 17:14:07 +00:00
Eric Botcazou 894d8b4163 target.def (min_arithmetic_precision): New hook.
* target.def (min_arithmetic_precision): New hook.
	* doc/tm.texi.in (Misc): Add TARGET_MIN_ARITHMETIC_PRECISION.
	* doc/tm.texi: Regenerate.
	* internal-fn.c (expand_arith_overflow): Adjust handling of target
	dependent support by means of TARGET_MIN_ARITHMETIC_PRECISION.
	* targhooks.c (default_min_arithmetic_precision): New function.
	* targhooks.h (default_min_arithmetic_precision): Declare.
	* config/sparc/sparc.c (TARGET_MIN_ARITHMETIC_PRECISION): Define.
	(sparc_min_arithmetic_precision): New function.

From-SVN: r241665
2016-10-28 21:04:51 +00:00
Martin Sebor 73e1414cb8 PR bootstrap/77819 - undefined reference to gnu_libc_printf_pointer_format with uClibc
gcc/ChangeLog:

	PR bootstrap/77819
	* config/linux.h (TARGET_PRINTF_POINTER_FORMAT): Define macro.
	* config/linux.c (gnu_libc_printf_pointer_format): Remove.
	* targhooks.c [DEFAULT_LIBC == LIBC_UCLIBC) && SINGLE_LIBC]
	(default_printf_pointer_format): Define function.
	* targhooks.c (linux_printf_pointer_format): Define new function.
	* targhooks.h (linux_printf_pointer_format): Declare.
	(gnu_libc_printf_pointer_format): Remove declaration.

From-SVN: r240793
2016-10-05 09:21:40 -06:00
Martin Sebor 88d0c3f0a1 PR middle-end/49905 - Better sanity checking on sprintf src & dest to
gcc/ChangeLog:

	PR middle-end/49905
	* Makefile.in (OBJS): Add gimple-ssa-sprintf.o.
	* config/linux.h (TARGET_PRINTF_POINTER_FORMAT): Redefine.
	* config/linux.c (gnu_libc_printf_pointer_format): New function.
	* config/sol2.h (TARGET_PRINTF_POINTER_FORMAT): Same.
	* config/sol2.c (solaris_printf_pointer_format): New function.
	* doc/invoke.texi (-Wformat-length, -fprintf-return-value): New
	options.
	* doc/tm.texi.in (TARGET_PRINTF_POINTER_FORMAT): Document.
	* doc/tm.texi: Regenerate.
	* gimple-fold.h (get_range_strlen): New function.
	(get_maxval_strlen): Declare existing function.
	* gimple-fold.c (get_range_strlen): Add arguments and compute both
	maximum and minimum.
	 (get_range_strlen): Define overload.
	(get_maxval_strlen): Adjust.
	* gimple-ssa-sprintf.c: New file and pass.
	* passes.def (pass_sprintf_length): Add new pass.
	* targhooks.h (default_printf_pointer_format): Declare new function.
	(gnu_libc_printf_pointer_format): Same.
	(solaris_libc_printf_pointer_format): Same.
	* targhooks.c (default_printf_pointer_format): Define new function.
	* tree-pass.h (make_pass_sprintf_length): Declare new function.
	* print-tree.c: Increase buffer size.

gcc/c-family/ChangeLog:

	PR middle-end/49905
	* c.opt: Add -Wformat-length and -fprintf-return-value.

gcc/testsuite/ChangeLog:

	PR middle-end/49905
	* gcc.dg/builtin-stringop-chk-1.c: Adjust.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: New test.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-2.c: New test.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: New test.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-4.c: New test.
	* gcc.dg/tree-ssa/builtin-sprintf.c: New test.
	* gcc.dg/tree-ssa/builtin-sprintf-2.c: New test.

From-SVN: r240298
2016-09-20 19:39:27 -06:00
Joseph Myers c65699efcc Implement C _FloatN, _FloatNx types.
ISO/IEC TS 18661-3:2015 defines C bindings to IEEE interchange and
extended types, in the form of _FloatN and _FloatNx type names with
corresponding fN/FN and fNx/FNx constant suffixes and FLTN_* / FLTNX_*
<float.h> macros.  This patch implements support for this feature in
GCC.

The _FloatN types, for N = 16, 32, 64 or >= 128 and a multiple of 32,
are types encoded according to the corresponding IEEE interchange
format (endianness unspecified; may use either the NaN conventions
recommended in IEEE 754-2008, or the MIPS NaN conventions, since the
choice of convention is only an IEEE recommendation, not a
requirement).  The _FloatNx types, for N = 32, 64 and 128, are IEEE
"extended" types: types extending a narrower format with range and
precision at least as big as those specified in IEEE 754 for each
extended type (and with unspecified representation, but still
following IEEE semantics for their values and operations - and with
the set of values being determined by the precision and the maximum
exponent, which means that while Intel "extended" is suitable for
_Float64x, m68k "extended" is not).  These types are always distinct
from and not compatible with each other and the standard floating
types float, double, long double; thus, double, _Float64 and _Float32x
may all have the same ABI, but they are three still distinct types.
The type names may be used with _Complex to construct corresponding
complex types (unlike __float128, which acts more like a typedef name
than a keyword - thus, this patch may be considered to fix PR
c/32187).  The new suffixes can be combined with GNU "i" and "j"
suffixes for constants of complex types (e.g. 1.0if128, 2.0f64i).

The set of types supported is implementation-defined.  In this GCC
patch, _Float32 is SFmode if that is suitable; _Float32x and _Float64
are DFmode if that is suitable; _Float128 is TFmode if that is
suitable; _Float64x is XFmode if that is suitable, and otherwise
TFmode if that is suitable.  There is a target hook to override the
choices if necessary.  "Suitable" means both conforming to the
requirements of that type, and supported as a scalar type including in
libgcc.  The ABI is whatever the back end does for scalars of that
mode (but note that _Float32 is passed without promotion in variable
arguments, unlike float).  All the existing issues with exceptions and
rounding modes for existing types apply equally to the new type names.

No GCC port supports a floating-point format suitable for _Float128x.
Although there is HFmode support for ARM and AArch64, use of that for
_Float16 is not enabled.  Supporting _Float16 would require additional
work on the excess precision aspects of TS 18661-3: there are new
values of FLT_EVAL_METHOD, which are not currently supported in GCC,
and FLT_EVAL_METHOD == 0 now means that operations and constants on
types narrower than float are evaluated to the range and precision of
float.  Implementing that, so that _Float16 gets evaluated with excess
range and precision, would involve changes to the excess precision
infrastructure so that the _Float16 case is enabled by default, unlike
the x87 case which is only enabled for -fexcess-precision=standard.
Other differences between _Float16 and __fp16 would also need to be
disentangled.

GCC has some prior support for nonstandard floating-point types in the
form of __float80 and __float128.  Where these were previously types
distinct from long double, they are made by this patch into aliases
for _Float64x / _Float128 if those types have the required properties.

In principle the set of possible _FloatN types is infinite.  This
patch hardcodes the four such types for N <= 128, but with as much
code as possible using loops over types to minimize the number of
places with such hardcoding.  I don't think it's likely any further
such types will be of use in future (or indeed that formats suitable
for _Float128x will actually be implemented).  There is a corner case
that all _FloatN, for N >= 128 and a multiple of 32, should be treated
as keywords even when the corresponding type is not supported; I
intend to deal with that in a followup patch.

Tests are added for various functionality of the new types, mostly
using type-generic headers.  The tests use dg-add-options to pass any
extra options needed to enable the types; this is wired up to use the
same options as for __float128 on powerpc to enable _Float128 and
_Float64x, and effective-target keywords for runtime support do the
same hardware test as for __float128 to make sure the VSX instructions
generated by those options are supported.  (Corresponding additions
would be needed for _Float16 on ARM as well if that were enabled with
-mfp16-format=ieee required to use it rather than unconditionally
available.  Of course, -mfp16-format=alternative enables use of a
format which is not compatible with the requirements of the _Float16
type.)

C++ note: no support for the new types or constant suffixes is added
for C++.  C++ decimal floating-point support was very different from
the C support, using class types, and the same may well apply to any
future C++ bindings for IEEE interchange and extended types.  There is
a case, however, for supporting at least *f128 constants in C++, so
that code using __float128 can use the newer style for constants
throughout rather than needing to use the older *q constants in C++.
Also, if built-in functions are added that may provide a way in which
the types could leak into C++ code.

Fortran note: the float128_type_node used in the Fortran front end is
renamed to gfc_float128_type_node, since the semantics are different:
in particular, if long double has binary128 format, then the new
language-independent float128_type_node is a distinct type that also
has binary128 format, but the Fortran node is expected to be NULL in
that case.  Likewise, Fortran's complex_float128_type_node is renamed
to gfc_complex_float128_type_node.

PowerPC note: the back end had an inconsistency that if TFmode was
binary128, *q constants were TFmode instead of KFmode but __float128
was KFmode.  This patch follows the same logic as for *q constants, so
that _Float128 prefers TFmode (and __float128 becomes an alias for
_Float128).

ARM note: __fp16 is promoted to double (by convert_arguments) when
passed without a prototype / in variable arguments.  But this is only
about the argument promotion; it is not handled as promoting in
c-common.c:self_promoting_args_p / c-typeck.c:c_type_promotes_to,
meaning that a K&R function definition for an argument of type __fp16
corresponds to a prototype with an argument of that type, not to one
with an argument of type double, whereas a float argument in a K&R
function definition corresponds to a double prototype argument - and
the same functions are also what's involved in making va_arg give a
warning and generate a call to abort when called with type float.
This is preserved by this patch, while arranging for _Float16 not to
be promoted when passed without a prototype / in variable arguments
(the promotion of float being considered a legacy feature, not applied
to any new types in C99 or later).

TS 18661-3 extends the set of decimal floating-point types similarly,
and adds new constant suffixes for the existing types, but this patch
does not do anything regarding that extension.

This patch does nothing regarding built-in functions, although
type-generic functions such as __builtin_isinf work for the new types
and associated tests are included.  There are at least two levels of
built-in function support possible for these types.  The minimal
level, implemented in
<https://gcc.gnu.org/ml/gcc-patches/2016-06/msg01702.html> (which
needs updating to use dg-add-options), adds built-in functions similar
to those x86 has for __float128: __builtin_inf* __builtin_huge_val*,
__builtin_nan*, __builtin_nans*, __builtin_fabs*, __builtin_copysign*.
That would be sufficient for glibc to use the *f128 names for built-in
functions by default with *q used only for backwards compatibility
when using older GCC versions.  That would also allow c_cpp_builtins's
flag_building_libgcc code, defining __LIBGCC_%s_FUNC_EXT__, to use
such suffixes rather than the present code hardcoding logic about
target-specific constant suffixes and how those relate to function
suffixes.

Full built-in function support would cover the full range of built-in
functions for existing floating-point types, adding variants for all
the new types, except for a few obsolescent functions and
non-type-generic variants of type-generic functions.  Some but not all
references to such functions in GCC use macros such as CASE_FLT_FN to
be type-generic; a fair amount of work would be needed to identify all
places to update.  Adding all those functions would enable
optimizations (for constant arguments and otherwise) for TS 18661-3
functions, but it would also substantially expand the enum listing
built-in functions (and we've had problems with the size of that enum
in the past), and increase the amount of built-in function
initialization to do - I don't know what the startup cost involved in
built-in function initialization is, but it would be something to
consider when adding such a large set of functions.

There are also a range of optimizations, in match.pd and elsewhere,
that only operate on the three standard floating-point types.  Ideally
those would be made generic to all floating-point types, but this
patch does nothing in that regard.  Special care would be needed
regarding making sure library functions to which calls are generated
actually exist.  For example, if sqrt is called on an argument of type
_Float32, and the result converted to _Float32, this is equivalent to
doing a square root operation directly on _Float32.  But if the user's
libm does not have the sqrtf32 function, or the name is not reserved
because __STDC_WANT_IEC_60559_TYPES_EXT__ was not defined before
including <math.h>, you can only do that optimization if you convert
to a call to sqrtf instead.

DECIMAL_DIG now relates to all supported floating-point formats, not
just float, double and long double; I've raised the question with WG14
of how this relates to the formula for DECIMAL_DIG in C11 not
considering this.  TS 18661-3 says it also covers non-arithmetic
formats only supported by library conversion functions; this patch
does not add any target hooks to allow for the case where there are
such formats wider than any supported for arithmetic types (where
e.g. libc supports conversions involving the binary128 representation,
but the _Float128 type is not supported).

GCC provides its own <tgmath.h> for some targets.  No attempt is made
to adapt this to handle the new types.

Nothing is done regarding debug info for the new types (see the
"Debugger support for __float128 type?" thread on gcc@, Sep/Oct 2015).

No __SIZEOF_*__ macros are added for the new types.

Nothing is done with do_warn_double_promotion.

Nothing is done to include the new types in those determining
max_align_t, although properly it should be sufficiently aligned for
any of those types.

The logic for usual arithmetic conversions in c_common_type relies on
TYPE_PRECISION for floating-point types, which is less than ideal
(doesn't necessarily correspond to whether one type's values are
subset of another); looking in more detail at the formats might be
better.  But since I included code in build_common_tree_nodes to work
around rs6000 KFmode having precision 113 not 128, I think it should
work.  Ideally one might have errors in generic code for the case
where the two types do not have one type's values a subset of the
other (which is undefined behavior).  But the only case where this can
actually occur is mixing IBM long double with binary128 on powerpc,
and rs6000_invalid_binary_op deals with that at present.  TS 18661-3
does not fully specify the type resulting from the usual arithmetic
conversions in the case where two _FloatNx types have the same set of
values; I arranged the code to prefer the greater value of N in that
case.

The __FP_FAST_FMA* macros are not extended to cover the new types,
since there are no corresponding built-in functions (if built-in
fmafN, fmafNx are added, the macros should be extended, and the new
macros documented).  Also, only a limited set of modes is handled in
mode_has_fma.

Diagnostics relating to the use of the new types with -pedantic do not
try to distinguish them from purely nonstandard types such as __int128
and constant suffixes such as *q.

If you use an unsupported _FloatN / _FloatNx type you get a warning
about the type defaulting to int after the warning about the type not
being supported.  That's less than ideal, but it's also a pre-existing
condition if you use __int128 on a 32-bit system where it's
unsupported.

Bootstrapped with no regressions on x86_64-pc-linux-gnu.  Other
back-end changes minimally tested by building cc1 for ia64-linux-gnu,
powerpc64le-linux-gnu, pdp11-none (the last failed for unrelated
reasons).

	PR c/32187
gcc:
	* tree-core.h (TI_COMPLEX_FLOAT16_TYPE)
	(TI_COMPLEX_FLOATN_NX_TYPE_FIRST, TI_COMPLEX_FLOAT32_TYPE)
	(TI_COMPLEX_FLOAT64_TYPE, TI_COMPLEX_FLOAT128_TYPE)
	(TI_COMPLEX_FLOAT32X_TYPE, TI_COMPLEX_FLOAT64X_TYPE)
	(TI_COMPLEX_FLOAT128X_TYPE, TI_FLOAT16_TYPE, TI_FLOATN_TYPE_FIRST)
	(TI_FLOATN_NX_TYPE_FIRST, TI_FLOAT32_TYPE, TI_FLOAT64_TYPE)
	(TI_FLOAT128_TYPE, TI_FLOATN_TYPE_LAST, TI_FLOAT32X_TYPE)
	(TI_FLOATNX_TYPE_FIRST, TI_FLOAT64X_TYPE, TI_FLOAT128X_TYPE)
	(TI_FLOATNX_TYPE_LAST, TI_FLOATN_NX_TYPE_LAST): New enum
	tree_index values.
	(NUM_FLOATN_TYPES, NUM_FLOATNX_TYPES, NUM_FLOATN_NX_TYPES): New
	macros.
	(struct floatn_type_info): New structure type.
	(floatn_nx_types): New variable declaration.
	* tree.h (FLOATN_TYPE_NODE, FLOATN_NX_TYPE_NODE)
	(FLOATNX_TYPE_NODE, float128_type_node, float64x_type_node)
	(COMPLEX_FLOATN_NX_TYPE_NODE): New macros.
	* tree.c (floatn_nx_types): New variable.
	(build_common_tree_nodes): Initialize _FloatN, _FloatNx and
	corresponding complex types.
	* target.def (floatn_mode): New hook.
	* targhooks.c: Include "real.h".
	(default_floatn_mode): New function.
	* targhooks.h (default_floatn_mode): New prototype.
	* doc/extend.texi (Floating Types): Document _FloatN and _FloatNx
	types.
	* doc/sourcebuild.texi (float@var{n}, float@var{n}x): Document new
	effective-target and dg-add-options keywords.
	(float@var{n}_runtime, float@var{n}x_runtime, floatn_nx_runtime):
	Document new effective-target keywords.
	* doc/tm.texi.in (TARGET_FLOATN_MODE): New @hook.
	* doc/tm.texi: Regenerate.
	* ginclude/float.h (LDBL_DECIMAL_DIG): Define to
	__LDBL_DECIMAL_DIG__, not __DECIMAL_DIG__.
	[__STDC_WANT_IEC_60559_TYPES_EXT__]: Define macros from TS
	18661-3.
	* real.h (struct real_format): Add field ieee_bits.
	* real.c (ieee_single_format, mips_single_format)
	(motorola_single_format, spu_single_format, ieee_double_format)
	(mips_double_format, motorola_double_format)
	(ieee_extended_motorola_format, ieee_extended_intel_96_format)
	(ieee_extended_intel_128_format)
	(ieee_extended_intel_96_round_53_format, ibm_extended_format)
	(mips_extended_format, ieee_quad_format, mips_quad_format)
	(vax_f_format, vax_d_format, vax_g_format, decimal_single_format)
	(decimal_double_format, decimal_quad_format, ieee_half_format)
	(arm_half_format, real_internal_format: Initialize ieee_bits
	field.
	* config/i386/i386.c (ix86_init_builtin_types): Do not initialize
	float128_type_node.  Set float80_type_node to float64x_type_node
	if appropriate and long_double_type_node not appropriate.
	* config/ia64/ia64.c (ia64_init_builtins): Likewise.
	* config/pdp11/pdp11.c (pdp11_f_format, pdp11_d_format):
	Initialize ieee_bits field.
	* config/rs6000/rs6000.c (TARGET_FLOATN_MODE): New macro.
	(rs6000_init_builtins): Set ieee128_float_type_node to
	float128_type_node.
	(rs6000_floatn_mode): New function.

gcc/c:
	* c-tree.h (cts_floatn_nx): New enum c_typespec_keyword value.
	(struct c_declspecs): Add field floatn_nx_idx.
	* c-decl.c (declspecs_add_type, finish_declspecs): Handle _FloatN
	and _FloatNx type specifiers.
	* c-parser.c (c_keyword_starts_typename, c_token_starts_declspecs)
	(c_parser_declspecs, c_parser_attribute_any_word)
	(c_parser_objc_selector): Use CASE_RID_FLOATN_NX.
	* c-typeck.c (c_common_type): Handle _FloatN and _FloatNx types.
	(convert_arguments): Avoid promoting _FloatN and _FloatNx types
	narrower than double.

gcc/c-family:
	* c-common.h (RID_FLOAT16, RID_FLOATN_NX_FIRST, RID_FLOAT32)
	(RID_FLOAT64, RID_FLOAT128, RID_FLOAT32X, RID_FLOAT64X)
	(RID_FLOAT128X): New enum rid values.
	(CASE_RID_FLOATN_NX): New macro.
	* c-common.c (c_common_reswords): Add _FloatN and _FloatNx
	keywords.
	(c_common_type_for_mode): Check for _FloatN and _FloatNx and
	corresponding complex types.
	(c_common_nodes_and_builtins): For non-C++, register _FloatN and
	_FloatNx and corresponding complex types.
	(keyword_begins_type_specifier): Use CASE_RID_FLOATN_NX.
	* c-cppbuiltin.c (builtin_define_float_constants): Check _FloatN
	and _FloatNx types for the widest type for determining
	DECIMAL_DIG.  Define __LDBL_DECIMAL_DIG__ as well as
	__DECIMAL_DIG__ for long double.  Handle FMA_SUFFIX being NULL.
	(c_cpp_builtins): Call builtin_define_float_constants for _FloatN
	and _FloatNx types.
	* c-lex.c (interpret_float): Handle _FloatN and _FloatNx
	constants.
	* c-pretty-print.c (pp_c_floating_constant): Handle _FloatN and
	_FloatNx types.

gcc/fortran:
	* trans-types.h (float128_type_node): Rename to
	gfc_float128_type_node.
	(complex_float128_type_node): Rename to
	gfc_complex_float128_type_node.
	* iso-c-binding.def, trans-intrinsic.c, trans-types.c: All users
	changed.

gcc/testsuite:
	* lib/target-supports.exp (check_effective_target_float16)
	(check_effective_target_float32, check_effective_target_float64)
	(check_effective_target_float128, check_effective_target_float32x)
	(check_effective_target_float64x)
	(check_effective_target_float128x)
	(check_effective_target_float16_runtime)
	(check_effective_target_float32_runtime)
	(check_effective_target_float64_runtime)
	(check_effective_target_float128_runtime)
	(check_effective_target_float32x_runtime)
	(check_effective_target_float64x_runtime)
	(check_effective_target_float128x_runtime)
	(check_effective_target_floatn_nx_runtime)
	(add_options_for_float16, add_options_for_float32)
	(add_options_for_float64, add_options_for_float128)
	(add_options_for_float32x, add_options_for_float64x)
	(add_options_for_float128x): New procedures.
	* gcc.dg/dfp/floatn.c, gcc.dg/float128-typeof.c,
	gcc.dg/float128x-typeof.c, gcc.dg/float16-typeof.c,
	gcc.dg/float32-typeof.c, gcc.dg/float32x-typeof.c,
	gcc.dg/float64-typeof.c, gcc.dg/float64x-typeof.c,
	gcc.dg/floatn-arithconv.c, gcc.dg/floatn-errs.c,
	gcc.dg/floatn-typeof.h, gcc.dg/torture/float128-basic.c,
	gcc.dg/torture/float128-complex.c,
	gcc.dg/torture/float128-floath.c, gcc.dg/torture/float128-tg.c,
	gcc.dg/torture/float128x-basic.c,
	gcc.dg/torture/float128x-complex.c,
	gcc.dg/torture/float128x-floath.c, gcc.dg/torture/float128x-tg.c,
	gcc.dg/torture/float16-basic.c, gcc.dg/torture/float16-complex.c,
	gcc.dg/torture/float16-floath.c, gcc.dg/torture/float16-tg.c,
	gcc.dg/torture/float32-basic.c, gcc.dg/torture/float32-complex.c,
	gcc.dg/torture/float32-floath.c, gcc.dg/torture/float32-tg.c,
	gcc.dg/torture/float32x-basic.c,
	gcc.dg/torture/float32x-complex.c,
	gcc.dg/torture/float32x-floath.c, gcc.dg/torture/float32x-tg.c,
	gcc.dg/torture/float64-basic.c, gcc.dg/torture/float64-complex.c,
	gcc.dg/torture/float64-floath.c, gcc.dg/torture/float64-tg.c,
	gcc.dg/torture/float64x-basic.c,
	gcc.dg/torture/float64x-complex.c,
	gcc.dg/torture/float64x-floath.c, gcc.dg/torture/float64x-tg.c,
	gcc.dg/torture/floatn-basic.h, gcc.dg/torture/floatn-complex.h,
	gcc.dg/torture/floatn-convert.c, gcc.dg/torture/floatn-floath.h,
	gcc.dg/torture/floatn-tg.h,
	gcc.dg/torture/fp-int-convert-float128-ieee-timode.c,
	gcc.dg/torture/fp-int-convert-float128-ieee.c,
	gcc.dg/torture/fp-int-convert-float128x-timode.c,
	gcc.dg/torture/fp-int-convert-float128x.c,
	gcc.dg/torture/fp-int-convert-float16-timode.c,
	gcc.dg/torture/fp-int-convert-float16.c,
	gcc.dg/torture/fp-int-convert-float32-timode.c,
	gcc.dg/torture/fp-int-convert-float32.c,
	gcc.dg/torture/fp-int-convert-float32x-timode.c,
	gcc.dg/torture/fp-int-convert-float32x.c,
	gcc.dg/torture/fp-int-convert-float64-timode.c,
	gcc.dg/torture/fp-int-convert-float64.c,
	gcc.dg/torture/fp-int-convert-float64x-timode.c,
	gcc.dg/torture/fp-int-convert-float64x.c: New tests.
	* gcc.dg/torture/fp-int-convert.h (TEST_I_F): Add argument for
	maximum exponent of floating-point type.  Use it in testing
	whether 0x8...0 fits in the floating-point type.  Always treat -1
	(signed 0xf...f) as fitting in the floating-point type.
	(M_OK1): New macro.
	* gcc.dg/torture/fp-int-convert-double.c,
	gcc.dg/torture/fp-int-convert-float.c,
	gcc.dg/torture/fp-int-convert-float128-timode.c,
	gcc.dg/torture/fp-int-convert-float128.c,
	gcc.dg/torture/fp-int-convert-float80-timode.c,
	gcc.dg/torture/fp-int-convert-float80.c,
	gcc.dg/torture/fp-int-convert-long-double.c,
	gcc.dg/torture/fp-int-convert-timode.c: Update calls to TEST_I_F.

libcpp:
	* include/cpplib.h (CPP_N_FLOATN, CPP_N_FLOATNX)
	(CPP_N_WIDTH_FLOATN_NX, CPP_FLOATN_SHIFT, CPP_FLOATN_MAX): New
	macros.
	* expr.c (interpret_float_suffix): Handle fN, fNx, FN and FNx
	suffixes.

From-SVN: r239625
2016-08-19 18:43:26 +01:00
James Greenhalgh e914c11a99 [Patch 1/2 ifcvt costs] New target hook: max_noce_ifcvt_seq_cost
gcc/

	* target.def (max_noce_ifcvt_seq_cost): New.
	* doc/tm.texi.in (TARGET_MAX_NOCE_IFCVT_SEQ_COST): Document it.
	* doc/tm.texi: Regenerate.
	* targhooks.h (default_max_noce_ifcvt_seq_cost): New.
	* targhooks.c (default_max_noce_ifcvt_seq_cost): New.
	* params.def (PARAM_MAX_RTL_IF_CONVERSION_PREDICTABLE_COST): New.
	(PARAM_MAX_RTL_IF_CONVERSION_UNPREDICTABLE_COST): Likewise.
	* doc/invoke.texi: Document new params.

From-SVN: r238593
2016-07-21 15:37:50 +00:00
Georg-Johann Lay ffc2284012 target.def (addr_space): Add new diagnose_usage to hook vector.
gcc/
	* target.def (addr_space): Add new diagnose_usage to hook vector.
	* targhooks.c (default_addr_space_diagnose_usage): Add default
	implementation and...
	* targhooks.h (default_addr_space_diagnose_usage): ... its prototype.
	* c/c-parser.c (c_lex_one_token) [CPP_NAME]: If the token
	is some address space, call targetm.addr_space.diagnose_usage.
	* doc/tm.texi.in (Named Address Spaces): Add anchor for
	TARGET_ADDR_SPACE_DIAGNOSE_USAGE documentation.
	* doc/tm.texi: Regenerate.

From-SVN: r238514
2016-07-20 13:07:43 +00:00
Bernd Schmidt 36b85e4328 re PR tree-optimization/52171 (memcmp/strcmp/strncmp can be optimized when the result is tested for [in]equality with 0)
PR tree-optimization/52171
        * builtins.c (expand_cmpstrn_or_cmpmem): Delete, moved elsewhere.
        (expand_builtin_memcmp): New arg RESULT_EQ.  All callers changed.
        Look for constant strings.  Move some code to emit_block_cmp_hints
        and use it.
        * builtins.def (BUILT_IN_MEMCMP_EQ): New.
        * defaults.h (COMPARE_MAX_PIECES): New macro.
        * expr.c (move_by_pieces_d, store_by_pieces_d): Remove old structs.
        (move_by_pieces_1, store_by_pieces_1, store_by_pieces_2): Remvoe.
        (clear_by_pieces_1): Don't declare.  Move definition before use.
        (can_do_by_pieces): New static function.
        (can_move_by_pieces): Use it.  Return bool.
        (by_pieces_ninsns): Renamed from move_by_pieces_ninsns.  New arg
        OP.  All callers changed.  Handle COMPARE_BY_PIECES.
        (class pieces_addr); New.
        (pieces_addr::pieces_addr, pieces_addr::decide_autoinc,
        pieces_addr::adjust, pieces_addr::increment_address,
        pieces_addr::maybe_predec, pieces_addr::maybe_postinc): New member
        functions for it.
        (class op_by_pieces_d): New.
        (op_by_pieces_d::op_by_pieces_d, op_by_pieces_d::run): New member
        functions for it.
        (class move_by_pieces_d, class compare_by_pieces_d,
        class store_by_pieces_d): New subclasses of op_by_pieces_d.
        (move_by_pieces_d::prepare_mode, move_by_pieces_d::generate,
        move_by_pieces_d::finish_endp, store_by_pieces_d::prepare_mode,
        store_by_pieces_d::generate, store_by_pieces_d::finish_endp,
        compare_by_pieces_d::generate, compare_by_pieces_d::prepare_mode,
        compare_by_pieces_d::finish_mode): New member functions.
        (compare_by_pieces, emit_block_cmp_via_cmpmem): New static
        functions.
        (expand_cmpstrn_or_cmpmem): Moved here from builtins.c.
        (emit_block_cmp_hints): New function.
        (move_by_pieces, store_by_pieces, clear_by_pieces): Rewrite to just
        use the newly defined classes.
        * expr.h (by_pieces_constfn): New typedef.
        (can_store_by_pieces, store_by_pieces): Use it in arg declarations.
        (emit_block_cmp_hints, expand_cmpstrn_or_cmpmem): Declare.
        (move_by_pieces_ninsns): Don't declare.
        (can_move_by_pieces): Change return value to bool.
        * target.def (TARGET_USE_BY_PIECES_INFRASTRUCTURE_P): Update docs.
        (compare_by_pieces_branch_ratio): New hook.
        * target.h (enum by_pieces_operation): Add COMPARE_BY_PIECES.
        (by_pieces_ninsns): Declare.
        * targethooks.c (default_use_by_pieces_infrastructure_p): Handle
        COMPARE_BY_PIECES.
        (default_compare_by_pieces_branch_ratio): New function.
        * targhooks.h (default_compare_by_pieces_branch_ratio): Declare.
        * doc/tm.texi.in (STORE_MAX_PIECES, COMPARE_MAX_PIECES): Document.
        * doc/tm.texi: Regenerate.
        * tree-ssa-strlen.c: Include "builtins.h".
        (handle_builtin_memcmp): New static function.
        (strlen_optimize_stmt): Call it for BUILT_IN_MEMCMP.
        * tree.c (build_common_builtin_nodes): Create __builtin_memcmp_eq.

testsuite/
        PR tree-optimization/52171
        * gcc.dg/pr52171.c: New test.
        * gcc.target/i386/pr52171.c: New test.

From-SVN: r237069
2016-06-03 14:20:53 +00:00
Wilco Dijkstra 31e2b5a3d8 Improve TARGET_IRA_CHANGE_PSEUDO_ALLOCNO_CLASS target hook.
Improve TARGET_IRA_CHANGE_PSEUDO_ALLOCNO_CLASS target hook.  It turns out there
is another case where the register allocator uses the union of register classes
without checking that the cost of the resulting register class is lower than
both (see https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01765.html ).  This
happens when the cost of the best and alternative class are both lower than the
memory cost.  In this case we typically end up with ALL_REGS as the allocno
class, which almost invariably results in bad allocations with many redundant
int<->FP moves (which are expensive on various cores).  AArch64 is affected by
this significantly due to supporting many scalar integer operations in SIMD.

Currently the TARGET_IRA_CHANGE_PSEUDO_ALLOCNO_CLASS hook forces the class to
GENERAL_REGS if the allocno class is ALL_REGS and the register has an integer
mode.  This is bad if the best class happens to be FP_REGS.  To handle this
case as well, an extra argument is needed in the hook to pass the best class.
If the allocno class is ALL_REGS, but the best class isn't, we use the best
class instead (rather than using the mode to force to GENERAL_REGS or FP_REGS).

Previously this might happen:

r79: preferred FP_REGS, alternative GENERAL_REGS, allocno GENERAL_REGS
     a1 (r79,l0) best GENERAL_REGS, allocno GENERAL_REGS

a1(r79,l0) costs: CALLER_SAVE_REGS:5000,5000 GENERAL_REGS:5000,5000
                  FP_LO_REGS:0,0 FP_REGS:0,0 ALL_REGS:10000,10000 MEM:9000,9000

The proposed allocno is ALL_REGS (despite having the highest cost!) and is then
forced by the hook to GENERAL_REGS because r79 has integer mode.  However
FP_REGS has the lowest cost.  After this patch the choice is as follows:

r79: preferred FP_REGS, alternative GENERAL_REGS, allocno FP_REGS
     a1 (r79,l0) best FP_REGS, allocno FP_REGS

As a result it is now no longer a requirement to use register move costs that 
are larger than the memory move cost.  So it will be feasible to use realistic
costs for both without a huge penalty.


2016-02-02  Wilco Dijkstra  <wdijkstr@arm.com>

    gcc/
        * ira-costs.c (find_costs_and_classes): Add extra argument.
        * target.def (ira_change_pseudo_allocno_class): Add parameter.
        * targhooks.h (ira_change_pseudo_allocno_class): Likewise.
        * targhooks.c (ira_change_pseudo_allocno_class): Likewise.
        * config/aarch64/aarch64.c (aarch64_ira_change_pseudo_allocno_class)
        Add best_class parameter, and return it if not ALL_REGS.
        * config/mips/mips.c (mips_ira_change_pseudo_allocno_class):
        Add parameter.
        * doc/tm.texi (TARGET_IRA_CHANGE_PSEUDO_ALLOCNO_CLASS):
        Update target hook.

From-SVN: r233084
2016-02-02 17:12:56 +00:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Richard Sandiford ee62a5a602 Add an rsqrt_optab and IFN_RSQRT internal function
All current uses of builtin_reciprocal convert 1.0/sqrt into rsqrt.
This patch adds an rsqrt optab and associated internal function for
that instead.  We can then pick up the vector forms of rsqrt automatically,
fixing an AArch64 regression from my internal_fn patches.

With that change, builtin_reciprocal only needs to handle target-specific
built-in functions.  I've restricted the hook to those since, if we need
a reciprocal of another standard function later, I think there should be
a strong preference for adding a new optab and internal function for it,
rather than hiding the code in a backend.

Three targets implement builtin_reciprocal: aarch64, i386 and rs6000.
i386 and rs6000 already used the obvious rsqrt<mode>2 pattern names
for the instructions, so they pick up the new code automatically.
aarch64 needs a slight rename.

mn10300 is unusual in that its native operation is rsqrt, and
sqrt is approximated as 1.0/rsqrt.  The port also uses rsqrt<mode>2
for the rsqrt pattern, so after the patch we now pick it up as a native
operation.

Two other ports define rsqrt patterns: sh and v850.  AFAICT these
patterns aren't currently used, but I think the patch does what the
authors of the patterns would have expected.  There's obviously some
risk of fallout though.

Tested on x86_64-linux-gnu, aarch64-linux-gnu, arm-linux-gnueabihf
(as a target without the hooks) and powerpc64-linux-gnu.

gcc/
	* internal-fn.def (RSQRT): New function.
	* optabs.def (rsqrt_optab): New optab.
	* doc/md.texi (rsqrtM2): Document.
	* target.def (builtin_reciprocal): Replace gcall argument with
	a function decl.  Restrict hook to machine functions.
	* doc/tm.texi: Regenerate.
	* targhooks.h (default_builtin_reciprocal): Update prototype.
	* targhooks.c (default_builtin_reciprocal): Likewise.
	* tree-ssa-math-opts.c: Include internal-fn.h.
	(internal_fn_reciprocal): New function.
	(pass_cse_reciprocals::execute): Call it, and build a call to an
	internal function on success.  Only call targetm.builtin_reciprocal
	for machine functions.
	* config/aarch64/aarch64-protos.h (aarch64_builtin_rsqrt): Remove
	second argument.
	* config/aarch64/aarch64-builtins.c (aarch64_expand_builtin_rsqrt):
	Rename aarch64_rsqrt_<mode>2 to rsqrt<mode>2.
	(aarch64_builtin_rsqrt): Remove md_fn argument and only handle
	machine functions.
	* config/aarch64/aarch64.c (use_rsqrt_p): New function.
	(aarch64_builtin_reciprocal): Replace gcall argument with a
	function decl.  Use use_rsqrt_p.  Remove optimize_size check.
	Only handle machine functions.  Update call to aarch64_builtin_rsqrt.
	(aarch64_optab_supported_p): New function.
	(TARGET_OPTAB_SUPPORTED_P): Define.
	* config/aarch64/aarch64-simd.md (aarch64_rsqrt_<mode>2): Rename to...
	(rsqrt<mode>2): ...this.
	* config/i386/i386.c (use_rsqrt_p): New function.
	(ix86_builtin_reciprocal): Replace gcall argument with a
	function decl.  Use use_rsqrt_p.  Remove optimize_insn_for_size_p
	check.  Only handle machine functions.
	(ix86_optab_supported_p): Handle rsqrt_optab.
	* config/rs6000/rs6000.c (TARGET_OPTAB_SUPPORTED_P): Define.
	(rs6000_builtin_reciprocal): Replace gcall argument with a
	function decl.  Remove optimize_insn_for_size_p check.
	Only handle machine functions.
	(rs6000_optab_supported_p): New function.

From-SVN: r231229
2015-12-03 14:31:55 +00:00
Richard Sandiford d95ab70a3c PR 68432: Add a target hook to control size/speed optab choices
The problem in the PR is that some i386 optabs FAIL when
optimising for size rather than speed.  The gimple level generally
needs access to this information before calling the generator,
so this patch adds a new hook to say whether an optab should
be used when optimising for size or speed.  It also has a "both"
option for cases where we want code that is optimised for both
size and speed.

I've passed the optab to the target hook because I think in most
cases that's more useful than the instruction code.  We could pass
both if there's a use for it though.

At the moment the match-and-simplify code doesn't have direct access
to the target block, so for now I've used "both" there.

Tested on x86_64-linux-gnu and powerpc64-linux-gnu.

gcc/
	PR tree-optimization/68432
	* coretypes.h (optimization_type): New enum.
	* doc/tm.texi.in (TARGET_OPTAB_SUPPORTED_P): New hook.
	* doc/tm.texi: Regenerate.
	* target.def (optab_supported_p): New hook.
	* targhooks.h (default_optab_supported_p): Declare.
	* targhooks.c (default_optab_supported_p): New function.
	* predict.h (function_optimization_type): Declare.
	(bb_optimization_type): Likewise.
	* predict.c (function_optimization_type): New function.
	(bb_optimization_type): Likewise.
	* optabs-query.h (convert_optab_handler): Define an overload
	that takes an optimization type.
	(direct_optab_handler): Likewise.
	* optabs-query.c (convert_optab_handler): Likewise.
	(direct_optab_handler): Likewise.
	* internal-fn.h (direct_internal_fn_supported_p): Take an
	optimization_type argument.
	* internal-fn.c (direct_optab_supported_p): Likewise.
	(multi_vector_optab_supported_p): Likewise.
	(direct_internal_fn_supported_p): Likewise.
	* builtins.c (replacement_internal_fn): Update call to
	direct_internal_fn_supported_p.
	* gimple-match-head.c (build_call_internal): Likewise.
	* tree-vect-patterns.c (vect_recog_pow_pattern): Likewise.
	* tree-vect-stmts.c (vectorizable_internal_function): Likewise.
	* tree.c (maybe_build_call_expr_loc): Likewise.
	* config/i386/i386.c (ix86_optab_supported_p): New function.
	(TARGET_OPTAB_SUPPORTED_P): Define.
	* config/i386/i386.md (asinxf2): Remove optimize_insn_for_size_p check.
	(asin<mode>2, acosxf2, acos<mode>2, log1pxf2, log1p<mode>2)
	(expNcorexf3, expxf2, exp<mode>2, exp10xf2, exp10<mode>2, exp2xf2)
	(exp2<mode>2, expm1xf2, expm1<mode>2, ldexpxf3, ldexp<mode>3)
	(scalbxf3, scalb<mode>3, rint<mode>2, round<mode>2)
	(<rounding_insn>xf2, <rounding_insn><mode>2): Likewise.

gcc/testsuite/
	* gcc.target/i386/pr68432-1.c: New test.
	* gcc.target/i386/pr68432-2.c: Likewise.
	* gcc.target/i386/pr68432-3.c: Likewise.

From-SVN: r231161
2015-12-02 09:08:49 +00:00
Jakub Jelinek 7b90c63a28 re PR tree-optimization/68501 (sqrt builtin is not used anymore)
PR tree-optimization/68501
	* target.def (builtin_reciprocal): Replace the 3 arguments with
	a gcall * one, adjust description.
	* targhooks.h (default_builtin_reciprocal): Replace the 3 arguments
	with a gcall * one.
	* targhooks.c (default_builtin_reciprocal): Likewise.
	* tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Use
	targetm.builtin_reciprocal even on internal functions, adjust
	the arguments and allow replacing an internal function with normal
	built-in.
	* config/i386/i386.c (ix86_builtin_reciprocal): Replace the 3 arguments
	with a gcall * one.  Handle internal fns too.
	* config/rs6000/rs6000.c (rs6000_builtin_reciprocal): Likewise.
	* config/aarch64/aarch64.c (aarch64_builtin_reciprocal): Likewise.
	* doc/tm.texi (builtin_reciprocal): Document.

From-SVN: r231075
2015-11-30 15:56:08 +01:00
Richard Sandiford 10766209ec Make builtin_vectorized_function take a combined_fn
This patch replaces the fndecl argument to builtin_vectorized_function
with a combined_fn and gets the vectoriser to call it for internal
functions too.  The patch also moves vectorisation of machine-specific
built-ins to a new hook, builtin_md_vectorized_function.

Tested on x86_64-linux-gnu, aarch64-linux-gnu, arm-linux-gnu and
powerpc64-linux-gnu.

gcc/
	* target.def (builtin_vectorized_function): Take a combined_fn (in
	the form of an unsigned int) rather than a function decl.
	(builtin_md_vectorized_function): New.
	* targhooks.h (default_builtin_vectorized_function): Replace the
	fndecl argument with an unsigned int.
	(default_builtin_md_vectorized_function): Declare.
	* targhooks.c (default_builtin_vectorized_function): Replace the
	fndecl argument with an unsigned int.
	(default_builtin_md_vectorized_function): New function.
	* doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_MD_VECTORIZED_FUNCTION):
	New hook.
	* doc/tm.texi: Regenerate.
	* tree-vect-stmts.c (vectorizable_function): Update call to
	builtin_vectorized_function, also passing internal functions.
	Call builtin_md_vectorized_function for target-specific builtins.
	* config/aarch64/aarch64-protos.h
	(aarch64_builtin_vectorized_function): Replace fndecl argument
	with an unsigned int.
	* config/aarch64/aarch64-builtins.c: Include case-cfn-macros.h.
	(aarch64_builtin_vectorized_function): Update after above changes.
	Use CASE_CFN_*.
	* config/arm/arm-protos.h (arm_builtin_vectorized_function): Replace
	fndecl argument with an unsigned int.
	* config/arm/arm-builtins.c: Include case-cfn-macros.h
	(arm_builtin_vectorized_function): Update after above changes.
	Use CASE_CFN_*.
	* config/i386/i386.c: Include case-cfn-macros.h
	(ix86_veclib_handler): Take a combined_fn rather than a
	built_in_function.
	(ix86_veclibabi_svml, ix86_veclibabi_acml): Likewise.  Use
	mathfn_built_in rather than calling builtin_decl_implicit directly.
	(ix86_builtin_vectorized_function) Update after above changes.
	Use CASE_CFN_*.
	* config/rs6000/rs6000.c: Include case-cfn-macros.h
	(rs6000_builtin_vectorized_libmass): Replace fndecl argument
	with a combined_fn.  Use CASE_CFN_*.  Use mathfn_built_in rather
	than calling builtin_decl_implicit directly.
	(rs6000_builtin_vectorized_function): Update after above changes.
	Use CASE_CFN_*.  Move BUILT_IN_MD to...
	(rs6000_builtin_md_vectorized_function): ...this new function.
	(TARGET_VECTORIZE_BUILTIN_MD_VECTORIZED_FUNCTION): Define.

From-SVN: r230491
2015-11-17 18:55:13 +00:00
Julian Brown cc8ca59eb8 Machine modes for address printing.
* final.c (output_asm_insn): Pass VOIDmode to output_address.
	(output_address): Add MODE argument. Pass to print_operand_address
	hook.
	* targhooks.c (default_print_operand_address): Add MODE argument.
	* targhooks.h (default_print_operand_address): Update prototype.
	* output.h (output_address): Update prototype.
	* target.def (print_operand_address): Add MODE argument.
	* config/vax/vax.c (print_operand_address): Pass VOIDmode to
	output_address.
	(print_operand): Pass access mode to output_address.
	* config/mcore/mcore.c (mcore_print_operand_address): Add MODE
	argument.
	(mcore_print_operand): Update calls to mcore_print_operand_address.
	* config/fr30/fr30.c (fr30_print_operand): Pass VOIDmode to
	output_address.
	* config/lm32/lm32.c (lm32_print_operand): Pass mode in calls to
	output_address.
	* config/tilegx/tilegx.c (output_memory_reference_mode): Remove
	global.
	(tilegx_print_operand): Don't set above global. Update calls to
	output_address.
	(tilegx_print_operand_address): Add MODE argument. Use instead of
	output_memory_reference_mode global.
	* config/frv/frv.c (frv_print_operand_address): Add MODE argument.
	(frv_print_operand): Pass mode to frv_print_operand_address calls.
	* config/mn10300/mn10300.c (mn10300_print_operand): Pass mode to
	output_address.
	* config/cris/cris.c (cris_print_operand_address): Add MODE
	argument.
	(cris_print_operand): Pass mode to output_address calls.
	* config/spu/spu.c (print_operand): Pass mode to output_address
	calls.
	* config/aarch64/aarch64.h (aarch64_print_operand)
	(aarch64_print_operand_address): Remove prototypes.
	* config/aarch64/aarch64.c (aarch64_memory_reference_mode): Delete
	global.
	(aarch64_print_operand): Make static. Update calls to
	output_address.
	(aarch64_print_operand_address): Add MODE argument. Use instead of
	aarch64_memory_reference_mode global.
	(TARGET_PRINT_OPERAND, TARGET_PRINT_OPERAND_ADDRESS): Define target
	hooks.
	* config/aarch64/aarch64.h (PRINT_OPERAND, PRINT_OPERAND_ADDRESS):
	Delete macro definitions.
	* config/pa/pa.c (pa_print_operand): Pass mode in output_address
	calls.
	* config/xtensa/xtensa.c (print_operand): Pass mode in
	output_address calls.
	* config/h8300/h8300.c (h8300_print_operand_address): Add MODE
	argument.
	(h83000_print_operand): Update calls to h8300_print_operand_address
	and output_address.
	* config/ia64/ia64.c (ia64_print_operand_address): Add MODE
	argument.
	* config/tilepro/tilepro.c (output_memory_reference_mode): Delete
	global.
	(tilepro_print_operand): Pass mode to output_address.
	(tilepro_print_operand_address): Add MODE argument. Use instead of
	output_memory_reference_mode.
	* config/nvptx/nvptx.c (output_decl_chunk, nvptx_assemble_integer)
	(nvptx_output_call_insn, nvptx_print_address_operand): Pass VOIDmode
	to output_address calls.
	(nvptx_print_operand_address): Add MODE argument.
	* config/alpha/alpha.c (print_operand): Pass mode argument in
	output_address calls.
	* config/m68k/m68k.c (print_operand): Pass mode argument in
	output_address call.
	* config/avr/avr.c (avr_print_operand_address): Add MODE argument.
	(avr_print_operand): Update calls to avr_print_operand_address.
	* config/sparc/sparc.c (sparc_print_operand_address): Add MODE
	argument. Update calls to output_address.
	(sparc_print_operand): Pass mode to output_address.
	* config/iq2000/iq2000.c (iq2000_print_operand_address): Add MODE
	argument.
	(iq2000_print_operand): Pass mode in output_address calls.
	* config/stormy16/stormy16.c (xstormy16_print_operand_address): Add
	MODE argument.
	(xstormy16_print_operand): Pass mode to
	xstormy16_print_operand_address calls.
	* config/mips/mips.c (mips_print_operand): Update calls to
	output_address.
	(mips_print_operand_address): Add MODE argument.
	* config/epiphany/epiphany.c (epiphany_print_operand): Update calls
	to output_address.
	(epiphany_print_operand_address): Add MODE argument. Add FIXME note.
	* config/pdp11/pdp11.c (pdp11_asm_print_operand): Update call to
	output_address.
	* config/rx/rx.c (rx_print_operand_address): Add MODE argument.
	(rx_print_operand): Update calls to output_address,
	rx_print_operand_address.
	* config/nds32/nds32.c (nds32_print_operand): Update calls to
	output_address.
	(nds32_print_operand_address): Add MODE argument.
	* config/rs6000/rs6000.c (print_operand): Pass mem mode to
	output_address calls.
	* config/c6x/c6x.c (print_address_offset): Pass mem mode to
	output_address call.
	(c6x_print_address_operand): Update calls to output_address.
	(c6x_print_operand_address): Pass mode to above.
	* config/v850/v850.c (v850_print_operand_address): Add MODE
	argument.
	(v850_print_operand): Pass mode to v850_print_operand_address,
	output_address.
	* config/mmix/mmix.c (mmix_print_operand_address): Add MODE
	argument.
	(mmix_print_operand): Pass mode in output_address calls.
	* config/sh/sh.c (sh_print_operand_address): Add MODE argument.
	(sh_print_operand): Pass mem mode to output_address,
	sh_print_operand_address.
	* config/cr16/cr16.c (cr16_print_operand_address): Add MODE
	argument.
	(cr16_print_operand): Pass mode to output_address,
	cr16_print_operand_address.
	* config/bfin/bfin.c (print_address_operand): Pass VOIDmode to
	output_address.
	* config/microblaze/microblaze.c (print_operand): Pass mode to
	output_address.
	* config/nios2/nios2.c (nios2_print_operand): Pass VOIDmode to
	output_address.
	(nios2_print_operand_address): Add MODE argument. Update call to
	nios2_print_operand_address.
	* config/s390/s390.c (print_operand): Pass mode to output_address.
	* config/m32c/m32c.c (m32c_print_operand_address): Add MODE
	argument.
	* config/arc/arc.c (arc_print_operand): Pass VOIDmode to
	output_address.
	* config/arm/arm.c (arm_print_operand_address): Add MODE argument.
	Use instead of output_memory_reference_mode.
	(output_memory_reference_mode): Delete global.
	(arm_print_operand): Pass mem mode to output_address.
	* config/m32r/m32r.c (m32r_print_operand_address): Add MODE
	argument.
	(m32r_print_operand): Pass mode to output_address.
	* config/msp430/msp430.c (msp430_print_operand_addr): Add MODE
	argument.
	(msp430_print_operand): Pass mode to msp430_print_operand_addr.
	* config/i386/i386.c (ix86_print_operand): Pass mode to
	output_address calls.
	(ix86_print_operand_address): Add MODE argument.

From-SVN: r230016
2015-11-09 12:16:55 +00:00
Richard Henderson f736b911e6 Add hook for modifying debug info for address spaces
* dwarf2out.c (modified_type_die): Pass the address space number
        through TARGET_ADDR_SPACE_DEBUG to produce the dwarf address class.
        * target.def (TARGET_ADDR_SPACE_DEBUG): New.
        * targhooks.c (default_addr_space_debug): New.
        * targhooks.h (default_addr_space_debug): Declare.
        * doc/tm.texi.in (TARGET_ADDR_SPACE_DEBUG): Mark it.
        * doc/tm.texi: Rebuild.

From-SVN: r230000
2015-11-09 01:19:19 -08:00
Richard Henderson 6626f97034 Add TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID
* gimple.c (check_loadstore): Return false when 0 is a valid address.
        * fold-const.c (const_unop) [ADDR_SPACE_CONVERT_EXPR]: Do not fold
        null when 0 is valid in the source address space.
        * target.def (TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID): New.
        * targhooks.c (default_addr_space_zero_address_valid): New.
        * targhooks.h (default_addr_space_zero_address_valid): Declare.
        * doc/tm.texi.in (TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID): Mark it.
        * doc/tm.texi: Rebuild.

From-SVN: r229999
2015-11-09 01:18:59 -08:00
Nathan Sidwell bd75197575 target.def (goacc.dim_limit): New hook.
* target.def (goacc.dim_limit): New hook.
	* targhooks.h (default_goacc_dim_limit): Declare.
	* doc/tm.texi.in (TARGET_GOACC_DIM_LIMIT): Add.
	* doc/tm.texi: Rebuilt.
	* omp-low.h (get_oacc_fn_dim_size, get_oacc_ifn_dim_arg): Declare.
	* omp-low.c (get_oacc_fn_dim_size, get_oacc_ifn_dim_arg): New.
	(default_goacc_dim_limit): New.
	* config/nvptx/nvptx.c (PTX_VECTOR_LENGTH, PTX_WORKER_LENGTH): New.
	(nvptx_goacc_dim_limit) New.
	(TARGET_GOACC_DIM_LIMIT): Override.
	* tree-vrp.c: Include omp-low.h, target.h.
	(extract_range_basic): Add handling for IFN_GOACC_DIM_SIZE &
	IFN_GOACC_DIM_POS.

From-SVN: r229809
2015-11-05 13:50:13 +00:00
Nathan Sidwell e50146711b internal-fn.def (GOACC_REDUCTION): New.
* internal-fn.def (GOACC_REDUCTION): New.
	* internal-fn.h (enum ifn_goacc_reduction_kind): New.
	* internal-fn.c (expand_GOACC_REDUCTION): New.
	* target.def (goacc.reduction): New OpenACC hook.
	* targhooks.h (default_goacc_reduction): Declare.
	* doc/tm.texi.in: Add TARGET_GOACC_REDUCTION.
	* doc/tm.texi: Rebuilt.
	* omp-low.c (oacc_get_reduction_array_id, oacc_max_threads,
	scan_sharing_clauses): Remove oacc reduction handling here.
	(lower_rec_input_clauses): Don't handle OpenACC reductions here.
	(oacc_lower_reduction_var_helper): Delete.
	(lower_oacc_reductions): New.
	(lower_reduction_clauses): Don't handle OpenACC reductions here.
	(lower_oacc_head_tail): Call lower_oacc_reductions.
	(oacc_gimple_assign, oacc_init_reduction_array,
	oacc_initialize_reduction_data, oacc_finalize_reduction_data,
	oacc_process_reduction_data): Delete.
	(lower_omp_target): Remove old OpenACC reduction handling.  Insert
	dummy OpenACC gang reduction for reductions at outer level.
	(oacc_loop_xform_head_tail): Transform IFN_GOACC_REDUCTION.
	(default_goacc_reduction): New.
	(execute_oacc_device_lower): Handle IFN_GOACC_REDUCTION.

From-SVN: r229767
2015-11-04 16:57:36 +00:00
Nathan Sidwell 6e91acf8bb target-insns.def (oacc_fork, oacc_join): Define.
* target-insns.def (oacc_fork, oacc_join): Define.
	* target.def (goacc.validate_dims): Adjust doc to avoid warning.
	(goacc.fork_join): New GOACC hook.
	* targhooks.h (default_goacc_fork_join): Declare.
	* omp-low.c (default_goacc_forkjoin): New.
	* doc/tm.texi.in (TARGET_GOACC_FORK_JOIN): Add.
	* doc/tm.texi: Regenerate.

From-SVN: r229465
2015-10-27 22:16:19 +00:00
Ilya Enkovich 9f47c7e5cf tm.texi: Regenerated.
gcc/

	* doc/tm.texi: Regenerated.
	* doc/tm.texi.in (TARGET_VECTORIZE_GET_MASK_MODE): New.
	* stor-layout.c (layout_type): Use mode to get vector mask size.
	* target.def (get_mask_mode): New.
	* targhooks.c (default_get_mask_mode): New.
	* targhooks.h (default_get_mask_mode): New.
	* gcc/tree-vect-stmts.c (get_same_sized_vectype): Add special case
	for boolean vector.
	* tree.c (MAX_BOOL_CACHED_PREC): New.
	(nonstandard_boolean_type_cache): New.
	(build_nonstandard_boolean_type): New.
	(make_vector_type): Vector mask has no canonical type.
	(build_truth_vector_type): New.
	(build_same_sized_truth_vector_type): New.
	(truth_type_for): Support vector masks.
	* tree.h (VECTOR_BOOLEAN_TYPE_P): New.
	(build_truth_vector_type): New.
	(build_same_sized_truth_vector_type): New.
	(build_nonstandard_boolean_type): New.
	* tree-cfg.c (verify_gimple_comparison) Require boolean
	vector type for vector comparison.
	(verify_gimple_assign_ternary): Likewise.
	* optabs.c (expand_vec_cond_expr): Accept boolean vector as
	condition operand.
	* tree-vect-stmts.c (vectorizable_condition): Use boolean
	vector type for vector comparison.
	* tree-vect-generic.c (elem_op_func): Add new operand to hold
	vector type.
	(do_unop): Adjust to modified function type.
	(do_binop): Likewise.
	(do_plus_minus): Likewise.
	(do_negate); Likewise.
	(expand_vector_piecewise): Likewise.
	(do_cond): Likewise.
	(do_compare): Use comparison instead of condition.
	(expand_vector_divmod): Use boolean vector type for comparison.
	(expand_vector_operations_1): Skip scalar mask operations.

gcc/c

	* c-typeck.c (build_conditional_expr): Use boolean vector
	type for vector comparison.
	(build_vec_cmp): New.
	(build_binary_op): Use build_vec_cmp for comparison.

gcc/cp

	* call.c (build_conditional_expr_1): Use boolean vector
	type for vector comparison.
	* typeck.c (build_vec_cmp): New.
	(cp_build_binary_op): Use build_vec_cmp for comparison.

gcc/testsuite/

	* g++.dg/ext/vector22.C: Allow VEC_COND_EXPR.

From-SVN: r229128
2015-10-21 16:01:43 +00:00
Nathan Sidwell 94829f87ca nvptx.c (nvptx_goacc_validate_dims): New.
* config/nvptx/nvptx.c (nvptx_goacc_validate_dims): New.
	(TARGET_GOACC_VALIDATE_DIMS): Override.
	* target.def (TARGET_GOACC): New target hook prefix.
	(validate_dims): New hook.
	* targhooks.h (default_goacc_validate_dims): New.
	* omp-low.c (oacc_validate_dims): New.
	(execute_oacc_device_lower): New.
	(default_goacc_validate_dims): New.
	(pass_data_oacc_device_lower): New.
	(pass_oacc_device_lower): New pass.
	(make_pass_oacc_device_lower): New.
	* tree-pass.h (make_pass_oacc_device_lower): Declare.
	* passes.def (pass_oacc_device_lower): Add it.
	* doc/tm.texi: Rebuilt.
	* doc/tm.texi.in (TARGET_GOACC_VALIDATE_DIMS): Add hook.
	* doc/invoke.texi (oaccdevlow): Document tree dump flag.

Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>

From-SVN: r228304
2015-09-30 19:16:29 +00:00
Vladimir Makarov 5074a1f86a re PR rtl-optimization/65862 ([MIPS] IRA/LRA issue: integers spilled to floating-point registers)
2015-05-14  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/65862
	* target.def (ira_change_pseudo_allocno_class): New hook.
	* targhooks.c (default_ira_change_pseudo_allocno_class): Default
	value of the hook.
	* targhooks.h (default_ira_change_pseudo_allocno_class): New
	extern
	* doc/tm.texi.in (TARGET_IRA_CHANGE_PSEUDO_ALLOCNO_CLASS): Add the
	hook.
	* ira-costs.c (find_costs_and_classes): Call the hook and change
	classes when it is necessary.
	* doc/tm.texi: Update.

From-SVN: r223202
2015-05-14 20:40:44 +00:00
Jakub Jelinek 5624e564d2 Update copyright years.
From-SVN: r219188
2015-01-05 13:33:28 +01:00
Kaz Kojima 14133a4d8a * Add TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT target macro.
From-SVN: r218887
2014-12-19 04:43:11 +00:00
James Greenhalgh 445d78261c [Patch] PR target/63937 TARGET_USE_BY_PIECES_INFRASTRUCTURE_P should take an unsigned HOST_WIDE_INT size argument
gcc/

	PR target/63937
	* target.def (use_by_pieces_infrastructure_p): Take unsigned
	HOST_WIDE_INT as the size parameter.
	* targhooks.c (default_use_by_pieces_infrastructure_p): Likewise.
	* targhooks.h (default_use_by_pieces_infrastructure_p): Likewise.
	* config/arc/arc.c (arc_use_by_pieces_infrastructure_p)): Likewise.
	* config/mips/mips.c (mips_use_by_pieces_infrastructure_p)): Likewise.
	* config/s390/s390.c (s390_use_by_pieces_infrastructure_p)): Likewise.
	* config/sh/sh.c (sh_use_by_pieces_infrastructure_p)): Likewise.
	* config/aarch64/aarch64.c
	(aarch64_use_by_pieces_infrastructure_p)): Likewise.
	* doc/tm.texi: Regenerate.

gcc/testsuite/

	PR target/63937
	* gcc.dg/memset-2.c: New.

From-SVN: r217742
2014-11-18 22:45:21 +00:00
Ilya Enkovich d5e254e19c ipa-chkp.c: New.
gcc/

2014-11-05  Ilya Enkovich  <ilya.enkovich@intel.com>

	* ipa-chkp.c: New.
	* ipa-chkp.h: New.
	* tree-chkp.c: New.
	* tree-chkp.h: New.
	* tree-chkp-opt.c: New.
	* rtl-chkp.c: New.
	* rtl-chkp.h: New.
	* Makefile.in (OBJS): Add ipa-chkp.o, rtl-chkp.o, tree-chkp.o
	tree-chkp-opt.o.
	(GTFILES): Add tree-chkp.c.
	* mode-classes.def (MODE_POINTER_BOUNDS): New.
	* tree.def (POINTER_BOUNDS_TYPE): New.
	* genmodes.c (complete_mode): Support MODE_POINTER_BOUNDS.
	(POINTER_BOUNDS_MODE): New.
	(make_pointer_bounds_mode): New.
	* machmode.h (POINTER_BOUNDS_MODE_P): New.
	* stor-layout.c (int_mode_for_mode): Support MODE_POINTER_BOUNDS.
	(layout_type): Support POINTER_BOUNDS_TYPE.
	* tree-pretty-print.c (dump_generic_node): Support POINTER_BOUNDS_TYPE.
	* tree-core.h (tree_index): Add TI_POINTER_BOUNDS_TYPE.
	* tree.c (build_int_cst_wide): Support POINTER_BOUNDS_TYPE.
	(type_contains_placeholder_1): Likewise.
	(build_common_tree_nodes): Initialize
	pointer_bounds_type_node.
	* tree.h (POINTER_BOUNDS_TYPE_P): New.
	(pointer_bounds_type_node): New.
	(POINTER_BOUNDS_P): New.
	(BOUNDED_TYPE_P): New.
	(BOUNDED_P): New.
	(CALL_WITH_BOUNDS_P): New.
	* gimple.h (gf_mask): Add GF_CALL_WITH_BOUNDS.
	(gimple_call_with_bounds_p): New.
	(gimple_call_set_with_bounds): New.
	(gimple_return_retbnd): New.
	(gimple_return_set_retbnd): New
	* gimple.c (gimple_build_return): Increase number of ops
	for return statement.
	(gimple_build_call_from_tree): Propagate CALL_WITH_BOUNDS_P
	flag.
	* gimple-pretty-print.c (dump_gimple_return): Print second op.
	* rtl.h (CALL_EXPR_WITH_BOUNDS_P): New.
	* gimplify.c (gimplify_init_constructor): Avoid infinite
	loop during gimplification of bounds initializer.
	* calls.c: Include tree-chkp.h, rtl-chkp.h, bitmap.h.
	(special_function_p): Use original decl name when analyzing
	instrumentation clone.
	(arg_data): Add fields special_slot, pointer_arg and
	pointer_offset.
	(store_bounds): New.
	(emit_call_1): Propagate instrumentation flag for CALL.
	(initialize_argument_information): Compute pointer_arg,
	pointer_offset and special_slot for pointer bounds arguments.
	(finalize_must_preallocate): Preallocate when storing bounds
	in bounds table.
	(compute_argument_addresses): Skip pointer bounds.
	(expand_call): Store bounds into tables separately.  Return
	result joined with resulting bounds.
	* cfgexpand.c: Include tree-chkp.h, rtl-chkp.h.
	(expand_call_stmt): Propagate bounds flag for CALL_EXPR.
	(expand_return): Add returned bounds arg.  Handle returned bounds.
	(expand_gimple_stmt_1): Adjust to new expand_return signature.
	(gimple_expand_cfg): Reset rtx bounds map.
	* expr.c: Include tree-chkp.h, rtl-chkp.h.
	(expand_assignment): Handle returned bounds.
	(store_expr_with_bounds): New.  Replaces store_expr with new bounds
	target argument.  Handle bounds returned by calls.
	(store_expr): Now wraps store_expr_with_bounds.
	* expr.h (store_expr_with_bounds): New.
	* function.c: Include tree-chkp.h, rtl-chkp.h.
	(bounds_parm_data): New.
	(use_register_for_decl): Do not registerize decls used for bounds
	stores and loads.
	(assign_parms_augmented_arg_list): Add bounds of the result
	structure pointer as the second argument.
	(assign_parm_find_entry_rtl): Mark bounds are never passed on
	the stack.
	(assign_parm_is_stack_parm): Likewise.
	(assign_parm_load_bounds): New.
	(assign_bounds): New.
	(assign_parms): Load bounds and determine a location for
	returned bounds.
	(diddle_return_value_1): New.
	(diddle_return_value): Handle returned bounds.
	* function.h (rtl_data): Add field for returned bounds.
	* varasm.c: Include tree-chkp.h.
	(output_constant): Support POINTER_BOUNDS_TYPE.
	(output_constant_pool_2): Support MODE_POINTER_BOUNDS.
	(ultimate_transparent_alias_target): Move up.
	(make_decl_rtl): For instrumented function use
	name of the original decl.
	(assemble_start_function): Mark function as global
	in case it is instrumentation clone of the global
	function.
	(do_assemble_alias): Follow transparent alias chain
	for identifier.  Check if original alias is public.
	(maybe_assemble_visibility): Use visibility of the
	original function for instrumented version.
	(default_unique_section): Likewise.
	* emit-rtl.c (immed_double_const): Support MODE_POINTER_BOUNDS.
	(init_emit_once): Build pointer bounds zero constants.
	* explow.c (trunc_int_for_mode): Support MODE_POINTER_BOUNDS.
	* target.def (builtin_chkp_function): New.
	(chkp_bound_type): New.
	(chkp_bound_mode): New.
	(chkp_make_bounds_constant): New.
	(chkp_initialize_bounds): New.
	(load_bounds_for_arg): New.
	(store_bounds_for_arg): New.
	(load_returned_bounds): New.
	(store_returned_bounds): New.
	(chkp_function_value_bounds): New.
	(setup_incoming_vararg_bounds): New.
	(function_arg): Update hook description with new possible return
	value CONST_INT.
	* targhooks.h (default_load_bounds_for_arg): New.
	(default_store_bounds_for_arg): New.
	(default_load_returned_bounds): New.
	(default_store_returned_bounds): New.
	(default_chkp_bound_type): New.
	(default_chkp_bound_mode): New.
	(default_builtin_chkp_function): New.
	(default_chkp_function_value_bounds): New.
	(default_chkp_make_bounds_constant): New.
	(default_chkp_initialize_bounds): New.
	(default_setup_incoming_vararg_bounds): New.
	* targhooks.c (default_load_bounds_for_arg): New.
	(default_store_bounds_for_arg): New.
	(default_load_returned_bounds): New.
	(default_store_returned_bounds): New.
	(default_chkp_bound_type): New.
	(default_chkp_bound_mode); New.
	(default_builtin_chkp_function): New.
	(default_chkp_function_value_bounds): New.
	(default_chkp_make_bounds_constant): New.
	(default_chkp_initialize_bounds): New.
	(default_setup_incoming_vararg_bounds): New.
	* builtin-types.def (BT_BND): New.
	(BT_FN_PTR_CONST_PTR): New.
	(BT_FN_CONST_PTR_CONST_PTR): New.
	(BT_FN_BND_CONST_PTR): New.
	(BT_FN_CONST_PTR_BND): New.
	(BT_FN_PTR_CONST_PTR_SIZE): New.
	(BT_FN_PTR_CONST_PTR_CONST_PTR): New.
	(BT_FN_VOID_PTRPTR_CONST_PTR): New.
	(BT_FN_VOID_CONST_PTR_SIZE): New.
	(BT_FN_VOID_PTR_BND): New.
	(BT_FN_CONST_PTR_CONST_PTR_CONST_PTR): New.
	(BT_FN_BND_CONST_PTR_SIZE): New.
	(BT_FN_PTR_CONST_PTR_CONST_PTR_SIZE): New.
	(BT_FN_VOID_CONST_PTR_BND_CONST_PTR): New.
	* chkp-builtins.def: New.
	* builtins.def: include chkp-builtins.def.
	(DEF_CHKP_BUILTIN): New.
	* builtins.c: Include tree-chkp.h and rtl-chkp.h.
	(expand_builtin): Support BUILT_IN_CHKP_INIT_PTR_BOUNDS,
	BUILT_IN_CHKP_NULL_PTR_BOUNDS, BUILT_IN_CHKP_COPY_PTR_BOUNDS,
	BUILT_IN_CHKP_CHECK_PTR_LBOUNDS, BUILT_IN_CHKP_CHECK_PTR_UBOUNDS,
	BUILT_IN_CHKP_CHECK_PTR_BOUNDS, BUILT_IN_CHKP_SET_PTR_BOUNDS,
	BUILT_IN_CHKP_NARROW_PTR_BOUNDS, BUILT_IN_CHKP_STORE_PTR_BOUNDS,
	BUILT_IN_CHKP_GET_PTR_LBOUND, BUILT_IN_CHKP_GET_PTR_UBOUND,
	BUILT_IN_CHKP_BNDMK, BUILT_IN_CHKP_BNDSTX, BUILT_IN_CHKP_BNDCL,
	BUILT_IN_CHKP_BNDCU, BUILT_IN_CHKP_BNDLDX, BUILT_IN_CHKP_BNDRET,
	BUILT_IN_CHKP_INTERSECT, BUILT_IN_CHKP_NARROW,
	BUILT_IN_CHKP_EXTRACT_LOWER, BUILT_IN_CHKP_EXTRACT_UPPER.
	(std_expand_builtin_va_start): Init bounds for va_list.
	* cppbuiltin.c (define_builtin_macros_for_compilation_flags): Add
	__CHKP__ macro when Pointer Bounds Checker is on.
	* params.def (PARAM_CHKP_MAX_CTOR_SIZE): New.
	* passes.def (pass_ipa_chkp_versioning): New.
	(pass_early_local_passes): Renamed to pass_build_ssa_passes.
	(pass_fixup_cfg): Moved to pass_chkp_instrumentation_passes.
	(pass_chkp_instrumentation_passes): New.
	(pass_ipa_chkp_produce_thunks): New.
	(pass_local_optimization_passes): New.
	(pass_chkp_opt): New.
	* tree-pass.h (make_pass_ipa_chkp_versioning): New.
	(make_pass_ipa_chkp_produce_thunks): New.
	(make_pass_chkp): New.
	(make_pass_chkp_opt): New.
	(make_pass_early_local_passes): Renamed to ...
	(make_pass_build_ssa_passes): This.
	(make_pass_chkp_instrumentation_passes): New.
	(make_pass_local_optimization_passes): New.
	* passes.c (pass_manager::execute_early_local_passes): Execute
	early passes in three steps.
	(execute_all_early_local_passes): Renamed to ...
	(execute_build_ssa_passes): This.
	(pass_data_early_local_passes): Renamed to ...
	(pass_data_build_ssa_passes): This.
	(pass_early_local_passes): Renamed to ...
	(pass_build_ssa_passes): This.
	(pass_data_chkp_instrumentation_passes): New.
	(pass_chkp_instrumentation_passes): New.
	(pass_data_local_optimization_passes): New.
	(pass_local_optimization_passes): New.
	(make_pass_early_local_passes): Renamed to ...
	(make_pass_build_ssa_passes): This.
	(make_pass_chkp_instrumentation_passes): New.
	(make_pass_local_optimization_passes): New.
	* c-family/c.opt (fcheck-pointer-bounds): New.
	(fchkp-check-incomplete-type): New.
	(fchkp-zero-input-bounds-for-main): New.
	(fchkp-first-field-has-own-bounds): New.
	(fchkp-narrow-bounds): New.
	(fchkp-narrow-to-innermost-array): New.
	(fchkp-optimize): New.
	(fchkp-use-fast-string-functions): New.
	(fchkp-use-nochk-string-functions): New.
	(fchkp-use-static-bounds): New.
	(fchkp-use-static-const-bounds): New.
	(fchkp-treat-zero-dynamic-size-as-infinite): New.
	(fchkp-check-read): New.
	(fchkp-check-write): New.
	(fchkp-store-bounds): New.
	(fchkp-instrument-calls): New.
	(fchkp-instrument-marked-only): New.
	(Wchkp): New.
	* c-family/c-common.c (handle_bnd_variable_size_attribute): New.
	(handle_bnd_legacy): New.
	(handle_bnd_instrument): New.
	(c_common_attribute_table): Add bnd_variable_size, bnd_legacy
	and bnd_instrument.  Fix documentation.
	(c_common_format_attribute_table): Likewsie.
	* toplev.c: include tree-chkp.h.
	(process_options): Check Pointer Bounds Checker is supported.
	(compile_file): Add chkp_finish_file call.
	* ipa-cp.c (initialize_node_lattices): Use cgraph_local_p
	to handle instrumentation clones properly.
	(propagate_constants_accross_call): Do not propagate
	through instrumentation thunks.
	* ipa-pure-const.c (propagate_pure_const): Support
	IPA_REF_CHKP.
	* ipa-inline.c (early_inliner): Check edge has summary allocated.
	* ipa-split.c: Include tree-chkp.h.
	(find_retbnd): New.
	(split_part_set_ssa_name_p): New.
	(consider_split): Do not split retbnd and retval
	producers.
	(insert_bndret_call_after): new.
	(split_function): Propagate Pointer Bounds Checker
	instrumentation marks and handle returned bounds.
	* tree-ssa-sccvn.h (vn_reference_op_struct): Transform opcode
	into bit field and add with_bounds field.
	* tree-ssa-sccvn.c (copy_reference_ops_from_call): Set
	with_bounds field for instrumented calls.
	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Restore
	CALL_WITH_BOUNDS_P flag for calls.
	* tree-ssa-ccp.c: Include tree-chkp.h.
	(insert_clobber_before_stack_restore): Handle
	BUILT_IN_CHKP_BNDRET calls.
	* tree-ssa-dce.c: Include tree-chkp.h.
	(propagate_necessity): For free call fed by alloc check
	bounds are also provided by the same alloc.
	(eliminate_unnecessary_stmts): Handle BUILT_IN_CHKP_BNDRET
	used by free calls.
	* tree-inline.c: Include tree-chkp.h.
	(declare_return_variable): Add arg holding
	returned bounds slot.  Create and initialize returned bounds var.
	(remap_gimple_stmt): Handle returned bounds.
	Return sequence of statements instead of a single statement.
	(insert_init_stmt): Add declaration.
	(remap_gimple_seq): Adjust to new remap_gimple_stmt signature.
	(copy_bb): Adjust to changed return type of remap_gimple_stmt.
	Properly handle bounds in va_arg_pack and va_arg_pack_len.
	(expand_call_inline): Handle returned bounds.  Add bounds copy
	for generated mem to mem assignments.
	* tree-inline.h (copy_body_data): Add fields retbnd and
	assign_stmts.
	* value-prof.c: Include tree-chkp.h.
	(gimple_ic): Support returned bounds.
	* ipa.c (cgraph_build_static_cdtor_1): Support contructors
	with "chkp ctor" and "bnd_legacy" attributes.
	(symtab_remove_unreachable_nodes): Keep initial values for
	pointer bounds to be used for checks eliminations.
	(process_references): Handle IPA_REF_CHKP.
	(walk_polymorphic_call_targets): Likewise.
	* ipa-visibility.c (cgraph_externally_visible_p): Mark
	instrumented 'main' as externally visible.
	(function_and_variable_visibility): Filter instrumentation
	thunks.
	* cgraph.h (cgraph_thunk_info): Add add_pointer_bounds_args
	field.
	(cgraph_node): Add instrumented_version, orig_decl and
	instrumentation_clone fields.
	(symtab_node::get_alias_target): Allow IPA_REF_CHKP reference.
	(varpool_node): Add need_bounds_init field.
	(cgraph_local_p): New.
	* cgraph.c: Include tree-chkp.h.
	(cgraph_node::remove): Fix instrumented_version
	of the referenced node if any.
	(cgraph_node::dump): Dump instrumentation_clone and
	instrumented_version fields.
	(cgraph_node::verify_node): Check correctness of IPA_REF_CHKP
	references and instrumentation thunks.
	(cgraph_can_remove_if_no_direct_calls_and_refs_p): Keep
	all not instrumented instrumentation clones alive.
	(cgraph_redirect_edge_call_stmt_to_callee): Support
	returned bounds.
	* cgraphbuild.c (rebuild_cgraph_edges): Rebuild IPA_REF_CHKP
	reference.
	(cgraph_rebuild_references): Likewise.
	* cgraphunit.c: Include tree-chkp.h.
	(assemble_thunks_and_aliases): Skip thunks calling instrumneted
	function version.
	(varpool_finalize_decl): Register statically initialized decls
	in Pointer Bounds Checker.
	(walk_polymorphic_call_targets): Do not mark generated call to
	__builtin_unreachable as with_bounds.
	(output_weakrefs): If there are both instrumented and original
	versions, output only one of them.
	(cgraph_node::expand_thunk): Set with_bounds flag
	for created call statement.
	* ipa-ref.h (ipa_ref_use): Add IPA_REF_CHKP.
	(ipa_ref): increase size of use field.
	* symtab.c (ipa_ref_use_name): Add element for IPA_REF_CHKP.
	* varpool.c (dump_varpool_node): Dump need_bounds_init field.
	(ctor_for_folding): Do not fold constant bounds vars.
	* lto-streamer.h (LTO_minor_version): Change minor version from
	0 to 1.
	* lto-cgraph.c (compute_ltrans_boundary): Keep initial values for
	pointer bounds.
	(lto_output_node): Output instrumentation_clone,
	thunk.add_pointer_bounds_args and orig_decl field.
	(lto_output_ref): Adjust to new ipa_ref::use field size.
	(input_overwrite_node): Read instrumentation_clone field.
	(input_node): Read thunk.add_pointer_bounds_args and orig_decl
	fields.
	(input_ref): Adjust to new ipa_ref::use field size.
	(input_cgraph_1): Compute instrumented_version fields and restore
	IDENTIFIER_TRANSPARENT_ALIAS chains.
	(lto_output_varpool_node): Output
	need_bounds_init value.
	(input_varpool_node): Read need_bounds_init value.
	* lto-partition.c (add_symbol_to_partition_1): Keep original
	and instrumented versions together.
	(privatize_symbol_name): Restore transparent alias chain if required.
	(add_references_to_partition): Add references to pointer bounds vars.
	* dbxout.c (dbxout_type): Ignore POINTER_BOUNDS_TYPE.
	* dwarf2out.c (gen_subprogram_die): Ignore bound args.
	(gen_type_die_with_usage): Skip pointer bounds.
	(dwarf2out_global_decl): Likewise.
	(is_base_type): Support POINTER_BOUNDS_TYPE.
	(gen_formal_types_die): Skip pointer bounds.
	(gen_decl_die): Likewise.
	* var-tracking.c (vt_add_function_parameters): Skip
	bounds parameters.
	* ipa-icf.c (sem_function::merge): Do not merge when instrumentation
	thunk still exists.
	(sem_variable::merge): Reset need_bounds_init flag.
	* doc/extend.texi: Document Pointer Bounds Checker built-in functions
	and attributes.
	* doc/tm.texi.in (TARGET_LOAD_BOUNDS_FOR_ARG): New.
	(TARGET_STORE_BOUNDS_FOR_ARG): New.
	(TARGET_LOAD_RETURNED_BOUNDS): New.
	(TARGET_STORE_RETURNED_BOUNDS): New.
	(TARGET_CHKP_FUNCTION_VALUE_BOUNDS): New.
	(TARGET_SETUP_INCOMING_VARARG_BOUNDS): New.
	(TARGET_BUILTIN_CHKP_FUNCTION): New.
	(TARGET_CHKP_BOUND_TYPE): New.
	(TARGET_CHKP_BOUND_MODE): New.
	(TARGET_CHKP_MAKE_BOUNDS_CONSTANT): New.
	(TARGET_CHKP_INITIALIZE_BOUNDS): New.
	* doc/tm.texi: Regenerated.
	* doc/rtl.texi (MODE_POINTER_BOUNDS): New.
	(BND32mode): New.
	(BND64mode): New.
	* doc/invoke.texi (-mmpx): New.
	(-mno-mpx): New.
	(chkp-max-ctor-size): New.
	* config/i386/constraints.md (w): New.
	(Ti): New.
	(Tb): New.
	* config/i386/i386-c.c (ix86_target_macros_internal): Add __MPX__.
	* config/i386/i386-modes.def (BND32): New.
	(BND64): New.
	* config/i386/i386-protos.h (ix86_bnd_prefixed_insn_p): New.
	* config/i386/i386.c: Include tree-chkp.h, rtl-chkp.h, tree-iterator.h.
	(regclass_map): Add bound registers.
	(dbx_register_map): Likewise.
	(dbx64_register_map): Likewise.
	(svr4_dbx_register_map): Likewise.
	(isa_opts): Add -mmpx.
	(PTA_MPX): New.
	(ix86_option_override_internal): Support MPX ISA.
	(ix86_conditional_register_usage): Support bound registers.
	(ix86_code_end): Add MPX bnd prefix.
	(output_set_got): Likewise.
	(print_reg): Avoid prefixes for bound registers.
	(ix86_print_operand): Add '!' (MPX bnd) print prefix support.
	(ix86_print_operand_punct_valid_p): Likewise.
	(ix86_print_operand_address): Support UNSPEC_BNDMK_ADDR and
	UNSPEC_BNDLDX_ADDR.
	(ix86_output_call_insn): Add MPX bnd prefix to branch instructions.
	(ix86_class_likely_spilled_p): Add bound regs support.
	(ix86_hard_regno_mode_ok): Likewise.
	(x86_order_regs_for_local_alloc): Likewise.
	(ix86_bnd_prefixed_insn_p): New.
	(ix86_builtins): Add
	IX86_BUILTIN_BNDMK, IX86_BUILTIN_BNDSTX,
	IX86_BUILTIN_BNDLDX, IX86_BUILTIN_BNDCL,
	IX86_BUILTIN_BNDCU, IX86_BUILTIN_BNDRET,
	IX86_BUILTIN_BNDNARROW, IX86_BUILTIN_BNDINT,
	IX86_BUILTIN_SIZEOF, IX86_BUILTIN_BNDLOWER,
	IX86_BUILTIN_BNDUPPER.
	(builtin_isa): Add leaf_p and nothrow_p fields.
	(def_builtin): Initialize leaf_p and nothrow_p.
	(ix86_add_new_builtins): Handle leaf_p and nothrow_p
	flags.
	(bdesc_mpx): New.
	(bdesc_mpx_const): New.
	(ix86_init_mpx_builtins): New.
	(ix86_init_builtins): Call ix86_init_mpx_builtins.
	(ix86_emit_cmove): New.
	(ix86_emit_move_max): New.
	(ix86_expand_builtin): Expand IX86_BUILTIN_BNDMK,
	IX86_BUILTIN_BNDSTX, IX86_BUILTIN_BNDLDX,
	IX86_BUILTIN_BNDCL, IX86_BUILTIN_BNDCU,
	IX86_BUILTIN_BNDRET, IX86_BUILTIN_BNDNARROW,
	IX86_BUILTIN_BNDINT, IX86_BUILTIN_SIZEOF,
	IX86_BUILTIN_BNDLOWER, IX86_BUILTIN_BNDUPPER.
	(ix86_function_value_bounds): New.
	(ix86_builtin_mpx_function): New.
	(ix86_get_arg_address_for_bt): New.
	(ix86_load_bounds): New.
	(ix86_store_bounds): New.
	(ix86_load_returned_bounds): New.
	(ix86_store_returned_bounds): New.
	(ix86_mpx_bound_mode): New.
	(ix86_make_bounds_constant): New.
	(ix86_initialize_bounds):
	(TARGET_LOAD_BOUNDS_FOR_ARG): New.
	(TARGET_STORE_BOUNDS_FOR_ARG): New.
	(TARGET_LOAD_RETURNED_BOUNDS): New.
	(TARGET_STORE_RETURNED_BOUNDS): New.
	(TARGET_CHKP_BOUND_MODE): New.
	(TARGET_BUILTIN_CHKP_FUNCTION): New.
	(TARGET_CHKP_FUNCTION_VALUE_BOUNDS): New.
	(TARGET_CHKP_MAKE_BOUNDS_CONSTANT): New.
	(TARGET_CHKP_INITIALIZE_BOUNDS): New.
	(ix86_option_override_internal): Do not
	support x32 with MPX.
	(init_cumulative_args): Init stdarg, bnd_regno, bnds_in_bt
	and force_bnd_pass.
	(function_arg_advance_32): Return number of used integer
	registers.
	(function_arg_advance_64): Likewise.
	(function_arg_advance_ms_64): Likewise.
	(ix86_function_arg_advance): Handle pointer bounds.
	(ix86_function_arg): Likewise.
	(ix86_function_value_regno_p): Mark fisrt bounds registers as
	possible function value.
	(ix86_function_value_1): Handle pointer bounds type/mode
	(ix86_return_in_memory): Likewise.
	(ix86_print_operand): Analyse insn to decide abounf "bnd" prefix.
	(ix86_expand_call): Generate returned bounds.
	(ix86_setup_incoming_vararg_bounds): New.
	(ix86_va_start): Initialize bounds for pointers in va_list.
	(TARGET_SETUP_INCOMING_VARARG_BOUNDS): New.
	* config/i386/i386.h (TARGET_MPX): New.
	(TARGET_MPX_P): New.
	(FIRST_PSEUDO_REGISTER): Fix to new value.
	(FIXED_REGISTERS): Add bound registers.
	(CALL_USED_REGISTERS): Likewise.
	(REG_ALLOC_ORDER): Likewise.
	(HARD_REGNO_NREGS): Likewise.
	(VALID_BND_REG_MODE): New.
	(FIRST_BND_REG): New.
	(LAST_BND_REG): New.
	(reg_class): Add BND_REGS.
	(REG_CLASS_NAMES): Likewise.
	(REG_CLASS_CONTENTS): Likewise.
	(BND_REGNO_P): New.
	(ANY_BND_REG_P): New.
	(BNDmode): New.
	(HI_REGISTER_NAMES): Add bound registers.
	(ix86_args): Add bnd_regno, bnds_in_bt,	force_bnd_pass and
	stdarg fields.
	* config/i386/i386.md (UNSPEC_BNDMK): New.
	(UNSPEC_BNDMK_ADDR): New.
	(UNSPEC_BNDSTX): New.
	(UNSPEC_BNDLDX): New.
	(UNSPEC_BNDLDX_ADDR): New.
	(UNSPEC_BNDCL): New.
	(UNSPEC_BNDCU): New.
	(UNSPEC_BNDCN): New.
	(UNSPEC_MPX_FENCE): New.
	(UNSPEC_SIZEOF): New.
	(BND0_REG): New.
	(BND1_REG): New.
	(type): Add mpxmov, mpxmk, mpxchk, mpxld, mpxst.
	(length_immediate): Support mpxmov, mpxmk, mpxchk, mpxld, mpxst.
	(prefix_rep): Check for bnd prefix.
	(prefix_0f): Support mpxmov, mpxmk, mpxchk, mpxld, mpxst.
	(length_nobnd): New.
	(length): Use length_nobnd when specified.
	(memory): Support mpxmov, mpxmk, mpxchk, mpxld, mpxst.
	(BND): New.
	(bnd_ptr): New.
	(BNDCHECK): New.
	(bndcheck): New.
	(*jcc_1): Add MPX bnd prefix.
	(*jcc_2): Likewise.
	(jump): Likewise.
	(*indirect_jump): Likewise.
	(*tablejump_1): Likewise.
	(simple_return_internal): Likewise.
	(simple_return_internal_long): Likewise.
	(simple_return_pop_internal): Likewise.
	(simple_return_indirect_internal): Likewise.
	(<mode>_mk): New.
	(*<mode>_mk): New.
	(mov<mode>): New.
	(*mov<mode>_internal_mpx): New.
	(<mode>_<bndcheck>): New.
	(*<mode>_<bndcheck>): New.
	(<mode>_ldx): New.
	(*<mode>_ldx): New.
	(<mode>_stx): New.
	(*<mode>_stx): New.
	move_size_reloc_<mode>): New.
	* config/i386/predicates.md (address_mpx_no_base_operand): New.
	(address_mpx_no_index_operand): New.
	(bnd_mem_operator): New.
	(symbol_operand): New.
	(x86_64_immediate_size_operand): New.
	* config/i386/i386.opt (mmpx): New.
	* config/i386/i386-builtin-types.def (BND): New.
	(ULONG): New.
	(BND_FTYPE_PCVOID_ULONG): New.
	(VOID_FTYPE_BND_PCVOID): New.
	(VOID_FTYPE_PCVOID_PCVOID_BND): New.
	(BND_FTYPE_PCVOID_PCVOID): New.
	(BND_FTYPE_PCVOID): New.
	(BND_FTYPE_BND_BND): New.
	(PVOID_FTYPE_PVOID_PVOID_ULONG): New.
	(PVOID_FTYPE_PCVOID_BND_ULONG): New.
	(ULONG_FTYPE_VOID): New.
	(PVOID_FTYPE_BND): New.

gcc/testsuite/

2014-11-05  Ilya Enkovich  <ilya.enkovich@intel.com>

	* gcc.target/i386/chkp-builtins-1.c: New.
	* gcc.target/i386/chkp-builtins-2.c: New.
	* gcc.target/i386/chkp-builtins-3.c: New.
	* gcc.target/i386/chkp-builtins-4.c: New.
	* gcc.target/i386/chkp-remove-bndint-1.c: New.
	* gcc.target/i386/chkp-remove-bndint-2.c: New.
	* gcc.target/i386/chkp-const-check-1.c: New.
	* gcc.target/i386/chkp-const-check-2.c: New.
	* gcc.target/i386/chkp-lifetime-1.c: New.
	* gcc.dg/pr37858.c: Replace early_local_cleanups pass name
	with build_ssa_passes.

From-SVN: r217125
2014-11-05 12:42:03 +00:00
James Greenhalgh 7cbed00872 [Patch 1/7] Hookize *_BY_PIECES_P
gcc/

	* target.def (use_by_pieces_infrastructure_p): New.
	* doc/tm.texi.in (MOVE_BY_PIECES_P): Describe that this macro
	is deprecated.
	(STORE_BY_PIECES_P): Likewise.
	(CLEAR_BY_PIECES_P): Likewise.
	(SET_BY_PIECES_P): Likewise.
	(TARGET_MOVE_BY_PIECES_PROFITABLE_P): Add hook.
	* doc/tm.texi: Regenerate.
	* expr.c (MOVE_BY_PIECES_P): Rewrite in terms of
	TARGET_USE_BY_PIECES_INFRASTRUCTURE_P.
	(STORE_BY_PIECES_P): Likewise.
	(CLEAR_BY_PIECES_P): Likewise.
	(SET_BY_PIECES_P): Likewise.
	(STORE_MAX_PIECES): Move to...
	* defaults.h (STORE_MAX_PIECES): ...here.
	* targhooks.c (get_move_ratio): New.
	(default_use_by_pieces_infrastructure_p): Likewise.
	* targhooks.h (default_use_by_pieces_infrastructure_p): New.
	* target.h (by_pieces_operation): New.

From-SVN: r216996
2014-11-01 08:13:09 +00:00
Richard Sandiford ef4bddc299 decl.c, [...]: Remove redundant enum from machine_mode.
gcc/ada/
	* gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c,
	gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c:
	Remove redundant enum from machine_mode.

gcc/c-family/
	* c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant
	enum from machine_mode.

gcc/c/
	* c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from
	machine_mode.

gcc/cp/
	* constexpr.c: Remove redundant enum from machine_mode.

gcc/fortran/
	* trans-types.c, trans-types.h: Remove redundant enum from
	machine_mode.

gcc/go/
	* go-lang.c: Remove redundant enum from machine_mode.

gcc/java/
	* builtins.c, java-tree.h, typeck.c: Remove redundant enum from
	machine_mode.

gcc/lto/
	* lto-lang.c: Remove redundant enum from machine_mode.

gcc/
	* addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c,
	builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h,
	cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c,
	config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md,
	config/aarch64/aarch64.c, config/aarch64/aarch64.h,
	config/aarch64/aarch64.md, config/alpha/alpha-protos.h,
	config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c,
	config/arc/arc.h, config/arc/predicates.md,
	config/arm/aarch-common-protos.h, config/arm/aarch-common.c,
	config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h,
	config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md,
	config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c,
	config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c,
	config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md,
	config/cr16/cr16-protos.h, config/cr16/cr16.c,
	config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md,
	config/darwin-protos.h, config/darwin.c,
	config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c,
	config/epiphany/epiphany.md, config/fr30/fr30.c,
	config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md,
	config/h8300/h8300-protos.h, config/h8300/h8300.c,
	config/i386/i386-builtin-types.awk, config/i386/i386-protos.h,
	config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md,
	config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h,
	config/ia64/ia64.c, config/iq2000/iq2000-protos.h,
	config/iq2000/iq2000.c, config/iq2000/iq2000.md,
	config/lm32/lm32-protos.h, config/lm32/lm32.c,
	config/m32c/m32c-protos.h, config/m32c/m32c.c,
	config/m32r/m32r-protos.h, config/m32r/m32r.c,
	config/m68k/m68k-protos.h, config/m68k/m68k.c,
	config/mcore/mcore-protos.h, config/mcore/mcore.c,
	config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c,
	config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c,
	config/mips/mips-protos.h, config/mips/mips.c,
	config/mmix/mmix-protos.h, config/mmix/mmix.c,
	config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c,
	config/moxie/moxie.c, config/msp430/msp430-protos.h,
	config/msp430/msp430.c, config/nds32/nds32-cost.c,
	config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c,
	config/nds32/nds32-protos.h, config/nds32/nds32.c,
	config/nios2/nios2-protos.h, config/nios2/nios2.c,
	config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h,
	config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c,
	config/rs6000/altivec.md, config/rs6000/rs6000-c.c,
	config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c,
	config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c,
	config/s390/predicates.md, config/s390/s390-protos.h,
	config/s390/s390.c, config/s390/s390.h, config/s390/s390.md,
	config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c,
	config/sh/sh.md, config/sparc/predicates.md,
	config/sparc/sparc-protos.h, config/sparc/sparc.c,
	config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c,
	config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c,
	config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c,
	config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h,
	config/tilepro/tilepro.c, config/v850/v850-protos.h,
	config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h,
	config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h,
	config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h,
	dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi,
	doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c,
	dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h,
	except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c,
	fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h,
	fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c,
	genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c,
	graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c,
	internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c,
	ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h,
	libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c,
	loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c,
	lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c,
	lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h,
	output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h,
	recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c,
	regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h,
	rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c,
	sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c,
	simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def,
	targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c,
	tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c,
	tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c,
	tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c,
	tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c,
	tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c,
	tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c,
	tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c,
	tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c,
	tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c,
	var-tracking.c, varasm.c: Remove redundant enum from
	machine_mode.
gcc/
	* gengtype.c (main): Treat machine_mode as a scalar typedef.
	* genmodes.c (emit_insn_modes_h): Hide inline functions if
	USED_FOR_TARGET.

From-SVN: r216834
2014-10-29 12:02:45 +00:00
Kito Cheng f1717f8df9 Add header guard to several header files.
2014-09-19  Kito Cheng  <kito@0xlab.org>

	* except.h: Fix header guard.
	* addresses.h: Add missing header guard.
	* cfghooks.h: Likewise.
	* collect-utils.h: Likewise.
	* collect2-aix.h: Likewise.
	* conditions.h: Likewise.
	* cselib.h: Likewise.
	* dwarf2asm.h: Likewise.
	* graphds.h: Likewise.
	* graphite-scop-detection.h: Likewise.
	* gsyms.h: Likewise.
	* hw-doloop.h: Likewise.
	* incpath.h: Likewise.
	* ipa-inline.h: Likewise.
	* ipa-ref.h: Likewise.
	* ira-int.h: Likewise.
	* ira.h: Likewise.
	* lra-int.h: Likewise.
	* lra.h: Likewise.
	* lto-section-names.h: Likewise.
	* read-md.h: Likewise.
	* reload.h: Likewise.
	* rtl-error.h: Likewise.
	* sdbout.h: Likewise.
	* targhooks.h: Likewise.
	* tree-affine.h: Likewise.
	* xcoff.h: Likewise.
	* xcoffout.h: Likewise.

From-SVN: r215365
2014-09-18 23:34:23 +01:00
David Malcolm 9158a0d8c7 The various TARGET_ASM_..._MAX_SKIP hooks take an insn
gcc/ChangeLog:
	* config/rs6000/rs6000.c (rs6000_loop_align_max_skip): Strengthen
	param "label" from rtx to rtx_insn *.
	* config/rx/rx.c (rx_max_skip_for_label): Likewise for param "lab"
	and local "op".
	* doc/tm.texi (TARGET_ASM_JUMP_ALIGN_MAX_SKIP): Autogenerated changes.
	(TARGET_ASM_LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Likewise.
	(TARGET_ASM_LOOP_ALIGN_MAX_SKIP): Likewise.
	(TARGET_ASM_LABEL_ALIGN_MAX_SKIP): Likewise.
	* final.c (default_label_align_after_barrier_max_skip): Strengthen
	param from rtx to rtx_insn *.
	(default_loop_align_max_skip): Likewise.
	(default_label_align_max_skip): Likewise.
	(default_jump_align_max_skip): Likewise.
	* target.def (label_align_after_barrier_max_skip): Likewise.
	(loop_align_max_skip): Likewise.
	(label_align_max_skip): Likewise.
	(jump_align_max_skip): Likewise.
	* targhooks.h (default_label_align_after_barrier_max_skip):
	Likewise.
	(default_loop_align_max_skip): Likewise.
	(default_label_align_max_skip): Likewise.
	(default_jump_align_max_skip): Likewise.

From-SVN: r215270
2014-09-15 15:57:31 +00:00
Joseph Myers 8cc4b7a26d Remove LIBGCC2_HAS_?F_MODE target macros.
This patch removes the LIBGCC2_HAS_{SF,DF,XF,TF}_MODE target macros,
replacing them by predefines with -fbuilding-libgcc, together with a
target hook that can influence those predefines when needed.

The new default is that a floating-point mode is supported in libgcc
if (a) it passes the scalar_mode_supported_p hook (otherwise it's not
plausible for it to be supported in libgcc) and (b) it's one of those
four modes (since those are the modes for which libgcc hardcodes the
possibility of support).  The target hook can override the default
choice (in either direction) for modes that pass
scalar_mode_supported_p (although overriding in the direction of
returning true when the default would return false only makes sense if
all relevant functions are specially defined in libgcc for that
particular target).

The previous default settings depended on various settings such as
LIBGCC2_LONG_DOUBLE_TYPE_SIZE, as well as targets defining the above
target macros if the default wasn't correct.

The default scalar_mode_supported_p only declares a floating-point
mode to be supported if it matches one of float / double / long
double.  This means that in most cases where a mode is only supported
conditionally in libgcc (TFmode only supported if it's the mode of
long double, most commonly), the default gets things right.  Overrides
were needed in the following cases:

* SFmode would always have been supported in libgcc (the condition was
  BITS_PER_UNIT == 8, true for all current targets), but pdp11
  defaults to 64-bit float, and in that case SFmode would fail
  scalar_mode_supported_p.  I don't know if libgcc actually built for
  pdp11 (and the port may well no longer be being used), but this
  patch adds a scalar_mode_supported_p hook to it to ensure SFmode is
  treated as supported.

* Certain i386 and ia64 targets need the new hook to match the
  existing cases for when XFmode or TFmode support is present in
  libgcc.  For i386, the hook can always declare XFmode to be
  supported - the cases where it's not are the cases where long double
  is TFmode, in which case XFmode fails scalar_mode_supported_p[*] -
  but TFmode support needs to be conditional.  (And of the targets not
  defining LIBGCC2_HAS_TF_MODE before this patch, some defined
  LONG_DOUBLE_TYPE_SIZE to 64, so ensuring LIBGCC2_HAS_TF_MODE would
  always be false, while others did not define it, so allowing it to
  be true in the -mlong-double-128 case.  This patch matches that
  logic, although I suspect all the latter targets would have been
  broken if you tried to enable -mlong-double-128 by default, for lack
  of the soft-fp TFmode support in libgcc, which is separately
  configured.)

  [*] I don't know if it's deliberate not to support __float80 at all
  with -mlong-double-128.

In order to implement the default version of the new hook,
insn-modes.h was made to contain macros such as HAVE_TFmode for each
machine mode, so the default hook can contain conditionals on whether
XFmode and TFmode exist (to match the hardcoding of a list of modes in
libgcc).  This is also used in fortran/trans-types.c; previously it
had a conditional on defined(LIBGCC2_HAS_TF_MODE) (a bit dubious,
since it ignored the value of the macro), which is replaced by testing
defined(HAVE_TFmode), in conjunction with requiring
targetm.libgcc_floating_mode_supported_p.

(Fortran is testing something stronger than that hook: not only is
libgcc support required, but also libm or equivalent.  Thus, it has a
test for ENABLE_LIBQUADMATH_SUPPORT in the case that the mode is
TFmode and that's not the same as any of the three standard types.
The old and new tests are intended to accept exactly the same set of
modes for all targets.)

Apart from the four target macros eliminated by this patch, it gets us
closer to eliminating LIBGCC2_LONG_DOUBLE_TYPE_SIZE as well, though a
few more places using that macro need changing first.

Bootstrapped with no regressions on x86_64-unknown-linux-gnu; also
built cc1 for crosses to ia64-elf and pdp11-none as a minimal test of
changes for those targets.

gcc:
	* target.def (libgcc_floating_mode_supported_p): New hook.
	* targhooks.c (default_libgcc_floating_mode_supported_p): New
	function.
	* targhooks.h (default_libgcc_floating_mode_supported_p): Declare.
	* doc/tm.texi.in (LIBGCC2_HAS_DF_MODE, LIBGCC2_HAS_XF_MODE)
	(LIBGCC2_HAS_TF_MODE): Remove.
	(TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P): New @hook.
	* doc/tm.texi: Regenerate.
	* genmodes.c (emit_insn_modes_h): Define HAVE_%smode for each
	machine mode.
	* system.h (LIBGCC2_HAS_SF_MODE, LIBGCC2_HAS_DF_MODE)
	(LIBGCC2_HAS_XF_MODE, LIBGCC2_HAS_TF_MODE): Poison.
	* config/i386/cygming.h (LIBGCC2_HAS_TF_MODE): Remove.
	* config/i386/darwin.h (LIBGCC2_HAS_TF_MODE): Remove.
	* config/i386/djgpp.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define.
	* config/i386/dragonfly.h (LIBGCC2_HAS_TF_MODE): Remove.
	* config/i386/freebsd.h (LIBGCC2_HAS_TF_MODE): Remove.
	* config/i386/gnu-user-common.h (LIBGCC2_HAS_TF_MODE): Remove.
	* config/i386/i386-interix.h (IX86_NO_LIBGCC_TFMODE): Define.
	* config/i386/i386.c (ix86_libgcc_floating_mode_supported_p): New
	function.
	(TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P): Define.
	* config/i386/i386elf.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define.
	* config/i386/lynx.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define.
	* config/i386/netbsd-elf.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define.
	* config/i386/netbsd64.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define.
	* config/i386/nto.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define.
	* config/i386/openbsd.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define.
	* config/i386/openbsdelf.h (LIBGCC2_HAS_TF_MODE): Remove.
	* config/i386/rtemself.h (IX86_NO_LIBGCC_TFMODE): Define.
	* config/i386/sol2.h (LIBGCC2_HAS_TF_MODE): Remove.
	* config/i386/vx-common.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define.
	* config/ia64/elf.h (IA64_NO_LIBGCC_TFMODE): Define.
	* config/ia64/freebsd.h (IA64_NO_LIBGCC_TFMODE): Define.
	* config/ia64/hpux.h (LIBGCC2_HAS_XF_MODE, LIBGCC2_HAS_TF_MODE):
	Remove.
	* config/ia64/ia64.c (TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P):
	New macro.
	(ia64_libgcc_floating_mode_supported_p): New function.
	* config/ia64/linux.h (LIBGCC2_HAS_TF_MODE): Remove.
	* config/ia64/vms.h (IA64_NO_LIBGCC_XFMODE)
	(IA64_NO_LIBGCC_TFMODE): Define.
	* config/msp430/msp430.h (LIBGCC2_HAS_DF_MODE): Remove.
	* config/pdp11/pdp11.c (TARGET_SCALAR_MODE_SUPPORTED_P): New
	macro.
	(pdp11_scalar_mode_supported_p): New function.
	* config/rl78/rl78.h (LIBGCC2_HAS_DF_MODE): Remove.
	* config/rx/rx.h (LIBGCC2_HAS_DF_MODE): Remove.

gcc/c-family:
	* c-cppbuiltin.c (c_cpp_builtins): Define __LIBGCC_HAS_%s_MODE__
	macros for floating-point modes.

gcc/fortran:
	* trans-types.c (gfc_init_kinds): Check
	targetm.libgcc_floating_mode_supported_p for floating-point
	modes.  Check HAVE_TFmode instead of LIBGCC2_HAS_TF_MODE.

libgcc:
	* libgcc2.h (LIBGCC2_HAS_SF_MODE): Define using
	__LIBGCC_HAS_SF_MODE__.
	(LIBGCC2_HAS_DF_MODE): Define using __LIBGCC_HAS_DF_MODE__.
	(LIBGCC2_HAS_XF_MODE): Define using __LIBGCC_HAS_XF_MODE__.
	(LIBGCC2_HAS_TF_MODE): Define using __LIBGCC_HAS_TF_MODE__.
	* config/libbid/bid_gcc_intrinsics.h
	(LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Do not define.
	(LIBGCC2_HAS_XF_MODE): Define using __LIBGCC_HAS_XF_MODE__.
	(LIBGCC2_HAS_TF_MODE): Define using __LIBGCC_HAS_TF_MODE__.
	* fixed-bit.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Do not define.
	(LIBGCC2_HAS_SF_MODE): Define using __LIBGCC_HAS_SF_MODE__.
	(LIBGCC2_HAS_DF_MODE): Define using __LIBGCC_HAS_DF_MODE__.

From-SVN: r215215
2014-09-12 13:05:18 +01:00
Matthew Fortune ff050c66b1 Add target hook to override DWARF2 frame register size
gcc/

	* target.def (TARGET_DWARF_FRAME_REG_MODE): New target hook.
	* targhooks.c (default_dwarf_frame_reg_mode): New function.
	* targhooks.h (default_dwarf_frame_reg_mode): New prototype.
	* doc/tm.texi.in (TARGET_DWARF_FRAME_REG_MODE): Document.
	* doc/tm.texi: Regenerate.
	* dwarf2cfi.c (expand_builtin_init_dwarf_reg_sizes): Abstract mode
	selection logic to default_dwarf_frame_reg_mode.

From-SVN: r214898
2014-09-04 08:32:05 +00:00
David Malcolm ac44248e6a Use rtx_insn for various target.def hooks
gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

	* target.def (unwind_emit): Strengthen param "insn" from rtx to
	rtx_insn *.
	(final_postscan_insn): Likewise.
	(adjust_cost): Likewise.
	(adjust_priority): Likewise.
	(variable_issue): Likewise.
	(macro_fusion_pair_p): Likewise.
	(dfa_post_cycle_insn): Likewise.
	(first_cycle_multipass_dfa_lookahead_guard): Likewise.
	(first_cycle_multipass_issue): Likewise.
	(dfa_new_cycle): Likewise.
	(adjust_cost_2): Likewise for params "insn" and "dep_insn".
	(speculate_insn): Likewise for param "insn".
	(gen_spec_check): Likewise for params "insn" and "label".
	(get_insn_spec_ds): Likewise for param "insn".
	(get_insn_checked_ds): Likewise.
	(dispatch_do): Likewise.
	(dispatch): Likewise.
	(cannot_copy_insn_p): Likewise.
	(invalid_within_doloop): Likewise.
	(legitimate_combined_insn): Likewise.
	(needed): Likewise.
	(after): Likewise.

	* doc/tm.texi: Automatically updated to reflect changes to
	target.def.

	* haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when
	working with insn.
	(schedule_block): Likewise.
	(sched_init): Likewise.
	(sched_speculate_insn): Strengthen param "insn" from rtx to
	rtx_insn *.
	(ready_remove_first_dispatch): Convert NULL_RTX to NULL when
	working with insn.
	* hooks.c (hook_bool_rtx_true): Rename to...
	hook_bool_rtx_insn_true): ...this, and strengthen first param from
	rtx to rtx_insn *.
	(hook_constcharptr_const_rtx_null): Rename to...
	(hook_constcharptr_const_rtx_insn_null): ...this, and strengthen
	first param from const_rtx to const rtx_insn *.
	(hook_bool_rtx_int_false): Rename to...
	(hook_bool_rtx_insn_int_false): ...this, and strengthen first
	param from rtx to rtx_insn *.
	(hook_void_rtx_int): Rename to...
	(hook_void_rtx_insn_int): ...this, and strengthen first param from
	rtx to rtx_insn *.

	* hooks.h (hook_bool_rtx_true): Rename to...
	(hook_bool_rtx_insn_true): ...this, and strengthen first param from
	rtx to rtx_insn *.
	(hook_bool_rtx_int_false): Rename to...
	(hook_bool_rtx_insn_int_false): ...this, and strengthen first
	param from rtx to rtx_insn *.
	(hook_void_rtx_int): Rename to...
	(hook_void_rtx_insn_int): ...this, and strengthen first param from
	rtx to rtx_insn *.
	(hook_constcharptr_const_rtx_null): Rename to...
	(hook_constcharptr_const_rtx_insn_null): ...this, and strengthen
	first param from const_rtx to const rtx_insn *.

	* sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn"
	and local "prev" from rtx to rtx_insn *.

	* sched-int.h (sched_speculate_insn): Strengthen first param from
	rtx to rtx_insn *.

	* sel-sched.c (create_speculation_check): Likewise for local "label".
	* targhooks.c (default_invalid_within_doloop): Strengthen param
	"insn" from const_rtx to const rtx_insn *.
	* targhooks.h (default_invalid_within_doloop): Strengthen param
	from const_rtx to const rtx_insn *.

	* config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise.
	(alpha_adjust_cost): Likewise for params "insn", "dep_insn".

	* config/arc/arc.c (arc_sched_adjust_priority): Likewise for param
	"insn".
	(arc_invalid_within_doloop): Likewise, with const.

	* config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep".
	(arm_cannot_copy_insn_p): Likewise for param "insn".
	(arm_unwind_emit): Likewise.

	* config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn",
	"dep_insn".

	* config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn".
	(c6x_variable_issue): Likewise.  Removed now-redundant checked
	cast.
	(c6x_adjust_cost): Likewise for params "insn", "dep_insn".

	* config/epiphany/epiphany-protos.h (epiphany_mode_needed):
	Likewise for param "insn".
	(epiphany_mode_after): Likewise.
	* config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for
	params "insn", "dep_insn".
	(epiphany_mode_needed): Likewise for param "insn".
	(epiphany_mode_after): Likewise.

	* config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise.
	* config/i386/i386.c (ix86_legitimate_combined_insn): Likewise.
	(ix86_avx_u128_mode_needed): Likewise.
	(ix86_i387_mode_needed): Likewise.
	(ix86_mode_needed): Likewise.
	(ix86_avx_u128_mode_after): Likewise.
	(ix86_mode_after): Likewise.
	(ix86_adjust_cost): Likewise for params "insn", "dep_insn".
	(ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp".
	(ix86_adjust_priority): Likewise for param "insn".
	(core2i7_first_cycle_multipass_issue): Likewise for param "insn".
	(do_dispatch): Likewise.
	(has_dispatch): Likewise.
	* config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise.

	* config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to
	reflect renaming of default hook implementation from
	hook_constcharptr_const_rtx_null to
	hook_constcharptr_const_rtx_insn_null.
	(ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from
	rtx to rtx_insn *.
	(ia64_variable_issue): Likewise for param "insn".
	(ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise.
	(ia64_dfa_new_cycle): Likewise.
	(ia64_get_insn_spec_ds): Likewise.
	(ia64_get_insn_checked_ds): Likewise.
	(ia64_speculate_insn): Likewise.
	(ia64_gen_spec_check): Likewise for params "insn", "label".
	(ia64_asm_unwind_emit): Likewise for param "insn".

	* config/m32r/m32r.c (m32r_adjust_priority): Likewise.

	* config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params
	"insn", "def_insn".
	(m68k_sched_variable_issue): Likewise for param "insn".

	* config/mep/mep.c (mep_adjust_cost): Likewise for params "insn",
	"def_insn".

	* config/microblaze/microblaze.c (microblaze_adjust_cost):
	Likewise for params "insn", "dep".

	* config/mips/mips.c (mips_adjust_cost): Likewise.
	(mips_variable_issue): Likewise for param "insn".
	(mips_final_postscan_insn): Likewise.

	* config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise
	for params "insn", "dep".

	* config/pa/pa.c (pa_adjust_cost): Likewise for params "insn",
	"dep_insn".
	(pa_adjust_priority): Likewise for param "insn".

	* config/picochip/picochip.c (picochip_sched_adjust_cost):
	Likewise for params "insn", "dep_insn".

	* config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for
	param "insn".
	(rs6000_variable_issue): Likewise.
	(rs6000_adjust_cost): Likewise for params "insn", "dep_insn".
	(rs6000_debug_adjust_cost): Likewise.
	(rs6000_adjust_priority): Likewise for param "insn".
	(rs6000_use_sched_lookahead_guard): Likewise.
	(get_next_active_insn): Likewise for return type and both params.
	(redefine_groups): Likewise for params "prev_head_insn", "tail"
	and locals "insn", "next_insn".
	(pad_groups): Likewise.

	* config/s390/s390.c (s390_adjust_priority): Likewise for param
	"insn".
	(s390_cannot_copy_insn_p): Likewise.
	(s390_sched_variable_issue): Likewise for third param, eliminating
	checked cast.
	(TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of
	default hook implementation from hook_constcharptr_const_rtx_null
	to hook_constcharptr_const_rtx_insn_null.

	* config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn"
	from rtx to rtx_insn *.
	(sh_adjust_cost): Likewise for params "insn", "dep_insn".
	(sh_variable_issue): Likewise for param "insn".
	(sh_dfa_new_cycle): Likewise.
	(sh_mode_needed): Likewise.
	(sh_mode_after): Likewise.

	* config/sparc/sparc.c (supersparc_adjust_cost): Likewise for
	params "insn", "dep_insn".
	(hypersparc_adjust_cost): Likewise.
	(sparc_adjust_cost): Likewise.

	* config/spu/spu.c (spu_sched_variable_issue): Likewise for third
	param, eliminated checked cast.
	(spu_sched_adjust_cost): Likewise for first and third params.

	* config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen
	params "insn" and "dep_insn" from rtx to rtx_insn *.

	* config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise.

From-SVN: r214584
2014-08-27 19:34:13 +00:00
Kenneth Zadeck 807e902eea Merge in wide-int.
From-SVN: r210113
2014-05-06 16:25:05 +00:00
Andreas Krebbel d56a43a0e0 target.def: Add new target hook.
2014-05-05  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* target.def: Add new target hook.
	* doc/tm.texi: Regenerate.
	* targhooks.h (default_keep_leaf_when_profiled): Add prototype.
	* targhooks.c (default_keep_leaf_when_profiled): New function.

	* config/s390/s390.c (s390_keep_leaf_when_profiled): New function.
	(TARGET_KEEP_LEAF_WHEN_PROFILED): Define.

2014-05-05  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* gcc.target/s390/leaf-profile.c: New testcase.

From-SVN: r210061
2014-05-05 07:55:26 +00:00
Richard Sandiford 23a5b65a92 Update copyright years in gcc/
From-SVN: r206289
2014-01-02 22:23:26 +00:00
Oleg Endo 84562394e2 cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef.
* gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator):
	Remove typedef.
	(cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and
	rename to cgraph_inline_failed_t.
	* gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename
	to ao_ref.
	* gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename
	to reg_equivs_t.
	* gcc/conditions.h (CC_STATUS): Remove typedef.
	* gcc/bitmap.h (bitmap_obstack): Remove typedef.
	(bitmap_element_def, bitmap_element): Remove typedef and rename to
	bitmap_element.
	(bitmap_head_def, bitmap_head): Remove typedef and rename to
	bitmap_head.
	(bitmap_iterator): Remove typedef.
	* gcc/target.h (cumulative_args_t, print_switch_type,
	secondary_reload_info): Remove typedef.
	* gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove
	dw_cfi_oprnd_struct alias.
	(dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node.
	(dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node.
	(cfa_loc, dw_cfa_location): Remove typedef and rename to
	dw_cfa_location.
	(dw_vec_struct, dw_vec_const): Remove typedef and rename to
	dw_vec_const.
	(dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node.
	(dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to
	dw_loc_descr_node.
	* gcc/params.h (param_info, compiler_param): Remove typedef.
	* gcc/opts.h (cl_deferred_param): Remove typedef.
	* gcc/sreal.h (sreal): Remove typedef.
	* gcc/ddg.h (dep_type, dep_data_type): Remove typedef.
	* gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove
	typedef.
	* gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry,
	lto_symtab_encoder_iterator, res_pair): Remove typedef.
	* gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef
	and rename to aff_tree.
	* gcc/sched-int.h (region): Remove typedef.
	* gcc/diagnostic.h (diagnostic_info,
	diagnostic_classification_change_t): Remove typedef.
	* gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to
	affine_iv.
	* gcc/sbitmap.h (sbitmap_iterator): Remove typedef.
	* gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator):
	Remove typedef and rename to imm_use_iterator.
	(ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to
	ssa_op_iter.
	* gcc/ggc-internal.h (ggc_statistics): Remove typedef.
	* gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and
	rename to cselib_val.
	* gcc/tree-core.h (alias_pair): Remove typedef.
	(constructor_elt_d, constructor_elt): Remove typedef and rename to
	constructor_elt.
	(ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to
	ssa_use_operand_t.
	* gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef.
	* gcc/tree-data-ref.h (conflict_function): Remove typedef.
	* gcc/tree-inline.h (copy_body_data): Remove typedef.
	* gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t,
	edge_growth_cache_entry): Remove typedef.
	* gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef.
	* gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator):
	Remove typedef and rename to gimple_stmt_iterator.
	* gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and
	rename to ce_if_block.
	(edge_iterator): Remove typedef.
	* gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef
	and rename to ipa_agg_jf_item.
	(ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t,
	ipa_parm_adjustment_t): Remove typedef.
	(ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to
	ipa_jump_func.
	(ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to
	ipa_edge_args.
	* gcc/gcov-io.h (gcov_bucket_type): Remove typedef.
	(gcov_working_set_info, gcov_working_set_t): Remove typedef and rename
	to gcov_working_set_t.
	* gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator,
	ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator,
	ira_copy_iterator, ira_object_conflict_iterator): Remove typedef.
	* gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef.
	* gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs,
	replace_label_data): Remove typedef.
	(rtunion_def, rtunion): Remove typedef and rename to rtunion.
	* gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef.
	* gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def,
	sel_region_bb_info_def, succ_iterator): Remove typedef.
	(deps_where_def, deps_where_t): Remove typedef and rename to
	deps_where_t.
	* gcc/coretypes.h: Adapt forward declarations.
	* gcc/tree-scalar-evolution.h: Likewise.
	* gcc/tree-ssa-address.h: Likewise.
	* gcc/tree-ssa-operands.h: Likewise.
	* gcc/function.h: Likewise.
	* gcc/config/frv/frv-protos.h: Likewise.
	* gcc/targhooks.h: Likewise.
	* gcc/basic_block.h: Likewise.
	* gcc/rtl.def: Adapt documentation.
	* gcc/doc/tm.texi: Likewise.
	* gcc/ipa-cp.c: Adapt uses.
	* gcc/bitmap.c: Likewise.
	* gcc/dwarf2out.c: Likewise.
	* gcc/target.def: Likewise.
	* gcc/ipa-inline-analysis.c: Likewise.
	* gcc/dwarf2cfi.c: Likewise.
	* gcc/tree-ssa-loop-ivopts.c: Likewise.
	* gcc/lto-cgraph.c: Likewise.
	* gcc/config/frv/frv.c: Likewise.
	* gcc/ifcvt.c: Likewise.
	* gcc/ipa-prop.c: Likewise.

From-SVN: r205863
2013-12-10 16:48:44 +00:00
Ilya Enkovich 089d122746 revert: cgraph.h (varpool_node): Add need_bounds_init field.
Reverted:
	2013-11-20  Ilya Enkovich  <ilya.enkovich@intel.com>
	* cgraph.h (varpool_node): Add need_bounds_init field.
	* lto-cgraph.c (lto_output_varpool_node): Output
	need_bounds_init value.
	(input_varpool_node): Read need_bounds_init value.
	* varpool.c (dump_varpool_node): Dump need_bounds_init field.

	Reverted:
	2013-11-20  Ilya Enkovich  <ilya.enkovich@intel.com>
	* dbxout.c (dbxout_type): Ignore POINTER_BOUNDS_TYPE.
	* dwarf2out.c (gen_subprogram_die): Ignore bound args.
	(gen_type_die_with_usage): Skip pointer bounds.
	(dwarf2out_global_decl): Likewise.

	Reverted:
	2013-11-18  Ilya Enkovich  <ilya.enkovich@intel.com>
	* builtin-types.def (BT_FN_PTR_CONST_PTR_VAR): New.
	* chkp-builtins.def (BUILT_IN_CHKP_BIND_BOUNDS): New.
	* cfgexpand.c (expand_call_stmt): Expand BUILT_IN_CHKP_BIND_BOUNDS.
	* gimple.c (gimple_call_get_nobnd_arg_index): Remove.
	* gimple.h (gf_mask): Add GF_CALL_WITH_BOUNDS.
	(gimple_call_with_bounds_p): New.
	(gimple_call_set_with_bounds): New.
	(gimple_call_num_nobnd_args): Remove.
	(gimple_call_nobnd_arg): Remove.
	* tree.h (CALL_WITH_BOUNDS_P): New.
	* rtl.h (CALL_EXPR_WITH_BOUNDS_P): New.

	Reverted:
	2013-11-08  Ilya Enkovich  <ilya.enkovich@intel.com>
	* common.opt (fcheck-pointer-bounds): Move to ...
	* c-family/c.opt: ... here.
	* langhooks-def.h (LANG_HOOKS_CHKP_SUPPORTED): Remove.
	(LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_CHKP_SUPPORTED.
	* langhooks.h (lang_hooks): Remove chkp_supported field.
	* toplev.c (process_options): Remove chkp_supported check.

	Reverted:
	2013-10-30  Ilya Enkovich  <ilya.enkovich@intel.com>
	* tree-core.h (tree_index): Add TI_POINTER_BOUNDS_TYPE.
	* tree.h (POINTER_BOUNDS_P): New.
	(BOUNDED_TYPE_P): New.
	(BOUNDED_P): New.
	(pointer_bounds_type_node): New.
	* tree.c (build_common_tree_nodes): Initialize
	pointer_bounds_type_node.
	* gimple.h (gimple_call_get_nobnd_arg_index): New.
	(gimple_call_num_nobnd_args): New.
	(gimple_call_nobnd_arg): New.
	(gimple_return_retbnd): New.
	(gimple_return_set_retbnd): New
	* gimple.c (gimple_build_return): Increase number of ops
	for return statement.
	(gimple_call_get_nobnd_arg_index): New.
	* gimple-pretty-print.c (dump_gimple_return): Print second op.

	Reverted:
	2013-10-30  Ilya Enkovich  <ilya.enkovich@intel.com>
	* ipa.c (cgraph_build_static_cdtor_1): Support contructors
	with "chkp ctor" and "bnd_legacy" attributes.
	* gimplify.c (gimplify_init_constructor): Avoid infinite
	loop during gimplification of bounds initializer.

	Reverted:
	2013-10-30  Ilya Enkovich  <ilya.enkovich@intel.com>
	* c-family/c-common.c (handle_bnd_variable_size_attribute): New.
	(handle_bnd_legacy): New.
	(c_common_attribute_table): Add bnd_variable_size and bnd_legacy.
	* doc/extend.texi: Document bnd_variable_size and bnd_legacy
	attributes.

	Reverted:
	2013-10-29  Ilya Enkovich  <ilya.enkovich@intel.com>
	* builtin-types.def (BT_FN_VOID_CONST_PTR): New.
	(BT_FN_PTR_CONST_PTR): New.
	(BT_FN_CONST_PTR_CONST_PTR): New.
	(BT_FN_PTR_CONST_PTR_SIZE): New.
	(BT_FN_PTR_CONST_PTR_CONST_PTR): New.
	(BT_FN_VOID_PTRPTR_CONST_PTR): New.
	(BT_FN_VOID_CONST_PTR_SIZE): New.
	(BT_FN_PTR_CONST_PTR_CONST_PTR_SIZE): New.
	* chkp-builtins.def: New.
	* builtins.def: include chkp-builtins.def.
	(DEF_CHKP_BUILTIN): New.
	* builtins.c (expand_builtin): Support BUILT_IN_CHKP_INIT_PTR_BOUNDS,
	BUILT_IN_CHKP_NULL_PTR_BOUNDS, BUILT_IN_CHKP_COPY_PTR_BOUNDS,
	BUILT_IN_CHKP_CHECK_PTR_LBOUNDS, BUILT_IN_CHKP_CHECK_PTR_UBOUNDS,
	BUILT_IN_CHKP_CHECK_PTR_BOUNDS, BUILT_IN_CHKP_SET_PTR_BOUNDS,
	BUILT_IN_CHKP_NARROW_PTR_BOUNDS, BUILT_IN_CHKP_STORE_PTR_BOUNDS,
	BUILT_IN_CHKP_GET_PTR_LBOUND, BUILT_IN_CHKP_GET_PTR_UBOUND,
	BUILT_IN_CHKP_BNDMK, BUILT_IN_CHKP_BNDSTX, BUILT_IN_CHKP_BNDCL,
	BUILT_IN_CHKP_BNDCU, BUILT_IN_CHKP_BNDLDX, BUILT_IN_CHKP_BNDRET,
	BUILT_IN_CHKP_INTERSECT, BUILT_IN_CHKP_ARG_BND, BUILT_IN_CHKP_NARROW,
	BUILT_IN_CHKP_EXTRACT_LOWER, BUILT_IN_CHKP_EXTRACT_UPPER.
	* common.opt (fcheck-pointer-bounds): New.
	* toplev.c (process_options): Check Pointer Bounds Checker is
	supported.
	* doc/extend.texi: Document Pointer Bounds Checker built-in functions.

	Reverted:
	2013-10-30  Ilya Enkovich  <ilya.enkovich@intel.com>
	* target.def (builtin_chkp_function): New.
	(chkp_bound_type): New.
	(chkp_bound_mode): New.
	(fn_abi_va_list_bounds_size): New.
	(load_bounds_for_arg): New.
	(store_bounds_for_arg): New.
	* targhooks.h (default_load_bounds_for_arg): New.
	(default_store_bounds_for_arg): New.
	(default_fn_abi_va_list_bounds_size): New.
	(default_chkp_bound_type): New.
	(default_chkp_bound_mode): New.
	(default_builtin_chkp_function): New.
	* targhooks.c (default_load_bounds_for_arg): New.
	(default_store_bounds_for_arg): New.
	(default_fn_abi_va_list_bounds_size): New.
	(default_chkp_bound_type): New.
	(default_chkp_bound_mode); New.
	(default_builtin_chkp_function): New.
	* doc/tm.texi.in (TARGET_FN_ABI_VA_LIST_BOUNDS_SIZE): New.
	(TARGET_LOAD_BOUNDS_FOR_ARG): New.
	(TARGET_STORE_BOUNDS_FOR_ARG): New.
	(TARGET_BUILTIN_CHKP_FUNCTION): New.
	(TARGET_CHKP_BOUND_TYPE): New.
	(TARGET_CHKP_BOUND_MODE): New.
	* doc/tm.texi: Regenerated.
	* langhooks.h (lang_hooks): Add chkp_supported field.
	* langhooks-def.h (LANG_HOOKS_CHKP_SUPPORTED): New.
	(LANG_HOOKS_INITIALIZER); Add LANG_HOOKS_CHKP_SUPPORTED.

	Reverted:
	2013-10-24  Ilya Enkovich  <ilya.enkovich@intel.com>
	* config/i386/constraints.md (B): New.
	(Ti): New.
	(Tb): New.
	* config/i386/i386-c.c (ix86_target_macros_internal): Add __MPX__.
	* config/i386/i386-modes.def (BND32): New.
	(BND64): New.
	* config/i386/i386-protos.h (ix86_bnd_prefixed_insn_p): New.
	* config/i386/i386.c (isa_opts): Add mmpx.
	(regclass_map): Add bound registers.
	(dbx_register_map): Likewise.
	(dbx64_register_map): Likewise.
	(svr4_dbx_register_map): Likewise.
	(PTA_MPX): New.
	(ix86_option_override_internal): Support MPX ISA.
	(ix86_conditional_register_usage): Support bound registers.
	(print_reg): Likewise.
	(ix86_code_end): Add MPX bnd prefix.
	(output_set_got): Likewise.
	(ix86_output_call_insn): Likewise.
	(ix86_print_operand): Add '!' (MPX bnd) print prefix support.
	(ix86_print_operand_punct_valid_p): Likewise.
	(ix86_print_operand_address): Support UNSPEC_BNDMK_ADDR and
	UNSPEC_BNDMK_ADDR.
	(ix86_class_likely_spilled_p): Add bound regs support.
	(ix86_hard_regno_mode_ok): Likewise.
	(x86_order_regs_for_local_alloc): Likewise.
	(ix86_bnd_prefixed_insn_p): New.
	* config/i386/i386.h (FIRST_PSEUDO_REGISTER): Fix to new value.
	(FIXED_REGISTERS): Add bound registers.
	(CALL_USED_REGISTERS): Likewise.
	(REG_ALLOC_ORDER): Likewise.
	(HARD_REGNO_NREGS): Likewise.
	(TARGET_MPX): New.
	(VALID_BND_REG_MODE): New.
	(FIRST_BND_REG): New.
	(LAST_BND_REG): New.
	(reg_class): Add BND_REGS.
	(REG_CLASS_NAMES): Likewise.
	(REG_CLASS_CONTENTS): Likewise.
	(BND_REGNO_P): New.
	(ANY_BND_REG_P): New.
	(BNDmode): New.
	(HI_REGISTER_NAMES): Add bound registers.
	* config/i386/i386.md (UNSPEC_BNDMK): New.
	(UNSPEC_BNDMK_ADDR): New.
	(UNSPEC_BNDSTX): New.
	(UNSPEC_BNDLDX): New.
	(UNSPEC_BNDLDX_ADDR): New.
	(UNSPEC_BNDCL): New.
	(UNSPEC_BNDCU): New.
	(UNSPEC_BNDCN): New.
	(UNSPEC_MPX_FENCE): New.
	(BND0_REG): New.
	(BND1_REG): New.
	(type): Add mpxmov, mpxmk, mpxchk, mpxld, mpxst.
	(length_immediate): Likewise.
	(prefix_0f): Likewise.
	(memory): Likewise.
	(prefix_rep): Check for bnd prefix.
	(length_nobnd): New.
	(length): Use length_nobnd if specified.
	(BND): New.
	(bnd_ptr): New.
	(BNDCHECK): New.
	(bndcheck): New.
	(*jcc_1): Add bnd prefix and rename length attr to length_nobnd.
	(*jcc_2): Likewise.
	(jump): Likewise.
	(simple_return_internal): Likewise.
	(simple_return_pop_internal): Likewise.
	(*indirect_jump): Add MPX bnd prefix.
	(*tablejump_1): Likewise.
	(simple_return_internal_long): Likewise.
	(simple_return_indirect_internal): Likewise.
	(<mode>_mk): New.
	(*<mode>_mk): New.
	(mov<mode>): New.
	(*mov<mode>_internal_mpx): New.
	(<mode>_<bndcheck>): New.
	(*<mode>_<bndcheck>): New.
	(<mode>_ldx): New.
	(*<mode>_ldx): New.
	(<mode>_stx): New.
	(*<mode>_stx): New.
	* config/i386/predicates.md (lea_address_operand): Rename to...
	(address_no_seg_operand): ... this.
	(address_mpx_no_base_operand): New.
	(address_mpx_no_index_operand): New.
	(bnd_mem_operator): New.
	* config/i386/i386.opt (mmpx): New.
	* doc/invoke.texi: Add documentation for the flags -mmpx, -mno-mpx.
	* doc/rtl.texi Add documentation for BND32mode and BND64mode.

	Reverted:
	2013-10-24  Ilya Enkovich  <ilya.enkovich@intel.com>
	* mode-classes.def (MODE_POINTER_BOUNDS): New.
	* tree.def (POINTER_BOUNDS_TYPE): New.
	* genmodes.c (complete_mode): Support MODE_POINTER_BOUNDS.
	(POINTER_BOUNDS_MODE): New.
	(make_pointer_bounds_mode): New.
	* machmode.h (POINTER_BOUNDS_MODE_P): New.
	* stor-layout.c (int_mode_for_mode): Support MODE_POINTER_BOUNDS.
	(layout_type): Support POINTER_BOUNDS_TYPE.
	* tree-pretty-print.c (dump_generic_node): Support POINTER_BOUNDS_TYPE.
	* tree.c (build_int_cst_wide): Support POINTER_BOUNDS_TYPE.
	(type_contains_placeholder_1): Likewise.
	* tree.h (POINTER_BOUNDS_TYPE_P): New.
	* varasm.c (output_constant): Support POINTER_BOUNDS_TYPE.
	* doc/rtl.texi (MODE_POINTER_BOUNDS): New.

From-SVN: r205522
2013-11-29 12:12:39 +00:00
Richard Sandiford 1d0216c8b7 target.def (can_use_doloop_p): New hook.
gcc/
	* target.def (can_use_doloop_p): New hook.
	* doc/tm.texi.in (TARGET_CAN_USE_DOLOOP_P): Add.
	* doc/tm.texi: Regenerate.
	* doc/md.texi (doloop_begin, doloop_end): Update documentation.
	* hooks.h (hook_bool_dint_dint_uint_true): Declare.
	* hooks.c (hook_bool_dint_dint_uint_true): New function.
	* targhooks.h (can_use_doloop_if_innermost): Declare.
	* targhooks.c (can_use_doloop_if_innermost): New function.
	* target.h: Include double-int.h.
	* loop-doloop.c (doloop_optimize): Call targetm.can_use_doloop_p.
	Remove iteration count, maximum iteration count, loop depth and
	enter-at-top inputs from doloop_begin and doloop_end.
	* config/arc/arc.md (doloop_begin, doloop_end): Update for new
	interface.
	* config/arc/arc.c (arc_can_use_doloop_p): New function.
	(TARGET_CAN_USE_DOLOOP_P): Define.
	* config/arm/thumb2.md (doloop_end): Update for new interface.
	* config/arm/arm.c (TARGET_CAN_USE_DOLOOP_P): Define.
	* config/bfin/bfin.md (doloop_end): Update for new interface.
	* config/bfin/bfin.c (bfin_can_use_doloop_p): New function.
	(TARGET_CAN_USE_DOLOOP_P): Define.
	* config/c6x/c6x.md (doloop_end): Update for new interface.
	* config/ia64/ia64.md (doloop_end): Update for new interface.
	* config/ia64/ia64.c (TARGET_CAN_USE_DOLOOP_P): Define.
	* config/mep/mep.md (doloop_begin, doloop_end): Update for new
	interface.
	* config/mep/mep.c (mep_emit_doloop): Likewise.
	(TARGET_CAN_USE_DOLOOP_P): Define.
	* config/rs6000/rs6000.md (doloop_end): Update for new interface.
	* config/rs6000/rs6000.c (TARGET_CAN_USE_DOLOOP_P): Define.
	* config/s390/s390.md (doloop_end): Update for new interface.
	* config/sh/sh.md (doloop_end): Likewise.
	* config/spu/spu.md (doloop_end): Likewise.
	* config/spu/spu.c (TARGET_CAN_USE_DOLOOP_P): Define.
	* config/tilegx/tilegx.md (doloop_end): Update for new interface.
	* config/tilegx/tilegx.c (TARGET_CAN_USE_DOLOOP_P): Define.
	* config/tilepro/tilepro.md (doloop_end): Update for new interface.
	* config/tilepro/tilepro.c (TARGET_CAN_USE_DOLOOP_P): Define.
	* config/v850/v850.md (doloop_begin, doloop_end): Update for new
	interface.
	* config/v850/v850.c (TARGET_CAN_USE_DOLOOP_P): Define.

From-SVN: r204614
2013-11-09 11:42:16 +00:00
Joseph Myers 267bac1078 tree-core.h (enum cv_qualifier): Add TYPE_QUAL_ATOMIC.
gcc:
2013-11-05  Andrew MacLeod  <amacleod@redhat.com>
	    Joseph Myers  <joseph@codesourcery.com>

	* tree-core.h (enum cv_qualifier): Add TYPE_QUAL_ATOMIC.
	(enum tree_index): Add TI_ATOMICQI_TYPE, TI_ATOMICHI_TYPE,
	TI_ATOMICSI_TYPE, TI_ATOMICDI_TYPE and TI_ATOMICTI_TYPE.
	(struct tree_base): Add atomic_flag field.
	* tree.h (TYPE_ATOMIC): New accessor macro.
	(TYPE_QUALS, TYPE_QUALS_NO_ADDR_SPACE): Add TYPE_QUAL_ATOMIC.
	(TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC): New macro.
	(atomicQI_type_node, atomicHI_type_node, atomicSI_type_node)
	(atomicDI_type_node, atomicTI_type_node): New macros for type
	nodes.
	* tree.c (set_type_quals): Set TYPE_ATOMIC.
	(find_atomic_core_type): New function.
	(build_qualified_type): Adjust alignment for qualified types.
	(build_atomic_base): New function
	(build_common_tree_nodes): Build atomicQI_type_node,
	atomicHI_type_node, atomicSI_type_node, atomicDI_type_node and
	atomicTI_type_node.
	* print-tree.c (print_node): Print atomic qualifier.
	* tree-pretty-print.c (dump_generic_node): Print atomic type
	attribute.
	* target.def (atomic_assign_expand_fenv): New hook.
	* doc/tm.texi.in (TARGET_ATOMIC_ASSIGN_EXPAND_FENV): New @hook.
	* doc/tm.texi: Regenerate.
	* targhooks.c (default_atomic_assign_expand_fenv): New function.
	* targhooks.h (default_atomic_assign_expand_fenv): Declare.
	* sync-builtins.def (__atomic_feraiseexcept): New built-in
	function.
	* config/i386/i386-builtin-types.def (VOID_FTYPE_PUSHORT): New
	function type.
	* config/i386/i386.c (enum ix86_builtins): Add
	IX86_BUILTIN_FNSTENV, IX86_BUILTIN_FLDENV, IX86_BUILTIN_FNSTSW and
	IX86_BUILTIN_FNCLEX.
	(bdesc_special_args): Add __builtin_ia32_fnstenv,
	__builtin_ia32_fldenv, __builtin_ia32_fnstsw and
	__builtin_ia32_fnclex.
	(ix86_expand_builtin): Handle the new built-in functions.
	(ix86_atomic_assign_expand_fenv): New function.
	(TARGET_ATOMIC_ASSIGN_EXPAND_FENV): New macro.
	* config/i386/i386.md (UNSPECV_FNSTENV, UNSPECV_FLDENV)
	(UNSPECV_FNSTSW, UNSPECV_FNCLEX): New unspecs.
	(fnstenv, fldenv, fnstsw, fnclex): New insns.

gcc/c-family:
2013-11-05  Andrew MacLeod  <amacleod@redhat.com>
	    Joseph Myers  <joseph@codesourcery.com>

	* c-common.h (enum rid): Add RID_ATOMIC.
	* c-common.c (c_common_reswords): Add _Atomic.
	(sync_resolve_params): Use TYPE_MAIN_VARIANT on pointer argument.
	(keyword_is_type_qualifier): Accept RID_ATOMIC.
	* c-format.c (check_format_types): Check for extra _Atomic
	qualifiers in format argument.
	* c-pretty-print.c (pp_c_cv_qualifiers): Handle atomic qualifier.
	(pp_c_type_qualifier_list): Mention _Atomic in comment.

gcc/c:
2013-11-05  Joseph Myers  <joseph@codesourcery.com>
	    Andrew MacLeod  <amacleod@redhat.com>

	* c-aux-info.c (gen_type): Handle atomic qualifier.
	* c-decl.c (validate_proto_after_old_defn): Do not remove atomic
	qualifiers when compating types.
	(shadow_tag_warned): Handle atomic_p in declspecs.
	(quals_from_declspecs): Likewise.
	(start_decl): Use c_type_promotes_to when promoting argument
	types.
	(grokdeclarator): Handle _Atomic.
	(get_parm_info): Diagnose any qualifier on "void" as only
	parameter.
	(store_parm_decls_oldstyle): Do not remove atomic qualifiers when
	comparing types.  Use c_type_promotes_to when promoting argument
	types.
	(finish_function): Use c_type_promotes_to when promoting argument
	types.
	(build_null_declspecs): Handle atomic_p in declspecs.
	(declspecs_add_qual): Handle RID_ATOMIC.
	* c-parser.c (c_token_starts_typename, c_token_is_qualifier)
	(c_token_starts_declspecs): Handle RID_ATOMIC.
	(c_parser_declspecs): Handle atomic type specifiers and
	qualifiers.
	(c_parser_typeof_specifier): Remove const and _Atomic qualifiers
	from types of expressions with atomic type.
	(c_parser_direct_declarator_inner): Use convert_lvalue_to_rvalue.
	(c_parser_attribute_any_word): Handle RID_ATOMIC.
	(c_parser_initializer, c_parser_initelt, c_parser_initval)
	(c_parser_statement_after_labels, c_parser_switch_statement)
	(c_parser_for_statement, c_parser_expr_no_commas)
	(c_parser_conditional_expression, c_parser_binary_expression)
	(c_parser_cast_expression, c_parser_unary_expression)
	(c_parser_postfix_expression)
	(c_parser_postfix_expression_after_primary, c_parser_expression):
	Use convert_lvalue_to_rvalue.
	(c_parser_expression_conv, c_parser_expr_list): Document
	conversion of lvalues to rvalues.  Use convert_lvalue_to_rvalue.
	(c_parser_objc_synchronized_statement): Use
	convert_lvalue_to_rvalue.
	(c_parser_objc_selector): Handle RID_ATOMIC.
	(c_parser_objc_receiver, c_parser_array_notation): Use
	convert_lvalue_to_rvalue.
	* c-tree.h (ctsk_typeof): Adjust comment to mention use for
	_Atomic (type-name).
	(struct c_declspecs): Add atomic_p field.
	(convert_lvalue_to_rvalue): Declare.
	* c-typeck.c (c_type_promotes_to): Promote atomic types to
	corresponding atomic types.
	(qualify_type): Don't add _Atomic qualifiers from second argument.
	(comp_target_types): Do not allow _Atomic mismatches.
	(type_lists_compatible_p): Do not remove atomic qualifiers when
	comparing types.
	(really_atomic_lvalue, convert_lvalue_to_rvalue)
	(build_atomic_assign): New functions.
	(build_unary_op): Use build_atomic_assign for atomic increment and
	decrement.
	(build_conditional_expr): Do not treat _Atomic void as a qualified
	version of void.
	(build_modify_expr): Use build_atomic_assign for atomic LHS.
	(find_anonymous_field_with_type, convert_to_anonymous_field)
	(convert_for_assignment): Do not remove atomic qualifiers when
	comparing types.
	(digest_init): Do not accept initialization of arrays of atomic
	elements by string constants.
	(build_asm_expr): Use convert_lvalue_to_rvalue.
	(build_binary_op): Do not treat _Atomic void as a qualified
	version of void.

gcc/objc:
2013-11-05  Andrew MacLeod  <amacleod@redhat.com>

	* objc-act.c (objc_push_parm): Handle atomic qualifier.

gcc/testsuite:
2013-11-05  Joseph Myers  <joseph@codesourcery.com>

	* lib/target-supports.exp
	(check_effective_target_fenv_exceptions): New function.
	* lib/atomic-dg.exp, gcc.dg/atomic/atomic.exp: New files.
	* gcc.dg/atomic/c11-atomic-exec-1.c,
	gcc.dg/atomic/c11-atomic-exec-2.c,
	gcc.dg/atomic/c11-atomic-exec-3.c,
	gcc.dg/atomic/c11-atomic-exec-4.c,
	gcc.dg/atomic/c11-atomic-exec-5.c, gcc.dg/c11-atomic-1.c,
	gcc.dg/c11-atomic-2.c, gcc.dg/c11-atomic-3.c,
	gcc.dg/c90-atomic-1.c, gcc.dg/c99-atomic-1.c: New tests.

libatomic:
2013-11-05  Joseph Myers  <joseph@codesourcery.com>

	* fenv.c: New file.
	* libatomic.map (LIBATOMIC_1.1): New symbol version.  Include
	__atomic_feraiseexcept.
	* configure.ac (libtool_VERSION): Change to 2:0:1.
	(fenv.h): Test for header.
	* Makefile.am (libatomic_la_SOURCES): Add fenv.c.
	* Makefile.in, auto-config.h.in, configure: Regenerate.

From-SVN: r204544
2013-11-07 21:15:25 +00:00
Joseph Myers 9193fb0595 cpp.texi (__GCC_IEC_559, [...]): Document macros.
* doc/cpp.texi (__GCC_IEC_559, __GCC_IEC_559_COMPLEX): Document
	macros.
	* target.def (float_exceptions_rounding_supported_p): New hook.
	* targhooks.c (default_float_exceptions_rounding_supported_p): New
	function.
	* targhooks.h (default_float_exceptions_rounding_supported_p):
	Declare.
	* doc/tm.texi.in (TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P):
	New @hook.
	* doc/tm.texi: Regenerate.
	* config.gcc (powerpc*-*-linux*): Set extra_objs.
	* config/rs6000/rs6000-linux.c: New file.
	* config/rs6000/rs6000-protos.h
	(rs6000_linux_float_exceptions_rounding_supported_p): Declare.
	* config/rs6000/linux.h
	(TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P): New macro.
	* config/rs6000/linux64.h
	(TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P): Likewise.
	* config/rs6000/t-linux (rs6000-linux.o): New rule.
	* config/rs6000/t-linux64 (rs6000-linux.o): Likewise.

c-family:
	* c-cppbuiltin.c (cpp_iec_559_value, cpp_iec_559_complex_value):
	New functions.
	(c_cpp_builtins): Define __GCC_IEC_559 and __GCC_IEC_559_COMPLEX.

testsuite:
	* gcc.dg/iec-559-macros-1.c, gcc.dg/iec-559-macros-2.c,
	gcc.dg/iec-559-macros-3.c, gcc.dg/iec-559-macros-4.c,
	gcc.dg/iec-559-macros-5.c, gcc.dg/iec-559-macros-6.c,
	gcc.dg/iec-559-macros-7.c, gcc.dg/iec-559-macros-8.c,
	gcc.dg/iec-559-macros-9.c: New tests.

From-SVN: r204351
2013-11-04 15:39:57 +00:00
Ilya Enkovich f481a2ce85 target.def (builtin_chkp_function): New.
* target.def (builtin_chkp_function): New.
        (chkp_bound_type): New.
        (chkp_bound_mode): New.
        (fn_abi_va_list_bounds_size): New.
        (load_bounds_for_arg): New.
        (store_bounds_for_arg): New.
        * targhooks.h (default_load_bounds_for_arg): New.
        (default_store_bounds_for_arg): New.
        (default_fn_abi_va_list_bounds_size): New.
        (default_chkp_bound_type): New.
        (default_chkp_bound_mode): New.
        (default_builtin_chkp_function): New.
        * targhooks.c (default_load_bounds_for_arg): New.
        (default_store_bounds_for_arg): New.
        (default_fn_abi_va_list_bounds_size): New.
        (default_chkp_bound_type): New.
        (default_chkp_bound_mode); New.
        (default_builtin_chkp_function): New.
        * doc/tm.texi.in (TARGET_FN_ABI_VA_LIST_BOUNDS_SIZE): New.
        (TARGET_LOAD_BOUNDS_FOR_ARG): New.
        (TARGET_STORE_BOUNDS_FOR_ARG): New.
        (TARGET_BUILTIN_CHKP_FUNCTION): New.
        (TARGET_CHKP_BOUND_TYPE): New.
        (TARGET_CHKP_BOUND_MODE): New.
        * doc/tm.texi: Regenerated.
        * langhooks.h (lang_hooks): Add chkp_supported field.
        * langhooks-def.h (LANG_HOOKS_CHKP_SUPPORTED): New.
        (LANG_HOOKS_INITIALIZER); Add LANG_HOOKS_CHKP_SUPPORTED.

From-SVN: r204195
2013-10-30 08:57:50 +00:00
Andrew MacLeod 4a7cb16f83 builtins.c (dummy_object, [...]): Move to gimplify.c.
* builtins.c (dummy_object, gimplify_va_arg_expr): Move to gimplify.c.
	* gimplify.c (build_va_arg_indirect_ref, std_gimplify_va_arg_expr):
	Move to targhooks.c.
	(dummy_object, gimplify_va_arg_expr): Relocate from builtins.c.
	* targhooks.c (build_va_arg_indirect_ref, std_gimplify_va_arg_expr):
	Relocate from gimplify.c.
	* targhooks.h: Add 2 prototypes.
	* tree.h. Delete 2 prototypes.

From-SVN: r204032
2013-10-24 19:02:44 +00:00
Richard Sandiford c328471880 alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
	* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
	bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
	cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
	cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
	combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
	cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
	df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
	dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
	errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
	fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
	gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
	genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
	genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
	genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
	gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
	gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
	gimple.h, godump.c, graphite-clast-to-gimple.c,
	graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
	graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
	hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
	ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
	ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
	ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
	loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
	lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
	mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
	pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
	predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
	profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
	regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
	reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
	sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
	statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
	system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
	tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
	tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
	tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
	tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
	tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
	tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
	tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
	tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
	tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
	tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
	tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
	tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
	tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
	tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
	tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
	tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
	tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
	tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
	tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
	tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
	varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
	whitespace before "(".

From-SVN: r203004
2013-09-28 08:42:34 +00:00
Alexander Ivchenko d33d9e47d4 target.def (TARGET_LIBC_HAS_FUNCTION): New target hook.
* target.def (TARGET_LIBC_HAS_FUNCTION): New target hook.
	* builtins.c (default_libc_has_function): New.
	(gnu_libc_has_function): Ditto.
	(no_c99_libc_has_function): Ditto.
	(expand_builtin_cexpi): Using new target hook TARGET_LIBC_HAS_FUNCTION
	instead of TARGET_HAS_SINCOS and TARGET_C99_FUNCTIONS.
	(fold_builtin_sincos): Likewise.
	(fold_builtin_cexp): Likewise.
	* builtins.def (DEF_C94_BUILTIN): Likewise.
	(DEF_C99_BUILTIN): Likewise.
	(DEF_C99_C90RES_BUILTIN): Likewise.
	(DEF_C99_COMPL_BUILTIN): New define. Change all complex c99 builtin
	definitions to using this define.
	* config/darwin-protos.h (darwin_libc_has_function): New.
	* config/darwin.c: (darwin_libc_has_function: Ditto.
	* config/alpha/linux.h: Remove TARGET_C99_FUNCTIONS and
	TARGET_HAS_SINCOS. Redefine TARGET_LIBC_HAS_FUNCTION.
	* config/darwin.h: Ditto.
	* config/elfos.h: Ditto.
	* config/freebsd.h: Ditto.
	* config/i386/cygming.h: Ditto.
	* config/i386/djgpp.h: Ditto.
	* config/i386/i386-interix.h: Ditto.
	* config/microblaze/microblaze.h: Ditto.
	* config/mmix/mmix.h: Ditto.
	* config/gnu-user.h: Ditto.
	* config/ia64/hpux.h: Ditto.
	* config/pa/pa-hpux.h: Ditto.
	* config/pdp11/pdp11.h: Ditto.
	* config/picochip/picochip.h: Ditto.
	* config/linux.h: Ditto.
	* config/netbsd.h: Ditto.
	* config/openbsd.h: Ditto.
	* config/rs6000/aix43.h: Ditto.
	* config/rs6000/aix51.h: Ditto.
	* config/rs6000/aix52.h: Ditto.
	* config/rs6000/aix53.h: Ditto.
	* config/rs6000/aix61.h: Ditto.
	* config/rs6000/darwin.h: Ditto.
	* config/rs6000/linux.h: Ditto.
	* config/rs6000/linux64.h: Ditto.
	* config/s390/tpf.h: Ditto.
	* config/sol2-10.h: Ditto.
	* config/sol2.h: Ditto.
	* config/vms/vms.h: Ditto.
	* config/vxworks.h: Ditto.
	* config/linux-android.c (linux_android_libc_has_function):
	New linux-specific implementation of TARGET_LIBC_HAS_FUNCTION.
	* config/linux-protos.h (linux_android_libc_has_function):
	New declaration.
	* config/i386/i386.c (ix86_libc_has_function): New.
	* config/i386/i386-protos.h
	(ix86_libc_has_function): New declaration.
	* config/i386/i386.md
	("isinfxf2"): Change condition for TARGET_LIBC_HAS_FUNCTION.
	("isinf<mode>2): Likewise.
	* convert.c (convert_to_integer): Using new target hook
	TARGET_LIBC_HAS_FUNCTION istead of TARGET_HAS_SINCOS and
	TARGET_C99_FUNCTIONS.
	* fortran/f95-lang.c (gfc_init_builtin_functions): Ditto.
	* tree-ssa-math-opts.c (execute_cse_sincos): Ditto.
	* coretypes.h (function_class): New enum for different
	classes of functions.
	* defaults.h: Remove TARGET_C99_FUNCTIONS and TARGET_HAS_SINCOS.
	* doc/tm.texi.in (TARGET_C99_FUNCTIONS): Remove documentation.
	(TARGET_HAS_SINCOS): Likewise.
	(TARGET_LIBC_HAS_FUNCTION): New.
	* doc/tm.texi: Regenerated.
	* targhooks.h (default_libc_has_function): New declaration.
	(no_c99_libc_has_function): Ditto.
	(gnu_libc_has_function): Ditto.
	* system.h: Add the poisoning of TARGET_C99_FUNCTIONS
	and TARGET_HAS_SINCOS.

From-SVN: r201838
2013-08-19 12:21:26 +00:00
Vladimir Makarov 3b9ceb4b4f target.def (register_usage_leveling_p): New hook.
2013-05-30  Vladimir Makarov  <vmakarov@redhat.com>

	* target.def (register_usage_leveling_p): New hook.
	* targhooks.c (default_register_usage_leveling_p): New.
	* targhooks.h (default_register_usage_leveling_p): New prototype.
	* lra-assigns.c (register_usage_leveling_p): Use the hook.
	* doc/tm.texi.in (TARGET_REGISTER_USAGE_LEVELING_P): New hook.
	* doc/tm.texi: Update.
	* config/i386/i386.c (TARGET_REGISTER_USAGE_LEVELING_P): Define.

From-SVN: r199459
2013-05-30 20:30:38 +00:00