platform/upstream/gcc.git
6 years agoPR libgfortran/83649 Chunk large reads and writes
Janne Blomqvist [Tue, 2 Jan 2018 13:25:10 +0000 (15:25 +0200)]
PR libgfortran/83649 Chunk large reads and writes

It turns out that Linux never reads or writes more than 2147479552
bytes in a single syscall. For writes this is not a problem as
libgfortran already contains a loop around write() to handle short
writes. But for reads we cannot do this, since then read will hang if
we have a short read when reading from the terminal.  Also, there are
reports that macOS fails I/O's larger than 2 GB.  Thus, to work around
these issues do large reads/writes in chunks.

The testcase from the PR

program largewr
  integer(kind=1) :: a(2_8**31+1)
  a = 0
  a(size(a, kind=8)) = 1
  open(10, file="largewr.dat", access="stream", form="unformatted")
  write (10) a
  close(10)
  a(size(a, kind=8)) = 2
  open(10, file="largewr.dat", access="stream", form="unformatted")
  read (10) a
  if (a(size(a, kind=8)) == 1) then
    print *, "All is well"
  else
    print *, "Oh no"
  end if
end program largewr

fails on trunk but works with the patch.

Regtested on x86_64-pc-linux-gnu, committed to trunk.

libgfortran/ChangeLog:

2018-01-02  Janne Blomqvist  <jb@gcc.gnu.org>

PR libgfortran/83649
* io/unix.c (MAX_CHUNK): New define.
(raw_read): For reads larger than MAX_CHUNK, loop.
(raw_write): Write no more than MAX_CHUNK bytes per iteration.

From-SVN: r256074

6 years agore PR target/81616 (Update -mtune=generic for the current Intel and AMD processors)
Jan Hubicka [Tue, 2 Jan 2018 13:04:19 +0000 (14:04 +0100)]
re PR target/81616 (Update -mtune=generic for the current Intel and AMD processors)

PR target/81616
* config/i386/x86-tune-costs.h: Increase cost of integer load costs
for generic 4->6.

From-SVN: r256073

6 years agoipa-inline.c (big_speedup_p): Fix expression.
Richard Biener [Tue, 2 Jan 2018 12:35:53 +0000 (12:35 +0000)]
ipa-inline.c (big_speedup_p): Fix expression.

2018-01-02  Richard Biener  <rguenther@suse.de>

* ipa-inline.c (big_speedup_p): Fix expression.

From-SVN: r256072

6 years agoadd comment about why valid
Nathan Sidwell [Tue, 2 Jan 2018 12:35:02 +0000 (12:35 +0000)]
add comment about why valid

From-SVN: r256071

6 years agore PR target/81616 (Update -mtune=generic for the current Intel and AMD processors)
Jan Hubicka [Tue, 2 Jan 2018 09:31:47 +0000 (10:31 +0100)]
re PR target/81616 (Update -mtune=generic for the current Intel and AMD processors)

PR target/81616
* x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
cond_taken_branch_cost 3->4.

From-SVN: r256070

6 years agore PR lto/83452 (FAIL: gfortran.dg/save_6.f90 -O0 (test for excess errors))
Richard Biener [Tue, 2 Jan 2018 08:45:05 +0000 (08:45 +0000)]
re PR lto/83452 (FAIL: gfortran.dg/save_6.f90   -O0  (test for excess errors))

2017-01-02  Richard Biener  <rguenther@suse.de>

PR lto/83452
* simple-object-elf.c (simple_object_elf_copy_lto_debug_section):
Do not use UNDEF locals for removed symbols but instead just
define them in the first prevailing section and with no name.
Use the same gnu_lto_v1 name for all removed globals we promote to
WEAK UNDEFs so hpux can use a stub to provide this symbol.  Clear
sh_info and sh_link in removed sections.

From-SVN: r256069

