]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
5 years ago2018-08-21 Nicolas Koenig <koenigni@gcc.gnu.org>
koenigni [Tue, 21 Aug 2018 18:48:59 +0000 (18:48 +0000)] 
2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
Thomas Koenig <tkoenig@gcc.gnu.org>

PR fortran/25829
* gfortran.texi: Add description of asynchronous I/O.
* trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
as volatile.
* trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
st_wait_async and change argument spec from ".X" to ".w".
(gfc_trans_wait): Pass ID argument via reference.

2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
Thomas Koenig <tkoenig@gcc.gnu.org>

PR fortran/25829
* gfortran.dg/f2003_inquire_1.f03: Add write statement.
* gfortran.dg/f2003_io_1.f03: Add wait statement.

2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
Thomas Koenig <tkoenig@gcc.gnu.org>

PR fortran/25829
* Makefile.am: Add async.c to gfor_io_src.
Add async.h to gfor_io_headers.
* Makefile.in: Regenerated.
* gfortran.map: Add _gfortran_st_wait_async.
* io/async.c: New file.
* io/async.h: New file.
* io/close.c: Include async.h.
(st_close): Call async_wait for an asynchronous unit.
* io/file_pos.c (st_backspace): Likewise.
(st_endfile): Likewise.
(st_rewind): Likewise.
(st_flush): Likewise.
* io/inquire.c: Add handling for asynchronous PENDING
and ID arguments.
* io/io.h (st_parameter_dt): Add async bit.
(st_parameter_wait): Correct.
(gfc_unit): Add au pointer.
(st_wait_async): Add prototype.
(transfer_array_inner): Likewise.
(st_write_done_worker): Likewise.
* io/open.c: Include async.h.
(new_unit): Initialize asynchronous unit.
* io/transfer.c (async_opt): New struct.
(wrap_scalar_transfer): New function.
(transfer_integer): Call wrap_scalar_transfer to do the work.
(transfer_real): Likewise.
(transfer_real_write): Likewise.
(transfer_character): Likewise.
(transfer_character_wide): Likewise.
(transfer_complex): Likewise.
(transfer_array_inner): New function.
(transfer_array): Call transfer_array_inner.
(transfer_derived): Call wrap_scalar_transfer.
(data_transfer_init): Check for asynchronous I/O.
Perform a wait operation on any pending asynchronous I/O
if the data transfer is synchronous. Copy PDT and enqueue
thread for data transfer.
(st_read_done_worker): New function.
(st_read_done): Enqueue transfer or call st_read_done_worker.
(st_write_done_worker): New function.
(st_write_done): Enqueue transfer or call st_read_done_worker.
(st_wait): Document as no-op for compatibility reasons.
(st_wait_async): New function.
* io/unit.c (insert_unit): Use macros LOCK, UNLOCK and TRYLOCK;
add NOTE where necessary.
(get_gfc_unit): Likewise.
(init_units): Likewise.
(close_unit_1): Likewise. Call async_close if asynchronous.
(close_unit): Use macros LOCK and UNLOCK.
(finish_last_advance_record): Likewise.
(newunit_alloc): Likewise.
* io/unix.c (find_file): Likewise.
(flush_all_units_1): Likewise.
(flush_all_units): Likewise.
* libgfortran.h (generate_error_common): Add prototype.
* runtime/error.c: Include io.h and async.h.
(generate_error_common): New function.

2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
Thomas Koenig <tkoenig@gcc.gnu.org>

PR fortran/25829
* testsuite/libgomp.fortran/async_io_1.f90: New test.
* testsuite/libgomp.fortran/async_io_2.f90: New test.
* testsuite/libgomp.fortran/async_io_3.f90: New test.
* testsuite/libgomp.fortran/async_io_4.f90: New test.
* testsuite/libgomp.fortran/async_io_5.f90: New test.
* testsuite/libgomp.fortran/async_io_6.f90: New test.
* testsuite/libgomp.fortran/async_io_7.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263750 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago PR c++/86499
mpolacek [Tue, 21 Aug 2018 18:37:23 +0000 (18:37 +0000)] 
PR c++/86499
* parser.c (cp_parser_lambda_introducer): Give error if a non-local
lambda has a capture-default.

* g++.dg/cpp0x/lambda/lambda-non-local.C: New test.
* g++.dg/cpp0x/lambda/lambda-this10.C: Adjust dg-error.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263749 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago2018-08-21 Paolo Carlini <paolo.carlini@oracle.com>
paolo [Tue, 21 Aug 2018 15:49:58 +0000 (15:49 +0000)] 
2018-08-21  Paolo Carlini  <paolo.carlini@oracle.com>

* decl.c (check_static_variable_definition): Change to return void.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263742 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago PR c++/86981, Implement -Wpessimizing-move.
mpolacek [Tue, 21 Aug 2018 15:38:36 +0000 (15:38 +0000)] 
PR c++/86981, Implement -Wpessimizing-move.
* c.opt (Wpessimizing-move): New option.

* typeck.c (decl_in_std_namespace_p): New.
(is_std_move_p): New.
(maybe_warn_pessimizing_move): New.
(can_do_nrvo_p): New, factored out of ...
(check_return_expr): ... here.  Warn about potentially harmful
std::move in a return statement.

* doc/invoke.texi: Document -Wpessimizing-move.

* g++.dg/cpp0x/Wpessimizing-move1.C: New test.
* g++.dg/cpp0x/Wpessimizing-move2.C: New test.
* g++.dg/cpp0x/Wpessimizing-move3.C: New test.
* g++.dg/cpp0x/Wpessimizing-move4.C: New test.
* g++.dg/cpp1z/Wpessimizing-move1.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263741 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago PR c++/65043
mpolacek [Tue, 21 Aug 2018 15:25:17 +0000 (15:25 +0000)] 
PR c++/65043
* call.c (standard_conversion): Set check_narrowing.
* typeck2.c (check_narrowing): Use CP_INTEGRAL_TYPE_P rather
than comparing with INTEGER_TYPE.

* g++.dg/concepts/pr67595.C: Add dg-warning.
* g++.dg/cpp0x/Wnarrowing11.C: New test.
* g++.dg/cpp0x/Wnarrowing12.C: New test.
* g++.dg/cpp0x/rv-cast5.C: Add static_cast.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263739 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago * cp-tree.h: Fix typo.
mpolacek [Tue, 21 Aug 2018 15:10:51 +0000 (15:10 +0000)] 
* cp-tree.h: Fix typo.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263738 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Minor reformattings
pmderodat [Tue, 21 Aug 2018 14:50:03 +0000 (14:50 +0000)] 
[Ada] Minor reformattings

2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* checks.adb, contracts.adb, exp_aggr.adb, exp_attr.adb,
exp_ch6.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb,
exp_util.adb, freeze.adb, gnatlink.adb, layout.adb,
lib-writ.adb, lib-xref-spark_specific.adb, sem_ch13.adb,
sem_ch3.adb, sem_ch6.adb, sem_res.adb, sem_util.adb, sinfo.ads,
sprint.adb: Minor reformatting.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263737 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Add a new gnat tool vxlink
pmderodat [Tue, 21 Aug 2018 14:49:49 +0000 (14:49 +0000)] 
[Ada] Add a new gnat tool vxlink

VxLink is a helper tool used as a wrapper around g++/gcc to build
VxWorks DKM (Downloadable Kernel Modules).

Such DKM is a partially linked object that includes entry points for
constructors and destructors.

This tool thus uses g++ to generate an intermediate partially linked
object, retrieves the list of constructors and destructors in it and
produces a C file that lists those ctors/dtors in a way that is
understood be VxWorks kernel. It then links this file with the
intermediate object to produce a valid DKM.

2018-08-21  Jerome Lambourg  <lambourg@adacore.com>

gcc/ada/

* vxlink-bind.adb, vxlink-bind.ads, vxlink-link.adb,
vxlink-link.ads, vxlink-main.adb, vxlink.adb, vxlink.ads: Add a
new tool vxlink to handle VxWorks constructors in DKMs.
* gcc-interface/Makefile.in: add rules to build vxlink

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263736 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Crash on expression function and tagged types
pmderodat [Tue, 21 Aug 2018 14:49:42 +0000 (14:49 +0000)] 
[Ada] Crash on expression function and tagged types

This patch fixes a compiler abort on an expression function whose
expression includes tagged types that have not been frozen before the
generated body of the function is analyzed, even though that body is
inserted at the end of the current declarative part.

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch6.adb (Analyze_Subprogram_Body_Helper, Mask_Type):
Refine the handling of freezing types for expression functions
that are not completions, when analyzing the generated body for
the function: the body is inserted at the end of the enclosing
declarative part, and its analysis may freeze types declared in
the same scope that have not been frozen yet.

gcc/testsuite/

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263735 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Spurious crash on expression function as completion with contracts
pmderodat [Tue, 21 Aug 2018 14:49:34 +0000 (14:49 +0000)] 
[Ada] Spurious crash on expression function as completion with contracts

This patch fixes a compiler abort on an expression function that is a
completion of a subprogram with preconditions. The problem is caused by
the presence of types in the precondition that are not frozen when the
subprogram body constructed for the expression function receives the
code that enforces the precondition. These types must be frozen before
the contract is expanded, so the freeze nodes for these types appear in
the proper scope. This is analogous to what is done with type references
that appear in the original expression of the expression function.

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch6.adb: Remove Freeze_Expr_Types.
* freeze.ads, freeze.adb (Freeze_Expr_Types): Moved from
sem_ch6.adb, and extended to handle other expressions that may
contain unfrozen types that must be frozen in their proper
scopes.
* contracts.adb (Analyze_Entry_Or_Subprogram_Contract): If the
contract is for the generated body of an expression function
that is a completion, traverse the expressions for pre- and
postconditions to freeze all types before adding the contract
code within the subprogram body.

gcc/testsuite/

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263734 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Retention of with clauses for ignored Ghost units
pmderodat [Tue, 21 Aug 2018 14:49:26 +0000 (14:49 +0000)] 
[Ada] Retention of with clauses for ignored Ghost units

This patch ensures that with clauses that mention ignored Ghost units are
retained in the tree. The retention is necessary for several reasons:

   * The with clauses allow the new elaboration order mechanism to
     produce the same library edges regardless of whether the Ghost unit
     is checked or ignored. This ensures that the elaboration order
     remains consistent.

   * The with clauses allow the unnesting mechanism to properly
     recognize that all units have been examined for unnesing purposes.

No observable impact, no test needed.

2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* sem_ch10.adb: Remove the with and use clause for unit Ghost.
(Analyze_With_Clause): Do not mark a with clause which mentions
an ignored Ghost code for elimination.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263733 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Crash processing SPARK annotate aspect
pmderodat [Tue, 21 Aug 2018 14:48:35 +0000 (14:48 +0000)] 
[Ada] Crash processing SPARK annotate aspect

The compiler blows up writing the ALI file of a package that has a ghost
subprogram with an annotate contract.

2018-08-21  Javier Miranda  <miranda@adacore.com>

gcc/ada/

* lib-writ.adb (Write_Unit_Information): Handle pragmas removed
by the expander.

gcc/testsuite/

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263732 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Spurious error on overriding protected function in instance
pmderodat [Tue, 21 Aug 2018 14:48:03 +0000 (14:48 +0000)] 
[Ada] Spurious error on overriding protected function in instance

