gcc.git
6 years ago[Ada] Adjust documentation of -gnatn switch
Eric Botcazou [Tue, 29 May 2018 09:42:50 +0000 (09:42 +0000)]
[Ada] Adjust documentation of -gnatn switch

This changes the wording in the documentation of the -gnatn switch to make
it use "units" rather than "modules" and also adjusts the usage message.

No functional changes.

2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
List of All Switches): Replace "modules" with "units".
(Subprogram Inlining Control): Likewise.
* gnat_ugn.texi: Regenerate.
* usage.adb (Usage): Fix description of -gnatn switch.

From-SVN: r260889

6 years ago[Ada] Fix typos in Makefile.in
Arnaud Charlet [Tue, 29 May 2018 09:42:45 +0000 (09:42 +0000)]
[Ada] Fix typos in Makefile.in

2018-05-29  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* gcc-interface/Makefile.in: Fix typos.

From-SVN: r260888

6 years ago[Ada] Attach reference to finalizers to tree
Ed Schonberg [Tue, 29 May 2018 09:42:39 +0000 (09:42 +0000)]
[Ada] Attach reference to finalizers to tree

2018-05-29  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_ch7.adb (Build_Finalizer_Call): Attach to tree the reference to
the finalizer procedure in the At_End handler, for use in LLVM
generation.

From-SVN: r260887

6 years ago[Ada] Wrong equality on untagged private type
Javier Miranda [Tue, 29 May 2018 09:42:34 +0000 (09:42 +0000)]
[Ada] Wrong equality on untagged private type

When a private type declaration T1 is completed with a derivation of an
untagged private type that overrides the predefined equality primitive, and the
full view of T2 is a derivation of another private type T2 whose full view is a
tagged type, the compiler may generate code that references the wrong equality
primitive when processing comparisons of objects of type T1.

2018-05-29  Javier Miranda  <miranda@adacore.com>

gcc/ada/

* exp_ch4.adb (Expand_N_Op_Eq, Expand_Composite_Equality): Use the new
subprogram Inherits_From_Tagged_Full_View to identify more reliably
untagged private types completed with a derivation of an untagged
private whose full view is a tagged type.
* sem_util.ads, sem_util.adb (Inherits_From_Tagged_Full_View): New
subprogram.
(Collect_Primitive_Operations): Handle untagged private types completed
with a derivation of an untagged private type whose full view is a
tagged type. In such case, collecting the list of primitives we may
find two equality primitives: one associated with the untagged private
and another associated with the ultimate tagged type (and we must
remove from the returned list this latter one).

gcc/testsuite/

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

From-SVN: r260886

6 years ago[Ada] Unnesting: handle statement sequences that include an At_End handler
Ed Schonberg [Tue, 29 May 2018 09:42:29 +0000 (09:42 +0000)]
[Ada] Unnesting: handle statement sequences that include an At_End handler

2018-05-29  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_unst.adb (Visit_Node): Handle statement sequences that include an
At_End handler.

From-SVN: r260885

6 years ago[Ada] Plug small hole in -gnatR output
Eric Botcazou [Tue, 29 May 2018 09:42:16 +0000 (09:42 +0000)]
[Ada] Plug small hole in -gnatR output

The -gnatR switch outputs representation information for locally-defined
types but it was skipping those defined in blocks without label, unlike
those defined in named blocks.  This change plugs this small hole.

The following procedure:

procedure P is
begin
  declare
    type R is record
      I : Integer;
    end record;
  begin
    null;
  end;
end;

must now generate the following output with -gnatR:

Representation information for unit P (body)
--------------------------------------------

for B_1.R'Size use 32;
for B_1.R'Alignment use 4;
for B_1.R use record
   I at 0 range  0 .. 31;
end record;

2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* repinfo.adb (List_Entities): Also recurse into blocks without label.

From-SVN: r260884

6 years ago[Ada] Unnesting: do not generate push/pop for exceptions
Ed Schonberg [Tue, 29 May 2018 09:42:11 +0000 (09:42 +0000)]
[Ada] Unnesting: do not generate push/pop for exceptions

2018-05-29  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_ch6.adb (Expand_N_Subprogram_Body): Do not generate push/pop for
exceptions if subprogram unnesting is in effect, because these branch
nodes are relevant only in the presence of nested subprograms.

From-SVN: r260883

6 years ago[Ada] Improper behavior of floating-point attributes
Ed Schonberg [Tue, 29 May 2018 09:42:05 +0000 (09:42 +0000)]
[Ada] Improper behavior of floating-point attributes

This patch fixes an error in the handling of attributes Pred qnd Succ when
applied to the limit values of a floating-point type. The RM mandates that
such operations must raise constraint_error, but GNAT generated in most cases
an infinite value, regardless of whether overflow checks were enabled.

2018-05-29  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* libgnat/s-fatgen.adb (Succ, Pred):  Raise Constraint_Error
unconditionally when applied to the largest positive (resp. largest
negative) value of a floating-point type.

gcc/testsuite/

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

From-SVN: r260882

6 years ago[Ada] Clarify use of Activation_Record_Component
Ed Schonberg [Tue, 29 May 2018 09:41:59 +0000 (09:41 +0000)]
[Ada] Clarify use of Activation_Record_Component

2018-05-29  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* einfo.ads, einfo.adb: Clarify use of Activation_Record_Component:
discriminants and exceptions are never components of such.  The flag
Needs_Activation_Record is set on subprogram types, not on access to
them.

From-SVN: r260881

6 years ago[Ada] Set scope of component of subtype
Ed Schonberg [Tue, 29 May 2018 09:41:52 +0000 (09:41 +0000)]
[Ada] Set scope of component of subtype

2018-05-29  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch3.adb: Set scope of component of subtype.

From-SVN: r260880

6 years ago[Ada] Unnesting: exclude selected components whose prefix carry no type
Ed Schonberg [Tue, 29 May 2018 09:41:45 +0000 (09:41 +0000)]
[Ada] Unnesting: exclude selected components whose prefix carry no type

2018-05-29  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_unst.adb (Visit_Node): Exclude selected components whose prefix
carry no type. Such selected components appear in unit names that are
child units, both in the specification and possibly in an end label for
the unit, and they do not contain any relevant uplevel references.

From-SVN: r260879

6 years ago[Ada] Turn Ada.Calendar.Epoch_Offset into a function
Arnaud Charlet [Tue, 29 May 2018 09:41:40 +0000 (09:41 +0000)]
[Ada] Turn Ada.Calendar.Epoch_Offset into a function

2018-05-29  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* libgnat/a-calend.ads, libgnat/a-calend.adb (Epoch_Offset): Make it a
function.

From-SVN: r260878

6 years ago[Ada] Add system-vxworks7 variants of system.ads files for Vx7
Olivier Hainque [Tue, 29 May 2018 09:41:34 +0000 (09:41 +0000)]
[Ada] Add system-vxworks7 variants of system.ads files for Vx7

Based on the Vx6 versions, using a different link spec to accomodate VxWorks 7
specificities, in particular the ability in some configurations to rely on
.ctor sections to trigger constructors in kernel modules.

2018-05-29  Olivier Hainque  <hainque@adacore.com>

gcc/ada/

* libgnat/system-vxworks7-ppc-rtp.ads: New file.
* libgnat/system-vxworks7-ppc-kernel.ads: New file.
* libgnat/system-vxworks7-e500-rtp.ads: New file.
* libgnat/system-vxworks7-e500-kernel.ads: New file.
* libgnat/system-vxworks7-x86-rtp.ads: New file.
* libgnat/system-vxworks-ppc64-kernel.ads: Rename as ...
* libgnat/system-vxworks7-ppc64-kernel.ads: and adjust name of
gnat-crtbe link spec to use the vx7 variant.

From-SVN: r260877

6 years ago[Ada] Tighten crtbegin files for VxWorks
Olivier Hainque [Tue, 29 May 2018 09:41:02 +0000 (09:41 +0000)]
[Ada] Tighten crtbegin files for VxWorks

Enforce a more explicit distinction of crtbegin objects holding
either functions with ctor/dtor attributes or _ctors/_dtors arrays,
or none of the two (no array, no attributes). Then allow/enforce
different linking strategies for VxWorks 7.

2018-05-29  Olivier Hainque  <hainque@adacore.com>

gcc/ada/

