gcc.git
7 years agoPR c++/79549 - C++17 ICE with non-type auto template parameter pack
Jason Merrill [Wed, 10 May 2017 15:56:09 +0000 (11:56 -0400)]
PR c++/79549 - C++17 ICE with non-type auto template parameter pack

* pt.c (convert_template_argument): Just return an argument pack.
(coerce_template_parameter_pack, template_parm_to_arg)
(extract_fnparm_pack, make_argument_pack, tsubst_template_args)
(tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
Don't set the type of a NONTYPE_ARGUMENT_PACK.
* parser.c (make_char_string_pack, make_string_pack): Likewise.

From-SVN: r247842

7 years agors6000-c: Add support for built-in functions vector signed char vec_neg (vector...
Carl Love [Wed, 10 May 2017 15:54:41 +0000 (15:54 +0000)]
rs6000-c: Add support for built-in functions vector signed char vec_neg (vector...

gcc/ChangeLog:

2017-05-10  Carl Love  <cel@us.ibm.com>

   * config/rs6000/rs6000-c: Add support for built-in functions
   vector signed char        vec_neg (vector signed char)
   vector signed short int   vec_neg (vector short int)
   vector signed int         vec_neg (vector signed int)
   vector signed long long   vec_neg (vector signed long long)
   vector float              vec_neg (vector float)
   vector double             vec_neg (vector double)
   * config/rs6000/rs6000-builtin.def: Add definitions for NEG function
   overload.
   * config/rs6000/altivec.h: Add define for vec_neg
   * doc/extend.texi: Update the built-in documentation for the
   new built-in functions.

gcc/testsuite/ChangeLog:

2017-05-10  Carl Love  <cel@us.ibm.com>
   * gcc.target/powerpc/builtins-3.c: Add tests for the new built-ins to
   to the test suite file.
   * gcc.target/powerpc/builtins-3-p8.c: Add tests for the new built-ins to
   to the test suite file.

From-SVN: r247841

7 years ago* g++.dg/template/crash126.C: Second error doesn't apply to C++17.
Jason Merrill [Wed, 10 May 2017 15:53:48 +0000 (11:53 -0400)]
* g++.dg/template/crash126.C: Second error doesn't apply to C++17.

From-SVN: r247840

7 years agore PR target/80687 (VLA usage in libgfortran; nvptx target: "sorry, unimplemented...
Thomas Koenig [Wed, 10 May 2017 15:45:52 +0000 (15:45 +0000)]
re PR target/80687 (VLA usage in libgfortran; nvptx target: "sorry, unimplemented: target cannot support alloca")

2017-05-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/80687
        PR fortran/80696
        * m4/matmul_internal.m4:  'matmul_name`:  Always
        use malloc/free to allocate t1.
        * generated/matmul_c10.c: Regenerated.
        * generated/matmul_c16.c: Regenerated.
        * generated/matmul_c4.c: Regenerated.
        * generated/matmul_c8.c: Regenerated.
        * generated/matmul_i1.c: Regenerated.
        * generated/matmul_i16.c: Regenerated.
        * generated/matmul_i2.c: Regenerated.
        * generated/matmul_i4.c: Regenerated.
        * generated/matmul_i8.c: Regenerated.
        * generated/matmul_r10.c: Regenerated.
        * generated/matmul_r16.c: Regenerated.
        * generated/matmul_r4.c: Regenerated.
        * generated/matmul_r8.c: Regenerated.

From-SVN: r247839

7 years agoraise-gcc.c (exception_class_eq): Make ec parameter const.
Bernd Edlinger [Wed, 10 May 2017 13:34:07 +0000 (13:34 +0000)]
raise-gcc.c (exception_class_eq): Make ec parameter const.

2017-05-10  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * raise-gcc.c (exception_class_eq): Make ec parameter const.

From-SVN: r247836

7 years agore PR tree-optimization/77644 (missed optimization with sqrt in comparison)
Prathamesh Kulkarni [Wed, 10 May 2017 13:26:09 +0000 (13:26 +0000)]
re PR tree-optimization/77644 (missed optimization with sqrt in comparison)

2017-05-10  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

PR tree-optimization/77644
* match.pd (sqrt(x) cmp sqrt(y) -> x cmp y): New pattern.

testsuite/
* gcc.dg/tree-ssa/pr77644.c: New test-case.

From-SVN: r247835

7 years agocp-tree.h (add_method, [...]): Change last arg to bool.
Nathan Sidwell [Wed, 10 May 2017 13:12:57 +0000 (13:12 +0000)]
cp-tree.h (add_method, [...]): Change last arg to bool.

gcc/cp/
* cp-tree.h (add_method, clone_function_decl): Change last arg to
bool.
* class.c (add_method): Change third arg to bool.  Adjust.
(one_inheriting_sig, one_inherited_ctor): Adjust.
(clone_function_decl): Change 2nd arg to bool.  Adjust.
(clone_constructors_and_destructors): Adjust.
* lambda.c (maybe_add_lambda_conv_op): Adjust.
* method.c (lazily_declare_fn): Adjust.
* pt.c (tsubst_decl, instantiate_template_1): Adjust.
* semantics.c (finish_member_declaration): Adjust.

libcc1/
* libcp1plugin.cc (plugin_build_decl): Adjust add_method call.

From-SVN: r247834

7 years agodumpfile.h (TDI_lang_all): New.
Nathan Sidwell [Wed, 10 May 2017 12:16:25 +0000 (12:16 +0000)]
dumpfile.h (TDI_lang_all): New.

* dumpfile.h (TDI_lang_all): New.
(TDF_KIND): New. Renumber others
(TDF_LANG, TDF_TREE, TDF_RTL, TDF_IPA): Enumerate value, rather
than bits.
* dumpfile.c (dump_files): Mark language dumps as TDF_LANG.  add
lang-all.
(get_dump_file_name): Adjust suffix generation.
(dump_enable_all): Use TDF_KIND.
* doc/invoke.texi (-fdump-lang-all): Document.

From-SVN: r247833

7 years ago* dumpfile.h: Tabify.
Nathan Sidwell [Wed, 10 May 2017 12:01:23 +0000 (12:01 +0000)]
* dumpfile.h: Tabify.

From-SVN: r247832

7 years agoMove an use-after-free access before the delete.
Wilco Dijkstra [Wed, 10 May 2017 11:01:26 +0000 (11:01 +0000)]
Move an use-after-free access before the delete.

    gcc/
PR target/80671
* config/aarch64/cortex-a57-fma-steering.c (merge_forest):
Move member access before delete.

From-SVN: r247831

7 years agoavoid remove&reinsert of call when splitting block for inlining
Alexandre Oliva [Wed, 10 May 2017 10:16:54 +0000 (10:16 +0000)]
avoid remove&reinsert of call when splitting block for inlining

We used to split the inlined-into block at (= after) the call, and then
remove the call from the first block to insert it in the second.

The removal may cause unnecessary and unrecoverable resetting of debug
insns: we do not generate debug temps for calls.

Avoid the remove-and-reinsert dance by splitting the block before the
call.

for  gcc/ChangeLog

* tree-inline.c (expand_call_inline): Split block at stmt
before the call.

for  gcc/testsuite/ChangeLog

* gcc.dg/guality/inline-params-2.c: New.

From-SVN: r247830

7 years agore PR c++/80145 ([c++1y] ICE after failed return type deduction)
Paolo Carlini [Wed, 10 May 2017 08:34:02 +0000 (08:34 +0000)]
re PR c++/80145 ([c++1y] ICE after failed return type deduction)

/cp
2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/80145
* decl.c (finish_function): To improve error recovery, change the
logic for calling apply_deduced_return_type.

/testsuite
2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/80145
* g++.dg/cpp1y/auto-fn37.C: New.
* g++.dg/cpp1y/auto-fn38.C: Likewise.

From-SVN: r247828

7 years agoDaily bump.
GCC Administrator [Wed, 10 May 2017 00:16:27 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r247825

7 years agoMAINTAINERS: Move Kaz Kojima to Write After Approval section.
Kaz Kojima [Wed, 10 May 2017 00:01:26 +0000 (00:01 +0000)]
MAINTAINERS: Move Kaz Kojima to Write After Approval section.

From-SVN: r247821

7 years agore PR target/68163 (GCC on power8 does not issue the stxsspx instruction on power8)
Michael Meissner [Tue, 9 May 2017 21:25:23 +0000 (21:25 +0000)]
re PR target/68163 (GCC on power8 does not issue the stxsspx instruction on power8)

[gcc]
2017-05-09  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/68163
* config/rs6000/rs6000.md (f32_lr): Delete mode attributes that
are now unused after splitting mov{sf,sd}_hardfloat.
(f32_lr2): Likewise.
(f32_lm): Likewise.
(f32_lm2): Likewise.
(f32_li): Likewise.
(f32_li2): Likewise.
(f32_lv): Likewise.
(f32_sr): Likewise.
(f32_sr2): Likewise.
(f32_sm): Likewise.
(f32_sm2): Likewise.
(f32_si): Likewise.
(f32_si2): Likewise.
(f32_sv): Likewise.
(f32_dm): Likewise.
(f32_vsx): Likewise.
(f32_av): Likewise.
(mov<mode>_hardfloat): Split into separate movsf and movsd pieces.
For movsf, order stores so the VSX stores occur before the GPR
store which encourages the register allocator to use a traditional
FPR instead of a GPR.  For movsd, order the stores so that the GPR
store comes before the VSX stores to allow the power6 to work.
This is due to the power6 not having a 32-bit integer store
instruction from a FPR.
(movsf_hardfloat): Likewise.
(movsd_hardfloat): Likewise.

[gcc/testsuite]
2017-05-09  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/68163
* gcc.target/powerpc/pr68163.c: New test.

From-SVN: r247819

7 years agore PR fortran/79311 ([OOP] ICE in generate_finalization_wrapper, at fortran/class...
Janus Weil [Tue, 9 May 2017 20:55:38 +0000 (22:55 +0200)]
re PR fortran/79311 ([OOP] ICE in generate_finalization_wrapper, at fortran/class.c:1992)

2017-05-09  Janus Weil  <janus@gcc.gnu.org>

PR fortran/79311
* resolve.c (gfc_resolve_finalizers): Ensure that derived-type
components have a their finalizers resolved, also if the superordinate
type itself has a finalizer.

2017-05-09  Janus Weil  <janus@gcc.gnu.org>

PR fortran/79311
* gfortran.dg/finalize_32.f90: New test.

From-SVN: r247818

7 years ago* class.c (check_bases): Ignore empty bases.
Jason Merrill [Tue, 9 May 2017 20:38:03 +0000 (16:38 -0400)]
* class.c (check_bases): Ignore empty bases.

From-SVN: r247816

7 years ago* g++.dg/cpp1z/direct-enum-init1.C: Correct error message.
Jason Merrill [Tue, 9 May 2017 20:37:57 +0000 (16:37 -0400)]
* g++.dg/cpp1z/direct-enum-init1.C: Correct error message.

From-SVN: r247815

7 years agoPR c++/70979 - literal class and closure types
Jason Merrill [Tue, 9 May 2017 20:37:51 +0000 (16:37 -0400)]
PR c++/70979 - literal class and closure types

* class.c (finalize_literal_type_property): Handle closures
specifically.
(explain_non_literal_class): Likewise.

From-SVN: r247814

7 years agoPR c++/66297, DR 1684 - literal class and constexpr member fns
Jason Merrill [Tue, 9 May 2017 20:37:44 +0000 (16:37 -0400)]
PR c++/66297, DR 1684 - literal class and constexpr member fns

* constexpr.c (is_valid_constexpr_fn): Only complain about
non-literal enclosing class in C++11.
* class.c (finalize_literal_type_property): Likewise.

From-SVN: r247813

7 years agoconfig.host: Use the generic FreeBSD t-slibgcc-elf-ver for arm*-*-freebsd* instead...
Andreas Tobler [Tue, 9 May 2017 20:37:25 +0000 (22:37 +0200)]
config.host: Use the generic FreeBSD t-slibgcc-elf-ver for arm*-*-freebsd* instead of the...

2017-05-09  Andreas Tobler  <andreast@gcc.gnu.org>

    * config.host: Use the generic FreeBSD t-slibgcc-elf-ver for
    arm*-*-freebsd* instead of the t-slibgcc-libgcc.

From-SVN: r247812

7 years agore PR c/35441 (pretty-printer cannot handle some expressions)
Volker Reichelt [Tue, 9 May 2017 19:09:22 +0000 (19:09 +0000)]
re PR c/35441 (pretty-printer cannot handle some expressions)

        PR c/35441
        * c-pretty-print.c (c_pretty_printer::expression): Handle MAX_EXPR,
        MIN_EXPR, EXACT_DIV_EXPR, RDIV_EXPR, LROTATE_EXPR, RROTATE_EXPR.
        (c_pretty_printer::postfix_expression): Handle MAX_EXPR, MIN_EXPR.
        (c_pretty_printer::multiplicative_expression): Handle EXACT_DIV_EXPR,
        RDIV_EXPR.
        (pp_c_shift_expression): Handle LROTATE_EXPR, RROTATE_EXPR.

        * gcc.dg/pr35441.c: New test.

From-SVN: r247810

7 years agore PR testsuite/80643 (NA->FAIL: gcc.dg/pr79214.c gcc.dg/pr79222.c gcc.dg/pr79223...
Martin Sebor [Tue, 9 May 2017 17:32:59 +0000 (17:32 +0000)]
re PR testsuite/80643 (NA->FAIL: gcc.dg/pr79214.c gcc.dg/pr79222.c gcc.dg/pr79223.c gcc.dg/tree-ssa/builtins-folding-gimple-ub.c)

gcc/testsuite/ChangeLog:

PR testsuite/80643
* c-c++-common/Wsizeof-pointer-memaccess2.c: Prune -Wformat-overflow
output.

From-SVN: r247808

7 years agore PR c++/80186 (ICE on C++ code with invalid constructor: Segmentation fault (progra...
Paolo Carlini [Tue, 9 May 2017 16:56:34 +0000 (16:56 +0000)]
re PR c++/80186 (ICE on C++ code with invalid constructor: Segmentation fault (program cc1plus))

/cp
2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/80186
* pt.c (tsubst_decl): Early return error_mark_node if
grok_ctor_properties returns false.

/testsuite
2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/80186
* g++.dg/template/crash126.C: New.

From-SVN: r247807

7 years agoavx512f-vaddsd-2.c: Test fixed.
Sebastian Peryt [Tue, 9 May 2017 16:15:50 +0000 (18:15 +0200)]
avx512f-vaddsd-2.c: Test fixed.

* gcc.target/i386/avx512f-vaddsd-2.c: Test fixed.
* gcc.target/i386/avx512f-vaddss-2.c: Ditto.
* gcc.target/i386/avx512f-vsubsd-2.c: Ditto.
* gcc.target/i386/avx512f-vsubss-2.c: Ditto.

From-SVN: r247806

7 years agoAdd PR number.
Dominique d'Humieres [Tue, 9 May 2017 16:07:37 +0000 (18:07 +0200)]
Add PR number.

From-SVN: r247805

7 years agore PR translation/80280 (Missing closing quote (%>) c/semantics.c and c/c-typeck.c)
Martin Sebor [Tue, 9 May 2017 15:55:05 +0000 (15:55 +0000)]
re PR translation/80280 (Missing closing quote (%>) c/semantics.c and c/c-typeck.c)

gcc/ChangeLog:

PR translation/80280
* config/sol2-c.c (cmn_err_flag_specs): Initialize new data member
added in r247778.

From-SVN: r247804

7 years agocoarray_lock_7.f90: Fix dg-final regexps.
Dominique d'Humieres [Tue, 9 May 2017 15:47:02 +0000 (17:47 +0200)]
coarray_lock_7.f90: Fix dg-final regexps.

2017-05-09  Dominique d'Humieres  <dominiq@lps.ens.fr>

* gfortran.dg/coarray_lock_7.f90: Fix dg-final regexps.

From-SVN: r247803

7 years agore PR translation/80280 (Missing closing quote (%>) c/semantics.c and c/c-typeck.c)
Martin Sebor [Tue, 9 May 2017 15:39:54 +0000 (15:39 +0000)]
re PR translation/80280 (Missing closing quote (%>) c/semantics.c and c/c-typeck.c)

gcc/ChangeLog:

PR translation/80280
* config/i386/msformat-c.c (ms_printf_flag_specs): Initialize new
data member added in r247778.
(ms_scanf_flag_specs, ms_strftime_flag_specs): Same.

From-SVN: r247801

7 years ago* tree.h (tree_fits_shwi_p, tree_fits_uhwi_p): Unconditionally pure.
Nathan Sidwell [Tue, 9 May 2017 15:15:46 +0000 (15:15 +0000)]
* tree.h (tree_fits_shwi_p, tree_fits_uhwi_p): Unconditionally pure.

From-SVN: r247800

7 years ago* testsuite/24_iterators/container_access.cc (test03): Make il3 static.
Jason Merrill [Tue, 9 May 2017 15:11:19 +0000 (11:11 -0400)]
* testsuite/24_iterators/container_access.cc (test03): Make il3 static.

From-SVN: r247799

7 years ago[ARC] Add support for advanced mpy/mac instructions.
Claudiu Zissulescu [Tue, 9 May 2017 14:19:47 +0000 (16:19 +0200)]
[ARC] Add support for advanced mpy/mac instructions.

gcc/
2017-05-09  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc.c (arc_conditional_register_usage): Handle ACCL,
ACCH registers.
* config/arc/arc.md (mulsidi3): Use advanced mpy instructions when
available.
(umulsidi3): Likewise.
(mulsidi3_700): Disable this pattern when we have advanced mpy
instructions.
(umulsidi3_700): Likewise.
(maddsidi4): New pattern.
(macd, mac, mac_r, umaddsidi4, macdu, macu, macu_r): Likewise.
(mpyd_arcv2hs, mpyd_imm_arcv2hs, mpydu_arcv2hs): Likewise.
(mpydu_imm_arcv2hs): Likewise.
* config/arc/predicates.md (accl_operand): New predicate.

From-SVN: r247797

7 years ago[ARC]Fast interrupts support.
Claudiu Zissulescu [Tue, 9 May 2017 14:19:35 +0000 (16:19 +0200)]
[ARC]Fast interrupts support.

When a processor enters a fast interrupts handler, and duplicate
register banks are configured, the processor saves the user context by
saving the registers in the main register bank to these additional
registers in the duplicate register bank.  In this fast interrupt
context, when you specify the rgf_banked_regs option,the compiler does
not save the registers duplicated in the additional register bank are
not saved.

gcc/
2017-05-09  Claudiu Zissulescu  <claziss@synopsys.com>
    Andrew Burgess  <andrew.burgess@embecosm.com>

* config/arc/arc.c (ARC_AUTOBLINK_IRQ_P): Consider fast interrupts
case also.
(ARC_AUTOFP_IRQ_P): Likewise.
(ARC_AUTO_IRQ_P): Likewise.
(rgf_banked_register_count): New variable.
(parse_mrgf_banked_regs_option): New function.
(arc_override_options): Handle rgf_banked_regs option.
(arc_handle_interrupt_attribute): Add firq option.
(arc_compute_function_type): Return fast irq type when required.
(arc_must_save_register): Handle fast interrupts.
(arc_expand_prologue): Do not emit dwarf info for fast interrupts.
(arc_return_address_regs): Update.
* config/arc/arc.h (arc_return_address_regs): Update.
(arc_function_type): Add fast interrupt type.
(ARC_INTERRUPT_P): Update.
(RC_FAST_INTERRUPT_P): Define.
* config/arc/arc.md (simple_return): Update for fast interrupts.
(p_return_i): Likewise.
* config/arc/arc.opt (mrgf-banked-regs): New option.
* doc/invoke.texi (mrgf-banked-regs): Document.

testsuite/
2017-05-09  Claudiu Zissulescu  <claziss@synopsys.com>
    Andrew Burgess  <andrew.burgess@embecosm.com>

* gcc.target/arc/firq-1.c: New file.
* gcc.target/arc/firq-2.c: Likewise.
* gcc.target/arc/firq-3.c: Likewise.
* gcc.target/arc/firq-4.c: Likewise.
* gcc.target/arc/firq-5.c: Likewise.
* gcc.target/arc/firq-6.c: Likewise.

Co-Authored-By: Andrew Burgess <andrew.burgess@embecosm.com>
From-SVN: r247796

7 years ago[ARC] Automatic context save/restore for regular interrupts.
Claudiu Zissulescu [Tue, 9 May 2017 14:19:22 +0000 (16:19 +0200)]
[ARC] Automatic context save/restore for regular interrupts.

The AUX_IRQ_CTRL register controls the behavior of automated register
save and restore or prologue and epilogue sequences during a non-fast
interrupt entry and exit, and context save and restore instructions.

A user passes to the compiler the configuration of the AUX_IRQ_CTRL
register via mirq-ctrl-saved option.  This option, specifies
gneral-purposes registers that the processor saves/restores on
interrupt entry and exit, and it is only valid for ARC EM and ARC HS
cores.

gcc/
2017-05-09  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc.c (irq_ctrl_saved): New variable.
(ARC_AUTOBLINK_IRQ_P): Define.
(ARC_AUTOFP_IRQ_P): Likewise.
(ARC_AUTO_IRQ_P): Likewise.
(irq_range): New function.
(arc_must_save_register): Likewise.
(arc_must_save_return_addr): Likewise.
(arc_dwarf_emit_irq_save_regs): Likewise.
(arc_override_options): Handle deferred options.
(MUST_SAVE_REGISTER): Deleted, replaced by arc_must_save_register.
(MUST_SAVE_RETURN_ADDR): Deleted, replaced by
arc_must_save_return_addr.
(arc_compute_frame_size): Handle automated save and restore of
registers.
(arc_expand_prologue): Likewise.
(arc_expand_epilogue): Likewise.
* config/arc/arc.md (stack_irq_dwarf): New unspec instruction.
* config/arc/arc.opt (mirq-ctrl-saved): New option.
* doc/invoke.texi (mirq-ctrl-saved): Document option.

testsuite/
2017-05-09  Claudiu Zissulescu  <claziss@synopsys.com>

* gcc.target/arc/interrupt-5.c: Newfile.
* gcc.target/arc/interrupt-6.c: Likewise.
* gcc.target/arc/interrupt-7.c: Likewise.
* gcc.target/arc/interrupt-8.c: Likewise.
* gcc.target/arc/interrupt-9.c: Likewise.

From-SVN: r247795

7 years agovect-44.c: Add --param vect-max-peeling-for-alignment=0 and adjust.
Richard Biener [Tue, 9 May 2017 14:07:01 +0000 (14:07 +0000)]
vect-44.c: Add --param vect-max-peeling-for-alignment=0 and adjust.

2017-05-09  Richard Biener  <rguenther@suse.de>

* gcc.dg/vect/vect-44.c: Add --param vect-max-peeling-for-alignment=0
and adjust.
* gcc.dg/vect/vect-50.c: Likewise.

From-SVN: r247794

7 years agoPR c++/70167 - array prvalue treated as lvalue
Jason Merrill [Tue, 9 May 2017 13:48:58 +0000 (09:48 -0400)]
PR c++/70167 - array prvalue treated as lvalue

* cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
(enum fcl_t): New.
* semantics.c (finish_compound_literal): Add fcl_context parameter.
Only make a static variable for C99 syntax.
* parser.c (cp_parser_postfix_expression): Pass it.
* pt.c (tsubst_copy_and_build): Likewise.
* call.c (extend_ref_init_temps): Set
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.

From-SVN: r247793

7 years agoipa-devirt.c (default_hash_traits<type_pair>): Skip struct-scope typedefs.
Nathan Sidwell [Tue, 9 May 2017 13:03:41 +0000 (13:03 +0000)]
ipa-devirt.c (default_hash_traits<type_pair>): Skip struct-scope typedefs.

* ipa-devirt.c (default_hash_traits<type_pair>): Skip struct-scope
typedefs.

From-SVN: r247791

7 years agore PR c/80525 (-Wlogical-op confused by undefined integer overflow)
Marek Polacek [Tue, 9 May 2017 11:21:14 +0000 (11:21 +0000)]
re PR c/80525 (-Wlogical-op confused by undefined integer overflow)

PR c/80525
* c-warn.c (unwrap_c_maybe_const): New.
(warn_logical_operator): Call it.

* c-c++-common/Wlogical-op-1.c: Don't use -fwrapv anymore.
* c-c++-common/Wlogical-op-2.c: New test.

From-SVN: r247786

7 years agoc-tree.h (pushdecl): Declare.
Nathan Sidwell [Tue, 9 May 2017 11:17:45 +0000 (11:17 +0000)]
c-tree.h (pushdecl): Declare.

gcc/c/
* c-tree.h (pushdecl): Declare.
gcc/cp/
* cp-lang.c (get_global_decls, cxx_pushdecl): New.
(LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
* name-lookup.h (pushdecl_top_level): Declare.
gcc/c-family/
* c-common.c (c_register_builtin_type): Use pushdecl lang_hook.
* c-common.h (pushdecl_top_level, pushdecl): Don't declare here.
gcc/objc/
* objc-gnu-runtime-abi-01.c (objc_add_static_instance): Use
pushdecl lang_hook.

From-SVN: r247785

7 years ago* doc/invoke.texi: Fix typo.
Marek Polacek [Tue, 9 May 2017 10:53:49 +0000 (10:53 +0000)]
* doc/invoke.texi: Fix typo.

From-SVN: r247784

7 years agotree-vrp.c (vrp_val_is_max): Adjust comment.
Richard Biener [Tue, 9 May 2017 10:22:27 +0000 (10:22 +0000)]
tree-vrp.c (vrp_val_is_max): Adjust comment.

2017-05-09  Richard Biener  <rguenther@suse.de>

* tree-vrp.c (vrp_val_is_max): Adjust comment.
(vrp_val_is_min): Likewise.
(set_value_range_to_value): Likewise.
(set_value_range_to_nonnegative): Likewise.
(gimple_assign_nonzero_p): Likewise.
(gimple_stmt_nonzero_p): Likewise.
(vrp_int_const_binop): Likewise.  Remove unreachable case.
(adjust_range_with_scev): Adjust comments.
(compare_range_with_value): Likewise.
(extract_range_from_phi_node): Likewise.
(test_for_singularity): Likewise.

From-SVN: r247783

7 years agoFix broken cunroll-13.c for avr target
Senthil Kumar Selvaraj [Tue, 9 May 2017 09:59:25 +0000 (09:59 +0000)]
Fix broken cunroll-13.c for avr target

The test reports bogus failures because the loop variable i is declared
as int, and the constant expected in the dump doesn't fit in an int for avr.
Fixed by explicitly using __INT32_TYPE__ for targets with __SIZEOF_INT__ < 4.

gcc/testsuite/

2017-05-09  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

* gcc.dg/tree-ssa/cunroll-13.c: Use __INT32_TYPE__ for
for targets with __SIZEOF_INT__ < 4.

From-SVN: r247782

7 years agotree-vrp.c (get_single_symbol): Add assert that we don't get overflowed constants...
Richard Biener [Tue, 9 May 2017 08:14:44 +0000 (08:14 +0000)]
tree-vrp.c (get_single_symbol): Add assert that we don't get overflowed constants as invariant part.

2017-05-09  Richard Biener  <rguenther@suse.de>

* tree-vrp.c (get_single_symbol): Add assert that we don't
get overflowed constants as invariant part.
(compare_values_warnv): Add comment before the TREE_NO_WARNING
checks.  Use wi::cmp instead of recursing for integer constants.
(compare_values): Just ignore whether we assumed undefined
overflow instead of failing the compare.
(extract_range_for_var_from_comparison_expr): Add comment before the
TREE_NO_WARNING sets.
(test_for_singularity): Likewise.
(extract_range_from_comparison): Do not disable optimization
when we assumed undefined overflow.
(extract_range_basic): Remove init of unused var.

From-SVN: r247781

7 years agovect-50.c: Revert last change.
Richard Biener [Tue, 9 May 2017 08:07:47 +0000 (08:07 +0000)]
vect-50.c: Revert last change.

2017-05-09  Richard Biener  <rguenther@suse.de>

* gcc.dg/vect/vect-50.c: Revert last change.
* gcc.dg/vect/vect-44.c: Likewise.

From-SVN: r247780

7 years agotree-vrp.c (vrp_int_const_binop): Use wide-ints and simplify.
Richard Biener [Tue, 9 May 2017 07:57:04 +0000 (07:57 +0000)]
tree-vrp.c (vrp_int_const_binop): Use wide-ints and simplify.

2017-05-09  Richard Biener  <rguenther@suse.de>

* tree-vrp.c (vrp_int_const_binop): Use wide-ints and simplify.
(extract_range_from_multiplicative_op_1): Adjust.
(extract_range_from_binary_expr_1): Use int_const_binop.

From-SVN: r247779

7 years agoPR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c
Martin Sebor [Tue, 9 May 2017 02:47:14 +0000 (02:47 +0000)]
PR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c

gcc/c-family/ChangeLog:

PR translation/80280
* c-format.h (struct format_flag_spec): Add new member.
(T89_T): New macro.
* c-format.c (local_tree_type_node): New global.
(printf_flag_specs, asm_fprintf_flag_spec): Initialize new data.
(gcc_diag_flag_specs, scanf_flag_specs, strftime_flag_specs): Ditto.
(strfmon_flag_specs): Likewise.
(gcc_diag_char_table, gcc_cdiag_char_table): Split up specifiers
with distinct quoting properties.
(gcc_tdiag_char_table, gcc_cxxdiag_char_table): Same.
(flag_chars_t::validate): Add argument and handle bad quoting.
(check_format_info_main): Handle quoting problems.
(init_dynamic_diag_info): Simplify.

gcc/testsuite/ChangeLog:

PR translation/80280
* gcc.dg/format/gcc_diag-10.c: New test.

From-SVN: r247778

7 years agore PR target/80101 (ICE in store_data_bypass_p, at recog.c:3737)
Kelvin Nilsen [Tue, 9 May 2017 01:15:46 +0000 (01:15 +0000)]
re PR target/80101 (ICE in store_data_bypass_p, at recog.c:3737)

gcc/testsuite/ChangeLog:

2017-05-08  Kelvin Nilsen  <kelvin@gcc.gnu.org>

PR target/80101
* gcc.target/powerpc/pr80101-1.c: New test.

gcc/ChangeLog:

2017-05-08  Kelvin Nilsen  <kelvin@gcc.gnu.org>

PR target/80101
* config/rs6000/power6.md: Replace store_data_bypass_p calls with
rs6000_store_data_bypass_p in seven define_bypass directives and
in several comments.
* config/rs6000/rs6000-protos.h: Add prototype for
rs6000_store_data_bypass_p function.
* config/rs6000/rs6000.c (rs6000_store_data_bypass_p): New
function implements slightly different (rs6000-specific) semantics
than store_data_bypass_p, returning false rather than aborting
with assertion error when arguments do not satisfy the
requirements of store data bypass.
(rs6000_adjust_cost): Replace six calls of store_data_bypass_p with
rs6000_store_data_bypass_p.

From-SVN: r247777

7 years agoDaily bump.
GCC Administrator [Tue, 9 May 2017 00:16:18 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r247776

7 years agoxtensa: add support for SSP
Max Filippov [Mon, 8 May 2017 23:53:14 +0000 (23:53 +0000)]
xtensa: add support for SSP

gcc/
2017-05-08  Max Filippov  <jcmvbkbc@gmail.com>

* config/xtensa/xtensa-protos.h
        (xtensa_initial_elimination_offset): New declaration.
* config/xtensa/xtensa.c (xtensa_initial_elimination_offset):
New function. Move its body from the INITIAL_ELIMINATION_OFFSET
macro definition, add case for FRAME_POINTER_REGNUM when
FRAME_GROWS_DOWNWARD.
* config/xtensa/xtensa.h (FRAME_GROWS_DOWNWARD): New macro
definition.
(INITIAL_ELIMINATION_OFFSET): Replace body with call to
xtensa_initial_elimination_offset.

From-SVN: r247771

7 years ago* doc/invoke.texi: Alphabetize -fdump options.
Nathan Sidwell [Mon, 8 May 2017 21:52:53 +0000 (21:52 +0000)]
* doc/invoke.texi: Alphabetize -fdump options.

From-SVN: r247760

7 years agore PR translation/80280 (Missing closing quote (%>) c/semantics.c and c/c-typeck.c)
Martin Sebor [Mon, 8 May 2017 20:50:24 +0000 (20:50 +0000)]
re PR translation/80280 (Missing closing quote (%>) c/semantics.c and c/c-typeck.c)

gcc/ChangeLog:

PR translation/80280
* config/sol2-c.c (solaris_pragma_align): Correct quoting.

From-SVN: r247758

7 years agoPR c++/80178 - parameter passing for uncopyable classes
Jason Merrill [Mon, 8 May 2017 19:08:07 +0000 (15:08 -0400)]
PR c++/80178 - parameter passing for uncopyable classes

* tree.c (type_has_nontrivial_copy_init): True for classes with only
deleted copy/move ctors.
(remember_deleted_copy, maybe_warn_parm_abi): New.
* decl.c (require_complete_types_for_parms, check_function_type):
Call maybe_warn_parm_abi.
* call.c (convert_for_arg_passing, build_cxx_call): Likewise.

From-SVN: r247757

7 years agoBump C++ ABI version.
Jason Merrill [Mon, 8 May 2017 18:45:42 +0000 (14:45 -0400)]
Bump C++ ABI version.

* c-opts.c (c_common_post_options): Update defaults for
flag_abi_version and flag_abi_compat_version.

From-SVN: r247756

7 years agore PR fortran/79930 (Potentially Missed Optimisation for MATMUL / DOT_PRODUCT)
Thomas Koenig [Mon, 8 May 2017 18:22:44 +0000 (18:22 +0000)]
re PR fortran/79930 (Potentially Missed Optimisation for MATMUL / DOT_PRODUCT)

2017-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/79930
* frontend-passes.c (matmul_to_var_expr): New function,
add prototype.
(matmul_to_var_code):  Likewise.
(optimize_namespace):  Use them from gfc_code_walker.

2017-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/79930
* gfortran.dg/inline_transpose_1.f90:  Add
-finline-matmul-limit=0 to options.
* gfortran.dg/matmul_5.f90:  Likewise.
* gfortran.dg/vect/vect-8.f90: Likewise.
* gfortran.dg/inline_matmul_14.f90:  New test.
* gfortran.dg/inline_matmul_15.f90:  New test.

From-SVN: r247755

7 years agodecl.c (builtin_function_1): Set DCL_ANTICIPATED before pushing.
Nathan Sidwell [Mon, 8 May 2017 17:59:03 +0000 (17:59 +0000)]
decl.c (builtin_function_1): Set DCL_ANTICIPATED before pushing.

* decl.c (builtin_function_1): Set DCL_ANTICIPATED before pushing.
(start_preparsed_function): Do decl pushing before setting
current_funciton_decl and announcing it.

From-SVN: r247754

7 years agore PR libfortran/80602 (Reduce stack usage for blocked matmul)
Thomas Koenig [Mon, 8 May 2017 17:56:13 +0000 (17:56 +0000)]
re PR libfortran/80602 (Reduce stack usage for blocked matmul)

2017-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/80602
* m4/matmul_internal.m4:  'matmul_name`:  Change
t1 to a VLA of the required size.
        * generated/matmul_c10.c: Regenerated.
        * generated/matmul_c16.c: Regenerated.
        * generated/matmul_c4.c: Regenerated.
        * generated/matmul_c8.c: Regenerated.
        * generated/matmul_i1.c: Regenerated.
        * generated/matmul_i16.c: Regenerated.
        * generated/matmul_i2.c: Regenerated.
        * generated/matmul_i4.c: Regenerated.
        * generated/matmul_i8.c: Regenerated.
        * generated/matmul_r10.c: Regenerated.
        * generated/matmul_r16.c: Regenerated.
        * generated/matmul_r4.c: Regenerated.
        * generated/matmul_r8.c: Regenerated.

2017-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/80602
* gfortran.dg/matmul_15.f90:  New test case.

From-SVN: r247753

7 years agoname-lookup.h (pushdecl_with_scope): Replace with ...
Nathan Sidwell [Mon, 8 May 2017 17:54:55 +0000 (17:54 +0000)]
name-lookup.h (pushdecl_with_scope): Replace with ...

* name-lookup.h (pushdecl_with_scope): Replace with ...
(pushdecl_outermost_localscope): ... this.
* name-lookup.c (pushdecl_with_scope): Replace with ...
(pushdecl_outermost_localscope): ... this.
(pushdecl_namespace_level): Adjust.
* decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
* lambda.c (insert_capture_proxy): Likewise.

From-SVN: r247752

7 years agotarget.def (compute_frame_layout): New optional target hook.
Bernd Edlinger [Mon, 8 May 2017 17:44:36 +0000 (17:44 +0000)]
target.def (compute_frame_layout): New optional target hook.

2017-05-08  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * target.def (compute_frame_layout): New optional target hook.
        * doc/tm.texi.in (TARGET_COMPUTE_FRAME_LAYOUT): Add hook.
        * doc/tm.texi (TARGET_COMPUTE_FRAME_LAYOUT): Add documentation.
        * lra-eliminations.c (update_reg_eliminate): Call compute_frame_layout
        target hook.
        * reload1.c (verify_initial_elim_offsets): Likewise.
        * config/arm/arm.c (TARGET_COMPUTE_FRAME_LAYOUT): Define.
        (use_simple_return_p): Call arm_compute_frame_layout if needed.
        (arm_get_frame_offsets): Split up into this ...
        (arm_compute_frame_layout): ... and this function.

From-SVN: r247750

7 years agoTweak static assertions in std::optional
Jonathan Wakely [Mon, 8 May 2017 17:13:38 +0000 (18:13 +0100)]
Tweak static assertions in std::optional

* include/std/optional: Use a separate static_assert per condition.
* testsuite/20_util/optional/cons/value_neg.cc: Update dg-error line
numbers.

From-SVN: r247748

7 years agoclass.c (build_vtbl_initializer): Don't shadow outer variable with static var.
Nathan Sidwell [Mon, 8 May 2017 16:58:44 +0000 (16:58 +0000)]
class.c (build_vtbl_initializer): Don't shadow outer variable with static var.

* class.c (build_vtbl_initializer): Don't shadow outer variable
with static var.

From-SVN: r247747

7 years ago[AArch64] Tighten move constraints for symbolic operands
Richard Sandiford [Mon, 8 May 2017 16:18:49 +0000 (16:18 +0000)]
[AArch64] Tighten move constraints for symbolic operands

The movsi and movdi constraints allowed the source to be any
absolute symbolic expression ("S").  That's OK for operands that
have already been vetted by the aarch64_mov_operand predicate but
causes problems if the register allocator substitutes an equivalence
(the usual "the constraints can't accept more than the predicates"
restriction).

Although all other uses of "S" in the backend are redundant and could
in principle be removed, "S" itself is a publicly-documented constraint
and so we'd have to keep its definition.  This patch therefore adds a
new "Usa" constraint for legitimate absolute address operands.

2017-05-08  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* config/aarch64/constraints.md (Usa): New constraint.
* config/aarch64/aarch64.md (*movsi_aarch64, *movdi_aarch64): Use it.

From-SVN: r247746

7 years agoRevert _binding -> _value change.
Nathan Sidwell [Mon, 8 May 2017 15:51:57 +0000 (15:51 +0000)]
Revert _binding -> _value change.

* name-lookup.h (get_namespace_value, set_global_value): Rename to
...
(get_namespace_binding, set_global_binding): ... these.
* name-lookup.c (get_namespace_value, set_global_value): Rename to
...
(get_namespace_binding, set_global_binding): ... these.
(arg_assoc_namespace, pushdecl_maybe_friend_1)
check_for_out_of_scope_variable, push_overloaded_decl_1,
lookup_name_innermost_nonclass_level, push_namespace): Adjust.
* cp-tree.h (IDENTIFIER_GLOBAL_VALUE)
SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
* decl.c (poplevel): Adjust.
* pt.c (make_constrained_auto): Likewise.
((--This line, and those below, will be ignored--

M    cp/cp-tree.h
M    cp/name-lookup.c
M    cp/name-lookup.h
M    cp/decl.c
M    cp/ChangeLog
M    cp/pt.c

From-SVN: r247745

7 years ago* es.po, sv.po: Update.
Joseph Myers [Mon, 8 May 2017 15:42:27 +0000 (16:42 +0100)]
* es.po, sv.po: Update.

From-SVN: r247743

7 years agoClarify mt_allocator documentation w.r.t deallocation
Jonathan Wakely [Mon, 8 May 2017 15:09:08 +0000 (16:09 +0100)]
Clarify mt_allocator documentation w.r.t deallocation

* doc/xml/manual/mt_allocator.xml: Clarify deallocation behaviour.
* doc/html/*: Regenerate.

From-SVN: r247742

7 years agoDefine TM_MULTILIB_CONFIG for ARM multilib
Thomas Preud'homme [Mon, 8 May 2017 14:35:56 +0000 (14:35 +0000)]
Define TM_MULTILIB_CONFIG for ARM multilib

TM_MULTILIB_CONFIG is not set in config.gcc when building with multilib
for arm targets, leading to config/arm/t-multilib not including any of
the files (t-aprofile and t-rmprofile) definining the architecture and
FPU to build multilib for. This patch fixes that by setting
TM_MULTILIB_CONFIG to with_multilib_list's value after it has been
checked. It also fix a trailing whitespace issue.

2017-05-08  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * config.gcc (arm*-*-*): Set TM_MULTILIB_CONFIG from
    with_multilib_list after it has been checked.

From-SVN: r247741

7 years agotree-ssa-pre.c (bitmap_set_and): Avoid bitmap copy.
Richard Biener [Mon, 8 May 2017 13:35:29 +0000 (13:35 +0000)]
tree-ssa-pre.c (bitmap_set_and): Avoid bitmap copy.

2017-05-08  Richard Biener  <rguenther@suse.de>

* tree-ssa-pre.c (bitmap_set_and): Avoid bitmap copy.
(bitmap_set_subtract_values): Likewise.

From-SVN: r247739

7 years agotree-vrp.c (gimple_assign_nonzero_warnv_p): Rename to ...
Richard Biener [Mon, 8 May 2017 12:52:44 +0000 (12:52 +0000)]
tree-vrp.c (gimple_assign_nonzero_warnv_p): Rename to ...

2017-05-08  Richard Biener  <rguenther@suse.de>

* tree-vrp.c (gimple_assign_nonzero_warnv_p): Rename to ...
(gimple_assign_nonzero): ... this and remove strict_overflow_p
argument.
(gimple_stmt_nonzero_warnv_p): Rename to ...
(gimple_stmt_nonzero_p): ... this and remove strict_overflow_p
argument.
(vrp_stmt_computes_nonzero): Remove strict_overflow_p argument.
(extract_range_basic): Adjust, do not disable propagation on
strict overflow sensitive simplification.
(vrp_visit_cond_stmt): Likewise.

From-SVN: r247738

7 years agoThis fixes a few failures on ARM and AArch64 due to a recent change in...
Wilco Dijkstra [Mon, 8 May 2017 12:38:52 +0000 (12:38 +0000)]
This fixes a few failures on ARM and AArch64 due to a recent change in...

This fixes a few failures on ARM and AArch64 due to a recent change in
alignment peeling by switching the vector cost model off.

Tested on AArch64, ARM and x64 - committed as obvious.

    testsuite/
* gcc.dg/vect/vect-44.c: Add -fno-vect-cost-model.
* gcc.dg/vect/vect-50.c: Likewise.

From-SVN: r247737

7 years agoDaily bump.
GCC Administrator [Mon, 8 May 2017 00:16:30 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r247733

7 years agoipa-inline-analysis.c (estimate_function_body_sizes): Recompute body size uncondition...
Jan Hubicka [Sun, 7 May 2017 22:21:05 +0000 (00:21 +0200)]
ipa-inline-analysis.c (estimate_function_body_sizes): Recompute body size unconditionally.

* ipa-inline-analysis.c (estimate_function_body_sizes): Recompute
body size unconditionally.

From-SVN: r247729

7 years agore PR translation/80280 (Missing closing quote (%>) c/semantics.c and c/c-typeck.c)
Volker Reichelt [Sun, 7 May 2017 19:41:09 +0000 (19:41 +0000)]
re PR translation/80280 (Missing closing quote (%>) c/semantics.c and c/c-typeck.c)

        PR translation/80280
        * call.c (print_z_candidate): Fix quoting.

From-SVN: r247728

7 years agorevert: re PR tree-optimization/78496 (Missed opportunities for jump threading)
Jeff Law [Sun, 7 May 2017 15:10:55 +0000 (09:10 -0600)]
revert: re PR tree-optimization/78496 (Missed opportunities for jump threading)

2017-05-07  Jeff Law  <law@redhat.com>

Revert:
2017-05-06  Jeff Law  <law@redhat.com>
PR tree-optimization/78496
* tree-vrp.c (simplify_assert_expr_using_ranges): Remove debugging
code.

PR tree-optimization/78496
* tree-vrp.c (simplify_assert_expr_using_ranges): New function.
(simplify_stmt_using_ranges): Call it.
(vrp_dom_walker::before_dom_children): Extract equivalences
from an ASSERT_EXPR with an equality comparison against a
constant.

Revert:
2017-05-06  Jeff Law  <law@redhat.com>
PR tree-optimization/78496
* gcc.dg/tree-ssa/ssa-thread-16.c: New test.
* gcc.dg/tree-ssa/ssa-thread-17.c: New test.

From-SVN: r247727

7 years agoDaily bump.
GCC Administrator [Sun, 7 May 2017 00:16:25 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r247726

7 years agore PR tree-optimization/78496 (Missed opportunities for jump threading)
Jeff Law [Sat, 6 May 2017 18:20:31 +0000 (12:20 -0600)]
re PR tree-optimization/78496 (Missed opportunities for jump threading)

PR tree-optimization/78496
* tree-vrp.c (simplify_assert_expr_using_ranges): Remove debugging
code.

From-SVN: r247722

7 years agore PR tree-optimization/78496 (Missed opportunities for jump threading)
Jeff Law [Sat, 6 May 2017 15:03:40 +0000 (09:03 -0600)]
re PR tree-optimization/78496 (Missed opportunities for jump threading)

PR tree-optimization/78496
* tree-vrp.c (simplify_assert_expr_using_ranges): New function.
(simplify_stmt_using_ranges): Call it.
(vrp_dom_walker::before_dom_children): Extract equivalences
from an ASSERT_EXPR with an equality comparison against a
constant.

PR tree-optimization/78496
* gcc.dg/tree-ssa/ssa-thread-16.c: New test.
* gcc.dg/tree-ssa/ssa-thread-17.c: New test.

From-SVN: r247721

7 years agoRecord equivalences for spill registers
Richard Sandiford [Sat, 6 May 2017 07:46:48 +0000 (07:46 +0000)]
Record equivalences for spill registers

If we decide to allocate a call-clobbered register R to a value that
is live across a call, LRA will create a new spill register TMPR,
insert:

   TMPR <- R

before the call and

   R <- TMPR

after it.  But if we then failed to allocate a register to TMPR, we would
always spill it to the stack, even if R was known to be equivalent to
a constant or to some existing memory location.  And on AArch64, we'd
always fail to allocate such a register for 128-bit Advanced SIMD modes,
since no registers of those modes are call-preserved.

This patch avoids the problem by copying the equivalence information
from the original pseudo to the spill register.  It means that the
code for the testcase is as good with -O2 as it is with -O,
whereas previously the -O code was better.

[Based on the code ARM contributed in branches/ARM/sve-branch@247248]

2017-05-06  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* lra-constraints.c (lra_copy_reg_equiv): New function.
(split_reg): Use it to copy equivalence information from the
original register to the spill register.

gcc/testsuite/
* gcc.target/aarch64/spill_1.c: New test.

From-SVN: r247720

7 years agoPR 75964: Invalid integer ABS handling in simplify-rtx.c
Richard Sandiford [Sat, 6 May 2017 07:44:13 +0000 (07:44 +0000)]
PR 75964: Invalid integer ABS handling in simplify-rtx.c

RTL has no distinction between signed and unsigned values, so it
doesn't make sense to test for signed overflow.

2017-05-06  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR rtl-optimization/75964
* simplify-rtx.c (simplify_const_relational_operation): Remove
invalid handling of comparisons of integer ABS.

gcc/testsuite/
PR rtl-optimization/75964
* gcc.dg/torture/pr75964.c: New test.

From-SVN: r247719

7 years agoRemove default_packed lines from i386/avx-vtestp{d,s}*
Tom de Vries [Sat, 6 May 2017 07:31:27 +0000 (07:31 +0000)]
Remove default_packed lines from i386/avx-vtestp{d,s}*

2017-05-06  Tom de Vries  <tom@codesourcery.com>

PR testsuite/80606
* gcc.target/i386/avx-vtestpd-1.c: Remove default_packed lines.
* gcc.target/i386/avx-vtestpd-2.c: Same.
* gcc.target/i386/avx-vtestpd-256-1.c: Same.
* gcc.target/i386/avx-vtestpd-256-2.c: Same.
* gcc.target/i386/avx-vtestpd-256-3.c: Same.
* gcc.target/i386/avx-vtestpd-3.c: Same.
* gcc.target/i386/avx-vtestps-1.c: Same.
* gcc.target/i386/avx-vtestps-2.c: Same.
* gcc.target/i386/avx-vtestps-256-1.c: Same.
* gcc.target/i386/avx-vtestps-256-2.c: Same.
* gcc.target/i386/avx-vtestps-256-3.c: Same.
* gcc.target/i386/avx-vtestps-3.c: Same.

From-SVN: r247718

7 years agoAdd absolute line number comment in gcc.target/avr/progmem-error-1.cpp
Tom de Vries [Sat, 6 May 2017 07:17:16 +0000 (07:17 +0000)]
Add absolute line number comment in gcc.target/avr/progmem-error-1.cpp

2017-05-06  Tom de Vries  <tom@codesourcery.com>

* gcc.target/avr/progmem-error-1.cpp: Add abolute line number comment.

From-SVN: r247717

7 years agoReplace absolute line numbers in gcc.target/powerpc
Tom de Vries [Sat, 6 May 2017 07:17:05 +0000 (07:17 +0000)]
Replace absolute line numbers in gcc.target/powerpc

2017-05-06  Tom de Vries  <tom@codesourcery.com>

PR testsuite/80557
* gcc.target/powerpc/altivec-macros.c: Replace absolute line numbers.
* gcc.target/powerpc/altivec-types-1.c: Same.

From-SVN: r247716

7 years agoReplace absolute line numbers in gcc.target/spu
Tom de Vries [Sat, 6 May 2017 07:16:53 +0000 (07:16 +0000)]
Replace absolute line numbers in gcc.target/spu

2017-05-06  Tom de Vries  <tom@codesourcery.com>

PR testsuite/80557
* gcc.target/spu/Wmain.c: Replace absolute line numbers.
* gcc.target/spu/intrinsics-1.c: Same.

From-SVN: r247715

7 years agoReplace absolute line numbers in gcc.target/arm
Tom de Vries [Sat, 6 May 2017 07:16:43 +0000 (07:16 +0000)]
Replace absolute line numbers in gcc.target/arm

2017-05-06  Tom de Vries  <tom@codesourcery.com>

PR testsuite/80557
* gcc.target/arm/pr69180.c: Replace absolute line numbers.

From-SVN: r247714

7 years agoReplace absolute line numbers in gcc.target/aarch64
Tom de Vries [Sat, 6 May 2017 07:16:33 +0000 (07:16 +0000)]
Replace absolute line numbers in gcc.target/aarch64

2017-05-06  Tom de Vries  <tom@codesourcery.com>

PR testsuite/80557
* gcc.target/aarch64/spellcheck_1.c: Replace absolute line numbers.
* gcc.target/aarch64/spellcheck_2.c: Same.
* gcc.target/aarch64/spellcheck_3.c: Same.

From-SVN: r247713

7 years agoReplace absolute line numbers in g++.dg/{debug,goacc}
Tom de Vries [Sat, 6 May 2017 07:16:17 +0000 (07:16 +0000)]
Replace absolute line numbers in g++.dg/{debug,goacc}

2017-05-06  Tom de Vries  <tom@codesourcery.com>

PR testsuite/80557
* g++.dg/debug/dwarf2/dwarf2-1.C: Replace absolute line numbers.
* g++.dg/debug/dwarf2/dwarf2-2.C: Same.
* g++.dg/debug/dwarf2/pr46123-2.C: Same.
* g++.dg/debug/dwarf2/typedef5.C: Same.
* g++.dg/goacc/data-1.C: Same.

From-SVN: r247712

7 years agoi386.c (ext_80387_constant_init): Do not explicitly initialize to zero.
Uros Bizjak [Sat, 6 May 2017 07:01:51 +0000 (09:01 +0200)]
i386.c (ext_80387_constant_init): Do not explicitly initialize to zero.

* config/i386/i386.c (ext_80387_constant_init): Do not explicitly
initialize to zero.
(init_regs): Remove declaration.
(function_arg_advance_32): Initialize error_p as boolean variable.

From-SVN: r247711

7 years agoAdd fuchsia support to libgcc
Joshua Conner [Sat, 6 May 2017 00:22:38 +0000 (00:22 +0000)]
Add fuchsia support to libgcc

* config/arm/unwind-arm.h (_Unwind_decode_typeinfo_ptr): Use
pc-relative indirect handling for fuchsia.
* config/t-slibgcc-fuchsia: New file.
* config.host (*-*-fuchsia*, aarch64*-*-fuchsia*, arm*-*-fuchsia*,
x86_64-*-fuchsia*): Add definitions.

From-SVN: r247710

7 years agoDaily bump.
GCC Administrator [Sat, 6 May 2017 00:16:44 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r247709

7 years agostore-motion.c (remove_reachable_equiv_notes): Reformat long lines.
Nathan Sidwell [Fri, 5 May 2017 23:24:41 +0000 (23:24 +0000)]
store-motion.c (remove_reachable_equiv_notes): Reformat long lines.

* store-motion.c (remove_reachable_equiv_notes): Reformat long
lines.  Use for (;;).

From-SVN: r247705

7 years agors6000.c (rs6000_vect_nonmem): New static var.
Bill Schmidt [Fri, 5 May 2017 21:27:54 +0000 (21:27 +0000)]
rs6000.c (rs6000_vect_nonmem): New static var.

[gcc]

2017-05-05  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

* config/rs6000/rs6000.c (rs6000_vect_nonmem): New static var.
(rs6000_init_cost): Initialize rs6000_vect_nonmem.
(rs6000_add_stmt_cost): Update rs6000_vect_nonmem.
(rs6000_finish_cost): Avoid vectorizing simple copy loops with
VF=2 that require versioning.

[gcc/testsuite]

2017-05-05  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

* gcc.target/powerpc/versioned-copy-loop.c: New file.

From-SVN: r247671

7 years agoConvert CARET_LINE_MARGIN to const int
David Malcolm [Fri, 5 May 2017 21:07:38 +0000 (21:07 +0000)]
Convert CARET_LINE_MARGIN to const int

gcc/ChangeLog:
* diagnostic.h (CARET_LINE_MARGIN): Convert from macro to const
int.

From-SVN: r247666

7 years agoConvert diagnostic_override_option_index from macro to inline function
David Malcolm [Fri, 5 May 2017 21:05:15 +0000 (21:05 +0000)]
Convert diagnostic_override_option_index from macro to inline function

gcc/ChangeLog:
* diagnostic.h (diagnostic_override_option_index): Convert from
macro to inline function.

From-SVN: r247665

7 years agoGet rid of macros for diagnostic_report_current_module
David Malcolm [Fri, 5 May 2017 21:03:07 +0000 (21:03 +0000)]
Get rid of macros for diagnostic_report_current_module

diagnostic.h has a couple of macros (diagnostic_last_module_changed
and diagnostic_set_last_module) which are only used within
diagnostic_report_current_module.

This patch eliminates the macros in favor of static functions within
diagnostic.c.

No functional change intended.

gcc/ChangeLog:
* diagnostic.c (last_module_changed_p): New function.
(set_last_module): New function.
(diagnostic_report_current_module): Convert macro usage to
the above functions.
* diagnostic.h (diagnostic_context::last_module): Strengthen
from const line_map * to const line_map_ordinary *.
(diagnostic_last_module_changed): Delete macro.
(diagnostic_set_last_module): Delete macro.

From-SVN: r247664

7 years agoEliminate report_diagnostic macro
David Malcolm [Fri, 5 May 2017 21:01:05 +0000 (21:01 +0000)]
Eliminate report_diagnostic macro

This patch eliminates the report_diagnostic macro, manually
expanding it in all sites in the code.

No functional change intended.

gcc/c-family/ChangeLog:
* c-common.c (c_cpp_error): Replace report_diagnostic
with diagnostic_report_diagnostic.

gcc/c/ChangeLog:
* c-decl.c (warn_defaults_to): Replace report_diagnostic
with diagnostic_report_diagnostic.
* c-errors.c (pedwarn_c99): Likewise.
(pedwarn_c90): Likewise.

gcc/cp/ChangeLog:
* error.c (pedwarn_cxx98): Replace report_diagnostic
with diagnostic_report_diagnostic.

gcc/ChangeLog:
* diagnostic.c (diagnostic_impl): Replace report_diagnostic
with diagnostic_report_diagnostic.
(diagnostic_n_impl_richloc): Likewise.
* diagnostic.h (report_diagnostic): Delete macro.
* rtl-error.c (diagnostic_for_asm): Replace report_diagnostic
with diagnostic_report_diagnostic.
* substring-locations.c (format_warning_va): Likewise.

gcc/fortran/ChangeLog:
* cpp.c (cb_cpp_error): Replace report_diagnostic
with diagnostic_report_diagnostic.
* error.c (gfc_warning): Likewise.
(gfc_warning_now_at): Likewise.
(gfc_warning_now): Likewise.
(gfc_warning_internal): Likewise.
(gfc_error_now): Likewise.
(gfc_fatal_error): Likewise.
(gfc_error_opt): Likewise.
(gfc_internal_error): Likewise.

From-SVN: r247663

7 years agodiagnostic.c: add print_option_information
David Malcolm [Fri, 5 May 2017 20:56:36 +0000 (20:56 +0000)]
diagnostic.c: add print_option_information

This patch simplifies diagnostic_report_diagnostic by moving
option-printing to a new subroutine.

Doing so required a slight rewrite.  In both the old and new
code, context->option_name returns a malloc-ed string.
The old behavior was to then use ACONCAT to manipulate the
format_spec, appending the option metadata.
ACONCAT calcs the buffer size, then uses alloca, and then copies the
data to the on-stack buffer.

Given the alloca, this needs rewriting when moving the printing to
a subroutine.  In the new version, the metadata is simply printed
using pp_* calls (so it's hitting the obstack within the
pretty_printer).

This means we can get rid of the save/restore of format_spec: I don't
believe anything else in the code modifies it.

It also seems inherently simpler; it seems odd to me to be
appending metadata to the formatting string, rather than simply
printing the metadata after the formatted string is printed
(the old code also assumed that no option name contained a '%').

No functional change intended.

gcc/ChangeLog:
* diagnostic.c (diagnostic_report_diagnostic): Eliminate
save/restor of format_spec.  Move option-printing code to...
(print_option_information): ...this new function, and
reimplement by simply printing to the pretty_printer,
rather than appending to the format string.

From-SVN: r247661

7 years agodiagnostic_report_diagnostic: refactor pragma-handling
David Malcolm [Fri, 5 May 2017 20:51:18 +0000 (20:51 +0000)]
diagnostic_report_diagnostic: refactor pragma-handling

This patch simplifies diagnostic_report_diagnostic by moving the
pragma-handling logic into a subroutine.

No functional change intended.

gcc/ChangeLog:
* diagnostic.c (diagnostic_report_diagnostic): Split out pragma
handling logic into...
(update_effective_level_from_pragmas): ...this new function.

From-SVN: r247660

7 years agoRISC-V: Add -mstrict-align option
Andrew Waterman [Fri, 5 May 2017 20:24:46 +0000 (20:24 +0000)]
RISC-V: Add -mstrict-align option

The RISC-V user ISA permits misaligned accesses, but they may trap
and be emulated.  That emulation software needs to be compiled assuming
strict alignment.

Even when strict alignment is not required, set SLOW_UNALIGNED_ACCESS
based upon -mtune to avoid a performance pitfall.

gcc/ChangeLog:

2017-05-04  Andrew Waterman  <andrew@sifive.com>

* config/riscv/riscv.opt (mstrict-align): New option.
* config/riscv/riscv.h (STRICT_ALIGNMENT): Use it.  Update comment.
(SLOW_UNALIGNED_ACCESS): Define.
(riscv_slow_unaligned_access): Declare.
* config/riscv/riscv.c (riscv_tune_info): Add slow_unaligned_access
field.
(riscv_slow_unaligned_access): New variable.
(rocket_tune_info): Set slow_unaligned_access to true.
(optimize_size_tune_info): Set slow_unaligned_access to false.
(riscv_cpu_info_table): Add entry for optimize_size_tune_info.
(riscv_valid_lo_sum_p): Use TARGET_STRICT_ALIGN.
(riscv_option_override): Set riscv_slow_unaligned_access.
        * doc/invoke.texi: Add -mstrict-align to RISC-V.

From-SVN: r247659

7 years agoRISC-V: Unify indention in riscv.md
Kito Cheng [Fri, 5 May 2017 20:24:38 +0000 (20:24 +0000)]
RISC-V: Unify indention in riscv.md

This contains only whitespace changes.

gcc/ChangeLog

2017-05-04  Kito Cheng  <kito.cheng@gmail.com>

* config/riscv/riscv.md: Unify indentation.

From-SVN: r247658

7 years agore PR target/79038 (Improve PowerPC ISA 3.0 conversion between integers and hardware...
Michael Meissner [Fri, 5 May 2017 20:21:15 +0000 (20:21 +0000)]
re PR target/79038 (Improve PowerPC ISA 3.0 conversion between integers and hardware _Float128)

[gcc]
2017-05-05  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/79038
PR target/79202
PR target/79203
* config/rs6000/rs6000.md (u code attribute): Add FIX and
UNSIGNED_FIX.
(extendsi<mode>2): Add support for doing sign extension via
VUPKHSW and XXPERMDI if the value is in Altivec registers and we
don't have ISA 3.0 instructions.
(extendsi<mode>2 splitter): Likewise.
(fix_trunc<mode>si2): If we are at ISA 2.07 (VSX small integer),
generate the normal insns since SImode can now go in vector
registers.  Disallow the special UNSPECs needed for previous
machines to hide SImode being used.  Add new insns
fctiw{,w}_<mode>_smallint if SImode can go in vector registers.
(fix_trunc<mode>si2_stfiwx): Likewise.
(fix_trunc<mode>si2_internal): Likewise.
(fixuns_trunc<mode>si2): Likewise.
(fixuns_trunc<mode>si2_stfiwx): Likewise.
(fctiw<u>z_<mode>_smallint): Likewise.
(fctiw<u>z_<mode>_mem): New combiner pattern to prevent conversion
of floating point to 32-bit integer from doing a direct move to
the GPR registers to do a store.
(fctiwz_<mode>): Break long line.

[gcc/testsuite]
2017-05-05  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/79038
PR target/79202
PR target/79203
* gcc.target/powerpc/ppc-round3.c: New test.
* gcc.target/powerpc/ppc-round2.c: Update expected code.

From-SVN: r247657

7 years agocp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
Nathan Sidwell [Fri, 5 May 2017 20:04:45 +0000 (20:04 +0000)]
cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.

* cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
(SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
(IDENTIFIER_NAMESPACE_VALUE): Delete.
* name-lookup.h (namespace_binding, set_namespace_binding):
Replace
with ...
(get_namespace_value, set_global_value): ... these.
(get_global_value_if_present, is_typename_at_global_scope):
Delete.
* decl.c (poplevel): Use get_namespace_value.
(grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
* class.c (build_vtbl_initializer): Stash library decl in
static var. Use IDENTIFIER_GLOBAL_VALUE.
* except.c (do_get_exception_ptr, do_begin_catch, do_end_catch)
do_allocate_exception, do_free_exception, build_throw): Likewise.
* init.c (throw_bad_array_new_length): Likewise.
* rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
* name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1)
check_for_our_of_scope_variable, push_overloaded_decl_1): Use
get_namespace_value.
(set_namespace_binding_1): Rename to
(set_namespace_binding): ... here.
(set_global_value): New.
(lookup_name_innermost_nonclass_level_1, push_namespace): Use
get_namespace_value.
* pt.c (listify): Use get_namespace_value.
((--This line, and those below, will be ignored--

M    cp/name-lookup.c
M    cp/name-lookup.h
M    cp/ChangeLog
M    cp/except.c
M    cp/class.c
M    cp/pt.c
M    cp/init.c
M    cp/cp-tree.h
M    cp/decl.c
M    cp/rtti.c

From-SVN: r247654

7 years agoMakefile.in (GTFILES): Add tree-ssa-loop-ivopts.c.
Bin Cheng [Fri, 5 May 2017 18:34:45 +0000 (18:34 +0000)]
Makefile.in (GTFILES): Add tree-ssa-loop-ivopts.c.

* Makefile.in (GTFILES): Add tree-ssa-loop-ivopts.c.
* tree-ssa-loop-ivopts.c (compute_max_addr_offset): Delete.
(addr_list, addr_offset_valid_p): New.
(split_address_groups): Check offset validity with above function.
(gt-tree-ssa-loop-ivopts.h): Include header file.

From-SVN: r247653