gcc.git
4 years agore PR rtl-optimization/91164 (ICE in verify_dominators, at dominance.c:1184 (error...
Jakub Jelinek [Tue, 16 Jul 2019 11:37:05 +0000 (13:37 +0200)]
re PR rtl-optimization/91164 (ICE in verify_dominators, at dominance.c:1184 (error: dominator of 114 should be 112, not 16))

PR rtl-optimization/91164
* dse.c (rest_of_handle_dse): If dead edges have been purged,
invalidate dominance info.

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

From-SVN: r273522

4 years agoalias-1_0.C: Use -O3.
Jan Hubicka [Tue, 16 Jul 2019 09:29:17 +0000 (11:29 +0200)]
alias-1_0.C: Use -O3.

* g++.dg/lto/alias-1_0.C: Use -O3.
* g++.dg/lto/alias-2_0.C: Use -O3.
* g++.dg/lto/alias-3_0.C: Add loop to enable inlining with
-fno-use-linker-plugin.
* g++.dg/lto/alias-3_1.C: Remove dg-lto-do and dg-lto-options.

From-SVN: r273520

4 years agoDon't xfail gcc.dg/tree-ssa/pr84512.c on 64-bit SPARC
Rainer Orth [Tue, 16 Jul 2019 09:27:57 +0000 (09:27 +0000)]
Don't xfail gcc.dg/tree-ssa/pr84512.c on 64-bit SPARC

* gcc.dg/tree-ssa/pr84512.c: Don't xfail scan-tree-dump on
sparcv9.

From-SVN: r273519

4 years agoRequire int128 support in gcc.dg/autopar/pr91162.c
Rainer Orth [Tue, 16 Jul 2019 09:13:16 +0000 (09:13 +0000)]
Require int128 support in gcc.dg/autopar/pr91162.c

* gcc.dg/autopar/pr91162.c: Require int128 support.

From-SVN: r273518

4 years agoSimplify range location creation in C++ parser.
Jason Merrill [Tue, 16 Jul 2019 08:57:03 +0000 (04:57 -0400)]
Simplify range location creation in C++ parser.

Many places in the parser follow the same pattern of capturing the location
of the last lexed token, either before or after lexing it, and then using
that as the end of a location range; this can be simplified by passing the
lexer to make_location and grabbing the token location there.

* parser.c (make_location): Add overload taking cp_lexer* as last
parameter.

From-SVN: r273516

4 years agoAdd parens around constraint in <memory>.
Jason Merrill [Tue, 16 Jul 2019 08:54:47 +0000 (04:54 -0400)]
Add parens around constraint in <memory>.

C++20 concepts require parens around atomic constraints that are not
primary-expressions.

* include/std/memory (uses_allocator_construction_args): Add parens
around constraint.

From-SVN: r273515

4 years agoSimplify type-specifier parsing.
Jason Merrill [Tue, 16 Jul 2019 08:50:16 +0000 (04:50 -0400)]
Simplify type-specifier parsing.

Previously, the tentative parses for optional type-specifier and to support
class template argument deduction were combined awkwardly.  This
reorganization was motivated by the new concepts branch.

* parser.c (cp_parser_simple_type_specifier): Separate tentative
parses for optional type-spec and CTAD.

From-SVN: r273514

4 years agoFix g++.dg/template/pr84789.C on new concepts branch.
Jason Merrill [Tue, 16 Jul 2019 08:49:04 +0000 (04:49 -0400)]
Fix g++.dg/template/pr84789.C on new concepts branch.

On the concepts branch I ran into trouble where a pre-parsed dependent
nested-name-specifier got replaced on a subsequent parse with is_declaration
by one with typenames resolved, which was then used wrongly on a further
parse with !is_declaration.

    * parser.c (cp_parser_nested_name_specifier_opt): If the token is
    already CPP_NESTED_NAME_SPECIFIER, leave it alone.

From-SVN: r273513

4 years agoReport ambiguous uses of .md attributes
Richard Sandiford [Tue, 16 Jul 2019 08:41:21 +0000 (08:41 +0000)]
Report ambiguous uses of .md attributes

This patch reports an error if the .md file has an unscoped
attribute that maps to more than one possible value.

2019-07-16  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* read-md.h (md_reader::record_potential_iterator_use): Add a
file_location parameter.
* read-rtl.c (attribute_use::loc): New field.
(map_attr_string): Take a file_location parameter.  Report cases
in which attributes map to multiple distinct values.
(apply_attribute_uses): Update call accordingly.
(md_reader::handle_overloaded_name): Likewise.
(md_reader::apply_iterator_to_string): Likewise.  Skip empty
nonnull strings.
(record_attribute_use): Take a file_location parameter.
Initialize attribute_use::loc.
(md_reader::record_potential_iterator_use): Take a file_location
parameter.  Update call to record_attribute_use.
(rtx_reader::rtx_alloc_for_name): Update call accordingly.
(rtx_reader::read_rtx_code): Likewise.
(rtx_reader::read_rtx_operand): Likewise.  Record a location
for implicitly-expanded empty strings.

From-SVN: r273511

4 years agoUse file_location for md_reader's ptr_loc
Richard Sandiford [Tue, 16 Jul 2019 08:41:13 +0000 (08:41 +0000)]
Use file_location for md_reader's ptr_loc

Also make it public, so that clients can use the location for error
reporting.

2019-07-16  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* read-md.h (md_reader::ptr_loc): Moved from read-md.c.
Use file_location instead of separate fields.
(md_reader::set_md_ptr_loc): Take a file_location instead of a
separate filename and line number.
* read-md.c (ptr_loc): As above.
(md_reader::copy_md_ptr_loc): Update for new ptr_loc layout.
(md_reader::fprint_md_ptr_loc): Likewise.
(md_reader::set_md_ptr_loc): Likewise.  Take a file_location
instead of a separate filename and line number.
(md_reader::read_string): Update call accordingly.

From-SVN: r273510

4 years ago[rs6000] Fix ambiguous .md attribute uses
Richard Sandiford [Tue, 16 Jul 2019 08:41:03 +0000 (08:41 +0000)]
[rs6000] Fix ambiguous .md attribute uses

This patch is part of a series that fixes ambiguous attribute
uses in .md files, i.e. cases in which attributes didn't use
<ITER:ATTR> to specify an iterator, and in which <ATTR> could
have different values depending on the iterator chosen.

No behavioural change -- produces the same code as before except
for formatting and line numbers.

2019-07-16  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* config/rs6000/rs6000.md (*mov<mode>_update1): Explicitly
use <SFDF:mode>, <SFDF:MODE>, <SFDF:Ff> and <SFDF:bits> rather than
leaving the choice between SFDF and P implicit.
(*mov<mode>_update2): Likewise.
(*cmp<IBM128:mode>_internal2): Explicitly use <IBM128:MODE>
rather than leaving the choice betweem IBM128 and GPR implicit.
(*fix<uns>_trunc<IEEE128:mode><QHSI:mode>2_mem): Explicitly use
<IEEE128:MODE> rather than leaving the choice between IEEE128 and
QHSI implicit.
(AltiVec define_peephole2s): Explicitly use <ALTIVEC_DFORM:MODE>
rather than leaving the choice between ALTIVEC_DFORM and P implicit.
* config/rs6000/vsx.md
(*vsx_ext_<VSX_EXTRACT_I:VS_scalar>_fl_<FL_CONV:mode>)
(*vsx_ext_<VSX_EXTRACT_I:VS_scalar>_ufl_<FL_CONV:mode>): Explicitly
use <FL_CONV:VSisa> rather than leaving the choice between FL_CONV
and VSX_EXTRACT_I implicit.

From-SVN: r273509

4 years ago[mips] Fix ambiguous .md attribute uses
Richard Sandiford [Tue, 16 Jul 2019 08:40:55 +0000 (08:40 +0000)]
[mips] Fix ambiguous .md attribute uses

This patch is part of a series that fixes ambiguous attribute
uses in .md files, i.e. cases in which attributes didn't use
<ITER:ATTR> to specify an iterator, and in which <ATTR> could
have different values depending on the iterator chosen.

No behavioural change -- produces the same code as before.

2019-07-16  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* config/mips/micromips.md (*movep<MOVEP1:mode><MOVEP2:mode>):
Explicitly use <MOVEP1:MODE> for the mode attribute.

From-SVN: r273508

4 years agoPR91176: Skip debug insns when computing inline costs
Jan Hubicka [Tue, 16 Jul 2019 08:12:05 +0000 (10:12 +0200)]
PR91176: Skip debug insns when computing inline costs

Apply Honza's fix for an aarch64-linux-gnu bootstrap failure.

2019-07-16  Jan Hubicka  <hubicka@ucw.cz>

gcc/
PR bootstrap/91176
* ipa-fnsummary.c (analyze_function_body): Skip debug stmts

From-SVN: r273507

4 years agoRemove trailing space.
Jason Merrill [Tue, 16 Jul 2019 07:34:58 +0000 (03:34 -0400)]
Remove trailing space.

From-SVN: r273506

4 years agoDaily bump.
GCC Administrator [Tue, 16 Jul 2019 00:16:48 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r273505

4 years ago* config/i386/i386.md (*testdi_1): Put back "%" constraint modifier.
Uros Bizjak [Mon, 15 Jul 2019 22:23:11 +0000 (00:23 +0200)]
* config/i386/i386.md (*testdi_1): Put back "%" constraint modifier.

From-SVN: r273501

4 years agoruntime: expose the g variable
Ian Lance Taylor [Mon, 15 Jul 2019 21:17:16 +0000 (21:17 +0000)]
runtime: expose the g variable

    Currently, getg is implemented in C, which loads the thread-local
    g variable. The g variable is declared static in C.

    This CL exposes the g variable, so it can be accessed from the Go
    side. This allows the Go compiler to inline getg calls to direct
    access of g.

    Currently, the actual inlining is only implemented in the gollvm
    compiler. The g variable is thread-local and the compiler backend
    may choose to cache the TLS address in a register or on stack. If
    a thread switch happens the cache may become invalid. I don't
    know how to disable the TLS address cache in gccgo, therefore
    the inlining of getg is not implemented. In the future gccgo may
    gain this if we know how to do it safely.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/186238

From-SVN: r273499

4 years agors6000: Always output .machine
Segher Boessenkool [Mon, 15 Jul 2019 20:57:53 +0000 (22:57 +0200)]
rs6000: Always output .machine

We now can always output .machine (if we output it at all for the
current target).

PR target/91050
* config/rs6000/rs6000.c (rs6000_file_start): Never skip emitting a
.machine directive.

From-SVN: r273498

4 years agoi386.md (@test<mode>_ccno_1): Rename from test<mode>_ccno_1.
Uros Bizjak [Mon, 15 Jul 2019 20:26:43 +0000 (22:26 +0200)]
i386.md (@test<mode>_ccno_1): Rename from test<mode>_ccno_1.

* config/i386/i386.md (@test<mode>_ccno_1):
Rename from test<mode>_ccno_1.
(*testdi_1): Remove redundant alternatives.  Remove modrm attribute.
(*testqi_1_maybe_si): Remove modrm attribute.
(*test<mode>_1): Ditto.
* config/i386/i386-expand.c (ix86_split_idivmod): Use
gen_test_ccno_1 and gen_extend_insn.

From-SVN: r273496

4 years agotree-ssa-alias.c (aliasing_component_refs_walk): Initialize same_p to 0.
Jan Hubicka [Mon, 15 Jul 2019 19:21:36 +0000 (21:21 +0200)]
tree-ssa-alias.c (aliasing_component_refs_walk): Initialize same_p to 0.

* tree-ssa-alias.c (aliasing_component_refs_walk): Initialize same_p
to 0.

From-SVN: r273495

4 years agore PR tree-optimization/91162 (ICE: tree check: expected class 'type', have 'exceptio...
Richard Biener [Mon, 15 Jul 2019 12:48:47 +0000 (12:48 +0000)]
re PR tree-optimization/91162 (ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.c:86 (error: invalid 'PHI' argument))

2019-07-15  Richard Biener  <rguenther@suse.de>

PR middle-end/91162
* tree-cfg.c (move_block_to_fn): When releasing a virtual PHI
node make sure to replace all uses with something valid.

* gcc.dg/autopar/pr91162.c: New testcase.

From-SVN: r273492

4 years agore PR tree-optimization/88497 (Improve Accumulation in Auto-Vectorized Code)
Kewen Lin [Mon, 15 Jul 2019 05:12:05 +0000 (05:12 +0000)]
re PR tree-optimization/88497 (Improve Accumulation in Auto-Vectorized Code)

gcc/ChangeLog

2019-07-15  Kewen Lin  <linkw@gcc.gnu.org>

    PR tree-optimization/88497
    * tree-ssa-reassoc.c (reassociate_bb): Swap the positions of
    GIMPLE_BINARY_RHS check and gimple_visited_p check, call new
    function undistribute_bitref_for_vector.
    (undistribute_bitref_for_vector): New function.
    (cleanup_vinfo_map): Likewise.
    (sort_by_mach_mode): Likewise.

gcc/testsuite/ChangeLog

2019-07-15  Kewen Lin  <linkw@gcc.gnu.org>

    PR tree-optimization/88497
    * gcc.dg/tree-ssa/pr88497-1.c: New test.
    * gcc.dg/tree-ssa/pr88497-2.c: Likewise.
    * gcc.dg/tree-ssa/pr88497-3.c: Likewise.
    * gcc.dg/tree-ssa/pr88497-4.c: Likewise.
    * gcc.dg/tree-ssa/pr88497-5.c: Likewise.
    * gcc.dg/tree-ssa/pr88497-6.c: Likewise.
    * gcc.dg/tree-ssa/pr88497-7.c: Likewise.

From-SVN: r273490

4 years agoDaily bump.
GCC Administrator [Mon, 15 Jul 2019 00:16:18 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r273488

4 years agore PR fortran/87233 (Constraint C1279 still followed after f2008 standard revision...
Jerry DeLisle [Sun, 14 Jul 2019 22:52:58 +0000 (22:52 +0000)]
re PR fortran/87233 (Constraint C1279 still followed after f2008 standard revision (?))

2019-07-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/87233
* expr.c (check_restricted): Relax constraint C1279 which was
removed from F2008 and above.

* gfortran.dg/initialization_14.f90: Modify to now pass by
removing two dg-error commands. Added comments.
* gfortran.dg/initialization_30.f90: New test that includes the
two tests removed above with the 'dg-options -std=f95'.

From-SVN: r273484

4 years agopr84512.c (dg-final): Remove XFAIL on alpha*-*-*.
Uros Bizjak [Sun, 14 Jul 2019 20:27:25 +0000 (22:27 +0200)]
pr84512.c (dg-final): Remove XFAIL on alpha*-*-*.

* gcc.dg/tree-ssa/pr84512.c (dg-final): Remove XFAIL on alpha*-*-*.

From-SVN: r273483

4 years agoi386.md (nonmemory_szext_operand): New mode attribute.
Uros Bizjak [Sun, 14 Jul 2019 18:52:16 +0000 (20:52 +0200)]
i386.md (nonmemory_szext_operand): New mode attribute.

* config/i386/i386.md (nonmemory_szext_operand): New mode attribute.
(test<mode>_ccno_1): Macroize insn pattern from testsi_ccno_1
and testdi_ccno_1 using SWI48 mode attribute.
(*testdi_1): Use x86_64_szext_nonmemory_operand instead of
x86_64_szext_general_operand.
(*testqi_1_maybe_si): Use nonmemory_operand instead of general_operand.
(*test<mode>_1): Use nonmemory_szext_operand mode attribute
instead of genera_operand mode attribute.

From-SVN: r273482

4 years agogdbhooks.py: dump-fn, dot-fn: cast ret values of fopen/fclose
Vladislav Ivanishin [Sun, 14 Jul 2019 13:19:29 +0000 (13:19 +0000)]
gdbhooks.py: dump-fn, dot-fn: cast ret values of fopen/fclose

Work around the following

    (gdb) Python Exception <class 'gdb.error'> 'fclose@@GLIBC_2.2.5' has
    unknown return type; cast the call to its declared return type:
    (gdb) Error occurred in Python: 'fclose@@GLIBC_2.2.5' has unknown
    return type; cast the call to its declared return type

This is due to GDB not being able to pick up and use the return types from
debug info for external declarations.

2019-07-14  Vladislav Ivanishin <vlad@ispras.ru>

        * gdbhooks.py (DumpFn.invoke): Add explicit casts of return values of
        fopen and fclose to their respective types.
        (DotFn.invoke): Ditto.

From-SVN: r273480

4 years agoipa-fnsummary.c (ipa_dump_hints): Do not dump array_index.
Jan Hubicka [Sun, 14 Jul 2019 11:57:10 +0000 (13:57 +0200)]
ipa-fnsummary.c (ipa_dump_hints): Do not dump array_index.

* ipa-fnsummary.c (ipa_dump_hints): Do not dump array_index.
(ipa_fn_summary::~ipa_fn_summary): Do not destroy array_index.
(ipa_fn_summary_t::duplicate): Do not duplicate array_index.
(array_index_predicate): Remove.
(analyze_function_body): Account cost for variable ofsetted array
indexing.
(estimate_node_size_and_time): Do not compute array index hint.
(ipa_merge_fn_summary_after_inlining): Do not merge array index hint.
(inline_read_section): Do not read array index hint.
(ipa_fn_summary_write): Do not write array index hint.
* doc/invoke.texi (ipa-cp-array-index-hint-bonus): Remove.
* ipa-cp.c (hint_time_bonus): Remove.
* ipa-fnsummary.h (ipa_hints_vals): Remove array_index.
(ipa_fnsummary): Remove array_index.
* ipa-inline.c (want_inline_small_function_p): Do not use
array_index.
(edge_badness): Likewise.
* params.def (PARAM_IPA_CP_ARRAY_INDEX_HINT_BONUS): Remove.

From-SVN: r273479

4 years agors6000: Shut up -Wformat-diag a little more
Segher Boessenkool [Sun, 14 Jul 2019 08:24:38 +0000 (10:24 +0200)]
rs6000: Shut up -Wformat-diag a little more

PR target/91148
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Remove
superfluous "builtin function" phrasing.

gcc/testsuite/
* gcc.target/powerpc/bfp/scalar-extract-exp-2.c: Adjust.
* gcc.target/powerpc/bfp/scalar-extract-sig-2.c: Adjust.
* gcc.target/powerpc/bfp/scalar-insert-exp-2.c: Adjust.
* gcc.target/powerpc/bfp/scalar-insert-exp-5.c: Adjust.
* gcc.target/powerpc/bfp/scalar-insert-exp-8.c: Adjust.
* gcc.target/powerpc/byte-in-set-2.c: Adjust.
* gcc.target/powerpc/cmpb-3.c: Adjust.
* gcc.target/powerpc/vsu/vec-all-nez-7.c: Adjust.
* gcc.target/powerpc/vsu/vec-any-eqz-7.c: Adjust.
* gcc.target/powerpc/vsu/vec-xl-len-13.c: Adjust.
* gcc.target/powerpc/vsu/vec-xst-len-12.c: Adjust.

From-SVN: r273475

4 years agoDaily bump.
GCC Administrator [Sun, 14 Jul 2019 00:16:17 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r273474

4 years ago[Darwin, PPC, testsuite] Require stabs support for a test.
Iain Sandoe [Sat, 13 Jul 2019 21:21:43 +0000 (21:21 +0000)]
[Darwin, PPC, testsuite] Require stabs support for a test.

The test fails if the assembler doesn't support stabs.

2019-07-13  Iain Sandoe  <iain@sandoe.co.uk>

* gcc.target/powerpc/stabs-attrib-vect-darwin.c: Require stabs
support.

From-SVN: r273470

4 years agotree-ssa-alias.c (component_ref_to_zero_sized_trailing_array_p): Break out from ...
Jan Hubicka [Sat, 13 Jul 2019 18:46:40 +0000 (20:46 +0200)]
tree-ssa-alias.c (component_ref_to_zero_sized_trailing_array_p): Break out from ...

* tree-ssa-alias.c (component_ref_to_zero_sized_trailing_array_p):
Break out from ...
(aliasing_component_refs_walk): Break out from ...
(aliasing_component_refs_p): ... here.

From-SVN: r273469

4 years agors6000: Shut up -Wformat-diag somewhat
Segher Boessenkool [Sat, 13 Jul 2019 15:57:21 +0000 (17:57 +0200)]
rs6000: Shut up -Wformat-diag somewhat

We currently get lot of build warnings like
/home/segher/src/gcc/gcc/config/rs6000/rs6000-c.c:7039:12: warning: misspelled term 'builtin function' in format; use 'built-in function' instead [-Wformat-diag]
 7039 |    error ("builtin function %qs not supported in this compiler "
      |            ^~~~~~~~~~~~~~~~

That would print something like
  builtin function '__builtin_example' not supported in this compiler

Changing that to "built-in" as suggested only makes this worse.
Instead, let's just remove the whole "builtin function" phrase.

PR target/91148
* config/rs6000/rs6000.c (rs6000_invalid_builtin): Remove superfluous
"builtin function" phrasing.

gcc/testsuite/
* gcc.target/powerpc/bfp/scalar-cmp-exp-eq-2.c: Adjust.
* gcc.target/powerpc/bfp/scalar-cmp-exp-gt-2.c: Adjust.
* gcc.target/powerpc/bfp/scalar-cmp-exp-lt-2.c: Adjust.
* gcc.target/powerpc/bfp/scalar-cmp-exp-unordered-2.c: Adjust.
* gcc.target/powerpc/bfp/scalar-extract-exp-1.c: Adjust.
* gcc.target/powerpc/bfp/scalar-extract-exp-2.c: Adjust.
* gcc.target/powerpc/bfp/scalar-extract-exp-4.c: Adjust.
* gcc.target/powerpc/bfp/scalar-extract-sig-1.c: Adjust.
* gcc.target/powerpc/bfp/scalar-extract-sig-2.c: Adjust.
* gcc.target/powerpc/bfp/scalar-extract-sig-4.c: Adjust.
* gcc.target/powerpc/bfp/scalar-insert-exp-1.c: Adjust.
* gcc.target/powerpc/bfp/scalar-insert-exp-10.c: Adjust.
* gcc.target/powerpc/bfp/scalar-insert-exp-2.c: Adjust.
* gcc.target/powerpc/bfp/scalar-insert-exp-4.c: Adjust.
* gcc.target/powerpc/bfp/scalar-insert-exp-5.c: Adjust.
* gcc.target/powerpc/bfp/scalar-insert-exp-7.c: Adjust.
* gcc.target/powerpc/bfp/scalar-insert-exp-8.c: Adjust.
* gcc.target/powerpc/bfp/scalar-test-data-class-11.c: Adjust.
* gcc.target/powerpc/bfp/scalar-test-data-class-6.c: Adjust.
* gcc.target/powerpc/bfp/scalar-test-data-class-7.c: Adjust.
* gcc.target/powerpc/bfp/scalar-test-neg-2.c: Adjust.
* gcc.target/powerpc/bfp/scalar-test-neg-3.c: Adjust.
* gcc.target/powerpc/bfp/scalar-test-neg-5.c: Adjust.
* gcc.target/powerpc/bfp/vec-extract-exp-2.c: Adjust.
* gcc.target/powerpc/bfp/vec-extract-exp-3.c: Adjust.
* gcc.target/powerpc/bfp/vec-extract-sig-2.c: Adjust.
* gcc.target/powerpc/bfp/vec-extract-sig-3.c: Adjust.
* gcc.target/powerpc/bfp/vec-insert-exp-2.c: Adjust.
* gcc.target/powerpc/bfp/vec-insert-exp-3.c: Adjust.
* gcc.target/powerpc/bfp/vec-insert-exp-6.c: Adjust.
* gcc.target/powerpc/bfp/vec-insert-exp-7.c: Adjust.
* gcc.target/powerpc/bfp/vec-test-data-class-2.c: Adjust.
* gcc.target/powerpc/bfp/vec-test-data-class-3.c: Adjust.
* gcc.target/powerpc/byte-in-either-range-1.c: Adjust.
* gcc.target/powerpc/byte-in-range-1.c: Adjust.
* gcc.target/powerpc/byte-in-set-1.c: Adjust.
* gcc.target/powerpc/byte-in-set-2.c: Adjust.
* gcc.target/powerpc/cmpb-3.c: Adjust.
* gcc.target/powerpc/crypto-builtin-2.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-1.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-11.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-16.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-21.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-26.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-31.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-36.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-41.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-46.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-51.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-56.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-6.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-61.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-66.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-71.c: Adjust.
* gcc.target/powerpc/dfp/dtstsfi-76.c: Adjust.
* gcc.target/powerpc/vsu/vec-all-nez-7.c: Adjust.
* gcc.target/powerpc/vsu/vec-any-eqz-7.c: Adjust.
* gcc.target/powerpc/vsu/vec-cmpnez-7.c: Adjust.
* gcc.target/powerpc/vsu/vec-cntlz-lsbb-2.c: Adjust.
* gcc.target/powerpc/vsu/vec-cnttz-lsbb-2.c: Adjust.
* gcc.target/powerpc/vsu/vec-xl-len-12.c: Adjust.
* gcc.target/powerpc/vsu/vec-xl-len-13.c: Adjust.
* gcc.target/powerpc/vsu/vec-xlx-7.c: Adjust.
* gcc.target/powerpc/vsu/vec-xrx-7.c: Adjust.
* gcc.target/powerpc/vsu/vec-xst-len-12.c: Adjust.
* gcc.target/powerpc/vsu/vec-xst-len-13.c: Adjust.

From-SVN: r273468

4 years ago* Makefile.rtl: Use g-sercom__linux.adb for all linuxes.
Andreas Schwab [Sat, 13 Jul 2019 12:03:29 +0000 (12:03 +0000)]
* Makefile.rtl: Use g-sercom__linux.adb for all linuxes.

From-SVN: r273467

4 years agore PR target/90723 (pr88598-2.c segfaults with -msve-vector-bits=256)
Prathamesh Kulkarni [Sat, 13 Jul 2019 08:28:33 +0000 (08:28 +0000)]
re PR target/90723 (pr88598-2.c segfaults with -msve-vector-bits=256)

2019-07-15  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

PR target/90723
* recog.h (temporary_volatile_ok): New class.
* config/aarch64/aarch64.c (aarch64_emit_sve_pred_move): Set
volatile_ok temporarily to true using temporary_volatile_ok.
* expr.c (emit_block_move_via_cpymem): Likewise.
* optabs.c (maybe_legitimize_operand): Likewise.

From-SVN: r273466

4 years agore PR c/91149 (GCC 9 and later incorrectly rejects OpenMP task reduction-modifier...
Jakub Jelinek [Sat, 13 Jul 2019 06:29:46 +0000 (08:29 +0200)]
re PR c/91149 (GCC 9 and later incorrectly rejects OpenMP task reduction-modifier on target parallel combined construct)

PR c/91149
* c-omp.c (c_omp_split_clauses): Fix a pasto in
OMP_CLAUSE_REDUCTION_TASK handling.

* c-c++-common/gomp/reduction-task-3.c: New test.

From-SVN: r273465

4 years agogimplify.c (struct gimplify_omp_ctx): Add order_concurrent member.
Jakub Jelinek [Sat, 13 Jul 2019 06:25:04 +0000 (08:25 +0200)]
gimplify.c (struct gimplify_omp_ctx): Add order_concurrent member.

* gimplify.c (struct gimplify_omp_ctx): Add order_concurrent member.
(omp_notice_threadprivate_variable): Diagnose threadprivate variable
uses inside of order(concurrent) constructs.
(gimplify_scan_omp_clauses): Set ctx->order_concurrent if
OMP_CLAUSE_ORDER is seen.
* omp-low.c (struct omp_context): Add order_concurrent member.
(scan_sharing_clauses): Set ctx->order_concurrent if
OMP_CLAUSE_ORDER is seen.
(check_omp_nesting_restrictions): Diagnose ordered or atomic inside
of simd order(concurrent).  Diagnose constructs not allowed inside of
for order(concurrent).
(setjmp_or_longjmp_p): Add a context and TREE_PUBLIC check to avoid
complaining about static double setjmp (double); or class static
methods or non-global namespace setjmps.
(omp_runtime_api_call): New function.
(scan_omp_1_stmt): Diagnose OpenMP runtime API calls inside of
order(concurrent) loops.

* c-c++-common/gomp/order-3.c: New test.
* c-c++-common/gomp/order-4.c: New test.

From-SVN: r273464

4 years agoDaily bump.
GCC Administrator [Sat, 13 Jul 2019 00:16:24 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r273463

4 years ago[PATCH] Fix typo in test case.
Bill Seurer [Fri, 12 Jul 2019 21:57:07 +0000 (21:57 +0000)]
[PATCH] Fix typo in test case.

The test case has a typo in the big endian section that reversed two digits.

Fix committed as obvious.

2019-07-12  Bill Seurer  <seurer@linux.vnet.ibm.com>

* gcc.dg/tree-ssa/vector-7.c: Fix typo.

From-SVN: r273459

4 years ago[Darwin, testsuite] Remove unused test.
Iain Sandoe [Fri, 12 Jul 2019 18:38:33 +0000 (18:38 +0000)]
[Darwin, testsuite] Remove unused test.

During GCC-9, the codegen for unreachable switch case statements changed
such that the (undefined) behaviour of reaching such statements is directed
to one of the existing switch cases.  This means that the testcase which
deals with the old behaviour can no longer work (and there is nothing to test
with it).  The [Darwin-specific] test is now redundant and can be removed.

gcc/testsuite/

2019-07-12  Iain Sandoe  <iain@sandoe.co.uk>

* gcc.dg/pr57438-2.c: Remove.

From-SVN: r273457

4 years agoinvoke.texi (ssa-name-def-chain-limit): Document new --param.
Martin Sebor [Fri, 12 Jul 2019 17:36:45 +0000 (17:36 +0000)]
invoke.texi (ssa-name-def-chain-limit): Document new --param.

gcc/ChangeLog:

* doc/invoke.texi (ssa-name-def-chain-limit): Document new --param.
* params.def (PARAM_SSA_NAME_DEF_CHAIN_LIMIT): Add new --param.
* tree-vrp.c (vrp_prop::check_mem_ref): Use
PARAM_SSA_NAME_DEF_CHAIN_LIMIT.

gcc/testsuite/ChangeLog:

* gcc.dg/Warray-bounds-43.c: New test.

From-SVN: r273454

4 years agotree-ssa-alias.c (same_tmr_indexing_p): Break out from ...
Jan Hubicka [Fri, 12 Jul 2019 16:56:57 +0000 (16:56 +0000)]
tree-ssa-alias.c (same_tmr_indexing_p): Break out from ...

* tree-ssa-alias.c (same_tmr_indexing_p): Break out from ...
(indirect_refs_may_alias_p): ... here.
(nonoverlapping_component_refs_since_match_p): Support also non-trivial
mem refs in the access paths.

* gcc.dg/tree-ssa/alias-access-path-9.c: New testcase.

From-SVN: r273451

4 years agore PR tree-optimization/89430 (A missing ifcvt optimization to generate csel)
Jiangning Liu [Fri, 12 Jul 2019 16:28:43 +0000 (16:28 +0000)]
re PR tree-optimization/89430 (A missing ifcvt optimization to generate csel)

2019-07-12  Jiangning Liu  <jiangning.liu@amperecomputing.com>

PR tree-optimization/89430
* tree-ssa-phiopt.c (cond_store_replacement): Support conditional
store elimination for local variable without address escape.

PR tree-optimization/89430
* gcc.dg/tree-ssa/pr89430-1.c: New test.
* gcc.dg/tree-ssa/pr89430-2.c: New test.
* gcc.dg/tree-ssa/pr89430-3.c: New test.
* gcc.dg/tree-ssa/pr89430-4.c: New test.
* gcc.dg/tree-ssa/pr89430-5.c: New test.
* gcc.dg/tree-ssa/pr89430-6.c: New test.

From-SVN: r273449

4 years agoFix inaccurate comment in new test
Jonathan Wakely [Fri, 12 Jul 2019 15:45:16 +0000 (16:45 +0100)]
Fix inaccurate comment in new test

* testsuite/29_atomics/atomic_float/1.cc: Fix comment.

From-SVN: r273448

4 years agoc6x.c (c6x_section_type): Clear SECTION_NOTYPE for the ".far" section.
Jeff Law [Fri, 12 Jul 2019 15:40:39 +0000 (09:40 -0600)]
c6x.c (c6x_section_type): Clear SECTION_NOTYPE for the ".far" section.

* config/c6x/c6x.c (c6x_section_type): Clear SECTION_NOTYPE
for the ".far" section.

From-SVN: r273447

4 years agore PR tree-optimization/91145 (ICE: in vect_build_slp_tree_2, at tree-vect-slp.c...
Richard Biener [Fri, 12 Jul 2019 14:36:50 +0000 (14:36 +0000)]
re PR tree-optimization/91145 (ICE: in vect_build_slp_tree_2, at tree-vect-slp.c:1143 with -march=skylake-avx512 -O3)

2019-07-12  Richard Biener  <rguenther@suse.de>

PR tree-optimization/91145
* tree-vect-slp.c (vect_build_slp_tree_2): Fix reduction
chain check.

* gcc.dg/torture/pr91145.c: New testcase.

From-SVN: r273445

4 years agoallow EH to escape from GIMPLE_EH_ELSE ELSE block
Alexandre Oliva [Fri, 12 Jul 2019 13:51:00 +0000 (13:51 +0000)]
allow EH to escape from GIMPLE_EH_ELSE ELSE block

The only preexisting use of GIMPLE_EH_ELSE, for transactional memory
commits, did not allow exceptions to escape from the ELSE path.  The
trick it uses to allow the ELSE path to see the propagating exception
does not work very well if the exception cleanup raises further
exceptions: the ELSE block is configured to handle exceptions in
itself.  This confuses the heck out of CFG and EH cleanups.

Basing the lowering context for the ELSE block on outer_state, rather
than this_state, gets us the expected enclosing handler.

for  gcc/ChangeLog

* tree-eh.c (honor_protect_cleanup_actions): Use outer_
rather than this_state as the lowering context for the ELSE
seq in a GIMPLE_EH_ELSE.

for  gcc/testsuite/ChangeLog

* gcc.dg/gimplefe-44.c: New.

From-SVN: r273444

4 years agointroduce try/finally/else in gimplefe
Alexandre Oliva [Fri, 12 Jul 2019 13:50:49 +0000 (13:50 +0000)]
introduce try/finally/else in gimplefe

for  gcc/c/ChangeLog

* gimple-parser.c (c_parser_gimple_try_stmt): New.
(c_parser_compound_statement): Call it.

for  gcc/testsuite/ChangeLog

* gcc.dg/gimplefe-43.c: New.

From-SVN: r273443

4 years agoDefine __type_identity_t alias and use for string_view
Jonathan Wakely [Fri, 12 Jul 2019 11:43:22 +0000 (12:43 +0100)]
Define __type_identity_t alias and use for string_view

This defines the equivalent of C++2a's std::type_identity_t alias but
for use in C++11 and later. This can be used to replace __detail::__idt
in the string_view headers, which previously used common_type_t because
the one argument specialization of common_type_t was simply the identity
transform (which is no longer true).

* include/experimental/string_view (__detail::__idt): Remove.
(operator==, operator!=, operator<, operator>, operator<=, operator>=):
Use __type_identity_t instead of __detail::__idt;
* include/std/string_view (__detail::__idt): Remove.
(operator==, operator!=, operator<, operator>, operator<=, operator>=):
Use __type_identity_t instead of __detail::__idt;
* include/std/type_traits (__type_identity_t): New alias template.

From-SVN: r273442

4 years agoUpdate C++2a library status table
Jonathan Wakely [Fri, 12 Jul 2019 11:43:17 +0000 (12:43 +0100)]
Update C++2a library status table

* doc/xml/manual/status_cxx2020.xml: Update status for atomic_ref
and floating point atomics.

From-SVN: r273441

4 years agoRelax vector_builder::elt sanity check
Richard Sandiford [Fri, 12 Jul 2019 10:33:52 +0000 (10:33 +0000)]
Relax vector_builder::elt sanity check

I'd made it a precondition of vector_builder::elt that the encoding
must have been fully populated and that all implicit elements are
therefore defined.  But for one of the AArch64 patches I'm working on,
it'd be convenient to be able to look back at previous elements while
building up the encoding.  This patch therefore makes the assert
specific to implicit elements only.

2019-07-12  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* vector-builder.h (vector_builder::elt): Allow already-supplied
elements to be read back before building is complete.

From-SVN: r273440

4 years agore PR rtl-optimization/91136 (incorrect move of instruction to delay slot causes...
Eric Botcazou [Fri, 12 Jul 2019 10:15:39 +0000 (10:15 +0000)]
re PR rtl-optimization/91136 (incorrect move of instruction to delay slot causes application crash in exception handling)

PR rtl-optimization/91136
* df-core.c (ACCESSING REFS): Fix typos in comment.
* resource.c (mark_target_live_reg): Add artificial defs that occur at
the beginning of the block to the initial set of live registers.

From-SVN: r273436

4 years agofold-const.h (get_array_ctor_element_at_index): Adjust.
Richard Biener [Fri, 12 Jul 2019 10:03:10 +0000 (10:03 +0000)]
fold-const.h (get_array_ctor_element_at_index): Adjust.

2019-07-12  Richard Biener  <rguenther@suse.de>

* fold-const.h (get_array_ctor_element_at_index): Adjust.
* fold-const.c (get_array_ctor_element_at_index): Add
ctor_idx output parameter informing the caller where in
the constructor the element was (not) found.  Add early exit
for when the ctor is sorted.
* gimple-fold.c (fold_array_ctor_reference): Support constant
folding across multiple array elements.

* gcc.dg/tree-ssa/vector-7.c: New testcase.

From-SVN: r273435

4 years agocfgexpand.c (expand_gimple_stmt_1): If the statement doesn't have location...
Eric Botcazou [Fri, 12 Jul 2019 09:35:21 +0000 (09:35 +0000)]
cfgexpand.c (expand_gimple_stmt_1): If the statement doesn't have location...

* cfgexpand.c (expand_gimple_stmt_1) <GIMPLE_RETURN>: If the statement
doesn't have location, set the current location to the function's end

From-SVN: r273434

4 years ago[arch64] Fix ambiguous .md attribute uses
Richard Sandiford [Fri, 12 Jul 2019 08:14:34 +0000 (08:14 +0000)]
[arch64] Fix ambiguous .md attribute uses

This patch is part of a series that fixes ambiguous attribute
uses in .md files, i.e. cases in which attributes didn't use
<ITER:ATTR> to specify an iterator, and in which <ATTR> could
have different values depending on the iterator chosen.

No behavioural change except for dropping the unused SVE
divide permutations.

2019-07-12  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* config/aarch64/aarch64.md (*compare_condjump<mode>)
(loadwb_pair<GPI:mode>_<P:mode>, loadwb_pair<GPF:mode>_<P:mode>)
(storewb_pair<GPI:mode>_<P:mode>, storewb_pair<GPF:mode>_<P:mode>)
(*ands<mode>_compare0): Fix ambiguous uses of .md attributes.
* config/aarch64/aarch64-simd.md
(*aarch64_get_lane_extend<GPI:mode><VDQQH:mode>): Likewise.
(*aarch64_get_lane_zero_extend<GPI:mode><VDQQH:mode>): Likewise.
* config/aarch64/aarch64-sve.md
(while_ult<GPI:mode><PRED_ALL:mode>): Likewise.
(*cond_<optab><mode>_any): Fix SVE_I/SVE_SDI typo.

From-SVN: r273433

4 years agoSupport multiple operand counts for .md @ patterns
Richard Sandiford [Fri, 12 Jul 2019 07:54:23 +0000 (07:54 +0000)]
Support multiple operand counts for .md @ patterns

This patch extends the support for "@..." pattern names so that
the patterns can have different numbers of operands.  This allows
things like binary and ternary operations to be handled in a
consistent way, a bit like optabs.  The generators assert that
the number of operands passed is correct for the underlying
instruction.

Also, replace_operands_with_dups iterated over the old rtx format
even after having decided to do a replacement, which broke with
match_operator.

2019-07-12  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* doc/md.texi: Document that @ patterns can have different
numbers of operands.
* genemit.c (handle_overloaded_gen): Handle this case.
* genopinit.c (handle_overloaded_gen): Likewise.
* gensupport.c (replace_operands_with_dups): Iterate over
the new rtx's format rather than the old one's.

From-SVN: r273432

4 years agotree-core.h (enum omp_clause_code): Add OMP_CLAUSE_ORDER.
Jakub Jelinek [Fri, 12 Jul 2019 07:49:51 +0000 (09:49 +0200)]
tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_ORDER.

* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_ORDER.
* tree.c (omp_clause_num_ops, omp_clause_code_name): Add
order clause entries.
(walk_tree_1): Handle OMP_CLAUSE_ORDER.
* tree-pretty-print.c (dump_omp_clause): Likewise.
* gimplify.c (gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses):
Likewise.
* omp-low.c (scan_sharing_clauses): Likewise.
* tree-nested.c (convert_nonlocal_omp_clauses,
convert_local_omp_clauses): Likewise.
c-family/
* c-pragma.h (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_ORDER.
* c-omp.c (c_omp_split_clauses): Handle splitting of OMP_CLAUSE_ORDER.
c/
* c-parser.c (c_parser_omp_clause_name): Handle order clause.
(c_parser_omp_clause_order): New function.
(c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ORDER.
(OMP_SIMD_CLAUSE_MASK, OMP_FOR_CLAUSE_MASK): Add
PRAGMA_OMP_CLAUSE_ORDER.
* c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_ORDER.
cp/
* parser.c (cp_parser_omp_clause_name): Handle order clause.
(cp_parser_omp_clause_order): New function.
(cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ORDER.
(OMP_SIMD_CLAUSE_MASK, OMP_FOR_CLAUSE_MASK): Add
PRAGMA_OMP_CLAUSE_ORDER.
* semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_ORDER.
* pt.c (tsubst_omp_clauses): Likewise.
testsuite/
* c-c++-common/gomp/order-1.c: New test.
* c-c++-common/gomp/order-2.c: New test.

From-SVN: r273431

4 years agoAdd hint if the fallthrough target of current BB isn't the one
Kewen Lin [Fri, 12 Jul 2019 05:07:35 +0000 (05:07 +0000)]
Add hint if the fallthrough target of current BB isn't the one
placed closely next.

2019-07-12  Kewen Lin  <linkw@gcc.gnu.org>

    * gcc/cfgrtl.c (print_rtl_with_bb): Emit a hint if the
    fallthrough target of current basic block isn't the placed
    right next.

From-SVN: r273430

4 years agoDaily bump.
GCC Administrator [Fri, 12 Jul 2019 00:16:23 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r273429

4 years agocompiler: ensure evaluation order in type hash/eq functions
Ian Lance Taylor [Thu, 11 Jul 2019 21:37:33 +0000 (21:37 +0000)]
compiler: ensure evaluation order in type hash/eq functions

    The type hash and equality functions are generated after the
    order_evaluations pass. They may contain shortcut operators and
    Set_and_use_temporary_expressions (e.g. from lowering a
    Binary_exprssion) that need to be ordered. Run order_evaluations
    and remove_shortcuts on these functions. (The hash functions
    may be fine, but to be on the safe side we run on them anyway.
    We do need to run on the equality functions.)

    A Set_and_use_temporary_expression is effectively an assignment,
    so it needs to be ordered. Otherwise if we insert a temporary
    statement before it, we may get wrong evaluation order.

    A test case is CL 185818.

    Fixes golang/go#33062.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/185817

From-SVN: r273425

4 years agoChangeLog: Fix whitespace.
Uros Bizjak [Thu, 11 Jul 2019 21:01:25 +0000 (23:01 +0200)]
ChangeLog: Fix whitespace.

* ChangeLog: Fix whitespace.
* testsuite/ChangeLog: Ditto.

From-SVN: r273424

4 years agoImprove docs for --enable-libstdcxx-time=rt
Jonathan Wakely [Thu, 11 Jul 2019 19:43:32 +0000 (20:43 +0100)]
Improve docs for --enable-libstdcxx-time=rt

* doc/xml/manual/configure.xml: Improve documentation of
--enable-libstdcxx-time option.

From-SVN: r273421

4 years agoDefine std::atomic_ref and std::atomic<floating-point> for C++20
Jonathan Wakely [Thu, 11 Jul 2019 19:43:25 +0000 (20:43 +0100)]
Define std::atomic_ref and std::atomic<floating-point> for C++20

This adds the new atomic types from C++2a, as proposed by P0019 and
P0020. To reduce duplication the calls to the compiler's atomic
built-ins are wrapped in new functions in the __atomic_impl namespace.
These functions are currently only used by std::atomic<floating-point>
and std::atomic_ref but could also be used for all other specializations
of std::atomic.

* include/bits/atomic_base.h (__atomic_impl): New namespace for
wrappers around atomic built-ins.
(__atomic_float, __atomic_ref): New class templates for use as base
classes.
* include/std/atomic (atomic<float>, atomic<double>)
(atomic<long double>): New explicit specializations.
(atomic_ref): New class template.
(__cpp_lib_atomic_ref): Define.
* include/std/version (__cpp_lib_atomic_ref): Define.
* testsuite/29_atomics/atomic/60695.cc: Adjust dg-error.
     * testsuite/29_atomics/atomic_float/1.cc: New test.
     * testsuite/29_atomics/atomic_float/requirements.cc: New test.
     * testsuite/29_atomics/atomic_ref/deduction.cc: New test.
     * testsuite/29_atomics/atomic_ref/float.cc: New test.
     * testsuite/29_atomics/atomic_ref/generic.cc: New test.
     * testsuite/29_atomics/atomic_ref/integral.cc: New test.
     * testsuite/29_atomics/atomic_ref/pointer.cc: New test.
     * testsuite/29_atomics/atomic_ref/requirements.cc: New test.

From-SVN: r273420

4 years agoi386: Add AVX512 unaligned intrinsics
Sunil K Pandey [Thu, 11 Jul 2019 19:09:37 +0000 (19:09 +0000)]
i386: Add AVX512 unaligned intrinsics

__m512i _mm512_loadu_epi64( void * sa);
void _mm512_storeu_epi64(void * d, __m512i a);
__m512i _mm512_loadu_epi32( void * sa);
void _mm512_storeu_epi32(void * d, __m512i a);
void _mm256_storeu_epi64(void * d, __m256i a);
void _mm_storeu_epi64(void * d, __m128i a);
void _mm256_storeu_epi32(void * d, __m256i a);
void _mm_storeu_epi32(void * d, __m128i a);

Tested on x86-64.

2019-07-11  Sunil K Pandey  <sunil.k.pandey@intel.com>

gcc/

PR target/90980
* config/i386/avx512fintrin.h (_mm512_loadu_epi64): New.
(_mm512_storeu_epi64): Likewise.
(_mm512_loadu_epi32): Likewise.
(_mm512_storeu_epi32): Likewise.
* config/i386/avx512vlintrin.h (_mm256_storeu_epi64): New.
(_mm_storeu_epi64): Likewise.
(_mm256_storeu_epi32): Likewise.
(_mm_storeu_epi32): Likewise.

gcc/testsuite/

PR target/90980
* gcc.target/i386/pr90980-1.c: New test.
* gcc.target/i386/pr90980-2.c: Likewise.
* gcc.target/i386/pr90980-3.c: Likewise.

From-SVN: r273416

4 years agors6000: Adjust comment for the Modula-2 traceback lang
Segher Boessenkool [Thu, 11 Jul 2019 18:51:23 +0000 (20:51 +0200)]
rs6000: Adjust comment for the Modula-2 traceback lang

* config/rs6000/rs6000-logue.c: Add Modula-2 to comment.

From-SVN: r273413

4 years agors6000: Handle Modula-2 in the traceback table
Segher Boessenkool [Thu, 11 Jul 2019 18:36:48 +0000 (20:36 +0200)]
rs6000: Handle Modula-2 in the traceback table

This patch recognises Modula-2 as language for the traceback table,
fixing the problem shown in
https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00848.html .

* config/rs6000/rs6000-logue.c (rs6000_output_function_epilogue):
Handle Modula-2.

From-SVN: r273411

4 years agore PR target/91124 (gcc.target/i386/avx512vl-vpshldvd-2.c etc. FAIL)
Jakub Jelinek [Thu, 11 Jul 2019 08:31:51 +0000 (10:31 +0200)]
re PR target/91124 (gcc.target/i386/avx512vl-vpshldvd-2.c etc. FAIL)

PR target/91124
* config/i386/sse.md (sse2_cvtpd2dq<mask_name>): Change into ...
(sse2_cvtpd2dq): ... this.  Remove mask substitution macros.
(sse2_cvtpd2dq_mask, sse2_cvtpd2dq_mask_1): New define_insns.
(ufix_notruncv2dfv2si2<mask_name>): Change into ...
(ufix_notruncv2dfv2si2): ... this.  Remove mask substitution macros.
(ufix_notruncv2dfv2si2_mask, ufix_notruncv2dfv2si2_mask_1): New
define_insns.
(ufix_truncv2dfv2si2<mask_name>): Change into ...
(ufix_truncv2dfv2si2): ... this.  Remove mask substitution macros.
(ufix_truncv2dfv2si2_mask, ufix_truncv2dfv2si2_mask_1): New
define_insns.
(sse2_cvttpd2dq<mask_name>): Change into ...
(sse2_cvttpd2dq): ... this.  Remove mask substitution macros.
(sse2_cvttpd2dq_mask, sse2_cvttpd2dq_mask_1): New define_insns.
(*sse2_cvtpd2dq<mask_name>): Change into ...
(*sse2_cvtpd2dq): ... this.  Remove mask substitution macros.
Add "C" constraint to const0_operand.
(*sse2_cvtpd2dq_mask, *sse2_cvtpd2dq_mask_1): New define_insns.
(sse2_cvtpd2ps_mask): Adjust expand to match *sse2_cvtpd2ps_mask
changes.

From-SVN: r273409

4 years agore PR target/91124 (gcc.target/i386/avx512vl-vpshldvd-2.c etc. FAIL)
Jakub Jelinek [Thu, 11 Jul 2019 08:31:19 +0000 (10:31 +0200)]
re PR target/91124 (gcc.target/i386/avx512vl-vpshldvd-2.c etc. FAIL)

PR target/91124
* config/i386/i386-builtin-types.def
(V32HI_FTYPE_V32HI_V32HI_V32HI_INT,
V16HI_FTYPE_V16HI_V16HI_V16HI_INT, V8HI_FTYPE_V8HI_V8HI_V8HI_INT,
V8SI_FTYPE_V8SI_V8SI_V8SI_INT, V4DI_FTYPE_V4DI_V4DI_V4DI_INT,
V8DI_FTYPE_V8DI_V8DI_V8DI_INT, V16SI_FTYPE_V16SI_V16SI_V16SI_INT,
V2DI_FTYPE_V2DI_V2DI_V2DI_INT, V4SI_FTYPE_V4SI_V4SI_V4SI_INT): Remove.
* config/i386/i386-builtin.def (__builtin_ia32_vpshrdv_v32hi_mask,
__builtin_ia32_vpshrdv_v32hi_maskz, __builtin_ia32_vpshrdv_v16hi_mask,
__builtin_ia32_vpshrdv_v16hi_maskz, __builtin_ia32_vpshrdv_v8hi_mask,
__builtin_ia32_vpshrdv_v8hi_maskz, __builtin_ia32_vpshrdv_v16si_mask,
__builtin_ia32_vpshrdv_v16si_maskz, __builtin_ia32_vpshrdv_v8si_mask,
__builtin_ia32_vpshrdv_v8si_maskz, __builtin_ia32_vpshrdv_v4si_mask,
__builtin_ia32_vpshrdv_v4si_maskz, __builtin_ia32_vpshrdv_v8di_mask,
__builtin_ia32_vpshrdv_v8di_maskz, __builtin_ia32_vpshrdv_v4di_mask,
__builtin_ia32_vpshrdv_v4di_maskz, __builtin_ia32_vpshrdv_v2di_mask,
__builtin_ia32_vpshrdv_v2di_maskz, __builtin_ia32_vpshldv_v32hi_mask,
__builtin_ia32_vpshldv_v32hi_maskz, __builtin_ia32_vpshldv_v16hi_mask,
__builtin_ia32_vpshldv_v16hi_maskz, __builtin_ia32_vpshldv_v8hi_mask,
__builtin_ia32_vpshldv_v8hi_maskz, __builtin_ia32_vpshldv_v16si_mask,
__builtin_ia32_vpshldv_v16si_maskz, __builtin_ia32_vpshldv_v8si_mask,
__builtin_ia32_vpshldv_v8si_maskz, __builtin_ia32_vpshldv_v4si_mask,
__builtin_ia32_vpshldv_v4si_maskz, __builtin_ia32_vpshldv_v8di_mask,
__builtin_ia32_vpshldv_v8di_maskz, __builtin_ia32_vpshldv_v4di_mask,
__builtin_ia32_vpshldv_v4di_maskz, __builtin_ia32_vpshldv_v2di_mask,
__builtin_ia32_vpshldv_v2di_maskz, __builtin_ia32_vpdpbusd_v16si_mask,
__builtin_ia32_vpdpbusd_v16si_maskz, __builtin_ia32_vpdpbusd_v8si_mask,
__builtin_ia32_vpdpbusd_v8si_maskz, __builtin_ia32_vpdpbusd_v4si_mask,
__builtin_ia32_vpdpbusd_v4si_maskz,
__builtin_ia32_vpdpbusds_v16si_mask,
__builtin_ia32_vpdpbusds_v16si_maskz,
__builtin_ia32_vpdpbusds_v8si_mask,
__builtin_ia32_vpdpbusds_v8si_maskz,
__builtin_ia32_vpdpbusds_v4si_mask,
__builtin_ia32_vpdpbusds_v4si_maskz,
__builtin_ia32_vpdpwssd_v16si_mask,
__builtin_ia32_vpdpwssd_v16si_maskz, __builtin_ia32_vpdpwssd_v8si_mask,
__builtin_ia32_vpdpwssd_v8si_maskz, __builtin_ia32_vpdpwssd_v4si_mask,
__builtin_ia32_vpdpwssd_v4si_maskz,
__builtin_ia32_vpdpwssds_v16si_mask,
__builtin_ia32_vpdpwssds_v16si_maskz,
__builtin_ia32_vpdpwssds_v8si_mask,
__builtin_ia32_vpdpwssds_v8si_maskz,
__builtin_ia32_vpdpwssds_v4si_mask,
__builtin_ia32_vpdpwssds_v4si_maskz): Use *_USI, *_UHI or *_UQI
suffixed types rather than *_INT.
* config/i386/i386-expand.c (ix86_expand_args_builtin): Don't handle
V32HI_FTYPE_V32HI_V32HI_V32HI_INT, V16HI_FTYPE_V16HI_V16HI_V16HI_INT,
V8HI_FTYPE_V8HI_V8HI_V8HI_INT, V8SI_FTYPE_V8SI_V8SI_V8SI_INT,
V4DI_FTYPE_V4DI_V4DI_V4DI_INT, V8DI_FTYPE_V8DI_V8DI_V8DI_INT,
V16SI_FTYPE_V16SI_V16SI_V16SI_INT, V2DI_FTYPE_V2DI_V2DI_V2DI_INT
and V4SI_FTYPE_V4SI_V4SI_V4SI_INT.

From-SVN: r273408

4 years ago[Ada] Use high-level wrappers for Lib.Units.Table
Piotr Trojanek [Thu, 11 Jul 2019 08:03:33 +0000 (08:03 +0000)]
[Ada] Use high-level wrappers for Lib.Units.Table

2019-07-11  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* lib-writ.adb (Ensure_System_Dependency,
Up_To_Date_ALI_File_Exists, Write_ALI): Replace low-level access
to table with a high-level query.

From-SVN: r273407

4 years ago[Ada] Minor refactoring
Piotr Trojanek [Thu, 11 Jul 2019 08:03:28 +0000 (08:03 +0000)]
[Ada] Minor refactoring

2019-07-11  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* checks.adb: Fix typo in comment.
* sem.adb (Semantics): Avoid repeated calls to
In_Extended_Main_Source_Unit by reusing an already-cached
result.
* sem_util.adb (First_Global): Fix style.

From-SVN: r273406

4 years ago[Ada] Avoid spurious errors on dimensionality checking in GNATprove
Yannick Moy [Thu, 11 Jul 2019 08:03:24 +0000 (08:03 +0000)]
[Ada] Avoid spurious errors on dimensionality checking in GNATprove

In the special GNATprove mode of the frontend, automatic inlining is
performed, which may lead to spurious errors on dimensionality checking.
Avoid performing this checking on inlined code, which has already been
checked for dimensionality errors.

There is no impact on compilation.

2019-07-11  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_res.adb (Resolve_Call): Do not perform dimensionality
checking on inlined bodies.

From-SVN: r273405

4 years ago[Ada] Flip the meaning of debug switch -gnatdF
Yannick Moy [Thu, 11 Jul 2019 08:03:19 +0000 (08:03 +0000)]
[Ada] Flip the meaning of debug switch -gnatdF

2019-07-11  Yannick Moy  <moy@adacore.com>

gcc/ada/

* debug.adb: Flip meaning of debug switch -gnatdF.

From-SVN: r273404

4 years ago[Ada] Avoid spurious warning on assertions with Loop_Entry
Yannick Moy [Thu, 11 Jul 2019 08:03:14 +0000 (08:03 +0000)]
[Ada] Avoid spurious warning on assertions with Loop_Entry

When the Loop_Entry attribute is used inside a loop invariant or another
assertion where it is allowed, it may lead to spurious warnings on
conditions that are detected to be always valid. Now fixed.

2019-07-11  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_eval.adb (Is_Same_Value): Add special case for rewritten
Loop_Entry attribute.

gcc/testsuite/

* gnat.dg/loop_entry1.adb: New testcase.

From-SVN: r273403

4 years ago[Ada] Refactor ownership pointer checking in SPARK as a generic
Claire Dross [Thu, 11 Jul 2019 08:03:09 +0000 (08:03 +0000)]
[Ada] Refactor ownership pointer checking in SPARK as a generic

Ownership checking as done in SPARK should be applied only to SPARK
code, which requires GNATprove knowledge of the SPARK_Mode boundary.
Transform the checking unit into a generic to allow passing in the
knowledge from GNATprove to that unit in GNAT sources.

Keeping the code in GNAT sources makes it possible in the future to
adapt it further (or simply instantiate it differently) to be used on
Ada code, independently of GNATprove.

There is no impact on compilation.

2019-07-11  Claire Dross  <dross@adacore.com>

gcc/ada/

* gnat1drv.adb: SPARK checking rules for pointer aliasing are
moved to GNATprove backend.
* sem_spark.ads, sem_spark.adb (Sem_SPARK): Is now a generic
unit. Takes as parameters:
 - Retysp which is used to query the most underlying type
   visible in SPARK. We do not introduce aliasing checks for
   types which are not visibly deep.
 - Component_Is_Visible_In_SPARK is used to avoid doing pointer
   aliasing checks on components which are not visible in SPARK.
 - Emit_Messages returns True in the second phase of SPARK
   analysis. Error messages for failed aliasing checks are only
   output in this case.
Additionally, errors on constructs not supported in SPARK are
removed as duplicates of marking errors. Components are stored
in the permission map using their original component to avoid
inconsistencies between components of different views of the
same type.
(Check_Expression): Handle delta constraints.
(Is_Deep): Exported so that we can check for SPARK restrictions
on deep types inside SPARK semantic checkings.
(Is_Traversal_Function): Exported so that we can check for SPARK
restrictions on traversal functions inside SPARK semantic
checkings.
(Check_Call_Statement, Read_Indexes): Check wether we are
dealing with a subprogram pointer type before querying called
entity.
(Is_Subpath_Expression): Image attribute can appear inside a
path.
(Check_Loop_Statement): Correct order of statements in the loop.
(Check_Node): Ignore raise nodes.
(Check_Statement): Use Last_Non_Pragma to get the object
declaration in an extended return statement.

From-SVN: r273402

4 years ago[Ada] Minimal binder
Patrick Bernardi [Thu, 11 Jul 2019 08:03:04 +0000 (08:03 +0000)]
[Ada] Minimal binder

The new minimal binder option ("-minimal") suppresses the generation of
binder objects that are not strictly required for program operation.
This option is suitable for space constrained applications and comes
with the restriction that programs can no longer be debugged using GDB.

2019-07-11  Patrick Bernardi  <bernardi@adacore.com>

gcc/ada/

* bindgen.adb (Gen_Main): Do not generate a reference to
Ada_Main_Program_Name when the Minimal_Binder flag is set.
(Gen_Output_File_Ada): Do not output GNAT_Version and
Ada_Main_Program_Name info if Minimal_Binder flag is set.
* bindusg.adb: Add documentation for new -minimal switch.
* gnatbind.adb (Scan_Bind_Arg): Scan -minimal switch.
* opt.ads: Add new global flag Minimal_Binder to indicate if the
binder should not produce global variables.
* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
Update documentation with new binder -minimal switch.
* gnat_ugn.texi: Regenerate.

From-SVN: r273401

4 years ago[Ada] Makefile.rtl: add a warning about compilation flags
Eric Botcazou [Thu, 11 Jul 2019 08:02:58 +0000 (08:02 +0000)]
[Ada] Makefile.rtl: add a warning about compilation flags

2019-07-11  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* Makefile.rtl: Add warning note about compilation flags and
capitalize.

From-SVN: r273400

4 years ago[Ada] Crash on protected type with self-referential component
Ed Schonberg [Thu, 11 Jul 2019 08:02:53 +0000 (08:02 +0000)]
[Ada] Crash on protected type with self-referential component

This patch fixes a compiler abort on a declarastion for a protected type
PT when one of its private component is of type access PT.

2019-07-11  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_ch9.adb (Expand_N_Protected_Type_Declaaration): New
subsidiary routine Replace_Access_Definition, to handle properly
a protected type PT one of whose private components is of type
access PT.

gcc/testsuite/

* gnat.dg/prot8.adb, gnat.dg/prot8.ads: New testcase.

From-SVN: r273399

4 years ago[Ada] GNAT.Sockets: support ICMP, IGMP and RAW IP protocol levels
Dmitriy Anisimkov [Thu, 11 Jul 2019 08:02:49 +0000 (08:02 +0000)]
[Ada] GNAT.Sockets: support ICMP, IGMP and RAW IP protocol levels

2019-07-11  Dmitriy Anisimkov  <anisimko@adacore.com>

gcc/ada/

* libgnat/g-socket.ads (Level_Type): Add enumerators for
IP_Protocol_For_ICMP, IP_Protocol_For_IGMP,
IP_Protocol_For_RAW_Level.
* libgnat/g-socket.adb (Levels): Handle them.
* s-oscons-tmplt.c: Import socket protocols defined in
netinet/in.h.

From-SVN: r273398

4 years ago[Ada] Memory corruption when using formal hashed sets or maps
Claire Dross [Thu, 11 Jul 2019 08:02:44 +0000 (08:02 +0000)]
[Ada] Memory corruption when using formal hashed sets or maps

Add a check to avoid causing a buffer overflow when the map is empty

2019-07-11  Claire Dross  <dross@adacore.com>

gcc/ada/

* libgnat/a-cfhama.adb, libgnat/a-cfhase.adb (Free): Do not
reset the Has_Element flag if no element is freed.

From-SVN: r273397

4 years ago[Ada] errno.c: remove obsolete support for MaRTE OS
Arnaud Charlet [Thu, 11 Jul 2019 08:02:40 +0000 (08:02 +0000)]
[Ada] errno.c: remove obsolete support for MaRTE OS

2019-07-11  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* errno.c: Remove obsolete support for MaRTE OS.

From-SVN: r273396

4 years ago[Ada] Remove redundant predicate checks
Ed Schonberg [Thu, 11 Jul 2019 08:02:35 +0000 (08:02 +0000)]
[Ada] Remove redundant predicate checks

This patch removes redundant dynamic predicate checks generated by type
conversions in various contexts. The patch also recognizes additional
such checks that can be evaluated statically when applied to constant
values.

No simple test available.

2019-07-11  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_ch4.adb (Expand_N_Type_Conversion): If a predicate check
is generated, analyze it with range check suppressed, because
that check has been previously applied.
* exp_ch5.adb (Expand_N_Assignment_Statement): If the RHS is a
type conversion to the type of the LHS, do not apply a predicate
check to the RHS because it will have been generated already
during its expansion.
* exp_ch6.adb (Can_Fold_Predicate_Call): Extend processing to
handle a predicate check on a constant entity whose value is
static.

From-SVN: r273395

4 years ago[Ada] Elaboration order v4.0 and output of dependencies
Hristian Kirtchev [Thu, 11 Jul 2019 08:02:30 +0000 (08:02 +0000)]
[Ada] Elaboration order v4.0 and output of dependencies

This patch adds a missing case to the mechanism that outputs the
elaboration order dependencies of units.

------------
-- Source --
------------

--  pack.ads

package Pack is
   procedure Force_Body;
end Pack;

--  pack.adb

package body Pack is
   procedure Force_Body is null;
end Pack;

--  main.adb

with Pack;

procedure Main is begin null; end Main;

----------------------------
-- Compilation and output --
----------------------------

$ gnatmake -q main.adb -bargs -e

ELABORATION ORDER DEPENDENCIES

   unit "pack (spec)" must be elaborated before unit "main (body)"
     reason: unit "main (body)" has with clause for unit "pack (spec)"
   unit "pack (spec)" must be elaborated before unit "pack (body)"
     reason: spec must be elaborated before body

2019-07-11  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* bindo.adb: Remove the documentation of switch -d_N because it
is no longer in use.
* bindo-graphs.ads, bindo-graphs.adb (Is_Spec_Before_Body_Edge):
New routine.
* bindo-writers.adb (Write_Dependency_Edge): Add the missing
case of a spec-before-body edge.

From-SVN: r273394

4 years ago[Ada] GNAT.Sockets: add support for RAW sockets
Dmitriy Anisimkov [Thu, 11 Jul 2019 08:02:26 +0000 (08:02 +0000)]
[Ada] GNAT.Sockets: add support for RAW sockets

2019-07-11  Dmitriy Anisimkov  <anisimko@adacore.com>

gcc/ada/

* libgnat/g-socket.ads (Mode_Type): Add a Socket_Raw enumerator.
* libgnat/g-socket.adb (Modes): Handle Socket_Raw.

From-SVN: r273393

4 years ago[Ada] Pragma Unreferenced triggers undefined reference
Justin Squirek [Thu, 11 Jul 2019 08:02:21 +0000 (08:02 +0000)]
[Ada] Pragma Unreferenced triggers undefined reference

This patch corrects the generation of protected body declarations so
that instances of pragma Unreferenced applied to formals don't falsly
trigger undefined references.

2019-07-11  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* exp_ch9.adb (Build_Private_Protected_Declaration): Add
exception for the moving of pragmas to internally generated
specs for pragma Unreferenced.

gcc/testsuite/

* gnat.dg/unreferenced2.adb: New testcase.

From-SVN: r273392

4 years ago[Ada] Fix inconsistent documentation for gnatmetric
Bob Duff [Thu, 11 Jul 2019 08:02:17 +0000 (08:02 +0000)]
[Ada] Fix inconsistent documentation for gnatmetric

One part said all metrics are enabled by default (which is now true),
and another part said the coupling metrics are disabled by default
(which is no longer true).

2019-07-11  Bob Duff  <duff@adacore.com>

gcc/ada/

* doc/gnat_ugn/gnat_utility_programs.rst: Fix inconsistent
documentation for gnatmetric.
* gnat_ugn.texi: Regenerate.

From-SVN: r273391

4 years ago[Ada] Document gnatpp's --spaces-only switch
Bob Duff [Thu, 11 Jul 2019 08:02:12 +0000 (08:02 +0000)]
[Ada] Document gnatpp's --spaces-only switch

2019-07-11  Bob Duff  <duff@adacore.com>

gcc/ada/

* doc/gnat_ugn/gnat_utility_programs.rst: Document gnatpp's
--spaces-only switch.

From-SVN: r273390

4 years ago[Ada] Infinite loop on illegal declaration
Hristian Kirtchev [Thu, 11 Jul 2019 08:02:07 +0000 (08:02 +0000)]
[Ada] Infinite loop on illegal declaration

This patch updates predicate Null_Status to prevent an infinite
recursion when the argument is an illegal object declaration of an
access type.

2019-07-11  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* sem_util.adb (Null_Status): Assume that an erroneous construct
has an undefined null status.

gcc/testsuite/

* gnat.dg/self_ref1.adb: New testcase.

From-SVN: r273389

4 years ago[Ada] Minor reformatting
Hristian Kirtchev [Thu, 11 Jul 2019 08:02:03 +0000 (08:02 +0000)]
[Ada] Minor reformatting

2019-07-11  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* checks.adb, exp_ch6.adb, gnat1drv.adb, sem_aux.adb,
sem_ch2.adb, sem_ch8.adb, sem_res.adb: Minor reformatting.

From-SVN: r273388

4 years ago[Ada] Internal crash on illegal renaming
Hristian Kirtchev [Thu, 11 Jul 2019 08:01:58 +0000 (08:01 +0000)]
[Ada] Internal crash on illegal renaming

This patch updates the retrieval of the renamed object name of an object
renaming declaration to handle various name forms.

No need for a test because one already exists, and reproducing requires
a compiler built with assertions.

2019-07-11  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* sem_ch8.adb (Analyze_Object_Renaming): Obtain the object being
renamed using routine Get_Object_Name which takes care of
various name forms.
(Get_Object_Name): New routine.

From-SVN: r273387

4 years ago[Ada] Compile-time evaluation of predicate checks
Ed Schonberg [Thu, 11 Jul 2019 08:01:54 +0000 (08:01 +0000)]
[Ada] Compile-time evaluation of predicate checks

This patch recognizes case of dynamic predicates on integer subtypes
that are simple enough to be evaluated statically when the argument is
itself a literal. Even though in many cases such predicate checks will
be removed by the back-end with any level of optimization, it is
preferable to perform this constant folding in the front-end, wich also
cleans up the output of CCG, as well as producing explicit warnings when
the test will fail.

2019-07-11  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_ch6.adb (Can_Fold_Predicate_Call): New function,
subsidiary of Expand_Call_Helper, to compute statically a
predicate check when the argument is a static integer.

gcc/testsuite/

* gnat.dg/predicate11.adb: New testcase.

From-SVN: r273386

4 years ago[Ada] Link error due to negated intrinsic comparison
Hristian Kirtchev [Thu, 11 Jul 2019 08:01:49 +0000 (08:01 +0000)]
[Ada] Link error due to negated intrinsic comparison

This patch corrects the resolution of operator "not" when the expression
being negated is an equality operator to prevent the transformation of
an intrinsic equality operator into a function call.

2019-07-11  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* sem_res.adb (Resolve_Op_Not): Do not rewrite an equality
operator into a function call when the operator is intrinsic.

gcc/testsuite/

* gnat.dg/equal9.adb: New testcase.

From-SVN: r273385

4 years ago[Ada] Fix crash on dynamic predicate when generating SCOs
Thomas Quinot [Thu, 11 Jul 2019 08:01:44 +0000 (08:01 +0000)]
[Ada] Fix crash on dynamic predicate when generating SCOs

A pragma Check for Dynamic_Predicate does not correspond to any source
construct that has a provisionally-disabled SCO.

2019-07-11  Thomas Quinot  <quinot@adacore.com>

gcc/ada/

* sem_prag.adb (Analyze_Pragma, case pragma Check): Do not call
Set_SCO_Pragma_Enabled for the dynamic predicate case.

gcc/testsuite/

* gnat.dg/scos1.adb: New testcase.

From-SVN: r273384

4 years ago[Ada] Missing finalization of private protected type
Hristian Kirtchev [Thu, 11 Jul 2019 08:01:39 +0000 (08:01 +0000)]
[Ada] Missing finalization of private protected type

This patch updates the analysis of protected types to properly mark the
type as having controlled components when it contains at least one such
component. This in turn marks a potential partial view as requiring
finalization actions.

------------
-- Source --
------------

--  types.ads

with Ada.Finalization; use Ada.Finalization;

package Types is
   type Ctrl_Typ is new Controlled with null record;
   procedure Finalize (Obj : in out Ctrl_Typ);

   type Prot_Typ is limited private;

private
   protected type Prot_Typ is
   private
      Comp : Ctrl_Typ;
   end Prot_Typ;
end Types;

--  types.adb

with Ada.Text_IO; use Ada.Text_IO;

package body Types is
   procedure Finalize (Obj : in out Ctrl_Typ) is
   begin
      Put_Line ("finalize");
   end Finalize;

   protected body Prot_Typ is
   end Prot_Typ;
end Types;

--  main.adb

with Types; use Types;

procedure Main is
   Obj : Prot_Typ;
begin
   null;
end Main;

2019-07-11  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* exp_util.ads, exp_util.adb (Needs_Finalization): Move to
Sem_Util.
* sem_ch9.adb (Analyze_Protected_Definition): Code cleanup. Mark
the protected type as having controlled components when it
contains at least one such component.
* sem_util.ads, sem_util.adb (Needs_Finalization): New
function.

From-SVN: r273383

4 years ago[Ada] New Repinfo.Input unit to read back JSON representation info.
Eric Botcazou [Thu, 11 Jul 2019 08:01:35 +0000 (08:01 +0000)]
[Ada] New Repinfo.Input unit to read back JSON representation info.

For some time the Repinfo unit has been able to output the
representation information in the JSON data interchange format in
addition to the usual text and binary formats.

The new Repinfo.Input unit makes it possible to read back this
information under this format and make it available to clients, the main
one being ASIS.

The big advantage of using this approach over manipulating a binary blob
is that the writer and the reader of the JSON representation need not be
binary compatible, i.e. in practice need not be the same version of the
compiler or ASIS for the same target.

The patch also adds a -gnatd_j switch to read back the information in
the compiler itself, which makes it easy to keep the writer and the
reader in sync using only one tool, namely the compiler.  The typical
usage is:

  gcc -c p.ads -gnatR4js
  gcc -c p.ads -gnatd_j

to exercise respectively the writer and the reader from the compiler.

2019-07-11  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* alloc.ads (Rep_JSON_Table_Initial): New constant.
(Rep_JSON_Table_Increment): Likewise.
* debug.adb: Document -gnatd_j switch.
* gcc-interface/Make-lang.in (GNAT_ADA_OBJS): Add
repinfo-input.o.
* gnat1drv.adb: Add with clause for Repinfo.Input.
Add with and use clauses for Sinput.
(Read_JSON_Files_For_Repinfo): New procedure.
(Gnat1drv1): Deal with -gnatd_j switch.
* repinfo-input.ad[sb]: New unit.
* snames.ads-tmpl (Name_Discriminant): New constant.
(Name_Operands): Likewise.

From-SVN: r273382

4 years ago[Ada] No warning for guaranteed accessibility check failures
Justin Squirek [Thu, 11 Jul 2019 08:01:30 +0000 (08:01 +0000)]
[Ada] No warning for guaranteed accessibility check failures

This patch corrects the generation of dynamic accessibility checks which
are guaranteed to trigger errors during run time so as to give the user
proper warning during unit compiliation.

2019-07-11  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* checks.adb (Apply_Accessibility_Check): Add check for constant
folded conditions on accessibility checks.

gcc/testsuite/

* gnat.dg/access7.adb: New testcase.

From-SVN: r273381

4 years ago[Ada] GNAT.Threads: Add a Get_Thread overload taking a Task_Id
Arnaud Charlet [Thu, 11 Jul 2019 08:01:25 +0000 (08:01 +0000)]
[Ada] GNAT.Threads: Add a Get_Thread overload taking a Task_Id

2019-07-11  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* libgnarl/g-thread.ads, libgnarl/g-thread.adb (Get_Thread):
Update comments. Add new version taking a Task_Id.

From-SVN: r273380

4 years ago[Ada] Elaboration order v4.0 and infinite loops
Hristian Kirtchev [Thu, 11 Jul 2019 08:01:21 +0000 (08:01 +0000)]
[Ada] Elaboration order v4.0 and infinite loops

This patch introduces binder switch -d_S which prompts the various
phases of the elaboration order mechanism to output a short message
concerning their commencement and completion. The output is useful when
trying to determine whether a phase is stuck in an infinite loop.

------------
-- Source --
------------

--  main.adb

procedure Main is begin null; end Main;

----------------------------
-- Compilation and output --
----------------------------

$ gnatmake -q main.adb -bargs -d_S -d_V
elaborating units...
collecting units...
units collected.
constructing library graph...
validating library graph...
library graph validated.
library graph constructed.
constructing invocation graph...
validating invocation graph...
invocation graph validated.
invocation graph constructed.
augmenting library graph...
library graph augmented.
discovering components...
components discovered.
validating elaboration order...
elaboration order validated.
units elaborated.

2019-07-11  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* bindo.adb: Update the section of switches and debugging
elaboration issues.
* bindo.ads: Add type Elaboration_Phase.
* bindo-augmentors.adb: Add use clause for
Bindo.Writers.Phase_Writers.
(Augment_Library_Graph): Signal the start and end of the
aubmentation phase.
* bindo-builders.adb: Add with and use clause for Bindo.Writers.
Add use clause for Bindo.Writers.Phase_Writers.
(Build_Invocation_Graph): Signal the start and end of the
invocation graph construction phase.
(Build_Library_Graph): Signal the start and end of the library
graph construction phase.
* bindo-diagnostics.adb: Add use clause for
Bindo.Writers.Phase_Writers.
(Diagnose_Cycle): Signal the start and end of the cycle
diagnostic phase.
* bindo-elaborators.adb: Add use clause for
Bindo.Writers.Phase_Writers.
(Elaborate_Units): Signal the start and end of the unit
elaboration phase.
* bindo-graphs.adb: Add use clause for
Bindo.Writers.Phase_Writers.
(Find_Components): Signal the start and end of the component
discovery phase.
(Find_Cycles): Signal the start and end of the cycle discovery
phase.
* bindo-units.adb: Add with and use clause for Bindo.Writers.
Add use clause for Bindo.Writers.Phase_Writers.
(Collect_Elaborable_Units): Signal the start and end of the unit
collection phase.
* bindo-validators.adb: Add with and use clause for
Bindo.Writers.  Add use clause for Bindo.Writers.Phase_Writers.
(Validate_Cycles, Validate_Elaboration_Order,
Validate_Invocation_Graph, Validate_Library_Graph): Signal the
start and end of the libray graph validation phase.
* bindo-writers.ads, bindo-writers.adb: Add new nested package
Phase_Writers.
* debug.adb: Update the documentation of switch d_S.

From-SVN: r273379

4 years ago[Ada] Avoid spurious warning on wrong order of operator call arguments
Yannick Moy [Thu, 11 Jul 2019 08:01:07 +0000 (08:01 +0000)]
[Ada] Avoid spurious warning on wrong order of operator call arguments

GNAT issues a warning under -gnatwa when actuals for a call are named
like the formals, but in a different order. This is inappropriate for
calls to operators in infix form, when e.g. Right <= Left is in general
the intended order. Special case calls to operators to avoid that
spurious warning.

2019-07-11  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_res.adb (Check_Argument_Order): Special case calls to
operators.

gcc/testsuite/

* gnat.dg/warn21.adb, gnat.dg/warn21.ads: New testcase.

From-SVN: r273378

4 years agoDo not try to further refine a VR_UNDEFINED result when intersecting
Aldy Hernandez [Thu, 11 Jul 2019 07:50:58 +0000 (07:50 +0000)]
Do not try to further refine a VR_UNDEFINED result when intersecting
value_ranges.

From-SVN: r273377

4 years agore PR middle-end/91131 (Bad bitfield coalescing)
Richard Biener [Thu, 11 Jul 2019 07:32:04 +0000 (07:32 +0000)]
re PR middle-end/91131 (Bad bitfield coalescing)

2019-07-11  Richard Biener  <rguenther@suse.de>

PR middle-end/91131
* gimplify.c (gimplify_compound_literal_expr): Force a temporary
when the object is volatile and we have not cleared it even though
there are no nonzero elements.

* gcc.target/i386/pr91131.c: New testcase.

From-SVN: r273376