* vx_crtbegin.inc: Use a consistent naming convention for the
registration/deregistration functions across RTP or kernel.  Remove the
ctor/dtor attribute setting based on RTP/kernel, expect the optional
attribute extension to be provided by includers instead.
* vx_crtbegin.c: Mere inclusion of vx_crtbegin.inc with empty attribute
extension for the registration/deregistration functions.
* vx_crtbegin_attr.c: New file. Include vx_crtbegin.inc with explicit
constructor/destructor attribute extensions.
* vx_crtbegin_array.c: New file. Include vx_crtbegin.inc with empty
attribute extensions and declare _ctors/_dtors arrays.
* vx_crtbegin_auto.c: Remove.
* libgnat/system-vxworks7-aarch64-rtp-smp.ads: Use
vxworks7-gnat-crtbe-link.spec.
* libgnat/system-vxworks7-aarch64.ads: Likewise.
* libgnat/system-vxworks7-e500-rtp-smp.ads: Likewise.
* libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise.
* libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise.
* libgnat/system-vxworks7-x86-kernel.ads: Likewise.
* libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise.
* libgnat/system-vxworks7-x86_64-kernel.ads: Likewise.
* libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise.

From-SVN: r260876

6 years ago[Ada] Minor reformatting
Piotr Trojanek [Tue, 29 May 2018 09:40:37 +0000 (09:40 +0000)]
[Ada] Minor reformatting

2018-05-29  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* ali.adb: Minor reformatting.

From-SVN: r260875

6 years ago[Ada] GNAT UGN: update package requirements for 32bit GNAT on x86_64-linux
Joel Brobecker [Tue, 29 May 2018 09:40:15 +0000 (09:40 +0000)]
[Ada] GNAT UGN: update package requirements for 32bit GNAT on x86_64-linux

2018-05-29  Joel Brobecker  <brobecker@adacore.com>

gcc/ada/

* doc/gnat_ugn/platform_specific_information.rst: Update package
requirements for 32bit GNAT on x86_64-linux.
* gnat_ugn.texi: Regenerate.

From-SVN: r260874

6 years ago[Ada] Adjustment of behavior of new -gnatRj switch
Eric Botcazou [Tue, 29 May 2018 09:39:44 +0000 (09:39 +0000)]
[Ada] Adjustment of behavior of new -gnatRj switch

This decouples -gnatRj from the destination, either standard output or file,
so that it only toggles the format of the representation information.

2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* doc/gnat_ugn/building_executable_programs_with_gnat.rst (Debugging
Control): Adjust description of -gnatRj.
* gnat_ugn.texi: Regenerate.
* opt.ads (List_Representation_Info_To_JSON): Likewise.
* repinfo.adb (List_Rep_Info): Do not automatically create a file
if List_Representation_Info_To_JSON is true.
* switch-c.adb (Scan_Front_End_Switches) <R>: Remove incompatibility
check between -gnatRj and -gnatRs.
* usage.adb (Usage): Adjust description of -gnatRj.

From-SVN: r260873

6 years ago[Ada] Fix constraint error in Normalize_Pathname
Pascal Obry [Tue, 29 May 2018 09:39:11 +0000 (09:39 +0000)]
[Ada] Fix constraint error in Normalize_Pathname

Fix Normalize_Pathname to avoid a constraint error.

2018-05-29  Pascal Obry  <obry@adacore.com>

gcc/ada/

* libgnat/s-os_lib.adb (Normalize_Pathname): Fix handling of ".." in
the root directory.

gcc/testsuite/

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

From-SVN: r260872

6 years ago[Ada] System.Os_Lib: minor reformatting
Pascal Obry [Tue, 29 May 2018 09:38:41 +0000 (09:38 +0000)]
[Ada] System.Os_Lib: minor reformatting

2018-05-29  Pascal Obry  <obry@adacore.com>

gcc/ada/

* libgnat/s-os_lib.adb: Minor reformatting.

From-SVN: r260871

6 years ago[Ada] New function to return nanoseconds from Unix Epoch
Doug Rupp [Tue, 29 May 2018 09:38:17 +0000 (09:38 +0000)]
[Ada] New function to return nanoseconds from Unix Epoch

2018-05-29  Doug Rupp  <rupp@adacore.com>

gcc/ada/

* libgnat/a-calend.adb (Epoch_Offset): Move from body to ...
* libgnat/a-calend.ads (Epoch_Offset): to private part of spec
* libgnat/a-calcon.ads (To_Unix_Nano_Time): New function spec.
* libgnat/a-calcon.adb (To_Unix_Nano_Time): New function body.

From-SVN: r260870

6 years ago[Ada] Enhance output of discriminants with -gnatR in JSON mode
Eric Botcazou [Tue, 29 May 2018 09:37:43 +0000 (09:37 +0000)]
[Ada] Enhance output of discriminants with -gnatR in JSON mode

This arranges for the Discriminant_Number of discriminants to be output
by -gnatR in JSON mode.  This number is referenced in symbolic expressions
present for offsets and sizes, so its definition is also required for the
sake of completeness.

2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* repinfo.ads (JSON format): Document new pair for components.
* repinfo.adb (Derived_Discriminant): New function.
(List_Structural_Record_Layout): Add Outer_Ent parameter and pass it
in recursive calls. If the record type is the parent of an extension,
find and list the derived discriminant from the extension, if any.
(List_Component_Layout): List the Discriminant_Number in JSON mode.
(List_Record_Info): Adjust call to List_Structural_Record_Layout.

From-SVN: r260869

6 years ago[Ada] Implement machine parsable format for -gnatR output
Eric Botcazou [Tue, 29 May 2018 09:36:51 +0000 (09:36 +0000)]
[Ada] Implement machine parsable format for -gnatR output

This adds a new variant to the -gnatR switch, namely -gnatRj, which causes
the compiler to output representation information to a file in the JSON
data interchange format.  It can be combined with -gnatR0/1/2/3/m (but is
incompatible with -gnaRe and -gnatRs).

The information output in this mode is a superset of that output in the
traditional -gnatR mode, but is otherwise equivalent for the common part.

2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* doc/gnat_ugn/building_executable_programs_with_gnat.rst (Alphabetical
List of All Switches): Document -gnatRj.
(Debugging Control): Likewise.
* gnat_ugn.texi: Regenerate.
* opt.ads (List_Representation_Info_To_JSON): New boolean variable.
* osint-c.adb (Create_Repinfo_File): Use the .json instead of .rep
extension if List_Representation_Info_To_JSON is true.
* repinfo.ads: Document the JSON output format.
* repinfo.adb (List_Location): New procedure.
(List_Array_Info): Add support for JSON output.
(List_Entities): Likewise.
(Unop): Likewise.
(Binop): Likewise.
(Print_Expr): Likewise.
(List_Linker_Section): Likewise.
(List_Mechanisms): Likewise.
(List_Name): Likewise.
(List_Object_Info): Likewise.
(List_Record_Info): Likewise.
(List_Component_Layout): Likewise.  Add Indent parameter.
(List_Structural_Record_Layout): New procedure.
(List_Attr): Add support for JSON output.
(List_Type_Info): Likewise.
(Write_Unknown_Val): Likewise.
* switch-c.adb (Scan_Front_End_Switches) <R>: Deal with 'j'.
* usage.adb (Usage): List -gnatRj.

From-SVN: r260868

6 years ago[Ada] Factor out worker procedure for -gnatR
Eric Botcazou [Tue, 29 May 2018 09:36:34 +0000 (09:36 +0000)]
[Ada] Factor out worker procedure for -gnatR

This extracts a worker procedure for printing the layout of a single component
from List_Record_Layout so as to make the next change more readable.

2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* repinfo.adb (List_Component_Layout): New procedure extracted from...
(List_Record_Layout): ...here.  Invoke it.

From-SVN: r260867

6 years ago[Ada] Minor cleanup in repinfo unit
Eric Botcazou [Tue, 29 May 2018 09:35:57 +0000 (09:35 +0000)]
[Ada] Minor cleanup in repinfo unit

This factors out the various cases where a marker for an unknown value is
output by the -gnatR switches.  No functional changes.

2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* repinfo.adb (Write_Unknown_Val): New procedure.
(List_GCC_Expression): Call it.
(List_Record_Layout): Likewise.
(Write_Val): Likewise.

From-SVN: r260866

6 years ago[Ada] Clear Do_Overflow_Check when inserting code to do check
Richard Kenner [Tue, 29 May 2018 09:35:25 +0000 (09:35 +0000)]
[Ada] Clear Do_Overflow_Check when inserting code to do check

2018-05-29  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

gcc/ada/

* exp_ch4.adb (Expand_N_Op_Abs): Clear Do_Overflow_Check when inserting
code to do check.

From-SVN: r260865

6 years ago[Ada] Lib.Write: avoid use of System.Case_Util
Arnaud Charlet [Tue, 29 May 2018 09:34:47 +0000 (09:34 +0000)]
[Ada] Lib.Write: avoid use of System.Case_Util

2018-05-29  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* lib-writ.adb (Write_ALI): Do not use new function from s-casuti yet.
This breaks build of cross compilers with older versions of GNAT, so
better avoid it.