The conformance between an overriding protected operation with
progenitors and the overridden interface operation requires subtype
conformance; requiring equality of return types in the case of a
function is too restrictive and leads to spurious errors when the return
type is a generic actual.

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch6.adb (Check_Synchronized_Overriding): The conformance
between an overriding protected operation and the overridden
abstract progenitor operation requires subtype conformance;
requiring equality of return types in the case of a function is
too restrictive and leads to spurious errors when the return
type is a generic actual.

gcc/testsuite/

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263731 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Properly set scope of artificial entities in blocks
pmderodat [Tue, 21 Aug 2018 14:47:56 +0000 (14:47 +0000)] 
[Ada] Properly set scope of artificial entities in blocks

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_ch9.adb (Expand_N_Timed_Entry_Call,
Expand_Conditional_Entry_Call): Use Reset_Scopes_Of to set
properly the scope of all entities created in blocks generated
by the expansion of these constructs.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263730 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Fix scope computation for loop statements
pmderodat [Tue, 21 Aug 2018 14:47:50 +0000 (14:47 +0000)] 
[Ada] Fix scope computation for loop statements

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch13.adb (Build_Predicate_Functioss): Apply
Reset_Quantified_Variables_Scope after predicate function has
been analyzed, so that the scope can be reset on the generated
loop statements that have replaced the quantified expressions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263729 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Einfo: remove obsolete code
pmderodat [Tue, 21 Aug 2018 14:47:44 +0000 (14:47 +0000)] 
[Ada] Einfo: remove obsolete code

2018-08-21  Bob Duff  <duff@adacore.com>

gcc/ada

* einfo.ads, einfo.adb (Private_View, Shadow_Entities): Remove
obsolete code.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263728 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Update for Ownership rules for access types according to AI12-0240
pmderodat [Tue, 21 Aug 2018 14:47:38 +0000 (14:47 +0000)] 
[Ada] Update for Ownership rules for access types according to AI12-0240

The implementation of these Ownership rules for safe pointers and
automatic memory management is still a prototype at an experimental
stage.

To activate the checks, the code should be compiled with the debug flag
-gnatdF and the flag -gnatd.F for setting the context for formal
verification of SPARK.

These changes do not affect compilation.

2018-08-21  Maroua Maalej  <maalej@adacore.com>

gcc/ada/

* sem_spark.adb (Check_Call_Statement): Check global and formal
parameter permissions at call sites.
(Check_Callable_Body): Assume permissions on globals and
parameters depending on their modes then analyse the body
operations.
(Check_Declaration): Consider both deep (including elementary
access) object declarations and normal variables. First check
whether the deep object is of Ownership Aspec True or not, then,
depending on its initialization, assign the appropriate state.
Check related to non access type variables deal with
initialization value permissions.
(Check_Expression): Check nodes used in the expression being
analyzed.
(Check_Globals): Call by Check_Call_Statement to perform the
check on globals.
(Check_List): Call Check_Node on each element of the list.
(Check_Loop_Statement): Check the Iteration_Scheme and loop
statements.
(Check_Node): Main traversal procedure to check safe pointer usage.
(Check_Package_Body): Check subprogram's body.
(Check_Param_In): Take a formal and an actual parameter and
Check the permission of every in-mode parameter.
(Check_Param_Out): Take a formal and an actual parameter and
check the state of out-mode and in out-mode parameters.
(Check_Statement): Check statements other than procedure call.
(Get_Perm, Get_Perm_Or_Tree, Get_Perm_Tree): Find out the state
related to the given name.
(Is_Deep): Return True if an object is of access type or has
subfields of access type.
(Perm_Error, Perm_Error_Subprogram_End): Add an error message
whenever the found state on the given name is different from the
one expected (in the statement being analyzed).
(Process_Path): Given an operation and a current state, call
Perm_Error if there is any mismatch.
(Return_Declarations, Return_Globals, Return_The_Global): Check
the state of a given name at the end of the subprogram. These
procedures may change depending on how we shall finally deal
with globals and the rhs state in a move operation.
(Set_Perm_Extensions, Set_Perm_Prefixes_Borrow,
Set_Perm_Prefixes, Setup_Globals, Setup_Parameter_Or_Global,
Setup_Parameters): Set up the new states to the given node and
up and down the tree after an operation.
(Has_Ownership_Aspect_True): This function may disappear later
when the Ownership Aspect will be implemented in the FE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263727 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Spurious ambiguity error on call returning an access type
pmderodat [Tue, 21 Aug 2018 14:47:32 +0000 (14:47 +0000)] 
[Ada] Spurious ambiguity error on call returning an access type

If F is a function with a single defaulted parameter that returns an
access_to_array type, then F (I) may designate either the return type or
an indexing of the result of the call, after implicit dereferencing.  If
the component type C of the array type AR is accces AR this is ambiguous
in a context whose expected type is C. If F is parameterless the call is
not ambiguous.

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_res.adb (Resolve_Call): Resolve correctly a parameterless
call that returns an access type whose designated type is the
component type of an array, when the function has no defaulted
parameters.

gcc/testsuite/

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263726 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Document entries of the target parametrization file
pmderodat [Tue, 21 Aug 2018 14:47:25 +0000 (14:47 +0000)] 
[Ada] Document entries of the target parametrization file

2018-08-21  Yannick Moy  <moy@adacore.com>

gcc/ada/

* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
Document entries of the target parametrization file.
* gnat_ugn.texi: Regenerate.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263725 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Set scope of elaboration flag for 'Access
pmderodat [Tue, 21 Aug 2018 14:47:18 +0000 (14:47 +0000)] 
[Ada] Set scope of elaboration flag for 'Access

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_attr.adb: Set scope of elaboration flag for 'Access.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263724 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Sprint: add guard on printing aspects
pmderodat [Tue, 21 Aug 2018 14:47:12 +0000 (14:47 +0000)] 
[Ada] Sprint: add guard on printing aspects

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sprint.adb: Add guard on printing aspects.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263723 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Crash compiling SPARK ghost functions with callgraph info
pmderodat [Tue, 21 Aug 2018 14:47:05 +0000 (14:47 +0000)] 
[Ada] Crash compiling SPARK ghost functions with callgraph info

The compiler blows up generating the callgraph output of SPARK ghost
subprograms whose contracts invoke ghost functions.

2018-08-21  Javier Miranda  <miranda@adacore.com>

gcc/ada/

* exp_cg.adb (Generate_CG_Output): Handle calls removed by the
expander.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263722 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Unnesting: do not set size of access subprograms
pmderodat [Tue, 21 Aug 2018 14:46:59 +0000 (14:46 +0000)] 
[Ada] Unnesting: do not set size of access subprograms

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* layout.adb: Do not set size of access subprogram if unnesting.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263721 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Unnesting: do not emit warnings for access to subprograms
pmderodat [Tue, 21 Aug 2018 14:46:54 +0000 (14:46 +0000)] 
[Ada] Unnesting: do not emit warnings for access to subprograms

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* freeze.adb: Remove warnings for access to subprograms when
unnesting is active.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263720 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Improper copying of limited arrays with default initialization
pmderodat [Tue, 21 Aug 2018 14:46:49 +0000 (14:46 +0000)] 
[Ada] Improper copying of limited arrays with default initialization

This patch fixes an improper expansion of aggregates for limited array
types in an object declaration. Prior to this patch, The presence of the
aggregate (which can only consist of box initializations) would create a
temporary that was then assigned to the object in the declaration.
Apart from a violation of the semantics of build-in-place limited
objects, this can also lead to out-of-scope access in LLVM.

Executing the following;

   gcc -c -gnatDG nocopy.adb
   grep quintet nocopy.adb.dg | wc -l

must yield:

   5

----
procedure NoCopy is

  --  Task used in this example to test that the limited component
  --  is properly initialized.

  task type T_Task (Disc : Natural);

  task body T_Task is
  begin
     null;
  end T_Task;

  type My_Rec (D : Natural := 9999) is record

     --  Components initialized by means of the current value
     --  of the record discriminant

     T : T_Task (D);
  end record;

  type TR is array (1 .. 5) of My_Rec;
  Quintet : TR := (others => (others => <>));
begin
   null;
end NoCopy;

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_aggr.adb (Expand_Array_Aggregate): If the component type
is limited, the array must be constructed in place, so set flag
In_Place_Assign_OK_For_Declaration accordingly. This prevents
improper copying of an array of tasks during initialization.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263719 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Fix spurious error on unchecked conversion on VFA record type
pmderodat [Tue, 21 Aug 2018 14:46:45 +0000 (14:46 +0000)] 
[Ada] Fix spurious error on unchecked conversion on VFA record type

2018-08-21  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* gcc-interface/trans.c (Call_to_gnu): Always suppress an
unchecked conversion around the actual for an In parameter
passed by copy.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263718 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Fix internal error on extension of record with representation clause
pmderodat [Tue, 21 Aug 2018 14:46:40 +0000 (14:46 +0000)] 
[Ada] Fix internal error on extension of record with representation clause

This fixes a long-standing issue present for extensions of tagged record
types with a representation clause: the clause is correctly inherited
for components inherited in the extension but the position and size are
not, which fools the logic of Is_Possibly_Unaligned_Object.

This can result in an attempt to take the address of a component not
aligned on a byte boundary, which is then flagged as an internal error.

2018-08-21  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* exp_util.adb (Is_Possibly_Unaligned_Object): For the case of a
selected component inherited in a record extension and subject
to a representation clause, retrieve the position and size from
the original record component.

gcc/testsuite/

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263717 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Spurious "Duplicated symbol" error with discriminated tasks
pmderodat [Tue, 21 Aug 2018 14:46:34 +0000 (14:46 +0000)] 
[Ada] Spurious "Duplicated symbol" error with discriminated tasks

This patch fixes a spurious error in a program that contains a
discriminated task type and several of its subtype in the same
declarative part, when the corresponding discriminant constraints are
expressions.

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_util.ads, sem_util.adb (New_External_Entity): Type of
Suffix_Index must be Int, not Nat, so that a negative value can
be used to generate a unique name for an external object, as
specified in Tbuild.New_External_Name.
(Scope_Within): Handle private type whose completion is a
synchronized type (For unnesting).
* itypes.ads, itypes.adb (Create_Itype): Ditto
* sem_ch3.adb (Constrain_Corresponding_Record): Generate a
unique name for the created subtype, because there may be
several discriminated tasks present in the same scope, and each
needs its distinct corresponding record subtype.

gcc/testsuite/

* gnat.dg/task1.adb, gnat.dg/task1.ads, gnat.dg/task1_pkg.adb,
gnat.dg/task1_pkg.ads: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263716 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Define versions of dimension system for Float and Long_Float
pmderodat [Tue, 21 Aug 2018 14:46:07 +0000 (14:46 +0000)] 
[Ada] Define versions of dimension system for Float and Long_Float

The dimension system in System.Dim.Mks is based on Long_Long_Float,
which may not be convenient to people who want to use Float or
Long_Float as basis. These new files provide units that define the
dimension system based on Float in System.Dim.Float_Mks and on
Long_Float in System.Dim.Long_Mks.

Child packages Other_Prefixes and Mks_IO are also defined appropriately,
with new instantiations for the various sizes of floating-point types.

2018-08-21  Yannick Moy  <moy@adacore.com>

gcc/ada/

