wi::add_large and wi::sub_large weren't setting the overflow bit
correctly for unsigned operations if the result needed fewer HWIs
than the precision.
2017-11-22 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
PR middle-end/82547
* wide-int.cc (wi::add_large, wi::sub_large): Fix overflow detection
for unsigned values with fewer HWIs than the precision.
(test_overflow): New function.
(wide_int_cc_tests): Call it.
From-SVN: r255059
r254589 was supposed to leave tests unchanged for the default
VECTOR_BITS==128, but I must have got my sums wrong on pr81136.c.
2017-11-22 Richard Sandiford <richard.sandiford@linaro.org>
gcc/testsuite/
PR testsuite/83004
* gcc.dg/vect/pr81136.c: Restore previous alignment of 32
in the default case.
From-SVN: r255058
This patch fixes a regression caused by r251469, where I'd incorrectly
converted a call to mode_for_size that sometimes needs MODE_PARTIAL_INTs.
2017-11-22 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* emit-rtl.c (init_derived_machine_modes): Make sure ptr_mode
has the same mode class as Pmode.
From-SVN: r255057
As part of r253256, cmse_nonsecure_entry_clear_before_return has been
rewritten to use auto_sbitmap instead of an integer bitfield to control
which register needs to be cleared. This commit continues this work in
cmse_nonsecure_call_clear_caller_saved.
2017-11-22 Thomas Preud'homme <thomas.preudhomme@arm.com>
gcc/
* config/arm/arm.c (cmse_nonsecure_call_clear_caller_saved): Use
auto_sbitap instead of integer bitfield to control register needing
clearing.
From-SVN: r255055
PR tree-optimization/83044
* tree-vrp.c (vrp_prop::check_array_ref): If eltsize is not
INTEGER_CST or is 0, clear up_bound{,_p1} and later ignore tests
that need the upper bound. Subtract offset from
get_addr_base_and_unit_offset only if positive and subtract it
before division by eltsize rather than after it.
* gcc.dg/pr83044.c: New test.
* c-c++-common/Warray-bounds.c (fb): Fix up MAX value.
From-SVN: r255054
2017-11-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/79072
* trans-stmt.c (trans_associate_var): Weaken the over strong
condition for using the fake result decl.
2017-11-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/79072
* gfortran.dg/class_result_6.f90: New test for comment 10 of
the PR.
From-SVN: r255053
PR debug/83084
* valtrack.c (propagate_for_debug_subst, propagate_for_debug): Reset
debug insns if they would contain UNSPEC_VOLATILE or volatile asm.
(dead_debug_insert_temp): Likewise, but also ignore even non-volatile
asm.
* g++.dg/opt/pr83084.C: New test.
From-SVN: r255051
PR middle-end/82875
* optabs.c (expand_doubleword_mult, expand_binop): Before calling
expand_binop with *mul_widen_optab, make sure at least one of the
operands doesn't have VOIDmode.
* gcc.dg/pr82875.c: New test.
* gcc.c-torture/compile/pr82875.c: New test.
From-SVN: r255050
PR rtl-optimization/82044
PR tree-optimization/82042
* dse.c (record_store): Check for overflow.
(check_mem_read_rtx): Properly check for overflow if width == -1, call
add_wild_read instead of clear_rhs_from_active_local_stores on
overflow and log it into dump_file.
From-SVN: r255048
2017-11-22 Richard Biener <rguenther@suse.de>
* gimple-iterator.c (gimple_find_edge_insert_loc): Ignore
fake edges to exit when looking for a place to insert.
* tree-ssa-pre.c (clear_expression_ids): Inline into callers
and remove.
(insert_into_preds_of_block): Commit edge insertion immediately,
assert that doesn't require new BBs.
(fini_pre): Release expressions.
(pass_pre::execute): Shuffle things around a bit, if the fn
is too large do not compute AVAIL either as this is really the
quadratic bit.
From-SVN: r255047
2017-11-22 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/83070
* intrinsics/eoshift0.c (eoshift0): Fix -Wsign-compare warning by
making a_ex and r_ex index_type instead of size_t.
From-SVN: r255045
2017-11-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/83089
* tree-if-conv.c (pass_if_conversion::execute): If anything
changed reset SCEV and free the number of iteration estimates.
* gcc.dg/pr83089.c: New testcase.
From-SVN: r255044
PR c/83056 reports an issue affecting trunk and gcc-7 in which
the C frontend's implementation of lookup_name_fuzzy uses undeclared
identifiers as suggestions when encountering subsequent undeclared
identifiers.
The fix is to filter out the names bound to error_mark_node
in lookup_name_fuzzy.
The C++ frontend is unaffected, as it already does this.
gcc/c/ChangeLog:
PR c/83056
* c-decl.c (lookup_name_fuzzy): Don't suggest names that came from
earlier failed lookups.
gcc/testsuite/ChangeLog:
PR c/83056
* gcc.dg/spellcheck-pr83056.c: New test case.
From-SVN: r255038
* config/i386/i386-opts.h (enum prefer_vector_width): Added new enum
for the new option -mprefer-vector-width=[none|128|256|512].
* config/i386/i386.c (ix86_target_string): remove old style options
-mprefer-avx256 and make -mprefer-avx128 as alias.
(ix86_option_override_internal): Apply defaults for the
-mprefer-vector-width=[128|256] option.
* config/i386/i386.h (TARGET_PREFER_AVX128, TARGET_PREFER_AVX256):
Implement macros to work with -mprefer-vector-width=.
* config/i386/i386.opt: Implemented option
-mprefer-vector-width=[none|128|256|512].
* doc/invoke.texi: Documentation for
-mprefer-vector-width=[none|128|256|512].
gcc/testsuite/
* g++.dg/ext/pr57362.C (__attribute__): Test
prefer-vector-width=[128|256] target attribute.
* gcc.target/i386/avx512f-constant-float-return.c (dg-optioins):
Use -mprefer-vector-width=256 instead of -mprefer-avx256.
* gcc.target/i386/avx512f-prefer.c: Ditto.
* gcc.target/i386/pr82460-2.c: Ditto.
From-SVN: r255030
2017-11-21 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
* doc/xml/manual/using.xml (manual.intro.using.macros): Move
variablelist element at the end of its list.
From-SVN: r255023
PR tree-optimization/83086
* gimple-ssa-store-merging.c
(imm_store_chain_info::try_coalesce_bswap): Test this_n.base_addr
rather than n.base_addr.
From-SVN: r255002
PR tree-optimization/83047
* gimple-ssa-store-merging.c
(imm_store_chain_info::output_merged_store): If the loads with the
same vuse are in different basic blocks, for load_gsi pick a load
location that is dominated by the other loads.
* gcc.dg/pr83047.c: New test.
From-SVN: r254992
P0428R2 - familiar template syntax for generic lambdas
* parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn
for cxx2a and above, reword pedwarn for C++14/C++17.
* g++.dg/cpp1y/lambda-generic-x.C: Adjust warnings and limit
to c++17_down target.
* g++.dg/cpp1y/lambda-generic-dep.C: Likewise.
* g++.dg/cpp1y/lambda-generic-77914.C: Adjust error and limit
to c++17_down target.
* g++.dg/cpp2a/lambda-generic1.C: New test.
* g++.dg/cpp2a/lambda-generic2.C: New test.
* g++.dg/cpp2a/lambda-generic3.C: New test.
* g++.dg/cpp2a/lambda-generic4.C: New test.
* g++.dg/cpp2a/lambda-generic5.C: New test.
From-SVN: r254991
PR debug/82718
* dwarf2out.c (dw_loc_list): If crtl->has_bb_partition, temporarily
set in_cold_section_p to the partition containing loc_list->first.
When seeing loc_list->last_before_switch node, update secname and
perform range_across_switch second partition handling only after that.
* gcc.dg/debug/dwarf2/pr82718-1.c: New test.
* gcc.dg/debug/dwarf2/pr82718-2.c: New test.
From-SVN: r254989