From-SVN: r260864

6 years ago[Ada] Refine documentation of Monotonic_Clock to reflect reality
Doug Rupp [Tue, 29 May 2018 09:33:50 +0000 (09:33 +0000)]
[Ada] Refine documentation of Monotonic_Clock to reflect reality

2018-05-29  Doug Rupp  <rupp@adacore.com>

gcc/ada/

* libgnarl/s-taprop.ads (Monotonic_Clock): Refine documentation to
reflect reality.

From-SVN: r260863

6 years ago[Ada] Always do range check against 'First
Richard Kenner [Tue, 29 May 2018 09:31:00 +0000 (09:31 +0000)]
[Ada] Always do range check against 'First

2018-05-29  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

gcc/ada/

* exp_ch4.adb (Expand_N_Op_Abs): Always do range check against 'First.

From-SVN: r260862

6 years ago[Ada] Fix irregular output with -gnatRm
Eric Botcazou [Tue, 29 May 2018 09:29:28 +0000 (09:29 +0000)]
[Ada] Fix irregular output with -gnatRm

The information displayed by -gnatRm was using slightly different naming
and formatting conventions than the rest of the -gnatR information with
no justification, so this adjusts it for the sake of consistency.

For the following package:

package P is

  function F (I : Integer) return Integer;

  type Rec is limited record
    I : Integer;
  end record;

  procedure P1 (R : Rec; I : out Integer);

  procedure P2 (R : Rec; I : out Integer);
  pragma Linker_Section (P2, ".my_section");

  package Inner is

    procedure P3;

  end Inner;

end P;

package body P is

  function F (I : Integer) return Integer is
  begin
    return I;
  end;

  procedure P1 (R : Rec; I : out Integer) is
  begin
    I := R.I;
  end;

  procedure P2 (R : Rec; I : out Integer) is
  begin
    I := R.I;
  end;

  package body Inner is

     procedure P3 is
     begin
       null;
     end;

  end Inner;

end P;

the output of -gnatRm must be:

Representation information for unit P (body)
--------------------------------------------

Representation information for unit P (spec)
--------------------------------------------

function F declared at p7.ads:3:12
convention : Ada
   I : passed by copy
returns by copy

for Rec'Size use 32;
for Rec'Alignment use 4;
for Rec use record
   I at 0 range  0 .. 31;
end record;

procedure P1 declared at p7.ads:9:13
convention : Ada
   R : passed by reference
   I : passed by copy

procedure P2 declared at p7.ads:11:13
convention : Ada
   R : passed by reference
   I : passed by copy
pragma Linker_Section (P2, ".my_section");

procedure Inner.P3 declared at p7.ads:16:15
convention : Ada

2018-05-29  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* repinfo.adb (List_Entities): Do not list the Linker_Section for
subprograms here...
(List_Mechanisms): ...but here instead.  Use consistent name output
and formatting conventions.

From-SVN: r260861

6 years ago[Ada] Preliminary work to avoid full pathnames in ALI files
Bob Duff [Tue, 29 May 2018 09:28:59 +0000 (09:28 +0000)]
[Ada] Preliminary work to avoid full pathnames in ALI files

Normally, ALI files refer to source files using simple names. This allows files
to be moved around without disturbing things (causing extra recompilations,
etc). However, for configuration files, the full pathname is stored. This patch
preparates the code base to store the simple name in this case.

2018-05-29  Bob Duff  <duff@adacore.com>

gcc/ada/

* lib-writ.adb (Write_ALI): Cleanup: avoid use of global var; call new
To_Lower function.
* libgnat/s-casuti.ads, libgnat/s-casuti.adb (To_Upper, To_Lower,
To_Mixed): New functions.
* osint.adb: Cleanup: use Is_Directory_Separator, which correctly
allows both '\' and '/' on Windows.

From-SVN: r260860

6 years ago[testsuite] Fix "too few/many" error messages in scan-*-times procs
Tom de Vries [Tue, 29 May 2018 07:08:34 +0000 (07:08 +0000)]
[testsuite] Fix "too few/many" error messages in scan-*-times procs

2018-05-29  Tom de Vries  <tom@codesourcery.com>

* lib/scanasm.exp (scan-assembler-times): Use proc name in error
message.
* lib/scanipa.exp (scan-ipa-dump-times): Same.
* lib/scanrtl.exp (scan-rtl-dump-times): Same.
* lib/scantree.exp (scan-tree-dump-times): Same.

From-SVN: r260859

6 years ago[testsuite] Use correct proc names in scanasm.exp
Tom de Vries [Tue, 29 May 2018 07:08:23 +0000 (07:08 +0000)]
[testsuite] Use correct proc names in scanasm.exp

2018-05-29  Tom de Vries  <tom@codesourcery.com>

* lib/scanasm.exp (scan-stack-usage, scan-stack-usage-not)
(scan-ada-spec, scan-ada-spec-not, scan-lto-assembler):
Use proc name as first argument to dg-scan.

From-SVN: r260858

6 years ago[testsuite] Fix error message in scan-hidden/scan-not-hidden
Tom de Vries [Tue, 29 May 2018 07:08:11 +0000 (07:08 +0000)]
[testsuite] Fix error message in scan-hidden/scan-not-hidden

2018-05-29  Tom de Vries  <tom@codesourcery.com>

* lib/scanasm.exp (scan-hidden, scan-not-hidden): Handle being called
with no arguments.

From-SVN: r260857

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

From-SVN: r260856

6 years agoconfig.gcc: Identify FreeBSD 3.x and 4.x as unsupported.
Gerald Pfeifer [Mon, 28 May 2018 23:20:15 +0000 (23:20 +0000)]
config.gcc: Identify FreeBSD 3.x and 4.x as unsupported.

* config.gcc: Identify FreeBSD 3.x and 4.x as unsupported.

* config/freebsd-spec.h (FBSD_LIB_SPEC): Only consider FreeBSD 5
and later.

From-SVN: r260852

6 years agore PR fortran/85840 (Memory leak in write.c)
Jerry DeLisle [Mon, 28 May 2018 21:55:31 +0000 (21:55 +0000)]
re PR fortran/85840 (Memory leak in write.c)

2018-05-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/85840
* io/write.c (write_real, write_real_g0, write_complex): Use
separate local variables for the float string length.

From-SVN: r260851

6 years agosplay-tree.h (splay_tree_compare_strings, [...]): Declare new utility functions.
Bernd Edlinger [Mon, 28 May 2018 18:21:23 +0000 (18:21 +0000)]
splay-tree.h (splay_tree_compare_strings, [...]): Declare new utility functions.

include:
2018-05-28  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * splay-tree.h (splay_tree_compare_strings,
        splay_tree_delete_pointers): Declare new utility functions.

libiberty:
2018-05-28  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * splay-tree.c (splay_tree_compare_strings,
        splay_tree_delete_pointers): New utility functions.

gcc:
2018-05-28  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * tree-dump.c (dump_node): Use splay_tree_delete_pointers.

c-family:
2018-05-28  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c-lex.c (get_fileinfo): Use splay_tree_compare_strings and
        splay_tree_delete_pointers.

cp:
2018-05-28  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * decl2.c (start_static_storage_duration_function): Use
        splay_tree_delete_pointers.

From-SVN: r260850