* doc/gnat_ugn/gnat_and_program_execution.rst: Update
documentation of dimensionality analysis.
* gnat_ugn.texi: Regenerate.
* Makefile.rtl, impunit.adb: Consider the new units.
* libgnat/s-dfmkio.ads, libgnat/s-dfmopr.ads,
libgnat/s-diflmk.ads: New units based on Float.
* libgnat/s-dilomk.ads, libgnat/s-dlmkio.ads,
libgnat/s-dlmopr.ads: New units based on Long_Float.
* libgnat/s-dmotpr.ads: Rename to libgnat/s-dgmgop.ads and turn
into an instance of
System.Dim.Generic_Mks.Generic_Other_Prefixes.
* libgnat/s-dimmks.ads: Rename to libgnat/s-digemk.ads and turn
into an instance of System.Dim.Generic_Mks.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263715 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] General purpose doubly linked list for compiler and tool use
pmderodat [Tue, 21 Aug 2018 14:45:49 +0000 (14:45 +0000)] 
[Ada] General purpose doubly linked list for compiler and tool use

This patch adds unit GNAT.Lists which currently contains the
implementation of a general purpose doubly linked list intended for use
by the compiler and the tools around it.

2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* impunit.adb: Add g-lists to the set of non-implementation
units.
* libgnat/g-lists.adb, libgnat/g-lists.ads: New unit.
* Makefile.rtl: Add g-lists to the set of non-tasking units.
* gcc-interface/Make-lang.in: Add g-lists to the set of files
used by gnat1.

gcc/testsuite/

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263714 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Fix scope computation for entry bodies and accept alternatives
pmderodat [Tue, 21 Aug 2018 14:45:04 +0000 (14:45 +0000)] 
[Ada] Fix scope computation for entry bodies and accept alternatives

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_ch9.adb (Reset_Scopes): Do not recurse into type
declarations when resetting the scope of entities declared the
procedures generated for entry bodies and accept alternatives.
Use the entity of the procedure declaration, not its body, as
the new scope.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263713 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Crash on entry in generic with dynamic elaboration checks
pmderodat [Tue, 21 Aug 2018 14:44:56 +0000 (14:44 +0000)] 
[Ada] Crash on entry in generic with dynamic elaboration checks

This patch modifies the set of attributes that applies to entries and
entry families to include elaboration entities used by the
access-before-elaboration mechanism.

2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* einfo.adb (Elaboration_Entity): Include entries and entry
families in the set of legal entities.
(Elaboration_Entity_Required): Include entries and entry
families in the set of legal entities.
(Set_Elaboration_Entity): Include entries and entry families in
the set of legal entities.
(Set_Elaboration_Entity_Required): Include entries and entry
families in the set of legal entities.
(Write_Field13_Name): Update the output of attribute
Elaboration_Entity.
* einfo.ads: Attributes Elaboration_Entity and
Elaboration_Entity_Required now apply to entries and entry
families.

gcc/testsuite/

* gnat.dg/elab6.adb, gnat.dg/elab6.ads, gnat.dg/elab6_pkg.adb,
gnat.dg/elab6_pkg.ads: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263712 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Set_Targ: add a CodePeer annotation
pmderodat [Tue, 21 Aug 2018 14:44:51 +0000 (14:44 +0000)] 
[Ada] Set_Targ: add a CodePeer annotation

2018-08-21  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* set_targ.adb: Mark some CodePeer message as Intentional.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263711 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Compiler abort on call to expr. function for default discriminant
pmderodat [Tue, 21 Aug 2018 14:44:46 +0000 (14:44 +0000)] 
[Ada] Compiler abort on call to expr. function for default discriminant

If a discriminant specification has a default that is a call to an
expression function, that function has to be frozen at the point of a
call to the initialization procedure for an object of the record type,
even though the call does not appear to come from source.

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_res.adb (Resolve_Call): Force the freezing of an
expression function that is called to provide a default value
for a defaulted discriminant in an object initialization.

gcc/testsuite/

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263710 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Dynamically resizable, load factor-based hash table
pmderodat [Tue, 21 Aug 2018 14:44:41 +0000 (14:44 +0000)] 
[Ada] Dynamically resizable, load factor-based hash table

This patch introduces a dynamically resizable, load factor-based hash
table in unit GNAT.Dynamic_HTables.

2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* libgnat/g-dynhta.adb, libgnat/g-dynhta.ads: New package
Dynamic_HTable.

gcc/testsuite/

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263709 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Enumeration types with non-standard representation
pmderodat [Tue, 21 Aug 2018 14:44:35 +0000 (14:44 +0000)] 
[Ada] Enumeration types with non-standard representation