6 years agoDaily bump.
GCC Administrator [Tue, 2 Jan 2018 00:16:16 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r256068

6 years agore PR fortran/83076 (ICE in gfc_deallocate_scalar_with_status, at fortran/trans.c...
Paul Thomas [Mon, 1 Jan 2018 17:36:41 +0000 (17:36 +0000)]
re PR fortran/83076 (ICE in gfc_deallocate_scalar_with_status, at fortran/trans.c:1598)

2018-01-01  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83076
* resolve.c (resolve_fl_derived0): Add caf_token fields for
allocatable and pointer scalars, when -fcoarray selected.
* trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token
field as well as the backend_decl.
(gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module
derived types that are not vtypes. Components with caf_token
attribute are pvoid types. For a component requiring it, find
the caf_token field and have the component token field point to
its backend_decl.

PR fortran/83319
*trans-types.c (gfc_get_array_descriptor_base): Add the token
field to the descriptor even when codimen not set.

2018-01-01  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83076
* gfortran.dg/coarray_45.f90 : New test.

PR fortran/83319
* gfortran.dg/coarray_46.f90 : New test.

From-SVN: r256065

6 years ago* es.po: Update.
Joseph Myers [Mon, 1 Jan 2018 00:17:27 +0000 (00:17 +0000)]
* es.po: Update.

From-SVN: r256059

6 years agoDaily bump.
GCC Administrator [Mon, 1 Jan 2018 00:16:12 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r256058

6 years agore PR tree-optimization/83581 (ICE in expand_LOOP_VECTORIZED, at internal-fn.c:2397)
Jakub Jelinek [Sun, 31 Dec 2017 23:53:17 +0000 (00:53 +0100)]
re PR tree-optimization/83581 (ICE in expand_LOOP_VECTORIZED, at internal-fn.c:2397)

PR tree-optimization/83581
* tree-loop-distribution.c (pass_loop_distribution::execute): Return
TODO_cleanup_cfg if any changes have been made.

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

From-SVN: r256055

6 years agore PR c/83595 (ICE: in linemap_macro_map_lookup, at libcpp/line-map.c:1008 on invalid...
Jakub Jelinek [Sun, 31 Dec 2017 23:52:41 +0000 (00:52 +0100)]
re PR c/83595 (ICE: in linemap_macro_map_lookup, at libcpp/line-map.c:1008 on invalid code)

PR c/83595
* c-parser.c (c_parser_braced_init, c_parser_initelt,
c_parser_conditional_expression, c_parser_cast_expression,
c_parser_sizeof_expression, c_parser_alignof_expression,
c_parser_postfix_expression, c_parser_omp_declare_reduction,
c_parser_transaction_expression): Use set_error () method instead
of setting value member to error_mark_node.

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

From-SVN: r256054

6 years agore PR rtl-optimization/83608 (ICE in convert_move, at expr.c:229 in GIMPLE store...
Jakub Jelinek [Sun, 31 Dec 2017 23:52:01 +0000 (00:52 +0100)]
re PR rtl-optimization/83608 (ICE in convert_move, at expr.c:229 in GIMPLE store merging pass)

PR middle-end/83608
* expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
convert_modes if target mode has the right side, but different mode
class.

* g++.dg/opt/pr83608.C: New test.

From-SVN: r256053

6 years agore PR tree-optimization/83609 (ICE in read_complex_part at gcc/expr.c:3202)
Jakub Jelinek [Sun, 31 Dec 2017 23:51:14 +0000 (00:51 +0100)]
re PR tree-optimization/83609 (ICE in read_complex_part at gcc/expr.c:3202)

PR middle-end/83609
* expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
last argument when extracting from CONCAT.  If either from_real or
from_imag is NULL, use expansion through memory.  If result is not
a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
the parts directly to inner mode, if even that fails, use expansion
through memory.

* gcc.dg/pr83609.c: New test.
* g++.dg/opt/pr83609.C: New test.

From-SVN: r256052

6 years agore PR middle-end/83623 (ICE: in convert_move, at expr.c:248 with -march=knl and 16bit...
Jakub Jelinek [Sun, 31 Dec 2017 23:50:32 +0000 (00:50 +0100)]
re PR middle-end/83623 (ICE: in convert_move, at expr.c:248 with -march=knl and 16bit vector bswap/rotate)

PR middle-end/83623
* expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
check for bswap in mode rather than HImode and use that in expand_unop
too.

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

From-SVN: r256051

6 years ago* gcc.target/i386/i386.exp
Jakub Jelinek [Sun, 31 Dec 2017 23:49:42 +0000 (00:49 +0100)]
* gcc.target/i386/i386.exp
(check_effective_target_avx512vpopcntdqvl): New proc.
* gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Use
avx512vpopcntdqvl effective target rather than avx512vpopcntdq.
* gcc.target/i386/avx512vpopcntdqvl-vpopcntq-1.c: Likewise.

From-SVN: r256050

6 years agore PR target/83536 (One 'false' too much in r255699 for mingw target (in config/i386...
Jakub Jelinek [Sun, 31 Dec 2017 13:28:00 +0000 (14:28 +0100)]
re PR target/83536 (One 'false' too much in r255699 for mingw target (in config/i386/i386.c))

PR target/83536
* config/i386/i386.c (ix86_attribute_table): Remove excess
initializer for "shared" attribute.

From-SVN: r256049

6 years agoDaily bump.
GCC Administrator [Sun, 31 Dec 2017 00:16:17 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r256048

6 years agoPrune removed funcs from offload table
Tom de Vries [Sat, 30 Dec 2017 17:02:00 +0000 (17:02 +0000)]
Prune removed funcs from offload table

2017-12-30  Tom de Vries  <tom@codesourcery.com>

PR libgomp/83046
* omp-expand.c (expand_omp_target): If in_lto_p, mark offload_funcs with
DECL_PRESERVE_P.
* lto-streamer-out.c (prune_offload_funcs): New function.  Remove
offload_funcs entries that no longer have a corresponding cgraph_node.
Mark the remaining ones as DECL_PRESERVE_P.
(output_lto): Call prune_offload_funcs.

* testsuite/libgomp.oacc-c-c++-common/pr83046.c: New test.
* testsuite/libgomp.c-c++-common/pr83046.c: New test.

From-SVN: r256045

6 years agosse.md (vgf2p8affineinvqb_<mode><mask_name>, [...]): Formatting fixes.
Jakub Jelinek [Sat, 30 Dec 2017 16:01:50 +0000 (17:01 +0100)]
sse.md (vgf2p8affineinvqb_<mode><mask_name>, [...]): Formatting fixes.

* config/i386/sse.md (vgf2p8affineinvqb_<mode><mask_name>,
vgf2p8affineqb_<mode><mask_name>, vgf2p8mulb_<mode><mask_name>,
vpshrd_<mode><mask_name>, vpshld_<mode><mask_name>,
vpshrdv_<mode>, vpshrdv_<mode>_mask, vpshrdv_<mode>_maskz,
vpshrdv_<mode>_maskz_1, vpshldv_<mode>, vpshldv_<mode>_mask,
vpshldv_<mode>_maskz, vpshldv_<mode>_maskz_1, vpdpbusd_<mode>,
vpdpbusd_<mode>_mask, vpdpbusd_<mode>_maskz, vpdpbusd_<mode>_maskz_1,
vpdpbusds_<mode>, vpdpbusds_<mode>_mask, vpdpbusds_<mode>_maskz,
vpdpbusds_<mode>_maskz_1, vpdpwssd_<mode>, vpdpwssd_<mode>_mask,
vpdpwssd_<mode>_maskz, vpdpwssd_<mode>_maskz_1, vpdpwssds_<mode>,
vpdpwssds_<mode>_mask, vpdpwssds_<mode>_maskz,
vpdpwssds_<mode>_maskz_1, vaesdec_<mode>, vaesdeclast_<mode>,
vaesenc_<mode>, vpclmulqdq_<mode>,
avx512vl_vpshufbitqmb<mode><mask_scalar_merge_name>): Formatting fixes.

From-SVN: r256044

6 years agoFix filename in ChangeLog entry for r256042
Tom de Vries [Sat, 30 Dec 2017 10:44:39 +0000 (10:44 +0000)]
Fix filename in ChangeLog entry for r256042

From-SVN: r256043

6 years agoFix 'memory cannot be printed' in c-c++-common/ubsan/object-size-9.c
Tom de Vries [Sat, 30 Dec 2017 10:31:54 +0000 (10:31 +0000)]
Fix 'memory cannot be printed' in c-c++-common/ubsan/object-size-9.c

2017-12-30  Tom de Vries  <tom@codesourcery.com>

PR testsuite/83612
* c-c++-common/ubsan/object-size-9.c (t): Add alignment attribute.

From-SVN: r256042

6 years agoDaily bump.
GCC Administrator [Sat, 30 Dec 2017 00:16:12 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r256039

6 years agore PR libfortran/83613 (Executing gfortran.dg/inquire_internal.f90 hangs on darwin...
Jerry DeLisle [Fri, 29 Dec 2017 22:36:25 +0000 (22:36 +0000)]
re PR libfortran/83613 (Executing gfortran.dg/inquire_internal.f90 hangs on darwin after r255621)

2017-12-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libgfortran/83613
        * io/unit.c (init_units): Don't forget to unlock the unit locks
        after being inserted.

From-SVN: r256035

6 years agore PR fortran/83560 (list-directed formatting of INTEGER is missing plus on output...
Jerry DeLisle [Fri, 29 Dec 2017 19:25:31 +0000 (19:25 +0000)]
re PR fortran/83560 (list-directed formatting of INTEGER is missing plus on output when output open with SIGN='PLUS')

2017-12-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libgfortran/83560
        * io/write.c (write_integer): Modify to use write_decimal.
        For namelist mode, suppress leading blanks and emit them as
        trailing blanks. Change parameter from len to kind for better
        readability. (nml_write_obj): Fix comment style.

From-SVN: r256034

6 years agore PR fortran/83567 (Parametrized derived types: Segmentation fault when assigning...
Paul Thomas [Fri, 29 Dec 2017 14:27:59 +0000 (14:27 +0000)]
re PR fortran/83567 (Parametrized derived types: Segmentation fault when assigning a function return value)

2017-12-28  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83567
* trans-expr.c (gfc_trans_assignment_1): Free parameterized
components of the lhs if dealloc is set.
*trans-decl.c (gfc_trans_deferred_vars): Do not free the
parameterized components of function results on leaving scope.

2017-12-28  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83567
* gfortran.dg/pdt_26.f90 : New test.

From-SVN: r256033

6 years agonamedret2.C (f): Return a value.
Uros Bizjak [Fri, 29 Dec 2017 11:23:14 +0000 (12:23 +0100)]
namedret2.C (f): Return a value.

* g++.old-deja/g++.ext/namedret2.C (f): Return a value.

From-SVN: r256032

6 years agonamedret1.C (f): Return a value.
Uros Bizjak [Fri, 29 Dec 2017 11:21:10 +0000 (12:21 +0100)]
namedret1.C (f): Return a value.

* g++.old-deja/g++.ext/namedret1.C (f): Return a value.

From-SVN: r256031

6 years agoDaily bump.
GCC Administrator [Fri, 29 Dec 2017 00:16:13 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r256030

6 years agobuiltins.def: (_Float<N> and _Float<N>X BUILT_IN_CEIL): Add _Float<N> and _Float...
Michael Meissner [Thu, 28 Dec 2017 21:19:12 +0000 (21:19 +0000)]
builtins.def: (_Float<N> and _Float<N>X BUILT_IN_CEIL): Add _Float<N> and _Float<N>X variants...

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

* builtins.def: (_Float<N> and _Float<N>X BUILT_IN_CEIL): Add
_Float<N> and _Float<N>X variants for rounding built-in
functions.
(_Float<N> and _Float<N>X BUILT_IN_FLOOR): Likewise.
(_Float<N> and _Float<N>X BUILT_IN_NEARBYINT): Likewise.
(_Float<N> and _Float<N>X BUILT_IN_RINT): Likewise.
(_Float<N> and _Float<N>X BUILT_IN_ROUND): Likewise.
(_Float<N> and _Float<N>X BUILT_IN_TRUNC): Likewise.
* builtins.c (mathfn_built_in_2): Likewise.
* internal-fn.def (CEIL): Likewise.
(FLOOR): Likewise.
(NEARBYINT): Likewise.
(RINT): Likewise.
(ROUND): Likewise.
(TRUNC): Likewise.
* convert.c (convert_to_integer_1): Likewise.
* fold-const.c (tree_call_nonnegative_warnv_p): Likewise.
(integer_valued_real_call_p): Likewise.
* fold-const-call.c (fold_const_call_ss): Likewise.
* gencfn-macros.c (print_case_cfn): Change CFN and operator
printers to take a const char * suffix instead of a bool.
(print_define_operator_list): Likewise.
(fltall_suffixes): New list of suffixes, that include the
traditional suffixes as well as all of the _Float<N> and
_Float<N>X suffixes.
(main): For _Float<N> and _Float<N>X functions, emit both
<name>_FN and <name>_ALL variants.  The <macro>_FN variant only
has the _Float<N> and _Float<N>X case names or operators.  The
<name>_ALL variant has both the traditional and the
_Float<N>/_Float<N>X case names or operators.
* match.pd (COPYSIGN optimizations): Provide optimizations for
_Float<N> and _Float<N>X types where possible.
(MIN/MAX optimizations): Likewise.
(sqrt optimizations): Likewise.
(rounding optimizations): Likewise.

[gcc/c]
2017-12-28  Michael Meissner  <meissner@linux.vnet.ibm.com>

* c-decl.c (header_for_builtin_fn): Add integer rounding _Float<N>
and _Float<N>X built-in functions.

From-SVN: r256026

6 years ago[rs6000] Use gen_int_mode in ieee_128bit_negative_zero
Richard Sandiford [Thu, 28 Dec 2017 20:42:43 +0000 (20:42 +0000)]
[rs6000] Use gen_int_mode in ieee_128bit_negative_zero

Previously we'd generate a non-canonical zero-extended CONST_INT
instead of a sign-extended one, which tripped the assert for
canonical CONST_INTs after a later patch.

2017-12-28  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* config/powerpcspe/powerpcspe.md (ieee_128bit_negative_zero): Use
gen_int_mode rather than GEN_INT.
* config/rs6000/rs6000.md (ieee_128bit_negative_zero): Likewise.

From-SVN: r256024

6 years agoUse valid_for_const_vector_p instead of CONSTANT_P
Richard Sandiford [Thu, 28 Dec 2017 20:40:20 +0000 (20:40 +0000)]
Use valid_for_const_vector_p instead of CONSTANT_P

This patch makes the VEC_SERIES code use valid_for_const_vector_p
instead of CONSTANT_P, to match what we already do for VEC_DUPLICATE.
This showed up as a failure in gcc.c-torture/execute/pr28982b.c for -m32
on x86_64-linux-gnu after later patches.

2017-12-28  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* emit-rtl.c (gen_const_vec_series): Use valid_for_const_vector_p
instead of CONSTANT_P.
(gen_vec_series): Likewise.
* simplify-rtx.c (simplify_binary_operation_1): Likewise.

From-SVN: r256023

6 years agore PR fortran/83548 (Compilation Error using logical function in parameter)
Steven G. Kargl [Thu, 28 Dec 2017 20:19:01 +0000 (20:19 +0000)]
re PR fortran/83548 (Compilation Error using logical function in parameter)

2017-12-28  Steven G. Kargl  <kargl@gcc.gnu.org>

PR Fortran/83548
* match.c (gfc_match_type_spec): Check for LOGICAL conflict in
type-spec versus LOGICAL intrinsic subprogram.

2017-12-28  Steven G. Kargl  <kargl@gcc.gnu.org>

PR Fortran/83548
* gfortran.dg/array_constructor_type_22.f03: New test.

From-SVN: r256022

6 years agoPR fortran/83344 Don't set bogus constant value
Janne Blomqvist [Thu, 28 Dec 2017 18:49:12 +0000 (20:49 +0200)]
PR fortran/83344 Don't set bogus constant value

This patch does not fix PR 83344, but merely fixes an error where we
used to set a constant character length value from a non-constant
expression, and thus set it to some bogus value.

As a result of this, I have commented out part of the associate_22.f90
test which otherwise generates a warning message.

Regtested on x86_64-pc-linux-gnu.

gcc/fortran/ChangeLog:

2017-12-28  Janne Blomqvist  <jb@gcc.gnu.org>

PR fortran/83344
* resolve.c (resolve_assoc_var): Don't set the constant value
unless the target is a constant expression.

gcc/testsuite/ChangeLog:

2017-12-28  Janne Blomqvist  <jb@gcc.gnu.org>

PR fortran/83344
* gfortran.dg/associate_22.f90: Comment out part of test.

From-SVN: r256021

6 years agom68k.md (ashrdi3_const1, [...]): Add CC_STATUS_INIT.
Andreas Schwab [Thu, 28 Dec 2017 16:28:44 +0000 (16:28 +0000)]
m68k.md (ashrdi3_const1, [...]): Add CC_STATUS_INIT.

* config/m68k/m68k.md (ashrdi3_const1, lshrdi3_const1): Add
CC_STATUS_INIT.

From-SVN: r256020

6 years agore PR fortran/83567 (Parametrized derived types: Segmentation fault when assigning...
Paul Thomas [Thu, 28 Dec 2017 13:22:36 +0000 (13:22 +0000)]
re PR fortran/83567 (Parametrized derived types: Segmentation fault when assigning a function return value)

2017-12-28  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83567
* trans-expr.c (gfc_trans_assignment_1): Free parameterized
components of the lhs if dealloc is set.
*trans-decl.c (gfc_trans_deferred_vars): Do not free the
parameterized components of function results on leaving scope.

2017-12-28  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83567
* gfortran.dg/pdt_26.f90 : New test.

From-SVN: r256019

6 years agoDaily bump.
GCC Administrator [Thu, 28 Dec 2017 00:16:12 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r256017

6 years agoPR libstdc++/83600 fix end iterator for unready std::match_results
Jonathan Wakely [Wed, 27 Dec 2017 22:18:08 +0000 (22:18 +0000)]
PR libstdc++/83600 fix end iterator for unready std::match_results

PR libstdc++/83600
* include/bits/regex.h (match_results::end()): Return valid iterator
when not ready.
* testsuite/28_regex/match_results/ctors/char/default.cc: Check that
unready objects are empty and have equal begin and end iterators.
* testsuite/28_regex/match_results/ctors/wchar_t/default.cc: Likewise.

From-SVN: r256014

6 years agoPR libstdc++/83598 don't modify flags passed to std::basic_regex constructors
Jonathan Wakely [Wed, 27 Dec 2017 22:18:02 +0000 (22:18 +0000)]
PR libstdc++/83598 don't modify flags passed to std::basic_regex constructors

PR libstdc++/83598
* include/bits/regex.h (basic_regex): Don't modify flags passed to
constructors.
* testsuite/28_regex/basic_regex/ctors/83598.cc: New test.

From-SVN: r256013

6 years agoPR libstdc++/83538 fix std::match_results<T>::reference (LWG 2306)
Jonathan Wakely [Wed, 27 Dec 2017 19:43:33 +0000 (19:43 +0000)]
PR libstdc++/83538 fix std::match_results<T>::reference (LWG 2306)

PR libstdc++/83538
* doc/xml/manual/intro.xml: Document LWG 2306 change.
* include/bits/regex.h (match_results::reference): Change to
non-const reference.
* testsuite/28_regex/match_results/typedefs.cc: Check types are
correct.

From-SVN: r256012

6 years ago2017_12_27 Louis Krupp <louis.krupp@zoho.com>
Louis Krupp [Wed, 27 Dec 2017 19:20:12 +0000 (19:20 +0000)]
2017_12_27  Louis Krupp  <louis.krupp@zoho.com>

PR fortran/83092
* expr.c (gfc_apply_init): Check that typespec has character type
before using character length field.

2017_12_27  Louis Krupp  <louis.krupp@zoho.com>

PR fortran/83092
* gfortran.dg/init_char_with_nonchar_ctr.f90: New test.

From-SVN: r256011

6 years agoaarch64-simd.md (aarch64_ld1x2<VQ:mode>): New.
Kugan Vivekanandarajah [Wed, 27 Dec 2017 11:47:45 +0000 (11:47 +0000)]
aarch64-simd.md (aarch64_ld1x2<VQ:mode>): New.

gcc/ChangeLog:

2017-12-27  Kugan Vivekanandarajah  <kuganv@linaro.org>

* config/aarch64/aarch64-simd.md (aarch64_ld1x2<VQ:mode>): New.
(aarch64_ld1x2<VDC:mode>): Likewise.
(aarch64_simd_ld1<mode>_x2): Likewise.
(aarch64_simd_ld1<mode>_x2): Likewise.
* config/aarch64/arm_neon.h (vld1_u8_x2): New.
(vld1_s8_x2): Likewise.
(vld1_u16_x2): Likewise.
(vld1_s16_x2): Likewise.
(vld1_u32_x2): Likewise.
(vld1_s32_x2): Likewise.
(vld1_u64_x2): Likewise.
(vld1_s64_x2): Likewise.
(vld1_f16_x2): Likewise.
(vld1_f32_x2): Likewise.
(vld1_f64_x2): Likewise.
(vld1_p8_x2): Likewise.
(vld1_p16_x2): Likewise.
(vld1_p64_x2): Likewise.
(vld1q_u8_x2): Likewise.
(vld1q_s8_x2): Likewise.
(vld1q_u16_x2): Likewise.
(vld1q_s16_x2): Likewise.
(vld1q_u32_x2): Likewise.
(vld1q_s32_x2): Likewise.
(vld1q_u64_x2): Likewise.
(vld1q_s64_x2): Likewise.
(vld1q_f16_x2): Likewise.
(vld1q_f32_x2): Likewise.
(vld1q_f64_x2): Likewise.
(vld1q_p8_x2): Likewise.
(vld1q_p16_x2): Likewise.
(vld1q_p64_x2): Likewise.

gcc/testsuite/ChangeLog:

2017-12-27  Kugan Vivekanandarajah  <kuganv@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vld1x2.c: New test.

From-SVN: r256010

6 years agoAssign result of get_string_lenth to a SSA_NAME (PR tree-optimization/83552).
Martin Liska [Wed, 27 Dec 2017 09:30:14 +0000 (10:30 +0100)]
Assign result of get_string_lenth to a SSA_NAME (PR tree-optimization/83552).

2017-12-27  Martin Liska  <mliska@suse.cz>

PR tree-optimization/83552
* tree-ssa-strlen.c (fold_strstr_to_strncmp): Assign result
of get_string_lenth to a SSA_NAME if not a GIMPLE value.
2017-12-27  Martin Liska  <mliska@suse.cz>

PR tree-optimization/83552
* gcc.dg/pr83552.c: New test.

From-SVN: r256009

6 years agoWorkaround PR83046 in gang-static-2.c
Tom de Vries [Wed, 27 Dec 2017 07:50:04 +0000 (07:50 +0000)]
Workaround PR83046 in gang-static-2.c

2017-12-27  Tom de Vries  <tom@codesourcery.com>

PR c++/83046
* testsuite/libgomp.oacc-c-c++-common/gang-static-2.c (test_static)
(test_nonstatic): Fix return type to workaround PR83046.

From-SVN: r256008

6 years agoDisable -gstatement-frontiers for nvptx
Tom de Vries [Wed, 27 Dec 2017 07:49:51 +0000 (07:49 +0000)]
Disable -gstatement-frontiers for nvptx

2017-12-27  Tom de Vries  <tom@codesourcery.com>

* config/nvptx/nvptx.c (nvptx_option_override): Disable
-gstatement-frontiers.

From-SVN: r256007

6 years agoDaily bump.
GCC Administrator [Wed, 27 Dec 2017 00:16:12 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r256006

6 years agore PR fortran/83540 (Invalid code with MATMUL, -fno-realloc-lhs -ffrontend-optimize)
Thomas Koenig [Tue, 26 Dec 2017 23:29:20 +0000 (23:29 +0000)]
re PR fortran/83540 (Invalid code with MATMUL, -fno-realloc-lhs -ffrontend-optimize)

2017-12-26  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/83540
* frontend-passes.c (create_var): If an array to be created
has unknown size and -fno-realloc-lhs is in effect,
return NULL.

2017-12-26  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/83540
* gfortran.dg/inline_matmul_20.f90: New test.

From-SVN: r256003

6 years agoUse relative line number in unroll-5.c
Tom de Vries [Tue, 26 Dec 2017 16:56:22 +0000 (16:56 +0000)]
Use relative line number in unroll-5.c

2017-12-26  Tom de Vries  <tom@codesourcery.com>

* c-c++-common/unroll-5.c: Use relative line number.

From-SVN: r256002

6 years agosel-sched: fix zero-usefulness case in sel_rank_for_schedule (PR 83513)
Alexander Monakov [Tue, 26 Dec 2017 14:34:33 +0000 (17:34 +0300)]
sel-sched: fix zero-usefulness case in sel_rank_for_schedule (PR 83513)

PR rtl-optimization/83513
* sel-sched.c (sel_rank_for_schedule): Order by non-zero usefulness
before priority comparison.

From-SVN: r256001

6 years agoDaily bump.
GCC Administrator [Tue, 26 Dec 2017 00:16:15 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r256000

6 years agore PR target/83488 (ICE on a CET test-case)
Jakub Jelinek [Mon, 25 Dec 2017 11:59:17 +0000 (12:59 +0100)]
re PR target/83488 (ICE on a CET test-case)

PR target/83488
* config/i386/i386.opt (-mavx512vpopcntdq, -mmavx512bitalg): Move from
ix86_isa_flags2 to ix86_isa_flags.
* config/i386/i386-c.c (ix86_target_macros_internal): Test
OPTION_MASK_ISA_AVX512BITALG and OPTION_MASK_ISA_AVX512VPOPCNTDQ in
isa_flags rather than isa_flags2.
* config/i386/i386.c (ix86_target_string): Move -mavx512vpopcntdq
and -mavx512bitalg from isa2_opts to isa_opts.
(ix86_option_override_internal): Test OPTION_MASK_ISA_AVX512VPOPCNTDQ
in x_ix86_isa_flags_explicit rather than x_ix86_isa_flags2_explicit
and set it in x_ix86_isa_flags rather than x_ix86_isa_flags2.
Formatting fixes.
(def_builtin): Treat OPTION_MASK_ISA_AVX512BW or
OPTION_MASK_ISA_AVX512F ored with another option similarly to
OPTION_MASK_ISA_AVX512VL.  Even for OPTION_MASK_ISA_AVX512VL don't
clear it if mask is just OPTION_MASK_ISA_AVX512VL itself.
(ix86_expand_builtin): Don't handle OPTION_MASK_ISA_GFNI and
OPTION_MASK_ISA_VPCLMULQDQ specially, instead handle
OPTION_MASK_ISA_AVX512BW and OPTION_MASK_ISA_AVX512F that way.
* config/i386/i386-builtin.def: Move AVX512VPOPCNTDQ and AVX512BITALG
builtins from bdesc_args2 to bdesc_args section.
(__builtin_ia32_compressstoreuqi512_mask,
__builtin_ia32_compressstoreuhi512_mask,
__builtin_ia32_compressstoreuqi256_mask,
__builtin_ia32_expandloadqi512_mask,
__builtin_ia32_expandloadqi512_maskz,
__builtin_ia32_expandloadhi512_mask,
__builtin_ia32_expandloadhi512_maskz,
__builtin_ia32_compressqi512_mask, __builtin_ia32_compresshi512_mask,
__builtin_ia32_compressqi256_mask, __builtin_ia32_expandqi512_mask,
__builtin_ia32_expandqi512_maskz, __builtin_ia32_expandhi512_mask,
__builtin_ia32_expandhi512_maskz, __builtin_ia32_expandqi256_mask,
__builtin_ia32_expandqi256_maskz, __builtin_ia32_vpshrd_v32hi_mask,
__builtin_ia32_vpshld_v32hi_mask, __builtin_ia32_vpshrdv_v32hi_mask,
__builtin_ia32_vpshrdv_v32hi_maskz, __builtin_ia32_vpshldv_v32hi_mask,
__builtin_ia32_vpshldv_v32hi_maskz,
__builtin_ia32_vpopcountb_v64qi_mask,
__builtin_ia32_vpopcountw_v32hi_mask,
__builtin_ia32_vpshufbitqmb512_mask,
__builtin_ia32_vpshufbitqmb256_mask): Add
" | OPTION_MASK_ISA_AVX512BW".
(__builtin_ia32_expandloadqi256_mask,
__builtin_ia32_expandloadqi256_maskz,
__builtin_ia32_vpopcountb_v32qi_mask): Add
" | OPTION_MASK_ISA_AVX512VL | OPTION_MASK_ISA_AVX512BW".
(__builtin_ia32_expandloadhi256_mask,
__builtin_ia32_expandloadhi256_maskz,
__builtin_ia32_expandloadqi128_mask,
__builtin_ia32_expandloadqi128_maskz,
__builtin_ia32_expandloadhi128_mask,
__builtin_ia32_expandloadhi128_maskz,
__builtin_ia32_vpshrd_v16hi, __builtin_ia32_vpshrd_v16hi_mask,
__builtin_ia32_vpshrd_v8hi, __builtin_ia32_vpshrd_v8hi_mask,
__builtin_ia32_vpshrd_v8si, __builtin_ia32_vpshrd_v8si_mask,
__builtin_ia32_vpshrd_v4si, __builtin_ia32_vpshrd_v4si_mask,
__builtin_ia32_vpshrd_v4di, __builtin_ia32_vpshrd_v4di_mask,
__builtin_ia32_vpshrd_v2di, __builtin_ia32_vpshrd_v2di_mask,
__builtin_ia32_vpshld_v16hi, __builtin_ia32_vpshld_v16hi_mask,
__builtin_ia32_vpshld_v8hi, __builtin_ia32_vpshld_v8hi_mask,
__builtin_ia32_vpshld_v8si, __builtin_ia32_vpshld_v8si_mask,
__builtin_ia32_vpshld_v4si, __builtin_ia32_vpshld_v4si_mask,
__builtin_ia32_vpshld_v4di, __builtin_ia32_vpshld_v4di_mask,
__builtin_ia32_vpshld_v2di, __builtin_ia32_vpshld_v2di_mask,
__builtin_ia32_vpshrdv_v16hi, __builtin_ia32_vpshrdv_v16hi_mask,
__builtin_ia32_vpshrdv_v16hi_maskz, __builtin_ia32_vpshrdv_v8hi,
__builtin_ia32_vpshrdv_v8hi_mask, __builtin_ia32_vpshrdv_v8hi_maskz,
__builtin_ia32_vpshrdv_v8si, __builtin_ia32_vpshrdv_v8si_mask,
__builtin_ia32_vpshrdv_v8si_maskz, __builtin_ia32_vpshrdv_v4si,
__builtin_ia32_vpshrdv_v4si_mask, __builtin_ia32_vpshrdv_v4si_maskz,
__builtin_ia32_vpshrdv_v4di, __builtin_ia32_vpshrdv_v4di_mask,
__builtin_ia32_vpshrdv_v4di_maskz, __builtin_ia32_vpshrdv_v2di,
__builtin_ia32_vpshrdv_v2di_mask, __builtin_ia32_vpshrdv_v2di_maskz,
__builtin_ia32_vpshldv_v16hi, __builtin_ia32_vpshldv_v16hi_mask,
__builtin_ia32_vpshldv_v16hi_maskz, __builtin_ia32_vpshldv_v8hi,
__builtin_ia32_vpshldv_v8hi_mask, __builtin_ia32_vpshldv_v8hi_maskz,
__builtin_ia32_vpshldv_v8si, __builtin_ia32_vpshldv_v8si_mask,
__builtin_ia32_vpshldv_v8si_maskz, __builtin_ia32_vpshldv_v4si,
__builtin_ia32_vpshldv_v4si_mask, __builtin_ia32_vpshldv_v4si_maskz,
__builtin_ia32_vpshldv_v4di, __builtin_ia32_vpshldv_v4di_mask,
__builtin_ia32_vpshldv_v4di_maskz, __builtin_ia32_vpshldv_v2di,
__builtin_ia32_vpshldv_v2di_mask, __builtin_ia32_vpshldv_v2di_maskz,
__builtin_ia32_vpopcountb_v32qi, __builtin_ia32_vpopcountb_v16qi,
__builtin_ia32_vpopcountb_v16qi_mask, __builtin_ia32_vpopcountw_v16hi,
__builtin_ia32_vpopcountw_v16hi_mask, __builtin_ia32_vpopcountw_v8hi,
__builtin_ia32_vpopcountw_v8hi_mask): Add
" | OPTION_MASK_ISA_AVX512VL".
* config/i386/avx512vbmi2intrin.h (_mm512_shrdi_epi16,
_mm512_shrdi_epi32, _mm512_mask_shrdi_epi32, _mm512_maskz_shrdi_epi32,
_mm512_shrdi_epi64, _mm512_mask_shrdi_epi64, _mm512_maskz_shrdi_epi64,
_mm512_shldi_epi16, _mm512_shldi_epi32, _mm512_mask_shldi_epi32,
_mm512_maskz_shldi_epi32, _mm512_shldi_epi64, _mm512_mask_shldi_epi64,
_mm512_maskz_shldi_epi64, _mm512_shrdv_epi16, _mm512_shrdv_epi32,
_mm512_mask_shrdv_epi32, _mm512_maskz_shrdv_epi32, _mm512_shrdv_epi64,
_mm512_mask_shrdv_epi64, _mm512_maskz_shrdv_epi64, _mm512_shldv_epi16,
_mm512_shldv_epi32, _mm512_mask_shldv_epi32, _mm512_maskz_shldv_epi32,
_mm512_shldv_epi64, _mm512_mask_shldv_epi64,
_mm512_maskz_shldv_epi64): Don't require avx512bw for these intrinsics.
* config/i386/avx512bitalgintrin.h (_mm_bitshuffle_epi64_mask,
_mm_mask_bitshuffle_epi64_mask): Likewise.
* common/config/i386/i386-common.c
(OPTION_MASK_ISA_AVX512VPOPCNTDQ_SET,
OPTION_MASK_ISA_AVX512BITALG_SET): Or in OPTION_MASK_ISA_AVX512F_SET.
(OPTION_MASK_ISA_AVX512F_UNSET): Or in
OPTION_MASK_ISA_AVX512VPOPCNTDQ_UNSET and
OPTION_MASK_ISA_AVX512BITALG_UNSET.
(OPTION_MASK_ISA2_AVX512F_UNSET,
OPTION_MASK_ISA2_GENERAL_REGS_ONLY_UNSET): Define.
(ix86_handle_option): For -mno-general-regs-only, clear from
ix86_isa_flags2 OPTION_MASK_ISA2_GENERAL_REGS_ONLY_UNSET rather than
just OPTION_MASK_ISA_MPX.  For -mno-sse{,2,3,4,4.1,4.2,avx,avx2} and
-mno-ssse3 clear OPTION_MASK_ISA2_AVX512F_UNSET bits from
ix86_isa_flags2.  For -mno-avx512f likewise, instead of masking
individually listed ISAs.  For -m{,no-}avx512{vpopcntdq,bitalg} adjust
for moving from ix86_isa_flags2 to ix86_isa_flags.

From-SVN: r255997

6 years agoDaily bump.
GCC Administrator [Mon, 25 Dec 2017 00:16:17 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r255996

6 years agore PR libstdc++/83237 (Values returned by std::poisson_distribution are not distribut...
Michele Pezzutti [Sun, 24 Dec 2017 22:08:52 +0000 (23:08 +0100)]
re PR libstdc++/83237 (Values returned by std::poisson_distribution are not distributed correctly)

2017-12-24  Michele Pezzutti <mpezz@tiscali.it>

PR libstdc++/83237
* include/bits/random.tcc (poisson_distribution<>::operator()):
Fix __x = 1 case - see updated Errata of Devroye's treatise.
* testsuite/26_numerics/random/poisson_distribution/operators/
values.cc: Add test.
* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error
line number.

From-SVN: r255993

6 years agoPR libstdc++/83450 avoid -Wreturn-type warning in test
Jonathan Wakely [Sun, 24 Dec 2017 09:17:38 +0000 (09:17 +0000)]
PR libstdc++/83450 avoid -Wreturn-type warning in test

PR libstdc++/83450
* testsuite/21_strings/basic_string/pthread18185.cc: Add return
statement.

From-SVN: r255992

6 years agoDaily bump.
GCC Administrator [Sun, 24 Dec 2017 00:16:16 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r255991

6 years agore PR c++/83553 (compiler removes body of the for-loop, although there is a case...
Jakub Jelinek [Sat, 23 Dec 2017 08:40:19 +0000 (09:40 +0100)]
re PR c++/83553 (compiler removes body of the for-loop, although there is a case label inside)

PR c++/83553
* fold-const.c (struct contains_label_data): New type.
(contains_label_1): Return non-NULL even for CASE_LABEL_EXPR, unless
inside of a SWITCH_BODY seen during the walk.
(contains_label_p): Use walk_tree instead of
walk_tree_without_duplicates, prepare data for contains_label_1 and
provide own pset.

* c-c++-common/torture/pr83553.c: New test.

From-SVN: r255987

6 years agoDaily bump.
GCC Administrator [Sat, 23 Dec 2017 00:16:12 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r255986

6 years agore PR debug/83550 (Bad location of DW_TAG_structure_type with forward declaration...
Jakub Jelinek [Fri, 22 Dec 2017 18:04:18 +0000 (19:04 +0100)]
re PR debug/83550 (Bad location of DW_TAG_structure_type with forward declaration since r224161)

PR debug/83550
* c-decl.c (finish_struct): Set DECL_SOURCE_LOCATION on
TYPE_STUB_DECL and call rest_of_type_compilation before processing
incomplete vars rather than after it.

* c-c++-common/dwarf2/pr83550.c: New test.

From-SVN: r255981

6 years agore PR debug/83547 ((statement-frontiers) error: void value not ignored as it ought...
Jakub Jelinek [Fri, 22 Dec 2017 18:01:58 +0000 (19:01 +0100)]
re PR debug/83547 ((statement-frontiers) error: void value not ignored as it ought to be)

PR debug/83547
* tree-iterator.c (alloc_stmt_list): Start with cleared
TREE_SIDE_EFFECTS regardless whether a new STATEMENT_LIST is allocated
or old one reused.
c/
* c-typeck.c (c_finish_stmt_expr): Ignore !TREE_SIDE_EFFECTS as
indicator of ({ }), instead skip all trailing DEBUG_BEGIN_STMTs first,
and consider empty ones if there are no other stmts.  For
-Wunused-value walk all statements before the one only followed by
DEBUG_BEGIN_STMTs.
testsuite/
* gcc.c-torture/compile/pr83547.c: New test.

From-SVN: r255980

6 years agore PR target/83488 (ICE on a CET test-case)
Jakub Jelinek [Fri, 22 Dec 2017 18:00:41 +0000 (19:00 +0100)]
re PR target/83488 (ICE on a CET test-case)

PR target/83488
* config/i386/avx512vnniintrin.h: Don't check for __AVX512F__ nor
enable avx512f explicitly in #pragma GCC target.
* config/i386/i386-builtin.def (__builtin_ia32_vpdpbusd_v8si,
__builtin_ia32_vpdpbusd_v8si_mask, __builtin_ia32_vpdpbusd_v8si_maskz,
__builtin_ia32_vpdpbusd_v4si, __builtin_ia32_vpdpbusd_v4si_mask,
__builtin_ia32_vpdpbusd_v4si_maskz, __builtin_ia32_vpdpbusds_v8si,
__builtin_ia32_vpdpbusds_v8si_mask,
__builtin_ia32_vpdpbusds_v8si_maskz, __builtin_ia32_vpdpbusds_v4si,
__builtin_ia32_vpdpbusds_v4si_mask,
__builtin_ia32_vpdpbusds_v4si_maskz, __builtin_ia32_vpdpwssd_v8si,
__builtin_ia32_vpdpwssd_v8si_mask, __builtin_ia32_vpdpwssd_v8si_maskz,
__builtin_ia32_vpdpwssd_v4si, __builtin_ia32_vpdpwssd_v4si_mask,
__builtin_ia32_vpdpwssd_v4si_maskz, __builtin_ia32_vpdpwssds_v8si,
__builtin_ia32_vpdpwssds_v8si_mask,
__builtin_ia32_vpdpwssds_v8si_maskz, __builtin_ia32_vpdpwssds_v4si,
__builtin_ia32_vpdpwssds_v4si_mask,
__builtin_ia32_vpdpwssds_v4si_maskz): Use
OPTION_MASK_ISA_AVX512VNNI | OPTION_MASK_ISA_AVX512VL instead of
just OPTION_MASK_ISA_AVX512VNNI.

* gcc.target/i386/pr83488-2.c: New test.
* gcc.target/i386/pr83488-3.c: New test.

From-SVN: r255979

6 years ago[PR 82027] Also stream opt_info of former_clones
Martin Jambor [Fri, 22 Dec 2017 17:03:16 +0000 (18:03 +0100)]
[PR 82027] Also stream opt_info of former_clones

2017-12-22  Martin Jambor  <mjambor@suse.cz>

PR lto/82027
* lto-cgraph.c (output_cgraph_opt_summary_p): Also check former
clones.

testsuite/
* g++.dg/lto/pr82027_0.C: New test.

From-SVN: r255978

6 years agocompiler: do not propagate address-taken of a slice element to the slice
Ian Lance Taylor [Fri, 22 Dec 2017 16:43:28 +0000 (16:43 +0000)]
compiler: do not propagate address-taken of a slice element to the slice

    Array_index_expression may be used for indexing/slicing array or
    slice. If a slice element is address taken, the slice itself is
    not necessarily address taken. Only propagate address-taken for
    arrays.

    Reviewed-on: https://go-review.googlesource.com/83877

From-SVN: r255977

6 years agocompiler: bring escape analysis mostly in line with gc compiler
Ian Lance Taylor [Fri, 22 Dec 2017 15:55:10 +0000 (15:55 +0000)]
compiler: bring escape analysis mostly in line with gc compiler

    This CL ports the latest (~Go 1.10) escape analysis code from
    the gc compiler. Changes include:

    - In the gc compiler, the variable expression is represented
      with the variable node itself (ONAME). It is the same node
      used in the AST for multiple var expressions for the same
      variable. In our case, the var expressions nodes are distinct
      nodes. We need to propagate the escape state from/to the
      underlying variable in getter and setter. We already do it in
      the setter. Do it in the getter as well.

    - At the point of escape analysis, some AST constructs have not
      been lowered to runtime calls, for example, map literal
      construction and some builtin calls. Change the analysis to
      work on the non-lowered AST constructs instead of call
      expressions for them. For this to work, the analysis needs to
      look into Builtin_call_expression. Move its class definition
      from expressions.cc to expressions.h, and add necessary
      accessors. Also fix bugs in other runtime call handlings
      (selectsend, ifaceX2Y2, etc.).

    - Handle closures properly. The analysis tracks the function
      reference expression, and the escape state is propagated to
      the underlying heap expression for get_backend to do stack
      allocation for non-escaping closures.

    - Fix add_dereference. Before, this was doing expr->deref(),
      which undoes an indirection instead of add one. In the gc
      compiler, it adds a level of indirection, which is modeled as
      an OIND node regardless of the type of the expression. We
      can't do this for non-pointer typed expression, otherwise it
      will result in a type error. Instead, we model it with a
      special flavor of Node, "indirect". The flood phase handles
      this by incrementing its level.

    - Slicing of an array was not handled correctly. The gc compiler
      has an implicit (compiler inserted) OADDR node for the array,
      so the analysis is actually performed on the address of the
      array. We don't have this implicit address-of expression in
      the AST. Instead, we model this by adding an implicit child to
      the Node of the Array_index_expression representing slicing of
      an array.

    - Array_index_expression may represent indexing or slicing. The
      code distinguishes them by looking at whether the type of the
      expression is a slice. This does not work if the slice element
      is a slice. Instead, check whether its end() is NULL.

    - Temporary references was handled only in a limited case, as
      part of address-of expression. This CL handles it in general.
      The analysis uses the Temporary_statement as the point of
      tracking, and forwards Temporary_reference_expression to the
      underlying statement when needed.

    - Handle call return value flows, escpecially multiple return
      values. This includes porting part of CL 8202, CL 20102, and
      other fixes.

    - Support go:noescape pragma.

    - Add special handling for self assignment like
      b.buf = b.buf[m:n]. (CL 3162)

    - Remove ESCAPE_SCOPE, which was treated essentially the same as
      ESCAPE_HEAP, and was removed from the gc compiler. (CL 32130)

    - Run flood phase until fix point. (CL 30693)

    - Unnamed parameters do not escape. (CL 38600)

    - Various small bug fixes and improvements.

    "make check-go" passes except the one test in math/big, when the
    escape analysis is on. The escape analysis is still not run by
    default.

    Reviewed-on: https://go-review.googlesource.com/83876

From-SVN: r255976

6 years agoEnable AVX512BITALG
Julia Koval [Fri, 22 Dec 2017 12:37:16 +0000 (13:37 +0100)]
Enable AVX512BITALG

gcc/
* common/config/i386/i386-common.c (OPTION_MASK_ISA_AVX512BITALG_SET,
OPTION_MASK_ISA_AVX512BITALG_UNSET): New.
(ix86_handle_option): Handle -mavx512bitalg, fix 4VNNIW formatting.
* config.gcc: Add avx512vpopcntdqvlintrin.h and avx512bitalgintrin.h.
* config/i386/avx512bitalgintrin.h (_mm512_popcnt_epi8, _mm512_popcnt_epi16,
_mm512_mask_popcnt_epi8, _mm512_maskz_popcnt_epi8, _mm512_mask_popcnt_epi16,
_mm512_maskz_popcnt_epi16, _mm512_bitshuffle_epi64_mask, _mm256_popcnt_epi8,
_mm512_mask_bitshuffle_epi64_mask, _mm256_mask_popcnt_epi8, _mm_popcnt_epi8,
_mm256_maskz_popcnt_epi8, _mm_bitshuffle_epi64_mask, _mm256_popcnt_epi16,
_mm_mask_bitshuffle_epi64_mask, _mm256_bitshuffle_epi64_mask,
_mm256_mask_bitshuffle_epi64_mask, _mm_popcnt_epi16, _mm_maskz_popcnt_epi8,
_mm256_mask_popcnt_epi16, _mm256_maskz_popcnt_epi16, _mm_mask_popcnt_epi8,
_mm_mask_popcnt_epi16, _mm_maskz_popcnt_epi16): New intrinsics.
* config/i386/avx512vpopcntdqvlintrin.h (_mm_popcnt_epi32, _mm_popcnt_epi64,
_mm_mask_popcnt_epi32, _mm_maskz_popcnt_epi32, _mm256_popcnt_epi32,
_mm256_mask_popcnt_epi32, _mm256_maskz_popcnt_epi32, _mm_mask_popcnt_epi64,
_mm_maskz_popcnt_epi64, _mm256_popcnt_epi64, _mm256_mask_popcnt_epi64,
_mm256_maskz_popcnt_epi64): New intrinsics.
* config/i386/cpuid.h (bit_AVX512BITALG): New bit.
* config/i386/driver-i386.c (host_detect_local_cpu): Detect -mavx512bitalg.
* config/i386/i386-builtin-types.def (V64QI_FTYPE_V64QI, V64QI_FTYPE_V64QI,
V4DI_FTYPE_V4DI, UHI_FTYPE_V2DI_V2DI_UHI, USI_FTYPE_V4DI_V4DI_USI,
V4SI_FTYPE_V4SI_V4SI_UHI, V8SI_FTYPE_V8SI_V8SI_UHI): New types.
* config/i386/i386-builtin.def (__builtin_ia32_vpopcountq_v4di,
__builtin_ia32_vpopcountq_v4di_mask, __builtin_ia32_vpopcountq_v2di,
__builtin_ia32_vpopcountq_v2di_mask, __builtin_ia32_vpopcountd_v4si,
__builtin_ia32_vpopcountd_v4si_mask, __builtin_ia32_vpopcountd_v8si,
__builtin_ia32_vpopcountd_v8si_mask, __builtin_ia32_vpopcountb_v64qi,
__builtin_ia32_vpopcountb_v64qi_mask, __builtin_ia32_vpopcountb_v32qi,
__builtin_ia32_vpopcountb_v32qi_mask, __builtin_ia32_vpopcountb_v16qi,
__builtin_ia32_vpopcountb_v16qi_mask, __builtin_ia32_vpopcountw_v32hi,
__builtin_ia32_vpopcountw_v32hi_mask, __builtin_ia32_vpopcountw_v16hi,
__builtin_ia32_vpopcountw_v16hi_mask, __builtin_ia32_vpopcountw_v8hi,
__builtin_ia32_vpopcountw_v8hi_mask, __builtin_ia32_vpshufbitqmb128_mask,
__builtin_ia32_vpshufbitqmb256_mask,
__builtin_ia32_vpshufbitqmb512_mask): New builtins.
* config/i386/i386-c.c (__AVX512BITALG__): New.
* config/i386/i386.c (isa2_opts): Add -mavx512bitalg.
(ix86_valid_target_attribute_inner_p): Ditto.
(ix86_expand_args_builtin): Handle new types.
* config/i386/i386.h (TARGET_AVX512BITALG, TARGET_AVX512BITALG_P): New.
* config/i386/i386.opt: Add -mavx512bitalg.
* config/i386/immintrin.h: Add avx512vpopcntdqvlintrin.h and
avx512bitalgintrin.h.
* config/i386/sse.md (VI48_AVX512VLBW): New iterator.
(vpopcount<mode><mask_name>): Add more types.
(avx512vl_vpshufbitqmb<mode><mask_scalar_merge_name>): New.
* doc/invoke.texi: Add -mavx512bitalg and -mavx512vpopcntdq.
gcc/testsuite/
* g++.dg/other/i386-2.C: Add new options.
* g++.dg/other/i386-3.C: Ditto.
* gcc.target/i386/sse-12.c: Ditto.
* gcc.target/i386/sse-13.c: Ditto.
* gcc.target/i386/sse-22.c: Ditto.
* gcc.target/i386/sse-23.c: Ditto.
* gcc.target/i386/avx512-check.h: Handle bit_AVX512BITALG.
* gcc.target/i386/avx512bitalg-vpopcntb-1.c: New.
* gcc.target/i386/avx512bitalg-vpopcntb.c: Ditto.
* gcc.target/i386/avx512bitalg-vpopcntbvl.c: Ditto.
* gcc.target/i386/avx512bitalg-vpopcntw-1.c: Ditto.
* gcc.target/i386/avx512bitalg-vpopcntw.c: Ditto.
* gcc.target/i386/avx512bitalg-vpopcntwvl.c: Ditto.
* gcc.target/i386/avx512bitalg-vpshufbitqmb-1.c: Ditto.
* gcc.target/i386/avx512bitalg-vpshufbitqmb.c: Ditto.
* gcc.target/i386/avx512bitalgvl-vpopcntb-1.c: Ditto.
* gcc.target/i386/avx512bitalgvl-vpopcntw-1.c: Ditto.
* gcc.target/i386/avx512bitalgvl-vpshufbitqmb-1.c: Ditto.
* gcc.target/i386/avx512vpopcntdqvl-vpopcntd-1.c: Ditto.
* gcc.target/i386/avx512vpopcntdqvl-vpopcntq-1.c: Ditto.
* gcc.target/i386/i386.exp (check_effective_target_avx512bitalg): New.
* gcc.target/i386/avx512vpopcntdq-vpopcntd-1.c: Add more types.
* gcc.target/i386/avx512vpopcntdq-vpopcntd.c: Handle new intrinsics.
* gcc.target/i386/avx512vpopcntdq-vpopcntq-1.c: Ditto.
* gcc.target/i386/avx512vpopcntdq-vpopcntq.c: Ditto.

Co-Authored-By: Sebastian Peryt <sebastian.peryt@intel.com>
From-SVN: r255975

6 years agoThis is a follow up patch for pr83488 to fix an error in setting...
Igor Tsimbalist [Fri, 22 Dec 2017 11:41:02 +0000 (12:41 +0100)]
This is a follow up patch for pr83488 to fix an error in setting...

This is a follow up patch for pr83488 to fix an error in setting
OPTION_MASK_ISA_AVX512VNNI_SET and OPTION_MASK_ISA_AVX512F_SET bits.
There were both set in ix86_isa_flags2 while being defined in
different ISA sets. Additionally move OPTION_MASK_ISA_AVX512VNNI_SET
to ix86_isa_flags as it can be used with OPTION_MASK_ISA_AVX512VL_SET.

gcc/
* common/config/i386/i386-common.c (OPTION_MASK_ISA_AVX512VNNI_SET):
Or in OPTION_MASK_ISA_AVX512F_SET.
(OPTION_MASK_ISA_AVX512F_UNSET): Or in
OPTION_MASK_ISA_AVX512VNNI_UNSET.
(ix86_handle_option): Adjust for
OPTION_MASK_ISA_AVX512VNNI_*SET being in ix86_isa_flags.
* config/i386/i386-builtin.def: Move VNNI builtins from ARGS2
section to ARGS.
* config/i386/i386-c.c: Check for OPTION_MASK_ISA_AVX512VNNI in
isa_flag instead of isa_flag2.
* config/i386/i386.c (ix86_target_string): Move -mavx512vnni from
isa_opts2 to isa_opts.
* config/i386/i386.opt (mavx512vnni): Move from ix86_isa_flags2
to ix86_isa_flags.

From-SVN: r255974

6 years agoextend.texi (Loop-Specific Pragmas): Document pragma GCC unroll.
Eric Botcazou [Fri, 22 Dec 2017 10:22:15 +0000 (10:22 +0000)]
extend.texi (Loop-Specific Pragmas): Document pragma GCC unroll.

* doc/extend.texi (Loop-Specific Pragmas): Document pragma GCC unroll.
c-family/
* c-pragma.c (init_pragma): Register pragma GCC unroll.
* c-pragma.h (enum pragma_kind): Add PRAGMA_UNROLL.
c/
* c-parser.c (c_parser_while_statement): Add unroll parameter and
build ANNOTATE_EXPR if present.  Add 3rd operand to ANNOTATE_EXPR.
(c_parser_do_statement): Likewise.
(c_parser_for_statement): Likewise.
(c_parser_statement_after_labels): Adjust calls to above.
(c_parse_pragma_ivdep): New static function.
(c_parser_pragma_unroll): Likewise.
(c_parser_pragma) <PRAGMA_IVDEP>: Add support for pragma Unroll.
<PRAGMA_UNROLL>: New case.
cp/
* constexpr.c (cxx_eval_constant_expression) <ANNOTATE_EXPR>: Remove
assertion on 2nd operand.
(potential_constant_expression_1): Likewise.
* cp-tree.def (RANGE_FOR_STMT): Take a 5th operand.
* cp-tree.h (RANGE_FOR_UNROLL): New macro.
(cp_convert_range_for): Adjust prototype.
(finish_while_stmt_cond): Likewise.
(finish_do_stmt): Likewise.
(finish_for_cond): Likewise.
* init.c (build_vec_init): Adjut call to finish_for_cond.
* parser.c (cp_parser_statement): Adjust call to
cp_parser_iteration_statement.
(cp_parser_for): Add unroll parameter and pass it in calls to
cp_parser_range_for and cp_parser_c_for.
(cp_parser_c_for): Add unroll parameter and pass it in call to
finish_for_cond.
(cp_parser_range_for): Add unroll parameter, set in on RANGE_FOR_STMT
and pass it in call to cp_convert_range_for.
(cp_convert_range_for): Add unroll parameter and pass it in call to
finish_for_cond.
(cp_parser_iteration_statement): Add unroll parameter and pass it in
calls to finish_while_stmt_cond, finish_do_stmt and cp_parser_for.
(cp_parser_pragma_ivdep): New static function.
(cp_parser_pragma_unroll): Likewise.
(cp_parser_pragma) <PRAGMA_IVDEP>: Add support for pragma Unroll.
<PRAGMA_UNROLL>: New case.
* pt.c (tsubst_expr) <FOR_STMT>: Adjust call to finish_for_cond.
<RANGE_FOR_STMT>: Pass unrolling factor to cp_convert_range_for.
<WHILE_STMT>: Adjust call to finish_while_stmt_cond.
<DO_STMT>: Adjust call to finish_do_stmt.
* semantics.c (finish_while_stmt_cond): Add unroll parameter and
build ANNOTATE_EXPR if present.
(finish_do_stmt): Likewise.
(finish_for_cond): Likewise.
(begin_range_for_stmt): Build RANGE_FOR_STMT with 5th operand.
fortran/
* array.c (gfc_copy_iterator): Copy unroll field.
* decl.c (directive_unroll): New global variable.
(gfc_match_gcc_unroll): New function.
* gfortran.h (gfc_iterator]): Add unroll field.
(directive_unroll): Declare:
* match.c (gfc_match_do): Use memset to initialize the iterator.
* match.h (gfc_match_gcc_unroll): New prototype.
* parse.c (decode_gcc_attribute): Match "unroll".
(parse_do_block): Set iterator's unroll.
(parse_executable): Diagnose misplaced unroll directive.
* trans-stmt.c (gfc_trans_simple_do) Annotate loop condition with
annot_expr_unroll_kind.
(gfc_trans_do): Likewise.
* gfortran.texi (GNU Fortran Compiler Directives): Split section into
subections 'ATTRIBUTES directive' and 'UNROLL directive'.

From-SVN: r255973

6 years agocompiler: improve escape analysis diagnostics
Ian Lance Taylor [Fri, 22 Dec 2017 03:27:00 +0000 (03:27 +0000)]
compiler: improve escape analysis diagnostics

    This CL brings escape analysis diagnostics closer to the gc
    compiler's. This makes porting and debugging escape analysis
    code easier. A few changes:

    - In the gc compiler, the variable expression is represented
      with the variable node itself (ONAME), the location of which
      is the location of definition. We add a definition_location
      method to Node, and make use of it when the gc compiler emits
      diagnostics at the definition locations.

    - In the gc compiler, methods are named T.M or (*T).M. Add the
      type to the method name when possible.

    - Print "moved to heap" messages only for variables.

    - Reduce some duplicated diagnostics.

    - Print "does not escape" messages in more situations which the
      gc compiler does.

    - Remove the special handling for closure numbers. In gofrontend,
      closures are named "$nested#" where # is a global counter
      starting from 0, whereas in the gc compiler they are named
      "outer.func#" where # is a per-function counter starting from
      1. We tried to adjust the closure name to better matching the
      ones in the gc compiler, however, it cannot match exactly
      because of the difference of the counter. Instead, just print
      "outer.$nested#".

    Reviewed-on: https://go-review.googlesource.com/83875

From-SVN: r255967

6 years ago[SFN] sync up debug-only stmt list's side effects with empty stmts too
Alexandre Oliva [Fri, 22 Dec 2017 02:07:31 +0000 (02:07 +0000)]
[SFN] sync up debug-only stmt list's side effects with empty stmts too

for  gcc/c-family/ChangeLog

PR debug/83527
PR debug/83419
* c-semantics.c (only_debug_stmts_after_p): New.
(pop_stmt_list): Clear side effects in debug-only stmt list.
Check for single nondebug stmt followed by debug stmts only.

for  gcc/testsuite/ChangeLog

PR debug/83527
PR debug/83419
* gcc.dg/pr83527.c: New.

From-SVN: r255966

6 years agoDaily bump.
GCC Administrator [Fri, 22 Dec 2017 00:16:15 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r255965

6 years agoPR testsuite/83462 - c-c++-common/Warray-bounds-3.c fails
Martin Sebor [Fri, 22 Dec 2017 00:07:39 +0000 (00:07 +0000)]
PR testsuite/83462 - c-c++-common/Warray-bounds-3.c fails

gcc/testsuite/ChangeLog

* c-c++-common/Warray-bounds-3.c: Adjust dg-warning grep pattern.

From-SVN: r255962

6 years agore PR middle-end/83487 (ICE in expand_call, at calls.c:4098)
Jakub Jelinek [Thu, 21 Dec 2017 23:10:45 +0000 (00:10 +0100)]
re PR middle-end/83487 (ICE in expand_call, at calls.c:4098)

PR middle-end/83487
* config/i386/i386.c (ix86_function_arg_boundary): Return
PARM_BOUNDARY for TYPE_EMPTY_P types.

* gcc.c-torture/compile/pr83487.c: New test.
* gcc.dg/compat/pr83487-1.h: New file.
* gcc.dg/compat/pr83487-1_main.c: New test.
* gcc.dg/compat/pr83487-1_x.c: New file.
* gcc.dg/compat/pr83487-1_y.c: New file.
* gcc.dg/compat/pr83487-2_main.c: New test.
* gcc.dg/compat/pr83487-2_x.c: New file.
* gcc.dg/compat/pr83487-2_y.c: New file.
* g++.dg/abi/pr83487.C: New test.
* g++.dg/compat/abi/pr83487-1_main.C: New test.
* g++.dg/compat/abi/pr83487-1_x.C: New file.
* g++.dg/compat/abi/pr83487-1_y.C: New file.
* g++.dg/compat/abi/pr83487-2_main.C: New test.
* g++.dg/compat/abi/pr83487-2_x.C: New file.
* g++.dg/compat/abi/pr83487-2_y.C: New file.

From-SVN: r255961

6 years agore PR c/83448 (ice in get_source_location_for_substring, at input.c:1507)
Jakub Jelinek [Thu, 21 Dec 2017 23:09:14 +0000 (00:09 +0100)]
re PR c/83448 (ice in get_source_location_for_substring, at input.c:1507)

PR c/83448
* gimple-ssa-sprintf.c (maybe_warn): Don't call set_caret_index
if navail is >= dir.len.

* gcc.c-torture/compile/pr83448.c: New test.
* gcc.dg/tree-ssa/builtin-snprintf-warn-4.c: New test.

From-SVN: r255960

6 years agoAdd missing PR number
Eric Botcazou [Thu, 21 Dec 2017 22:08:30 +0000 (22:08 +0000)]
Add missing PR number

From-SVN: r255959

6 years agodecl.c (gnat_to_gnu_entity): Always take into account the Esize if it is known.
Eric Botcazou [Thu, 21 Dec 2017 22:02:45 +0000 (22:02 +0000)]
decl.c (gnat_to_gnu_entity): Always take into account the Esize if it is known.

* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Always take
into account the Esize if it is known.

From-SVN: r255958

6 years agot-aarch64-linux (MULTILIB_OSDIRNAMES): Fix triplet for ilp32.
Steve Ellcey [Thu, 21 Dec 2017 21:58:19 +0000 (21:58 +0000)]
t-aarch64-linux (MULTILIB_OSDIRNAMES): Fix triplet for ilp32.

2017-12-21  Steve Ellcey  <sellcey@cavium.com>

* config/aarch64/t-aarch64-linux (MULTILIB_OSDIRNAMES): Fix
triplet for ilp32.

From-SVN: r255957

6 years agomove ChangeLog entry to the right file
Alexandre Oliva [Thu, 21 Dec 2017 20:30:23 +0000 (20:30 +0000)]
move ChangeLog entry to the right file

From-SVN: r255955

6 years agore PR rtl-optimization/80747 (gcc.dg/tree-ssa/tailrecursion-4.c fails with ICE when...
Jakub Jelinek [Thu, 21 Dec 2017 19:28:10 +0000 (20:28 +0100)]
re PR rtl-optimization/80747 (gcc.dg/tree-ssa/tailrecursion-4.c fails with ICE when compiled with options "-fprofile-use -freorder-blocks-and-partition")

PR rtl-optimization/80747
PR rtl-optimization/83512
* cfgrtl.c (force_nonfallthru_and_redirect): When splitting
succ edge from ENTRY, copy partition from e->dest to the newly
created bb.
* bb-reorder.c (reorder_basic_blocks_simple): If last_tail is
ENTRY, use BB_PARTITION of its successor block as current_partition.
Don't copy partition when splitting succ edge from ENTRY.

* gcc.dg/pr80747.c: New test.
* gcc.dg/pr83512.c: New test.

From-SVN: r255954

6 years agore PR tree-optimization/83523 (ICE: verify_gimple failed (error: statement marked...
Jakub Jelinek [Thu, 21 Dec 2017 19:27:21 +0000 (20:27 +0100)]
re PR tree-optimization/83523 (ICE: verify_gimple failed (error: statement marked for throw, but doesn't))

PR tree-optimization/83523
* tree-ssa-math-opts.c (is_widening_mult_p): Return false if
for INTEGER_TYPE TYPE_OVERFLOW_TRAPS.
(convert_mult_to_fma): Likewise.

* g++.dg/tree-ssa/pr83523.C: New test.

From-SVN: r255953

6 years agore PR tree-optimization/83521 (ICE: verify_gimple failed (error: invalid operand...
Jakub Jelinek [Thu, 21 Dec 2017 19:26:34 +0000 (20:26 +0100)]
re PR tree-optimization/83521 (ICE: verify_gimple failed (error: invalid operand in unary operation))

PR tree-optimization/83521
* tree-ssa-phiopt.c (factor_out_conditional_conversion): Use
gimple_build_assign without code on result of
fold_build1 (VIEW_CONVERT_EXPR, ...), as it might not create
a VIEW_CONVERT_EXPR.

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

From-SVN: r255952

6 years agot-aarch64-linux (MULTILIB_OSDIRNAMES): Handle multi-arch for ilp32.
Andrew Pinski [Thu, 21 Dec 2017 19:18:32 +0000 (19:18 +0000)]
t-aarch64-linux (MULTILIB_OSDIRNAMES): Handle multi-arch for ilp32.

2017-12-21  Andrew Pinski  <apinski@cavium.com>
    Steve Ellcey  <sellcey@cavium.com>

* config/aarch64/t-aarch64-linux (MULTILIB_OSDIRNAMES): Handle
multi-arch for ilp32.

Co-Authored-By: Steve Ellcey <sellcey@cavium.com>
From-SVN: r255951

6 years ago[PR c++/83406] deducing lambda type
Nathan Sidwell [Thu, 21 Dec 2017 19:16:01 +0000 (19:16 +0000)]
[PR c++/83406] deducing lambda type

https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01432.html
PR c++/83406
* parser.c (cp_parser_lambda_body): Remove obsolete
single-return-statement handling.

PR c++/83406
* g++.dg/cpp0x/lambda/lambda-ice15.C: Adjust error.
* g++.dg/cpp1y/pr83406.C: New.

From-SVN: r255950

6 years agore PR target/83467 (ICE: in assign_by_spills, at lra-assigns.c:1476: unable to find...
Uros Bizjak [Thu, 21 Dec 2017 19:00:28 +0000 (20:00 +0100)]
re PR target/83467 (ICE: in assign_by_spills, at lra-assigns.c:1476: unable to find a register to spill with -flive-range-shrinkage -m8bit-idiv)

PR target/83467
* config/i386/i386.md (*ashl<mode>3_mask): Add operand
constraints to operand 2.
(*ashl<mode>3_mask_1): Ditto.
(*<shift_insn><mode>3_mask): Ditto.
(*<shift_insn><mode>3_mask_1): Ditto.
(*<rotate_insn><mode>3_mask): Ditto.
(*<rotate_insn><mode>3_mask_1): Ditto.

testsuite/ChangeLog:

PR target/83467
* gcc.target/i386/pr83467-1.c: New test.
* gcc.target/i386/pr83467-2.c: Ditto.

From-SVN: r255949

6 years ago[-fcompare-debug] retain insn locations when turning dbr seq into return
Alexandre Oliva [Thu, 21 Dec 2017 18:14:21 +0000 (18:14 +0000)]
[-fcompare-debug] retain insn locations when turning dbr seq into return

A number of -fcompare-debug errors on sparc arise as we split a dbr
SEQUENCE back into separate insns to turn the branch into a return.
If we just take the location from the PREV_INSN, it might be a debug
insn without INSN_LOCATION, or an insn with an unrelated location.
But that's silly: each of the SEQUENCEd insns is still an insn with
its own INSN_LOCATION, so use that instead, even though some may have
been adjusted while constructing the SEQUENCE.

for  gcc/ChangeLog

* reorg.c (make_return_insns): Reemit each insn with its own
location.

From-SVN: r255948

6 years ago[SFN] propagate single-nondebug-stmt's side effects to enclosing list
Alexandre Oliva [Thu, 21 Dec 2017 18:14:06 +0000 (18:14 +0000)]
[SFN] propagate single-nondebug-stmt's side effects to enclosing list

Statements without side effects, preceded by debug begin stmt markers,
would become a statement list with side effects, although the stmt on
its own would be extracted from the list and remain not having side
effects.  This causes debug info and possibly codegen differences.
This patch fixes it, identifying the situation in which the stmt would
have been extracted from the stmt list, and propagating the side
effects flag from the stmt to the list.

for  gcc/ChangeLog

PR debug/83419
* c-family/c-semantics.c (pop_stmt_list): Propagate side
effects from single nondebug stmt to container list.

for  gcc/testsuite/ChangeLog

PR debug/83419
* gcc.dg/pr83419.c: New.

From-SVN: r255947

6 years ago[patch AArch64] Do not perform a vector splat for vector initialisation if it is...
James Greenhalgh [Thu, 21 Dec 2017 16:39:43 +0000 (16:39 +0000)]
[patch AArch64] Do not perform a vector splat for vector initialisation if it is not useful

Our current vector initialisation code will first duplicate
the first element to both lanes, then overwrite the top lane with a new
value.

This duplication can be clunky and wasteful.

Better would be to simply use the fact that we will always be overwriting
the remaining bits, and simply move the first element to the corrcet place
(implicitly zeroing all other bits).

We also need a new pattern in simplify-rtx.c:simplify_ternary_operation ,
to ensure we can still simplify:

  (vec_merge:OUTER
     (vec_duplicate:OUTER x:INNER)
     (subreg:OUTER y:INNER 0)
     (const_int N))

To:

  (vec_concat:OUTER x:INNER y:INNER) or (vec_concat y x)

---
gcc/

* config/aarch64/aarch64.c (aarch64_expand_vector_init): Modify code
generation for cases where splatting a value is not useful.
* simplify-rtx.c (simplify_ternary_operation): Simplify vec_merge
across a vec_duplicate and a paradoxical subreg forming a vector
mode to a vec_concat.

gcc/testsuite/

* gcc.target/aarch64/vect-slp-dup.c: New.

From-SVN: r255946

6 years ago[Patch combine] Don't create ZERO_EXTEND from subregs unless we have a scalar int...
James Greenhalgh [Thu, 21 Dec 2017 16:32:25 +0000 (16:32 +0000)]
[Patch combine] Don't create ZERO_EXTEND from subregs unless we have a scalar int mode

gcc/

* combine.c (simplify_set): Do not transform subregs to zero_extends
if the destination is not a scalar int mode.

From-SVN: r255945

6 years agore PR c++/82872 (ICE in ignore_overflows on __PTRDIFF_MAX__ index)
Eric Botcazou [Thu, 21 Dec 2017 16:22:04 +0000 (16:22 +0000)]
re PR c++/82872 (ICE in ignore_overflows on __PTRDIFF_MAX__ index)

PR c++/82872
* convert.c (convert_to_integer_1) <POINTER_TYPE>: Do not return the
shared zero if the input has overflowed.

From-SVN: r255944

6 years ago[arm] Specify +dotprod support for Cortex-A55 and Cortex-A75 in native system detection
Kyrylo Tkachov [Thu, 21 Dec 2017 15:02:49 +0000 (15:02 +0000)]
[arm] Specify +dotprod support for Cortex-A55 and Cortex-A75 in native system detection

Since support for -mcpu=cortex-a55 and -mcpu=cortex-a75
was added we added support for the +dotprod extension
which these CPUs support.

We already specify as such in the arm-cpus.in entries for
these processors. However the table in driver-arm.c was
not adding +dotproct to the -march string that it generates.

This patch fixes that oversight.
In the future I'd like to get the arm_cpu_table in driver-arm.c
be auto-generated somehow from the arm-cpus.in data so
that we don't have to keep track of discrepancies explicitly...

Bootstrapped and tested on arm-none-linux-gnueabihf.

* config/arm/driver-arm.c (arm_cpu_table): Specify dotprod
support for Cortex-A55 and Cortex-A75.

From-SVN: r255943

6 years ago[arm] Fix assembler option rewrite alphabetical comparison
Kyrylo Tkachov [Thu, 21 Dec 2017 14:50:02 +0000 (14:50 +0000)]
[arm] Fix assembler option rewrite alphabetical comparison

* common/config/arm/arm-common.c (compare_opt_names): Add function
comment.  Use strcmp instead of manual loop.

From-SVN: r255942

6 years agoFix gcov-dump tool for GCDA files (PR gcov-profile/83509).
Martin Liska [Thu, 21 Dec 2017 14:22:08 +0000 (15:22 +0100)]
Fix gcov-dump tool for GCDA files (PR gcov-profile/83509).

2017-12-21  Martin Liska  <mliska@suse.cz>

PR gcov-profile/83509
* gcov-dump.c (dump_gcov_file): Do not read info about
support_unexecuted_blocks for gcda files.

From-SVN: r255941

6 years agore PR rtl-optimization/82973 (ICE in output_constant_pool_2, at varasm.c:3896 on...
Jakub Jelinek [Thu, 21 Dec 2017 09:11:58 +0000 (10:11 +0100)]
re PR rtl-optimization/82973 (ICE in output_constant_pool_2, at varasm.c:3896 on aarch64)

PR rtl-optimization/82973
* emit-rtl.h (valid_for_const_vec_duplicate_p): Rename to ...
(valid_for_const_vector_p): ... this.
* emit-rtl.c (valid_for_const_vec_duplicate_p): Rename to ...
(valid_for_const_vector_p): ... this.  Adjust function comment.
(gen_vec_duplicate): Adjust caller.
* optabs.c (expand_vector_broadcast): Likewise.
* simplify-rtx.c (simplify_const_unary_operation): Don't optimize into
CONST_VECTOR if some element isn't simplified valid_for_const_vector_p
constant.
(simplify_const_binary_operation): Likewise.  Use CONST_FIXED_P macro
instead of GET_CODE == CONST_FIXED.
(simplify_subreg): Use CONST_FIXED_P macro instead of
GET_CODE == CONST_FIXED.

* gfortran.dg/pr82973.f90: New test.

From-SVN: r255939

6 years agore PR rtl-optimization/82973 (ICE in output_constant_pool_2, at varasm.c:3896 on...
Jakub Jelinek [Thu, 21 Dec 2017 09:11:29 +0000 (10:11 +0100)]
re PR rtl-optimization/82973 (ICE in output_constant_pool_2, at varasm.c:3896 on aarch64)

PR rtl-optimization/82973
* emit-rtl.h (valid_for_const_vec_duplicate_p): Rename to ...
(valid_for_const_vector_p): ... this.
* emit-rtl.c (valid_for_const_vec_duplicate_p): Rename to ...
(valid_for_const_vector_p): ... this.  Adjust function comment.
(gen_vec_duplicate): Adjust caller.
* optabs.c (expand_vector_broadcast): Likewise.
* simplify-rtx.c (simplify_const_unary_operation): Don't optimize into
CONST_VECTOR if some element isn't simplified valid_for_const_vector_p
constant.
(simplify_const_binary_operation): Likewise.  Use CONST_FIXED_P macro
instead of GET_CODE == CONST_FIXED.
(simplify_subreg): Use CONST_FIXED_P macro instead of
GET_CODE == CONST_FIXED.

* gfortran.dg/pr82973.f90: New test.

From-SVN: r255938

6 years agore PR target/83488 (ICE on a CET test-case)
Jakub Jelinek [Thu, 21 Dec 2017 08:45:30 +0000 (09:45 +0100)]
re PR target/83488 (ICE on a CET test-case)

PR target/83488
* config/i386/i386.c (ix86_target_string): Move -mavx512vbmi2 and
-mshstk entries from isa_opts2 to isa_opts and -mhle, -mmovbe,
-mclzero and -mmwaitx entries from isa_opts to isa_opts2.
(ix86_option_override_internal): Adjust for
OPTION_MASK_ISA_{HLE,MOVBE,CLZERO,MWAITX} moving to ix86_isa_flags2
and OPTION_MASK_ISA_SHSTK moving to ix86_isa_flags.
(BDESC_VERIFYS): Remove SPECIAL_ARGS2 related checks.
(ix86_init_mmx_sse_builtins): Remove bdesc_special_args2 handling.
Use def_builtin2 instead of def_builtin for OPTION_MASK_ISA_MWAITX
and OPTION_MASK_ISA_CLZERO builtins.  Use def_builtin instead of
def_builtin2 for CET builtins.
(ix86_expand_builtin): Remove bdesc_special_args2 handling.  Fix
up formatting in IX86_BUILTIN_RDPID code.
* config/i386/i386-builtin.def: Move VBMI2 builtins from SPECIAL_ARGS2
section to SPECIAL_ARGS and from ARGS2 section to ARGS.
* config/i386/i386.opt (mavx512vbmi2, mshstk): Move from
ix86_isa_flags2 to ix86_isa_flags.
(mhle, mmovbe, mclzero, mmwaitx): Move from ix86_isa_flags to
ix86_isa_flags2.
* config/i386/i386-c.c (ix86_target_macros_internal): Check for
OPTION_MASK_ISA_{CLZERO,MWAITX} in isa_flag2 instead of isa_flag.
Check for OPTION_MASK_ISA_{SHSTK,AVX512VBMI2} in isa_flag instead
of isa_flag2.
* common/config/i386/i386-common.c (OPTION_MASK_ISA_AVX512VBMI2_SET):
Or in OPTION_MASK_ISA_AVX512F_SET.
(OPTION_MASK_ISA_AVX512F_UNSET): Or in
OPTION_MASK_ISA_AVX512VBMI2_UNSET.
(ix86_handle_option): Adjust for
OPTION_MASK_ISA_{SHSTK,AVX512VBMI2}_*SET being in ix86_isa_flags
and OPTION_MASK_ISA_{MOVBE,MWAITX,CLZERO}_*SET in ix86_isa_flags2.

* gcc.target/i386/pr83488.c: New test.

From-SVN: r255937

6 years agopoly_int: prune_runtime_alias_test_list
Richard Sandiford [Thu, 21 Dec 2017 07:03:03 +0000 (07:03 +0000)]
poly_int: prune_runtime_alias_test_list

This patch makes prune_runtime_alias_test_list take the iteration
factor as a poly_int and tracks polynomial offsets internally
as well.

2017-12-21  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* tree-data-ref.h (prune_runtime_alias_test_list): Take the
factor as a poly_uint64 rather than an unsigned HOST_WIDE_INT.
* tree-data-ref.c (prune_runtime_alias_test_list): Likewise.
Track polynomial offsets.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r255936

6 years agopoly_int: compute_data_ref_alignment
Richard Sandiford [Thu, 21 Dec 2017 07:02:53 +0000 (07:02 +0000)]
poly_int: compute_data_ref_alignment

This patch makes vect_compute_data_ref_alignment treat DR_INIT as a
poly_int and handles cases in which the calculated misalignment might
not be constant.

2017-12-21  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* tree-vect-data-refs.c (vect_compute_data_ref_alignment):
Treat drb->init as a poly_int.  Fail if its misalignment wrt
vector_alignment isn't known.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r255935

6 years agopoly_int: loop versioning threshold
Richard Sandiford [Thu, 21 Dec 2017 07:02:46 +0000 (07:02 +0000)]
poly_int: loop versioning threshold

This patch splits the loop versioning threshold out from the
cost model threshold so that the former can become a poly_uint64.
We still use a single test to enforce both limits where possible.

2017-12-21  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* tree-vectorizer.h (_loop_vec_info): Add a versioning_threshold
field.
(LOOP_VINFO_VERSIONING_THRESHOLD): New macro
(vect_loop_versioning): Take the loop versioning threshold as a
separate parameter.
* tree-vect-loop-manip.c (vect_loop_versioning): Likewise.
* tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Initialize
versioning_threshold.
(vect_analyze_loop_2): Compute the loop versioning threshold
whenever loop versioning is needed, and store it in the new
field rather than combining it with the cost model threshold.
(vect_transform_loop): Update call to vect_loop_versioning.
Try to combine the loop versioning and cost thresholds here.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r255934

6 years agopoly_int: tree-ssa-loop-ivopts.c:iv_use
Richard Sandiford [Thu, 21 Dec 2017 07:02:36 +0000 (07:02 +0000)]
poly_int: tree-ssa-loop-ivopts.c:iv_use

This patch makes ivopts handle polynomial address offsets
when recording potential IV uses.

2017-12-21  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* tree-ssa-loop-ivopts.h (strip_offset): Return the offset as
poly_uint64_pod rather than an unsigned HOST_WIDE_INT.
* tree-loop-distribution.c (classify_builtin_st): Update accordingly.
* tree-ssa-loop-ivopts.c (iv_use::addr_offset): Change from
an unsigned HOST_WIDE_INT to a poly_uint64_pod.
(group_compare_offset): Update accordingly.
(split_small_address_groups_p): Likewise.
(record_use): Take addr_offset as a poly_uint64 rather than
an unsigned HOST_WIDE_INT.
(strip_offset): Return the offset as a poly_uint64 rather than
an unsigned HOST_WIDE_INT.
(record_group_use, split_address_groups): Track polynomial offsets.
(add_iv_candidate_for_use): Likewise.
(addr_offset_valid_p): Take the offset as a poly_int64 rather
than a HOST_WIDE_INT.
(strip_offset_1): Return the offset as a poly_int64 rather than
a HOST_WIDE_INT.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r255933

6 years agopoly_int: get_binfo_at_offset
Richard Sandiford [Thu, 21 Dec 2017 07:02:28 +0000 (07:02 +0000)]
poly_int: get_binfo_at_offset

This patch changes the offset parameter to get_binfo_at_offset
from HOST_WIDE_INT to poly_int64.  This function probably doesn't
need to handle polynomial offsets in practice, but it's easy
to do and avoids forcing the caller to check first.

2017-12-21  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* tree.h (get_binfo_at_offset): Take the offset as a poly_int64
rather than a HOST_WIDE_INT.
* tree.c (get_binfo_at_offset): Likewise.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r255932

6 years agopoly_int: build_ref_for_offset
Richard Sandiford [Thu, 21 Dec 2017 07:02:20 +0000 (07:02 +0000)]
poly_int: build_ref_for_offset

This patch changes the offset parameter to build_ref_for_offset
from HOST_WIDE_INT to poly_int64.

2017-12-21  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* ipa-prop.h (build_ref_for_offset): Take the offset as a poly_int64
rather than a HOST_WIDE_INT.
* tree-sra.c (build_ref_for_offset): Likewise.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r255931

6 years agopoly_int: MEM_REF offsets
Richard Sandiford [Thu, 21 Dec 2017 07:02:13 +0000 (07:02 +0000)]
poly_int: MEM_REF offsets

This patch allows MEM_REF offsets to be polynomial, with mem_ref_offset
now returning a poly_offset_int instead of an offset_int.  The
non-mechanical changes to callers of mem_ref_offset were handled by
previous patches.

2017-12-21  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* fold-const.h (mem_ref_offset): Return a poly_offset_int rather
than an offset_int.
* tree.c (mem_ref_offset): Likewise.
(build_simple_mem_ref_loc): Treat MEM_REF offsets as poly_ints.
* builtins.c (get_object_alignment_2): Likewise.
* expr.c (get_inner_reference, expand_expr_real_1): Likewise.
* gimple-fold.c (get_base_constructor): Likewise.
* gimple-ssa-strength-reduction.c (restructure_reference): Likewise.
* gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref):
Likewise.
* ipa-polymorphic-call.c
(ipa_polymorphic_call_context::ipa_polymorphic_call_context): Likewise.
* ipa-prop.c (compute_complex_assign_jump_func): Likewise.
(get_ancestor_addr_info): Likewise.
* ipa-param-manipulation.c (ipa_get_adjustment_candidate): Likewise.
* match.pd: Likewise.
* tree-data-ref.c (dr_analyze_innermost): Likewise.
* tree-dfa.c (get_addr_base_and_unit_offset_1): Likewise.
* tree-eh.c (tree_could_trap_p): Likewise.
* tree-object-size.c (addr_object_size): Likewise.
* tree-ssa-address.c (copy_ref_info): Likewise.
* tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Likewise.
(indirect_refs_may_alias_p): Likewise.
* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise.
* tree-ssa.c (maybe_rewrite_mem_ref_base): Likewise.
(non_rewritable_mem_ref_base): Likewise.
* tree-vect-data-refs.c (vect_check_gather_scatter): Likewise.
* tree-vrp.c (vrp_prop::check_array_ref): Likewise.
* varasm.c (decode_addr_const): Likewise.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r255930