This fixes an ICE in gcc.dg/attr-vector_size.c testcase.
gcc/ChangeLog:
2019-11-05 Andreas Krebbel <krebbel@linux.ibm.com>
* config/s390/s390.c (s390_vector_alignment): Check if the value
fits into uhwi before using it.
From-SVN: r277829
Here is the one-liner that fixes the incorrect
vec_perm cost for thunderx2t99 chip.
With the patch applied 526.blender of CPU2017
gets ~5% improvement with no measurable changes
for other benchmarks.
2019-11-05 Anton Youdkevitch <anton.youdkevitch@bell-sw.com>
* config/aarch64/aarch64.c (thunderx2t99_vector_cost):
Change vec_perm field to 10.
From-SVN: r277826
2019-11-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/92324
* tree-vect-loop.c (check_reduction_path): For MIN/MAX require
all signed or unsigned operations.
* gcc.dg/vect/pr92324-3.c: New testcase.
From-SVN: r277822
PR tree-optimization/91945
* builtins.c (compute_objsize): For ARRAY_REF, only multiply off
by tpsize if it is both non-NULL and INTEGER_CST, otherwise punt.
Formatting fix.
* gfortran.dg/pr91945.f90: New test.
From-SVN: r277820
PR c++/92343
* constexpr.c (potential_constant_expression_1): Return true rather
than false for PREDICT_EXPR.
* g++.dg/cpp2a/attr-likely6.C: New test.
From-SVN: r277819
Move vrp_set_zero_nonzero_bits from tree-vrp.c into vr-values.c, and
make it use wi_set_zero_nonzero_bits. Remove the now redundant
wide_int_range_set_zero_nonzero_bits.
From-SVN: r277818
* decl.c (omp_declare_variant_finalize_one): Call
declare_simd_adjust_this not just on the context, but also on the
variant-id expression for methods. Don't call
cp_get_callee_fndecl_nofold, call cp_get_callee and only if it is
safe cp_get_fndecl_from_callee. Don't try to print as %qD
NULL in diagnostics.
* pt.c (tsubst_attribute): Handle "omp declare variant base"
attribute.
(tsubst_function_decl): Call omp_declare_variant_finalize
if there are any "omp declare variant base" attributes left.
* g++.dg/gomp/declare-variant-7.C: New test.
* g++.dg/gomp/declare-variant-8.C: New test.
From-SVN: r277814
gcc/
* config/gcn/gcn.c (gcn_omp_device_kind_arch_isa): New function.
(TARGET_OMP_DEVICE_KIND_ARCH_ISA): Redefine to
gcn_omp_device_kind_arch_isa.
* config/gcn/t-omp-device: New file.
* configure.ac: Support gcn for omp_device_property.
* configure: Regenerate.
From-SVN: r277797
The SVE port now tries to register variable-length VECTOR_TYPEs
at start-up, so it's no longer possible to use the asserting
to_constant on the number of vector elements. This patch punts
on variable element counts instead, just like we do for other
things that the frontend doesn't recognise.
The brace indentation matches the surrounding style.
2019-11-04 Richard Sandiford <richard.sandiford@arm.com>
gcc/d/
* d-builtins.cc (build_frontend_type): Cope with variable
TYPE_VECTOR_SUBPARTS.
From-SVN: r277793
* ipa-inline-transform.c: Include ipa-utils.h
(inline_call): Set thunk_expansion flag.
* ipa-utils.h (thunk_expansion): Declare.
* ipa-devirt.c (thunk_expansion): New global var.
(devirt_node_removal_hook): Do not invalidate cache while
doing thunk expansion.
From-SVN: r277789
This initializes the rstmt variable with NULL and adds an assert to
check that a value has been given by one of the if cases before use.
This fixes the bootstrap failure due to -Werror.
Committed under the gcc obvious rule.
gcc/ChangeLog:
* tree-vect-slp.c (vectorize_slp_instance_root_stmt): Initialize rstmt.
From-SVN: r277788
gcc/ChangeLog:
2019-11-04 Joel Hutton <Joel.Hutton@arm.com>
* expr.c (store_constructor): Modify to handle single element vectors.
* tree-vect-slp.c (vect_analyze_slp_instance): Add case for vector
constructors.
(vect_slp_check_for_constructors): New function.
(vect_slp_analyze_bb_1): Call new function to check for vector
constructors.
(vectorize_slp_instance_root_stmt): New function.
(vect_schedule_slp): Call new function to vectorize root stmt of vector
constructors.
* tree-vectorizer.h (SLP_INSTANCE_ROOT_STMT): New field.
gcc/testsuite/ChangeLog:
2019-11-04 Joel Hutton <Joel.Hutton@arm.com>
* gcc.dg/vect/bb-slp-40.c: New test.
* gcc.dg/vect/bb-slp-41.c: New test.
From-SVN: r277784
2019-11-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/92345
* tree-vect-loop.c (vect_is_simple_reduction): Return whether
we produced a reduction chain.
(vect_analyze_scalar_cycles_1): Do not add reduction chains to
LOOP_VINFO_REDUCTIONS.
* gcc.dg/torture/pr92345.c: New testcase.
From-SVN: r277782
* cgraphclones.c (cgraph_node::create_version_clone): Do not
duplicate summaries.
* ipa-fnsummary.c (ipa_fn_summary_alloc): Allocate size summary
first.
(ipa_fn_summary_t::duplicate): Use get instead of get_create to
access call summaries.
(dump_ipa_call_summary): Be ready for missing edge summaries.
(analyze_function_body): Use get instead of get_create to access
edge summary.
(estimate_calls_size_and_time): Do not access summaries of
inlined edges; sanity check they are missing.
(ipa_call_context::estimate_size_and_time): Use get instead
of get_create to access node summary.
(inline_update_callee_summaries): Do not update depth of
inlined edge.
(ipa_merge_fn_summary_after_inlining): Remove inline edge from
growth caches.
(ipa_merge_fn_summary_after_inlining): Use get instead
of get_create.
* ipa-fnsummary.h (ipa_remove_from_growth_caches): Declare.
* ipa-inline-analyssi.c (edge_growth_cache): Turn to
fast summary.
(initialize_growth_caches): Update.
(do_estimate_edge_time): Remove redundant copy of context.
(ipa_remove_from_growth_caches): New function.
* ipa-inline.c (flatten_function): Update overall summary
only when optimizing.
(inline_to_all_callers): Update overall summary of function
inlined to.
* ipa-inline.h (edge_growth_cache): Turn to fast summary.
* symbol-summary.h (call_summary_base): Set m_initialize_when_cloning
to false.
From-SVN: r277780
2019-11-04 Richard Biener <rguenther@suse.de>
* system.h: Include malloc.h if INCLUDE_MALLOC_H and HAVE_MALLINFO.
* ggc-common.c: Remove inclusion of malloc.h, define INCLUDE_MALLOC_H.
From-SVN: r277779
Configuring GCC for obsolete targets works as long as build = host.
When it isn't, --enable-obsolete is not passed down to the additional
build configure started by gcc/configure, used to generate
auto-build.h. The build configure fails and we end up without a
auto-build.h, but the host configure proceeds, so we only get a fatal
failure much later, when make realizes auto-build.h is not there and
there's no rule to create it.
This patch gets the host configure to fail when the build configure
does, leaving the temporary build configure dir behind for
investigation. It also arranges for --eanble-obsolete to be passed
down to the build configure.
Alas, the latter triggered a warning in the build configure because
--enable-obsolete is not a recognized configure option. That's not
reported in the host configure because of the
--disable-option-checking passed by the top-level configure, so I
arranged for that to be passed down to the build configure as well.
Finally, since my initial suspicion when investigating this failure
was that auto-build.h had been removed after configuration and there
was no rule to rebuild it, I'm adding rules to gcc/Makefile to get it
created or updated as needed. Since it is configure that creates it,
as run by e.g. config.status --recheck, and config.status is created
after auto-build.h, I've made config.status depend on auto-build.h,
and added a dummy rule to create auto-build.h. This would normally
not be enough to create a header when needed, but since Makefile
depends on config.status, and make first updates Makefile, it ends up
working, as long as nothing else that Makefile depends on requires
auto-build.h but not config.status. The config.status dependency and
the auto-build.h rule are only enabled in the cases in which
auto-build.h is actually used, namely when build != host.
for gcc/ChangeLog
* configure.ac: Pass --enable-obsolete=* and
--enable-option-checking=* down to build configure, and fail
if it fails. AC_SUBST HAVE_AUTO_BUILD.
* configure: Rebuild.
* Makefile.in [HAVE_AUTO_BUILD] (auto-build.h): New rule.
[HAVE_AUTO_BUILD] (config.status): Depend on auto-build.h.
From-SVN: r277777
2019-11-04 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* crtstuff.c: Define USE_TM_CLONE_REGISTRY to 0 if it's undefined and
the target output object format is not ELF.
s/defined(USE_TM_CLONE_REGISTRY)/USE_TM_CLONE_REGISTRY.
From-SVN: r277775
2019-11-04 Jozef Lawrynowicz <jozef.l@mittosystems.com>
gcc/
* config.in: Regenerate.
* config/msp430/msp430.c (msp430_option_override): Emit an error if
-mtiny-printf is used without GCC being configured with
--enable-newlib-nano-formatted-io.
* config/msp430/msp430.h (LINK_SPEC): Pass
"--wrap puts --wrap printf" when -mtiny-printf is used.
* config/msp430/msp430.opt: Document -mtiny-printf.
* configure: Regenerate.
* configure.ac: Enable --enable-newlib-nano-formatted-io flag.
Define HAVE_NEWLIB_NANO_FORMATTED_IO if
--enable-newlib-nano-formatted-io is passed.
* doc/invoke.texi: Document -mtiny-printf.
gcc/testsuite/
* gcc.target/msp430/tiny-printf.c: New test.
From-SVN: r277774
MCU data file can now be specified with an environment variable or installed
into a toolchain subdirectory.
2019-11-04 Jozef Lawrynowicz <jozef.l@mittosystems.com>
gcc/
* config/msp430/driver-msp430.c
(msp430_get_linker_devices_include_path): New spec function.
* config/msp430/msp430-devices.c (msp430_dirname): New function.
(extract_devices_dir_from_exec_prefix): New function.
(extract_devices_dir_from_collect_gcc): New function.
(msp430_check_env_var_for_devices): New function.
(msp430_check_path_for_devices): Use xstrdup instead of ASTRDUP.
(parse_devices_csv): Call msp430_check_env_var_for_devices if
devices.csv was not found using other methods.
* config/msp430/msp430-devices.h (msp430_check_env_var_for_devices):
New prototype.
(msp430_dirname): Likewise.
* config/msp430/msp430.c (msp430_register_pre_includes): New function.
* config/msp430/msp430.h (EXTRA_SPEC_FUNCTIONS): Add
msp430_get_linker_devices_include_path.
(TARGET_EXTRA_PRE_INCLUDES): Define.
* doc/invoke.texi: Document new ways of searching for support files.
gcc/testsuite/
* gcc.target/msp430/devices/csv-using-env-var.c: New test.
* gcc.target/msp430/devices/csv-using-installed.c: New test.
* gcc.target/msp430/devices/csv-using-option.c: New test.
* gcc.target/msp430/devices/devices-main.c: New test source file.
* gcc.target/msp430/devices/msp430-devices.h: New test.
* gcc.target/msp430/msp430.exp (msp430_device_permutations_runtest):
Add special cases for csv-using* tests.
Define TESTING_HARD_DATA when running tests that use hard-coded device
data.
(get_installed_device_data_path): New.
(msp430_hide_installed_devices_data): New.
(msp430_restore_installed_devices_data): New.
(msp430_test_installed_device_data): New.
(msp430_install_device_data): New.
From-SVN: r277772
2019-11-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/92301
* tree-vect-stmts.c (process_use): Force reduction PHI defs live
as required by epilogue generation
* gcc.dg/pr92301.c: New testcase.
From-SVN: r277771