6 years agore PR middle-end/85933 (FAIL: gcc.dg/sso/p8.c -O3 -finline-functions (internal...
Richard Biener [Mon, 28 May 2018 10:31:46 +0000 (10:31 +0000)]
re PR middle-end/85933 (FAIL: gcc.dg/sso/p8.c   -O3 -finline-functions  (internal compiler error))

2018-05-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/85933
* tree-vect-data-refs.c (vect_record_base_alignments): Only
look at stmts marked as vectorizable.

From-SVN: r260848

6 years agore PR tree-optimization/85934 (ICE: verify_gimple failed (error: type mismatch in...
Richard Biener [Mon, 28 May 2018 10:28:38 +0000 (10:28 +0000)]
re PR tree-optimization/85934 (ICE: verify_gimple failed (error: type mismatch in vector pack expression))

2018-05-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/85934
* tree-vect-generic.c (expand_vector_operations_1): Hoist
vector boolean check before scalar optimization.

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

From-SVN: r260847

6 years agoinvoke.texi (ARM Options): Use @item instead of @itemx for armv5te.
Jakub Jelinek [Mon, 28 May 2018 10:20:56 +0000 (12:20 +0200)]
invoke.texi (ARM Options): Use @item instead of @itemx for armv5te.

* doc/invoke.texi (ARM Options): Use @item instead of @itemx
for armv5te.

From-SVN: r260846

6 years agoDWARF: Handle expressions containing "-1" in dw2_asm_output_delta_uleb128.
Mark Wielaard [Mon, 28 May 2018 09:06:02 +0000 (09:06 +0000)]
DWARF: Handle expressions containing "-1" in dw2_asm_output_delta_uleb128.

In dwarf2out.c dwarf2out_var_location () we create loclabels that might
contain -1 (for example ".LVL5-1"). Technically those are expressions,
not just plain labels. But they work fine everywhere we use them, except
when calculating an uleb128 delta between two labels.

For example we might create the following DWARF5 location list entry:

        .byte   0x3     # DW_LLE_startx_length (*.LLST0)
        .uleb128 0x6    # Location list range start index (*.LVL5-1)
        .uleb128 .LFE1-.LVL5-1        # Location list length (*.LLST0)
        .uleb128 0x1    # Location expression size
        .byte   0x54    # DW_OP_reg4
        .byte   0       # DW_LLE_end_of_list (*.LLST0)

Note the length is calculated using .uleb128 .LFE1-.LVL5-1. This is
wrong, since both .LVL5 and 1 are substracted from .LFE1, instead of
1 being subtracted from .LVL5 first, before substracting from .LFE1.

This happens because dw2_asm_output_delta_uleb128 expects two plain
labels and simply inserts a minus sign between them. To fix this we
simply look if the second label is actually an expression containing
a minus sign and then add brackets around it. That will emit the
correct .uleb128 expression:

        .uleb128 .LFE1-(.LVL5-1)        # Location list length (*.LLST0)

We cannot simply generate the loclabel containing brackets directly
because we do use them also in contexts that don't take a full
expression (for example we use them with .quad too).

gcc/

* dwarf2asm.c (dw2_asm_output_delta_uleb128): Add brackets around
lab2 if it is an expression containing a minus sign.

From-SVN: r260845

6 years ago[Ada] Minor fixes and tweaks to comments in the Repinfo unit
Eric Botcazou [Mon, 28 May 2018 08:56:20 +0000 (08:56 +0000)]
[Ada] Minor fixes and tweaks to comments in the Repinfo unit

2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* repinfo.ads: Minor fixes and tweaks in comments.

From-SVN: r260844

6 years ago[Ada] Remove Valop from the Repinfo unit
Eric Botcazou [Mon, 28 May 2018 08:56:15 +0000 (08:56 +0000)]
[Ada] Remove Valop from the Repinfo unit

This removes the recently added Valop as redundant.  No functional changes.

2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* repinfo.adb (List_GCC_Expression): Remove Valop and replace calls to
it with calls to Unop.

From-SVN: r260843

6 years ago[Ada] Minor cleanup in repinfo unit
Eric Botcazou [Mon, 28 May 2018 08:56:08 +0000 (08:56 +0000)]
[Ada] Minor cleanup in repinfo unit

This removes the Truth_Andif_Expr and Truth_Orif_Expr codes for expressions
handled by the repinfo unit, since they are redundant with Truth_And_Expr
and Truth_Or_Expr respectively in this context.  No functional changes.

2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* repinfo.ads (TCode): Adjust range.
(Truth_Andif_Expr): Remove.
(Truth_Orif_Expr): Likewise.
(Truth_And_Expr .. Dynamic_Val): Adjust value.
* repinfo.adb (Print_Expr): Remove handling of Truth_{And,Or}if_Expr.
(Rep_Value): Likewise.
* repinfo.h (Truth_Andif_Expr): Remove.
(Truth_Orif_Expr): Likewise.
(Truth_And_Expr .. Dynamic_Val): Adjust value.
* gcc-interface/decl.c (annotate_value) <TRUTH_ANDIF_EXPR>: Fall
through to TRUTH_AND_EXPR case.
<TRUTH_ORIF_EXPR>: Fall through to TRUTH_OR_EXPR case.

From-SVN: r260842

6 years ago[Ada] Unnesting: check index expressions for uplevel references
Ed Schonberg [Mon, 28 May 2018 08:56:03 +0000 (08:56 +0000)]
[Ada] Unnesting: check index expressions for uplevel references

2018-05-28  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_unst.adb (Visit_Node): For indexed components and attribute
references, examine index expressions or associated expressions as well
to record uplevel references.
(Vist_Node): For function and procedure calls, if a formal is an
unconstrained array and the actual is constrained, check whether bounds
of actual have uplevel references.

From-SVN: r260841

6 years ago[Ada] Unnesting: allow uplevel references to exceptions
Ed Schonberg [Mon, 28 May 2018 08:55:57 +0000 (08:55 +0000)]
[Ada] Unnesting: allow uplevel references to exceptions

2018-05-28  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* einfo.ads, einfo.adb: Exceptions can be uplevel references, and thus
they can appear as components of activation records.
* exp_unst.adb (Visit_Node): A reference to an exception may be an
uplevel reference.

From-SVN: r260840

6 years ago[Ada] Fix internal error on renaming of equality for record type
Eric Botcazou [Mon, 28 May 2018 08:55:52 +0000 (08:55 +0000)]
[Ada] Fix internal error on renaming of equality for record type

This adjusts the previous change to the cases where the array type is not
yet frozen and, therefore, where Size_Depends_On_Discriminant is not yet
computed, by doing the computation manually.

2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* exp_ch4.adb (Expand_Composite_Equality): Compute whether the size
depends on a discriminant manually instead of using the predicate
Size_Depends_On_Discriminant in the array type case.

gcc/testsuite/

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

From-SVN: r260839

6 years ago[Ada] Improve unnesting for discriminants of record subtypes
Ed Schonberg [Mon, 28 May 2018 08:55:47 +0000 (08:55 +0000)]
[Ada] Improve unnesting for discriminants of record subtypes

2018-05-28  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_unst.adb (Check_Static_Type): For a record subtype, check
discriminant constraints as well.
(Visit_Node): For a selected component, check type of prefix, as is
done for indexed components and slices.

From-SVN: r260838

6 years ago[Ada] Fix regression of ACATS c46032a with CCG back end
Javier Miranda [Mon, 28 May 2018 08:55:42 +0000 (08:55 +0000)]
[Ada] Fix regression of ACATS c46032a with CCG back end

2018-05-28  Javier Miranda  <miranda@adacore.com>

gcc/ada/

* exp_ch4.adb (Real_Range_Check): Add a temporary to store the integer
value when converting a float value to a fixed-point value. This is
required for CCG because it handles fixed-point types by means of
unsigned integer type variables. The range check is now performed using
the integer value stored in this temporary.

From-SVN: r260837

6 years ago[Ada] Update FE check following change in SPARK RM 7.1.3(12)
Yannick Moy [Mon, 28 May 2018 08:55:35 +0000 (08:55 +0000)]
[Ada] Update FE check following change in SPARK RM 7.1.3(12)

SPARK Reference Manual changed to accept attributes First, Last and Length
as not leading to an evaluation of a part of the prefix object. This is
reflected here in the checking code for that rule.

2018-05-28  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_util.adb (Is_OK_Volatile_Context): Add attributes First, Last and
Length as valid non-interfering contexts for SPARK.

From-SVN: r260836

6 years ago[Ada] Allow for GNATprove specific versions of routines from Sem_Disp
Claire Dross [Mon, 28 May 2018 08:55:22 +0000 (08:55 +0000)]
[Ada] Allow for GNATprove specific versions of routines from Sem_Disp

2018-05-28  Claire Dross  <dross@adacore.com>

gcc/ada/

* sem_disp.ads, sem_disp.adb (Inheritance_Utilities): Package for
generic inheritance utilities.
(Generic_Inherited_Subprograms): Generic version of
Inherited_Subprograms, generic in Find_Dispatching_Type function.
(Generic_Is_Overriding_Subprogram): Generic version of
Is_Overriding_Subprogram, generic in Find_Dispatching_Type function.
(Inherited_Subprograms): Instance of Generic_Inherited_Subprograms with
Sem_Disp.Find_Dispatching_Type.
(Is_Overriding_Subprogram): Instance of
Generic_Is_Overriding_Subprogram with Sem_Disp.Find_Dispatching_Type.
(Inheritance_Utilities_Inst): Instance of Inheritance_Utilities
with Sem_Disp.Find_Dispatching_Type.

From-SVN: r260835

6 years ago[Ada] Fix internal error on nested record types with representation clause
Eric Botcazou [Mon, 28 May 2018 08:54:55 +0000 (08:54 +0000)]
[Ada] Fix internal error on nested record types with representation clause

This fixes a long-standing issue with the expansion of equality functions
generated for discriminated record types with variant part.  In this case
the front-end recursively expands equality functions for the composite
sub-components, in particular the array sub-components.

But it systematically uses the unconstrained base type for them, which leads
to both a more complex equality function, because of the need to compare
the bounds, and an additional unchecked conversion from type to base type.

Now this unchecked conversion may block a further expansion of the array
sub-component, for example if it is a large array of record types subject
to a component clause that causes it not to start on a byte boundary, and
thus may lead to an internal error downstream in the back-end.

2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* exp_ch4.adb (Expand_Composite_Equality): For a composite (or FP)
component type, do not expand array equality using the unconstrained
base type, except for the case where the bounds of the type depend on a
discriminant.

gcc/testsuite/

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

From-SVN: r260834

6 years ago[Ada] Introduce a new Needs_Activation_Record entity flag
Ed Schonberg [Mon, 28 May 2018 08:54:46 +0000 (08:54 +0000)]
[Ada] Introduce a new Needs_Activation_Record entity flag

2018-05-28  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* einfo.ads, einfo.adb (Needs_Activation_Record): New flag on
access-to-subprogram types, to indicate that an indirect call through
such a type requires an activation record when compiling for LLVM.
* sem_ch3.adb (Access_Subprogram_Declaration): Set new flag as needed.

From-SVN: r260833

6 years ago[Ada] Better accuracy in float-to-fixed conversions
Ed Schonberg [Mon, 28 May 2018 08:54:41 +0000 (08:54 +0000)]
[Ada] Better accuracy in float-to-fixed conversions

This patch improves the accuracy of conversions from a floating point to
a fixed point type when the fixed point type has a specified Snall that is
not a power of two. Previously the conversion of Fixed_Point_Type'First to
some floating point number and back to Fixed_Point_Type raised Constraint
error. This result is within the accuracy imposed by tne Numerics annex of
the RM but is certainly undesirable. This patch transforms the conversion
to avoid extra manipulations of the 'Small of the type, so that the
identity:

      Fixed_T (Float_T (Fixed_Val)) = Fixed_Val

holds over the range of Fixed_T.

2018-05-28  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_ch4.adb (Real_Range_Check): Specialize float-to-fixed conversions
when bounds of fixed type are static, to remove some spuerfluous
implicit conversions and provide an accurate result when converting
back and forth between the fixed point type and a floating point type.

gcc/testsuite/

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

From-SVN: r260832

6 years ago[Ada] Don't create empty activation records
Ed Schonberg [Mon, 28 May 2018 08:54:34 +0000 (08:54 +0000)]
[Ada] Don't create empty activation records

2018-05-28  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_unst.adb (Unnest_Subprogram): Prevent creation of empty
activation records.

From-SVN: r260831

6 years ago[Ada] Improve unnesting of indexed references
Richard Kenner [Mon, 28 May 2018 08:54:27 +0000 (08:54 +0000)]
[Ada] Improve unnesting of indexed references

2018-05-28  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

gcc/ada/

* exp_unst.adb (Check_Static_Type): Add argument to indicate node to be
replaced, if any; all callers changed.
(Note_Uplevel_Ref): Likewise.  Also replace reference to deferred
constant with private view so we take the address of that entity.
(Note_Uplevel_Bound): Add argument to indicate node to be replaced, if
any; all callers changed.  Handle N_Indexed_Component like
N_Attribute_Reference.  Add N_Type_Conversion case.
(Visit_Node): Indexed references can be uplevel if the type isn't
static.
(Unnest_Subprograms): Don't rewrite if no reference given.  If call has
been relocated, set first_named pointer in original node as well.

From-SVN: r260830

6 years ago[Ada] Copy index expression trees rather than relocating them
Ed Schonberg [Mon, 28 May 2018 08:54:18 +0000 (08:54 +0000)]
[Ada] Copy index expression trees rather than relocating them

2018-05-28  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_aggr.adb (Flatten): Copy tree of expression in a component
association with a range or a set of discrete choices, rather than
relocating the node. This avoids inconsistencies in the tree when
handling nested subprograms with uplevel references for LLVM.

From-SVN: r260829

6 years ago[Ada] Disregard alignment issues in CodePeer mode
Arnaud Charlet [Mon, 28 May 2018 08:54:11 +0000 (08:54 +0000)]
[Ada] Disregard alignment issues in CodePeer mode

2018-05-28  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* exp_util.adb (Possible_Bit_Aligned_Component): Always return False in
codepeer mode.

From-SVN: r260828

6 years ago[Ada] Minor typo fix in exp_unst.adb
Arnaud Charlet [Mon, 28 May 2018 08:54:06 +0000 (08:54 +0000)]
[Ada] Minor typo fix in exp_unst.adb

2018-05-28  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* exp_unst.adb: Fix typo.

From-SVN: r260827

6 years ago[Ada] Minor cleanup implementation of Ada.Containers.Vectors
Bob Duff [Mon, 28 May 2018 08:54:01 +0000 (08:54 +0000)]
[Ada] Minor cleanup implementation of Ada.Containers.Vectors

2018-05-28  Bob Duff  <duff@adacore.com>

gcc/ada/

* libgnat/a-convec.adb (Query_Element): Minor cleanup: remove an
unnecessary use of 'Unrestricted_Access.

From-SVN: r260826

6 years ago[Ada] Crash on aspect/pragma Linked_Section with -gnatR2
Hristian Kirtchev [Mon, 28 May 2018 08:53:54 +0000 (08:53 +0000)]
[Ada] Crash on aspect/pragma Linked_Section with -gnatR2

This patch modifies the output of the representation information related to
aspect or pragma Linker_Section, achieved with compiler switch -gnatR2. The
value of the section argument is now properly retrieved. Previously it was
assumed that the value is always a N_String_Literal, however the semantics
of the annotation allow for any static string expression, including a
reference to a static string.

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

--  linker_sections.ads

package Linker_Sections is
   LS_1 : constant String := "1";
   LS_2 : constant String := "2" & "2";
   LS_3 : constant String := LS_1 & "3";
   LS_4 : constant String := "4" & LS_2;

   Val_1  : Integer with Linker_Section => LS_1;
   Val_2  : Integer with Linker_Section => LS_2;
   Val_3  : Integer with Linker_Section => LS_3;
   Val_4  : Integer with Linker_Section => LS_4;
   Val_5  : Integer with Linker_Section => LS_1 & "5";
   Val_6  : Integer with Linker_Section => LS_2 & "6";
   Val_7  : Integer with Linker_Section => LS_3 & "7";
   Val_8  : Integer with Linker_Section => LS_4 & "8";
   Val_9  : Integer with Linker_Section => "9"  & LS_1;
   Val_10 : Integer with Linker_Section => "10" & LS_2;
   Val_11 : Integer with Linker_Section => "11" & LS_3;
   Val_12 : Integer with Linker_Section => "12" & LS_4;

   Val_13 : Integer; pragma Linker_Section (Val_13, LS_1);
   Val_14 : Integer; pragma Linker_Section (Val_14, LS_2);
   Val_15 : Integer; pragma Linker_Section (Val_15, LS_3);
   Val_16 : Integer; pragma Linker_Section (Val_16, LS_4);
   Val_17 : Integer; pragma Linker_Section (Val_17, LS_1 & "5");
   Val_18 : Integer; pragma Linker_Section (Val_18, LS_2 & "6");
   Val_19 : Integer; pragma Linker_Section (Val_19, LS_3 & "7");
   Val_20 : Integer; pragma Linker_Section (Val_20, LS_4 & "8");
   Val_21 : Integer; pragma Linker_Section (Val_21, "9"  & LS_1);
   Val_22 : Integer; pragma Linker_Section (Val_22, "10" & LS_2);
   Val_23 : Integer; pragma Linker_Section (Val_23, "11" & LS_3);
   Val_24 : Integer; pragma Linker_Section (Val_24, "12" & LS_4);
end Linker_Sections;

-----------------
-- Compilation --
-----------------

$ gcc -c -gnatR2s linker_sections.ads

2018-05-28  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* repinfo.adb (Expr_Value_S): New routine.
(List_Linker_Section): Properly extract the value of the section
argument.

From-SVN: r260825

6 years ago[Ada] Update user manual for the -D binder switch
Patrick Bernardi [Mon, 28 May 2018 08:53:49 +0000 (08:53 +0000)]
[Ada] Update user manual for the -D binder switch

2018-05-28  Patrick Bernardi  <bernardi@adacore.com>

gcc/ada/

* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update the
description of the -D binder switch to reflect current usage.
* gnat_ugn.texi: Regenerate.

From-SVN: r260824

6 years ago[Ada] Minor reformatting
Gary Dismukes [Mon, 28 May 2018 08:53:42 +0000 (08:53 +0000)]
[Ada] Minor reformatting

2018-05-28  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

* exp_ch3.adb: Minor reformatting

From-SVN: r260823

6 years ago[Ada] Spurious constraint error on array of null-excluding components
Justin Squirek [Mon, 28 May 2018 08:53:36 +0000 (08:53 +0000)]
[Ada] Spurious constraint error on array of null-excluding components

This patch fixes an issue whereby the compiler would raise spurious runtime
errors when an array of null-excluding components was initialized with an
expression which required the secondary stack (such as with an concatination
operation) due to certain generated checks which were incorrected performed
on internal object declarations.

2018-05-28  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* exp_ch3.adb
(Build_Initialization_Call): Add logic to pass the appropriate actual to match
 new formal.
(Init_Formals): Add new formal *_skip_null_excluding_check
* exp_util.adb, exp_util.ads
(Enclosing_Init_Proc): Added to fetch the enclosing Init_Proc from the current
 scope.
(Inside_Init_Proc): Refactored to use Enclosing_Init_Proc
(Needs_Conditional_Null_Excluding_Check): Added to factorize the predicate
 used to determine how to generate an Init_Proc for a given type.
(Needs_Constant_Address): Minor reformatting
* sem_res.adb
(Resolve_Null): Add logic to generate a conditional check in certain cases

gcc/testsuite/

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

From-SVN: r260822

6 years ago[Ada] Minor reformatting
Hristian Kirtchev [Mon, 28 May 2018 08:53:29 +0000 (08:53 +0000)]
[Ada] Minor reformatting

2018-05-28  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* exp_aggr.adb, gnatlink.adb, sem_ch6.adb, sem_res.adb, sem_util.adb:
Minor reformatting.

From-SVN: r260821

6 years ago[Ada] Spurious error on aspect Volatile
Hristian Kirtchev [Mon, 28 May 2018 08:53:22 +0000 (08:53 +0000)]
[Ada] Spurious error on aspect Volatile

This patch modifies the analysis of aspect/pragma Volatile to correct accept
the annotation when it applies to single protected and single task types, and
SPARK_Mode On is in effect.

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

--  pack.ads

package Pack with SPARK_Mode is
   protected PO_Aspect with Volatile is end;                         --  OK

   protected PO_Pragma is end;
   pragma Volatile (PO_Pragma);                                      --  OK

   task TO_Aspect with Volatile;                                     --  OK

   task TO_Pragma;
   pragma Volatile (TO_Pragma);                                      --  OK
end Pack;

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

$ gcc -c pack.ads
$ gcc -c pack.ads -gnatd.F
cannot generate code for file pack.ads (package spec)

2018-05-28  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Include
the declarations of single concurrent types because they fall in the
category of full type and object declarations.

From-SVN: r260820

6 years ago[Ada] Minor tweak to output of -gnatR
Eric Botcazou [Mon, 28 May 2018 08:53:13 +0000 (08:53 +0000)]
[Ada] Minor tweak to output of -gnatR

This changes the output of -gnatR for extensions of tagged record types to
avoid displaying the internal _Parent component, which overlaps with other
components and is thus more confusing than helpful.

For the following hierarchy:

  type R1 is tagged record
    I : Integer;
  end record;

  type R2 is new R1 with record
    C : Character;
  end record;

the output -gnatR must now be:

for R1'Object_Size use 128;
for R1'Value_Size use 96;
for R1'Alignment use 8;
for R1 use record
   _Tag at 0 range  0 .. 63;
   I    at 8 range  0 .. 31;
end record;

for R2'Object_Size use 192;
for R2'Value_Size use 136;
for R2'Alignment use 8;
for R2 use record
   _Tag at  0 range  0 .. 63;
   I    at  8 range  0 .. 31;
   C    at 16 range  0 ..  7;
end record;

2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* repinfo.adb (Compute_Max_Length): Skip _Parent component.
(List_Record_Layout): Likewise.

From-SVN: r260819

6 years ago[Ada] Warning on recursive call within postcondition
Ed Schonberg [Mon, 28 May 2018 08:53:06 +0000 (08:53 +0000)]
[Ada] Warning on recursive call within postcondition

This patch adds a warning to a function call that appears within a
postcondition for said function. This may mean an omission of an attribute
reference 'Result, and may lead to an infinite loop on a call to that function.

Compiling post_error.ads must yield:

post_error.ads:3:11:
        warning: postcondition does not mention function result
post_error.ads:3:19:
       warning: call to "Foo" within its postcondition will lead
         to infinite recursion
----
package Post_Error is
   function Foo (A : out Integer) return Integer
     with Post => Foo (A)  /= 0;
   pragma Import (C, Foo);
end Post_Error;

2018-05-28  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_util.adb (Is_Function_Result): Add a warning if a postcondition
includes a call to function to which it applies. This may mean an
omission of an attribute reference 'Result, in particular if the
function is pqrameterless.

From-SVN: r260818

6 years ago[Ada] Misleading warning on unresolvable package name
Justin Squirek [Mon, 28 May 2018 08:53:00 +0000 (08:53 +0000)]
[Ada] Misleading warning on unresolvable package name

This patch fixes an issue whereby the compiler misidentified a package name
containing the name of a standard runtime package as said package - leading to
and improper error message prompting the user to "With" a package already in
scope.

2018-05-28  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* sem_ch8.adb (Find_Expanded_Name): Add extra guard to make sure the
misresolved package name is not a case of mistaken identity.

gcc/testsuite/

* gnat.dg/warn15-core-main.adb, gnat.dg/warn15-core.ads,
gnat.dg/warn15-interfaces.ads, gnat.dg/warn15.ads: New testcase.

From-SVN: r260817

6 years ago[Ada] Further evaluation of type bounds in GNATprove mode
Yannick Moy [Mon, 28 May 2018 08:52:53 +0000 (08:52 +0000)]
[Ada] Further evaluation of type bounds in GNATprove mode

Some static bounds of types are not recognized and evaluated as such in the
semantic analysis phase of the frontend, which leads to incomplete information
in GNATprove. Fix that in the GNATprove mode only, as this is not needed when
full expansion is used.

There is no impact on compilation.

2018-05-28  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_res.adb (Resolve_Range): Re-resolve the low bound of a range in
GNATprove mode, as the order of resolution (low then high) means that
all the information is not available when resolving the low bound the
first time.

From-SVN: r260816

6 years ago[Ada] Minor internal cleanup in repinfo unit
Eric Botcazou [Mon, 28 May 2018 08:52:42 +0000 (08:52 +0000)]
[Ada] Minor internal cleanup in repinfo unit

This steamlines a bit the implementation.  No functional changes.

2018-05-28  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* repinfo.adb (List_Array_Info): Start with an explicit blank line and
end with the linker section, if any.
(List_Entities): Do not output the linker section for record types,
array types and variables.
(Print_Expr): Factor out common processing for unary operators and
special values.  Adjust and reorder the various cases.
(List_Object_Info): End with the linker section, if any.
(List_Record_Info): Likewise.
(List_Type_Info): Do not start with a blank line.

From-SVN: r260815

6 years agoDaily bump.
GCC Administrator [Mon, 28 May 2018 00:16:35 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r260814

6 years agopa-linux.h (NEED_INDICATE_EXEC_STACK): Define to 0.
John David Anglin [Sun, 27 May 2018 21:49:43 +0000 (21:49 +0000)]
pa-linux.h (NEED_INDICATE_EXEC_STACK): Define to 0.

* config/pa/pa-linux.h (NEED_INDICATE_EXEC_STACK): Define to 0.

From-SVN: r260809

6 years agodecl.c (match_data_constant): Fortran 2018 allows pointer initialization in a data...
Steven G. Kargl [Sun, 27 May 2018 17:31:26 +0000 (17:31 +0000)]
decl.c (match_data_constant): Fortran 2018 allows pointer initialization in a data statement.

2018-05-27  Steven G. Kargl  <kargl@gcc.gnu.org>

 * decl.c (match_data_constant):  Fortran 2018 allows pointer
 initialization in a data statement.

2018-05-27  Steven G. Kargl  <kargl@gcc.gnu.org>

 * gfortran.dg/data_stmt_pointer.f90: new test.

From-SVN: r260808

6 years agoFix a number of ICE in the test suite.
Paul Koning [Sun, 27 May 2018 17:13:22 +0000 (13:13 -0400)]
Fix a number of ICE in the test suite.

    * config/pdp11/pdp11.md (truncsihi2): Remove.

From-SVN: r260807

6 years agostl_tree.h (_Rb_tree_impl(_Node_allocator&&)): New.
François Dumont [Sun, 27 May 2018 17:06:40 +0000 (17:06 +0000)]
stl_tree.h (_Rb_tree_impl(_Node_allocator&&)): New.

2018-05-27  François Dumont  <fdumont@gcc.gnu.org>

* include/bits/stl_tree.h (_Rb_tree_impl(_Node_allocator&&)): New.
(_Rb_tree(const allocator_type&)): Use latter.
* include/bits/stl_map.h (map(const allocator_type&)): Likewise.
(map(initializer_list<value_type>, const allocator_type&)): Likewise.
(map(_InputIterator, _InputIterator, const allocator_type&)): Likewise.
* include/bits/stl_multimap.h
(multimap(const allocator_type&)): Likewise.
(multimap(initializer_list<value_type>, const allocator_type&)):
Likewise.
(multimap(_InputIterator, _InputIterator, const allocator_type&)):
Likewise.
* include/bits/stl_set.h (set(const allocator_type&)): Likewise.
(set(initializer_list<value_type>, const allocator_type&)): Likewise.
(set(_InputIterator, _InputIterator, const allocator_type&)): Likewise.
* include/bits/stl_multiset.h
(multiset(const allocator_type&)): Likewise.
(multiset(initializer_list<value_type>, const allocator_type&)):
Likewise.
(multiset(_InputIterator, _InputIterator, const allocator_type&)):
Likewise.

From-SVN: r260806

6 years ago[NDS32] Optimize movmem and setmem operations.
Monk Chiang [Sun, 27 May 2018 16:18:24 +0000 (16:18 +0000)]
[NDS32] Optimize movmem and setmem operations.

gcc/
* config/nds32/nds32-intrinsic.md (unaligned_storedi): Modify patterns
implementation.
(unaligned_store_dw): Ditto.
* config/nds32/nds32-memory-manipulation.c
(nds32_expand_movmemsi_loop_known_size): Refactoring implementation.
(nds32_gen_dup_4_byte_to_word_value): Rename to ...
(nds32_gen_dup_4_byte_to_word_value_aux): ... this.
(emit_setmem_word_loop): Rename to ...
(emit_setmem_doubleword_loop): ... this.
(nds32_gen_dup_4_byte_to_word_value): New function.
(nds32_gen_dup_8_byte_to_double_word_value): New function.
(nds32_expand_setmem_loop): Refine implementation.
(nds32_expand_setmem_loop_v3m): Ditto.
* config/nds32/nds32-multiple.md (unaligned_store_update_base_dw): New
pattern.

Co-Authored-By: Chung-Ju Wu <jasonwucj@gmail.com>
From-SVN: r260805

6 years ago[NDS32] Implement bswapsi2 and bswaphi2 patterns.
Chung-Ju Wu [Sun, 27 May 2018 06:52:48 +0000 (06:52 +0000)]
[NDS32] Implement bswapsi2 and bswaphi2 patterns.

gcc/
* config/nds32/nds32.md (bswapsi2, bswaphi2): New patterns.

From-SVN: r260804

6 years ago[NDS32] new attribute no_prologue and new option -mret-in-naked-func.
Chung-Ju Wu [Sun, 27 May 2018 06:46:43 +0000 (06:46 +0000)]
[NDS32] new attribute no_prologue and new option -mret-in-naked-func.

gcc/
* config/nds32/nds32.c (nds32_attribute_table): Add "no_prologue".
(nds32_init_machine_status): Initialize machine->attr_naked_p and
machine->attr_no_prologue_p.
(nds32_compute_stack_frame): Check "naked" and "no_prologue" attributes.
(nds32_naked_function_p): Handle "naked" and "no_prologue" attributes.
(nds32_expand_epilogue): Consider attr_naked_p.
(nds32_expand_epilogue_v3pop): Likewise.
(nds32_can_use_return_insn): Likewise.
* config/nds32/nds32.h (machine_function): Add attr_naked_p and
attr_no_prologue_p fields.
* config/nds32/nds32.opt (mret-in-naked-func): New option.

From-SVN: r260803

6 years agoDaily bump.
GCC Administrator [Sun, 27 May 2018 00:16:27 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r260801

6 years agore PR target/85918 (Conversions to/from [unsigned] long long are not vectorized for...
Jakub Jelinek [Sat, 26 May 2018 22:04:50 +0000 (00:04 +0200)]
re PR target/85918 (Conversions to/from [unsigned] long long are not vectorized for AVX512DQ target)

PR target/85918
* config/i386/i386.md (fixunssuffix, floatunssuffix): New code
attributes.
* config/i386/sse.md
(<floatsuffix>float<sseintvecmodelower><mode>2<mask_name><round_name>):
Rename to ...
(float<floatunssuffix><sseintvecmodelower><mode>2<mask_name><round_name>):
... this.
(<floatsuffix>float<sselongvecmodelower><mode>2<mask_name><round_name>):
Rename to ...
(float<floatunssuffix><sselongvecmodelower><mode>2<mask_name><round_name>):
... this.
(*<floatsuffix>floatv2div2sf2): Rename to ...
(*float<floatunssuffix>v2div2sf2): ... this.
(<floatsuffix>floatv2div2sf2_mask): Rename to ...
(float<floatunssuffix>v2div2sf2_mask): ... this.
(*<floatsuffix>floatv2div2sf2_mask_1): Rename to ...
(*float<floatunssuffix>v2div2sf2_mask_1): ... this.
(<fixsuffix>fix_truncv8dfv8si2<mask_name><round_saeonly_name>): Rename
to ...
(fix<fixunssuffix>_truncv8dfv8si2<mask_name><round_saeonly_name>):
... this.
(<fixsuffix>fix_trunc<mode><sseintvecmodelower>2<mask_name><round_saeonly_name>):
Rename to ...
(fix<fixunssuffix>_trunc<mode><sseintvecmodelower>2<mask_name><round_saeonly_name>):
... this.
(<fixsuffix>fix_trunc<mode><sselongvecmodelower>2<mask_name><round_saeonly_name>):
Rename to ...
(fix<fixunssuffix>_trunc<mode><sselongvecmodelower>2<mask_name><round_saeonly_name>):
... this.
(<fixsuffix>fix_truncv2sfv2di2<mask_name>): Rename to ...
(fix<fixunssuffix>_truncv2sfv2di2<mask_name>): ... this.
(vec_pack_ufix_trunc_<mode>): Use gen_fixuns_truncv8dfv8si2 instead of
gen_ufix_truncv8dfv8si2.
* config/i386/i386-builtin.def (__builtin_ia32_cvttpd2uqq256_mask,
__builtin_ia32_cvttpd2uqq128_mask, __builtin_ia32_cvttps2uqq256_mask,
__builtin_ia32_cvttps2uqq128_mask, __builtin_ia32_cvtuqq2ps256_mask,
__builtin_ia32_cvtuqq2ps128_mask, __builtin_ia32_cvtuqq2pd256_mask,
__builtin_ia32_cvtuqq2pd128_mask, __builtin_ia32_cvttpd2udq512_mask,
__builtin_ia32_cvtuqq2ps512_mask, __builtin_ia32_cvtuqq2pd512_mask,
__builtin_ia32_cvttps2uqq512_mask, __builtin_ia32_cvttpd2uqq512_mask):
Use fixuns instead ufix or floatuns instead ufloat in CODE_FOR_ names.

* gcc.target/i386/avx512dq-pr85918.c: New test.

From-SVN: r260797

6 years agoFix PR number in last commit.
Jerry DeLisle [Sat, 26 May 2018 18:28:02 +0000 (18:28 +0000)]
Fix PR number in last commit.

From-SVN: r260796

6 years agore PR target/89506 (ICE: in decompose, at rtl.h:2266 with -Og -g)
Jerry DeLisle [Sat, 26 May 2018 18:22:18 +0000 (18:22 +0000)]
re PR target/89506 (ICE: in decompose, at rtl.h:2266 with -Og -g)

2018-05-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/89506
* io/write.c (write_integer): Initialise the fnode format to
FMT_NONE, used for list directed write.
(BUF_STACK_SZ): Bump default buffer size up to avoid allocs on
small stuff.

From-SVN: r260795

6 years agoFix changelog.
Jerry DeLisle [Sat, 26 May 2018 17:32:00 +0000 (17:32 +0000)]
Fix changelog.

From-SVN: r260794

6 years agore PR fortran/85840 (Memory leak in write.c)
Jerry DeLisle [Sat, 26 May 2018 17:30:52 +0000 (17:30 +0000)]
re PR fortran/85840 (Memory leak in write.c)

2018-05-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/85840
* io/write.c (write_float_0): Use separate local variable for
the float string length.

From-SVN: r260793

6 years agoDon't check ifunc_resolver on error
H.J. Lu [Sat, 26 May 2018 11:35:31 +0000 (11:35 +0000)]
Don't check ifunc_resolver on error

Since ifunc_resolver isn't set when an error is detected, we should
lookup ifunc attribute in this case.

PR target/85900
PR target/85345
* varasm.c (assemble_alias): Lookup ifunc attribute on error.

From-SVN: r260792

6 years agore PR bootstrap/85921 (/gcc/c-family/c-warn.c fails to build)
Jakub Jelinek [Sat, 26 May 2018 06:40:50 +0000 (08:40 +0200)]
re PR bootstrap/85921 (/gcc/c-family/c-warn.c fails to build)

PR bootstrap/85921
* c-warn.c (diagnose_mismatched_attributes): Remove unnecessary
noinline variable to workaround broken kernel headers.

From-SVN: r260790

6 years agoDaily bump.
GCC Administrator [Sat, 26 May 2018 00:16:48 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r260789

6 years agoRISC-V: Add interrupt attribute support.
Jim Wilson [Fri, 25 May 2018 22:29:17 +0000 (22:29 +0000)]
RISC-V: Add interrupt attribute support.

gcc/
* config/riscv/riscv-protos.h (riscv_epilogue_uses): New.
* config/riscv/riscv.c (struct machine_function): Add
interrupt_handler_p and attribute_checked_p fields.
(riscv_attribute_table): Add interrupt.
(riscv_interrupt_type_p): New.
(riscv_save_reg_p): Save extra regs for interrupt handler.
(riscv_use_save_libcall): Return false  for interrupt handler.
(riscv_first_stack_step): Add forward declaration.
(riscv_compute_frame_info): New local interrupt_save_t1.  Set it
for interrupt handler with large frame.  Use it for saved reg list.
(riscv_expand_prologue): Move flag_stack_usage_info support to
eliminate duplication.
(riscv_expand_epilogue): Generate mret for interrupt handler.
(riscv_epilogue_uses): New.
(riscv_can_use_return_insn): Return false for interrupt handler.
(riscv_function_ok_for_sibcall): Likewise.
(riscv_set_current_function): Add interrupt handler support.
* config/riscv/riscv.h (EPILOGUE_USES): Call riscv_epilogue_uses.
* config/riscv/riscv.md (UNSPECV_MRET): New.
(GP_REGNUM): New.
(riscv_frflags, riscv_fsflags): Use tab after opcode.
(riscv_mret): New.
* doc/extend.texi (RISC-V Function Attributes) <interrupt>: New.

gcc/testsuite/
* gcc.target/riscv/interrupt-1.c: New.
* gcc.target/riscv/interrupt-2.c: New.
* gcc.target/riscv/interrupt-3.c: New.
* gcc.target/riscv/interrupt-4.c: New.
* gcc.target/riscv/interrupt-5.c: New.

From-SVN: r260785

6 years agore PR fortran/85786 (Segfault in associated intrinsic)
Steven G. Kargl [Fri, 25 May 2018 21:57:24 +0000 (21:57 +0000)]
re PR fortran/85786 (Segfault in associated intrinsic)

2018-05-25  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/85786
* gfortran.dg/pr85786.f90: New test.

From-SVN: r260783

6 years agoPR c++/85815 - reference to member of enclosing template.
Jason Merrill [Fri, 25 May 2018 21:03:07 +0000 (17:03 -0400)]
PR c++/85815 - reference to member of enclosing template.

* search.c (lookup_base): Use currently_open_class.
(lookup_member): Use it regardless of -fconcepts.
* parser.c (cp_parser_postfix_dot_deref_expression): Check it.

From-SVN: r260782

6 years agoFix test case failures for pdp11 target.
Paul Koning [Fri, 25 May 2018 20:59:28 +0000 (16:59 -0400)]
Fix test case failures for pdp11 target.

* gcc.c-torture/compile/20151204.c: Skip if pdp11.
* gcc.c-torture/compile/pr55921.c: Ditto.
* gcc.c-torture/compile/pr60655-1.c: Ditto.
* gcc.c-torture/compile/vector-align-1.c: Add max alignment if pdp11.

From-SVN: r260781

6 years agoCWG 616, 1213 - value category of subobject references.
Jason Merrill [Fri, 25 May 2018 20:55:32 +0000 (16:55 -0400)]
CWG 616, 1213 - value category of subobject references.

* tree.c (lvalue_kind): Fix handling of ARRAY_REF of pointer.

From-SVN: r260780

6 years agore PR tree-optimization/85712 (ICE in all_phi_incrs_profitable_1 at gcc/gimple-ssa...
Bill Schmidt [Fri, 25 May 2018 19:12:16 +0000 (19:12 +0000)]
re PR tree-optimization/85712 (ICE in all_phi_incrs_profitable_1 at gcc/gimple-ssa-strength-reduction.c:3479)

2018-05-25  Bill Schmidt  <wschmidt@linux.ibm.com>

PR tree-optimization/85712
* gimple-ssa-strength-reduction.c (replace_one_candidate): Skip if
this candidate has already been replaced in-situ by a copy.

From-SVN: r260772

6 years ago* inclhack.def (vxworks_iolib_include_unistd): New fix.
Rasmus Villemoes [Fri, 25 May 2018 16:51:58 +0000 (18:51 +0200)]
* inclhack.def (vxworks_iolib_include_unistd): New fix.

From-SVN: r260763

6 years agoPR c++/80485 - inline function non-zero address.
Jason Merrill [Fri, 25 May 2018 16:44:55 +0000 (12:44 -0400)]
PR c++/80485 - inline function non-zero address.

* symtab.c (nonzero_address): Check DECL_COMDAT.

From-SVN: r260762

6 years agore PR libstdc++/85768 (FreeBSD bootstrap fails due to undefined reference to 'backtrace')
François Dumont [Fri, 25 May 2018 16:40:55 +0000 (16:40 +0000)]
re PR libstdc++/85768 (FreeBSD bootstrap fails due to undefined reference to 'backtrace')

2018-05-25  François Dumont  <fdumont@gcc.gnu.org>

PR libstdc++/85768
* src/c++11/debug.cc: Remove backtrace usage.

From-SVN: r260761

6 years agore PR rtl-optimization/83628 (performance regression when accessing arrays on alpha)
Uros Bizjak [Fri, 25 May 2018 13:56:16 +0000 (15:56 +0200)]
re PR rtl-optimization/83628 (performance regression when accessing arrays on alpha)

PR target/83628
* config/alpha/alpha.md (ashlsi3): New insn pattern.
(*ashlsi_se): Rename from *ashldi_se.  Define as sign
extension of SImode operation.  Use const123_operand predicate.
(*saddsi_1): Remove.
(*saddl_se_1): Ditto.
(*ssubsi_1): Ditto.
(*ssubl_se_1): Ditto.
* config/alpha/predicates.md (const123_operand): New predicate.
* config/alpha/constraints.md (P): Use IN_RANGE.

From-SVN: r260760

6 years agotree-ssa-alias.h (refs_may_alias_p): Add tbaa_p bool parameter, defaulted to true.
Richard Biener [Fri, 25 May 2018 13:08:28 +0000 (13:08 +0000)]
tree-ssa-alias.h (refs_may_alias_p): Add tbaa_p bool parameter, defaulted to true.

2018-05-25  Richard Biener  <rguenther@suse.de>

* tree-ssa-alias.h (refs_may_alias_p): Add tbaa_p bool parameter,
defaulted to true.
(ref_maybe_used_by_stmt_p): Likewise.
(stmt_may_clobber_ref_p): Likewise.
(stmt_may_clobber_ref_p_1): Likewise.
* tree-ssa-alias.c (refs_may_alias_p): Add tbaa_p bool parameter
and pass it along.
(ref_maybe_used_by_stmt_p): Likewise.
(stmt_may_clobber_ref_p): Likewise.
(stmt_may_clobber_ref_p_1): Likewise.
* tree-vect-data-refs.c (vect_slp_analyze_node_dependences): Use
the alias oracle to disambiguate DRs with stmts DR analysis
couldn't handle.
(vect_analyze_data_refs): Do not give up on not analyzable
DRs for BB vectorization.  Remove code truncating the dataref
vector.

From-SVN: r260757

6 years agore PR target/85832 ([AVX512] possible shorter code when comparing with vector of...
Jakub Jelinek [Fri, 25 May 2018 12:36:03 +0000 (14:36 +0200)]
re PR target/85832 ([AVX512] possible shorter code when comparing with vector of zeros)

PR target/85832
* config/i386/sse.md (<avx512>_eq<mode>3<mask_scalar_merge_name>_1):
Add (=Yk,v,C) variant using vptestm insn.  Use TARGET_AVX512BW
in test instead of TARGET_AVX512F for VI12_AVX512VL iterator.

* gcc.target/i386/avx512f-pr85832.c: New test.
* gcc.target/i386/avx512vl-pr85832.c: New test.
* gcc.target/i386/avx512bw-pr85832.c: New test.
* gcc.target/i386/avx512vlbw-pr85832.c: New test.

From-SVN: r260756