The compiler may report errors on enumeration types with non-standard
representation (i.e. at least one literal has a representation value
different from its 'Pos value) processing attribute 'Enum_Rep.

It may also generate wrong code for the evaluation of 'Enum_Rep raising
Constraint_Error at runtime.

2018-08-21  Javier Miranda  <miranda@adacore.com>

gcc/ada/

* checks.ads (Determine_Range): Adding documentation.
* checks.adb (Determine_Range): Don't deal with enumerated types
with non-standard representation.
(Convert_And_Check_Range): For conversion of enumeration types
with non standard representation to an integer type perform a
direct conversion to the target integer type.

gcc/testsuite/

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263708 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Handle pragmas that come from aspects for GNATprove
pmderodat [Tue, 21 Aug 2018 14:44:30 +0000 (14:44 +0000)] 
[Ada] Handle pragmas that come from aspects for GNATprove

In GNATprove we appear to abuse a routine related to cross-references and
expect it to deliver exact results, which is not what it was designed for.

This patch is a temporary solution to avoid crashes in GNATprove; it doesn't
affect the frontend or other backends, because this code is used exclusively
by GNATprove (it is located in the frontend for technical reasons). No tests
provided.

2018-08-21  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* lib-xref.ads, lib-xref-spark_specific.adb
(Enclosing_Subprogram_Or_Library_Package): Now roughtly works
for pragmas that come from aspect specifications.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263707 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Add sa_messages.ad[sb] for SPARK 2014
pmderodat [Tue, 21 Aug 2018 14:44:25 +0000 (14:44 +0000)] 
[Ada] Add sa_messages.ad[sb] for SPARK 2014

These new source files will make it possible to build SPARK 2014 from
a snapshot of GCC FSF sources.

2018-08-21  Pierre-Marie de Rodat  <derodat@adacore.com>

gcc/ada/

* sa_messages.ads, sa_messages.adb: New source files.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263706 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago* testsuite/18_support/new_nothrow.cc: XFAIL on AIX.
dje [Tue, 21 Aug 2018 14:03:16 +0000 (14:03 +0000)] 
* testsuite/18_support/new_nothrow.cc: XFAIL on AIX.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263703 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoUpdate global reviewers list
rsandifo [Tue, 21 Aug 2018 13:49:30 +0000 (13:49 +0000)] 
Update global reviewers list

2018-08-21  Richard Sandiford  <richard.sandiford@arm.com>

* MAINTAINERS: Add self to global reviewers list.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263702 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago * tree.c (find_decls_types_r): Do not check for redundant typedefs.
hubicka [Tue, 21 Aug 2018 12:32:53 +0000 (12:32 +0000)] 
* tree.c (find_decls_types_r): Do not check for redundant typedefs.
* tree.h (is_redundant_typedef): Remove.
* dwarf2out.c (is_redundant_typedef): Turn into static function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263699 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[Ada] Bump copyright notices to 2018
pmderodat [Tue, 21 Aug 2018 11:59:28 +0000 (11:59 +0000)] 
[Ada] Bump copyright notices to 2018

2018-08-21  Pierre-Marie de Rodat  <derodat@adacore.com>

gcc/ada/

* libgnarl/a-intnam__dragonfly.ads,
libgnarl/s-osinte__dragonfly.adb,
libgnarl/s-osinte__dragonfly.ads, libgnarl/s-osinte__gnu.adb,
libgnarl/s-osinte__gnu.ads, libgnarl/s-osinte__hpux-dce.adb,
libgnarl/s-osinte__hpux-dce.ads,
libgnarl/s-taprop__hpux-dce.adb,
libgnarl/s-taspri__hpux-dce.ads: Bump copyright notices to 2018.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263698 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago * tree.c (free_lang_data_in_decl): Remove types from DECL_CONTEXT
hubicka [Tue, 21 Aug 2018 10:36:37 +0000 (10:36 +0000)] 
* tree.c (free_lang_data_in_decl): Remove types from DECL_CONTEXT
when possible.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263697 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoFix DSE big-endian subreg crash on AArch64.
tnfchris [Tue, 21 Aug 2018 09:55:07 +0000 (09:55 +0000)] 
Fix DSE big-endian subreg crash on AArch64.

This patch fixes an ICE that would happen when extract_low_bits
is called with modes for which you can't extract a valid subreg.
e.g. taking a 32 bytes subreg from a 48 byte mode.

The ICE happens because convert_modes which eventually calls
simplify_gen_subreg does not expect the convertion to fail.

The assert in gen_lowpart_general would then be hit.  The patch
changes it to validate the subreg before trying to convert the
modes.  If the subreg is not possible we return NULL_RTX and bail
out early.

gcc/ChangeLog:

2018-08-21  Tamar Christina  <tamar.christina@arm.com>

* expmed.c (extract_low_bits): Reject invalid subregs early.

gcc/testsuite/ChangeLog:

2018-08-21  Tamar Christina  <tamar.christina@arm.com>

* gcc.target/aarch64/large_struct_copy.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263696 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoRemove redundant { dg-do run } directives in tests
redi [Tue, 21 Aug 2018 09:34:26 +0000 (09:34 +0000)] 
Remove redundant { dg-do run } directives in tests

These tests accidentally had two dg-do directives. Only the second one
is needed.

* testsuite/26_numerics/bit/bitops.count/countl_one.cc: Remove
redundant dg-do directive.
* testsuite/26_numerics/bit/bitops.count/countl_zero.cc: Likewise.
* testsuite/26_numerics/bit/bitops.count/countr_one.cc: Likewise.
* testsuite/26_numerics/bit/bitops.count/countr_zero.cc: Likewise.
* testsuite/26_numerics/bit/bitops.count/popcount.cc: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263695 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoRestrict the pr86763 test to *-*-linux* targets
nsz [Tue, 21 Aug 2018 09:22:14 +0000 (09:22 +0000)] 
Restrict the pr86763 test to *-*-linux* targets

clock_gettime is not available on some baremetal targets
and may require -lrt on some non-linux targets.

gcc/testsuite/ChangeLog:

* g++.dg/torture/pr86763.C: Restrict to *-*-linux*.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263694 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago2018-08-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
edlinger [Tue, 21 Aug 2018 08:56:11 +0000 (08:56 +0000)] 
2018-08-21  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR middle-end/86121
        * tree-ssa-strlen.c (adjust_last_stmt): Avoid folding away undefined
        behaviour.

testsuite:
2018-08-21  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR middle-end/86121
        * gcc.dg/Wstringop-overflow-6.c: Remove xfail.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263693 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agovxworks: don't define vxworks_asm_out_constructor when using .init_array
villemoes [Tue, 21 Aug 2018 08:52:40 +0000 (08:52 +0000)] 
vxworks: don't define vxworks_asm_out_constructor when using .init_array

When the compiler is configured with --enable-initfini-array,
config/initfini-array.h gets included after config/vxworks.h by tm.h, so
the definitions of TARGET_ASM_CONSTRUTOR/TARGET_ASM_DESTRUCTOR in
vxworks.h get undone in initfini-array.h. Hence, we might as well not
define the vxworks_asm_out_* functions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263692 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agovxworks: enable use of .init_array/.fini_array for cdtors
villemoes [Tue, 21 Aug 2018 08:50:27 +0000 (08:50 +0000)] 
vxworks: enable use of .init_array/.fini_array for cdtors

The target OS actually runs all function pointers found in the _ctors
array when the module is loaded. So it is not that hard to make use of
the "modern" .init_array/.fini_array mechanism - it mostly just requires
a linker script adding the _ctors and _dtors symbols and terminating
LONG(0) entries.

Assume that if the user passed --enable-initfini-array when building
gcc, the rest of the toolchain (including the link spec and linker
script) is set up appropriately.

Note that configuring with --enable-initfini-array may prevent the -mrtp
mode from working, due to the (unconditional) use of .init_array.*
sections instead of .ctors.* - however, that is the case regardless of this
patch.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263691 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agolibgcc: add crt{begin,end} for powerpc-wrs-vxworks target
villemoes [Tue, 21 Aug 2018 08:49:15 +0000 (08:49 +0000)] 
libgcc: add crt{begin,end} for powerpc-wrs-vxworks target

In order to allow ZCX on VxWorks, we need the frame_dummy function to do
the register_frame_info(). So make sure crtbegin.o and crtend.o are
available for use with a custom spec file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263690 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agovxworks: add target/h/wrn/coreip to the set of system include paths
villemoes [Tue, 21 Aug 2018 08:47:41 +0000 (08:47 +0000)] 
vxworks: add target/h/wrn/coreip to the set of system include paths

In order to build crtstuff.c, I need to ensure the headers in
target/h/wrn/coreip are also searched. Of course, that can be done
similar to how wrn/coreip gets manually added for libgcc, e.g. by adding

  CRTSTUFF_T_CFLAGS += -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip

But without target/h/wrn/coreip in the default search path, all
user-code that include <unistd.h> (crtstuff.c just being one such
example) will have to manually add an -isystem
flag adding the wrn/coreip directory: unistd.h include ioLib.h, which
has

#include "net/uio.h"

and that header is found in target/h/wrn/coreip. In other words, the
VxWorks system headers (at least for VxWorks 5.5) are written in a way
that assumes wrn/coreip is in the search path, so I think it makes sense
to have that by default.

It will change the search order for existing setups that pass
-I.../target/h/wrn/coreip (without -nostdinc), since that flag will now
be ignored. I can't know whether that will break anything, but I do
believe it makes sense to have the defaults actually usable without
expecting all invocations to add -I/-isystem flags.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263689 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago2018-08-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
edlinger [Tue, 21 Aug 2018 08:16:19 +0000 (08:16 +0000)] 
2018-08-21  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * gimple-ssa-sprintf.c (decl_constant_value): Remove.
        (get_format_string): Refer to c_getstr.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263688 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[debug] Add debug and earlydebug dumps
vries [Tue, 21 Aug 2018 07:39:29 +0000 (07:39 +0000)] 
[debug] Add debug and earlydebug dumps

With the introduction of early debug, we've added a phase in the compiler which
produces information which is not visible, unless we run the compiler in the
debugger and call debug_dwarf from dwarf2out_early_finish or some such.

This patch adds dumping of "early" and "final" debug info, into .earlydebug
and .debug dump files, enabled by -fdump-earlydebug and -fdumpdebug, such that
we can follow f.i. the upper bound of a vla type from early debug:
...
          DW_AT_upper_bound: location descriptor:
            (0x7f0d645b7550) DW_OP_GNU_variable_value , 0
...
to final debug:
...
          DW_AT_upper_bound: location descriptor:
            (0x7f0d645b7550) DW_OP_fbreg 18446744073709551592, 0
            (0x7f0d645b7a00) DW_OP_deref 8, 0
...
to -dA annotated assembly file:
...
        .uleb128 0x3    # DW_AT_upper_bound
        .byte   0x91    # DW_OP_fbreg
        .sleb128 -24
        .byte   0x6     # DW_OP_deref
...

The .debug file shows the same information as the annotated assembly, but in
the same format as the "early" debug info.

Bootstrapped and reg-tested on x86_64.

2018-08-21  Tom de Vries  <tdevries@suse.de>

* cgraph.h (debuginfo_early_init, debuginfo_init, debuginfo_fini)
(debuginfo_start, debuginfo_stop, debuginfo_early_start)
(debuginfo_early_stop): Declare.
* cgraphunit.c (debuginfo_early_init, debuginfo_init, debuginfo_fini)
(debuginfo_start, debuginfo_stop, debuginfo_early_start)
(debuginfo_early_stop): New function.
(symbol_table::finalize_compilation_unit): Call debuginfo_early_start
and debuginfo_early_stop.
* dwarf2out.c (dwarf2out_finish, dwarf2out_early_finish): Dump dwarf.
* toplev.c (compile_file): Call debuginfo_start and debuginfo_stop.
(general_init): Call debuginfo_early_init.
(finalize): Call debuginfo_fini.
(do_compile): Call debuginfo_init.
* doc/invoke.texi (@gccoptlist): Add -fdump-debug and
-fdump-early-debug.
(@item -fdump-debug, @item -fdump-earlydebug): Add.

* lto.c (lto_main):  Call debuginfo_early_start and
debuginfo_early_stop.

* gcc.c-torture/unsorted/dump-noaddr.x: Use -gno-record-gcc-switches
to avoid mismatch in .debug and .earlydebug dump files.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263687 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[debug] Respect fdump-noaddr and fdump-unnumbered in print_die
vries [Tue, 21 Aug 2018 07:39:17 +0000 (07:39 +0000)] 
[debug] Respect fdump-noaddr and fdump-unnumbered in print_die

2018-08-21  Tom de Vries  <tdevries@suse.de>

* dwarf2out.c (print_dw_val, print_loc_descr, print_die): Handle
flag_dump_noaddr and flag_dump_unnumbered.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263686 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago * wide-int-range.cc (wide_int_range_abs): New.
aldyh [Tue, 21 Aug 2018 06:27:14 +0000 (06:27 +0000)] 
* wide-int-range.cc (wide_int_range_abs): New.
(wide_int_range_order_set): Rename from wide_int_range_min_max.
* wide-int-range.h (wide_int_range_abs): New.
(wide_int_range_min_max): New.
* tree-vrp.c (extract_range_from_unary_expr): Rewrite ABS_EXPR
case to call wide_int_range_abs.
Rewrite MIN/MAX_EXPR to call wide_int_range_min_max.
(extract_range_from_abs_expr): Delete.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263685 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoDaily bump.
gccadmin [Tue, 21 Aug 2018 00:16:17 +0000 (00:16 +0000)] 
Daily bump.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263683 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[libiberty patch] PEX-unix forking
nathan [Tue, 21 Aug 2018 00:01:50 +0000 (00:01 +0000)] 
[libiberty patch] PEX-unix forking

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01170.html
* pex-unix.c (pex_child_error): Delete.
(pex_unix_exec_child): Commonize error paths to single message &
exit.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263679 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[gcc]
meissner [Mon, 20 Aug 2018 23:46:37 +0000 (23:46 +0000)] 
[gcc]
2018-08-20  Michael Meissner  <meissner@linux.ibm.com>

PR target/87033
* config/rs6000/rs6000.md (extendsi<mode>2): Change constraints
from 'Y' to 'YZ' to enable the LWAX instruction to be generated
for indexed loads.

[gcc/testsuite]
2018-08-20  Michael Meissner  <meissner@linux.ibm.com>

PR target/87033
* gcc.target/powerpc/pr87033.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263678 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[PATCH] fix some build breakage
nathan [Mon, 20 Aug 2018 23:31:18 +0000 (23:31 +0000)] 
[PATCH] fix some build breakage

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01214.html
* config/s390/s390-c (s390_macro_to_expand): Use cpp_macro_p.
* config/spu/spu-c.c (spu_macro_to_expand): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263677 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoPR tree-optimization/87034 - missing -Wformat-overflow on a sprintf %s with a wide...
msebor [Mon, 20 Aug 2018 23:03:55 +0000 (23:03 +0000)] 
PR tree-optimization/87034 - missing -Wformat-overflow on a sprintf %s with a wide string

gcc/testsuite/ChangeLog:
* gcc.dg/builtin-sprintf-warn-20.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263676 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoAdd support for grouping of related diagnostics (PR other/84889)
dmalcolm [Mon, 20 Aug 2018 21:06:46 +0000 (21:06 +0000)] 
Add support for grouping of related diagnostics (PR other/84889)

We often emit logically-related groups of diagnostics.

A relatively simple case is this:

  if (warning_at (body_loc, OPT_Wmultistatement_macros,
                  "macro expands to multiple statements"))
    inform (guard_loc, "some parts of macro expansion are not guarded by "
            "this %qs clause", guard_tinfo_to_string (keyword));

where the "note" diagnostic issued by the "inform" call
is guarded by the -Wmultistatement_macros warning.

More complicated examples can be seen in the C++ frontend,
where e.g. print_z_candidates can lead to numerous "note"
diagnostics being emitted.

I'm looking at various ways to improve how we handle such related
diagnostics, but, prior to this patch, there was no explicit
relationship between these diagnostics: the diagnostics subsystem
had no way of "knowing" that these were related.

This patch introduces a simple way to group the diagnostics:
an auto_diagnostic_group class: all diagnostics emitted within
the lifetime of an auto_diagnostic_group instance are logically
grouped.

Hence in the above example, the two diagnostics can be grouped
by simply adding an auto_diagnostic_group instance:

  auto_diagnostic_group d;
  if (warning_at (body_loc, OPT_Wmultistatement_macros,
                  "macro expands to multiple statements"))
    inform (guard_loc, "some parts of macro expansion are not guarded by "
            "this %qs clause", guard_tinfo_to_string (keyword));

Some more awkard cases are of the form:

  if (some_condition
      && warning_at (...)
      && more_conditions)
    inform (...);

which thus need restructuring to:

  if (some_condition)
    {
      auto_diagnostic_group d;
      warning_at (...);
      if (more_conditions)
        inform (...);
    }

so that the lifetime of the auto_diagnostic_group groups the
warning_at and the inform call.

Nesting is handled by simply tracking a nesting depth within the
diagnostic_context.: all diagnostics are treated as grouped until the
final auto_diagnostic_group is popped.

diagnostic.c uses this internally, so that all diagnostics are part of
a group - those that are "by themselves" are treated as being part of
a group with one element.

The diagnostic_context gains optional callbacks for displaying the
start of a group (when the first diagnostic is emitted within it), and
the end of a group (for when the group was non-empty); these callbacks
are unused by default, but a test plugin demonstrates them (and verifies
that the machinery is working).

As noted above, I'm looking at various ways to use the grouping to
improve how we output the diagnostics.

FWIW, I experimented with a more involved implementation, of the form:

  diagnostic_group d;
  if (d.warning_at (body_loc, OPT_Wmultistatement_macros,
                    "macro expands to multiple statements"))
    d.inform (guard_loc, "some parts of macro expansion are not guarded by "
              "this %qs clause", guard_tinfo_to_string (keyword));

which had the advantage of allowing auto-detection of the places where
groups were needed (by converting ::warning_at's return type to bool),
but it was a much more invasive patch, especially when dealing with
the places in the C++ frontend that can emit numerous notes after
an error or warning (and thus having to pass the group around)
Hence I went with this simpler approach.

gcc/c-family/ChangeLog:
PR other/84889
* c-attribs.c (common_handle_aligned_attribute): Add
auto_diagnostic_group instance.
* c-indentation.c (warn_for_misleading_indentation): Likewise.
* c-opts.c (c_common_post_options): Likewise.
* c-warn.c (warn_logical_not_parentheses): Likewise.
(warn_duplicated_cond_add_or_warn): Likewise.
(warn_for_multistatement_macros): Likewise.

gcc/c/ChangeLog:
PR other/84889
* c-decl.c (pushtag): Add auto_diagnostic_group instance.
(diagnose_mismatched_decls): Likewise, in various places.
(warn_if_shadowing): Likewise.
(implicit_decl_warning): Likewise.
(implicitly_declare): Likewise.
(undeclared_variable): Likewise.
(declare_label): Likewise.
(grokdeclarator): Likewise.
(start_function): Likewise.
* c-parser.c (c_parser_declaration_or_fndef): Likewise.
(c_parser_parameter_declaration): Likewise.
(c_parser_binary_expression): Likewise.
* c-typeck.c (c_expr_sizeof_expr): Likewise.
(parser_build_binary_op): Likewise.
(build_unary_op): Likewise.
(error_init): Likewise.
(pedwarn_init): Likewise.
(warning_init): Likewise.
(convert_for_assignment): Likewise.

gcc/cp/ChangeLog:
PR other/84889
* call.c (build_user_type_conversion_1): Add auto_diagnostic_group
instance(s).
(print_error_for_call_failure): Likewise.
(build_op_call_1): Likewise.
(build_conditional_expr_1): Likewise.
(build_new_op_1): Likewise.
(build_op_delete_call): Likewise.
(convert_like_real): Likewise.
(build_over_call): Likewise.
(build_new_method_call_1): Likewise.
(joust): Likewise.
* class.c (check_tag): Likewise.
(finish_struct_anon_r): Likewise.
(one_inherited_ctor): Likewise.
(finalize_literal_type_property): Likewise.
(explain_non_literal_class): Likewise.
(find_flexarrays): Likewise.
(resolve_address_of_overloaded_function): Likewise.
* constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
(is_valid_constexpr_fn): Likewise.
(cx_check_missing_mem_inits): Likewise.
* cp-gimplify.c (cp_genericize_r): Likewise.
* cvt.c (maybe_warn_nodiscard): Likewise.
* decl.c (warn_extern_redeclared_static): Likewise.
(check_redeclaration_exception_specification): Likewise.
(check_no_redeclaration_friend_default_args): Likewise.
(duplicate_decls): Likewise.
(redeclaration_error_message): Likewise.
(warn_misplaced_attr_for_class_type): Likewise.
* decl2.c (finish_static_data_member_decl): Likewise.
(no_linkage_error): Likewise.
(cp_warn_deprecated_use): Likewise.
* error.c (qualified_name_lookup_error): Likewise.
* friend.c (make_friend_class): Likewise.
(do_friend): Likewise.
* init.c (perform_member_init): Likewise.
(build_new_1): Likewise.
(build_vec_delete_1): Likewise.
(build_delete): Likewise.
* lex.c (unqualified_name_lookup_error): Likewise.
* name-lookup.c (check_extern_c_conflict): Likewise.
(inform_shadowed): New function.
(check_local_shadow): Add auto_diagnostic_group instances,
replacing goto "inform_shadowed" label with call to subroutine.
(set_local_extern_decl_linkage): Add auto_diagnostic_group
instance(s).
* parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
(cp_parser_namespace_name): Likewise.
* pt.c (check_specialization_namespace): Likewise.
(check_template_variable): Likewise.
(warn_spec_missing_attributes): Likewise.
(check_explicit_specialization): Likewise.
(process_partial_specialization): Likewise.
(lookup_template_class_1): Likewise.
(finish_template_variable): Likewise.
(do_auto_deduction): Likewise.
* search.c (check_final_overrider): Likewise.
(look_for_overrides_r): Likewise.
* tree.c (maybe_warn_parm_abi): Likewise.
* typeck.c (cxx_sizeof_expr): Likewise.
(cp_build_function_call_vec): Likewise.
(cp_build_binary_op): Likewise.
(convert_for_assignment): Likewise.
(maybe_warn_about_returning_address_of_local): Likewise.
* typeck2.c (abstract_virtuals_error_sfinae): Likewise.
(check_narrowing): Likewise.

gcc/ChangeLog:
PR other/84889
* attribs.c (diag_attr_exclusions): Add auto_diagnostic_group instance.
(decl_attributes): Likewise.
* calls.c (maybe_warn_nonstring_arg): Add auto_diagnostic_group
instance.
* cgraphunit.c (maybe_diag_incompatible_alias): Likewise.
* diagnostic-core.h (class auto_diagnostic_group): New class.
* diagnostic.c (diagnostic_initialize): Initialize the new fields.
(diagnostic_report_diagnostic): Handle the first diagnostics within
a group.
(emit_diagnostic): Add auto_diagnostic_group instance.
(inform): Likewise.
(inform_n): Likewise.
(warning): Likewise.
(warning_at): Likewise.
(warning_n): Likewise.
(pedwarn): Likewise.
(permerror): Likewise.
(error): Likewise.
(error_n): Likewise.
(error_at): Likewise.
(sorry): Likewise.
(fatal_error): Likewise.
(internal_error): Likewise.
(internal_error_no_backtrace): Likewise.
(auto_diagnostic_group::auto_diagnostic_group): New ctor.
(auto_diagnostic_group::~auto_diagnostic_group): New dtor.
* diagnostic.h (struct diagnostic_context): Add fields
"diagnostic_group_nesting_depth",
"diagnostic_group_emission_count", "begin_group_cb",
"end_group_cb".
* gimple-ssa-isolate-paths.c (find_implicit_erroneous_behavior):
Add auto_diagnostic_group instance(s).
(find_explicit_erroneous_behavior): Likewise.
* gimple-ssa-warn-alloca.c (pass_walloca::execute): Likewise.
* gimple-ssa-warn-restrict.c (maybe_diag_offset_bounds): Likewise.
* gimplify.c (warn_implicit_fallthrough_r): Likewise.
(gimplify_va_arg_expr): Likewise.
* hsa-gen.c (HSA_SORRY_ATV): Likewise.
(HSA_SORRY_AT): Likewise.
* ipa-devirt.c (compare_virtual_tables): Likewise.
(warn_odr): Likewise.
* multiple_target.c (expand_target_clones): Likewise.
* opts-common.c (cmdline_handle_error): Likewise.
* reginfo.c (globalize_reg): Likewise.
* substring-locations.c (format_warning_n_va): Likewise.
* tree-inline.c (expand_call_inline): Likewise.
* tree-ssa-ccp.c (pass_post_ipa_warn::execute): Likewise.
* tree-ssa-loop-niter.c
(do_warn_aggressive_loop_optimizations): Likewise.
* tree-ssa-uninit.c (warn_uninit): Likewise.
* tree.c (warn_deprecated_use): Likewise.

gcc/testsuite/ChangeLog:
PR other/84889
* gcc.dg/plugin/diagnostic-group-test-1.c: New test.
* gcc.dg/plugin/diagnostic_group_plugin.c: New test.
* gcc.dg/plugin/plugin.exp (plugin_test_list): Add the new tests.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263675 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agox86: Always update EH return address in word_mode
hjl [Mon, 20 Aug 2018 19:14:04 +0000 (19:14 +0000)] 
x86: Always update EH return address in word_mode

On x86, return address is always popped in word_mode.  eh_return needs
to put EH return address in word_mode on stack.

gcc/

PR target/87014
* config/i386/i386.md (eh_return): Always update EH return
address in word_mode.

gcc/testsuite/

PR target/87014
* g++.dg/torture/pr87014.C: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263672 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago * targhooks.c (std_gimplify_va_arg_expr): Properly handle case of when
law [Mon, 20 Aug 2018 18:32:06 +0000 (18:32 +0000)] 
* targhooks.c (std_gimplify_va_arg_expr): Properly handle case of when
TARGET_SPLIT_COMPLEX_ARG is defined.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263671 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[CPP PATCH] node field bits
nathan [Mon, 20 Aug 2018 17:45:42 +0000 (17:45 +0000)] 
[CPP PATCH] node field bits

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01171.html
* include/cpplib.h: Fixup some whitespace.
(cpp_hashnode): Reduce type to 2 bit & flags to 8.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263669 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[CPP PATCH] node type
nathan [Mon, 20 Aug 2018 16:32:29 +0000 (16:32 +0000)] 
[CPP PATCH] node type

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01164.html
* include/cpplib.h (NODE_BUILTIN, NODE_MACRO_ARG): Delete.
Renumber others.
(enum node_type): Replace NT_MACRO with NT_USER_MACRO,
NT_BUILTIN_MACRO, NT_MACRO_ARG.  Delete NT_ASSERTION.
(NTV_MACRO, NTV_ANSWER, NTV_BUILTIN, NTV_ARGUMENT, NTV_NONE):
Delete.
(CPP_HASHNODE_VALUE_IDX): Delete.
(union _cpp_hashnode_value): GTY tag from enum node_type directly.
(struct cpp_hashnode): Adjust GTY desc for value field.
(cpp_user_macro_p, cpp_builtin_macro_p, cpp_macro_p): Adjust.
* directives.c (undefine_macros): Clear value.anwers, adjust flag
clearing.
(_cpp_test_assertion): No need to check NT_ASSERTION.
(do_assert, do_unassert): Likewise.
* init.c (cpp_init_special_builtins): Set type not flags.
* macro.c (struct macro_arg_saved_data): Add type field.
(cpp_get_token_1): Check type not NT_VOID.
(_cpp_free_definition): Adjust flag clearing.  Nullify
value.answers.
(_cpp_save_parameter, _cpp_unsave_parameters): Save and restore
type.
(lex_expansion_token): Check type not flags.
(_cpp_create_definition): Set type to NT_USER_MACRO.
(_cpp_notify_macro_use): Adjust type checking.
* pch.c (write_macdef, count_defs, write_defs, cpp_valid_state)
(save_macros): Adjust node type/flag handling.
* traditional.c (_cpp_scan_out_logical_line): Check type not flags.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263667 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[CPP PATCH] Fix warning & other cleanups.
nathan [Mon, 20 Aug 2018 15:28:15 +0000 (15:28 +0000)] 
[CPP PATCH] Fix warning & other cleanups.

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01162.html
* directives.c (do_undef): Use cpp_macro_p & cpp_builtin_macro_p.
* include/cpplib.h (enum cpp_macro_kind): Remove trailing comma.
(cpp_fun_like_macro_p): Make inline, define.
* macro.c (cpp_define_lazily): Use UCHAR_MAX.
(cpp_fun_like_macro_p): Delete.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263666 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago2018-08-20 Bernd Edlinger <bernd.edlinger@hotmail.de>
edlinger [Mon, 20 Aug 2018 15:01:04 +0000 (15:01 +0000)] 
2018-08-20  Bernd Edlinger  <bernd.edlinger@hotmail.de>

* expr.c (store_field): Change gcc_assert to gcc_checking_assert.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263665 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago PR target/86984
law [Mon, 20 Aug 2018 14:20:59 +0000 (14:20 +0000)] 
PR target/86984
* expr.c (expand_assignment): Assert that bitpos is positive.
(store_field): Likewise
(expand_expr_real_1): Make sure that bitpos is positive.
* config/alpha/alpha.h (CONSTANT_ADDRESS_P): Avoid signed
integer overflow.

PR target/86984
* gcc.target/alpha/pr86984.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263664 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[PATCH] Kill cpp-id-data.h
nathan [Mon, 20 Aug 2018 14:20:04 +0000 (14:20 +0000)] 
[PATCH] Kill cpp-id-data.h

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01149.html
libcpp/
* Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h.
* include/cpp-id-data.h: Delete.
* internal.h: Include cpplib.h not cpp-id-data.h.
gcc/
* Makefile.in (CPP_ID_DATA_H): Delete.
(CPP_INTERNAL_H): Don't add it.
(GTFILES): Replace CPP_ID_DATA_H with CPPLIB_H.
* gengtype.c (open_base_files): Replace cpp-id-data.h with cpplib.h

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263663 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago2018-08-20 Richard Biener <rguenther@suse.de>
rguenth [Mon, 20 Aug 2018 14:01:05 +0000 (14:01 +0000)] 
2018-08-20  Richard Biener  <rguenther@suse.de>

PR tree-optimization/78655
* tree-vrp.c (extract_range_from_binary_expr_1): Make
pointer + offset nonnull if either operand is nonnull work.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263662 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoPR libstdc++/86963 Remove use of __tuple_base in std::tuple
redi [Mon, 20 Aug 2018 13:53:56 +0000 (13:53 +0000)] 
PR libstdc++/86963 Remove use of __tuple_base in std::tuple

The _Tuple_impl base class can be used to disable copy/move assignment,
without requiring an extra base class.

Exception specifications on std::tuple assignment and swap functions can
be defined directly using is_nothrow_swappable, instead of querying the
base classes.

PR libstdc++/86963
* include/std/tuple (_Tuple_impl::operator=): Define as deleted.
(_Tuple_impl::_M_assign): New functions to perform assignment instead
of assignment operators.
(_Tuple_impl::_M_swap): Remove exception specification.
(_Tuple_impl<_Idx, _Head>): Likewise.
(_TC::_NonNestedTuple, _TC::_NotSameTuple): Use __remove_cvref_t.
(__tuple_base): Remove.
(tuple, tuple<_T1, _T2>): Remove inheritance from __tuple_base.
(tuple::operator=, tuple<_T1, _T2>::operator=): Call _M_assign.
(tuple::swap, tuple<_T1, _T2>::swap): Define exception specification
using __is_nothrow_swappable.
(tuple<_T1, _T2>::tuple(_U1&&, _U2&&)): Use __remove_cvref_t.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263661 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[debug] Fix handling of vlas in lto
vries [Mon, 20 Aug 2018 13:52:29 +0000 (13:52 +0000)] 
[debug] Fix handling of vlas in lto

Atm, when running vla-1.c with -O0 -flto, we have:
...
FAIL: gcc.dg/guality/vla-1.c -O0 -flto -fuse-linker-plugin \
  -fno-fat-lto-objects line 17 sizeof (a) == 6
...

The vla a[i + 1] in f1 is gimplified into:
...
f1 (int i)
{
  char a[0:D.1922] [value-expr: *a.0];
  char[0:D.1922] * a.0;

  D.1921 = i + 1;
  D.1926 = (sizetype) D.1921;
  a.0 = __builtin_alloca_with_align (D.1926, 8);
...

The early debug info for the upper bound of the type of vla a that we stream
out is:
...
  DIE    0: DW_TAG_subrange_type (0x7f85029a90f0)
    DW_AT_upper_bound: location descriptor:
      (0x7f85029a9230) DW_OP_GNU_variable_value die -> 0 (0x7f85029a94b0), 0
  DIE    0: DW_TAG_variable (0x7f85029a94b0)
    DW_AT_name: "D.1922"
    DW_AT_type: die -> 0 (0x7f85029a3d70)
    DW_AT_artificial: 1
...

and in ltrans we have for that same upper bound:
...
  DIE    0: DW_TAG_subrange_type (0x7f5183b57d70)
    DW_AT_upper_bound: die -> 0 (0x7f5183b576e0)
  DIE    0: DW_TAG_variable (0x7f5183b576e0)
    DW_AT_name: "D.4278"
    DW_AT_abstract_origin: die -> label: vla_1.c.6719312a + 193 (0x7f5183b57730)
...
where D.4278 has abstract origin D.1922.

The D.4278 die has no DW_AT_location, so when evaluting "sizeof (a)" in the
debugger, we can't find the information to get the value of D.4278, and the
debugger prints "<optimized out>".

This patch fixes that by either:
- adding DW_AT_location to the referenced variable die, or
- instead of using a ref for the upper bound, using an exprloc.

When changing gcc.dg/guality/guality.exp to run the usual flto flavours
"-fno-use-linker-plugin -flto-partition=none" and "-fuse-linker-plugin
-fno-fat-lto-objects" in combination with O0, Og, O1, O2, O3 and Os, this patch
fixes all (20) failures in vla-1.c, leaving only:
...
No symbol "i" in current context.
UNSUPPORTED: gcc.dg/guality/vla-1.c  -O3 -flto -fno-use-linker-plugin \
  -flto-partition=none line 17 i == 5
'a' has unknown type; cast it to its declared type
UNSUPPORTED: gcc.dg/guality/vla-1.c  -O3 -flto -fno-use-linker-plugin \
  -flto-partition=none line 17 sizeof (a) == 6
...

Bootstrapped and reg-tested on x86_64.

2018-08-20  Tom de Vries  <tdevries@suse.de>

* dwarf2out.c (add_scalar_info): Don't add reference to existing die
unless the referenced die describes the added property using
DW_AT_location or DW_AT_const_value.  Fall back to exprloc case.
Otherwise, add a DW_AT_location to the referenced die.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263660 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[PATCH] #assert becomes macro-like
nathan [Mon, 20 Aug 2018 12:39:36 +0000 (12:39 +0000)] 
[PATCH] #assert becomes macro-like

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01140.html
libcpp/
* include/cpp-id-data.h (struct answer): Delete.
* include/cpplib.h (struct answer): Don't forward-declare.
(enum cpp_macro_kind): Add cmk_assert.
(struct cpp_macro): Union parms and next assert chain.
(union _cpp_hashnode_value): 'answer' field is cpp_macro.
* directives.c (parse_answer): Convert to use cpp_macro. Return
true on success.
(parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert)
(cpp_do_unassert): Convert to use cpp_macro.
* macro.c (warn_of_redefinition, _cpp_new_macro)
(check_trad_stringification, cpp_macro_definition): Adjust macro
parm access.
* traditional.c (_cpp_replacement_text_len)
(_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise.
gcc/c-family/
* c-ada-spec.c (macro_length, dump_ada_macros): Adjust macro parm
access.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263658 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoRefactor std::optional SFINAE constraints
redi [Mon, 20 Aug 2018 12:13:25 +0000 (12:13 +0000)] 
Refactor std::optional SFINAE constraints

* include/std/optional (_Optional_payload): Use variable templates
for conditions in default template arguments and exception
specifications.
(optional): Likewise. Adjust indentation.
(optional::__not_self, optional::__not_tag, optional::_Requires): New
SFINAE helpers.
(optional::optional): Use new helpers in constructor constraints.
* include/std/type_traits (__or_v, __and_v): New variable templates.
* testsuite/20_util/optional/cons/value_neg.cc: Change dg-error to
dg-prune-output. Remove unused header.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263657 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoDaily bump.
gccadmin [Mon, 20 Aug 2018 00:16:26 +0000 (00:16 +0000)] 
Daily bump.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263656 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago PR target/86994
uros [Sun, 19 Aug 2018 19:10:37 +0000 (19:10 +0000)] 
PR target/86994
* config/i386/i386.c (ix86_rtx_costs) [case SET]: Check source for
register_operand when calling ix86_set_reg_reg_cost.
[case CONST_INT, case CONST, case LABEL_REF, case SYMBOL_REF]:
Set *total to 0 for operands that satisfy x86_64_immediate_operand
predicate and to 1 otherwise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263652 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoDaily bump.
gccadmin [Sun, 19 Aug 2018 00:16:19 +0000 (00:16 +0000)] 
Daily bump.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263651 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago2018-08-18 François Dumont <fdumont@gcc.gnu.org>
fdumont [Sat, 18 Aug 2018 20:01:14 +0000 (20:01 +0000)] 
2018-08-18  François Dumont  <fdumont@gcc.gnu.org>

* testsuite/25_algorithms/copy/86658.cc: Use dg-options to define
_GLIBCXX_DEBUG.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263647 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoDarwin emits pubnames/types by default which mask the intent of the test.
iains [Sat, 18 Aug 2018 09:24:55 +0000 (09:24 +0000)] 
Darwin emits pubnames/types by default which mask the intent of the test.

gcc/testsuite

2018-08-18  Iain Sandoe  <iain@sandoe.co.uk>

* gcc.dg/debug/dwarf2/pr80263.c: Suppress pubtypes output
for Darwin.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263646 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoDarwin does not support gsplit-dwarf.
iains [Sat, 18 Aug 2018 09:15:05 +0000 (09:15 +0000)] 
Darwin does not support gsplit-dwarf.

2018-08-18  Iain Sandoe  <iain@sandoe.co.uk>

gcc/

* config/darwin.c (darwin_override_options): If -gsplit-dwarf is set,
emit a diagnostic that it is not supported and reset the option.
* config/darwin.h (DRIVER_SELF_SPECS): Note that gsplit-dwarf is not
supported and consume the option.  (ASM_FINAL_SPEC): New.

gcc/testsuite

* g++.dg/debug/dwarf2/pr85302.C: Skip unsupported split DWARF
test on Darwin.
* g++.dg/debug/dwarf2/pr85302.C: Likewise.
* gcc.dg/lto/pr83719_0.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263645 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoDaily bump.
gccadmin [Sat, 18 Aug 2018 00:16:26 +0000 (00:16 +0000)] 
Daily bump.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263644 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[PATCH] Adjust lazy macro definition
nathan [Fri, 17 Aug 2018 23:18:11 +0000 (23:18 +0000)] 
[PATCH] Adjust lazy macro definition

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01072.html
libcpp/
* include/cpplib.h (struct cpp_callbacks): Replace
user_builtin_macro with user_lazy_macro.
(struct cpp_macro): add lazy field.
(enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER.
(cpp_define_lazily): Declare.
* macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use.
(warn_of_redefinition): Use cpp_builtin_macro_p, directly call
user_lazy_macro hook.
(_cpp_new_macro): Clear lazy field.
(cpp_define_lazily): Define.
(_cpp_notify_macro_use): Adjust lazy definition code.
(cpp_macro_definition): No need to do lazy definition here.
* pch.c (write_macdef, save_macros): Likewise.
gcc/c-family/
* c-cppbuiltin.c (struct lazy_hex_fp_value_struct): Remove macro
field.
(laxy_hex_fp_value_count): Make unsigned.
(lazy_hex_fp_value): Provided with macro & lazy number.  Directly
manipulate the macro.
(builtin_defin_with_hex_fp_value): Adjust callback name, use
cpp_define_lazily.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263640 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoPR testsuite/86996
msebor [Fri, 17 Aug 2018 21:58:27 +0000 (21:58 +0000)] 
PR testsuite/86996

gcc/testsuite/CHangeLog:
* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Adjust.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263636 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoC++: -Wwrite-strings: use location of string constant
dmalcolm [Fri, 17 Aug 2018 21:56:21 +0000 (21:56 +0000)] 
C++: -Wwrite-strings: use location of string constant

Consider:

extern int callee (const char *one, char *two, const char *three);

int test ()
{
  return callee ("first", "second", "third");
}

for which -Wwrite-strings was emitting:

Wwrite-strings.C: In function 'int test()':
Wwrite-strings.C:10:44: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
10 |   return callee ("first", "second", "third");
   |                                            ^

This patch fixes the warning so that it underlines the pertinent argument
at the callsite:

Wwrite-strings.C: In function 'int test()':
Wwrite-strings.C:10:27: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
10 |   return callee ("first", "second", "third");
   |                           ^~~~~~~~

Ideally we ought to also issue a "note" highlighting the pertinent
parameter within the decl, but that's not readily available, so I'm
saving it for another patch.

gcc/cp/ChangeLog:
* typeck.c (string_conv_p): Extract location from EXP and use it
in preference to input_location when issuing warnings.

gcc/testsuite/ChangeLog:
* g++.dg/conversion/Wwrite-strings.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263635 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agodoc: Use @ref, not @xref, in the middle of a sentence
segher [Fri, 17 Aug 2018 19:35:18 +0000 (19:35 +0000)] 
doc: Use @ref, not @xref, in the middle of a sentence

makeinfo warns about this.

* doc/md.texi (Patterns): Use @ref instead of @xref in the middle of
a sentence.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263633 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago2018-08-17 Sandra Loosemore <sandra@codesourcery.com>
sandra [Fri, 17 Aug 2018 19:18:38 +0000 (19:18 +0000)] 
2018-08-17  Sandra Loosemore  <sandra@codesourcery.com>

MAINTAINERS: Add c-sky port maintainers.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263632 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago2018-08-17 Jojo <jijie_rong@c-sky.com>
sandra [Fri, 17 Aug 2018 19:08:27 +0000 (19:08 +0000)] 
2018-08-17  Jojo  <jijie_rong@c-sky.com>
    Huibin Wang  <huibin_wang@c-sky.com>
    Sandra Loosemore  <sandra@codesourcery.com>
    Chung-Lin Tang  <cltang@codesourcery.com>

C-SKY port: libgcc

libgcc/
* config.host: Add C-SKY support.
* config/csky/*: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263631 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago2018-08-17 Sandra Loosemore <sandra@codesourcery.com>
sandra [Fri, 17 Aug 2018 19:06:52 +0000 (19:06 +0000)] 
2018-08-17  Sandra Loosemore  <sandra@codesourcery.com>
    Chung-Lin Tang  <cltang@codesourcery.com>
    Xianmiao Qu  <xianmiao_qu@c-sky.com>

C-SKY port: Testsuite

gcc/testsuite/
* g++.dg/Wno-frame-address.C: Adjust for C-SKY.
* g++.dg/torture/type-generic-1.C: Likewise.
* gcc.c-torture/compile/20000804-1.c: Likewise.
* gcc.c-torture/execute/20101011-1.c: Likewise.
* gcc.c-torture/execute/ieee/mul-subnormal-single-1.x: Likewise.
* gcc.dg/20020312-2.c: Likewise.
* gcc.dg/Wno-frame-address.c: Likewise.
* gcc.dg/c11-true_min-1.c: Likewise.
* gcc.dg/sibcall-10.c: Likewise.
* gcc.dg/sibcall-9.c: Likewise.
* gcc.dg/stack-usage-1.c: Likewise.
* gcc.dg/torture/float32-tg-3.c: Likewise.
* gcc.dg/torture/float32x-tg-3.c: Likewise.
* gcc.dg/torture/float64-tg-3.c: Likewise.
* gcc.dg/torture/float64x-tg-3.c: Likewise.
* gcc.dg/torture/type-generic-1.c: Likewise.
* gcc.target/csky/*: New.
* lib/target-supports.exp (check_profiling_available): Add
csky-*-elf.
(check_effective_target_hard_float): Handle C-SKY targets with
single-precision hard float only.
(check_effective_target_logical_op_short_circuit): Handle C-SKY.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263630 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago2018-08-17 Sandra Loosemore <sandra@codesourcery.com>
sandra [Fri, 17 Aug 2018 19:05:12 +0000 (19:05 +0000)] 
2018-08-17  Sandra Loosemore  <sandra@codesourcery.com>

C-SKY port: Documentation

gcc/
* doc/extend.texi (C-SKY Function Attributes): New section.
* doc/invoke.texi (Option Summary): Add C-SKY options.
(C-SKY Options): New section.
* doc/md.texi (Machine Constraints): Document C-SKY constraints.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263629 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago2018-08-17 Jojo <jijie_rong@c-sky.com>
sandra [Fri, 17 Aug 2018 19:03:27 +0000 (19:03 +0000)] 
2018-08-17  Jojo  <jijie_rong@c-sky.com>
    Huibin Wang  <huibin_wang@c-sky.com>
    Sandra Loosemore  <sandra@codesourcery.com>
    Chung-Lin Tang  <cltang@codesourcery.com>

C-SKY port: Backend implementation

gcc/
* config/csky/*: New.
* common/config/csky/*: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263628 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago2018-08-17 Jojo <jijie_rong@c-sky.com>
sandra [Fri, 17 Aug 2018 19:00:25 +0000 (19:00 +0000)] 
2018-08-17  Jojo  <jijie_rong@c-sky.com>
    Huibin Wang  <huibin_wang@c-sky.com>
    Sandra Loosemore  <sandra@codesourcery.com>
    Chung-Lin Tang  <cltang@codesourcery.com>
    Andrew Jenner  <andrew@codesourcery.com>

C-SKY port: Configury

gcc/
* config.gcc (csky-*-*): New.
* configure.ac: Add csky to targets for dwarf2 debug_line support.
* configure: Regenerated.

contrib/
* config-list.mk (LIST): Add csky-elf and csky-linux-gnu.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263627 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoFormatted printing for dump_* in the middle-end
dmalcolm [Fri, 17 Aug 2018 18:21:31 +0000 (18:21 +0000)] 
Formatted printing for dump_* in the middle-end

This patch converts dump_print and dump_printf_loc from using
printf (and thus ATTRIBUTE_PRINTF) to using a new pretty-printer
based on pp_format, which supports formatting middle-end types.

In particular, the following codes are implemented (in addition
to the standard pretty_printer ones):

   %E: gimple *:
       Equivalent to: dump_gimple_expr (MSG_*, TDF_SLIM, stmt, 0)
   %G: gimple *:
       Equivalent to: dump_gimple_stmt (MSG_*, TDF_SLIM, stmt, 0)
   %T: tree:
       Equivalent to: dump_generic_expr (MSG_*, arg, TDF_SLIM).

Hence it becomes possible to convert e.g.:

  if (dump_enabled_p ())
    {
      dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
                       "not vectorized: different sized vector "
                       "types in statement, ");
      dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, vectype);
      dump_printf (MSG_MISSED_OPTIMIZATION, " and ");
      dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, nunits_vectype);
      dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
    }

into a one-liner:

  if (dump_enabled_p ())
    dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
                     "not vectorized: different sized vector "
                     "types in statement, %T and %T\n",
                     vectype, nunits_vectype);

Unlike regular pretty-printers, this one captures optinfo_item
instances for the formatted chunks as appropriate, so that when
written out to a JSON optimization record, the relevant parts of
the message are labelled by type, and by source location (so that
e.g. %G is entirely equivalent to using dump_gimple_stmt).

dump_printf and dump_printf_loc become marked with
ATTRIBUTE_GCC_DUMP_PRINTF, which the patch also implements.

gcc/c-family/ChangeLog:
* c-format.c (enum format_type): Add gcc_dump_printf_format_type.
(gcc_dump_printf_length_specs): New.
(gcc_dump_printf_flag_pairs): New.
(gcc_dump_printf_flag_specs): New.
(gcc_dump_printf_char_table): New.
(format_types_orig): Add entry for "gcc_dump_printf".
(init_dynamic_diag_info): Set up length_char_specs and
conversion_specs for gcc_dump_printf_format_type.
(handle_format_attribute): Handle gcc_dump_printf_format_type.

gcc/ChangeLog:
* dump-context.h: Include "dumpfile.h".
(dump_context::dump_printf_va): Convert final param from va_list
to va_list *.  Convert from ATTRIBUTE_PRINTF to
ATTRIBUTE_GCC_DUMP_PRINTF.
(dump_context::dump_printf_loc_va): Likewise.
* dumpfile.c: Include "stringpool.h".
(make_item_for_dump_printf_va): Delete.
(make_item_for_dump_printf): Delete.
(class dump_pretty_printer): New class.
(dump_pretty_printer::dump_pretty_printer): New ctor.
(dump_pretty_printer::emit_items): New member function.
(dump_pretty_printer::emit_any_pending_textual_chunks): New member
function.
(dump_pretty_printer::emit_item): New member function.
(dump_pretty_printer::stash_item): New member function.
(dump_pretty_printer::format_decoder_cb): New member function.
(dump_pretty_printer::decode_format): New member function.
(dump_context::dump_printf_va): Reimplement in terms of
dump_pretty_printer.
(dump_context::dump_printf_loc_va): Convert final param from va_list
to va_list *.
(dump_context::begin_scope): Reimplement call to
make_item_for_dump_printf.
(dump_printf): Update for change to dump_printf_va.
(dump_printf_loc): Likewise.
(selftest::test_capture_of_dump_calls): Convert "stmt" from
greturn * to gimple *.  Add a test_decl.  Add tests of dump_printf
with %T, %E, and %G.
* dumpfile.h (ATTRIBUTE_GCC_DUMP_PRINTF): New macro.
(dump_printf): Replace ATTRIBUTE_PRINTF_2 with
ATTRIBUTE_GCC_DUMP_PRINTF (2, 3).
(dump_printf_loc): Replace ATTRIBUTE_PRINTF_3 with
ATTRIBUTE_GCC_DUMP_PRINTF (3, 0).
* tree-vect-data-refs.c (vect_lanes_optab_supported_p): Convert
use of HOST_WIDE_INT_PRINT_DEC on unsigned HOST_WIDE_INT "count"
within a dump_printf_loc call to "%wu".
(vector_alignment_reachable_p): Merge two dump_printf[_loc] calls,
converting a use of HOST_WIDE_INT_PRINT_DEC to "%wd".  Add a
missing space after "=".
* tree-vect-loop.c (vect_analyze_loop_2) Within a dump_printf
call, convert use of HOST_WIDE_INT_PRINT_DEC to "%wd".
* tree-vect-slp.c (vect_slp_bb): Within a dump_printf_loc call,
convert use of HOST_WIDE_INT_PRINT_UNSIGNED to "%wu".
* tree-vectorizer.c (try_vectorize_loop_1): Likewise.  Remove
duplicate "vectorized" from message.

gcc/testsuite/ChangeLog:
* gcc.dg/format/gcc_diag-1.c: Fix typo.  Add test coverage for
gcc_dump_printf.
* gcc.dg/format/gcc_diag-10.c: Add gimple typedef.  Add test
coverage for gcc_dump_printf.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263626 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoPR libstdc++/86963 Implement LWG 2729 constraints on tuple assignment
redi [Fri, 17 Aug 2018 17:52:49 +0000 (17:52 +0000)] 
PR libstdc++/86963 Implement LWG 2729 constraints on tuple assignment

PR libstdc++/86963
* include/std/tuple (__tuple_base): New class template with deleted
copy assignment operator.
(tuple, tuple<_T1, _T2>): Derive from __tuple_base<tuple> so that
implicit copy/move assignment operator will be deleted/suppressed.
(tuple::__assignable, tuple<_T1, _T2>::__assignable): New helper
functions for SFINAE constraints on assignment operators.
(tuple::__nothrow_assignable, tuple<_T1, _T2>::__nothrow_assignable):
New helper functions for exception specifications.
(tuple::operator=(const tuple&), tuple::operator=(tuple&&))
(tuple<_T1, _T2>::operator=(const tuple&))
(tuple<_T1, _T2>::operator=(tuple&&)): Change parameter types to
__nonesuch_no_braces when the operator should be defined implicitly.
Use __nothrow_assignable for exception specifications.
(tuple::operator=(const tuple<_UElements...>&))
(tuple::operator=(tuple<_UElements...>&&))
(tuple<_T1, _T2>::operator=(const tuple<_U1, _U2>&))
(tuple<_T1, _T2>::operator=(tuple<_U1, _U2>&&))
(tuple<_T1, _T2>::operator=(const pair<_U1, _U2>&))
(tuple<_T1, _T2>::operator=(pair<_U1, _U2>&&)): Constrain using
__assignable and use __nothrow_assignable for exception
specifications.
* python/libstdcxx/v6/printers.py (is_specialization_of): Accept
gdb.Type as first argument, instead of a string.
(StdTuplePrinter._iterator._is_nonempty_tuple): New method to check
tuple for expected structure.
(StdTuplePrinter._iterator.__init__): Use _is_nonempty_tuple.
* testsuite/20_util/tuple/dr2729.cc: New test.
* testsuite/20_util/tuple/element_access/get_neg.cc: Change dg-error
to dg-prune-output.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263625 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoFix poly types after PR tree-optimization/71625 strlen optimization
nsz [Fri, 17 Aug 2018 17:26:11 +0000 (17:26 +0000)] 
Fix poly types after PR tree-optimization/71625 strlen optimization

Same as r263561, but for arm: avoid compilation errors caused by poly
initializers getting treated as string literals.

Tested on arm-none-linux-gnueabihf.

gcc/ChangeLog:

* config/arm/arm-builtins.c (arm_init_simd_builtin_types): Clear
polyNxK_t element's TYPE_STRING_FLAG.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263624 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agors6000: Give names to cbranch/creturn patterns
segher [Fri, 17 Aug 2018 17:22:36 +0000 (17:22 +0000)] 
rs6000: Give names to cbranch/creturn patterns

This gives a name to the conditional branch and conditional return
patterns, so that it looks neater in dumps and verbose asm.  Also, the
comment for conditional branch was out of date; this fixes it.

* config/rs6000/rs6000.md (*cbranch, *creturn): Name these patterns
(they were unnamed before).  Fix comments.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263623 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[PATCH] Macro body is trailing array
nathan [Fri, 17 Aug 2018 16:07:19 +0000 (16:07 +0000)] 
[PATCH] Macro body is trailing array

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01037.html
* include/cpplib.h (enum cpp_macro_kind): New.
(struct cpp_macro): Make body trailing array.  Add kind field,
delete traditional flag.
* internal.h (_cpp_new_macro): Declare.
(_cpp_reserve_room): New inline.
(_cpp_commit_buf): Declare.
(_cpp_create_trad_definition): Return new macro.
* lex.c (_cpp_commit_buff): New.
* macro.c (macro_real_token_count): Count backwards.
(replace_args): Pointer equality not orderedness.
(_cpp_save_parameter): Use _cpp_reserve_room.
(alloc_expansion_token): Delete.
(lex_expansion_token): Return macro pointer.  Use _cpp_reserve_room.
(create_iso_definition): Allocate macro itself.  Adjust for
different allocation ordering.
(_cpp_new_macro): New.
(_cpp_create_definition): Adjust for API changes.
* traditional.c (push_replacement_text): Don't set traditional
flag.
(save_replacement_text): Likewise.
(_cpp_create_trad_definition): Allocate macro itself, Adjust for
different allocation ordering.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263622 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago[PATCH] Move cpp_macro to cpplib.h
nathan [Fri, 17 Aug 2018 12:04:13 +0000 (12:04 +0000)] 
[PATCH] Move cpp_macro to cpplib.h

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01016.html
libcpp/
* cpp-id-data.h (uchar, UC): Move to internal.h
(struct cpp_macro): Move to cpplib.h.
* internal.h (uchar, UC): From cpp-id-data.h.
* include/cpplib.h (struct cpp_macro): From cpp-id-data.h.
gcc/c-family/
* c-ada-spec.c: Don't #include "cpp-id-data.h"
* c-cppbuiltin.c: Likewise.
gcc/
* cppbuiltin.c: Include "cpplib.h", not "cpp-id-data.h".

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263618 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago2018-08-17 Richard Biener <rguenther@suse.de>
rguenth [Fri, 17 Aug 2018 09:26:53 +0000 (09:26 +0000)] 
2018-08-17  Richard Biener  <rguenther@suse.de>

PR tree-optimization/86841
* wide-int-range.cc (wide_int_range_lshift): Use to_uhwi.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263615 138bc75d-0d04-0410-961f-82ee72b054a4

5 years agoMerge Ignore and Deprecated in .opt files.
marxin [Fri, 17 Aug 2018 09:25:56 +0000 (09:25 +0000)] 
Merge Ignore and Deprecated in .opt files.

2018-08-17  Martin Liska  <mliska@suse.cz>

* common.opt: Remove Warn, Init and Report for options with
        Ignore/Deprecated flag. Warning is done automatically for
        Deprecated flags.
* config/i386/i386.opt: Likewise.
* config/ia64/ia64.opt: Likewise.
* config/rs6000/rs6000.opt: Likewise.
* cppbuiltin.c (define_builtin_macros_for_compilation_flags):
        Remove usage of flag_check_pointer_bounds.
* lto-wrapper.c (merge_and_complain): Do not handle
        OPT_fcheck_pointer_bounds.
(append_compiler_options): Likewise.
* opt-functions.awk: Do not handle Deprecated.
* optc-gen.awk: Check that Var, Report and Init are not
        used for an option with Ignore/Deprecated flag.
* opts-common.c (decode_cmdline_option): Do not report
        CL_ERR_DEPRECATED.
(read_cmdline_option): Report warning for OPT_SPECIAL_deprecated
        options.
* opts.h (struct cl_option): Remove cl_deprecated flag.
(CL_ERR_DEPRECATED): Remove error enum value.
2018-08-17  Martin Liska  <mliska@suse.cz>

* g++.dg/opt/mpx.C: Fix scanned pattern.
* gcc.target/i386/mpx.c: Likewise.
* g++.dg/warn/Wunreachable-code-1.C: Remove.
* g++.dg/warn/Wunreachable-code-2.C: Likewise.
* gcc.dg/torture/pr52969.c: Likewise.
* g++.dg/warn/pr31246-2.C: Likewise.
* g++.dg/warn/pr31246.C: Likewise.
* gcc.dg/pr33092.c: Likewise.
* g++.dg/opt/eh1.C: Remove a deprecated option.
* g++.dg/template/inline1.C: Likewise.
* g++.dg/tree-ssa/pr81408.C: Likewise.
* gcc.dg/pr41837.c: Likewise.
* gcc.dg/pr41841.c: Likewise.
* gcc.dg/pr42250.c: Likewise.
* gcc.dg/pr43084.c: Likewise.
* gcc.dg/pr43317.c: Likewise.
* gcc.dg/pr51879-18.c: Likewise.
* gcc.dg/torture/pr36066.c: Likewise.
* gcc.dg/tree-ssa/ifc-8.c: Likewise.
* gcc.dg/tree-ssa/ifc-cd.c: Likewise.
* gcc.dg/tree-ssa/pr19210-1.c: Likewise.
* gcc.dg/tree-ssa/pr45122.c: Likewise.
* gcc.target/i386/pr45352-2.c: Likewise.
* gcc.target/i386/zee.c: Likewise.
* gfortran.dg/auto_char_len_2.f90: Likewise.
* gfortran.dg/auto_char_len_4.f90: Likewise.
* gfortran.dg/c_ptr_tests_15.f90: Likewise.
* gfortran.dg/char_array_structure_constructor.f90: Likewise.
* gfortran.dg/gomp/pr47331.f90: Likewise.
* gfortran.dg/pr40999.f: Likewise.
* gfortran.dg/pr41011.f: Likewise.
* gfortran.dg/pr42051.f03: Likewise.
* gfortran.dg/pr46804.f90: Likewise.
* gfortran.dg/pr83149_1.f90: Likewise.
* gfortran.dg/pr83149_b.f90: Likewise.
* gfortran.dg/whole_file_1.f90: Likewise.
* gfortran.dg/whole_file_10.f90: Likewise.
* gfortran.dg/whole_file_11.f90: Likewise.
* gfortran.dg/whole_file_12.f90: Likewise.
* gfortran.dg/whole_file_13.f90: Likewise.
* gfortran.dg/whole_file_14.f90: Likewise.
* gfortran.dg/whole_file_15.f90: Likewise.
* gfortran.dg/whole_file_16.f90: Likewise.
* gfortran.dg/whole_file_17.f90: Likewise.
* gfortran.dg/whole_file_18.f90: Likewise.
* gfortran.dg/whole_file_19.f90: Likewise.
* gfortran.dg/whole_file_2.f90: Likewise.
* gfortran.dg/whole_file_20.f03: Likewise.
* gfortran.dg/whole_file_3.f90: Likewise.
* gfortran.dg/whole_file_4.f90: Likewise.
* gfortran.dg/whole_file_5.f90: Likewise.
* gfortran.dg/whole_file_6.f90: Likewise.
* gfortran.dg/whole_file_7.f90: Likewise.
* gfortran.dg/whole_file_8.f90: Likewise.
* gfortran.dg/whole_file_9.f90: Likewise.
* gcc.dg/vect/vect.exp: Likewise.
2018-08-17  Martin Liska  <mliska@suse.cz>

* c.opt: Remove Warn, Init and Report for options with
        Ignore/Deprecated flag. Warning is done automatically for
        Deprecated flags.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263614 138bc75d-0d04-0410-961f-82ee72b054a4

5 years ago2018-08-17 Richard Biener <rguenther@suse.de>
rguenth [Fri, 17 Aug 2018 08:48:58 +0000 (08:48 +0000)] 
2018-08-17  Richard Biener  <rguenther@suse.de>

PR middle-end/86505
* tree-inline.c (copy_bb): When inlining __builtin_va_arg_pack_len ()
across a va-arg-pack using call adjust its return value accordingly.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263613 138bc75d-0d04-0410-961f-82ee72b054a4