From f8a27206853f8c0ed76feed9bbf77d1c598242c7 Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Tue, 25 Sep 2018 00:12:18 +0000 Subject: aarch64.c (aarch_macro_fusion_pair_p): Don't access prev before checking it for NULLness in the... 2018-09-24 Andrew Pinski * config/aarch64/aarch64.c (aarch_macro_fusion_pair_p): Don't access prev before checking it for NULLness in the AARCH64_FUSE_CMP_BRANCH case. From-SVN: r264548 --- gcc/ChangeLog | 6 ++++++ gcc/config/aarch64/aarch64.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b3d14b9..8011490 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-09-24 Andrew Pinski + + * config/aarch64/aarch64.c (aarch_macro_fusion_pair_p): Don't + access prev before checking it for NULLness in the + AARCH64_FUSE_CMP_BRANCH case. + 2018-09-24 H.J. Lu PR target/82699 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 9c68025..12f7dfe 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -16510,8 +16510,6 @@ aarch_macro_fusion_pair_p (rtx_insn *prev, rtx_insn *curr) if (aarch64_fusion_enabled_p (AARCH64_FUSE_CMP_BRANCH) && any_condjump_p (curr)) { - enum attr_type prev_type = get_attr_type (prev); - unsigned int condreg1, condreg2; rtx cc_reg_1; aarch64_fixed_condition_code_regs (&condreg1, &condreg2); @@ -16521,6 +16519,8 @@ aarch_macro_fusion_pair_p (rtx_insn *prev, rtx_insn *curr) && prev && modified_in_p (cc_reg_1, prev)) { + enum attr_type prev_type = get_attr_type (prev); + /* FIXME: this misses some which is considered simple arthematic instructions for ThunderX. Simple shifts are missed here. */ if (prev_type == TYPE_ALUS_SREG -- cgit v1.1 From 0276f2c271c114762f7eaefd6e6efd25924cd3ea Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Tue, 25 Sep 2018 00:16:39 +0000 Subject: Daily bump. From-SVN: r264552 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 89c02b0..7abc1ff 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20180924 +20180925 -- cgit v1.1 From 75902396e6dbed2a3cacb42452992db156c6f32f Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Tue, 25 Sep 2018 01:27:06 +0000 Subject: RISC-V: Fix problems with ilp32e ABI support. gcc/ PR target/87391 * config/riscv/riscv.h (STACK_BOUNDARY): Test riscv_abi == ABI_ILP32E not TARGET_RVE. (ABI_STACK_BOUNDARY, MAX_ARGS_IN_REGISTERS): Likewise. From-SVN: r264555 --- gcc/ChangeLog | 7 +++++++ gcc/config/riscv/riscv.h | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8011490..c6b3167 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-09-24 Jim Wilson + + PR target/87391 + * config/riscv/riscv.h (STACK_BOUNDARY): Test riscv_abi == ABI_ILP32E + not TARGET_RVE. + (ABI_STACK_BOUNDARY, MAX_ARGS_IN_REGISTERS): Likewise. + 2018-09-24 Andrew Pinski * config/aarch64/aarch64.c (aarch_macro_fusion_pair_p): Don't diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h index 5651d17..4bbb491 100644 --- a/gcc/config/riscv/riscv.h +++ b/gcc/config/riscv/riscv.h @@ -126,10 +126,11 @@ along with GCC; see the file COPYING3. If not see #define FUNCTION_BOUNDARY (TARGET_RVC ? 16 : 32) /* The smallest supported stack boundary the calling convention supports. */ -#define STACK_BOUNDARY (TARGET_RVE ? BITS_PER_WORD : 2 * BITS_PER_WORD) +#define STACK_BOUNDARY \ + (riscv_abi == ABI_ILP32E ? BITS_PER_WORD : 2 * BITS_PER_WORD) /* The ABI stack alignment. */ -#define ABI_STACK_BOUNDARY (TARGET_RVE ? BITS_PER_WORD : 128) +#define ABI_STACK_BOUNDARY (riscv_abi == ABI_ILP32E ? BITS_PER_WORD : 128) /* There is no point aligning anything to a rounder boundary than this. */ #define BIGGEST_ALIGNMENT 128 @@ -492,7 +493,7 @@ enum reg_class #define GP_RETURN GP_ARG_FIRST #define FP_RETURN (UNITS_PER_FP_ARG == 0 ? GP_RETURN : FP_ARG_FIRST) -#define MAX_ARGS_IN_REGISTERS (TARGET_RVE ? 6 : 8) +#define MAX_ARGS_IN_REGISTERS (riscv_abi == ABI_ILP32E ? 6 : 8) /* Symbolic macros for the first/last argument registers. */ -- cgit v1.1 From d5c4f75ddbf2994b6c462ed4b624ab5fcf23674f Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Tue, 25 Sep 2018 06:38:20 +0000 Subject: Fix EQ_ATTR_ALT size calculation (PR bootstrap/87417) "r264537: Change EQ_ATTR_ALT to support up to 64 alternatives" changed the format of EQ_ATTR_ALT from ii to ww. This broke the bootstrap on 32-bit systems, because the formula for rtx_code_size assumed that only certain codes contain HOST_WIDE_INTs. This did not surface on 64-bit systems, because rtunion is 8 bytes anyway, but on 32-bit systems it's only 4 bytes. This resulted in out-of-bounds writes and memory corruptions in genattrtab. gcc/ChangeLog: 2018-09-25 Ilya Leoshkevich PR bootstrap/87417 * rtl.c (rtx_code_size): Take into account that EQ_ATTR_ALT contains HOST_WIDE_INTs when computing its size. From-SVN: r264556 --- gcc/ChangeLog | 6 ++++++ gcc/rtl.c | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c6b3167..84f4c5a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-09-25 Ilya Leoshkevich + + PR bootstrap/87417 + * rtl.c (rtx_code_size): Take into account that EQ_ATTR_ALT + contains HOST_WIDE_INTs when computing its size. + 2018-09-24 Jim Wilson PR target/87391 diff --git a/gcc/rtl.c b/gcc/rtl.c index f9146af..ca5c25c 100644 --- a/gcc/rtl.c +++ b/gcc/rtl.c @@ -110,8 +110,7 @@ const enum rtx_class rtx_class[NUM_RTX_CODE] = { const unsigned char rtx_code_size[NUM_RTX_CODE] = { #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) \ - (((ENUM) == CONST_INT || (ENUM) == CONST_DOUBLE \ - || (ENUM) == CONST_FIXED || (ENUM) == CONST_WIDE_INT) \ + ((FORMAT)[0] == 'w' \ ? RTX_HDR_SIZE + (sizeof FORMAT - 1) * sizeof (HOST_WIDE_INT) \ : (ENUM) == REG \ ? RTX_HDR_SIZE + sizeof (reg_info) \ -- cgit v1.1 From 4cac9d00e93a40c7b19f0060b8b4f8f5b3e4d676 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 25 Sep 2018 09:08:44 +0200 Subject: Document all param values and remove defaults (PR middle-end/86078). 2018-09-25 Martin Liska PR middle-end/86078 * doc/invoke.texi: Document all parameters and remove default of the parameters. 2018-09-25 Martin Liska PR middle-end/86078 * check-params-in-docs.py: New file. From-SVN: r264558 --- gcc/ChangeLog | 6 + gcc/doc/invoke.texi | 327 +++++++++++++++++++++++++++++++++------------------- 2 files changed, 215 insertions(+), 118 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 84f4c5a..033a5fa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-09-25 Martin Liska + + PR middle-end/86078 + * doc/invoke.texi: Document all parameters and remove default + of the parameters. + 2018-09-25 Ilya Leoshkevich PR bootstrap/87417 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index abbd9ec..dba1e62 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -10428,19 +10428,22 @@ The names of specific parameters, and the meaning of the values, are tied to the internals of the compiler, and are subject to change without notice in future releases. +In order to get minimal, maximal and default value of a parameter, +one can use @option{--help=param -Q} options. + In each case, the @var{value} is an integer. The allowable choices for @var{name} are: @table @gcctabopt @item predictable-branch-outcome When branch is predicted to be taken with probability lower than this threshold -(in percent), then it is considered well predictable. The default is 10. +(in percent), then it is considered well predictable. @item max-rtl-if-conversion-insns RTL if-conversion tries to remove conditional branches around a block and replace them with conditionally executed instructions. This parameter gives the maximum number of instructions in a block which should be -considered for if-conversion. The default is 10, though the compiler will +considered for if-conversion. The compiler will also use other heuristics to decide whether if-conversion is likely to be profitable. @@ -10466,12 +10469,11 @@ probably small improvement in executable size. The minimum number of instructions that must be matched at the end of two blocks before cross-jumping is performed on them. This value is ignored in the case where all instructions in the block being -cross-jumped from are matched. The default value is 5. +cross-jumped from are matched. @item max-grow-copy-bb-insns The maximum code size expansion factor when copying basic blocks instead of jumping. The expansion is relative to a jump instruction. -The default value is 8. @item max-goto-duplication-insns The maximum number of instructions to duplicate to a block that jumps @@ -10479,7 +10481,7 @@ to a computed goto. To avoid @math{O(N^2)} behavior in a number of passes, GCC factors computed gotos early in the compilation process, and unfactors them as late as possible. Only computed jumps at the end of a basic blocks with no more than max-goto-duplication-insns are -unfactored. The default value is 8. +unfactored. @item max-delay-slot-insn-search The maximum number of instructions to consider when looking for an @@ -10506,7 +10508,7 @@ optimization is not done. @item max-gcse-insertion-ratio If the ratio of expression insertions to deletions is larger than this value for any expression, then RTL PRE inserts or removes the expression and thus -leaves partially redundant computations in the instruction stream. The default value is 20. +leaves partially redundant computations in the instruction stream. @item max-pending-list-length The maximum number of pending dependencies scheduling allows @@ -10525,7 +10527,6 @@ This number sets the maximum number of instructions (counted in GCC's internal representation) in a single function that the tree inliner considers for inlining. This only affects functions declared inline and methods implemented in a class declaration (C++). -The default value is 400. @item max-inline-insns-auto When you use @option{-finline-functions} (included in @option{-O3}), @@ -10533,14 +10534,12 @@ a lot of functions that would otherwise not be considered for inlining by the compiler are investigated. To those functions, a different (more restrictive) limit compared to functions declared inline can be applied. -The default value is 30. @item inline-min-speedup When estimated performance improvement of caller + callee runtime exceeds this threshold (in percent), the function can be inlined regardless of the limit on @option{--param max-inline-insns-single} and @option{--param max-inline-insns-auto}. -The default value is 15. @item large-function-insns The limit specifying really large functions. For functions larger than this @@ -10548,11 +10547,10 @@ limit after inlining, inlining is constrained by @option{--param large-function-growth}. This parameter is useful primarily to avoid extreme compilation time caused by non-linear algorithms used by the back end. -The default value is 2700. @item large-function-growth Specifies maximal growth of large function caused by inlining in percents. -The default value is 100 which limits large function growth to 2.0 times +For example, parameter value 100 limits large function growth to 2.0 times the original size. @item large-unit-insns @@ -10565,26 +10563,26 @@ A, the growth of unit is 300\% and yet such inlining is very sane. For very large units consisting of small inlineable functions, however, the overall unit growth limit is needed to avoid exponential explosion of code size. Thus for smaller units, the size is increased to @option{--param large-unit-insns} -before applying @option{--param inline-unit-growth}. The default is 10000. +before applying @option{--param inline-unit-growth}. @item inline-unit-growth Specifies maximal overall growth of the compilation unit caused by inlining. -The default value is 20 which limits unit growth to 1.2 times the original +For example, parameter value 20 limits unit growth to 1.2 times the original size. Cold functions (either marked cold via an attribute or by profile feedback) are not accounted into the unit size. @item ipcp-unit-growth Specifies maximal overall growth of the compilation unit caused by -interprocedural constant propagation. The default value is 10 which limits +interprocedural constant propagation. For example, parameter value 10 limits unit growth to 1.1 times the original size. @item large-stack-frame The limit specifying large stack frames. While inlining the algorithm is trying -to not grow past this limit too much. The default value is 256 bytes. +to not grow past this limit too much. @item large-stack-frame-growth Specifies maximal growth of large stack frames caused by inlining in percents. -The default value is 1000 which limits large stack frame growth to 11 times +For example, parameter value 1000 limits large stack frame growth to 11 times the original size. @item max-inline-insns-recursive @@ -10597,8 +10595,7 @@ function can grow into by performing recursive inlining. declared inline. For functions not declared inline, recursive inlining happens only when @option{-finline-functions} (included in @option{-O3}) is -enabled; @option{--param max-inline-insns-recursive-auto} applies instead. The -default value is 450. +enabled; @option{--param max-inline-insns-recursive-auto} applies instead. @item max-inline-recursive-depth @itemx max-inline-recursive-depth-auto @@ -10607,8 +10604,7 @@ Specifies the maximum recursion depth used for recursive inlining. @option{--param max-inline-recursive-depth} applies to functions declared inline. For functions not declared inline, recursive inlining happens only when @option{-finline-functions} (included in @option{-O3}) is -enabled; @option{--param max-inline-recursive-depth-auto} applies instead. The -default value is 8. +enabled; @option{--param max-inline-recursive-depth-auto} applies instead. @item min-inline-recursive-probability Recursive inlining is profitable only for function having deep recursion @@ -10620,12 +10616,10 @@ When profile feedback is available (see @option{-fprofile-generate}) the actual recursion depth can be guessed from the probability that function recurses via a given call expression. This parameter limits inlining only to call expressions whose probability exceeds the given threshold (in percents). -The default value is 10. @item early-inlining-insns Specify growth that the early inliner can make. In effect it increases the amount of inlining for code having a large abstraction penalty. -The default value is 14. @item max-early-inliner-iterations Limit of iterations of the early inliner. This basically bounds @@ -10634,20 +10628,19 @@ Deeper chains are still handled by late inlining. @item comdat-sharing-probability Probability (in percent) that C++ inline function with comdat visibility -are shared across multiple compilation units. The default value is 20. +are shared across multiple compilation units. @item profile-func-internal-id A parameter to control whether to use function internal id in profile database lookup. If the value is 0, the compiler uses an id that is based on function assembler name and filename, which makes old profile data more tolerant to source changes such as function reordering etc. -The default value is 0. @item min-vect-loop-bound The minimum number of iterations under which loops are not vectorized when @option{-ftree-vectorize} is used. The number of iterations after vectorization needs to be greater than the value specified by this option -to allow vectorization. The default value is 0. +to allow vectorization. @item gcse-cost-distance-ratio Scaling factor in calculation of maximum distance an expression @@ -10655,7 +10648,7 @@ can be moved by GCSE optimizations. This is currently supported only in the code hoisting pass. The bigger the ratio, the more aggressive code hoisting is with simple expressions, i.e., the expressions that have cost less than @option{gcse-unrestricted-cost}. Specifying 0 disables -hoisting of simple expressions. The default value is 10. +hoisting of simple expressions. @item gcse-unrestricted-cost Cost, roughly measured as the cost of a single typical machine @@ -10664,29 +10657,28 @@ the distance an expression can travel. This is currently supported only in the code hoisting pass. The lesser the cost, the more aggressive code hoisting is. Specifying 0 allows all expressions to travel unrestricted distances. -The default value is 3. @item max-hoist-depth The depth of search in the dominator tree for expressions to hoist. This is used to avoid quadratic behavior in hoisting algorithm. The value of 0 does not limit on the search, but may slow down compilation -of huge functions. The default value is 30. +of huge functions. @item max-tail-merge-comparisons The maximum amount of similar bbs to compare a bb with. This is used to -avoid quadratic behavior in tree tail merging. The default value is 10. +avoid quadratic behavior in tree tail merging. @item max-tail-merge-iterations The maximum amount of iterations of the pass over the function. This is used to -limit compilation time in tree tail merging. The default value is 2. +limit compilation time in tree tail merging. @item store-merging-allow-unaligned Allow the store merging pass to introduce unaligned stores if it is legal to -do so. The default value is 1. +do so. @item max-stores-to-merge The maximum number of stores to attempt to merge into wider stores in the store -merging pass. The minimum value is 2 and the default is 64. +merging pass. @item max-unrolled-insns The maximum number of instructions that a loop may have to be unrolled. @@ -10727,10 +10719,6 @@ The maximum number of insns of an unswitched loop. @item max-unswitch-level The maximum number of branches unswitched in a single loop. -@item max-loop-headers-insns -The maximum number of insns in loop header duplicated by the copy loop headers -pass. - @item lim-expensive The minimum cost of an expensive expression in the loop invariant motion. @@ -10808,12 +10796,10 @@ loop without bounds appears artificially cold relative to the other one. @item builtin-expect-probability Control the probability of the expression having the specified value. This parameter takes a percentage (i.e. 0 ... 100) as input. -The default probability of 90 is obtained empirically. @item builtin-string-cmp-inline-length The maximum length of a constant string for a builtin string cmp call eligible for inlining. -The default value is 3. @item align-threshold @@ -10863,27 +10849,23 @@ effective. @item stack-clash-protection-guard-size Specify the size of the operating system provided stack guard as -2 raised to @var{num} bytes. The default value is 12 (4096 bytes). -Acceptable values are between 12 and 30. Higher values may reduce the +2 raised to @var{num} bytes. Higher values may reduce the number of explicit probes, but a value larger than the operating system provided guard will leave code vulnerable to stack clash style attacks. @item stack-clash-protection-probe-interval Stack clash protection involves probing stack space as it is allocated. This param controls the maximum distance between probes into the stack as 2 raised -to @var{num} bytes. Acceptable values are between 10 and 16 and defaults to -12. Higher values may reduce the number of explicit probes, but a value +to @var{num} bytes. Higher values may reduce the number of explicit probes, but a value larger than the operating system provided guard will leave code vulnerable to stack clash style attacks. @item max-cse-path-length The maximum number of basic blocks on path that CSE considers. -The default is 10. @item max-cse-insns The maximum number of instructions CSE processes before flushing. -The default is 1000. @item ggc-min-expand @@ -10923,92 +10905,85 @@ to occur at every opportunity. The maximum number of instruction reload should look backward for equivalent register. Increasing values mean more aggressive optimization, making the compilation time increase with probably slightly better performance. -The default value is 100. @item max-cselib-memory-locations The maximum number of memory locations cselib should take into account. Increasing values mean more aggressive optimization, making the compilation time -increase with probably slightly better performance. The default value is 500. +increase with probably slightly better performance. @item max-sched-ready-insns The maximum number of instructions ready to be issued the scheduler should consider at any given time during the first scheduling pass. Increasing values mean more thorough searches, making the compilation time increase -with probably little benefit. The default value is 100. +with probably little benefit. @item max-sched-region-blocks The maximum number of blocks in a region to be considered for -interblock scheduling. The default value is 10. +interblock scheduling. @item max-pipeline-region-blocks The maximum number of blocks in a region to be considered for -pipelining in the selective scheduler. The default value is 15. +pipelining in the selective scheduler. @item max-sched-region-insns The maximum number of insns in a region to be considered for -interblock scheduling. The default value is 100. +interblock scheduling. @item max-pipeline-region-insns The maximum number of insns in a region to be considered for -pipelining in the selective scheduler. The default value is 200. +pipelining in the selective scheduler. @item min-spec-prob The minimum probability (in percents) of reaching a source block -for interblock speculative scheduling. The default value is 40. +for interblock speculative scheduling. @item max-sched-extend-regions-iters The maximum number of iterations through CFG to extend regions. -A value of 0 (the default) disables region extensions. +A value of 0 disables region extensions. @item max-sched-insn-conflict-delay The maximum conflict delay for an insn to be considered for speculative motion. -The default value is 3. @item sched-spec-prob-cutoff The minimal probability of speculation success (in percents), so that speculative insns are scheduled. -The default value is 40. @item sched-state-edge-prob-cutoff The minimum probability an edge must have for the scheduler to save its state across it. -The default value is 10. @item sched-mem-true-dep-cost Minimal distance (in CPU cycles) between store and load targeting same -memory locations. The default value is 1. +memory locations. @item selsched-max-lookahead The maximum size of the lookahead window of selective scheduling. It is a depth of search for available instructions. -The default value is 50. @item selsched-max-sched-times The maximum number of times that an instruction is scheduled during selective scheduling. This is the limit on the number of iterations -through which the instruction may be pipelined. The default value is 2. +through which the instruction may be pipelined. @item selsched-insns-to-rename The maximum number of best instructions in the ready list that are considered -for renaming in the selective scheduler. The default value is 2. +for renaming in the selective scheduler. @item sms-min-sc The minimum value of stage count that swing modulo scheduler -generates. The default value is 2. +generates. @item max-last-value-rtl The maximum size measured as number of RTLs that can be recorded in an expression -in combiner for a pseudo register as last known value of that register. The default -is 10000. +in combiner for a pseudo register as last known value of that register. @item max-combine-insns The maximum number of instructions the RTL combiner tries to combine. -The default value is 2 at @option{-Og} and 4 otherwise. @item integer-share-limit Small integer constants can use a shared data structure, reducing the compiler's memory usage and increasing its speed. This sets the maximum -value of a shared integer constant. The default value is 256. +value of a shared integer constant. @item ssp-buffer-size The minimum size of buffers (i.e.@: arrays) that receive stack smashing @@ -11016,7 +10991,7 @@ protection when @option{-fstack-protection} is used. @item min-size-for-stack-sharing The minimum size of variables taking part in stack slot sharing when not -optimizing. The default value is 32. +optimizing. @item max-jump-thread-duplication-stmts Maximum number of statements allowed in a block that needs to be @@ -11024,9 +10999,7 @@ duplicated when threading jumps. @item max-fields-for-field-sensitive Maximum number of fields in a structure treated in -a field sensitive manner during pointer analysis. The default is zero -for @option{-O0} and @option{-O1}, -and 100 for @option{-Os}, @option{-O2}, and @option{-O3}. +a field sensitive manner during pointer analysis. @item prefetch-latency Estimate on average number of instructions that are executed before @@ -11052,7 +11025,7 @@ for strides that are non-constant. In some cases this may be beneficial, though the fact the stride is non-constant may make it hard to predict when there is clear benefit to issuing these hints. -Set to 1, the default, if the prefetch hints should be issued for non-constant +Set to 1 if the prefetch hints should be issued for non-constant strides. Set to 0 if prefetch hints should be issued only for strides that are known to be constant and below @option{prefetch-minimum-stride}. @@ -11066,7 +11039,7 @@ the software prefetchers. If the hardware prefetchers have a maximum stride they can handle, it should be used here to improve the use of software prefetchers. -A value of -1, the default, means we don't have a threshold and therefore +A value of -1 means we don't have a threshold and therefore prefetch hints can be issued for any constant stride. This setting is only useful for strides that are known and constant. @@ -11086,8 +11059,8 @@ The minimum ratio between the number of instructions and the number of memory references to enable prefetching in a loop. @item use-canonical-types -Whether the compiler should use the ``canonical'' type system. By -default, this should always be 1, which uses a more efficient internal +Whether the compiler should use the ``canonical'' type system. +Should always be 1, which uses a more efficient internal mechanism for comparing types in C++ and Objective-C++. However, if bugs in the canonical type system are causing compilation failures, set this value to 0 to disable canonical types. @@ -11108,11 +11081,10 @@ which prevents the runaway behavior. Setting a value of 0 for this parameter allows an unlimited set length. @item rpo-vn-max-loop-depth -Maximum loop depth that is value-numbered optimistically. The default -maximum loop depth is three. When the limit hits the innermost +Maximum loop depth that is value-numbered optimistically. +When the limit hits the innermost @var{rpo-vn-max-loop-depth} loops and the outermost loop in the loop nest are value-numbered optimistically and the remaining ones not. -The default maximum loop depth is seven. @item sccvn-max-alias-queries-per-access Maximum number of alias-oracle queries we perform when looking for @@ -11120,14 +11092,12 @@ redundancies for loads and stores. If this limit is hit the search is aborted and the load or store is not considered redundant. The number of queries is algorithmically limited to the number of stores on all paths from the load to the function entry. -The default maximum number of queries is 1000. @item ira-max-loops-num IRA uses regional register allocation by default. If a function contains more loops than the number given by this parameter, only at most the given number of the most frequently-executed loops form regions -for regional register allocation. The default value of the -parameter is 100. +for regional register allocation. @item ira-max-conflict-table-size Although IRA uses a sophisticated algorithm to compress the conflict @@ -11136,37 +11106,33 @@ huge functions. If the conflict table for a function could be more than the size in MB given by this parameter, the register allocator instead uses a faster, simpler, and lower-quality algorithm that does not require building a pseudo-register conflict table. -The default value of the parameter is 2000. @item ira-loop-reserved-regs IRA can be used to evaluate more accurate register pressure in loops for decisions to move loop invariants (see @option{-O3}). The number of available registers reserved for some other purposes is given -by this parameter. The default value of the parameter is 2, which is -the minimal number of registers needed by typical instructions. -This value is the best found from numerous experiments. +by this parameter. Default of the parameter +is the best found from numerous experiments. @item lra-inheritance-ebb-probability-cutoff LRA tries to reuse values reloaded in registers in subsequent insns. This optimization is called inheritance. EBB is used as a region to do this optimization. The parameter defines a minimal fall-through edge probability in percentage used to add BB to inheritance EBB in -LRA. The default value of the parameter is 40. The value was chosen +LRA. The default value was chosen from numerous runs of SPEC2000 on x86-64. @item loop-invariant-max-bbs-in-loop Loop invariant motion can be very expensive, both in compilation time and in amount of needed compile-time memory, with very large loops. Loops with more basic blocks than this parameter won't have loop invariant -motion optimization performed on them. The default value of the -parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above. +motion optimization performed on them. @item loop-max-datarefs-for-datadeps Building data dependencies is expensive for very large loops. This parameter limits the number of data references in loops that are considered for data dependence analysis. These large loops are no handled by the optimizations using loop data dependencies. -The default value is 1000. @item max-vartrack-size Sets a maximum number of hash table slots to use during variable @@ -11184,14 +11150,14 @@ compilation time for more complete debug information. If this is set too low, value expressions that are available and could be represented in debug information may end up not being used; setting this higher may enable the compiler to find more complex debug expressions, but compile -time and memory use may grow. The default is 12. +time and memory use may grow. @item max-debug-marker-count Sets a threshold on the number of debug markers (e.g. begin stmt markers) to avoid complexity explosion at inlining or expanding to RTL. If a function has more such gimple stmts than the set limit, such stmts will be dropped from the inlined copy of a function, and from its RTL -expansion. The default is 100000. +expansion. @item min-nondebug-insn-uid Use uids starting at this parameter for nondebug insns. The range below @@ -11224,8 +11190,8 @@ sequence pairs. This option only applies when using @item graphite-max-nb-scop-params To avoid exponential effects in the Graphite loop transforms, the -number of parameters in a Static Control Part (SCoP) is bounded. The -default value is 10 parameters, a value of zero can be used to lift +number of parameters in a Static Control Part (SCoP) is bounded. +A value of zero can be used to lift the bound. A variable whose value is unknown at compilation time and defined outside a SCoP is a parameter of the SCoP. @@ -11234,15 +11200,7 @@ Loop blocking or strip mining transforms, enabled with @option{-floop-block} or @option{-floop-strip-mine}, strip mine each loop in the loop nest by a given number of iterations. The strip length can be changed using the @option{loop-block-tile-size} -parameter. The default value is 51 iterations. - -@item loop-unroll-jam-size -Specify the unroll factor for the @option{-floop-unroll-and-jam} option. The -default value is 4. - -@item loop-unroll-jam-depth -Specify the dimension to be unrolled (counting from the most inner loop) -for the @option{-floop-unroll-and-jam}. The default value is 2. +parameter. @item ipa-cp-value-list-size IPA-CP attempts to track all possible values and types passed to a function's @@ -11263,7 +11221,6 @@ are evaluated for cloning. Percentage penalty functions containing a single call to another function will receive when they are evaluated for cloning. - @item ipa-max-agg-items IPA-CP is also capable to propagate a number of scalar values passed in an aggregate. @option{ipa-max-agg-items} controls the maximum @@ -11291,7 +11248,6 @@ consider all memory clobbered after examining @item lto-partitions Specify desired number of partitions produced during WHOPR compilation. The number of partitions should exceed the number of CPUs used for compilation. -The default value is 32. @item lto-min-partition Size of minimal partition for WHOPR (in estimated instructions). @@ -11305,29 +11261,28 @@ Meant to be used only with balanced partitioning. @item cxx-max-namespaces-for-diagnostic-help The maximum number of namespaces to consult for suggestions when C++ -name lookup fails for an identifier. The default is 1000. +name lookup fails for an identifier. @item sink-frequency-threshold The maximum relative execution frequency (in percents) of the target block relative to a statement's original block to allow statement sinking of a statement. Larger numbers result in more aggressive statement sinking. -The default value is 75. A small positive adjustment is applied for +A small positive adjustment is applied for statements with memory operands as those are even more profitable so sink. @item max-stores-to-sink The maximum number of conditional store pairs that can be sunk. Set to 0 if either vectorization (@option{-ftree-vectorize}) or if-conversion -(@option{-ftree-loop-if-convert}) is disabled. The default is 2. +(@option{-ftree-loop-if-convert}) is disabled. @item allow-store-data-races Allow optimizers to introduce new data races on stores. -Set to 1 to allow, otherwise to 0. This option is enabled by default -at optimization level @option{-Ofast}. +Set to 1 to allow, otherwise to 0. @item case-values-threshold The smallest number of different values for which it is best to use a jump-table instead of a tree of conditional branches. If the value is -0, use the default for the machine. The default is 0. +0, use the default for the machine. @item tree-reassoc-width Set the maximum number of instructions executed in parallel in @@ -11397,32 +11352,31 @@ E.g. to disable inline code use @item use-after-scope-direct-emission-threshold If the size of a local variable in bytes is smaller or equal to this number, directly poison (or unpoison) shadow memory instead of using -run-time callbacks. The default value is 256. +run-time callbacks. @item max-fsm-thread-path-insns Maximum number of instructions to copy when duplicating blocks on a -finite state automaton jump thread path. The default is 100. +finite state automaton jump thread path. @item max-fsm-thread-length Maximum number of basic blocks on a finite state automaton jump thread -path. The default is 10. +path. @item max-fsm-thread-paths Maximum number of new jump thread paths to create for a finite state -automaton. The default is 50. +automaton. @item parloops-chunk-size -Chunk size of omp schedule for loops parallelized by parloops. The default -is 0. +Chunk size of omp schedule for loops parallelized by parloops. @item parloops-schedule Schedule type of omp schedule for loops parallelized by parloops (static, -dynamic, guided, auto, runtime). The default is static. +dynamic, guided, auto, runtime). @item parloops-min-per-thread The minimum number of iterations per thread of an innermost parallelized -loop for which the parallelized variant is prefered over the single threaded -one. The default is 100. Note that for a parallelized loop nest the +loop for which the parallelized variant is preferred over the single threaded +one. Note that for a parallelized loop nest the minimum number of iterations of the outermost loop per thread is two. @item max-ssa-name-query-depth @@ -11443,7 +11397,7 @@ we may be able to devirtualize speculatively. @item max-vrp-switch-assertions The maximum number of assertions to add along the default edge of a switch -statement during VRP. The default is 10. +statement during VRP. @item unroll-jam-min-percent The minimum percentage of memory references that must be optimized @@ -11452,6 +11406,143 @@ away for the unroll-and-jam transformation to be considered profitable. @item unroll-jam-max-unroll The maximum number of times the outer loop should be unrolled by the unroll-and-jam transformation. + +@item max-rtl-if-conversion-unpredictable-cost +Maximum permissible cost for the sequence that would be generated +by the RTL if-conversion pass for a branch that is considered unpredictable. + +@item max-variable-expansions-in-unroller +If @option{-fvariable-expansion-in-unroller} is used, the maximum number +of times that an individual variable will be expanded during loop unrolling. + +@item tracer-min-branch-probability-feedback +Stop forward growth if the probability of best edge is less than +this threshold (in percent). Used when profile feedback is available. + +@item partial-inlining-entry-probability +Maximum probability of the entry BB of split region +(in percent relative to entry BB of the function) +to make partial inlining happen. + +@item max-tracked-strlens +Maximum number of strings for which strlen optimization pass will +track string lengths. + +@item gcse-after-reload-partial-fraction +The threshold ratio for performing partial redundancy +elimination after reload. + +@item gcse-after-reload-critical-fraction +The threshold ratio of critical edges execution count that +permit performing redundancy elimination after reload. + +@item max-loop-header-insns +The maximum number of insns in loop header duplicated +by the copy loop headers pass. + +@item vect-epilogues-nomask +Enable loop epilogue vectorization using smaller vector size. + +@item slp-max-insns-in-bb +Maximum number of instructions in basic block to be +considered for SLP vectorization. + +@item avoid-fma-max-bits +Maximum number of bits for which we avoid creating FMAs. + +@item sms-loop-average-count-threshold +A threshold on the average loop count considered by the swing modulo scheduler. + +@item sms-dfa-history +The number of cycles the swing modulo scheduler considers when checking +conflicts using DFA. + +@item hot-bb-count-fraction +Select fraction of the maximal count of repetitions of basic block +in program given basic block needs +to have to be considered hot (used in non-LTO mode) + +@item max-inline-insns-recursive-auto +The maximum number of instructions non-inline function +can grow to via recursive inlining. + +@item graphite-allow-codegen-errors +Whether codegen errors should be ICEs when @option{-fchecking}. + +@item sms-max-ii-factor +A factor for tuning the upper bound that swing modulo scheduler +uses for scheduling a loop. + +@item lra-max-considered-reload-pseudos +The max number of reload pseudos which are considered during +spilling a non-reload pseudo. + +@item max-pow-sqrt-depth +Maximum depth of sqrt chains to use when synthesizing exponentiation +by a real constant. + +@item max-dse-active-local-stores +Maximum number of active local stores in RTL dead store elimination. + +@item asan-instrument-allocas +Enable asan allocas/VLAs protection. + +@item max-iterations-computation-cost +Bound on the cost of an expression to compute the number of iterations. + +@item max-isl-operations +Maximum number of isl operations, 0 means unlimited. + +@item graphite-max-arrays-per-scop +Maximum number of arrays per scop. + +@item max-vartrack-reverse-op-size +Max. size of loc list for which reverse ops should be added. + +@item unlikely-bb-count-fraction +The minimum fraction of profile runs a given basic block execution count +must be not to be considered unlikely. + +@item tracer-dynamic-coverage-feedback +The percentage of function, weighted by execution frequency, +that must be covered by trace formation. +Used when profile feedback is available. + +@item max-inline-recursive-depth-auto +The maximum depth of recursive inlining for non-inline functions. + +@item fsm-scale-path-stmts +Scale factor to apply to the number of statements in a threading path +when comparing to the number of (scaled) blocks. + +@item fsm-maximum-phi-arguments +Maximum number of arguments a PHI may have before the FSM threader +will not try to thread through its block. + +@item uninit-control-dep-attempts +Maximum number of nested calls to search for control dependencies +during uninitialized variable analysis. + +@item indir-call-topn-profile +Track top N target addresses in indirect-call profile. + +@item max-once-peeled-insns +The maximum number of insns of a peeled loop that rolls only once. + +@item sra-max-scalarization-size-Osize +Maximum size, in storage units, of an aggregate +which should be considered for scalarization when compiling for size. + +@item fsm-scale-path-blocks +Scale factor to apply to the number of blocks in a threading path +when comparing to the number of (scaled) statements. + +@item sched-autopref-queue-depth +Hardware autoprefetcher scheduler model control flag. +Number of lookahead cycles the model looks into; at ' +' only enable instruction sorting heuristic. + + @end table @end table -- cgit v1.1 From 87677ac7fbe12cd180e4a3c0ab4c209e08df98e8 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 25 Sep 2018 09:11:05 +0200 Subject: Remove Pascal-related entries in code and comments. 2018-09-25 Martin Liska * config/powerpcspe/powerpcspe.c (rs6000_output_function_epilogue): Do not handle "GNU Pascal". * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Likewise. * config/sparc/sparc.c (sparc_pass_by_reference): Remove Pascal from documentation. Likewise. * dbxout.c (dbxout_range_type): Likewise. * doc/cpp.texi: Likewise. * doc/extend.texi: Likewise. * doc/frontends.texi: Likewise. * doc/invoke.texi: Remove Pascal entry. * tree.def (CLEANUP_POINT_EXPR): Likewise. * doc/rtl.texi (MODE_FUNCTION): Remove not used entry. 2018-09-25 Martin Liska * c-common.c (c_common_truthvalue_conversion): Remove Pascal from documentation. From-SVN: r264559 --- gcc/ChangeLog | 16 ++++++++++++++++ gcc/c-family/ChangeLog | 5 +++++ gcc/c-family/c-common.c | 2 +- gcc/config/powerpcspe/powerpcspe.c | 4 +--- gcc/config/rs6000/rs6000.c | 4 +--- gcc/config/sparc/sparc.c | 5 ++--- gcc/dbxout.c | 2 +- gcc/doc/cpp.texi | 2 +- gcc/doc/extend.texi | 2 +- gcc/doc/frontends.texi | 3 +-- gcc/doc/invoke.texi | 3 --- gcc/doc/rtl.texi | 5 ----- gcc/tree.def | 17 ++++++----------- 13 files changed, 36 insertions(+), 34 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 033a5fa..d9dde59 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,21 @@ 2018-09-25 Martin Liska + * config/powerpcspe/powerpcspe.c (rs6000_output_function_epilogue): + Do not handle "GNU Pascal". + * config/rs6000/rs6000.c (rs6000_output_function_epilogue): + Likewise. + * config/sparc/sparc.c (sparc_pass_by_reference): Remove Pascal + from documentation. Likewise. + * dbxout.c (dbxout_range_type): Likewise. + * doc/cpp.texi: Likewise. + * doc/extend.texi: Likewise. + * doc/frontends.texi: Likewise. + * doc/invoke.texi: Remove Pascal entry. + * tree.def (CLEANUP_POINT_EXPR): Likewise. + * doc/rtl.texi (MODE_FUNCTION): Remove not used entry. + +2018-09-25 Martin Liska + PR middle-end/86078 * doc/invoke.texi: Document all parameters and remove default of the parameters. diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 4080bee..3b3b987 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2018-09-25 Martin Liska + + * c-common.c (c_common_truthvalue_conversion): + Remove Pascal from documentation. + 2018-09-21 Eric Botcazou * c-ada-spec.c: Include diagnostic.h. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 4bfb145..10a8bc2 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -3289,7 +3289,7 @@ c_common_truthvalue_conversion (location_t location, tree expr) tree inner = TREE_OPERAND (expr, 0); if (decl_with_nonnull_addr_p (inner)) { - /* Common Ada/Pascal programmer's mistake. */ + /* Common Ada programmer's mistake. */ warning_at (location, OPT_Waddress, "the address of %qD will always evaluate as %", diff --git a/gcc/config/powerpcspe/powerpcspe.c b/gcc/config/powerpcspe/powerpcspe.c index dea1eab..325b6ad 100644 --- a/gcc/config/powerpcspe/powerpcspe.c +++ b/gcc/config/powerpcspe/powerpcspe.c @@ -32024,7 +32024,7 @@ rs6000_output_function_epilogue (FILE *file) /* Language type. Unfortunately, there does not seem to be any official way to discover the language being compiled, so we use language_string. - C is 0. Fortran is 1. Pascal is 2. Ada is 3. C++ is 9. + C is 0. Fortran is 1. Ada is 3. C++ is 9. Java is 13. Objective-C is 14. Objective-C++ isn't assigned a number, so for now use 9. LTO, Go and JIT aren't assigned numbers either, so for now use 0. */ @@ -32036,8 +32036,6 @@ rs6000_output_function_epilogue (FILE *file) else if (! strcmp (language_string, "GNU F77") || lang_GNU_Fortran ()) i = 1; - else if (! strcmp (language_string, "GNU Pascal")) - i = 2; else if (! strcmp (language_string, "GNU Ada")) i = 3; else if (lang_GNU_CXX () diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 79dd2f6..5c7ab2b 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -28408,7 +28408,7 @@ rs6000_output_function_epilogue (FILE *file) /* Language type. Unfortunately, there does not seem to be any official way to discover the language being compiled, so we use language_string. - C is 0. Fortran is 1. Pascal is 2. Ada is 3. C++ is 9. + C is 0. Fortran is 1. Ada is 3. C++ is 9. Java is 13. Objective-C is 14. Objective-C++ isn't assigned a number, so for now use 9. LTO, Go and JIT aren't assigned numbers either, so for now use 0. */ @@ -28420,8 +28420,6 @@ rs6000_output_function_epilogue (FILE *file) else if (! strcmp (language_string, "GNU F77") || lang_GNU_Fortran ()) i = 1; - else if (! strcmp (language_string, "GNU Pascal")) - i = 2; else if (! strcmp (language_string, "GNU Ada")) i = 3; else if (lang_GNU_CXX () diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 2481fbf..42acabb 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -7516,9 +7516,8 @@ sparc_pass_by_reference (cumulative_args_t cum ATTRIBUTE_UNUSED, { if (TARGET_ARCH32) /* Original SPARC 32-bit ABI says that structures and unions, - and quad-precision floats are passed by reference. For Pascal, - also pass arrays by reference. All other base types are passed - in registers. + and quad-precision floats are passed by reference. + All base types are passed in registers. Extended ABI (as implemented by the Sun compiler) says that all complex floats are passed by reference. Pass complex integers diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 459b7c2..bf41b17 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -1715,7 +1715,7 @@ dbxout_range_type (tree type, tree low, tree high) if (TREE_TYPE (type)) dbxout_type (TREE_TYPE (type), 0); else if (TREE_CODE (type) != INTEGER_TYPE) - dbxout_type (type, 0); /* E.g. Pascal's ARRAY [BOOLEAN] of INTEGER */ + dbxout_type (type, 0); else { /* Traditionally, we made sure 'int' was type 1, and builtin types diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index efad2c8..5345574 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -194,7 +194,7 @@ will be removed, and the Makefile will not work. Having said that, you can often get away with using cpp on things which are not C@. Other Algol-ish programming languages are often safe -(Pascal, Ada, etc.) So is assembly, with caution. @option{-traditional-cpp} +(Ada, etc.) So is assembly, with caution. @option{-traditional-cpp} mode preserves more white space, and is otherwise more permissive. Many of the problems can be avoided by writing C or C++ style comments instead of native language comments, and keeping macros simple. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 7a69655..cfe6a8e 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -26,7 +26,7 @@ extensions, accepted by GCC in C90 mode and in C++. * Statement Exprs:: Putting statements and declarations inside expressions. * Local Labels:: Labels local to a block. * Labels as Values:: Getting pointers to labels, and computed gotos. -* Nested Functions:: As in Algol and Pascal, lexical scoping of functions. +* Nested Functions:: Nested function in GNU C. * Constructing Calls:: Dispatching a call to another function. * Typeof:: @code{typeof}: referring to the type of an expression. * Conditionals:: Omitting the middle operand of a @samp{?:} expression. diff --git a/gcc/doc/frontends.texi b/gcc/doc/frontends.texi index ecf1d51..dbb83ee 100644 --- a/gcc/doc/frontends.texi +++ b/gcc/doc/frontends.texi @@ -32,11 +32,10 @@ various processors. @cindex COBOL @cindex Mercury -@cindex Pascal The part of a compiler that is specific to a particular language is called the ``front end''. In addition to the front ends that are integrated components of GCC, there are several other front ends that -are maintained separately. These support languages such as Pascal, +are maintained separately. These support languages such as Mercury, and COBOL@. To use these, they must be built together with GCC proper. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index dba1e62..7ef4e7a 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1450,9 +1450,6 @@ Ada source code file containing a library unit body (a subprogram or package body). Such files are also called @dfn{bodies}. @c GCC also knows about some suffixes for languages not yet included: -@c Pascal: -@c @var{file}.p -@c @var{file}.pas @c Ratfor: @c @var{file}.r diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi index 0695ad2..463bdc6 100644 --- a/gcc/doc/rtl.texi +++ b/gcc/doc/rtl.texi @@ -1393,11 +1393,6 @@ Complex floating point modes. By default these are @code{QCmode}, @code{HCmode}, @code{SCmode}, @code{DCmode}, @code{XCmode}, and @code{TCmode}. -@findex MODE_FUNCTION -@item MODE_FUNCTION -Algol or Pascal function variables including a static chain. -(These are not currently implemented). - @findex MODE_CC @item MODE_CC Modes representing condition code values. These are @code{CCmode} plus diff --git a/gcc/tree.def b/gcc/tree.def index 49bc423..a6882d9 100644 --- a/gcc/tree.def +++ b/gcc/tree.def @@ -141,11 +141,7 @@ DEFTREECODE (BOOLEAN_TYPE, "boolean_type", tcc_type, 0) /* Integer types in all languages, including char in C. Also used for sub-ranges of other discrete types. Has components TYPE_MIN_VALUE, TYPE_MAX_VALUE (expressions, inclusive) - and TYPE_PRECISION (number of bits used by this type). - In the case of a subrange type in Pascal, the TREE_TYPE - of this will point at the supertype (another INTEGER_TYPE, - or an ENUMERAL_TYPE or BOOLEAN_TYPE). - Otherwise, the TREE_TYPE is zero. */ + and TYPE_PRECISION (number of bits used by this type). */ DEFTREECODE (INTEGER_TYPE, "integer_type", tcc_type, 0) /* C's float and double. Different floating types are distinguished @@ -200,16 +196,15 @@ DEFTREECODE (VECTOR_TYPE, "vector_type", tcc_type, 0) and holds the type to coerce a value of that array type to in C. TYPE_STRING_FLAG indicates a string (in contrast to an array of chars) in languages (such as Chill) that make a distinction. */ -/* Array types in C or Pascal */ +/* Array types in C */ DEFTREECODE (ARRAY_TYPE, "array_type", tcc_type, 0) -/* Struct in C, or record in Pascal. */ +/* Struct in C. */ /* Special fields: TYPE_FIELDS chain of FIELD_DECLs for the fields of the struct, VAR_DECLs, TYPE_DECLs and CONST_DECLs for record-scope variables, types and enumerators and FUNCTION_DECLs for methods associated - with the type. - A few may need to be added for Pascal. */ + with the type. */ /* See the comment above, before ENUMERAL_TYPE, for how forward references to struct tags are handled in C. */ DEFTREECODE (RECORD_TYPE, "record_type", tcc_type, 0) @@ -460,7 +455,7 @@ DEFTREECODE (IMAGPART_EXPR, "imagpart_expr", tcc_reference, 1) generating insns. */ DEFTREECODE (VIEW_CONVERT_EXPR, "view_convert_expr", tcc_reference, 1) -/* C unary `*' or Pascal `^'. One operand, an expression for a pointer. */ +/* C unary `*'. One operand, an expression for a pointer. */ DEFTREECODE (INDIRECT_REF, "indirect_ref", tcc_reference, 1) /* Used to represent lookup in a virtual method table which is dependent on @@ -632,7 +627,7 @@ DEFTREECODE (CLEANUP_POINT_EXPR, "cleanup_point_expr", tcc_expression, 1) object of the same type or even for one and the same object within its scope. - Record types with discriminants in Ada or schema types in Pascal are + Record types with discriminants in Ada are examples of such types. This mechanism is also used to create "fat pointers" for unconstrained array types in Ada; the fat pointer is a structure one of whose fields is a pointer to the actual array type -- cgit v1.1 From 72744f65a25d36f9cef92d3889ad3f9cb2d4b81e Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 25 Sep 2018 09:13:40 +0200 Subject: Remove unused functions and fields. 2018-09-25 Martin Liska * alias.c (set_dest_equal_p): Remove unused function. * config/i386/i386.c (def_builtin_pure2): Likewise. * diagnostic-show-locus.c (class layout): Remove unused field. (layout::layout): Likewise here. * dump-context.h (class temp_dump_context): Likewise. * dwarf2out.c (add_AT_fde_ref): Remove unused function. (add_AT_loclistsptr): Likewise. (add_AT_offset): Likewise. (get_AT_hi_pc): Likewise. (is_comdat_die): Likewise. (type_is_enum): Likewise. (ceiling): Likewise. (add_AT_vms_delta): Likewise. (is_class_die): Likewise. * edit-context.c (class line_event): Remove unused field. * graphite-sese-to-poly.c (tree_int_to_gmp): Remove unused function. * ipa-cp.c (ipa_get_vr_lat): Likewise. * lra-constraints.c (ok_for_index_p_nonstrict): Likewise. (ok_for_base_p_nonstrict): Likewise. * tree-chrec.c (is_not_constant_evolution): Likewise. (chrec_fold_poly_cst): Likewise. * tree-if-conv.c (has_pred_critical_p): Likewise. * tree-ssa-coalesce.c (print_exprs): Likewise. * tree-ssa-pre.c (bitmap_set_contains_expr): Likewise. * tree-ssa-uninit.c (is_and_or_or_p): Likewise. * tree-vrp.c (value_ranges_intersect_p): Likewise. (value_range_nonnegative_p): Likewise. 2018-09-25 Martin Liska * name-lookup.c (namespace_scope_ht_size): Remove unused function. * parser.c (cp_lexer_next_token_is_not_keyword): Likewise. 2018-09-25 Martin Liska * trans.c (remove_suffix): Remove unused function. 2018-09-25 Martin Liska * gofrontend/escape.cc (Gogo::analyze_escape): Remove usage of a parameter. (Gogo::assign_connectivity): Likewise. (class Escape_analysis_tag): Likewise. (Gogo::tag_function): Likewise. * gofrontend/expressions.cc (Call_expression::do_type): Likewise. * gofrontend/gogo.h (class Gogo): Likewise. * gofrontend/types.cc (class Call_multiple_result_type): Likewise. (Type::make_call_multiple_result_type): Likewise. * gofrontend/types.h (class Type): Likewise. * gofrontend/wb.cc (class Check_escape): Likewise. (Gogo::add_write_barriers): Likewise. From-SVN: r264561 --- gcc/ChangeLog | 32 +++++++++ gcc/alias.c | 9 --- gcc/config/i386/i386.c | 15 ----- gcc/cp/ChangeLog | 6 ++ gcc/cp/name-lookup.c | 15 ----- gcc/cp/parser.c | 8 --- gcc/diagnostic-show-locus.c | 2 - gcc/dump-context.h | 1 - gcc/dwarf2out.c | 141 --------------------------------------- gcc/edit-context.c | 3 +- gcc/fortran/ChangeLog | 5 ++ gcc/fortran/trans.c | 20 ------ gcc/go/ChangeLog | 15 +++++ gcc/go/gofrontend/escape.cc | 20 ++---- gcc/go/gofrontend/expressions.cc | 2 +- gcc/go/gofrontend/gogo.h | 2 +- gcc/go/gofrontend/types.cc | 13 ++-- gcc/go/gofrontend/types.h | 2 +- gcc/go/gofrontend/wb.cc | 10 +-- gcc/graphite-sese-to-poly.c | 8 --- gcc/ipa-cp.c | 10 --- gcc/lra-constraints.c | 27 -------- gcc/tree-chrec.c | 47 ------------- gcc/tree-if-conv.c | 13 ---- gcc/tree-ssa-coalesce.c | 16 ----- gcc/tree-ssa-pre.c | 6 -- gcc/tree-ssa-uninit.c | 10 --- gcc/tree-vrp.c | 38 ----------- 28 files changed, 76 insertions(+), 420 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d9dde59..f5dcd16 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,37 @@ 2018-09-25 Martin Liska + * alias.c (set_dest_equal_p): Remove unused function. + * config/i386/i386.c (def_builtin_pure2): Likewise. + * diagnostic-show-locus.c (class layout): Remove + unused field. + (layout::layout): Likewise here. + * dump-context.h (class temp_dump_context): Likewise. + * dwarf2out.c (add_AT_fde_ref): Remove unused function. + (add_AT_loclistsptr): Likewise. + (add_AT_offset): Likewise. + (get_AT_hi_pc): Likewise. + (is_comdat_die): Likewise. + (type_is_enum): Likewise. + (ceiling): Likewise. + (add_AT_vms_delta): Likewise. + (is_class_die): Likewise. + * edit-context.c (class line_event): Remove unused field. + * graphite-sese-to-poly.c (tree_int_to_gmp): Remove + unused function. + * ipa-cp.c (ipa_get_vr_lat): Likewise. + * lra-constraints.c (ok_for_index_p_nonstrict): Likewise. + (ok_for_base_p_nonstrict): Likewise. + * tree-chrec.c (is_not_constant_evolution): Likewise. + (chrec_fold_poly_cst): Likewise. + * tree-if-conv.c (has_pred_critical_p): Likewise. + * tree-ssa-coalesce.c (print_exprs): Likewise. + * tree-ssa-pre.c (bitmap_set_contains_expr): Likewise. + * tree-ssa-uninit.c (is_and_or_or_p): Likewise. + * tree-vrp.c (value_ranges_intersect_p): Likewise. + (value_range_nonnegative_p): Likewise. + +2018-09-25 Martin Liska + * config/powerpcspe/powerpcspe.c (rs6000_output_function_epilogue): Do not handle "GNU Pascal". * config/rs6000/rs6000.c (rs6000_output_function_epilogue): diff --git a/gcc/alias.c b/gcc/alias.c index 748da2b..7963ece 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -3270,15 +3270,6 @@ memory_modified_in_insn_p (const_rtx mem, const_rtx insn) return memory_modified; } -/* Return TRUE if the destination of a set is rtx identical to - ITEM. */ -static inline bool -set_dest_equal_p (const_rtx set, const_rtx item) -{ - rtx dest = SET_DEST (set); - return rtx_equal_p (dest, item); -} - /* Initialize the aliasing machinery. Initialize the REG_KNOWN_VALUE array. */ diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 052ca63..3d76c89 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -30221,21 +30221,6 @@ def_builtin_const2 (HOST_WIDE_INT mask, const char *name, return decl; } -/* Like def_builtin, but also marks the function decl "pure". */ - -static inline tree -def_builtin_pure2 (HOST_WIDE_INT mask, const char *name, - enum ix86_builtin_func_type tcode, enum ix86_builtins code) -{ - tree decl = def_builtin2 (mask, name, tcode, code); - if (decl) - DECL_PURE_P (decl) = 1; - else - ix86_builtins_isa[(int) code].pure_p = true; - - return decl; -} - /* Add any new builtin functions for a given ISA that may not have been declared. This saves a bit of space compared to adding all of the declarations to the tree, even if we didn't use them. */ diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6d4e93b..9ce845d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-09-25 Martin Liska + + * name-lookup.c (namespace_scope_ht_size): Remove + unused function. + * parser.c (cp_lexer_next_token_is_not_keyword): Likewise. + 2018-09-24 Paolo Carlini PR c++/85070 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index c56bfe5..95d2845 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -3291,21 +3291,6 @@ cp_binding_level_debug (cp_binding_level *scope, int line, const char *action) verbatim ("%s %s %p %d\n", action, desc, (void *) scope, line); } -/* Return the estimated initial size of the hashtable of a NAMESPACE - scope. */ - -static inline size_t -namespace_scope_ht_size (tree ns) -{ - tree name = DECL_NAME (ns); - - return name == std_identifier - ? NAMESPACE_STD_HT_SIZE - : (name == global_identifier - ? GLOBAL_SCOPE_HT_SIZE - : NAMESPACE_ORDINARY_HT_SIZE); -} - /* A chain of binding_level structures awaiting reuse. */ static GTY((deletable)) cp_binding_level *free_binding_level; diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 6e68f2c..6696f17 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -922,14 +922,6 @@ cp_lexer_nth_token_is_keyword (cp_lexer* lexer, size_t n, enum rid keyword) return cp_lexer_peek_nth_token (lexer, n)->keyword == keyword; } -/* Return true if the next token is not the indicated KEYWORD. */ - -static inline bool -cp_lexer_next_token_is_not_keyword (cp_lexer* lexer, enum rid keyword) -{ - return cp_lexer_peek_token (lexer)->keyword != keyword; -} - /* Return true if KEYWORD can start a decl-specifier. */ bool diff --git a/gcc/diagnostic-show-locus.c b/gcc/diagnostic-show-locus.c index 7dfb0a0..43a49ea 100644 --- a/gcc/diagnostic-show-locus.c +++ b/gcc/diagnostic-show-locus.c @@ -289,7 +289,6 @@ class layout private: diagnostic_context *m_context; pretty_printer *m_pp; - diagnostic_t m_diagnostic_kind; location_t m_primary_loc; expanded_location m_exploc; colorizer m_colorizer; @@ -886,7 +885,6 @@ layout::layout (diagnostic_context * context, diagnostic_t diagnostic_kind) : m_context (context), m_pp (context->printer), - m_diagnostic_kind (diagnostic_kind), m_primary_loc (richloc->get_range (0)->m_loc), m_exploc (richloc->get_expanded_location (0)), m_colorizer (context, diagnostic_kind), diff --git a/gcc/dump-context.h b/gcc/dump-context.h index 5ac9dd6..5b20c15 100644 --- a/gcc/dump-context.h +++ b/gcc/dump-context.h @@ -147,7 +147,6 @@ class temp_dump_context pretty_printer m_pp; dump_context m_context; dump_context *m_saved; - bool m_saved_flag_remarks; }; #endif /* CHECKING_P */ diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 55fcb7b..66ee839 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -3649,7 +3649,6 @@ static void add_AT_specification (dw_die_ref, dw_die_ref); static inline dw_die_ref AT_ref (dw_attr_node *); static inline int AT_ref_external (dw_attr_node *); static inline void set_AT_ref_external (dw_attr_node *, int); -static void add_AT_fde_ref (dw_die_ref, enum dwarf_attribute, unsigned); static void add_AT_loc (dw_die_ref, enum dwarf_attribute, dw_loc_descr_ref); static inline dw_loc_descr_ref AT_loc (dw_attr_node *); static void add_AT_loc_list (dw_die_ref, enum dwarf_attribute, @@ -3665,16 +3664,11 @@ static void add_AT_symview (dw_die_ref, enum dwarf_attribute, const char *); static void add_AT_lbl_id (dw_die_ref, enum dwarf_attribute, const char *); static void add_AT_lineptr (dw_die_ref, enum dwarf_attribute, const char *); static void add_AT_macptr (dw_die_ref, enum dwarf_attribute, const char *); -static void add_AT_loclistsptr (dw_die_ref, enum dwarf_attribute, - const char *); -static void add_AT_offset (dw_die_ref, enum dwarf_attribute, - unsigned HOST_WIDE_INT); static void add_AT_range_list (dw_die_ref, enum dwarf_attribute, unsigned long, bool); static inline const char *AT_lbl (dw_attr_node *); static dw_attr_node *get_AT (dw_die_ref, enum dwarf_attribute); static const char *get_AT_low_pc (dw_die_ref); -static const char *get_AT_hi_pc (dw_die_ref); static const char *get_AT_string (dw_die_ref, enum dwarf_attribute); static int get_AT_flag (dw_die_ref, enum dwarf_attribute); static unsigned get_AT_unsigned (dw_die_ref, enum dwarf_attribute); @@ -3716,7 +3710,6 @@ static int same_dw_val_p (const dw_val_node *, const dw_val_node *, int *); static int same_attr_p (dw_attr_node *, dw_attr_node *, int *); static int same_die_p (dw_die_ref, dw_die_ref, int *); static int is_type_die (dw_die_ref); -static int is_comdat_die (dw_die_ref); static inline bool is_template_instantiation (dw_die_ref); static int is_declaration_die (dw_die_ref); static int should_move_die_to_comdat (dw_die_ref); @@ -3773,7 +3766,6 @@ static int decl_quals (const_tree); static dw_die_ref modified_type_die (tree, int, bool, dw_die_ref); static dw_die_ref generic_parameter_die (tree, tree, bool, dw_die_ref); static dw_die_ref template_parameter_pack_die (tree, tree, dw_die_ref); -static int type_is_enum (const_tree); static unsigned int dbx_reg_number (const_rtx); static void add_loc_descr_op_piece (dw_loc_descr_ref *, int); static dw_loc_descr_ref reg_loc_descriptor (rtx, enum var_init_status); @@ -3796,7 +3788,6 @@ static dw_loc_list_ref loc_list_from_tree (tree, int, struct loc_descr_context *); static dw_loc_descr_ref loc_descriptor_from_tree (tree, int, struct loc_descr_context *); -static HOST_WIDE_INT ceiling (HOST_WIDE_INT, unsigned int); static tree field_type (const_tree); static unsigned int simple_type_align_in_bits (const_tree); static unsigned int simple_decl_align_in_bits (const_tree); @@ -3910,8 +3901,6 @@ static void prune_unused_types (void); static int maybe_emit_file (struct dwarf_file_data *fd); static inline const char *AT_vms_delta1 (dw_attr_node *); static inline const char *AT_vms_delta2 (dw_attr_node *); -static inline void add_AT_vms_delta (dw_die_ref, enum dwarf_attribute, - const char *, const char *); static void append_entry_to_tmpl_value_parm_die_table (dw_die_ref, tree); static void gen_remaining_tmpl_value_param_die_attribute (void); static bool generic_type_p (tree); @@ -4836,20 +4825,6 @@ set_AT_ref_external (dw_attr_node *a, int i) a->dw_attr_val.v.val_die_ref.external = i; } -/* Add an FDE reference attribute value to a DIE. */ - -static inline void -add_AT_fde_ref (dw_die_ref die, enum dwarf_attribute attr_kind, unsigned int targ_fde) -{ - dw_attr_node attr; - - attr.dw_attr = attr_kind; - attr.dw_attr_val.val_class = dw_val_class_fde_ref; - attr.dw_attr_val.val_entry = NULL; - attr.dw_attr_val.v.val_fde_index = targ_fde; - add_dwarf_attr (die, &attr); -} - /* Add a location description attribute value to a DIE. */ static inline void @@ -5160,22 +5135,6 @@ AT_file (dw_attr_node *a) return a->dw_attr_val.v.val_file; } -/* Add a vms delta attribute value to a DIE. */ - -static inline void -add_AT_vms_delta (dw_die_ref die, enum dwarf_attribute attr_kind, - const char *lbl1, const char *lbl2) -{ - dw_attr_node attr; - - attr.dw_attr = attr_kind; - attr.dw_attr_val.val_class = dw_val_class_vms_delta; - attr.dw_attr_val.val_entry = NULL; - attr.dw_attr_val.v.val_vms_delta.lbl1 = xstrdup (lbl1); - attr.dw_attr_val.v.val_vms_delta.lbl2 = xstrdup (lbl2); - add_dwarf_attr (die, &attr); -} - /* Add a symbolic view identifier attribute value to a DIE. */ static inline void @@ -5227,22 +5186,6 @@ add_AT_lineptr (dw_die_ref die, enum dwarf_attribute attr_kind, } /* Add a section offset attribute value to a DIE, an offset into the - debug_loclists section. */ - -static inline void -add_AT_loclistsptr (dw_die_ref die, enum dwarf_attribute attr_kind, - const char *label) -{ - dw_attr_node attr; - - attr.dw_attr = attr_kind; - attr.dw_attr_val.val_class = dw_val_class_loclistsptr; - attr.dw_attr_val.val_entry = NULL; - attr.dw_attr_val.v.val_lbl_id = xstrdup (label); - add_dwarf_attr (die, &attr); -} - -/* Add a section offset attribute value to a DIE, an offset into the debug_macinfo section. */ static inline void @@ -5258,21 +5201,6 @@ add_AT_macptr (dw_die_ref die, enum dwarf_attribute attr_kind, add_dwarf_attr (die, &attr); } -/* Add an offset attribute value to a DIE. */ - -static inline void -add_AT_offset (dw_die_ref die, enum dwarf_attribute attr_kind, - unsigned HOST_WIDE_INT offset) -{ - dw_attr_node attr; - - attr.dw_attr = attr_kind; - attr.dw_attr_val.val_class = dw_val_class_offset; - attr.dw_attr_val.val_entry = NULL; - attr.dw_attr_val.v.val_offset = offset; - add_dwarf_attr (die, &attr); -} - /* Add a range_list attribute value to a DIE. When using dwarf_split_debug_info, address attributes in dies destined for the final executable should be direct references--setting the parameter @@ -5383,18 +5311,6 @@ get_AT_low_pc (dw_die_ref die) return a ? AT_lbl (a) : NULL; } -/* Return the "high pc" attribute value, typically associated with a subprogram - DIE. Return null if the "high pc" attribute is either not present, or if it - cannot be represented as an assembler label identifier. */ - -static inline const char * -get_AT_hi_pc (dw_die_ref die) -{ - dw_attr_node *a = get_AT (die, DW_AT_high_pc); - - return a ? AT_lbl (a) : NULL; -} - /* Return the value of the string attribute designated by ATTR_KIND, or NULL if it is not present. */ @@ -7907,36 +7823,6 @@ is_type_die (dw_die_ref die) } } -/* Returns 1 iff C is the sort of DIE that should go into a COMDAT CU. - Basically, we want to choose the bits that are likely to be shared between - compilations (types) and leave out the bits that are specific to individual - compilations (functions). */ - -static int -is_comdat_die (dw_die_ref c) -{ - /* I think we want to leave base types and __vtbl_ptr_type in the main CU, as - we do for stabs. The advantage is a greater likelihood of sharing between - objects that don't include headers in the same order (and therefore would - put the base types in a different comdat). jason 8/28/00 */ - - if (c->die_tag == DW_TAG_base_type) - return 0; - - if (c->die_tag == DW_TAG_pointer_type - || c->die_tag == DW_TAG_reference_type - || c->die_tag == DW_TAG_rvalue_reference_type - || c->die_tag == DW_TAG_const_type - || c->die_tag == DW_TAG_volatile_type) - { - dw_die_ref t = get_AT_ref (c, DW_AT_type); - - return t ? is_comdat_die (t) : 0; - } - - return is_type_die (c); -} - /* Returns true iff C is a compile-unit DIE. */ static inline bool @@ -7965,15 +7851,6 @@ is_namespace_die (dw_die_ref c) return c && c->die_tag == DW_TAG_namespace; } -/* Returns true iff C is a class or structure DIE. */ - -static inline bool -is_class_die (dw_die_ref c) -{ - return c && (c->die_tag == DW_TAG_class_type - || c->die_tag == DW_TAG_structure_type); -} - /* Return non-zero if this DIE is a template parameter. */ static inline bool @@ -13703,15 +13580,6 @@ template_parameter_pack_die (tree parm_pack, return die; } -/* Given a pointer to an arbitrary ..._TYPE tree node, return true if it is - an enumerated type. */ - -static inline int -type_is_enum (const_tree type) -{ - return TREE_CODE (type) == ENUMERAL_TYPE; -} - /* Return the DBX register number described by a given RTL node. */ static unsigned int @@ -18933,15 +18801,6 @@ loc_descriptor_from_tree (tree loc, int want_address, return ret->expr; } -/* Given a value, round it up to the lowest multiple of `boundary' - which is not less than the value itself. */ - -static inline HOST_WIDE_INT -ceiling (HOST_WIDE_INT value, unsigned int boundary) -{ - return (((value + boundary - 1) / boundary) * boundary); -} - /* Given a pointer to what is assumed to be a FIELD_DECL node, return a pointer to the declared type for the relevant field variable, or return `integer_type_node' if the given node turns out to be an diff --git a/gcc/edit-context.c b/gcc/edit-context.c index 3cdb88d..85afc4a 100644 --- a/gcc/edit-context.c +++ b/gcc/edit-context.c @@ -182,7 +182,7 @@ class line_event { public: line_event (int start, int next, int len) : m_start (start), - m_next (next), m_delta (len - (next - start)) {} + m_delta (len - (next - start)) {} int get_effective_column (int orig_column) const { @@ -194,7 +194,6 @@ class line_event private: int m_start; - int m_next; int m_delta; }; diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5bc8856..7e1546f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2018-09-25 Martin Liska + + * trans.c (remove_suffix): Remove + unused function. + 2018-09-24 Thomas Koenig PR fortran/87397 diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index 153bab6..03dc7a2 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -61,26 +61,6 @@ gfc_advance_chain (tree t, int n) return t; } - -/* Strip off a legitimate source ending from the input - string NAME of length LEN. */ - -static inline void -remove_suffix (char *name, int len) -{ - int i; - - for (i = 2; i < 8 && len > i; i++) - { - if (name[len - i] == '.') - { - name[len - i] = '\0'; - break; - } - } -} - - /* Creates a variable declaration with a given TYPE. */ tree diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index 3512922..afb0a7d 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,18 @@ +2018-09-25 Martin Liska + + * gofrontend/escape.cc (Gogo::analyze_escape): Remove + usage of a parameter. + (Gogo::assign_connectivity): Likewise. + (class Escape_analysis_tag): Likewise. + (Gogo::tag_function): Likewise. + * gofrontend/expressions.cc (Call_expression::do_type): Likewise. + * gofrontend/gogo.h (class Gogo): Likewise. + * gofrontend/types.cc (class Call_multiple_result_type): Likewise. + (Type::make_call_multiple_result_type): Likewise. + * gofrontend/types.h (class Type): Likewise. + * gofrontend/wb.cc (class Check_escape): Likewise. + (Gogo::add_write_barriers): Likewise. + 2018-09-20 Allan Sandfeld Jensen * gospec.c (lang_specific_driver): Handle -r like -nostdlib. diff --git a/gcc/go/gofrontend/escape.cc b/gcc/go/gofrontend/escape.cc index 9c31525..d9dcc89 100644 --- a/gcc/go/gofrontend/escape.cc +++ b/gcc/go/gofrontend/escape.cc @@ -979,7 +979,7 @@ Gogo::analyze_escape() for (std::vector::iterator fn = stack.begin(); fn != stack.end(); ++fn) - this->tag_function(context, *fn); + this->tag_function(*fn); if (this->debug_escape_level() != 0) { @@ -1232,10 +1232,10 @@ Escape_analysis_loop::statement(Block*, size_t*, Statement* s) class Escape_analysis_assign : public Traverse { public: - Escape_analysis_assign(Escape_context* context, Named_object* fn) + Escape_analysis_assign(Escape_context* context) : Traverse(traverse_statements | traverse_expressions), - context_(context), fn_(fn) + context_(context) { } // Model statements within a function as assignments and flows between nodes. @@ -1272,8 +1272,6 @@ public: private: // The escape context for this set of functions. Escape_context* context_; - // The current function being analyzed. - Named_object* fn_; }; // Helper function to detect self assignment like the following. @@ -2703,7 +2701,7 @@ Gogo::assign_connectivity(Escape_context* context, Named_object* fn) int save_depth = context->loop_depth(); context->set_loop_depth(1); - Escape_analysis_assign ea(context, fn); + Escape_analysis_assign ea(context); Function::Results* res = fn->func_value()->result_variables(); if (res != NULL) { @@ -3266,17 +3264,13 @@ Gogo::propagate_escape(Escape_context* context, Node* dst) class Escape_analysis_tag { public: - Escape_analysis_tag(Escape_context* context) - : context_(context) + Escape_analysis_tag() { } // Add notes to the function's type about the escape information of its // input parameters. void tag(Named_object* fn); - - private: - Escape_context* context_; }; void @@ -3384,9 +3378,9 @@ Escape_analysis_tag::tag(Named_object* fn) // retain analysis results across imports. void -Gogo::tag_function(Escape_context* context, Named_object* fn) +Gogo::tag_function(Named_object* fn) { - Escape_analysis_tag eat(context); + Escape_analysis_tag eat; eat.tag(fn); } diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 46a1e69..91cc30e 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -10089,7 +10089,7 @@ Call_expression::do_type() else if (results->size() == 1) ret = results->begin()->type(); else - ret = Type::make_call_multiple_result_type(this); + ret = Type::make_call_multiple_result_type(); this->type_ = ret; diff --git a/gcc/go/gofrontend/gogo.h b/gcc/go/gofrontend/gogo.h index 0864ee1..07d08c2 100644 --- a/gcc/go/gofrontend/gogo.h +++ b/gcc/go/gofrontend/gogo.h @@ -680,7 +680,7 @@ class Gogo // Add notes about the escape level of a function's input and output // parameters for exporting and importing top level functions. void - tag_function(Escape_context*, Named_object*); + tag_function(Named_object*); // Reclaim memory of escape analysis Nodes. void diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index cc07bfc..ad0704c 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -5466,9 +5466,8 @@ Type::make_nil_type() class Call_multiple_result_type : public Type { public: - Call_multiple_result_type(Call_expression* call) - : Type(TYPE_CALL_MULTIPLE_RESULT), - call_(call) + Call_multiple_result_type() + : Type(TYPE_CALL_MULTIPLE_RESULT) { } protected: @@ -5501,18 +5500,14 @@ class Call_multiple_result_type : public Type void do_mangled_name(Gogo*, std::string*) const { go_assert(saw_errors()); } - - private: - // The expression being called. - Call_expression* call_; }; // Make a call result type. Type* -Type::make_call_multiple_result_type(Call_expression* call) +Type::make_call_multiple_result_type() { - return new Call_multiple_result_type(call); + return new Call_multiple_result_type(); } // Class Struct_field. diff --git a/gcc/go/gofrontend/types.h b/gcc/go/gofrontend/types.h index e011236..85e7c51 100644 --- a/gcc/go/gofrontend/types.h +++ b/gcc/go/gofrontend/types.h @@ -511,7 +511,7 @@ class Type make_nil_type(); static Type* - make_call_multiple_result_type(Call_expression*); + make_call_multiple_result_type(); static Struct_type* make_struct_type(Struct_field_list* fields, Location); diff --git a/gcc/go/gofrontend/wb.cc b/gcc/go/gofrontend/wb.cc index 4f84d99..52db710 100644 --- a/gcc/go/gofrontend/wb.cc +++ b/gcc/go/gofrontend/wb.cc @@ -189,9 +189,8 @@ Mark_address_taken::expression(Expression** pexpr) class Check_escape : public Traverse { public: - Check_escape(Gogo* gogo) - : Traverse(traverse_expressions | traverse_variables), - gogo_(gogo) + Check_escape() + : Traverse(traverse_expressions | traverse_variables) { } int @@ -199,9 +198,6 @@ class Check_escape : public Traverse int variable(Named_object*); - - private: - Gogo* gogo_; }; int @@ -621,7 +617,7 @@ Gogo::add_write_barriers() { this->propagate_writebarrierrec(); - Check_escape chk(this); + Check_escape chk; this->traverse(&chk); } diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c index 4dcc013..69898d4 100644 --- a/gcc/graphite-sese-to-poly.c +++ b/gcc/graphite-sese-to-poly.c @@ -58,14 +58,6 @@ along with GCC; see the file COPYING3. If not see #include "graphite.h" -/* Assigns to RES the value of the INTEGER_CST T. */ - -static inline void -tree_int_to_gmp (tree t, mpz_t res) -{ - wi::to_mpz (wi::to_wide (t), res, TYPE_SIGN (TREE_TYPE (t))); -} - /* Return an isl identifier for the polyhedral basic block PBB. */ static isl_id * diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index afc4596..27ae8e0 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -405,16 +405,6 @@ ipa_get_poly_ctx_lat (struct ipa_node_params *info, int i) return &plats->ctxlat; } -/* Return the lattice corresponding to the value range of the Ith formal - parameter of the function described by INFO. */ - -static inline ipcp_vr_lattice * -ipa_get_vr_lat (struct ipa_node_params *info, int i) -{ - struct ipcp_param_lattices *plats = ipa_get_parm_lattices (info, i); - return &plats->m_value_range; -} - /* Return whether LAT is a lattice with a single constant and without an undefined value. */ diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 8be4d46..774d1ff 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -630,33 +630,6 @@ get_reload_reg (enum op_type type, machine_mode mode, rtx original, } - -/* The page contains code to extract memory address parts. */ - -/* Wrapper around REGNO_OK_FOR_INDEX_P, to allow pseudos. */ -static inline bool -ok_for_index_p_nonstrict (rtx reg) -{ - unsigned regno = REGNO (reg); - - return regno >= FIRST_PSEUDO_REGISTER || REGNO_OK_FOR_INDEX_P (regno); -} - -/* A version of regno_ok_for_base_p for use here, when all pseudos - should count as OK. Arguments as for regno_ok_for_base_p. */ -static inline bool -ok_for_base_p_nonstrict (rtx reg, machine_mode mode, addr_space_t as, - enum rtx_code outer_code, enum rtx_code index_code) -{ - unsigned regno = REGNO (reg); - - if (regno >= FIRST_PSEUDO_REGISTER) - return true; - return ok_for_base_p_1 (regno, mode, as, outer_code, index_code); -} - - - /* The page contains major code to choose the current insn alternative and generate reloads for it. */ diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c index fa8c2ee..2717b40 100644 --- a/gcc/tree-chrec.c +++ b/gcc/tree-chrec.c @@ -41,53 +41,6 @@ along with GCC; see the file COPYING3. If not see /* Extended folder for chrecs. */ -/* Determines whether CST is not a constant evolution. */ - -static inline bool -is_not_constant_evolution (const_tree cst) -{ - return (TREE_CODE (cst) == POLYNOMIAL_CHREC); -} - -/* Fold CODE for a polynomial function and a constant. */ - -static inline tree -chrec_fold_poly_cst (enum tree_code code, - tree type, - tree poly, - tree cst) -{ - gcc_assert (poly); - gcc_assert (cst); - gcc_assert (TREE_CODE (poly) == POLYNOMIAL_CHREC); - gcc_checking_assert (!is_not_constant_evolution (cst)); - gcc_checking_assert (useless_type_conversion_p (type, chrec_type (poly))); - - switch (code) - { - case PLUS_EXPR: - return build_polynomial_chrec - (CHREC_VARIABLE (poly), - chrec_fold_plus (type, CHREC_LEFT (poly), cst), - CHREC_RIGHT (poly)); - - case MINUS_EXPR: - return build_polynomial_chrec - (CHREC_VARIABLE (poly), - chrec_fold_minus (type, CHREC_LEFT (poly), cst), - CHREC_RIGHT (poly)); - - case MULT_EXPR: - return build_polynomial_chrec - (CHREC_VARIABLE (poly), - chrec_fold_multiply (type, CHREC_LEFT (poly), cst), - chrec_fold_multiply (type, CHREC_RIGHT (poly), cst)); - - default: - return chrec_dont_know; - } -} - /* Fold the addition of two polynomial functions. */ static inline tree diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index 77eefac..52aa575 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -1114,19 +1114,6 @@ all_preds_critical_p (basic_block bb) return true; } -/* Returns true if at least one successor in on critical edge. */ -static inline bool -has_pred_critical_p (basic_block bb) -{ - edge e; - edge_iterator ei; - - FOR_EACH_EDGE (e, ei, bb->preds) - if (EDGE_COUNT (e->src->succs) > 1) - return true; - return false; -} - /* Return true when BB is if-convertible. This routine does not check basic block's statements and phis. diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c index c123449..a17c774 100644 --- a/gcc/tree-ssa-coalesce.c +++ b/gcc/tree-ssa-coalesce.c @@ -988,22 +988,6 @@ build_ssa_conflict_graph (tree_live_info_p liveinfo) return graph; } - -/* Shortcut routine to print messages to file F of the form: - "STR1 EXPR1 STR2 EXPR2 STR3." */ - -static inline void -print_exprs (FILE *f, const char *str1, tree expr1, const char *str2, - tree expr2, const char *str3) -{ - fprintf (f, "%s", str1); - print_generic_expr (f, expr1, TDF_SLIM); - fprintf (f, "%s", str2); - print_generic_expr (f, expr2, TDF_SLIM); - fprintf (f, "%s", str3); -} - - /* Print a failure to coalesce a MUST_COALESCE pair X and Y. */ static inline void diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 267086c..d1b0cc0 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -825,12 +825,6 @@ bitmap_set_contains_value (bitmap_set_t set, unsigned int value_id) return bitmap_bit_p (&set->values, value_id); } -static inline bool -bitmap_set_contains_expr (bitmap_set_t set, const pre_expr expr) -{ - return bitmap_bit_p (&set->expressions, get_expression_id (expr)); -} - /* Return true if two bitmap sets are equal. */ static bool diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c index f3e42dd..d2c5034 100644 --- a/gcc/tree-ssa-uninit.c +++ b/gcc/tree-ssa-uninit.c @@ -1586,16 +1586,6 @@ is_superset_of (pred_chain_union preds1, pred_chain_union preds2) return true; } -/* Returns true if TC is AND or OR. */ - -static inline bool -is_and_or_or_p (enum tree_code tc, tree type) -{ - return (tc == BIT_IOR_EXPR - || (tc == BIT_AND_EXPR - && (type == 0 || TREE_CODE (type) == BOOLEAN_TYPE))); -} - /* Returns true if X1 is the negate of X2. */ static inline bool diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index ab222a3..f95437b 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -844,27 +844,6 @@ value_inside_range (tree val, tree min, tree max) } -/* Return true if value ranges VR0 and VR1 have a non-empty - intersection. - - Benchmark compile/20001226-1.c compilation time after changing this - function. - */ - -static inline bool -value_ranges_intersect_p (const value_range *vr0, const value_range *vr1) -{ - /* The value ranges do not intersect if the maximum of the first range is - less than the minimum of the second range or vice versa. - When those relations are unknown, we can't do any better. */ - if (operand_less_p (vr0->max, vr1->min) != 0) - return false; - if (operand_less_p (vr1->max, vr0->min) != 0) - return false; - return true; -} - - /* Return TRUE if *VR includes the value zero. */ bool @@ -886,23 +865,6 @@ range_includes_zero_p (const value_range *vr) return value_inside_range (zero, vr->min, vr->max) != 0; } -/* Return true if *VR is know to only contain nonnegative values. */ - -static inline bool -value_range_nonnegative_p (const value_range *vr) -{ - /* Testing for VR_ANTI_RANGE is not useful here as any anti-range - which would return a useful value should be encoded as a - VR_RANGE. */ - if (vr->type == VR_RANGE) - { - int result = compare_values (vr->min, integer_zero_node); - return (result == 0 || result == 1); - } - - return false; -} - /* If *VR has a value rante that is a single constant value return that, otherwise return NULL_TREE. */ -- cgit v1.1 From 5433e40109e4d846c93a156160ec08edba34fed1 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 25 Sep 2018 09:13:59 +0200 Subject: Fix small coding style issues (PR fortran/87394). 2018-09-25 Martin Liska PR fortran/87394 * dbgcnt.c (dbg_cnt_process_single_pair): Return false instead of NULL. * dumpfile.c (dump_enable_all): Remove extra parenthesis. * gcov-tool.c: Declare the function with ATTRIBUTE_NORETURN. * godump.c (go_format_type): Remove extra parenthesis. 2018-09-25 Martin Liska PR fortran/87394 * decl.c (add_hidden_procptr_result): Simplify condition as we are in branch witch 'case1 || case2'. From-SVN: r264562 --- gcc/ChangeLog | 9 +++++++++ gcc/dbgcnt.c | 2 +- gcc/dumpfile.c | 4 ++-- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/decl.c | 2 +- gcc/gcov-tool.c | 2 +- gcc/godump.c | 2 +- 7 files changed, 21 insertions(+), 6 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f5dcd16..e5891f6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,14 @@ 2018-09-25 Martin Liska + PR fortran/87394 + * dbgcnt.c (dbg_cnt_process_single_pair): Return false + instead of NULL. + * dumpfile.c (dump_enable_all): Remove extra parenthesis. + * gcov-tool.c: Declare the function with ATTRIBUTE_NORETURN. + * godump.c (go_format_type): Remove extra parenthesis. + +2018-09-25 Martin Liska + * alias.c (set_dest_equal_p): Remove unused function. * config/i386/i386.c (def_builtin_pure2): Likewise. * diagnostic-show-locus.c (class layout): Remove diff --git a/gcc/dbgcnt.c b/gcc/dbgcnt.c index ddb0e8e..1eea658 100644 --- a/gcc/dbgcnt.c +++ b/gcc/dbgcnt.c @@ -138,7 +138,7 @@ dbg_cnt_process_single_pair (const char *arg) int high, low; if (value1 == NULL) - return NULL; + return false; if (value2 == NULL) { diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c index 5655e46..b4faeaa 100644 --- a/gcc/dumpfile.c +++ b/gcc/dumpfile.c @@ -1511,7 +1511,7 @@ dump_enable_all (dump_kind dkind, dump_flags_t flags, const char *filename) for (i = TDI_none + 1; i < (size_t) TDI_end; i++) { - if ((dump_files[i].dkind == dkind)) + if (dump_files[i].dkind == dkind) { const char *old_filename = dump_files[i].pfilename; dump_files[i].pstate = -1; @@ -1532,7 +1532,7 @@ dump_enable_all (dump_kind dkind, dump_flags_t flags, const char *filename) for (i = 0; i < m_extra_dump_files_in_use; i++) { - if ((m_extra_dump_files[i].dkind == dkind)) + if (m_extra_dump_files[i].dkind == dkind) { const char *old_filename = m_extra_dump_files[i].pfilename; m_extra_dump_files[i].pstate = -1; diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7e1546f..86d0a3e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 2018-09-25 Martin Liska + PR fortran/87394 + * decl.c (add_hidden_procptr_result): Simplify condition + as we are in branch witch 'case1 || case2'. + +2018-09-25 Martin Liska + * trans.c (remove_suffix): Remove unused function. diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 91a1f34..7f79811 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -6463,7 +6463,7 @@ add_hidden_procptr_result (gfc_symbol *sym) gfc_symtree *stree; if (case1) gfc_get_sym_tree ("ppr@", gfc_current_ns, &stree, false); - else if (case2) + else { gfc_symtree *st2; gfc_get_sym_tree ("ppr@", gfc_current_ns->parent, &stree, false); diff --git a/gcc/gcov-tool.c b/gcc/gcov-tool.c index 88539f9..173ed5e 100644 --- a/gcc/gcov-tool.c +++ b/gcc/gcov-tool.c @@ -438,7 +438,7 @@ static const struct option overlap_options[] = /* Print overlap usage and exit. */ -static void +static void ATTRIBUTE_NORETURN overlap_usage (void) { fnotice (stderr, "Overlap subcomand usage:"); diff --git a/gcc/godump.c b/gcc/godump.c index 88e1a77..baf21e2 100644 --- a/gcc/godump.c +++ b/gcc/godump.c @@ -961,7 +961,7 @@ go_format_type (struct godump_container *container, tree type, unions. */ if (!is_anon_substructure) { - if ((DECL_NAME (field) == NULL)) + if (DECL_NAME (field) == NULL) *p_art_i = go_append_artificial_name (ob, *p_art_i); else go_append_decl_name -- cgit v1.1 From 59d2702625fc7012c8f89511443b3318fa55dc70 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 25 Sep 2018 09:14:38 +0200 Subject: Fix scaling of a sreal number. 2018-09-25 Martin Liska * ipa-fnsummary.c (estimate_node_size_and_time): Scale by two integers and not by a float value. From-SVN: r264563 --- gcc/ChangeLog | 5 +++++ gcc/ipa-fnsummary.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e5891f6..780cf78 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2018-09-25 Martin Liska + * ipa-fnsummary.c (estimate_node_size_and_time): Scale by two + integers and not by a float value. + +2018-09-25 Martin Liska + PR fortran/87394 * dbgcnt.c (dbg_cnt_process_single_pair): Return false instead of NULL. diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c index 62095c6..9cb7d41 100644 --- a/gcc/ipa-fnsummary.c +++ b/gcc/ipa-fnsummary.c @@ -2742,7 +2742,7 @@ estimate_node_size_and_time (struct cgraph_node *node, gcc_checking_assert (time >= 0); /* nonspecialized_time should be always bigger than specialized time. Roundoff issues however may get into the way. */ - gcc_checking_assert ((nonspecialized_time - time * 0.99) >= -1); + gcc_checking_assert ((nonspecialized_time - time * 99 / 100) >= -1); /* Roundoff issues may make specialized time bigger than nonspecialized time. We do not really want that to happen because some heurstics -- cgit v1.1 From f6919d2011ed694971f54a9e3bfe63ff0fcb864c Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 25 Sep 2018 07:30:56 +0000 Subject: re PR debug/83941 (Debug info generated with -flto contains useless forwarders) 2018-09-25 Richard Biener PR debug/83941 * dwarf2out.c (struct sym_off_pair): New. (external_die_map): New global. (lookup_decl_die): When in LTO create DIEs lazily from the external_die_map. (lookup_block_die): New function, create DIEs lazily in LTO. (equate_block_to_die): New function. (dwarf2out_die_ref_for_decl): During WPA get the association from the external DIE map. (dwarf2out_register_external_die): Record mapping into the external DIE map. (maybe_create_die_with_external_ref): New function split out from DIE generation part of old dwarf2out_register_external_die. (add_abstract_origin_attribute): Do not return the DIE. When in LTO reference externals directly. (dwarf2out_abstract_function): When in LTO ignore calls for decls with external DIEs (already present abstract instances). (gen_call_site_die): Adjust. (add_high_low_attributes): Likewise. (gen_lexical_block_die): Likewise. (gen_inlined_subroutine_die): Likewie. (gen_block_die): Likewise. (dwarf2out_inline_entry): Likewise. (dwarf2out_early_finish): In LTRANS phase create DW_TAG_imported_unit DIEs. From-SVN: r264564 --- gcc/ChangeLog | 28 +++++++++ gcc/dwarf2out.c | 185 ++++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 153 insertions(+), 60 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 780cf78..61422ad 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,31 @@ +2018-09-25 Richard Biener + + PR debug/83941 + * dwarf2out.c (struct sym_off_pair): New. + (external_die_map): New global. + (lookup_decl_die): When in LTO create DIEs lazily from the + external_die_map. + (lookup_block_die): New function, create DIEs lazily in LTO. + (equate_block_to_die): New function. + (dwarf2out_die_ref_for_decl): During WPA get the association + from the external DIE map. + (dwarf2out_register_external_die): Record mapping into the + external DIE map. + (maybe_create_die_with_external_ref): New function split out from + DIE generation part of old dwarf2out_register_external_die. + (add_abstract_origin_attribute): Do not return the DIE. When + in LTO reference externals directly. + (dwarf2out_abstract_function): When in LTO ignore calls for + decls with external DIEs (already present abstract instances). + (gen_call_site_die): Adjust. + (add_high_low_attributes): Likewise. + (gen_lexical_block_die): Likewise. + (gen_inlined_subroutine_die): Likewie. + (gen_block_die): Likewise. + (dwarf2out_inline_entry): Likewise. + (dwarf2out_early_finish): In LTRANS phase create DW_TAG_imported_unit + DIEs. + 2018-09-25 Martin Liska * ipa-fnsummary.c (estimate_node_size_and_time): Scale by two diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 66ee839..6f45794 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -3822,7 +3822,7 @@ static inline void add_bit_offset_attribute (dw_die_ref, tree, struct vlr_context *); static void add_bit_size_attribute (dw_die_ref, tree); static void add_prototyped_attribute (dw_die_ref, tree); -static dw_die_ref add_abstract_origin_attribute (dw_die_ref, tree); +static void add_abstract_origin_attribute (dw_die_ref, tree); static void add_pure_or_virtual_attribute (dw_die_ref, tree); static void add_src_coords_attributes (dw_die_ref, tree); static void add_name_and_src_coords_attributes (dw_die_ref, tree, bool = false); @@ -5746,6 +5746,14 @@ equate_type_number_to_die (tree type, dw_die_ref type_die) TYPE_SYMTAB_DIE (type) = type_die; } +static dw_die_ref maybe_create_die_with_external_ref (tree); +struct GTY(()) sym_off_pair +{ + const char * GTY((skip)) sym; + unsigned HOST_WIDE_INT off; +}; +static GTY(()) hash_map *external_die_map; + /* Returns a hash value for X (which really is a die_struct). */ inline hashval_t @@ -5770,7 +5778,11 @@ lookup_decl_die (tree decl) dw_die_ref *die = decl_die_table->find_slot_with_hash (decl, DECL_UID (decl), NO_INSERT); if (!die) - return NULL; + { + if (in_lto_p) + return maybe_create_die_with_external_ref (decl); + return NULL; + } if ((*die)->removed) { decl_die_table->clear_slot (die); @@ -5780,6 +5792,27 @@ lookup_decl_die (tree decl) } +/* Return the DIE associated with BLOCK. */ + +static inline dw_die_ref +lookup_block_die (tree block) +{ + dw_die_ref die = BLOCK_DIE (block); + if (!die && in_lto_p) + return maybe_create_die_with_external_ref (block); + return die; +} + +/* Associate DIE with BLOCK. */ + +static inline void +equate_block_to_die (tree block, dw_die_ref die) +{ + BLOCK_DIE (block) = die; +} +#undef BLOCK_DIE + + /* For DECL which might have early dwarf output query a SYMBOL + OFFSET style reference. Return true if we found one refering to a DIE for DECL, otherwise return false. */ @@ -5790,32 +5823,27 @@ dwarf2out_die_ref_for_decl (tree decl, const char **sym, { dw_die_ref die; - if (in_lto_p && !decl_die_table) - return false; + if (in_lto_p) + { + /* During WPA stage and incremental linking we use a hash-map + to store the decl <-> label + offset map. */ + if (!external_die_map) + return false; + sym_off_pair *desc = external_die_map->get (decl); + if (!desc) + return false; + *sym = desc->sym; + *off = desc->off; + return true; + } if (TREE_CODE (decl) == BLOCK) - die = BLOCK_DIE (decl); + die = lookup_block_die (decl); else die = lookup_decl_die (decl); if (!die) return false; - /* During WPA stage and incremental linking we currently use DIEs - to store the decl <-> label + offset map. That's quite inefficient - but it works for now. */ - if (in_lto_p) - { - dw_die_ref ref = get_AT_ref (die, DW_AT_abstract_origin); - if (!ref) - { - gcc_assert (die == comp_unit_die ()); - return false; - } - *off = ref->die_offset; - *sym = ref->die_id.die_symbol; - return true; - } - /* Similar to get_ref_die_offset_label, but using the "correct" label. */ *off = die->die_offset; @@ -5837,6 +5865,8 @@ add_AT_external_die_ref (dw_die_ref die, enum dwarf_attribute attr_kind, { /* Create a fake DIE that contains the reference. Don't use new_die because we don't want to end up in the limbo list. */ + /* ??? We probably want to share these, thus put a ref to the DIE + we create here to the external_die_map entry. */ dw_die_ref ref = new_die_raw (die->die_tag); ref->die_id.die_symbol = IDENTIFIER_POINTER (get_identifier (symbol)); ref->die_offset = offset; @@ -5854,13 +5884,33 @@ dwarf2out_register_external_die (tree decl, const char *sym, if (debug_info_level == DINFO_LEVEL_NONE) return; - if ((flag_wpa - || flag_incremental_link == INCREMENTAL_LINK_LTO) && !decl_die_table) - decl_die_table = hash_table::create_ggc (1000); + if (!external_die_map) + external_die_map = hash_map::create_ggc (1000); + gcc_checking_assert (!external_die_map->get (decl)); + sym_off_pair p = { IDENTIFIER_POINTER (get_identifier (sym)), off }; + external_die_map->put (decl, p); +} + +/* If we have a registered external DIE for DECL return a new DIE for + the concrete instance with an appropriate abstract origin. */ + +static dw_die_ref +maybe_create_die_with_external_ref (tree decl) +{ + if (!external_die_map) + return NULL; + sym_off_pair *desc = external_die_map->get (decl); + if (!desc) + return NULL; + + const char *sym = desc->sym; + unsigned HOST_WIDE_INT off = desc->off; - dw_die_ref die - = TREE_CODE (decl) == BLOCK ? BLOCK_DIE (decl) : lookup_decl_die (decl); + in_lto_p = false; + dw_die_ref die = (TREE_CODE (decl) == BLOCK + ? lookup_block_die (decl) : lookup_decl_die (decl)); gcc_assert (!die); + in_lto_p = true; tree ctx; dw_die_ref parent = NULL; @@ -5872,7 +5922,7 @@ dwarf2out_register_external_die (tree decl, const char *sym, /* ??? We do not output DIEs for all scopes thus skip as many DIEs as needed. */ while (TREE_CODE (ctx) == BLOCK - && !BLOCK_DIE (ctx)) + && !lookup_block_die (ctx)) ctx = BLOCK_SUPERCONTEXT (ctx); } else @@ -5887,7 +5937,7 @@ dwarf2out_register_external_die (tree decl, const char *sym, if (ctx) { if (TREE_CODE (ctx) == BLOCK) - parent = BLOCK_DIE (ctx); + parent = lookup_block_die (ctx); else if (TREE_CODE (ctx) == TRANSLATION_UNIT_DECL /* Keep the 1:1 association during WPA. */ && !flag_wpa @@ -5914,18 +5964,14 @@ dwarf2out_register_external_die (tree decl, const char *sym, switch (TREE_CODE (decl)) { case TRANSLATION_UNIT_DECL: - if (! flag_wpa && flag_incremental_link != INCREMENTAL_LINK_LTO) - { - die = comp_unit_die (); - dw_die_ref import = new_die (DW_TAG_imported_unit, die, NULL_TREE); - add_AT_external_die_ref (import, DW_AT_import, sym, off); - /* We re-target all CU decls to the LTRANS CU DIE, so no need - to create a DIE for the original CUs. */ - return; - } - /* Keep the 1:1 association during WPA. */ - die = new_die (DW_TAG_compile_unit, NULL, decl); - break; + { + die = comp_unit_die (); + dw_die_ref import = new_die (DW_TAG_imported_unit, die, NULL_TREE); + add_AT_external_die_ref (import, DW_AT_import, sym, off); + /* We re-target all CU decls to the LTRANS CU DIE, so no need + to create a DIE for the original CUs. */ + return die; + } case NAMESPACE_DECL: if (is_fortran (decl)) die = new_die (DW_TAG_module, parent, decl); @@ -5957,7 +6003,7 @@ dwarf2out_register_external_die (tree decl, const char *sym, gcc_unreachable (); } if (TREE_CODE (decl) == BLOCK) - BLOCK_DIE (decl) = die; + equate_block_to_die (decl, die); else equate_decl_number_to_die (decl, die); @@ -5965,6 +6011,8 @@ dwarf2out_register_external_die (tree decl, const char *sym, /* Add a reference to the DIE providing early debug at $sym + off. */ add_AT_external_die_ref (die, DW_AT_abstract_origin, sym, off); + + return die; } /* Returns a hash value for X (which really is a var_loc_list). */ @@ -21081,28 +21129,28 @@ add_prototyped_attribute (dw_die_ref die, tree func_type) by looking in the type declaration, the object declaration equate table or the block mapping. */ -static inline dw_die_ref +static inline void add_abstract_origin_attribute (dw_die_ref die, tree origin) { dw_die_ref origin_die = NULL; if (DECL_P (origin)) { - dw_die_ref c; - origin_die = lookup_decl_die (origin); - /* "Unwrap" the decls DIE which we put in the imported unit context. - We are looking for the abstract copy here. */ + sym_off_pair *desc; if (in_lto_p - && origin_die - && (c = get_AT_ref (origin_die, DW_AT_abstract_origin)) - /* ??? Identify this better. */ - && c->with_offset) - origin_die = c; + && external_die_map + && (desc = external_die_map->get (origin))) + { + add_AT_external_die_ref (die, DW_AT_abstract_origin, + desc->sym, desc->off); + return; + } + origin_die = lookup_decl_die (origin); } else if (TYPE_P (origin)) origin_die = lookup_type_die (origin); else if (TREE_CODE (origin) == BLOCK) - origin_die = BLOCK_DIE (origin); + origin_die = lookup_block_die (origin); /* XXX: Functions that are never lowered don't always have correct block trees (in the case of java, they simply have no block tree, in some other @@ -21115,7 +21163,6 @@ add_abstract_origin_attribute (dw_die_ref die, tree origin) if (origin_die) add_AT_die_ref (die, DW_AT_abstract_origin, origin_die); - return origin_die; } /* We do not currently support the pure_virtual attribute. */ @@ -22411,6 +22458,13 @@ dwarf2out_abstract_function (tree decl) if (DECL_IGNORED_P (decl)) return; + /* Do not lazily create a DIE for decl here just because we + got called via debug_hooks->outlining_inline_function. */ + if (in_lto_p + && external_die_map + && external_die_map->get (decl)) + return; + old_die = lookup_decl_die (decl); /* With early debug we always have an old DIE unless we are in LTO and the user did not compile but only link with debug. */ @@ -22529,7 +22583,7 @@ gen_call_site_die (tree decl, dw_die_ref subr_die, && block != DECL_INITIAL (decl) && TREE_CODE (block) == BLOCK) { - stmt_die = BLOCK_DIE (block); + stmt_die = lookup_block_die (block); if (stmt_die) break; block = BLOCK_SUPERCONTEXT (block); @@ -24011,12 +24065,12 @@ add_high_low_attributes (tree stmt, dw_die_ref die) static void gen_lexical_block_die (tree stmt, dw_die_ref context_die) { - dw_die_ref old_die = BLOCK_DIE (stmt); + dw_die_ref old_die = lookup_block_die (stmt); dw_die_ref stmt_die = NULL; if (!old_die) { stmt_die = new_die (DW_TAG_lexical_block, context_die, stmt); - BLOCK_DIE (stmt) = stmt_die; + equate_block_to_die (stmt, stmt_die); } if (BLOCK_ABSTRACT (stmt)) @@ -24044,7 +24098,7 @@ gen_lexical_block_die (tree stmt, dw_die_ref context_die) if (old_die) { stmt_die = new_die (DW_TAG_lexical_block, context_die, stmt); - BLOCK_DIE (stmt) = stmt_die; + equate_block_to_die (stmt, stmt_die); old_die = NULL; } @@ -24091,7 +24145,7 @@ gen_inlined_subroutine_die (tree stmt, dw_die_ref context_die) = new_die (DW_TAG_inlined_subroutine, context_die, stmt); if (call_arg_locations || debug_inline_points) - BLOCK_DIE (stmt) = subr_die; + equate_block_to_die (stmt, subr_die); add_abstract_origin_attribute (subr_die, decl); if (TREE_ASM_WRITTEN (stmt)) add_high_low_attributes (stmt, subr_die); @@ -25591,7 +25645,7 @@ gen_block_die (tree stmt, dw_die_ref context_die) /* The outer scopes for inlinings *must* always be represented. We generate DW_TAG_inlined_subroutine DIEs for them. (See below.) */ must_output_die = 1; - else if (BLOCK_DIE (stmt)) + else if (lookup_block_die (stmt)) /* If we already have a DIE then it was filled early. Meanwhile we might have pruned all BLOCK_VARS as optimized out but we still want to generate high/low PC attributes so output it. */ @@ -27422,7 +27476,7 @@ dwarf2out_inline_entry (tree block) true)); gcc_assert (inlined_function_outer_scope_p (block)); - gcc_assert (!BLOCK_DIE (block)); + gcc_assert (!lookup_block_die (block)); if (BLOCK_FRAGMENT_ORIGIN (block)) block = BLOCK_FRAGMENT_ORIGIN (block); @@ -31846,6 +31900,17 @@ dwarf2out_early_finish (const char *filename) sure to adjust the phase after annotating the LTRANS CU DIE. */ if (in_lto_p) { + /* Force DW_TAG_imported_unit to be created now, otherwise + we might end up without it or ordered after DW_TAG_inlined_subroutine + referencing DIEs from it. */ + if (! flag_wpa && flag_incremental_link != INCREMENTAL_LINK_LTO) + { + unsigned i; + tree tu; + FOR_EACH_VEC_SAFE_ELT (all_translation_units, i, tu) + maybe_create_die_with_external_ref (tu); + } + early_dwarf_finished = true; if (dump_file) { -- cgit v1.1 From 5d6749d1f241223353cba6cb637738bb5b698756 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 25 Sep 2018 12:25:44 +0000 Subject: Check pie_enabled target in PIC tests We need to check pie_enabled target in PIC tests to support GCC where PIE is enabled by default when configured with --enable-default-pie. PR testsuite/70150 * gcc.dg/20020312-2.c (dg-additional-options): Set to "-no-pie" for pie_enabled target. * gcc.dg/uninit-19.c: Check pie_enabled for PIC. * gcc.target/i386/pr34256.c: Likewise. From-SVN: r264565 --- gcc/testsuite/ChangeLog | 8 ++++++++ gcc/testsuite/gcc.dg/20020312-2.c | 1 + gcc/testsuite/gcc.dg/uninit-19.c | 4 ++-- gcc/testsuite/gcc.target/i386/pr34256.c | 4 ++-- 4 files changed, 13 insertions(+), 4 deletions(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2243179..af269f4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2018-09-25 H.J. Lu + + PR testsuite/70150 + * gcc.dg/20020312-2.c (dg-additional-options): Set to "-no-pie" + for pie_enabled target. + * gcc.dg/uninit-19.c: Check pie_enabled for PIC. + * gcc.target/i386/pr34256.c: Likewise. + 2018-09-24 Paolo Carlini PR c++/85070 diff --git a/gcc/testsuite/gcc.dg/20020312-2.c b/gcc/testsuite/gcc.dg/20020312-2.c index f8be3ce..1a8afd8 100644 --- a/gcc/testsuite/gcc.dg/20020312-2.c +++ b/gcc/testsuite/gcc.dg/20020312-2.c @@ -7,6 +7,7 @@ /* { dg-do run } */ /* { dg-options "-O -fno-pic" } */ +/* { dg-additional-options "-no-pie" { target pie_enabled } } */ /* { dg-require-effective-target nonlocal_goto } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/uninit-19.c b/gcc/testsuite/gcc.dg/uninit-19.c index 094dc0e..3f5f06a 100644 --- a/gcc/testsuite/gcc.dg/uninit-19.c +++ b/gcc/testsuite/gcc.dg/uninit-19.c @@ -12,7 +12,7 @@ fn1 (int p1, float *f1, float *f2, float *f3, unsigned char *c1, float *f4, { if (p1 & 8) b[3] = p10[a]; - /* { dg-warning "may be used uninitialized" "" { target { { nonpic } || { hppa*64*-*-* } } } .-1 } */ + /* { dg-warning "may be used uninitialized" "" { target { { nonpic || pie_enabled } || { hppa*64*-*-* } } } .-1 } */ } void @@ -22,5 +22,5 @@ fn2 () if (l & 6) n = &c + m; fn1 (l, &d, &e, &g, &i, &h, &k, n); - /* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic } || { hppa*64*-*-* } } } } .-1 } */ + /* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic || pie_enabled } || { hppa*64*-*-* } } } } .-1 } */ } diff --git a/gcc/testsuite/gcc.target/i386/pr34256.c b/gcc/testsuite/gcc.target/i386/pr34256.c index 992312a..6987457 100644 --- a/gcc/testsuite/gcc.target/i386/pr34256.c +++ b/gcc/testsuite/gcc.target/i386/pr34256.c @@ -10,5 +10,5 @@ unsigned long long foo(__m64 m) { return _mm_cvtm64_si64(_mm_add_pi32(x, y)); } -/* { dg-final { scan-assembler-times "mov" 2 { target nonpic } } } */ -/* { dg-final { scan-assembler-times "mov" 4 { target { ! nonpic } } } } */ +/* { dg-final { scan-assembler-times "mov" 2 { target { nonpic || pie_enabled } } } } */ +/* { dg-final { scan-assembler-times "mov" 4 { target { { ! nonpic } && { ! pie_enabled } } } } } */ -- cgit v1.1 From a0d013bdc22353a1b835c5f009259ae032a6b84b Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 25 Sep 2018 12:51:57 +0000 Subject: re PR tree-optimization/87402 (ICE in set_ssa_val_to, at tree-ssa-sccvn.c:3645) 2018-09-25 Richard Biener PR tree-optimization/87402 * tree-ssa-sccvn.c (SSA_VISITED): Remove unused function. (visit_phi): Re-instantiate handling of supposed to be VARYING but non-VARYING backedge value. * gcc.dg/torture/pr87402.c: New testcase. From-SVN: r264566 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr87402.c | 33 +++++++++++++++++++++++++++++++++ gcc/tree-ssa-sccvn.c | 17 ++++++----------- 4 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr87402.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 61422ad..b81172f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2018-09-25 Richard Biener + PR tree-optimization/87402 + * tree-ssa-sccvn.c (SSA_VISITED): Remove unused function. + (visit_phi): Re-instantiate handling of supposed to be VARYING + but non-VARYING backedge value. + +2018-09-25 Richard Biener + PR debug/83941 * dwarf2out.c (struct sym_off_pair): New. (external_die_map): New global. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index af269f4..76a8a86 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-25 Richard Biener + + PR tree-optimization/87402 + * gcc.dg/torture/pr87402.c: New testcase. + 2018-09-25 H.J. Lu PR testsuite/70150 diff --git a/gcc/testsuite/gcc.dg/torture/pr87402.c b/gcc/testsuite/gcc.dg/torture/pr87402.c new file mode 100644 index 0000000..a27ac4f --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr87402.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ + +void +xl (int co) +{ + int ar = 0; + + if (ar != 0) + { + int pp, ll = 0; + int *zx; + + if (co == 0) + { + } + else + { + zx = &pp; + + if (co < 0) + while (co < 1) + { +to: + while (ll < 1) + ++ll; + } + + *zx = (__INTPTR_TYPE__)&ar; + } + } + + goto to; +} diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index cee3d73..5a05dfb 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -464,15 +464,6 @@ SSA_VAL (tree x, bool *visited = NULL) return tem && tem->visited ? tem->valnum : x; } -/* Return whether X was visited. */ - -inline bool -SSA_VISITED (tree x) -{ - vn_ssa_aux_t tem = vn_ssa_aux_hash->find_with_hash (x, SSA_NAME_VERSION (x)); - return tem && tem->visited; -} - /* Return the SSA value of the VUSE x, supporting released VDEFs during elimination which will value-number the VDEF to the associated VUSE (but not substitute in the whole lattice). */ @@ -4196,7 +4187,10 @@ visit_phi (gimple *phi, bool *inserted, bool backedges_varying_p) } } - /* If we value-number a virtual operand never value-number to the + /* If the value we want to use is flowing over the backedge and we + should take it as VARYING but it has a non-VARYING value drop to + VARYING. + If we value-number a virtual operand never value-number to the value from the backedge as that confuses the alias-walking code. See gcc.dg/torture/pr87176.c. If the value is the same on a non-backedge everything is OK though. */ @@ -4204,7 +4198,8 @@ visit_phi (gimple *phi, bool *inserted, bool backedges_varying_p) && !seen_non_backedge && TREE_CODE (backedge_val) == SSA_NAME && sameval == backedge_val - && SSA_NAME_IS_VIRTUAL_OPERAND (backedge_val)) + && (SSA_NAME_IS_VIRTUAL_OPERAND (backedge_val) + || SSA_VAL (backedge_val) != backedge_val)) /* Note this just drops to VARYING without inserting the PHI into the hashes. */ result = PHI_RESULT (phi); -- cgit v1.1 From d02c08cb15612969e3ad224111a84fb70aa1ab92 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 25 Sep 2018 15:18:06 +0200 Subject: vr-values.c (vr_values::vr_values): Initialize to_remove_edges and to_update_switch_stmts to vNULL instead of... * vr-values.c (vr_values::vr_values): Initialize to_remove_edges and to_update_switch_stmts to vNULL instead of calling create on them immediately. From-SVN: r264567 --- gcc/ChangeLog | 6 ++++++ gcc/vr-values.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b81172f..a92e935 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-09-25 Jakub Jelinek + + * vr-values.c (vr_values::vr_values): Initialize to_remove_edges and + to_update_switch_stmts to vNULL instead of calling create on them + immediately. + 2018-09-25 Richard Biener PR tree-optimization/87402 diff --git a/gcc/vr-values.c b/gcc/vr-values.c index 6b6a918..32392a1 100644 --- a/gcc/vr-values.c +++ b/gcc/vr-values.c @@ -1919,8 +1919,8 @@ vr_values::vr_values () : vrp_value_range_pool ("Tree VRP value ranges") vr_value = XCNEWVEC (value_range *, num_vr_values); vr_phi_edge_counts = XCNEWVEC (int, num_ssa_names); bitmap_obstack_initialize (&vrp_equiv_obstack); - to_remove_edges.create (10); - to_update_switch_stmts.create (5); + to_remove_edges = vNULL; + to_update_switch_stmts = vNULL; } /* Free VRP lattice. */ -- cgit v1.1 From eeefd00d9217513a47f1823f2f09111adf65d277 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 25 Sep 2018 15:21:44 +0200 Subject: coarray_lock_7.f90: Adjust scan-tree-dump-times for ILP32. * gfortran.dg/coarray_lock_7.f90: Adjust scan-tree-dump-times for ILP32. From-SVN: r264568 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/coarray_lock_7.f90 | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 76a8a86..9d37703 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-25 Jakub Jelinek + + * gfortran.dg/coarray_lock_7.f90: Adjust scan-tree-dump-times for + ILP32. + 2018-09-25 Richard Biener PR tree-optimization/87402 diff --git a/gcc/testsuite/gfortran.dg/coarray_lock_7.f90 b/gcc/testsuite/gfortran.dg/coarray_lock_7.f90 index 363fb30..1d8eb7c 100644 --- a/gcc/testsuite/gfortran.dg/coarray_lock_7.f90 +++ b/gcc/testsuite/gfortran.dg/coarray_lock_7.f90 @@ -41,6 +41,6 @@ end ! { dg-final { scan-tree-dump-times "_gfortran_caf_lock \\(three.token, 0, \\(integer\\(kind=4\\)\\) \\(5 - three.dim\\\[0\\\].lbound\\), &acquired.\[0-9\]+, 0B, 0B, 0\\);|_gfortran_caf_lock \\(three.token, 0, 5 - three.dim\\\[0\\\].lbound, &acquired.\[0-9\]+, 0B, 0B, 0\\);" 1 "original" } } ! { dg-final { scan-tree-dump-times "_gfortran_caf_unlock \\(three.token, 0, \\(integer\\(kind=4\\)\\) \\(8 - three.dim\\\[0\\\].lbound\\), &ii, 0B, 0\\);|_gfortran_caf_unlock \\(three.token, 0, 8 - three.dim\\\[0\\\].lbound, &ii, 0B, 0\\);" 1 "original" } } -! { dg-final { scan-tree-dump-times "_gfortran_caf_lock \\(four.token, .*\\(1 - four.dim\\\[0\\\].lbound\\), \\(integer\\(kind=4\\)\\) \\(7 - four.dim\\\[1\\\].lbound\\), &acquired.\[0-9\]+, &ii, 0B, 0\\);|_gfortran_caf_lock \\(four.token, 1 - four.dim\\\[0\\\].lbound, 7 - four.dim\\\[1\\\].lbound, &acquired.\[0-9\]+, &ii, 0B, 0\\);" 1 "original" } } -! { dg-final { scan-tree-dump-times "_gfortran_caf_unlock \\(four.token, .*\\(2 - four.dim\\\[0\\\].lbound\\), \\(integer\\(kind=4\\)\\) \\(8 - four.dim\\\[1\\\].lbound\\), 0B, 0B, 0\\);|_gfortran_caf_unlock \\(four.token, 2 - four.dim\\\[0\\\].lbound, 8 - four.dim\\\[1\\\].lbound, 0B, 0B, 0\\);" 1 "original" } } +! { dg-final { scan-tree-dump-times "_gfortran_caf_lock \\(four.token, .*\\(1 - four.dim\\\[0\\\].lbound\\), \\(integer\\(kind=4\\)\\) \\(7 - four.dim\\\[1\\\].lbound\\), &acquired.\[0-9\]+, &ii, 0B, 0\\);|_gfortran_caf_lock \\(four.token, \[^\n\r]*1 - four.dim\\\[0\\\].lbound\\)?, 7 - four.dim\\\[1\\\].lbound, &acquired.\[0-9\]+, &ii, 0B, 0\\);" 1 "original" } } +! { dg-final { scan-tree-dump-times "_gfortran_caf_unlock \\(four.token, .*\\(2 - four.dim\\\[0\\\].lbound\\), \\(integer\\(kind=4\\)\\) \\(8 - four.dim\\\[1\\\].lbound\\), 0B, 0B, 0\\);|_gfortran_caf_unlock \\(four.token, \[^\n\r]*2 - four.dim\\\[0\\\].lbound\\)?, 8 - four.dim\\\[1\\\].lbound, 0B, 0B, 0\\);" 1 "original" } } -- cgit v1.1 From 97b8f8679d0db4b9159e1640ff34460aaccace74 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 25 Sep 2018 13:51:45 +0000 Subject: i386: Compile pr82699-5.c and pr82699-6.c with -fno-pic Compile pr82699-5.c and pr82699-6.c with -fno-pic to avoid FAIL: gcc.target/i386/pr82699-5.c (test for excess errors) Excess errors: cc1: sorry, unimplemented: -mfentry isn't supported for 32-bit in combination with -fpic FAIL: gcc.target/i386/pr82699-6.c (test for excess errors) Excess errors: cc1: error: -mnop-mcount is not implemented for -fPIC cc1: sorry, unimplemented: -mfentry isn't supported for 32-bit in combination with -fpic when running GCC testsuite with --target_board='unix{-fpic\ -m32,-fpic}'. PR target/82699 * gcc.target/i386/pr82699-5.c: Add -fno-pic for ia32. * gcc.target/i386/pr82699-6.c: Add -fno-pic. From-SVN: r264569 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.target/i386/pr82699-5.c | 1 + gcc/testsuite/gcc.target/i386/pr82699-6.c | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9d37703..4a591bf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-09-25 H.J. Lu + + PR target/82699 + * gcc.target/i386/pr82699-5.c: Add -fno-pic for ia32. + * gcc.target/i386/pr82699-6.c: Add -fno-pic. + 2018-09-25 Jakub Jelinek * gfortran.dg/coarray_lock_7.f90: Adjust scan-tree-dump-times for diff --git a/gcc/testsuite/gcc.target/i386/pr82699-5.c b/gcc/testsuite/gcc.target/i386/pr82699-5.c index e0fe018..0c547e2 100644 --- a/gcc/testsuite/gcc.target/i386/pr82699-5.c +++ b/gcc/testsuite/gcc.target/i386/pr82699-5.c @@ -1,5 +1,6 @@ /* { dg-do compile { target *-*-linux* } } */ /* { dg-options "-O2 -fcf-protection -mfentry -fasynchronous-unwind-tables" } */ +/* { dg-additional-options "-fno-pic" { target ia32 } } */ /* { dg-final { scan-assembler-times {\t\.cfi_startproc\n\tendbr} 1 } } */ extern int bar (int); diff --git a/gcc/testsuite/gcc.target/i386/pr82699-6.c b/gcc/testsuite/gcc.target/i386/pr82699-6.c index cacf0ab..ff6bae7 100644 --- a/gcc/testsuite/gcc.target/i386/pr82699-6.c +++ b/gcc/testsuite/gcc.target/i386/pr82699-6.c @@ -1,5 +1,5 @@ /* { dg-do compile { target *-*-linux* } } */ -/* { dg-options "-O2 -fcf-protection -pg -mfentry -mrecord-mcount -mnop-mcount -fasynchronous-unwind-tables" } */ +/* { dg-options "-fno-pic -O2 -fcf-protection -pg -mfentry -mrecord-mcount -mnop-mcount -fasynchronous-unwind-tables" } */ /* { dg-final { scan-assembler-times {\t\.cfi_startproc\n\tendbr} 1 } } */ extern int bar (int); -- cgit v1.1 From b16084d244418d5421505f09851b5adf5abc35ec Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 25 Sep 2018 14:16:32 +0000 Subject: cmd/go: pass down testing gccgo in TestScript This permits TestScript to work when gccgo is not installed. Previous testing was using a previously installed gccgo, not the newly built one. This revealed that the testing of whether an internal package is permitted was incorrect for standard library packages, since the uninstalled gccgo can see internal packages in the uninstalled libgo. Fix the internal package tests. This permitted removing a couple of gccgo-specific changes in the testsuite. Reviewed-on: https://go-review.googlesource.com/137255 From-SVN: r264570 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 175db5d..65693ff 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -7b25b4dff4778fc4d6b5d6e10594814146b3e5dd +1dbc5b805a1665079008d1ce341991c3554c1eeb The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.1 From be2df8bc38a14659f6a5604c22252f17ef2a2a6c Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Tue, 25 Sep 2018 16:26:11 +0200 Subject: i386.md (frndintxf2_mask_pm): Remove. * config/i386/i386.md (frndintxf2_mask_pm): Remove. (frndintxf2_mask_pm_i387): Ditto. (nearbyintxf2): Rewrite expander pattern to match rintxf2. Enable for !flag_trapping_math. (nearbyint2): Enable x87 modes for !flag_trapping_math. Enable SSE modes for TARGET_SSE4_1 and expand them with round insn. Change operand 1 predicate to nonimmediate_operand. (attr "i387_cw"): Remove mask_pm. * config/i386/i386.h (enum ix86_stack_slot): Remove SLOT_CW_MASK_PM. (enum ix86_entity): Remove I387_MASK_PM. * config/i386/i386.c (ix86_i387_mode_needed): Do not handle I387_MASK_PM. (ix86_mode_needed): Ditto. (ix86_mode_after): Ditto. (ix86_mode_entry): Ditto. (ix86_mode_exit): Ditto. (emit_i387_cw_initialization): Do not handle I387_CW_MASK_PM. From-SVN: r264571 --- gcc/ChangeLog | 20 +++++++++++++ gcc/config/i386/i386.c | 16 ---------- gcc/config/i386/i386.h | 2 -- gcc/config/i386/i386.md | 79 ++++++++++++++----------------------------------- gcc/reg-stack.c | 1 - 5 files changed, 43 insertions(+), 75 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a92e935..b9e6ec2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,23 @@ +2018-09-25 Uros Bizjak + + * config/i386/i386.md (frndintxf2_mask_pm): Remove. + (frndintxf2_mask_pm_i387): Ditto. + (nearbyintxf2): Rewrite expander pattern to match rintxf2. + Enable for !flag_trapping_math. + (nearbyint2): Enable x87 modes for !flag_trapping_math. + Enable SSE modes for TARGET_SSE4_1 and expand them with round insn. + Change operand 1 predicate to nonimmediate_operand. + (attr "i387_cw"): Remove mask_pm. + * config/i386/i386.h (enum ix86_stack_slot): Remove SLOT_CW_MASK_PM. + (enum ix86_entity): Remove I387_MASK_PM. + * config/i386/i386.c (ix86_i387_mode_needed): Do not + handle I387_MASK_PM. + (ix86_mode_needed): Ditto. + (ix86_mode_after): Ditto. + (ix86_mode_entry): Ditto. + (ix86_mode_exit): Ditto. + (emit_i387_cw_initialization): Do not handle I387_CW_MASK_PM. + 2018-09-25 Jakub Jelinek * vr-values.c (vr_values::vr_values): Initialize to_remove_edges and diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 3d76c89..6c7da3d 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -18880,11 +18880,6 @@ ix86_i387_mode_needed (int entity, rtx_insn *insn) return mode; break; - case I387_MASK_PM: - if (mode == I387_CW_MASK_PM) - return mode; - break; - default: gcc_unreachable (); } @@ -18907,7 +18902,6 @@ ix86_mode_needed (int entity, rtx_insn *insn) case I387_TRUNC: case I387_FLOOR: case I387_CEIL: - case I387_MASK_PM: return ix86_i387_mode_needed (entity, insn); default: gcc_unreachable (); @@ -18968,7 +18962,6 @@ ix86_mode_after (int entity, int mode, rtx_insn *insn) case I387_TRUNC: case I387_FLOOR: case I387_CEIL: - case I387_MASK_PM: return mode; default: gcc_unreachable (); @@ -19021,7 +19014,6 @@ ix86_mode_entry (int entity) case I387_TRUNC: case I387_FLOOR: case I387_CEIL: - case I387_MASK_PM: return I387_CW_ANY; default: gcc_unreachable (); @@ -19056,7 +19048,6 @@ ix86_mode_exit (int entity) case I387_TRUNC: case I387_FLOOR: case I387_CEIL: - case I387_MASK_PM: return I387_CW_ANY; default: gcc_unreachable (); @@ -19108,12 +19099,6 @@ emit_i387_cw_initialization (int mode) slot = SLOT_CW_CEIL; break; - case I387_CW_MASK_PM: - /* mask precision exception for nearbyint() */ - emit_insn (gen_iorhi3 (reg, reg, GEN_INT (0x0020))); - slot = SLOT_CW_MASK_PM; - break; - default: gcc_unreachable (); } @@ -19169,7 +19154,6 @@ ix86_emit_mode_set (int entity, int mode, int prev_mode ATTRIBUTE_UNUSED, case I387_TRUNC: case I387_FLOOR: case I387_CEIL: - case I387_MASK_PM: if (mode != I387_CW_ANY && mode != I387_CW_UNINITIALIZED) emit_i387_cw_initialization (mode); diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index e77dac7..b68fc80 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2456,7 +2456,6 @@ enum ix86_stack_slot SLOT_CW_TRUNC, SLOT_CW_FLOOR, SLOT_CW_CEIL, - SLOT_CW_MASK_PM, SLOT_STV_TEMP, MAX_386_STACK_LOCALS }; @@ -2468,7 +2467,6 @@ enum ix86_entity I387_TRUNC, I387_FLOOR, I387_CEIL, - I387_MASK_PM, MAX_386_ENTITIES }; diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index e08b2b7..75e2edb 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -144,7 +144,6 @@ UNSPEC_FRNDINT_FLOOR UNSPEC_FRNDINT_CEIL UNSPEC_FRNDINT_TRUNC - UNSPEC_FRNDINT_MASK_PM UNSPEC_FIST_FLOOR UNSPEC_FIST_CEIL @@ -775,7 +774,7 @@ ;; Defines rounding mode of an FP operation. -(define_attr "i387_cw" "trunc,floor,ceil,mask_pm,uninitialized,any" +(define_attr "i387_cw" "trunc,floor,ceil,uninitialized,any" (const_string "any")) ;; Define attribute to classify add/sub insns that consumes carry flag (CF) @@ -16341,67 +16340,35 @@ DONE; }) -;; Rounding mode control word calculation could clobber FLAGS_REG. -(define_insn_and_split "frndintxf2_mask_pm" +(define_expand "nearbyintxf2" [(set (match_operand:XF 0 "register_operand") (unspec:XF [(match_operand:XF 1 "register_operand")] - UNSPEC_FRNDINT_MASK_PM)) - (clobber (reg:CC FLAGS_REG))] - "TARGET_USE_FANCY_MATH_387 - && flag_unsafe_math_optimizations - && can_create_pseudo_p ()" - "#" - "&& 1" - [(const_int 0)] -{ - ix86_optimize_mode_switching[I387_MASK_PM] = 1; - - operands[2] = assign_386_stack_local (HImode, SLOT_CW_STORED); - operands[3] = assign_386_stack_local (HImode, SLOT_CW_MASK_PM); - - emit_insn (gen_frndintxf2_mask_pm_i387 (operands[0], operands[1], - operands[2], operands[3])); - DONE; -} - [(set_attr "type" "frndint") - (set_attr "i387_cw" "mask_pm") - (set_attr "mode" "XF")]) - -(define_insn "frndintxf2_mask_pm_i387" - [(set (match_operand:XF 0 "register_operand" "=f") - (unspec:XF [(match_operand:XF 1 "register_operand" "0")] - UNSPEC_FRNDINT_MASK_PM)) - (use (match_operand:HI 2 "memory_operand" "m")) - (use (match_operand:HI 3 "memory_operand" "m"))] - "TARGET_USE_FANCY_MATH_387 - && flag_unsafe_math_optimizations" - "fldcw\t%3\n\tfrndint\n\tfclex\n\tfldcw\t%2" - [(set_attr "type" "frndint") - (set_attr "i387_cw" "mask_pm") - (set_attr "mode" "XF")]) - -(define_expand "nearbyintxf2" - [(parallel [(set (match_operand:XF 0 "register_operand") - (unspec:XF [(match_operand:XF 1 "register_operand")] - UNSPEC_FRNDINT_MASK_PM)) - (clobber (reg:CC FLAGS_REG))])] + UNSPEC_FRNDINT))] "TARGET_USE_FANCY_MATH_387 - && flag_unsafe_math_optimizations") + && !flag_trapping_math") (define_expand "nearbyint2" [(use (match_operand:MODEF 0 "register_operand")) - (use (match_operand:MODEF 1 "register_operand"))] - "TARGET_USE_FANCY_MATH_387 - && (!(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH) - || TARGET_MIX_SSE_I387) - && flag_unsafe_math_optimizations" -{ - rtx op0 = gen_reg_rtx (XFmode); - rtx op1 = gen_reg_rtx (XFmode); + (use (match_operand:MODEF 1 "nonimmediate_operand"))] + "(TARGET_USE_FANCY_MATH_387 + && (!(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH) + || TARGET_MIX_SSE_I387) + && !flag_trapping_math) + || (TARGET_SSE4_1 && TARGET_SSE_MATH)" +{ + if (TARGET_SSE4_1 && TARGET_SSE_MATH) + emit_insn (gen_sse4_1_round2 + (operands[0], operands[1], GEN_INT (ROUND_MXCSR + | ROUND_NO_EXC))); + else + { + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); - emit_insn (gen_extendxf2 (op1, operands[1])); - emit_insn (gen_frndintxf2_mask_pm (op0, op1)); - emit_insn (gen_truncxf2 (operands[0], op0)); + emit_insn (gen_extendxf2 (op1, operands[1])); + emit_insn (gen_nearbyintxf2 (op0, op1)); + emit_insn (gen_truncxf2_i387_noop_unspec (operands[0], op0)); + } DONE; }) diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 97d758c..8b45ecf 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -1818,7 +1818,6 @@ subst_stack_regs_pat (rtx_insn *insn, stack_ptr regstack, rtx pat) case UNSPEC_FRNDINT_FLOOR: case UNSPEC_FRNDINT_CEIL: case UNSPEC_FRNDINT_TRUNC: - case UNSPEC_FRNDINT_MASK_PM: /* Above insns operate on the top of the stack. */ -- cgit v1.1 From f5ec13f15ddaa6dc61b81d5c14cd8b30df896b40 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 25 Sep 2018 14:31:57 +0000 Subject: internal/bytealg, internal/cpu, internal/poll: portability fixes In internal/bytealg correct a +build tag to never build indexbyte_generic.go for the gofrontend, where we always use indexbyte_native.go. For internal/cpu let the Makefile define CacheLineSize using goarch.sh, rather than trying to enumerate all the possibilities in cpu_ARCH.go files. In internal/poll call the C fcntl function rather than using SYS_FCNTL. Change mksysinfo.sh to ensure that F_GETPIPE_SZ is always defined, and check that in internal/poll. Reviewed-on: https://go-review.googlesource.com/137256 From-SVN: r264572 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 65693ff..485906f 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -1dbc5b805a1665079008d1ce341991c3554c1eeb +652fbfb7acfd81ceffe28e20984464aa7bb6024d The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.1 From 4fb792e189c183aa499e834d9cdc4b3ee3bd064a Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 25 Sep 2018 14:51:39 +0000 Subject: re PR debug/83941 (Debug info generated with -flto contains useless forwarders) 2018-09-25 Richard Biener PR debug/83941 * dwarf2out.c (add_AT_external_die_ref): Remove now redundant GC-ification. (maybe_create_die_with_external_ref): Do not create DW_TAG_imported_unit here. (add_abstract_origin_attribute): Handle external BLOCK refs. (dwarf2out_abstract_function): Simplify LTO case. (dwarf2out_early_finish): Create DW_TAG_imported_unit explicitely rather than using maybe_create_die_with_external_ref. From-SVN: r264573 --- gcc/ChangeLog | 12 ++++++++++++ gcc/dwarf2out.c | 55 ++++++++++++++++++++++++++++--------------------------- 2 files changed, 40 insertions(+), 27 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b9e6ec2..6be143e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2018-09-25 Richard Biener + + PR debug/83941 + * dwarf2out.c (add_AT_external_die_ref): Remove now redundant + GC-ification. + (maybe_create_die_with_external_ref): Do not create + DW_TAG_imported_unit here. + (add_abstract_origin_attribute): Handle external BLOCK refs. + (dwarf2out_abstract_function): Simplify LTO case. + (dwarf2out_early_finish): Create DW_TAG_imported_unit explicitely + rather than using maybe_create_die_with_external_ref. + 2018-09-25 Uros Bizjak * config/i386/i386.md (frndintxf2_mask_pm): Remove. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 6f45794..1607269 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -5868,7 +5868,7 @@ add_AT_external_die_ref (dw_die_ref die, enum dwarf_attribute attr_kind, /* ??? We probably want to share these, thus put a ref to the DIE we create here to the external_die_map entry. */ dw_die_ref ref = new_die_raw (die->die_tag); - ref->die_id.die_symbol = IDENTIFIER_POINTER (get_identifier (symbol)); + ref->die_id.die_symbol = symbol; ref->die_offset = offset; ref->with_offset = 1; add_AT_die_ref (die, attr_kind, ref); @@ -5966,8 +5966,6 @@ maybe_create_die_with_external_ref (tree decl) case TRANSLATION_UNIT_DECL: { die = comp_unit_die (); - dw_die_ref import = new_die (DW_TAG_imported_unit, die, NULL_TREE); - add_AT_external_die_ref (import, DW_AT_import, sym, off); /* We re-target all CU decls to the LTRANS CU DIE, so no need to create a DIE for the original CUs. */ return die; @@ -21134,19 +21132,21 @@ add_abstract_origin_attribute (dw_die_ref die, tree origin) { dw_die_ref origin_die = NULL; - if (DECL_P (origin)) + /* For late LTO debug output we want to refer directly to the abstract + DIE in the early debug rather to the possibly existing concrete + instance and avoid creating that just for this purpose. */ + sym_off_pair *desc; + if (in_lto_p + && external_die_map + && (desc = external_die_map->get (origin))) { - sym_off_pair *desc; - if (in_lto_p - && external_die_map - && (desc = external_die_map->get (origin))) - { - add_AT_external_die_ref (die, DW_AT_abstract_origin, - desc->sym, desc->off); - return; - } - origin_die = lookup_decl_die (origin); + add_AT_external_die_ref (die, DW_AT_abstract_origin, + desc->sym, desc->off); + return; } + + if (DECL_P (origin)) + origin_die = lookup_decl_die (origin); else if (TYPE_P (origin)) origin_die = lookup_type_die (origin); else if (TREE_CODE (origin) == BLOCK) @@ -22458,21 +22458,15 @@ dwarf2out_abstract_function (tree decl) if (DECL_IGNORED_P (decl)) return; - /* Do not lazily create a DIE for decl here just because we - got called via debug_hooks->outlining_inline_function. */ - if (in_lto_p - && external_die_map - && external_die_map->get (decl)) + /* In LTO we're all set. We already created abstract instances + early and we want to avoid creating a concrete instance of that + if we don't output it. */ + if (in_lto_p) return; old_die = lookup_decl_die (decl); - /* With early debug we always have an old DIE unless we are in LTO - and the user did not compile but only link with debug. */ - if (in_lto_p && ! old_die) - return; gcc_assert (old_die != NULL); - if (get_AT (old_die, DW_AT_inline) - || get_AT (old_die, DW_AT_abstract_origin)) + if (get_AT (old_die, DW_AT_inline)) /* We've already generated the abstract instance. */ return; @@ -31907,8 +31901,15 @@ dwarf2out_early_finish (const char *filename) { unsigned i; tree tu; - FOR_EACH_VEC_SAFE_ELT (all_translation_units, i, tu) - maybe_create_die_with_external_ref (tu); + if (external_die_map) + FOR_EACH_VEC_SAFE_ELT (all_translation_units, i, tu) + if (sym_off_pair *desc = external_die_map->get (tu)) + { + dw_die_ref import = new_die (DW_TAG_imported_unit, + comp_unit_die (), NULL_TREE); + add_AT_external_die_ref (import, DW_AT_import, + desc->sym, desc->off); + } } early_dwarf_finished = true; -- cgit v1.1 From 0ae1678fd9f972a64bfa54da723e760d32dd95ab Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 25 Sep 2018 16:05:48 +0000 Subject: re PR c++/81246 (ICE on invalid C++ code (with a non-type template parameter having type 'float'): Segmentation fault) 2018-09-25 Paolo Carlini PR c++/81246 * g++.dg/cpp0x/pr81246.C: New. From-SVN: r264577 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/pr81246.C | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/pr81246.C (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4a591bf..056597d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-25 Paolo Carlini + + PR c++/81246 + * g++.dg/cpp0x/pr81246.C: New. + 2018-09-25 H.J. Lu PR target/82699 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr81246.C b/gcc/testsuite/g++.dg/cpp0x/pr81246.C new file mode 100644 index 0000000..e51e0b9 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr81246.C @@ -0,0 +1,11 @@ +// { dg-do compile { target c++11 } } + +namespace N +{ + template < typename T > class A + { + template < T > friend class B; // { dg-error "not a valid type" } + }; + + A < float > a; +} -- cgit v1.1 From 84848f51990785a127c32236be63c10e579a9332 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Tue, 25 Sep 2018 18:06:36 +0200 Subject: * config/i386/i386.md: Move nearbyint patterns closer to rint. From-SVN: r264578 --- gcc/config/i386/i386.md | 64 ++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'gcc') diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 75e2edb..fc5cfd0 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -16125,6 +16125,38 @@ DONE; }) +(define_expand "nearbyintxf2" + [(set (match_operand:XF 0 "register_operand") + (unspec:XF [(match_operand:XF 1 "register_operand")] + UNSPEC_FRNDINT))] + "TARGET_USE_FANCY_MATH_387 + && !flag_trapping_math") + +(define_expand "nearbyint2" + [(use (match_operand:MODEF 0 "register_operand")) + (use (match_operand:MODEF 1 "nonimmediate_operand"))] + "(TARGET_USE_FANCY_MATH_387 + && (!(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH) + || TARGET_MIX_SSE_I387) + && !flag_trapping_math) + || (TARGET_SSE4_1 && TARGET_SSE_MATH)" +{ + if (TARGET_SSE4_1 && TARGET_SSE_MATH) + emit_insn (gen_sse4_1_round2 + (operands[0], operands[1], GEN_INT (ROUND_MXCSR + | ROUND_NO_EXC))); + else + { + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extendxf2 (op1, operands[1])); + emit_insn (gen_nearbyintxf2 (op0, op1)); + emit_insn (gen_truncxf2_i387_noop_unspec (operands[0], op0)); + } + DONE; +}) + (define_expand "round2" [(match_operand:X87MODEF 0 "register_operand") (match_operand:X87MODEF 1 "nonimmediate_operand")] @@ -16340,38 +16372,6 @@ DONE; }) -(define_expand "nearbyintxf2" - [(set (match_operand:XF 0 "register_operand") - (unspec:XF [(match_operand:XF 1 "register_operand")] - UNSPEC_FRNDINT))] - "TARGET_USE_FANCY_MATH_387 - && !flag_trapping_math") - -(define_expand "nearbyint2" - [(use (match_operand:MODEF 0 "register_operand")) - (use (match_operand:MODEF 1 "nonimmediate_operand"))] - "(TARGET_USE_FANCY_MATH_387 - && (!(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH) - || TARGET_MIX_SSE_I387) - && !flag_trapping_math) - || (TARGET_SSE4_1 && TARGET_SSE_MATH)" -{ - if (TARGET_SSE4_1 && TARGET_SSE_MATH) - emit_insn (gen_sse4_1_round2 - (operands[0], operands[1], GEN_INT (ROUND_MXCSR - | ROUND_NO_EXC))); - else - { - rtx op0 = gen_reg_rtx (XFmode); - rtx op1 = gen_reg_rtx (XFmode); - - emit_insn (gen_extendxf2 (op1, operands[1])); - emit_insn (gen_nearbyintxf2 (op0, op1)); - emit_insn (gen_truncxf2_i387_noop_unspec (operands[0], op0)); - } - DONE; -}) - ;; Rounding mode control word calculation could clobber FLAGS_REG. (define_insn_and_split "*fist2__1" [(set (match_operand:SWI248x 0 "nonimmediate_operand") -- cgit v1.1 From e8753bb88e273b5fd1adba241edb78513aab6c39 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Tue, 25 Sep 2018 18:28:40 +0200 Subject: [PR 87339] Fix failure of gcc.dg/warn-abs-1.c on some targets 2018-09-25 Martin Jambor PR testsuite/87339 * gcc.dg/warn-abs-1.c: Do not test _Float128. Remove dg-skip-if and float125 target. * gcc.target/i386/warn-abs-3.c: New test. From-SVN: r264579 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gcc.dg/warn-abs-1.c | 6 ++---- gcc/testsuite/gcc.target/i386/warn-abs-3.c | 12 ++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/warn-abs-3.c (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 056597d..24bf238 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-09-25 Martin Jambor + + PR testsuite/87339 + * gcc.dg/warn-abs-1.c: Do not test _Float128. Remove dg-skip-if and + float125 target. + * gcc.target/i386/warn-abs-3.c: New test. + 2018-09-25 Paolo Carlini PR c++/81246 diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c index 129a3af..1c48727 100644 --- a/gcc/testsuite/gcc.dg/warn-abs-1.c +++ b/gcc/testsuite/gcc.dg/warn-abs-1.c @@ -1,5 +1,4 @@ -/* { dg-do compile { target float128 } } */ -/* { dg-skip-if "incomplete long double support" { { newlib } && large_long_double } } */ +/* { dg-do compile } */ /* { dg-options "-Wabsolute-value" } */ #include @@ -41,12 +40,11 @@ tst_notfloat (int *pi, long *pl, complex double *pc) } void -tst_float_size (double *pd, long double *pld, _Float128 *pf128) +tst_float_size (double *pd, long double *pld) { *pd = fabsf (*pd); /* { dg-warning "may cause truncation of value" } */ *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" } */ *pld = fabs ((double) *pld); - *pf128 = fabsl (*pf128); /* { dg-warning "may cause truncation of value" } */ } void tst_notcomplex (int *pi, long *pl, long double *pld) diff --git a/gcc/testsuite/gcc.target/i386/warn-abs-3.c b/gcc/testsuite/gcc.target/i386/warn-abs-3.c new file mode 100644 index 0000000..21feaff --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/warn-abs-3.c @@ -0,0 +1,12 @@ +/* { dg-do compile { target float128 } } */ +/* { dg-options "-Wabsolute-value" } */ + +#include +#include +#include + +void +tst_float128_size (_Float128 *pf128) +{ + *pf128 = fabsl (*pf128); /* { dg-warning "may cause truncation of value" } */ +} -- cgit v1.1 From 69deaf149a531fe55c058b87609f9f1c56ab6fc6 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 25 Sep 2018 18:40:57 +0200 Subject: re PR c++/87398 (g++ ICE on valid code: tree check: expected record_type or union_type or qual_union_type, have array_type in cxx_eval_constant_expression, at cp/constexpr.c:4820) PR c++/87398 * constexpr.c (cxx_eval_constant_expression) : Only look through COMPONENT_REFs with DECL_FIELD_IS_BASE FIELD_DECLs. * g++.dg/other/pr87398.C: New test. * g++.dg/cpp2a/constexpr-virtual10.C: New test. * g++.dg/cpp2a/constexpr-virtual11.C: New test. From-SVN: r264580 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/constexpr.c | 3 ++- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/g++.dg/cpp2a/constexpr-virtual10.C | 18 ++++++++++++++++ gcc/testsuite/g++.dg/cpp2a/constexpr-virtual11.C | 26 ++++++++++++++++++++++++ gcc/testsuite/g++.dg/other/pr87398.C | 12 +++++++++++ 6 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/cpp2a/constexpr-virtual10.C create mode 100644 gcc/testsuite/g++.dg/cpp2a/constexpr-virtual11.C create mode 100644 gcc/testsuite/g++.dg/other/pr87398.C (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9ce845d..672626c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-09-25 Jakub Jelinek + + PR c++/87398 + * constexpr.c (cxx_eval_constant_expression) : Only + look through COMPONENT_REFs with DECL_FIELD_IS_BASE FIELD_DECLs. + 2018-09-25 Martin Liska * name-lookup.c (namespace_scope_ht_size): Remove diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 08d00e8..403edda 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -4812,7 +4812,8 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t, return t; } obj = TREE_OPERAND (obj, 0); - while (handled_component_p (obj)) + while (TREE_CODE (obj) == COMPONENT_REF + && DECL_FIELD_IS_BASE (TREE_OPERAND (obj, 1))) obj = TREE_OPERAND (obj, 0); tree objtype = TREE_TYPE (obj); /* Find the function decl in the virtual functions list. TOKEN is diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 24bf238..68f1c3d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-09-25 Jakub Jelinek + + PR c++/87398 + * g++.dg/other/pr87398.C: New test. + * g++.dg/cpp2a/constexpr-virtual10.C: New test. + * g++.dg/cpp2a/constexpr-virtual11.C: New test. + 2018-09-25 Martin Jambor PR testsuite/87339 diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual10.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual10.C new file mode 100644 index 0000000..dd96bef --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual10.C @@ -0,0 +1,18 @@ +// P1064R0 +// { dg-do compile } +// { dg-options "-std=c++2a" } + +struct X +{ + constexpr virtual int f() const { return 1; }; +}; + +struct Y : public X +{ + constexpr virtual int f() const { return 2; }; +}; + +constexpr X a[2][1][3]; +constexpr Y b[3][12]; +static_assert (a[1][0][1].f() == 1); +static_assert (b[2][11].f() == 2); diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual11.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual11.C new file mode 100644 index 0000000..f7b46d3 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual11.C @@ -0,0 +1,26 @@ +// P1064R0 +// { dg-do compile } +// { dg-options "-std=c++2a" } + +struct A +{ + constexpr virtual int f () const { return 1; } +}; + +struct B : public A +{ + constexpr virtual int f () const { return 2; } +}; + +struct C +{ + A a; + B b; +}; + +constexpr C c; +constexpr const A &d = c.a; +constexpr const A &e = c.b; +constexpr const B &f = c.b; +static_assert (c.a.f () == 1 && c.b.f () == 2); +static_assert (d.f () == 1 && e.f () == 2 && f.f () == 2); diff --git a/gcc/testsuite/g++.dg/other/pr87398.C b/gcc/testsuite/g++.dg/other/pr87398.C new file mode 100644 index 0000000..00a2cd3 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr87398.C @@ -0,0 +1,12 @@ +// PR c++/87398 +// { dg-do compile } + +struct A { virtual int foo (); }; + +int +bar (int x) +{ + A e[5][2]; + int f = e[4][x].foo (); + return f; +} -- cgit v1.1 From a5bfbcc85c030d2ae6efeca8224c587ef3beb2b7 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 25 Sep 2018 18:02:47 +0000 Subject: re PR c++/87425 (ICE with virtual assignment operator) PR c++/87425 * g++.dg/cpp2a/constexpr-virtual12.C: New test. From-SVN: r264581 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp2a/constexpr-virtual12.C | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp2a/constexpr-virtual12.C (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 68f1c3d..90f5449 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-25 Marek Polacek + + PR c++/87425 + * g++.dg/cpp2a/constexpr-virtual12.C: New test. + 2018-09-25 Jakub Jelinek PR c++/87398 diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual12.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual12.C new file mode 100644 index 0000000..8f28eca --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual12.C @@ -0,0 +1,15 @@ +// PR c++/87425 +// P1064R0 +// { dg-do compile } +// { dg-options "-std=c++2a" } + +struct A +{ + virtual A& operator= (int); +}; + +struct B +{ + A a; + B() { a = 0; } +}; -- cgit v1.1 From 43ab423d96bc6786f30bb82888d18a908af07db7 Mon Sep 17 00:00:00 2001 From: Will Schmidt Date: Tue, 25 Sep 2018 18:34:06 +0000 Subject: altivec-6.C: Updated vec_splat() calls. [testsuite] 2018-09-25 Will Schmidt * g++.dg/ext/altivec-6.C: Updated vec_splat() calls. * gcc.target/powerpc/fold-vec-splat-char.c: Remove invalid vec_splat calls from recently added tests. Update instruction counts. * gcc.target/powerpc/fold-vec-splat-floatdouble.c: Same. * gcc.target/powerpc/fold-vec-splat-int.c: Same. * gcc.target/powerpc/fold-vec-splat-longlong.c: Same. * gcc.target/powerpc/fold-vec-splat-pixel.c: Same. * gcc.target/powerpc/fold-vec-splat-short.c: Same. From-SVN: r264582 --- gcc/testsuite/ChangeLog | 11 ++++++ gcc/testsuite/g++.dg/ext/altivec-6.C | 8 ++-- .../gcc.target/powerpc/fold-vec-splat-char.c | 21 ++-------- .../powerpc/fold-vec-splat-floatdouble.c | 45 ++++++++-------------- .../gcc.target/powerpc/fold-vec-splat-int.c | 25 +----------- .../gcc.target/powerpc/fold-vec-splat-longlong.c | 37 +++--------------- .../gcc.target/powerpc/fold-vec-splat-pixel.c | 12 +----- .../gcc.target/powerpc/fold-vec-splat-short.c | 22 +---------- 8 files changed, 46 insertions(+), 135 deletions(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 90f5449..da2d96c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2018-09-25 Will Schmidt + + * g++.dg/ext/altivec-6.C: Updated vec_splat() calls. + * gcc.target/powerpc/fold-vec-splat-char.c: Remove invalid + vec_splat calls from recently added tests. Update instruction counts. + * gcc.target/powerpc/fold-vec-splat-floatdouble.c: Same. + * gcc.target/powerpc/fold-vec-splat-int.c: Same. + * gcc.target/powerpc/fold-vec-splat-longlong.c: Same. + * gcc.target/powerpc/fold-vec-splat-pixel.c: Same. + * gcc.target/powerpc/fold-vec-splat-short.c: Same. + 2018-09-25 Marek Polacek PR c++/87425 diff --git a/gcc/testsuite/g++.dg/ext/altivec-6.C b/gcc/testsuite/g++.dg/ext/altivec-6.C index 63ae0b0..4c863ef 100644 --- a/gcc/testsuite/g++.dg/ext/altivec-6.C +++ b/gcc/testsuite/g++.dg/ext/altivec-6.C @@ -22,7 +22,9 @@ void foo(void) { vp = vec_sld(vp, vp, 5); vbc = vec_splat(vbc, 7); - vbs = vec_splat(vbs, 12); - vp = vec_splat(vp, 17); - vbi = vec_splat(vbi, 31); + /* The second argument to vec_splat needs to be less than the number of + elements in the referenced vector. */ + vbs = vec_splat(vbs, 4); + vp = vec_splat(vp, 1); + vbi = vec_splat(vbi, 15); } diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-char.c index d50d073..fbe347c 100644 --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-char.c +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-char.c @@ -12,27 +12,18 @@ vector bool char testb_1 (vector bool char x) { return vec_splat (x, 0b00001); vector bool char testb_2 (vector bool char x) { return vec_splat (x, 0b00010); } vector bool char testb_4 (vector bool char x) { return vec_splat (x, 0b00100); } vector bool char testb_8 (vector bool char x) { return vec_splat (x, 0b01000); } -vector bool char testb_10 (vector bool char x) { return vec_splat (x, 0b10000); } -vector bool char testb_1e (vector bool char x) { return vec_splat (x, 0b11110); } -vector bool char testb_1f (vector bool char x) { return vec_splat (x, 0b11111); } vector signed char tests_0 (vector signed char x) { return vec_splat (x, 0b00000); } vector signed char tests_1 (vector signed char x) { return vec_splat (x, 0b00001); } vector signed char tests_2 (vector signed char x) { return vec_splat (x, 0b00010); } vector signed char tests_4 (vector signed char x) { return vec_splat (x, 0b00100); } vector signed char tests_8 (vector signed char x) { return vec_splat (x, 0b01000); } -vector signed char tests_10 (vector signed char x) { return vec_splat (x, 0b10000); } -vector signed char tests_1e (vector signed char x) { return vec_splat (x, 0b11110); } -vector signed char tests_1f (vector signed char x) { return vec_splat (x, 0b11111); } vector unsigned char testu_0 (vector unsigned char x) { return vec_splat (x, 0b00000); } vector unsigned char testu_1 (vector unsigned char x) { return vec_splat (x, 0b00001); } vector unsigned char testu_2 (vector unsigned char x) { return vec_splat (x, 0b00010); } vector unsigned char testu_4 (vector unsigned char x) { return vec_splat (x, 0b00100); } vector unsigned char testu_8 (vector unsigned char x) { return vec_splat (x, 0b01000); } -vector unsigned char testu_10 (vector unsigned char x) { return vec_splat (x, 0b10000); } -vector unsigned char testu_1e (vector unsigned char x) { return vec_splat (x, 0b11110); } -vector unsigned char testu_1f (vector unsigned char x) { return vec_splat (x, 0b11111); } /* Similar tests as above, but the source vector is a known constant. */ const vector bool char by = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p'}; @@ -43,13 +34,7 @@ vector bool char test_bc (vector bool char x) { return vec_splat (by, 0b00010); vector signed char test_sc (vector signed char x) { return vec_splat (sy, 0b00011); } vector unsigned char test_uc (vector unsigned char x) { return vec_splat (uy, 0b00110); } -/* Similar tests as above, mask is greater than number of elements in the - source vector. */ -vector bool char test_obc (vector bool char x) { return vec_splat (by, 0b10010); } -vector signed char test_osc (vector signed char x) { return vec_splat (sy, 0b10011); } -vector unsigned char test_ouc (vector unsigned char x) { return vec_splat (uy, 0b10110); } - // vec_splat() using variable vectors should generate the vspltb instruction. -/* { dg-final { scan-assembler-times "vspltb" 24 } } */ -// vec_splat() using a constant vector should generate a load. -/* { dg-final { scan-assembler-times {\mlvx\M|\mlxvw4x\M} 6 } } */ +/* { dg-final { scan-assembler-times "vspltb" 15 } } */ +// vec_splat() using a constant vector will generate a load or a splat immediate byte. +/* { dg-final { scan-assembler-times {\mlvx\M|\mlxvw4x\M|\mxxspltib\M} 3 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-floatdouble.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-floatdouble.c index fd74002..ab39696 100644 --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-floatdouble.c +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-floatdouble.c @@ -7,40 +7,25 @@ #include +/* Floats. */ vector float testf_00 (vector float x) { return vec_splat (x, 0b00000); } vector float testf_01 (vector float x) { return vec_splat (x, 0b00001); } vector float testf_02 (vector float x) { return vec_splat (x, 0b00010); } -vector float testf_04 (vector float x) { return vec_splat (x, 0b00100); } -vector float testf_08 (vector float x) { return vec_splat (x, 0b01000); } -vector float testf_0f (vector float x) { return vec_splat (x, 0b01111); } -vector float testf_10 (vector float x) { return vec_splat (x, 0b10000); } -vector float testf_1e (vector float x) { return vec_splat (x, 0b11110); } -vector float testf_1f (vector float x) { return vec_splat (x, 0b11111); } +vector float test_fc () +{ const vector float y = { 7.1, 8.2, 9.3, 10.4}; return vec_splat (y, 0b00010); } +/* Doubles. */ vector double testd_00 (vector double x) { return vec_splat (x, 0b00000); } vector double testd_01 (vector double x) { return vec_splat (x, 0b00001); } -vector double testd_02 (vector double x) { return vec_splat (x, 0b00010); } -vector double testd_04 (vector double x) { return vec_splat (x, 0b00100); } -vector double testd_08 (vector double x) { return vec_splat (x, 0b01000); } -vector double testd_0f (vector double x) { return vec_splat (x, 0b01111); } -vector double testd_10 (vector double x) { return vec_splat (x, 0b10000); } -vector double testd_1e (vector double x) { return vec_splat (x, 0b11110); } -vector double testd_1f (vector double x) { return vec_splat (x, 0b11111); } - -/* Similar tests as above, but the source vector is a known constant. */ -vector float test_fc () { const vector float y = { 7.1, 8.2, 9.3, 10.4}; return vec_splat (y, 0b00010); } -vector double test_dc () { const vector double y = { 3.0, 5.0 }; return vec_splat (y, 0b00010); } - -/* Similar tests as above, mask is greater than number of elements in the - source vector. */ -vector float test_ofc () { const vector float y = { 7.1, 8.2, 9.3, 10.4}; return vec_splat (y, 0b10010); } -vector double test_odc () { const vector double y = { 3.0, 5.0 }; return vec_splat (y, 0b10010); } - -/* lvx or lxvd2x for loading of the constants. */ -/* vspltw or xxspltw for non-constants with the float type. */ -/* xxpermdi for non-constants with the double type. */ - -/* { dg-final { scan-assembler-times {\mlvx\M|\mlxvd2x\M} 4 } } */ -/* { dg-final { scan-assembler-times "vspltw|xxspltw" 9 } } */ -/* { dg-final { scan-assembler-times "xxpermdi" 9 } } */ +vector double test_dc () +{ const vector double y = { 3.0, 5.0 }; return vec_splat (y, 0b00010); } + +/* If the source vector is a known constant, we will generate a load. */ +/* { dg-final { scan-assembler-times {\mlvx\M|\mlxvd2x\M|\mlxv\M} 2 } } */ + +/* For float types, we generate a splat. */ +/* { dg-final { scan-assembler-times "vspltw|xxspltw" 3 } } */ + +/* For double types, we will generate xxpermdi instructions. */ +/* { dg-final { scan-assembler-times "xxpermdi" 3 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-int.c index 7697853..5df96d1 100644 --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-int.c +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-int.c @@ -10,41 +10,20 @@ vector bool int testb_0 (vector bool int x) { return vec_splat (x, 0b00000); } vector bool int testb_1 (vector bool int x) { return vec_splat (x, 0b00001); } vector bool int testb_2 (vector bool int x) { return vec_splat (x, 0b00010); } -vector bool int testb_4 (vector bool int x) { return vec_splat (x, 0b00100); } -vector bool int testb_8 (vector bool int x) { return vec_splat (x, 0b01000); } -vector bool int testb_10 (vector bool int x) { return vec_splat (x, 0b10000); } -vector bool int testb_1e (vector bool int x) { return vec_splat (x, 0b11110); } -vector bool int testb_1f (vector bool int x) { return vec_splat (x, 0b11111); } vector signed int tests_0 (vector signed int x) { return vec_splat (x, 0b00000); } vector signed int tests_1 (vector signed int x) { return vec_splat (x, 0b00001); } vector signed int tests_2 (vector signed int x) { return vec_splat (x, 0b00010); } -vector signed int tests_4 (vector signed int x) { return vec_splat (x, 0b00100); } -vector signed int tests_8 (vector signed int x) { return vec_splat (x, 0b01000); } -vector signed int tests_10 (vector signed int x) { return vec_splat (x, 0b10000); } -vector signed int tests_1e (vector signed int x) { return vec_splat (x, 0b11110); } -vector signed int tests_1f (vector signed int x) { return vec_splat (x, 0b11111); } vector unsigned int testu_0 (vector unsigned int x) { return vec_splat (x, 0b00000); } vector unsigned int testu_1 (vector unsigned int x) { return vec_splat (x, 0b00001); } vector unsigned int testu_2 (vector unsigned int x) { return vec_splat (x, 0b00010); } -vector unsigned int testu_4 (vector unsigned int x) { return vec_splat (x, 0b00100); } -vector unsigned int testu_8 (vector unsigned int x) { return vec_splat (x, 0b01000); } -vector unsigned int testu_10 (vector unsigned int x) { return vec_splat (x, 0b10000); } -vector unsigned int testu_1e (vector unsigned int x) { return vec_splat (x, 0b11110); } -vector unsigned int testu_1f (vector unsigned int x) { return vec_splat (x, 0b11111); } /* Similar test as above, but the source vector is a known constant. */ vector bool int test_bic () { const vector bool int y = { 1,2,3,4}; return vec_splat (y, 0b00010); } vector signed int test_sic () { const vector signed int y = { 1,2,3,4}; return vec_splat (y, 0b00010); } vector unsigned int test_uic () { const vector unsigned int y = { 1,2,3,4}; return vec_splat (y, 0b00010); } -/* Similar tests as above, mask is greater than number of elements in the - source vector. */ -vector bool int test_obic () { const vector bool int y = { 1,2,3,4}; return vec_splat (y, 0b10010); } -vector signed int test_osic () { const vector signed int y = { 1,2,3,4}; return vec_splat (y, 0b10010); } -vector unsigned int test_ouic () { const vector unsigned int y = { 1,2,3,4}; return vec_splat (y, 0b10010); } - -/* { dg-final { scan-assembler-times "vspltisw" 6 } } */ -/* { dg-final { scan-assembler-times "vspltw|xxspltw" 24 } } */ +/* { dg-final { scan-assembler-times "vspltisw" 3 } } */ +/* { dg-final { scan-assembler-times "vspltw|xxspltw" 9 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-longlong.c index 0720e20..4fa06c8 100644 --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-longlong.c +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-longlong.c @@ -10,51 +10,26 @@ vector bool long long testb_00 (vector bool long long x) { return vec_splat (x, 0b00000); } vector bool long long testb_01 (vector bool long long x) { return vec_splat (x, 0b00001); } vector bool long long testb_02 (vector bool long long x) { return vec_splat (x, 0b00010); } -vector bool long long testb_04 (vector bool long long x) { return vec_splat (x, 0b00100); } -vector bool long long testb_08 (vector bool long long x) { return vec_splat (x, 0b01000); } -vector bool long long testb_10 (vector bool long long x) { return vec_splat (x, 0b10000); } -vector bool long long testb_1e (vector bool long long x) { return vec_splat (x, 0b11110); } -vector bool long long testb_1f (vector bool long long x) { return vec_splat (x, 0b11111); } vector signed long long tests_00 (vector signed long long x) { return vec_splat (x, 0b00000); } vector signed long long tests_01 (vector signed long long x) { return vec_splat (x, 0b00001); } vector signed long long tests_02 (vector signed long long x) { return vec_splat (x, 0b00010); } -vector signed long long tests_04 (vector signed long long x) { return vec_splat (x, 0b00100); } -vector signed long long tests_08 (vector signed long long x) { return vec_splat (x, 0b01000); } -vector signed long long tests_10 (vector signed long long x) { return vec_splat (x, 0b10000); } -vector signed long long tests_1e (vector signed long long x) { return vec_splat (x, 0b11110); } -vector signed long long tests_1f (vector signed long long x) { return vec_splat (x, 0b11111); } vector unsigned long long testu_00 (vector unsigned long long x) { return vec_splat (x, 0b00000); } vector unsigned long long testu_01 (vector unsigned long long x) { return vec_splat (x, 0b00001); } vector unsigned long long testu_02 (vector unsigned long long x) { return vec_splat (x, 0b00010); } -vector unsigned long long testu_04 (vector unsigned long long x) { return vec_splat (x, 0b00100); } -vector unsigned long long testu_08 (vector unsigned long long x) { return vec_splat (x, 0b01000); } -vector unsigned long long testu_10 (vector unsigned long long x) { return vec_splat (x, 0b10000); } -vector unsigned long long testu_1e (vector unsigned long long x) { return vec_splat (x, 0b11110); } -vector unsigned long long testu_1f (vector unsigned long long x) { return vec_splat (x, 0b11111); } /* Similar test as above, but the source vector is a known constant. */ vector bool long long test_bll () { const vector bool long long y = {12, 23}; return vec_splat (y, 0b00010); } vector signed long long test_sll () { const vector signed long long y = {34, 45}; return vec_splat (y, 0b00010); } vector unsigned long long test_ull () { const vector unsigned long long y = {56, 67}; return vec_splat (y, 0b00010); } -/* Similar tests as above, mask is greater than number of elements in the - source vector. */ -vector bool long long test_obll () { const vector bool long long y = {12, 23}; return vec_splat (y, 0b10010); } -vector signed long long test_osll () { const vector signed long long y = {34, 45}; return vec_splat (y, 0b10010); } -vector unsigned long long test_oull () { const vector unsigned long long y = {56, 67}; return vec_splat (y, 0b10010); } - -/* lvx for the initialization with known constants. */ -/* { dg-final { scan-assembler-times {\mlvx\M|\mlxvd2x\M} 6 } } */ +/* Assorted load instructions for the initialization with known constants. */ +/* { dg-final { scan-assembler-times {\mlvx\M|\mlxvd2x\M|\mlxv\M} 3 } } */ /* xxpermdi for vec_splat of long long vectors. - At the time of this writing, the number of xxpermdi instructions - generated could be 24 or 26 or 27, ultimately depending on the - platform and whether or not folding is enabled. - Roughly: - 24 occurrences on older targets (power5) regardless of folding state. - 26 occurrences with gimple folding enabled (through power9). - 27 occurrences with gimple folding disabled (through power9). - So, ensure we have at least one hit. */ + At the time of this writing, the number of xxpermdi instructions + generated will vary depending on the target processor (p5/p6/p7/p8/...) + and whether or not folding is enabled. + So, ensure we have at least one hit. */ /* { dg-final { scan-assembler "xxpermdi" } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-pixel.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-pixel.c index 7170588..bb9b516 100644 --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-pixel.c +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-pixel.c @@ -11,17 +11,9 @@ vector pixel test1_00 (vector pixel x) { return vec_splat (x, 0b00000); } vector pixel test1_01 (vector pixel x) { return vec_splat (x, 0b00001); } vector pixel test1_02 (vector pixel x) { return vec_splat (x, 0b00010); } vector pixel test1_04 (vector pixel x) { return vec_splat (x, 0b00100); } -vector pixel test1_08 (vector pixel x) { return vec_splat (x, 0b01000); } -vector pixel test1_10 (vector pixel x) { return vec_splat (x, 0b10000); } -vector pixel test1_1e (vector pixel x) { return vec_splat (x, 0b11110); } -vector pixel test1_1f (vector pixel x) { return vec_splat (x, 0b11111); } /* Similar test as above, but the source vector is a known constant. */ vector pixel test_p () { const vector pixel y = { 1,2,3,4}; return vec_splat (y, 0b00010); } -/* Similar tests as above, mask is greater than number of elements in the - source vector. */ -vector pixel test_op () { const vector pixel y = { 1,2,3,4}; return vec_splat (y, 0b10010); } - -/* { dg-final { scan-assembler-times "vspltish" 2 } } */ -/* { dg-final { scan-assembler-times "vsplth" 8 } } */ +/* { dg-final { scan-assembler-times "vspltish" 1 } } */ +/* { dg-final { scan-assembler-times "vsplth" 4 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-short.c index 96c553f..92bdfa4 100644 --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-short.c +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-short.c @@ -11,39 +11,21 @@ vector bool short testb_00 (vector bool short x) { return vec_splat (x, 0b00000) vector bool short testb_01 (vector bool short x) { return vec_splat (x, 0b00001); } vector bool short testb_02 (vector bool short x) { return vec_splat (x, 0b00010); } vector bool short testb_04 (vector bool short x) { return vec_splat (x, 0b00100); } -vector bool short testb_08 (vector bool short x) { return vec_splat (x, 0b01000); } -vector bool short testb_10 (vector bool short x) { return vec_splat (x, 0b10000); } -vector bool short testb_1e (vector bool short x) { return vec_splat (x, 0b11110); } -vector bool short testb_1f (vector bool short x) { return vec_splat (x, 0b11111); } vector signed short tests_00 (vector signed short x) { return vec_splat (x, 0b00000); } vector signed short tests_01 (vector signed short x) { return vec_splat (x, 0b00001); } vector signed short tests_02 (vector signed short x) { return vec_splat (x, 0b00010); } vector signed short tests_04 (vector signed short x) { return vec_splat (x, 0b00100); } -vector signed short tests_08 (vector signed short x) { return vec_splat (x, 0b01000); } -vector signed short tests_10 (vector signed short x) { return vec_splat (x, 0b10000); } -vector signed short tests_1e (vector signed short x) { return vec_splat (x, 0b11110); } -vector signed short tests_1f (vector signed short x) { return vec_splat (x, 0b11111); } vector unsigned short testu_00 (vector unsigned short x) { return vec_splat (x, 0b00000); } vector unsigned short testu_01 (vector unsigned short x) { return vec_splat (x, 0b00001); } vector unsigned short testu_02 (vector unsigned short x) { return vec_splat (x, 0b00010); } vector unsigned short testu_04 (vector unsigned short x) { return vec_splat (x, 0b00100); } -vector unsigned short testu_08 (vector unsigned short x) { return vec_splat (x, 0b01000); } -vector unsigned short testu_10 (vector unsigned short x) { return vec_splat (x, 0b10000); } -vector unsigned short testu_1e (vector unsigned short x) { return vec_splat (x, 0b11110); } -vector unsigned short testu_1f (vector unsigned short x) { return vec_splat (x, 0b11111); } /* Similar test as above, but the source vector is a known constant. */ vector bool short test_bs () { const vector bool short y = {1, 2, 3, 4, 5, 6, 7, 8}; return vec_splat (y, 0b00010); } vector signed short test_ss () { const vector signed short y = {1, 2, 3, 4, 5, 6, 7, 8}; return vec_splat (y, 0b00010); } vector unsigned short test_us () { const vector unsigned short y = {1, 2, 3, 4, 5, 6, 7, 8}; return vec_splat (y, 0b00010); } -/* Similar tests as above, mask is greater than number of elements in the - source vector. */ -vector bool short test_obs () { const vector bool short y = {1, 2, 3, 4, 5, 6, 7, 8}; return vec_splat (y, 0b10010); } -vector signed short test_oss () { const vector signed short y = {1, 2, 3, 4, 5, 6, 7, 8}; return vec_splat (y, 0b10010); } -vector unsigned short test_ous () { const vector unsigned short y = {1, 2, 3, 4, 5, 6, 7, 8}; return vec_splat (y, 0b10010); } - -/* { dg-final { scan-assembler-times "vspltish" 6 } } */ -/* { dg-final { scan-assembler-times "vsplth" 24 } } */ +/* { dg-final { scan-assembler-times "vspltish" 3 } } */ +/* { dg-final { scan-assembler-times "vsplth" 12 } } */ -- cgit v1.1 From ee8505183c50f850509bf52855488259c53544fc Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 25 Sep 2018 19:04:44 +0000 Subject: adjust dinst.adb's expectations for location views The testcase failed when the compiler used .loc view syntax, because it expected discriminators at the end of the .loc lines. for gcc/testsuite/ChangeLog * gnat.dg/dinst.adb: Adjust for locviews. From-SVN: r264583 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gnat.dg/dinst.adb | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index da2d96c..05dbb0d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-09-25 Alexandre Oliva + + * gnat.dg/dinst.adb: Adjust for locviews. + 2018-09-25 Will Schmidt * g++.dg/ext/altivec-6.C: Updated vec_splat() calls. diff --git a/gcc/testsuite/gnat.dg/dinst.adb b/gcc/testsuite/gnat.dg/dinst.adb index 460e6c5..d5ccc9c 100644 --- a/gcc/testsuite/gnat.dg/dinst.adb +++ b/gcc/testsuite/gnat.dg/dinst.adb @@ -1,9 +1,9 @@ -- { dg-do compile { target *-*-gnu* } } -- { dg-options "-gnateS -gdwarf -g -O -gno-column-info" } --- { dg-final { scan-assembler "loc \[0-9] 5 \[0-9]( is_stmt \[0-9])? discriminator 1\n" } } */ --- { dg-final { scan-assembler-not "loc \[0-9] 5 \[0-9]( is_stmt \[0-9])? discriminator 2\n" } } */ --- { dg-final { scan-assembler "loc \[0-9] 5 \[0-9]( is_stmt \[0-9])? discriminator 3\n" } } */ --- { dg-final { scan-assembler "loc \[0-9] 5 \[0-9]( is_stmt \[0-9])? discriminator 4\n" } } */ +-- { dg-final { scan-assembler "loc \[0-9] 5 \[0-9]( is_stmt \[0-9])? discriminator 1\[ \n]" } } */ +-- { dg-final { scan-assembler-not "loc \[0-9] 5 \[0-9]( is_stmt \[0-9])? discriminator 2\[ \n]" } } */ +-- { dg-final { scan-assembler "loc \[0-9] 5 \[0-9]( is_stmt \[0-9])? discriminator 3\[ \n]" } } */ +-- { dg-final { scan-assembler "loc \[0-9] 5 \[0-9]( is_stmt \[0-9])? discriminator 4\[ \n]" } } */ with DInst_Pkg; -- cgit v1.1 From a9f6e019d15819f52b312e1b10cd460b59b57780 Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Wed, 26 Sep 2018 00:09:38 +0200 Subject: rs6000: Do not allow out of range immediate in vsplt[bhw] (PR86987) The original AltiVec manuals had the immediate lane number in the splat instructions as a 5-bit number, but anything too big has no defined meaning, and gas will choke on it too. This patch disallows it in the instruction patterns as well as in the builtins. This solves PR86987. PR target/86987 * config/rs6000/altivec.md (altivec_vspltb): Use const_0_to_15_operand instead of u5bit_cint_operand. (*altivec_vspltb_internal): Ditto. (altivec_vspltb_direct): Ditto. (altivec_vsplth): Use const_0_to_7_operand instead of u5bit_cint_operand. (*altivec_vsplth_internal): Ditto. (altivec_vsplth_direct): Ditto. (altivec_vspltw): Use const_0_to_3_operand instead of u5bit_cint_operand. (*altivec_vspltw_internal): Ditto. (altivec_vspltw_direct): Ditto. (altivec_vspltsf): Ditto. (*altivec_vspltsf_internal): Ditto. * config/rs6000/rs6000.c (rs6000_expand_binop_builtin): Handle the various splats with the proper size immediate. Reorder the various cases by ascending size of immediate, and put all such together. From-SVN: r264584 --- gcc/ChangeLog | 21 +++++++++++++ gcc/config/rs6000/altivec.md | 22 +++++++------- gcc/config/rs6000/rs6000.c | 70 +++++++++++++++++++++++++++++++------------- 3 files changed, 82 insertions(+), 31 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6be143e..12e7789 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,24 @@ +2018-09-25 Segher Boessenkool + + PR target/86987 + * config/rs6000/altivec.md (altivec_vspltb): Use + const_0_to_15_operand instead of u5bit_cint_operand. + (*altivec_vspltb_internal): Ditto. + (altivec_vspltb_direct): Ditto. + (altivec_vsplth): Use const_0_to_7_operand instead of + u5bit_cint_operand. + (*altivec_vsplth_internal): Ditto. + (altivec_vsplth_direct): Ditto. + (altivec_vspltw): Use const_0_to_3_operand instead of + u5bit_cint_operand. + (*altivec_vspltw_internal): Ditto. + (altivec_vspltw_direct): Ditto. + (altivec_vspltsf): Ditto. + (*altivec_vspltsf_internal): Ditto. + * config/rs6000/rs6000.c (rs6000_expand_binop_builtin): Handle the + various splats with the proper size immediate. Reorder the various + cases by ascending size of immediate, and put all such together. + 2018-09-25 Richard Biener PR debug/83941 diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md index 1ddf580..345be09 100644 --- a/gcc/config/rs6000/altivec.md +++ b/gcc/config/rs6000/altivec.md @@ -1861,7 +1861,7 @@ (define_expand "altivec_vspltb" [(use (match_operand:V16QI 0 "register_operand")) (use (match_operand:V16QI 1 "register_operand")) - (use (match_operand:QI 2 "u5bit_cint_operand"))] + (use (match_operand:QI 2 "const_0_to_15_operand"))] "TARGET_ALTIVEC" { rtvec v = gen_rtvec (1, operands[2]); @@ -1877,7 +1877,7 @@ (vec_duplicate:V16QI (vec_select:QI (match_operand:V16QI 1 "register_operand" "v") (parallel - [(match_operand:QI 2 "u5bit_cint_operand" "")]))))] + [(match_operand:QI 2 "const_0_to_15_operand" "")]))))] "TARGET_ALTIVEC" { if (!BYTES_BIG_ENDIAN) @@ -1890,7 +1890,7 @@ (define_insn "altivec_vspltb_direct" [(set (match_operand:V16QI 0 "register_operand" "=v") (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:QI 2 "u5bit_cint_operand" "i")] + (match_operand:QI 2 "const_0_to_15_operand" "i")] UNSPEC_VSPLT_DIRECT))] "TARGET_ALTIVEC" "vspltb %0,%1,%2" @@ -1899,7 +1899,7 @@ (define_expand "altivec_vsplth" [(use (match_operand:V8HI 0 "register_operand")) (use (match_operand:V8HI 1 "register_operand")) - (use (match_operand:QI 2 "u5bit_cint_operand"))] + (use (match_operand:QI 2 "const_0_to_7_operand"))] "TARGET_ALTIVEC" { rtvec v = gen_rtvec (1, operands[2]); @@ -1915,7 +1915,7 @@ (vec_duplicate:V8HI (vec_select:HI (match_operand:V8HI 1 "register_operand" "v") (parallel - [(match_operand:QI 2 "u5bit_cint_operand" "")]))))] + [(match_operand:QI 2 "const_0_to_7_operand" "")]))))] "TARGET_ALTIVEC" { if (!BYTES_BIG_ENDIAN) @@ -1928,7 +1928,7 @@ (define_insn "altivec_vsplth_direct" [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:QI 2 "u5bit_cint_operand" "i")] + (match_operand:QI 2 "const_0_to_7_operand" "i")] UNSPEC_VSPLT_DIRECT))] "TARGET_ALTIVEC" "vsplth %0,%1,%2" @@ -1937,7 +1937,7 @@ (define_expand "altivec_vspltw" [(use (match_operand:V4SI 0 "register_operand")) (use (match_operand:V4SI 1 "register_operand")) - (use (match_operand:QI 2 "u5bit_cint_operand"))] + (use (match_operand:QI 2 "const_0_to_3_operand"))] "TARGET_ALTIVEC" { rtvec v = gen_rtvec (1, operands[2]); @@ -1953,7 +1953,7 @@ (vec_duplicate:V4SI (vec_select:SI (match_operand:V4SI 1 "register_operand" "v") (parallel - [(match_operand:QI 2 "u5bit_cint_operand" "i")]))))] + [(match_operand:QI 2 "const_0_to_3_operand" "i")]))))] "TARGET_ALTIVEC" { if (!BYTES_BIG_ENDIAN) @@ -1966,7 +1966,7 @@ (define_insn "altivec_vspltw_direct" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:QI 2 "u5bit_cint_operand" "i")] + (match_operand:QI 2 "const_0_to_3_operand" "i")] UNSPEC_VSPLT_DIRECT))] "TARGET_ALTIVEC" "vspltw %0,%1,%2" @@ -1975,7 +1975,7 @@ (define_expand "altivec_vspltsf" [(use (match_operand:V4SF 0 "register_operand")) (use (match_operand:V4SF 1 "register_operand")) - (use (match_operand:QI 2 "u5bit_cint_operand"))] + (use (match_operand:QI 2 "const_0_to_3_operand"))] "TARGET_ALTIVEC" { rtvec v = gen_rtvec (1, operands[2]); @@ -1991,7 +1991,7 @@ (vec_duplicate:V4SF (vec_select:SF (match_operand:V4SF 1 "register_operand" "v") (parallel - [(match_operand:QI 2 "u5bit_cint_operand" "i")]))))] + [(match_operand:QI 2 "const_0_to_3_operand" "i")]))))] "VECTOR_UNIT_ALTIVEC_P (V4SFmode)" { if (!BYTES_BIG_ENDIAN) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 5c7ab2b..baa5851 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -13456,13 +13456,58 @@ rs6000_expand_binop_builtin (enum insn_code icode, tree exp, rtx target) if (arg0 == error_mark_node || arg1 == error_mark_node) return const0_rtx; - if (icode == CODE_FOR_altivec_vcfux + if (icode == CODE_FOR_unpackv1ti + || icode == CODE_FOR_unpackkf + || icode == CODE_FOR_unpacktf + || icode == CODE_FOR_unpackif + || icode == CODE_FOR_unpacktd) + { + /* Only allow 1-bit unsigned literals. */ + STRIP_NOPS (arg1); + if (TREE_CODE (arg1) != INTEGER_CST + || !IN_RANGE (TREE_INT_CST_LOW (arg1), 0, 1)) + { + error ("argument 2 must be a 1-bit unsigned literal"); + return CONST0_RTX (tmode); + } + } + else if (icode == CODE_FOR_altivec_vspltw) + { + /* Only allow 2-bit unsigned literals. */ + STRIP_NOPS (arg1); + if (TREE_CODE (arg1) != INTEGER_CST + || TREE_INT_CST_LOW (arg1) & ~3) + { + error ("argument 2 must be a 2-bit unsigned literal"); + return CONST0_RTX (tmode); + } + } + else if (icode == CODE_FOR_altivec_vsplth) + { + /* Only allow 3-bit unsigned literals. */ + STRIP_NOPS (arg1); + if (TREE_CODE (arg1) != INTEGER_CST + || TREE_INT_CST_LOW (arg1) & ~7) + { + error ("argument 2 must be a 3-bit unsigned literal"); + return CONST0_RTX (tmode); + } + } + else if (icode == CODE_FOR_altivec_vspltb) + { + /* Only allow 4-bit unsigned literals. */ + STRIP_NOPS (arg1); + if (TREE_CODE (arg1) != INTEGER_CST + || TREE_INT_CST_LOW (arg1) & ~15) + { + error ("argument 2 must be a 4-bit unsigned literal"); + return CONST0_RTX (tmode); + } + } + else if (icode == CODE_FOR_altivec_vcfux || icode == CODE_FOR_altivec_vcfsx || icode == CODE_FOR_altivec_vctsxs - || icode == CODE_FOR_altivec_vctuxs - || icode == CODE_FOR_altivec_vspltb - || icode == CODE_FOR_altivec_vsplth - || icode == CODE_FOR_altivec_vspltw) + || icode == CODE_FOR_altivec_vctuxs) { /* Only allow 5-bit unsigned literals. */ STRIP_NOPS (arg1); @@ -13507,21 +13552,6 @@ rs6000_expand_binop_builtin (enum insn_code icode, tree exp, rtx target) return CONST0_RTX (tmode); } } - else if (icode == CODE_FOR_unpackv1ti - || icode == CODE_FOR_unpackkf - || icode == CODE_FOR_unpacktf - || icode == CODE_FOR_unpackif - || icode == CODE_FOR_unpacktd) - { - /* Only allow 1-bit unsigned literals. */ - STRIP_NOPS (arg1); - if (TREE_CODE (arg1) != INTEGER_CST - || !IN_RANGE (TREE_INT_CST_LOW (arg1), 0, 1)) - { - error ("argument 2 must be a 1-bit unsigned literal"); - return CONST0_RTX (tmode); - } - } if (target == 0 || GET_MODE (target) != tmode -- cgit v1.1 From c7813484bc9fe2c578d7538d0a9e286bf2e64599 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 25 Sep 2018 16:17:45 -0600 Subject: re PR c/87387 (trunk/gcc/builtins.c:585:7: warning: -Wself-assign problem) PR c/87387 * builtins.c (unterminated_array): Simplify. * expr.c (string_constant): Handle SSA_NAME. Add more exceptions where pointer arithmetic is safe. * gcc.dg/warn-stpcpy-no-nul.c: Drop unnecessary xfails. * gcc.dg/warn-stplen-no-nul.c: Likewise. From-SVN: r264585 --- gcc/ChangeLog | 7 ++++++ gcc/builtins.c | 23 ++----------------- gcc/expr.c | 37 ++++++++++++++++++++++++++++++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/warn-stpcpy-no-nul.c | 4 ++-- gcc/testsuite/gcc.dg/warn-strlen-no-nul.c | 10 ++++----- 6 files changed, 57 insertions(+), 29 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 12e7789..4385715 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-09-25 Bernd Edlinger + + PR c/87387 + * builtins.c (unterminated_array): Simplify. + * expr.c (string_constant): Handle SSA_NAME. Add more exceptions + where pointer arithmetic is safe. + 2018-09-25 Segher Boessenkool PR target/86987 diff --git a/gcc/builtins.c b/gcc/builtins.c index 1d4de09..5f00208 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -570,28 +570,9 @@ warn_string_no_nul (location_t loc, const char *fn, tree arg, tree decl) tree unterminated_array (tree exp) { - if (TREE_CODE (exp) == SSA_NAME) - { - gimple *stmt = SSA_NAME_DEF_STMT (exp); - if (!is_gimple_assign (stmt)) - return NULL_TREE; - - tree rhs1 = gimple_assign_rhs1 (stmt); - tree_code code = gimple_assign_rhs_code (stmt); - if (code == ADDR_EXPR - && TREE_CODE (TREE_OPERAND (rhs1, 0)) == ARRAY_REF) - rhs1 = rhs1; - else if (code != POINTER_PLUS_EXPR) - return NULL_TREE; - - exp = rhs1; - } - tree nonstr = NULL; - if (c_strlen (exp, 1, &nonstr, 1) == NULL && nonstr) - return nonstr; - - return NULL_TREE; + c_strlen (exp, 1, &nonstr); + return nonstr; } /* Compute the length of a null-terminated character string or wide diff --git a/gcc/expr.c b/gcc/expr.c index b8782b9..583c7f0 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -11372,7 +11372,10 @@ string_constant (tree arg, tree *ptr_offset, tree *mem_size, tree *decl) /* Avoid pointers to arrays (see bug 86622). */ if (POINTER_TYPE_P (TREE_TYPE (arg)) && TREE_CODE (TREE_TYPE (TREE_TYPE (arg))) == ARRAY_TYPE - && TREE_CODE (TREE_OPERAND (arg0, 0)) == ARRAY_REF) + && !(decl && !*decl) + && !(decl && tree_fits_uhwi_p (DECL_SIZE_UNIT (*decl)) + && mem_size && tree_fits_uhwi_p (*mem_size) + && tree_int_cst_equal (*mem_size, DECL_SIZE_UNIT (*decl)))) return NULL_TREE; tree type = TREE_TYPE (arg1); @@ -11381,6 +11384,38 @@ string_constant (tree arg, tree *ptr_offset, tree *mem_size, tree *decl) } return NULL_TREE; } + else if (TREE_CODE (arg) == SSA_NAME) + { + gimple *stmt = SSA_NAME_DEF_STMT (arg); + if (!is_gimple_assign (stmt)) + return NULL_TREE; + + tree rhs1 = gimple_assign_rhs1 (stmt); + tree_code code = gimple_assign_rhs_code (stmt); + if (code == ADDR_EXPR) + return string_constant (rhs1, ptr_offset, mem_size, decl); + else if (code != POINTER_PLUS_EXPR) + return NULL_TREE; + + tree offset; + if (tree str = string_constant (rhs1, &offset, mem_size, decl)) + { + /* Avoid pointers to arrays (see bug 86622). */ + if (POINTER_TYPE_P (TREE_TYPE (rhs1)) + && TREE_CODE (TREE_TYPE (TREE_TYPE (rhs1))) == ARRAY_TYPE + && !(decl && !*decl) + && !(decl && tree_fits_uhwi_p (DECL_SIZE_UNIT (*decl)) + && mem_size && tree_fits_uhwi_p (*mem_size) + && tree_int_cst_equal (*mem_size, DECL_SIZE_UNIT (*decl)))) + return NULL_TREE; + + tree rhs2 = gimple_assign_rhs2 (stmt); + tree type = TREE_TYPE (rhs2); + *ptr_offset = fold_build2 (PLUS_EXPR, type, offset, rhs2); + return str; + } + return NULL_TREE; + } else if (DECL_P (arg)) array = arg; else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 05dbb0d..7b26b89 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-25 Jeff Law + + * gcc.dg/warn-stpcpy-no-nul.c: Drop unnecessary xfails. + * gcc.dg/warn-stplen-no-nul.c: Likewise. + 2018-09-25 Alexandre Oliva * gnat.dg/dinst.adb: Adjust for locviews. diff --git a/gcc/testsuite/gcc.dg/warn-stpcpy-no-nul.c b/gcc/testsuite/gcc.dg/warn-stpcpy-no-nul.c index 78c4a7f..e718010 100644 --- a/gcc/testsuite/gcc.dg/warn-stpcpy-no-nul.c +++ b/gcc/testsuite/gcc.dg/warn-stpcpy-no-nul.c @@ -71,13 +71,13 @@ void test_two_dim_array (char *d) T (&b[3][1] + 1); /* { dg-warning "nul" } */ T (&b[3][v0]); /* { dg-warning "nul" } */ T (&b[3][1] + v0); /* { dg-warning "nul" } */ - T (&b[3][v0] + v1); /* { dg-warning "nul" "bug ???" { xfail *-*-* } } */ + T (&b[3][v0] + v1); /* { dg-warning "nul" } */ T (&b[i3][i1]); /* { dg-warning "nul" } */ T (&b[i3][i1] + i1); /* { dg-warning "nul" } */ T (&b[i3][v0]); /* { dg-warning "nul" } */ T (&b[i3][i1] + v0); /* { dg-warning "nul" } */ - T (&b[i3][v0] + v1); /* { dg-warning "nul" "bug ???" { xfail *-*-* } } */ + T (&b[i3][v0] + v1); /* { dg-warning "nul" } */ T (v0 ? "" : b[0]); T (v0 ? "" : b[1]); diff --git a/gcc/testsuite/gcc.dg/warn-strlen-no-nul.c b/gcc/testsuite/gcc.dg/warn-strlen-no-nul.c index 997dfc3..b716aa4 100644 --- a/gcc/testsuite/gcc.dg/warn-strlen-no-nul.c +++ b/gcc/testsuite/gcc.dg/warn-strlen-no-nul.c @@ -71,9 +71,9 @@ T (&b[3][v0] + v1); /* { dg-warning "nul" } */ T (&b[i3][i1]); /* { dg-warning "nul" } */ T (&b[i3][i1] + 1); /* { dg-warning "nul" } */ T (&b[i3][i1] + i1); /* { dg-warning "nul" } */ -T (&b[i3][v0]); /* { dg-warning "nul" "pr86919" { xfail *-*-* } } */ -T (&b[i3][i1] + v0); /* { dg-warning "nul" "pr86919" { xfail *-*-* } } */ -T (&b[i3][v0] + v1); /* { dg-warning "nul" "pr86919" { xfail *-*-* } } */ +T (&b[i3][v0]); /* { dg-warning "nul" } */ +T (&b[i3][i1] + v0); /* { dg-warning "nul" } */ +T (&b[i3][v0] + v1); /* { dg-warning "nul" } */ T (v0 ? "" : b[0]); T (v0 ? "" : b[1]); @@ -152,10 +152,10 @@ T (&s.b[1] + v0); /* { dg-warning "nul" } */ T (&s.b[i0]); /* { dg-warning "nul" } */ T (&s.b[i0] + i1); /* { dg-warning "nul" } */ -T (&s.b[i0] + v0); /* { dg-warning "nul" "pr86919" { xfail *-*-* } } */ +T (&s.b[i0] + v0); /* { dg-warning "nul" } */ T (&s.b[i1]); /* { dg-warning "nul" } */ T (&s.b[i1] + i1); /* { dg-warning "nul" } */ -T (&s.b[i1] + v0); /* { dg-warning "nul" "pr86919" { xfail *-*-* } } */ +T (&s.b[i1] + v0); /* { dg-warning "nul" } */ struct B { struct A a[2]; }; -- cgit v1.1 From ad117173a0d8a5412bc2b9fb99e2c9b1cb4036af Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Tue, 25 Sep 2018 22:52:38 +0000 Subject: RISC-V: Fix weak symbols with medany and explicit relocs. gcc/ * config/riscv/riscv.c (riscv_split_symbol): Mark auipc label as weak when target symbol is weak. gcc/testsuite/ * gcc.target/riscv/weak-1.c: New. From-SVN: r264586 --- gcc/ChangeLog | 5 +++++ gcc/config/riscv/riscv.c | 5 +++++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/riscv/weak-1.c | 14 ++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/gcc.target/riscv/weak-1.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4385715..d43e6d6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-09-25 Jim Wilson + + * config/riscv/riscv.c (riscv_split_symbol): Mark auipc label as weak + when target symbol is weak. + 2018-09-25 Bernd Edlinger PR c/87387 diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c index 9d6d981..381a203 100644 --- a/gcc/config/riscv/riscv.c +++ b/gcc/config/riscv/riscv.c @@ -1103,6 +1103,11 @@ riscv_split_symbol (rtx temp, rtx addr, machine_mode mode, rtx *low_out) label = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)); SYMBOL_REF_FLAGS (label) |= SYMBOL_FLAG_LOCAL; + /* ??? Ugly hack to make weak symbols work. May need to change the + RTL for the auipc and/or low patterns to get a better fix for + this. */ + if (! nonzero_address_p (addr)) + SYMBOL_REF_WEAK (label) = 1; if (temp == NULL) temp = gen_reg_rtx (Pmode); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7b26b89..f690e62 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-09-25 Jim Wilson + + * gcc.target/riscv/weak-1.c: New. + 2018-09-25 Jeff Law * gcc.dg/warn-stpcpy-no-nul.c: Drop unnecessary xfails. diff --git a/gcc/testsuite/gcc.target/riscv/weak-1.c b/gcc/testsuite/gcc.target/riscv/weak-1.c new file mode 100644 index 0000000..0f20501 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/weak-1.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-mcmodel=medany -mexplicit-relocs -O" } */ + +/* Verify that the branch doesn't get optimized away. */ +extern int weak_func(void) __attribute__ ((weak)); + +int +sub (void) +{ + if (weak_func) + return weak_func (); + return 0; +} +/* { dg-final { scan-assembler "b\(ne|eq\)" } } */ -- cgit v1.1 From 07a38de7ceed3080f6f95912624d7e01ae352b6d Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Wed, 26 Sep 2018 01:31:22 +0200 Subject: rs6000: Simplify "switch (which_alternative)" patterns A few of the rs6000 patterns use C code as output control string, where that code is just a "switch (which_alternative)" with all alternatives returning a constant string or just the result of a function call as template. Write such cases as just a list of templates, with the few pieces that are C code preceded by "*". * config/rs6000/altivec.md (*altivec_mov): Write the output control string as a list of templates instead of as C code. (*altivec_movti): Ditto. * config/rs6000/darwin.md (movdf_low_di): Ditto. From-SVN: r264587 --- gcc/ChangeLog | 7 +++++++ gcc/config/rs6000/altivec.md | 48 ++++++++++++++++++-------------------------- gcc/config/rs6000/darwin.md | 14 +++---------- 3 files changed, 29 insertions(+), 40 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d43e6d6..54d9ecf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-09-25 Segher Boessenkool + + * config/rs6000/altivec.md (*altivec_mov): Write the output + control string as a list of templates instead of as C code. + (*altivec_movti): Ditto. + * config/rs6000/darwin.md (movdf_low_di): Ditto. + 2018-09-25 Jim Wilson * config/riscv/riscv.c (riscv_split_symbol): Mark auipc label as weak diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md index 345be09..f37ad5a 100644 --- a/gcc/config/rs6000/altivec.md +++ b/gcc/config/rs6000/altivec.md @@ -245,21 +245,16 @@ "VECTOR_MEM_ALTIVEC_P (mode) && (register_operand (operands[0], mode) || register_operand (operands[1], mode))" -{ - switch (which_alternative) - { - case 0: return "stvx %1,%y0"; - case 1: return "lvx %0,%y1"; - case 2: return "vor %0,%1,%1"; - case 3: return "#"; - case 4: return "#"; - case 5: return "#"; - case 6: return "vxor %0,%0,%0"; - case 7: return output_vec_const_move (operands); - case 8: return "#"; - default: gcc_unreachable (); - } -} + "@ + stvx %1,%y0 + lvx %0,%y1 + vor %0,%1,%1 + # + # + # + vxor %0,%0,%0 + * return output_vec_const_move (operands); + #" [(set_attr "type" "vecstore,vecload,veclogical,store,load,*,veclogical,*,*") (set_attr "length" "4,4,4,20,20,20,4,8,32")]) @@ -272,20 +267,15 @@ "VECTOR_MEM_ALTIVEC_P (TImode) && (register_operand (operands[0], TImode) || register_operand (operands[1], TImode))" -{ - switch (which_alternative) - { - case 0: return "stvx %1,%y0"; - case 1: return "lvx %0,%y1"; - case 2: return "vor %0,%1,%1"; - case 3: return "#"; - case 4: return "#"; - case 5: return "#"; - case 6: return "vxor %0,%0,%0"; - case 7: return output_vec_const_move (operands); - default: gcc_unreachable (); - } -} + "@ + stvx %1,%y0 + lvx %0,%y1 + vor %0,%1,%1 + # + # + # + vxor %0,%0,%0 + * return output_vec_const_move (operands);" [(set_attr "type" "vecstore,vecload,veclogical,store,load,*,veclogical,*")]) ;; Load up a vector with the most significant bit set by loading up -1 and diff --git a/gcc/config/rs6000/darwin.md b/gcc/config/rs6000/darwin.md index 37acb31..2d6d1ca 100644 --- a/gcc/config/rs6000/darwin.md +++ b/gcc/config/rs6000/darwin.md @@ -60,17 +60,9 @@ You should have received a copy of the GNU General Public License (mem:DF (lo_sum:DI (match_operand:DI 1 "gpc_reg_operand" "b,b") (match_operand 2 "" ""))))] "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_64BIT" -{ - switch (which_alternative) - { - case 0: - return "lfd %0,lo16(%2)(%1)"; - case 1: - return "ld %0,lo16(%2)(%1)"; - default: - gcc_unreachable (); - } -} + "@ + lfd %0,lo16(%2)(%1) + ld %0,lo16(%2)(%1)" [(set_attr "type" "load")]) (define_insn "movdf_low_st_si" -- cgit v1.1 From 0bbadf8bc35fb4d4d4206d1d8164695cec45c1c2 Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Wed, 26 Sep 2018 01:42:28 +0200 Subject: rs6000: Use set_attr_alternative in some places Some code is much neater if it uses set_attr_alternative than if it does everything by hand. Change some patterns to use this shorthand. * config/rs6000/rs6000.md (*movcc_internal1): Use set_attr_alternative. (*call_indirect_nonlocal_sysv): Ditto. (*call_value_indirect_nonlocal_sysv): Ditto. (*sibcall_nonlocal_sysv): Ditto. (*sibcall_value_nonlocal_sysv): Ditto. (_): Ditto. (tf_): Ditto. From-SVN: r264588 --- gcc/ChangeLog | 10 +++ gcc/config/rs6000/rs6000.md | 184 +++++++++++++++++++------------------------- 2 files changed, 89 insertions(+), 105 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 54d9ecf..1b25c3e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,15 @@ 2018-09-25 Segher Boessenkool + * config/rs6000/rs6000.md (*movcc_internal1): Use set_attr_alternative. + (*call_indirect_nonlocal_sysv): Ditto. + (*call_value_indirect_nonlocal_sysv): Ditto. + (*sibcall_nonlocal_sysv): Ditto. + (*sibcall_value_nonlocal_sysv): Ditto. + (_): Ditto. + (tf_): Ditto. + +2018-09-25 Segher Boessenkool + * config/rs6000/altivec.md (*altivec_mov): Write the output control string as a list of templates instead of as C code. (*altivec_movti): Ditto. diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 4ce24d5..bcabf4d 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -7050,25 +7050,21 @@ mt%0 %1 lwz%U1%X1 %0,%1 stw%U0%X0 %1,%0" - [(set (attr "type") - (cond [(eq_attr "alternative" "0,3") - (const_string "cr_logical") - (eq_attr "alternative" "1,2") - (const_string "mtcr") - (eq_attr "alternative" "6,7") - (const_string "integer") - (eq_attr "alternative" "8") - (const_string "mfjmpr") - (eq_attr "alternative" "9") - (const_string "mtjmpr") - (eq_attr "alternative" "10") - (const_string "load") - (eq_attr "alternative" "11") - (const_string "store") - (match_test "TARGET_MFCRF") - (const_string "mfcrf") - ] - (const_string "mfcr"))) + [(set_attr_alternative "type" + [(const_string "cr_logical") + (const_string "mtcr") + (const_string "mtcr") + (const_string "cr_logical") + (if_then_else (match_test "TARGET_MFCRF") + (const_string "mfcrf") (const_string "mfcr")) + (if_then_else (match_test "TARGET_MFCRF") + (const_string "mfcrf") (const_string "mfcr")) + (const_string "integer") + (const_string "integer") + (const_string "mfjmpr") + (const_string "mtjmpr") + (const_string "load") + (const_string "store")]) (set_attr "length" "4,4,12,4,4,8,4,4,4,4,4,4")]) ;; For floating-point, we normally deal with the floating-point registers @@ -10431,22 +10427,17 @@ return "crset 2\;beq%T0l-"; } [(set_attr "type" "jmpreg,jmpreg,jmpreg,jmpreg") - (set (attr "length") - (cond [(and (eq (symbol_ref "which_alternative") (const_int 0)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 0))) - (const_string "8") - (and (eq (symbol_ref "which_alternative") (const_int 2)) - (ne (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 0))) - (const_string "8") - (and (eq (symbol_ref "which_alternative") (const_int 2)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 0))) - (const_string "12") - (eq (symbol_ref "which_alternative") (const_int 3)) - (const_string "8")] - (const_string "4")))]) + (set_attr_alternative "length" + [(if_then_else (eq (symbol_ref "rs6000_speculate_indirect_jumps") + (const_int 0)) + (const_string "8") + (const_string "4")) + (const_string "4") + (if_then_else (eq (symbol_ref "rs6000_speculate_indirect_jumps") + (const_int 0)) + (const_string "12") + (const_string "8")) + (const_string "8")])]) (define_insn_and_split "*call_nonlocal_sysv" [(call (mem:SI (match_operand:P 0 "symbol_ref_operand" "s,s")) @@ -10538,22 +10529,17 @@ return "crset 2\;beq%T1l-"; } [(set_attr "type" "jmpreg,jmpreg,jmpreg,jmpreg") - (set (attr "length") - (cond [(and (eq (symbol_ref "which_alternative") (const_int 0)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 0))) - (const_string "8") - (and (eq (symbol_ref "which_alternative") (const_int 2)) - (ne (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 0))) - (const_string "8") - (and (eq (symbol_ref "which_alternative") (const_int 2)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 0))) - (const_string "12") - (eq (symbol_ref "which_alternative") (const_int 3)) - (const_string "8")] - (const_string "4")))]) + (set_attr_alternative "length" + [(if_then_else (eq (symbol_ref "rs6000_speculate_indirect_jumps") + (const_int 0)) + (const_string "8") + (const_string "4")) + (const_string "4") + (if_then_else (eq (symbol_ref "rs6000_speculate_indirect_jumps") + (const_int 0)) + (const_string "12") + (const_string "8")) + (const_string "8")])]) (define_insn_and_split "*call_value_nonlocal_sysv" [(set (match_operand 0 "" "") @@ -10947,22 +10933,17 @@ return "b %z0"; } [(set_attr "type" "branch") - (set (attr "length") - (cond [(eq (symbol_ref "which_alternative") (const_int 1)) - (const_string "8") - (and (eq (symbol_ref "which_alternative") (const_int 2)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 0))) - (const_string "12") - (and (eq (symbol_ref "which_alternative") (const_int 3)) - (ne (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 0))) - (const_string "8") - (and (eq (symbol_ref "which_alternative") (const_int 3)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 0))) - (const_string "16")] - (const_string "4")))]) + (set_attr_alternative "length" + [(const_string "4") + (const_string "8") + (if_then_else (eq (symbol_ref "rs6000_speculate_indirect_jumps") + (const_int 0)) + (const_string "12") + (const_string "4")) + (if_then_else (eq (symbol_ref "rs6000_speculate_indirect_jumps") + (const_int 0)) + (const_string "16") + (const_string "8"))])]) (define_insn "*sibcall_value_nonlocal_sysv" [(set (match_operand 0 "" "") @@ -10997,22 +10978,17 @@ return "b %z1"; } [(set_attr "type" "branch") - (set (attr "length") - (cond [(eq (symbol_ref "which_alternative") (const_int 1)) - (const_string "8") - (and (eq (symbol_ref "which_alternative") (const_int 2)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 0))) - (const_string "12") - (and (eq (symbol_ref "which_alternative") (const_int 3)) - (ne (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 0))) - (const_string "8") - (and (eq (symbol_ref "which_alternative") (const_int 3)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 0))) - (const_string "16")] - (const_string "4")))]) + (set_attr_alternative "length" + [(const_string "4") + (const_string "8") + (if_then_else (eq (symbol_ref "rs6000_speculate_indirect_jumps") + (const_int 0)) + (const_string "12") + (const_string "4")) + (if_then_else (eq (symbol_ref "rs6000_speculate_indirect_jumps") + (const_int 0)) + (const_string "16") + (const_string "8"))])]) ;; AIX ABI sibling call patterns. @@ -12645,17 +12621,16 @@ return " $+8\;b %l0"; } [(set_attr "type" "branch") - (set (attr "length") - (cond [(eq (symbol_ref "which_alternative") (const_int 0)) - (if_then_else (and (ge (minus (match_dup 0) (pc)) - (const_int -32768)) - (lt (minus (match_dup 0) (pc)) - (const_int 32764))) - (const_int 4) - (const_int 8)) - (eq (symbol_ref "which_alternative") (const_int 1)) - (const_int 16)] - (const_int 20)))]) + (set_attr_alternative "length" + [(if_then_else (and (ge (minus (match_dup 0) (pc)) + (const_int -32768)) + (lt (minus (match_dup 0) (pc)) + (const_int 32764))) + (const_int 4) + (const_int 8)) + (const_string "16") + (const_string "20") + (const_string "20")])]) ;; Now the splitter if we could not allocate the CTR register (define_split @@ -12734,17 +12709,16 @@ } } [(set_attr "type" "branch") - (set (attr "length") - (cond [(eq (symbol_ref "which_alternative") (const_int 0)) - (if_then_else (and (ge (minus (match_dup 0) (pc)) - (const_int -32768)) - (lt (minus (match_dup 0) (pc)) - (const_int 32764))) - (const_int 4) - (const_int 8)) - (eq (symbol_ref "which_alternative") (const_int 1)) - (const_int 16)] - (const_int 20)))]) + (set_attr_alternative "length" + [(if_then_else (and (ge (minus (match_dup 0) (pc)) + (const_int -32768)) + (lt (minus (match_dup 0) (pc)) + (const_int 32764))) + (const_int 4) + (const_int 8)) + (const_string "16") + (const_string "20") + (const_string "20")])]) ;; Now the splitter if we could not allocate the CTR register (define_split -- cgit v1.1 From a1f9402ebd8935321a013695409772bac5715cde Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Wed, 26 Sep 2018 00:16:57 +0000 Subject: Daily bump. From-SVN: r264592 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 7abc1ff..c0bfb9b 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20180925 +20180926 -- cgit v1.1 From 201054a7f042f5f175605ca64accb2a812b27bfe Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 26 Sep 2018 03:29:07 +0000 Subject: runtime, os: fix the build on Solaris Reviewed-on: https://go-review.googlesource.com/137535 From-SVN: r264593 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 485906f..c306628 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -652fbfb7acfd81ceffe28e20984464aa7bb6024d +e7b98cf0a380eb45791cd5c52897224a686dcdec The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.1 From 392047f92ad5d7c388fe42dfaa1c72c8cc1996ec Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 26 Sep 2018 07:05:01 +0000 Subject: re PR debug/87428 ("Missed" inline instances cause bogus DWARF to be emitted) 2018-09-26 Richard Biener PR debug/87428 PR debug/87362 * tree-inline.c (expand_call_inline): When the location of the call is UNKNOWN_LOCATION use DECL_SOURCE_LOCATION or BUILTINS_LOCATION for the BLOCK_SOURCE_LOCATION of the inserted BLOCK to make inlined_function_outer_scope_p recognize it. * dwarf2out.c (add_call_src_coords_attributes): Do not add coords for reserved locations. From-SVN: r264594 --- gcc/ChangeLog | 12 ++++++++++++ gcc/dwarf2out.c | 4 ++++ gcc/tree-inline.c | 10 ++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1b25c3e..d3f3de2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2018-09-26 Richard Biener + + PR debug/87428 + PR debug/87362 + * tree-inline.c (expand_call_inline): When the location + of the call is UNKNOWN_LOCATION use DECL_SOURCE_LOCATION + or BUILTINS_LOCATION for the BLOCK_SOURCE_LOCATION of + the inserted BLOCK to make inlined_function_outer_scope_p + recognize it. + * dwarf2out.c (add_call_src_coords_attributes): Do not add + coords for reserved locations. + 2018-09-25 Segher Boessenkool * config/rs6000/rs6000.md (*movcc_internal1): Use set_attr_alternative. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 1607269..3c10ec8 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -23907,6 +23907,10 @@ gen_label_die (tree decl, dw_die_ref context_die) static inline void add_call_src_coords_attributes (tree stmt, dw_die_ref die) { + /* We can end up with BUILTINS_LOCATION here. */ + if (RESERVED_LOCATION_P (BLOCK_SOURCE_LOCATION (stmt))) + return; + expanded_location s = expand_location (BLOCK_SOURCE_LOCATION (stmt)); if (dwarf_version >= 3 || !dwarf_strict) diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 9352acc..b2cddc2 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4527,10 +4527,16 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id) not refer to them in any way to not break GC for locations. */ if (gimple_block (stmt)) { + /* We do want to assign a not UNKNOWN_LOCATION BLOCK_SOURCE_LOCATION + to make inlined_function_outer_scope_p return true on this BLOCK. */ + location_t loc = LOCATION_LOCUS (gimple_location (stmt)); + if (loc == UNKNOWN_LOCATION) + loc = LOCATION_LOCUS (DECL_SOURCE_LOCATION (fn)); + if (loc == UNKNOWN_LOCATION) + loc = BUILTINS_LOCATION; id->block = make_node (BLOCK); BLOCK_ABSTRACT_ORIGIN (id->block) = fn; - BLOCK_SOURCE_LOCATION (id->block) - = LOCATION_LOCUS (gimple_location (stmt)); + BLOCK_SOURCE_LOCATION (id->block) = loc; prepend_lexical_block (gimple_block (stmt), id->block); } -- cgit v1.1 From f29cfc6b15aa015eb2ec0069633f6ed2a4cff195 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 26 Sep 2018 07:36:45 +0000 Subject: arm.c (arm_reorg): Skip Thumb reorg pass for thunks. * config/arm/arm.c (arm_reorg): Skip Thumb reorg pass for thunks. (arm32_output_mi_thunk): Deal with long calls. From-SVN: r264595 --- gcc/ChangeLog | 5 +++++ gcc/config/arm/arm.c | 23 +++++++++++++++++++++-- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/g++.dg/other/thunk1.C | 26 ++++++++++++++++++++++++++ gcc/testsuite/g++.dg/other/thunk2a.C | 15 +++++++++++++++ gcc/testsuite/g++.dg/other/thunk2b.C | 16 ++++++++++++++++ gcc/testsuite/g++.dg/other/vthunk1.C | 26 -------------------------- 7 files changed, 90 insertions(+), 28 deletions(-) create mode 100644 gcc/testsuite/g++.dg/other/thunk1.C create mode 100644 gcc/testsuite/g++.dg/other/thunk2a.C create mode 100644 gcc/testsuite/g++.dg/other/thunk2b.C delete mode 100644 gcc/testsuite/g++.dg/other/vthunk1.C (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d3f3de2..4f606d3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-09-26 Eric Botcazou + + * config/arm/arm.c (arm_reorg): Skip Thumb reorg pass for thunks. + (arm32_output_mi_thunk): Deal with long calls. + 2018-09-26 Richard Biener PR debug/87428 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 6332e68..c6e3f79 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -17647,7 +17647,11 @@ arm_reorg (void) if (use_cmse) cmse_nonsecure_call_clear_caller_saved (); - if (TARGET_THUMB1) + + /* We cannot run the Thumb passes for thunks because there is no CFG. */ + if (cfun->is_thunk) + ; + else if (TARGET_THUMB1) thumb1_reorg (); else if (TARGET_THUMB2) thumb2_reorg (); @@ -26721,6 +26725,8 @@ static void arm32_output_mi_thunk (FILE *file, tree, HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset, tree function) { + const bool long_call_p = arm_is_long_call_p (function); + /* On ARM, this_regno is R0 or R1 depending on whether the function returns an aggregate or not. */ @@ -26758,9 +26764,22 @@ arm32_output_mi_thunk (FILE *file, tree, HOST_WIDE_INT delta, TREE_USED (function) = 1; } rtx funexp = XEXP (DECL_RTL (function), 0); + if (long_call_p) + { + emit_move_insn (temp, funexp); + funexp = temp; + } funexp = gen_rtx_MEM (FUNCTION_MODE, funexp); - rtx_insn * insn = emit_call_insn (gen_sibcall (funexp, const0_rtx, NULL_RTX)); + rtx_insn *insn = emit_call_insn (gen_sibcall (funexp, const0_rtx, NULL_RTX)); SIBLING_CALL_P (insn) = 1; + emit_barrier (); + + /* Indirect calls require a bit of fixup in PIC mode. */ + if (long_call_p) + { + split_all_insns_noflow (); + arm_reorg (); + } insn = get_insns (); shorten_branches (insn); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f690e62..60b23ba 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-09-26 Eric Botcazou + + * g++.dg/other/vthunk1.C: Rename to... + * g++.dg/other/thunk1.C: ...this. + * g++.dg/other/thunk2a.C: New test. + * g++.dg/other/thunk2b.C: Likewise. + 2018-09-25 Jim Wilson * gcc.target/riscv/weak-1.c: New. diff --git a/gcc/testsuite/g++.dg/other/thunk1.C b/gcc/testsuite/g++.dg/other/thunk1.C new file mode 100644 index 0000000..9016562 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/thunk1.C @@ -0,0 +1,26 @@ +// PR c++/12007 Multiple inheritance float pass by value fails +// { dg-do run } + +extern "C" void abort (void); + +class gvImpl +{ +public: + virtual void PutVal(float value){} +}; + +class foo { public: virtual void Bar(){} }; + +class myGv: public foo, public gvImpl +{ + void PutVal(float value){ if (value != 3.14159f) abort (); } +}; + +myGv x; +gvImpl* object = &x; + +int main() +{ + object->PutVal(3.14159f); + return 0; +} diff --git a/gcc/testsuite/g++.dg/other/thunk2a.C b/gcc/testsuite/g++.dg/other/thunk2a.C new file mode 100644 index 0000000..8e5ebd4 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/thunk2a.C @@ -0,0 +1,15 @@ +// { dg-do compile { target arm*-*-* } } +// { dg-options "-mlong-calls -ffunction-sections" } + +class a { +public: + virtual ~a(); +}; + +class b : virtual a {}; + +class c : b { + ~c(); +}; + +c::~c() {} diff --git a/gcc/testsuite/g++.dg/other/thunk2b.C b/gcc/testsuite/g++.dg/other/thunk2b.C new file mode 100644 index 0000000..c8f4570 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/thunk2b.C @@ -0,0 +1,16 @@ +// { dg-do compile { target arm*-*-* } } +// { dg-options "-mlong-calls -ffunction-sections" } +// { dg-additional-options "-fPIC" { target fpic } } + +class a { +public: + virtual ~a(); +}; + +class b : virtual a {}; + +class c : b { + ~c(); +}; + +c::~c() {} diff --git a/gcc/testsuite/g++.dg/other/vthunk1.C b/gcc/testsuite/g++.dg/other/vthunk1.C deleted file mode 100644 index 9016562..0000000 --- a/gcc/testsuite/g++.dg/other/vthunk1.C +++ /dev/null @@ -1,26 +0,0 @@ -// PR c++/12007 Multiple inheritance float pass by value fails -// { dg-do run } - -extern "C" void abort (void); - -class gvImpl -{ -public: - virtual void PutVal(float value){} -}; - -class foo { public: virtual void Bar(){} }; - -class myGv: public foo, public gvImpl -{ - void PutVal(float value){ if (value != 3.14159f) abort (); } -}; - -myGv x; -gvImpl* object = &x; - -int main() -{ - object->PutVal(3.14159f); - return 0; -} -- cgit v1.1 From 9464ed971f63a98ecbd07a4cdb69c1624a33b4db Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 26 Sep 2018 09:08:24 +0000 Subject: re PR c++/67656 ([concepts] matched variadics in expression constraint report as unmatched) 2018-09-26 Paolo Carlini PR c++/67656 * g++.dg/concepts/pr67656.C: New. From-SVN: r264596 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/concepts/pr67656.C | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 gcc/testsuite/g++.dg/concepts/pr67656.C (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 60b23ba..531e2f1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-26 Paolo Carlini + + PR c++/67656 + * g++.dg/concepts/pr67656.C: New. + 2018-09-26 Eric Botcazou * g++.dg/other/vthunk1.C: Rename to... diff --git a/gcc/testsuite/g++.dg/concepts/pr67656.C b/gcc/testsuite/g++.dg/concepts/pr67656.C new file mode 100644 index 0000000..2f1030e --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/pr67656.C @@ -0,0 +1,19 @@ +// { dg-do compile { target c++11 } } +// { dg-additional-options "-fconcepts" } + +template +void consume(Xs&&...) {} + +template + struct A { + template + requires requires(Ys... ys) { + consume(Xs{ys}...); + } + A(Ys&&... ys) { + } +}; + +int main() { + A a(55, 2); +} -- cgit v1.1 From 539866048e546c696afbb49d4366fe6477f50130 Mon Sep 17 00:00:00 2001 From: Jerome Lambourg Date: Wed, 26 Sep 2018 09:13:03 +0000 Subject: [Ada] Vxlink: kill a CodePeer warning 2018-09-26 Jerome Lambourg gcc/ada/ * vxlink.adb: Kill a CodePeer warning. From-SVN: r264597 --- gcc/ada/ChangeLog | 4 ++++ gcc/ada/vxlink.adb | 3 +++ 2 files changed, 7 insertions(+) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e51a2a3..42391f6 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2018-09-26 Jerome Lambourg + + * vxlink.adb: Kill a CodePeer warning. + 2018-09-24 Eric Botcazou PR ada/87396 diff --git a/gcc/ada/vxlink.adb b/gcc/ada/vxlink.adb index 400ad22..f36b9b9 100644 --- a/gcc/ada/vxlink.adb +++ b/gcc/ada/vxlink.adb @@ -245,6 +245,9 @@ package body VxLink is GNAT.OS_Lib.Free (Args); if Status /= 0 then + pragma Annotate (Codepeer, False_Positive, + "test always false", + "Status modified by Get_Command_Output"); Ada.Text_IO.Put_Line (Ret); Set_Error_State (Base_Name (Arguments.First_Element) & -- cgit v1.1 From 5e14418b07376add230c52ac4c53efd65fd3b8c9 Mon Sep 17 00:00:00 2001 From: Matthew Malcomson Date: Wed, 26 Sep 2018 09:13:18 +0000 Subject: A few places in the arm and aarch64 backends check whether an atomic operation needs acquire or release semantics. A few places in the arm and aarch64 backends check whether an atomic operation needs acquire or release semantics. This is generally done with a check like (is_mm_relaxed (model) || is_mm_consume (model) || is_mm_release (model)) In this patch we introduce two helper functions to make things a little tidier. There are a few places in the arm/ backend that check whether an operation needs memory model semantics with an idiom that can now be replaced with the new aarch_mm_needs_* functions, so we make that replacement. There is also some backslash removal to make things a little tidier. Full bootstrap and regression test plus cross-compilation regression tests done on arm-none-linux-gnueabihf. Ok for trunk? gcc/ChangeLog: 2018-09-20 Matthew Malcomson * config/arm/arm.c (arm_split_compare_and_swap, arm_split_atomic_op): Use new helper functions. * config/arm/sync.md (atomic_load, atomic_store): Use new helper functions. * config/arm/aarch-common-protos.h (aarch_mm_needs_acquire, aarch_mm_needs_release): New declarations. * config/arm/aarch-common.c (aarch_mm_needs_acquire, aarch_mm_needs_release): New. From-SVN: r264598 --- gcc/ChangeLog | 11 +++++++++++ gcc/config/arm/aarch-common-protos.h | 2 ++ gcc/config/arm/aarch-common.c | 23 +++++++++++++++++++++++ gcc/config/arm/arm.c | 23 +++++++---------------- gcc/config/arm/sync.md | 22 ++++++++++------------ 5 files changed, 53 insertions(+), 28 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4f606d3..2eeacef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2018-09-26 Matthew Malcomson + + * config/arm/arm.c (arm_split_compare_and_swap, arm_split_atomic_op): + Use new helper functions. + * config/arm/sync.md (atomic_load, atomic_store): + Use new helper functions. + * config/arm/aarch-common-protos.h (aarch_mm_needs_acquire, + aarch_mm_needs_release): New declarations. + * config/arm/aarch-common.c (aarch_mm_needs_acquire, + aarch_mm_needs_release): New. + 2018-09-26 Eric Botcazou * config/arm/arm.c (arm_reorg): Skip Thumb reorg pass for thunks. diff --git a/gcc/config/arm/aarch-common-protos.h b/gcc/config/arm/aarch-common-protos.h index 6204482..b9a9b04 100644 --- a/gcc/config/arm/aarch-common-protos.h +++ b/gcc/config/arm/aarch-common-protos.h @@ -28,6 +28,8 @@ extern int aarch_crypto_can_dual_issue (rtx_insn *, rtx_insn *); extern bool aarch_rev16_p (rtx); extern bool aarch_rev16_shleft_mask_imm_p (rtx, machine_mode); extern bool aarch_rev16_shright_mask_imm_p (rtx, machine_mode); +extern bool aarch_mm_needs_acquire (rtx); +extern bool aarch_mm_needs_release (rtx); extern int arm_early_load_addr_dep (rtx, rtx); extern int arm_early_load_addr_dep_ptr (rtx, rtx); extern int arm_early_store_addr_dep (rtx, rtx); diff --git a/gcc/config/arm/aarch-common.c b/gcc/config/arm/aarch-common.c index f0675a3..14eb495 100644 --- a/gcc/config/arm/aarch-common.c +++ b/gcc/config/arm/aarch-common.c @@ -29,6 +29,7 @@ #include "tm.h" #include "rtl.h" #include "rtl-iter.h" +#include "memmodel.h" /* In ARMv8-A there's a general expectation that AESE/AESMC and AESD/AESIMC sequences of the form: @@ -230,6 +231,28 @@ aarch_rev16_p (rtx x) return is_rev; } +/* Return non-zero if the RTX representing a memory model is a memory model + that needs acquire semantics. */ +bool +aarch_mm_needs_acquire (rtx const_int) +{ + enum memmodel model = memmodel_from_int (INTVAL (const_int)); + return !(is_mm_relaxed (model) + || is_mm_consume (model) + || is_mm_release (model)); +} + +/* Return non-zero if the RTX representing a memory model is a memory model + that needs release semantics. */ +bool +aarch_mm_needs_release (rtx const_int) +{ + enum memmodel model = memmodel_from_int (INTVAL (const_int)); + return !(is_mm_relaxed (model) + || is_mm_consume (model) + || is_mm_acquire (model)); +} + /* Return nonzero if the CONSUMER instruction (a load) does need PRODUCER's value to calculate the address. */ int diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index c6e3f79..8810df5 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -28645,7 +28645,7 @@ arm_expand_compare_and_swap (rtx operands[]) void arm_split_compare_and_swap (rtx operands[]) { - rtx rval, mem, oldval, newval, neg_bval; + rtx rval, mem, oldval, newval, neg_bval, mod_s_rtx; machine_mode mode; enum memmodel mod_s, mod_f; bool is_weak; @@ -28657,20 +28657,16 @@ arm_split_compare_and_swap (rtx operands[]) oldval = operands[3]; newval = operands[4]; is_weak = (operands[5] != const0_rtx); - mod_s = memmodel_from_int (INTVAL (operands[6])); + mod_s_rtx = operands[6]; + mod_s = memmodel_from_int (INTVAL (mod_s_rtx)); mod_f = memmodel_from_int (INTVAL (operands[7])); neg_bval = TARGET_THUMB1 ? operands[0] : operands[8]; mode = GET_MODE (mem); bool is_armv8_sync = arm_arch8 && is_mm_sync (mod_s); - bool use_acquire = TARGET_HAVE_LDACQ - && !(is_mm_relaxed (mod_s) || is_mm_consume (mod_s) - || is_mm_release (mod_s)); - - bool use_release = TARGET_HAVE_LDACQ - && !(is_mm_relaxed (mod_s) || is_mm_consume (mod_s) - || is_mm_acquire (mod_s)); + bool use_acquire = TARGET_HAVE_LDACQ && aarch_mm_needs_acquire (mod_s_rtx); + bool use_release = TARGET_HAVE_LDACQ && aarch_mm_needs_release (mod_s_rtx); /* For ARMv8, the load-acquire is too weak for __sync memory orders. Instead, a full barrier is emitted after the store-release. */ @@ -28765,13 +28761,8 @@ arm_split_atomic_op (enum rtx_code code, rtx old_out, rtx new_out, rtx mem, bool is_armv8_sync = arm_arch8 && is_mm_sync (model); - bool use_acquire = TARGET_HAVE_LDACQ - && !(is_mm_relaxed (model) || is_mm_consume (model) - || is_mm_release (model)); - - bool use_release = TARGET_HAVE_LDACQ - && !(is_mm_relaxed (model) || is_mm_consume (model) - || is_mm_acquire (model)); + bool use_acquire = TARGET_HAVE_LDACQ && aarch_mm_needs_acquire (model_rtx); + bool use_release = TARGET_HAVE_LDACQ && aarch_mm_needs_release (model_rtx); /* For ARMv8, a load-acquire is too weak for __sync memory orders. Instead, a full barrier is emitted after the store-release. */ diff --git a/gcc/config/arm/sync.md b/gcc/config/arm/sync.md index 7141c76..08fc5d1 100644 --- a/gcc/config/arm/sync.md +++ b/gcc/config/arm/sync.md @@ -70,20 +70,19 @@ VUNSPEC_LDA))] "TARGET_HAVE_LDACQ" { - enum memmodel model = memmodel_from_int (INTVAL (operands[2])); - if (is_mm_relaxed (model) || is_mm_consume (model) || is_mm_release (model)) + if (aarch_mm_needs_acquire (operands[2])) { if (TARGET_THUMB1) - return \"ldr\\t%0, %1\"; + return "lda\t%0, %1"; else - return \"ldr%?\\t%0, %1\"; + return "lda%?\t%0, %1"; } else { if (TARGET_THUMB1) - return \"lda\\t%0, %1\"; + return "ldr\t%0, %1"; else - return \"lda%?\\t%0, %1\"; + return "ldr%?\t%0, %1"; } } [(set_attr "arch" "32,v8mb,any") @@ -97,20 +96,19 @@ VUNSPEC_STL))] "TARGET_HAVE_LDACQ" { - enum memmodel model = memmodel_from_int (INTVAL (operands[2])); - if (is_mm_relaxed (model) || is_mm_consume (model) || is_mm_acquire (model)) + if (aarch_mm_needs_release (operands[2])) { if (TARGET_THUMB1) - return \"str\t%1, %0\"; + return "stl\t%1, %0"; else - return \"str%?\t%1, %0\"; + return "stl%?\t%1, %0"; } else { if (TARGET_THUMB1) - return \"stl\t%1, %0\"; + return "str\t%1, %0"; else - return \"stl%?\t%1, %0\"; + return "str%?\t%1, %0"; } } [(set_attr "arch" "32,v8mb,any") -- cgit v1.1 From e5d163235117f137292f450a2d38b9695f6c6311 Mon Sep 17 00:00:00 2001 From: Gary Dismukes Date: Wed, 26 Sep 2018 09:15:48 +0000 Subject: [Ada] Fix miscellaneous typos 2018-09-26 Gary Dismukes gcc/ada/ * exp_ch9.adb, layout.adb, sem_attr.adb, sem_res.adb: Fix miscellaneous typos. From-SVN: r264599 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/exp_ch9.adb | 4 ++-- gcc/ada/layout.adb | 2 +- gcc/ada/sem_attr.adb | 4 ++-- gcc/ada/sem_res.adb | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 42391f6..d5e4018 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-09-26 Gary Dismukes + + * exp_ch9.adb, layout.adb, sem_attr.adb, sem_res.adb: Fix + miscellaneous typos. + 2018-09-26 Jerome Lambourg * vxlink.adb: Kill a CodePeer warning. diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 4470c4e..a62ba2d 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -481,7 +481,7 @@ package body Exp_Ch9 is -- to be E. Bod is either a block or a subprogram body. Used after -- expanding various kinds of entry bodies into their corresponding -- constructs. This is needed during unnesting to determine whether a - -- body geenrated for an entry or an accept alternative includes uplevel + -- body generated for an entry or an accept alternative includes uplevel -- references. function Trivial_Accept_OK return Boolean; @@ -14854,7 +14854,7 @@ package body Exp_Ch9 is function Reset_Scope (N : Node_Id) return Traverse_Result; -- Temporaries may have been declared during expansion of the procedure -- created for an entry body or an accept alternative. Indicate that - -- their scope is the new body, to unsure proper generation of uplevel + -- their scope is the new body, to ensure proper generation of uplevel -- references where needed during unnesting. procedure Reset_Scopes is new Traverse_Proc (Reset_Scope); diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb index a7b24ab..91640c1 100644 --- a/gcc/ada/layout.adb +++ b/gcc/ada/layout.adb @@ -328,7 +328,7 @@ package body Layout is -- If unnesting subprograms, subprogram access types contain the -- address of both the subprogram and an activation record. But if we -- set that, we'll get a warning on different unchecked conversion - -- sizes in the RTS. So leave unset ub that case. + -- sizes in the RTS. So leave unset in that case. elsif Unnest_Subprogram_Mode and then Is_Access_Subprogram_Type (E) diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 96eb488..715ec95 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -11249,9 +11249,9 @@ package body Sem_Attr is -- The above sets the Scope of the flag entity to the -- current scope, in which the attribute appears, but -- the flag declaration has been inserted after that - -- of Subp_Id, so the scope of the flag the same as + -- of Subp_Id, so the scope of the flag is the same as -- that of Subp_Id. This is relevant when unnesting, - -- whereh processing depends on correct scope settingl + -- where processing depends on correct scope setting. Set_Scope (Flag_Id, Scop); end if; diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 2002b75..5354d81 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -6067,7 +6067,7 @@ package body Sem_Res is -- (including the body of another expression function) which would -- place the freeze node in the wrong scope. An expression function -- is frozen in the usual fashion, by the appearance of a real body, - -- or at the end of a declarative part. However an implcit call to + -- or at the end of a declarative part. However an implicit call to -- an expression function may appear when it is part of a default -- expression in a call to an initialiation procedure, and must be -- frozen now, even if the body is inserted at a later point. -- cgit v1.1 From 98f57e4ca3ee558c5a88d471019de0cf005967e9 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 26 Sep 2018 09:16:18 +0000 Subject: [Ada] Vxlink: minor reformatting 2018-09-26 Arnaud Charlet gcc/ada * vxlink.adb: Minor reformatting. From-SVN: r264600 --- gcc/ada/ChangeLog | 4 ++++ gcc/ada/vxlink.adb | 57 ++++++++++++++++++++++++------------------------------ 2 files changed, 29 insertions(+), 32 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d5e4018..0649a27 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2018-09-26 Arnaud Charlet + + * vxlink.adb: Minor reformatting. + 2018-09-26 Gary Dismukes * exp_ch9.adb, layout.adb, sem_attr.adb, sem_res.adb: Fix diff --git a/gcc/ada/vxlink.adb b/gcc/ada/vxlink.adb index f36b9b9..efb11cc 100644 --- a/gcc/ada/vxlink.adb +++ b/gcc/ada/vxlink.adb @@ -40,8 +40,10 @@ package body VxLink is Error_State : Boolean := False; function Triplet return String; + -- ??? missing spec function Which (Exe : String) return String; + -- ??? missing spec ------------- -- Triplet -- @@ -69,8 +71,7 @@ package body VxLink is -- Which -- ----------- - function Which (Exe : String) return String - is + function Which (Exe : String) return String is Suffix : GNAT.OS_Lib.String_Access := Get_Executable_Suffix; Basename : constant String := Exe & Suffix.all; Path : GNAT.OS_Lib.String_Access := Getenv ("PATH"); @@ -108,8 +109,7 @@ package body VxLink is -- Set_Verbose -- ----------------- - procedure Set_Verbose (Value : Boolean) - is + procedure Set_Verbose (Value : Boolean) is begin Verbose := Value; end Set_Verbose; @@ -118,8 +118,7 @@ package body VxLink is -- Is_Verbose -- ---------------- - function Is_Verbose return Boolean - is + function Is_Verbose return Boolean is begin return Verbose; end Is_Verbose; @@ -128,8 +127,7 @@ package body VxLink is -- Set_Error_State -- --------------------- - procedure Set_Error_State (Message : String) - is + procedure Set_Error_State (Message : String) is begin Log_Error ("Error: " & Message); Error_State := True; @@ -140,8 +138,7 @@ package body VxLink is -- Is_Error_State -- -------------------- - function Is_Error_State return Boolean - is + function Is_Error_State return Boolean is begin return Error_State; end Is_Error_State; @@ -150,8 +147,7 @@ package body VxLink is -- Log_Info -- -------------- - procedure Log_Info (S : String) - is + procedure Log_Info (S : String) is begin if Verbose then Ada.Text_IO.Put_Line (S); @@ -162,8 +158,7 @@ package body VxLink is -- Log_Error -- --------------- - procedure Log_Error (S : String) - is + procedure Log_Error (S : String) is begin Ada.Text_IO.Put_Line (Ada.Text_IO.Standard_Error, S); end Log_Error; @@ -172,8 +167,7 @@ package body VxLink is -- Run -- --------- - procedure Run (Arguments : Arguments_List) - is + procedure Run (Arguments : Arguments_List) is Output : constant String := Run (Arguments); begin if not Is_Error_State then @@ -187,13 +181,12 @@ package body VxLink is -- Run -- --------- - function Run (Arguments : Arguments_List) return String - is + function Run (Arguments : Arguments_List) return String is Args : GNAT.OS_Lib.Argument_List_Access := new GNAT.OS_Lib.Argument_List (1 .. Natural (Arguments.Length) - 1); Base : constant String := Base_Name (Arguments.First_Element); - Status : aliased Integer := 0; + Debug_Line : Unbounded_String; Add_Quotes : Boolean; @@ -234,13 +227,15 @@ package body VxLink is end if; declare - Ret : constant String := - Get_Command_Output - (Command => Arguments.First_Element, - Arguments => Args.all, - Input => "", - Status => Status'Access, - Err_To_Out => True); + Status : aliased Integer := 0; + Ret : constant String := + Get_Command_Output + (Command => Arguments.First_Element, + Arguments => Args.all, + Input => "", + Status => Status'Access, + Err_To_Out => True); + begin GNAT.OS_Lib.Free (Args); @@ -248,6 +243,7 @@ package body VxLink is pragma Annotate (Codepeer, False_Positive, "test always false", "Status modified by Get_Command_Output"); + Ada.Text_IO.Put_Line (Ret); Set_Error_State (Base_Name (Arguments.First_Element) & @@ -262,8 +258,7 @@ package body VxLink is -- Gcc -- --------- - function Gcc return String - is + function Gcc return String is begin return Which (Triplet & "gcc"); end Gcc; @@ -272,8 +267,7 @@ package body VxLink is -- Gxx -- --------- - function Gxx return String - is + function Gxx return String is begin return Which (Triplet & "g++"); end Gxx; @@ -282,8 +276,7 @@ package body VxLink is -- Nm -- -------- - function Nm return String - is + function Nm return String is begin return Which (Triplet & "nm"); end Nm; -- cgit v1.1 From f0f2d1fc033cbe56098f7261d91ef6a8130d0b27 Mon Sep 17 00:00:00 2001 From: Maroua Maalej Date: Wed, 26 Sep 2018 09:16:23 +0000 Subject: [Ada] SPARK: update borrowing effects for IN parameters 2018-09-26 Maroua Maalej gcc/ada/ * sem_spark.adb (Check_Param_In, Setup_Parameter_Or_Global): Change the operation associated to assigning to an IN parameter. In SPARK, IN access-to-variable is an observe operation for a function, and borrow operation for a procedure. From-SVN: r264601 --- gcc/ada/ChangeLog | 7 +++++++ gcc/ada/sem_spark.adb | 51 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 19 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 0649a27..8d7f5c2 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2018-09-26 Maroua Maalej + + * sem_spark.adb (Check_Param_In, Setup_Parameter_Or_Global): + Change the operation associated to assigning to an IN parameter. + In SPARK, IN access-to-variable is an observe operation for a + function, and borrow operation for a procedure. + 2018-09-26 Arnaud Charlet * vxlink.adb: Minor reformatting. diff --git a/gcc/ada/sem_spark.adb b/gcc/ada/sem_spark.adb index e522620..920c3ff 100644 --- a/gcc/ada/sem_spark.adb +++ b/gcc/ada/sem_spark.adb @@ -505,13 +505,12 @@ package body Sem_SPARK is type Checking_Mode is (Read, - -- Default mode. Checks that paths have Read_Perm permission. + -- Default mode Move, - -- Regular moving semantics. Checks that paths have - -- Unrestricted permission. After moving a path, its permission is set - -- to Unrestricted and the permission of its extensions is set - -- to Unrestricted. + -- Regular moving semantics. Checks that paths have Unrestricted + -- permission. After moving a path, the permission of both it and + -- its extensions are set to Unrestricted. Assign, -- Used for the target of an assignment, or an actual parameter with @@ -1985,14 +1984,22 @@ package body Sem_SPARK is if not Is_Access_Constant (Etype (Formal)) then - -- Formal IN parameter, named/anonymous access to variable + -- Formal IN parameter, named/anonymous access-to-variable -- type. + -- + -- In SPARK, IN access-to-variable is an observe operation + -- for a function, and a borrow operation for a procedure. - Current_Checking_Mode := Borrow; - Check_Node (Actual); + if Ekind (Scope (Formal)) = E_Function then + Current_Checking_Mode := Observe; + Check_Node (Actual); + else + Current_Checking_Mode := Borrow; + Check_Node (Actual); + end if; - -- Formal IN parameter, access to constant type - -- Formal IN parameter, access to named constant type + -- Formal IN parameter, access-to-constant type + -- Formal IN parameter, access-to-named-constant type elsif not Is_Anonymous_Access_Type (Etype (Formal)) then Error_Msg_N ("assignment not allowed, Ownership Aspect" @@ -3396,7 +3403,7 @@ package body Sem_SPARK is end if; declare - -- Set state to Borrowed to the path and any of its prefixes + -- Set state to Moved to the path and any of its prefixes Tree : constant Perm_Tree_Access := Set_Perm_Prefixes (N, Moved); @@ -3410,7 +3417,7 @@ package body Sem_SPARK is return; end if; - -- Set state to Borrowed on any strict extension of the path + -- Set state to Moved on any strict extension of the path Set_Perm_Extensions (Tree, Moved); end; @@ -4466,18 +4473,24 @@ package body Sem_SPARK is when E_In_Parameter => - -- Handling global variables as in parameters here - -- Remove the following condition once decided how globals - -- should be considered. + -- Handling global variables as IN parameters here. + -- Remove the following condition once it's decided how globals + -- should be considered. ??? + -- + -- In SPARK, IN access-to-variable is an observe operation for + -- a function, and a borrow operation for a procedure. if not Global_Var then if (Is_Access_Type (Etype (Id)) - and then Is_Access_Constant (Etype (Id)) - and then Is_Anonymous_Access_Type (Etype (Id))) + and then Is_Access_Constant (Etype (Id)) + and then Is_Anonymous_Access_Type (Etype (Id))) + or else + (Is_Access_Type (Etype (Id)) + and then Ekind (Scope (Id)) = E_Function) or else (not Is_Access_Type (Etype (Id)) - and then Is_Deep (Etype (Id)) - and then not Is_Anonymous_Access_Type (Etype (Id))) + and then Is_Deep (Etype (Id)) + and then not Is_Anonymous_Access_Type (Etype (Id))) then Elem.all.Tree.Permission := Observed; Elem.all.Tree.Children_Permission := Observed; -- cgit v1.1 From 33d2551767100d004ffa85efbd1165cb731dc87d Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Wed, 26 Sep 2018 09:16:28 +0000 Subject: [Ada] Fix ICE related to type freezing 2018-09-26 Ed Schonberg gcc/ada/ * contracts.adb (Expand_Subprogram_Contract, Process_Preconditions_For): Apply Freeze_Expr_Types to the expression for a precondition of an expression function that is a completion, when the completion appears in the private part and the declaration it completes is in the visible part of the same package. * freeze.adb (Freeze_Expr_Types): Do not establish the scope of the operation if it is already installed, as will be the case when called to analyze the contract oc the subprogram (which happens when generating code inside the subprogram body). From-SVN: r264602 --- gcc/ada/ChangeLog | 13 +++++++++++++ gcc/ada/contracts.adb | 26 ++++++++++++++++++++++++-- gcc/ada/freeze.adb | 17 +++++++++++++---- 3 files changed, 50 insertions(+), 6 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8d7f5c2..e5be5bb 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,16 @@ +2018-09-26 Ed Schonberg + + * contracts.adb (Expand_Subprogram_Contract, + Process_Preconditions_For): Apply Freeze_Expr_Types to the + expression for a precondition of an expression function that is + a completion, when the completion appears in the private part + and the declaration it completes is in the visible part of the + same package. + * freeze.adb (Freeze_Expr_Types): Do not establish the scope of + the operation if it is already installed, as will be the case + when called to analyze the contract oc the subprogram (which + happens when generating code inside the subprogram body). + 2018-09-26 Maroua Maalej * sem_spark.adb (Check_Param_In, Setup_Parameter_Or_Global): diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index 26a8d28..136c05c 100644 --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -33,6 +33,7 @@ with Exp_Prag; use Exp_Prag; with Exp_Tss; use Exp_Tss; with Exp_Util; use Exp_Util; with Freeze; use Freeze; +with Lib; use Lib; with Namet; use Namet; with Nlists; use Nlists; with Nmake; use Nmake; @@ -591,7 +592,8 @@ package body Contracts is if Skip_Assert_Exprs then null; - -- Otherwise analyze the pre/postconditions. Their expressions + -- Otherwise analyze the pre/postconditions. + -- If these come from an aspect specification, their expressions -- might include references to types that are not frozen yet, in the -- case where the body is a rewritten expression function that is a -- completion, so freeze all types within before constructing the @@ -2856,12 +2858,25 @@ package body Contracts is procedure Process_Preconditions_For (Subp_Id : Entity_Id) is Items : constant Node_Id := Contract (Subp_Id); + Bod : constant Node_Id := Unit_Declaration_Node (Body_Id); Decl : Node_Id; + Freeze_T : Boolean; Prag : Node_Id; Subp_Decl : Node_Id; begin - -- Process the contract + -- Process the contract. If the body is an expression function + -- that is a completion, freeze types within, because this may + -- not have been done yet, when the subprogram declaration and + -- its completion by an expression function appear in distinct + -- declarative lists of the same unit (visible and private). + + Freeze_T := Was_Expression_Function (Bod) + and then Sloc (Body_Id) /= Sloc (Subp_Id) + and then In_Same_Source_Unit (Body_Id, Subp_Id) + and then List_Containing (Bod) /= + List_Containing (Unit_Declaration_Node (Subp_Id)) + and then not In_Instance; if Present (Items) then Prag := Pre_Post_Conditions (Items); @@ -2869,6 +2884,13 @@ package body Contracts is if Pragma_Name (Prag) = Name_Precondition and then Is_Checked (Prag) then + if Freeze_T + and then Present (Corresponding_Aspect (Prag)) + then + Freeze_Expr_Types (Subp_Id, Standard_Boolean, + Expression (Corresponding_Aspect (Prag)), Bod); + end if; + Prepend_To_Decls_Or_Save (Prag); end if; diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 5036a79..4ff0d38 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -7824,11 +7824,20 @@ package body Freeze is -- minimum decoration needed to locate referenced unfrozen types -- without adding any decoration to the function expression. - Push_Scope (Def_Id); - Install_Formals (Def_Id); + -- This routine is also applied to expressions in the contract for + -- the subprogram. If that happens when expanding the code for + -- pre/postconditions during expansion of the subprogram body, the + -- subprogram is already installed. - Preanalyze_Spec_Expression (Dup_Expr, Typ); - End_Scope; + if Def_Id /= Current_Scope then + Push_Scope (Def_Id); + Install_Formals (Def_Id); + + Preanalyze_Spec_Expression (Dup_Expr, Typ); + End_Scope; + else + Preanalyze_Spec_Expression (Dup_Expr, Typ); + end if; -- Restore certain attributes of Def_Id since the preanalysis may -- have introduced itypes to this scope, thus modifying attributes -- cgit v1.1 From ef8f9700fa4cb1d8cd6c3f38510da08d562b0791 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Wed, 26 Sep 2018 09:16:33 +0000 Subject: [Ada] Unnesting: fix handling of up level refs for entries 2018-09-26 Ed Schonberg gcc/ada/ * exp_unst.adb: Fix handling of up level references for entries. From-SVN: r264603 --- gcc/ada/ChangeLog | 4 +++ gcc/ada/exp_unst.adb | 92 +++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 87 insertions(+), 9 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e5be5bb..cbedcc0 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,9 @@ 2018-09-26 Ed Schonberg + * exp_unst.adb: Fix handling of up level references for entries. + +2018-09-26 Ed Schonberg + * contracts.adb (Expand_Subprogram_Contract, Process_Preconditions_For): Apply Freeze_Expr_Types to the expression for a precondition of an expression function that is diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index d688157..e31d84a 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -260,8 +260,8 @@ package body Exp_Unst is E := Ultimate_Alias (E); -- The body of a protected operation has a different name and - -- has been scanned at this point, and thus has an entry in the - -- subprogram table. + -- has been scanned at this point, and thus has an entry in + -- the subprogram table. if E = Sub and then Convention (E) = Convention_Protected then E := Protected_Body_Subprogram (E); @@ -535,6 +535,29 @@ package body Exp_Unst is end loop; end; + -- The type of the prefix may be have an uplevel + -- reference if this needs bounds. + + if Nkind (N) = N_Attribute_Reference then + declare + Attr : constant Attribute_Id := + Get_Attribute_Id (Attribute_Name (N)); + begin + if (Attr = Attribute_First + or else Attr = Attribute_Last + or else Attr = Attribute_Length) + and then Is_Constrained (Etype (Prefix (N))) + then + declare + DT : Boolean := False; + begin + Check_Static_Type + (Etype (Prefix (N)), Empty, DT); + end; + end if; + end; + end if; + -- Binary operator cases. These can apply to arrays for -- which we may need bounds. @@ -699,6 +722,9 @@ package body Exp_Unst is and then Corresponding_Procedure (Callee) = Caller then return; + + elsif Ekind_In (Callee, E_Entry, E_Entry_Family) then + return; end if; -- We have a new uplevel referenced entity @@ -748,6 +774,22 @@ package body Exp_Unst is ARECnU => Empty)); Set_Subps_Index (E, UI_From_Int (Subps.Last)); + + -- If we marked this reachable because it's in a synchronized + -- unit, we have to mark all enclosing subprograms as reachable + -- as well. + + if In_Synchronized_Unit (E) then + declare + S : Entity_Id := E; + + begin + for J in reverse 1 .. L - 1 loop + S := Enclosing_Subprogram (S); + Subps.Table (Subp_Index (S)).Reachable := True; + end loop; + end; + end if; end Register_Subprogram; -- Start of processing for Visit_Node @@ -1109,12 +1151,24 @@ package body Exp_Unst is end if; -- Pragmas and component declarations can be ignored + -- Quantified expressions are expanded into explicit loops + -- and the original epression must be ignored. when N_Component_Declaration | N_Pragma + | N_Quantified_Expression => return Skip; + -- We want to skip the function spec for a generic function + -- to avoid looking at any generic types that might be in + -- its formals. + + when N_Function_Specification => + if Is_Generic_Subprogram (Unique_Defining_Entity (N)) then + return Skip; + end if; + -- Otherwise record an uplevel reference in a local identifier when others => @@ -1965,13 +2019,26 @@ package body Exp_Unst is -- If we have a loop parameter, we have -- to insert before the first statement -- of the loop. Ins points to the - -- N_Loop_Parameter_Specification. - - if Ekind (Ent) = E_Loop_Parameter then - Ins := - First - (Statements (Parent (Parent (Ins)))); - Insert_Before (Ins, Asn); + -- N_Loop_Parameter_Specification or to + -- an N_Iterator_Specification. + + if Nkind_In (Ins, N_Iterator_Specification, + N_Loop_Parameter_Specification) + then + -- Quantified expression are rewrittne + -- as loops during expansion. + + if Nkind (Parent (Ins)) = + N_Quantified_Expression + then + null; + + else + Ins := + First + (Statements (Parent (Parent (Ins)))); + Insert_Before (Ins, Asn); + end if; else Insert_After (Ins, Asn); @@ -2369,6 +2436,13 @@ package body Exp_Unst is elsif Nkind (N) in N_Body_Stub then Do_Search (Library_Unit (N)); + + -- Skip generic packages + + elsif Nkind (N) = N_Package_Body + and then Ekind (Corresponding_Spec (N)) = E_Generic_Package + then + return Skip; end if; return OK; -- cgit v1.1 From 6d7d342a391f9ab3b0fa6779bfe9657d574695e2 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Wed, 26 Sep 2018 09:16:39 +0000 Subject: [Ada] Disable special handling for preconditions specified by pragmas 2018-09-26 Ed Schonberg gcc/ada/ * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): The analysis of preconditions specified by pragmas (rather than aspects) is not delayed, and therefore expressions functions that are completions do not need special handling during expansion. From-SVN: r264604 --- gcc/ada/ChangeLog | 8 ++++++++ gcc/ada/contracts.adb | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index cbedcc0..e1dd3eb 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,13 @@ 2018-09-26 Ed Schonberg + * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): The + analysis of preconditions specified by pragmas (rather than + aspects) is not delayed, and therefore expressions functions + that are completions do not need special handling during + expansion. + +2018-09-26 Ed Schonberg + * exp_unst.adb: Fix handling of up level references for entries. 2018-09-26 Ed Schonberg diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index 136c05c..8b18c39 100644 --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -620,7 +620,9 @@ package body Contracts is Prag := Pre_Post_Conditions (Items); while Present (Prag) loop - if Freeze_Types then + if Freeze_Types + and then Present (Corresponding_Aspect (Prag)) + then Freeze_Expr_Types (Def_Id => Subp_Id, Typ => Standard_Boolean, -- cgit v1.1 From 1ac984f5952c52f0f70e64f5ab7a99fa62877df7 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 26 Sep 2018 09:16:44 +0000 Subject: [Ada] Introduce -gnatd_A to set Opt.Disable_ALI_File This will allow us to remove the import of flag_compare_debug in lib-writ.adb in a second stage. 2018-09-26 Arnaud Charlet gcc/ada/ * gnat1drv.adb (Adjust_Global_Switches): -gnatd_A sets Opt.Disable_ALI_File. * debug.adb: Update debug flags documentation. From-SVN: r264605 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/debug.adb | 4 +++- gcc/ada/gnat1drv.adb | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e1dd3eb..f726904 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Arnaud Charlet + + * gnat1drv.adb (Adjust_Global_Switches): -gnatd_A sets + Opt.Disable_ALI_File. + * debug.adb: Update debug flags documentation. + 2018-09-26 Ed Schonberg * contracts.adb (Analyze_Entry_Or_Subprogram_Contract): The diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index 0324433..95efede 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -172,7 +172,7 @@ package body Debug is -- d_y -- d_z - -- d_A + -- d_A Stop generation of ALI file -- d_B -- d_C -- d_D @@ -843,6 +843,8 @@ package body Debug is -- a call to routine Ada.Synchronous_Task_Control.Suspend_Until_True -- or Ada.Synchronous_Barriers.Wait_For_Release. + -- d_A Do not generate ALI files by setting Opt.Disable_ALI_File. + -- d_L Output trace information on elaboration checking. This debug switch -- causes output to be generated showing each call or instantiation as -- it is checked, and the progress of the recursive trace through diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb index 4b8db7d..a3d905b 100644 --- a/gcc/ada/gnat1drv.adb +++ b/gcc/ada/gnat1drv.adb @@ -161,6 +161,12 @@ procedure Gnat1drv is Modify_Tree_For_C := True; end if; + -- -gnatd_A disables generation of ALI files. + + if Debug_Flag_Underscore_AA then + Disable_ALI_File := True; + end if; + -- Set all flags required when generating C code if Generate_C_Code then -- cgit v1.1 From 3b9d159401751981118415b472dd0bdb68e862f6 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 26 Sep 2018 09:16:49 +0000 Subject: [Ada] Wrong handling of address clause for limited record type 2018-09-26 Eric Botcazou gcc/ada/ * gcc-interface/decl.c (gnat_to_gnu_entity) : Adjust code retrieving the address when a clause has already been processed. * gcc-interface/trans.c (gnat_to_gnu) : For an object with a Freeze node, build a meaningful expression. gcc/testsuite/ * gnat.dg/addr12.adb, gnat.dg/addr12_a.adb, gnat.dg/addr12_a.ads, gnat.dg/addr12_b.adb, gnat.dg/addr12_b.ads, gnat.dg/addr12_c.ads: New testcase. From-SVN: r264606 --- gcc/ada/ChangeLog | 9 +++++++++ gcc/ada/gcc-interface/decl.c | 8 ++++---- gcc/ada/gcc-interface/trans.c | 32 ++++++++++++++++++++++++++------ gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gnat.dg/addr12.adb | 8 ++++++++ gcc/testsuite/gnat.dg/addr12_a.adb | 20 ++++++++++++++++++++ gcc/testsuite/gnat.dg/addr12_a.ads | 3 +++ gcc/testsuite/gnat.dg/addr12_b.adb | 8 ++++++++ gcc/testsuite/gnat.dg/addr12_b.ads | 24 ++++++++++++++++++++++++ gcc/testsuite/gnat.dg/addr12_c.ads | 6 ++++++ 10 files changed, 114 insertions(+), 10 deletions(-) create mode 100644 gcc/testsuite/gnat.dg/addr12.adb create mode 100644 gcc/testsuite/gnat.dg/addr12_a.adb create mode 100644 gcc/testsuite/gnat.dg/addr12_a.ads create mode 100644 gcc/testsuite/gnat.dg/addr12_b.adb create mode 100644 gcc/testsuite/gnat.dg/addr12_b.ads create mode 100644 gcc/testsuite/gnat.dg/addr12_c.ads (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f726904..b296122 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,12 @@ +2018-09-26 Eric Botcazou + + * gcc-interface/decl.c (gnat_to_gnu_entity) : Adjust + code retrieving the address when a clause has already been + processed. + * gcc-interface/trans.c (gnat_to_gnu) + : For an object with a Freeze + node, build a meaningful expression. + 2018-09-26 Arnaud Charlet * gnat1drv.adb (Adjust_Global_Switches): -gnatd_A sets diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 6f605bd..c15b0c8 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -1147,10 +1147,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) if (definition && Present (Address_Clause (gnat_entity))) { const Node_Id gnat_clause = Address_Clause (gnat_entity); - Node_Id gnat_address = Expression (gnat_clause); - tree gnu_address - = present_gnu_tree (gnat_entity) - ? get_gnu_tree (gnat_entity) : gnat_to_gnu (gnat_address); + const Node_Id gnat_address = Expression (gnat_clause); + tree gnu_address = present_gnu_tree (gnat_entity) + ? TREE_OPERAND (get_gnu_tree (gnat_entity), 0) + : gnat_to_gnu (gnat_address); save_gnu_tree (gnat_entity, NULL_TREE, false); diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 940bf5f..3e129b6 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -7570,13 +7570,33 @@ gnat_to_gnu (Node_Id gnat_node) /* And we only deal with 'Address if the object has a Freeze node. */ gnat_temp = Entity (Name (gnat_node)); - if (No (Freeze_Node (gnat_temp))) - break; + if (Freeze_Node (gnat_temp)) + { + tree gnu_address = gnat_to_gnu (Expression (gnat_node)); + + /* Get the value to use as the address and save it as the equivalent + for the object; when it is frozen, gnat_to_gnu_entity will do the + right thing. For a subprogram, put the naked address but build a + meaningfull expression for an object in case its address is taken + before the Freeze node is encountered; this can happen if the type + of the object is limited and it is initialized with the result of + a function call. */ + if (Is_Subprogram (gnat_temp)) + gnu_result = gnu_address; + else + { + tree gnu_type = gnat_to_gnu_type (Etype (gnat_temp)); + /* Drop atomic and volatile qualifiers for the expression. */ + gnu_type = TYPE_MAIN_VARIANT (gnu_type); + gnu_type + = build_reference_type_for_mode (gnu_type, ptr_mode, true); + gnu_address = convert (gnu_type, gnu_address); + gnu_result + = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_address); + } - /* Get the value to use as the address and save it as the equivalent - for the object. When it is frozen, gnat_to_gnu_entity will do the - right thing. */ - save_gnu_tree (gnat_temp, gnat_to_gnu (Expression (gnat_node)), true); + save_gnu_tree (gnat_temp, gnu_result, true); + } break; case N_Enumeration_Representation_Clause: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 531e2f1..c97b9c5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -5,6 +5,12 @@ 2018-09-26 Eric Botcazou + * gnat.dg/addr12.adb, gnat.dg/addr12_a.adb, + gnat.dg/addr12_a.ads, gnat.dg/addr12_b.adb, + gnat.dg/addr12_b.ads, gnat.dg/addr12_c.ads: New testcase. + +2018-09-26 Eric Botcazou + * g++.dg/other/vthunk1.C: Rename to... * g++.dg/other/thunk1.C: ...this. * g++.dg/other/thunk2a.C: New test. diff --git a/gcc/testsuite/gnat.dg/addr12.adb b/gcc/testsuite/gnat.dg/addr12.adb new file mode 100644 index 0000000..7143d50 --- /dev/null +++ b/gcc/testsuite/gnat.dg/addr12.adb @@ -0,0 +1,8 @@ +-- { dg-do run } + +with Addr12_A; + +procedure Addr12 is +begin + Addr12_A.Do_Stuff; +end; diff --git a/gcc/testsuite/gnat.dg/addr12_a.adb b/gcc/testsuite/gnat.dg/addr12_a.adb new file mode 100644 index 0000000..fac145a --- /dev/null +++ b/gcc/testsuite/gnat.dg/addr12_a.adb @@ -0,0 +1,20 @@ +with Addr12_B; +with Addr12_C; +with System; + +package body Addr12_A is + + First_Address : constant System.Address := Addr12_C.First'Address; + Second_Address : constant System.Address := Addr12_C.Second'Address; + + First_Channel : Addr12_B.Shared_Context_Type := Addr12_B.Initial_State + with Volatile, Async_Readers, Address => First_Address; + + Second_Channel : Addr12_B.Shared_Context_Type := Addr12_B.Initial_State + with Volatile, Async_Readers; + + for Second_Channel'Address use Second_Address; + + procedure Do_Stuff is null; + +end Addr12_A; diff --git a/gcc/testsuite/gnat.dg/addr12_a.ads b/gcc/testsuite/gnat.dg/addr12_a.ads new file mode 100644 index 0000000..3278b8c --- /dev/null +++ b/gcc/testsuite/gnat.dg/addr12_a.ads @@ -0,0 +1,3 @@ +package Addr12_A is + procedure Do_Stuff; +end Addr12_A; diff --git a/gcc/testsuite/gnat.dg/addr12_b.adb b/gcc/testsuite/gnat.dg/addr12_b.adb new file mode 100644 index 0000000..b35c44f --- /dev/null +++ b/gcc/testsuite/gnat.dg/addr12_b.adb @@ -0,0 +1,8 @@ +package body Addr12_B is + + function Initial_State return Shared_Context_Type is + begin + return Shared_Context_Type'(Data => (others => Null_Entry)); + end Initial_State; + +end Addr12_B; diff --git a/gcc/testsuite/gnat.dg/addr12_b.ads b/gcc/testsuite/gnat.dg/addr12_b.ads new file mode 100644 index 0000000..8b58400 --- /dev/null +++ b/gcc/testsuite/gnat.dg/addr12_b.ads @@ -0,0 +1,24 @@ +package Addr12_B is + + type Entry_Type is record + Auto_Init : Boolean; + end record; + + type Entry_Range is range 1 .. 20; + type Entries_Type is array (Entry_Range) of Entry_Type; + + Null_Entry : constant Entry_Type := Entry_Type'(Auto_Init => False); + + type Shared_Context_Type is limited private; + + function Initial_State return Shared_Context_Type + with Volatile_Function; + +private + + type Shared_Context_Type is limited record + Data : Entries_Type; + end record + with Volatile; + +end Addr12_B; diff --git a/gcc/testsuite/gnat.dg/addr12_c.ads b/gcc/testsuite/gnat.dg/addr12_c.ads new file mode 100644 index 0000000..957189b --- /dev/null +++ b/gcc/testsuite/gnat.dg/addr12_c.ads @@ -0,0 +1,6 @@ +with Addr12_B; + +package Addr12_C is + First : Addr12_B.Shared_Context_Type; + Second : Addr12_B.Shared_Context_Type; +end Addr12_C; -- cgit v1.1 From 738b83cd32bc4ebf651ef517cd880f04500d07af Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 26 Sep 2018 09:16:54 +0000 Subject: [Ada] Set Current_Error_Node directly This changes gigi to set Current_Error_Node directly, which should result in a more robust error handling. 2018-09-26 Eric Botcazou gcc/ada/ * gcc-interface/gigi.h (error_gnat_node): Delete. * gcc-interface/trans.c (error_gnat_node): Likewise. (gigi): Replace it with Current_Error_Node. (gnat_to_gnu): Likewise. * gcc-interface/utils.c (rest_of_subprog_body_compilation): Likewise. * gcc-interface/misc.c (internal_error_function): Do not set it. From-SVN: r264607 --- gcc/ada/ChangeLog | 10 ++++++++++ gcc/ada/gcc-interface/gigi.h | 3 --- gcc/ada/gcc-interface/misc.c | 1 - gcc/ada/gcc-interface/trans.c | 7 ++----- gcc/ada/gcc-interface/utils.c | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index b296122..d6d46ee 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,15 @@ 2018-09-26 Eric Botcazou + * gcc-interface/gigi.h (error_gnat_node): Delete. + * gcc-interface/trans.c (error_gnat_node): Likewise. + (gigi): Replace it with Current_Error_Node. + (gnat_to_gnu): Likewise. + * gcc-interface/utils.c (rest_of_subprog_body_compilation): + Likewise. + * gcc-interface/misc.c (internal_error_function): Do not set it. + +2018-09-26 Eric Botcazou + * gcc-interface/decl.c (gnat_to_gnu_entity) : Adjust code retrieving the address when a clause has already been processed. diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index eb64a8b..3029732 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -214,9 +214,6 @@ extern void destroy_gnat_decl (void); /* Highest number in the front-end node table. */ extern int max_gnat_nodes; -/* Current node being treated, in case abort called. */ -extern Node_Id error_gnat_node; - /* True when gigi is being called on an analyzed but unexpanded tree, and the only purpose of the call is to properly annotate types with representation information. */ diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 9ee73b9..16a9d2c 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -347,7 +347,6 @@ internal_error_function (diagnostic_context *context, const char *msgid, sp_loc.Bounds = &temp_loc; sp_loc.Array = loc; - Current_Error_Node = error_gnat_node; Compiler_Abort (sp, sp_loc, true); } diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 3e129b6..12f6a87 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -86,9 +86,6 @@ struct List_Header *List_Headers_Ptr; /* Highest number in the front-end node table. */ int max_gnat_nodes; -/* Current node being treated, in case abort called. */ -Node_Id error_gnat_node; - /* True when gigi is being called on an analyzed but unexpanded tree, and the only purpose of the call is to properly annotate types with representation information. */ @@ -719,7 +716,7 @@ gigi (Node_Id gnat_root, destroy_gnat_utils (); /* We cannot track the location of errors past this point. */ - error_gnat_node = Empty; + Current_Error_Node = Empty; } /* Return a subprogram decl corresponding to __gnat_rcheck_xx for the given @@ -5910,7 +5907,7 @@ gnat_to_gnu (Node_Id gnat_node) bool sync = false; /* Save node number for error message and set location information. */ - error_gnat_node = gnat_node; + Current_Error_Node = gnat_node; Sloc_to_locus (Sloc (gnat_node), &input_location); /* If we are only annotating types and this node is a statement, return diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 313d984..73ab562b 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -3389,7 +3389,7 @@ void rest_of_subprog_body_compilation (tree subprog_decl) { /* We cannot track the location of errors past this point. */ - error_gnat_node = Empty; + Current_Error_Node = Empty; /* If we're only annotating types, don't actually compile this function. */ if (type_annotate_only) -- cgit v1.1 From 05a84157e98dfb25500705c0bc2570139a01075f Mon Sep 17 00:00:00 2001 From: Justin Squirek Date: Wed, 26 Sep 2018 09:16:59 +0000 Subject: [Ada] Regression in partial compilation of RCI units This patch fixes an issue whereby the compilation of partial sources (packages without bodies that require them) would not occur when said sources were remote call interfaces. This is required because such interfaces may have bodies that only exist on the server side or vice versa 2018-09-26 Justin Squirek gcc/ada/ * lib-writ.adb, lib-writ.ads (Write_With_Lines): Add documentation and an extra conditional check for RCI units so that generated ali files will list the spec only instead of a body when a body is not found. From-SVN: r264608 --- gcc/ada/ChangeLog | 7 +++++++ gcc/ada/lib-writ.adb | 11 ++++++++--- gcc/ada/lib-writ.ads | 17 +++++++++-------- 3 files changed, 24 insertions(+), 11 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d6d46ee..e139e2d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2018-09-26 Justin Squirek + + * lib-writ.adb, lib-writ.ads (Write_With_Lines): Add + documentation and an extra conditional check for RCI units so + that generated ali files will list the spec only instead of a + body when a body is not found. + 2018-09-26 Eric Botcazou * gcc-interface/gigi.h (error_gnat_node): Delete. diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb index a4f9526..f035b45 100644 --- a/gcc/ada/lib-writ.adb +++ b/gcc/ada/lib-writ.adb @@ -960,9 +960,14 @@ package body Lib.Writ is -- In GNATprove mode we must write the spec of a unit which -- requires a body if that body is not found. This will - -- allow partial analysis on incomplete sources. - - if GNATprove_Mode then + -- allow partial analysis on incomplete sources. Also, in + -- the case of a unit that is a remote call interface, the + -- bodies of packages may not exist but still may form a + -- valid program - so we handle that here as well. + + if GNATprove_Mode + or else Is_Remote_Call_Interface (Cunit_Entity (Unum)) + then Body_Fname := Get_File_Name (Uname => Get_Body_Name (Uname), diff --git a/gcc/ada/lib-writ.ads b/gcc/ada/lib-writ.ads index df391a8..9c7c270 100644 --- a/gcc/ada/lib-writ.ads +++ b/gcc/ada/lib-writ.ads @@ -624,18 +624,19 @@ package Lib.Writ is -- Z unit-name [source-name lib-name] [E] [EA] [ED] [AD] -- One W line is present for each unit that is mentioned in an explicit - -- non-limited with clause by the current unit. One Y line is present + -- nonlimited with clause by the current unit. One Y line is present -- for each unit that is mentioned in an explicit limited with clause -- by the current unit. One Z line is present for each unit that is -- only implicitly withed by the current unit. The first parameter is -- the unit name in internal format. The second parameter is the file - -- name of the body unit on which the current compliation depends - - -- except when in GNATprove mode. In GNATprove mode, when packages - -- which require a body have no associated source file, the file name - -- of the spec is used instead to allow partial analysis of incomplete - -- sources. The third parameter is the file name of the library - -- information file that contains the results of compiling this unit. - -- The optional modifiers are used as follows: + -- name of the body unit on which the current compilation unit depends, + -- except when in GNATprove mode or when the unit is a remote call + -- interface. In these cases, when packages that require a body have + -- no associated source file, the file name of the spec is used instead + -- to allow partial analysis of incomplete sources. The third parameter + -- is the file name of the library information file that contains the + -- results of compiling this unit. The optional modifiers are used as + -- follows: -- E pragma Elaborate applies to this unit -- cgit v1.1 From 81d85d4baeb6ada71652a556cec1663511c3933c Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 26 Sep 2018 09:17:05 +0000 Subject: [Ada] Fix assertion failure on record subtype with -gnatRj The JSON output of the -gnatR machinery was choking on record subtypes and the change fixes this oversight. The following package must now compile properly with -gnatRj: package P is type Rec (D : Integer) is record C : Integer; case D is when 1 => S : String (1 .. 20); when 2 => B : Boolean; when others => Ch1 : Character; F : Float; Ch2 : Character; end case; end record; subtype Rec1 is Rec (1); end P; 2018-09-26 Eric Botcazou gcc/ada/ * repinfo.adb (List_Record_Layout): Be prepared for JSON output. (List_Record_Info): Use the flat representation for record subtypes in the JSON format. From-SVN: r264609 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/repinfo.adb | 18 ++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e139e2d..83685b4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Eric Botcazou + + * repinfo.adb (List_Record_Layout): Be prepared for JSON output. + (List_Record_Info): Use the flat representation for record + subtypes in the JSON format. + 2018-09-26 Justin Squirek * lib-writ.adb, lib-writ.ads (Write_With_Lines): Add diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb index b2bc9ca..d5c099f 100644 --- a/gcc/ada/repinfo.adb +++ b/gcc/ada/repinfo.adb @@ -1358,7 +1358,8 @@ package body Repinfo is Starting_First_Bit : Uint := Uint_0; Prefix : String := "") is - Comp : Entity_Id; + Comp : Entity_Id; + First : Boolean := True; begin Comp := First_Component_Or_Discriminant (Ent); @@ -1413,6 +1414,15 @@ package body Repinfo is goto Continue; end if; + if List_Representation_Info_To_JSON then + if First then + Write_Eol; + First := False; + else + Write_Line (","); + end if; + end if; + List_Component_Layout (Comp, Starting_Position, Starting_First_Bit, Prefix); end; @@ -1678,7 +1688,11 @@ package body Repinfo is Write_Line (","); Write_Str (" ""record"": ["); - List_Structural_Record_Layout (Ent, Ent); + if Is_Base_Type (Ent) then + List_Structural_Record_Layout (Ent, Ent); + else + List_Record_Layout (Ent); + end if; Write_Eol; Write_Str (" ]"); -- cgit v1.1 From 4453a8221c65f386ae361670fa932643521374d7 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 26 Sep 2018 09:17:10 +0000 Subject: [Ada] ICE on array of task type with -gnatct 2018-09-26 Eric Botcazou gcc/ada/ * gcc-interface/decl.c (gnat_to_gnu_entity) : In -gnatct mode, process the discriminants only for a definition. From-SVN: r264610 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/gcc-interface/decl.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 83685b4..a0252f8 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,10 @@ 2018-09-26 Eric Botcazou + * gcc-interface/decl.c (gnat_to_gnu_entity) : In + -gnatct mode, process the discriminants only for a definition. + +2018-09-26 Eric Botcazou + * repinfo.adb (List_Record_Layout): Be prepared for JSON output. (List_Record_Info): Use the flat representation for record subtypes in the JSON format. diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index c15b0c8..8dd62f7 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -4158,7 +4158,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) part of the associated body so they need to be translated. */ if (type_annotate_only && gnat_equiv_type == gnat_entity) { - if (Has_Discriminants (gnat_entity) + if (definition + && Has_Discriminants (gnat_entity) && Root_Type (gnat_entity) == gnat_entity) { tree gnu_field_list = NULL_TREE; -- cgit v1.1 From bcbe14db192f03018ea74cf6eb24c04a110ecac0 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Wed, 26 Sep 2018 09:17:16 +0000 Subject: [Ada] Missing predicate check on return value The semantics of the return statement includes an implicit conversion of the value to the return type of the funcction. This conversion, as elsewhere, entails a predicate check if the return type has a predicate aspect. We do not apply the check to a case expression because in the context of a return statement it will be expanded into a series of return statements, each of which will receive a predicate check. 2018-09-26 Ed Schonberg gcc/ada/ * sem_ch6.adb (Analyze_Function_Return): If the return type has a dynamic_predicate, apply a Predicate_Check to the expression, given that it is implicitly converted to the return type. Exclude case expressions from the check, because in this context the expression is expanded into individual return statements. gcc/testsuite/ * gnat.dg/predicate3.adb, gnat.dg/predicate3_pkg.ads: New testcase. From-SVN: r264611 --- gcc/ada/ChangeLog | 8 +++++++ gcc/ada/sem_ch6.adb | 10 ++++++++ gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/gnat.dg/predicate3.adb | 39 ++++++++++++++++++++++++++++++++ gcc/testsuite/gnat.dg/predicate3_pkg.ads | 22 ++++++++++++++++++ 5 files changed, 84 insertions(+) create mode 100644 gcc/testsuite/gnat.dg/predicate3.adb create mode 100644 gcc/testsuite/gnat.dg/predicate3_pkg.ads (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a0252f8..9db2747 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2018-09-26 Ed Schonberg + + * sem_ch6.adb (Analyze_Function_Return): If the return type has + a dynamic_predicate, apply a Predicate_Check to the expression, + given that it is implicitly converted to the return type. + Exclude case expressions from the check, because in this context + the expression is expanded into individual return statements. + 2018-09-26 Eric Botcazou * gcc-interface/decl.c (gnat_to_gnu_entity) : In diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index b330426..d0617fe 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -1060,6 +1060,16 @@ package body Sem_Ch6 is Apply_Constraint_Check (Expr, R_Type); + -- The return value is converted to the return type of the function, + -- which implies a predicate check if the return type is predicated. + -- We do not apply the check to a case expression because it will + -- be expanded into a series of return statements, each of which + -- will receive a predicate check. + + if Nkind (Expr) /= N_Case_Expression then + Apply_Predicate_Check (Expr, R_Type); + end if; + -- Ada 2005 (AI-318-02): When the result type is an anonymous access -- type, apply an implicit conversion of the expression to that type -- to force appropriate static and run-time accessibility checks. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c97b9c5..3c95432 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-26 Ed Schonberg + + * gnat.dg/predicate3.adb, gnat.dg/predicate3_pkg.ads: New + testcase. + 2018-09-26 Paolo Carlini PR c++/67656 diff --git a/gcc/testsuite/gnat.dg/predicate3.adb b/gcc/testsuite/gnat.dg/predicate3.adb new file mode 100644 index 0000000..0d649ed --- /dev/null +++ b/gcc/testsuite/gnat.dg/predicate3.adb @@ -0,0 +1,39 @@ +-- { dg-do run } +-- { dg-options "-gnata" } + +with Ada.Assertions, Ada.Text_IO; +use Ada.Assertions, Ada.Text_IO; + +with Predicate3_Pkg; +use Predicate3_Pkg; + +procedure Predicate3 is + Got_Assertion : Boolean := False; +begin + + begin + Put_Line (Good (C)'Image); + exception + when Assertion_Error => + Got_Assertion := True; + end; + + if not Got_Assertion then + raise Program_Error; + end if; + + Got_Assertion := False; + declare + X: Priv; + begin + X := Wrong; + exception + when Assertion_Error => + Got_Assertion := True; + end; + + if not Got_Assertion then + raise Program_Error; + end if; + +end Predicate3; diff --git a/gcc/testsuite/gnat.dg/predicate3_pkg.ads b/gcc/testsuite/gnat.dg/predicate3_pkg.ads new file mode 100644 index 0000000..a5c2e4c --- /dev/null +++ b/gcc/testsuite/gnat.dg/predicate3_pkg.ads @@ -0,0 +1,22 @@ +package Predicate3_Pkg is + + type Priv is private; + C: constant Priv; + + function Test (X: Priv) return Boolean; + subtype Subt is Priv with Dynamic_Predicate => (Test (Subt)); + + function Wrong return Subt; + function Good (X: Subt) return Boolean; + +private + + type Priv is new Integer; + C: constant Priv := -1; + + function Test (X: Priv) return Boolean is (X > 0); + + function Wrong return Subt is (-1); + function Good (X: Subt) return Boolean is (True); + +end Predicate3_Pkg; -- cgit v1.1 From b45a9ff305f536031a12509c6c6e7aea9cb7f884 Mon Sep 17 00:00:00 2001 From: Justin Squirek Date: Wed, 26 Sep 2018 09:17:21 +0000 Subject: [Ada] Crash on expression functions within quantified expressions This patch fixes an issue whereby using a call to an expression function as the domain of iteration for a loop would trigger a crash due to the function not being frozen appropriately. 2018-09-26 Justin Squirek gcc/ada/ * sem_ch5.adb (Analyze_Iterator_Specification): Add conditional to freeze called functions within iterator specifications during full analysis. (Preanalyze_Range): Minor typo fix. gcc/testsuite/ * gnat.dg/expr_func8.adb: New testcase. From-SVN: r264612 --- gcc/ada/ChangeLog | 7 +++++++ gcc/ada/sem_ch5.adb | 21 ++++++++++++++++---- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gnat.dg/expr_func8.adb | 37 ++++++++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gnat.dg/expr_func8.adb (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9db2747..4ab1bcd 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2018-09-26 Justin Squirek + + * sem_ch5.adb (Analyze_Iterator_Specification): Add conditional + to freeze called functions within iterator specifications during + full analysis. + (Preanalyze_Range): Minor typo fix. + 2018-09-26 Ed Schonberg * sem_ch6.adb (Analyze_Function_Return): If the return type has diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index f35b37d..2f44691 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -2203,6 +2203,19 @@ package body Sem_Ch5 is Preanalyze_Range (Iter_Name); + -- If the domain of iteration is a function call, make sure the function + -- itself is frozen. This is an issue if this is a local expression + -- function. + + if Nkind (Iter_Name) = N_Function_Call + and then Is_Entity_Name (Name (Iter_Name)) + and then Full_Analysis + and then (In_Assertion_Expr = 0 + or else Assertions_Enabled) + then + Freeze_Before (N, Entity (Name (Iter_Name))); + end if; + -- Set the kind of the loop variable, which is not visible within the -- iterator name. @@ -4136,10 +4149,10 @@ package body Sem_Ch5 is Full_Analysis := False; Expander_Mode_Save_And_Set (False); - -- In addition to the above we must ecplicity suppress the - -- generation of freeze nodes which might otherwise be generated - -- during resolution of the range (e.g. if given by an attribute - -- that will freeze its prefix). + -- In addition to the above we must explicitly suppress the generation + -- of freeze nodes that might otherwise be generated during resolution + -- of the range (e.g. if given by an attribute that will freeze its + -- prefix). Set_Must_Not_Freeze (R_Copy); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3c95432..f8591aa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-09-26 Justin Squirek + + * gnat.dg/expr_func8.adb: New testcase. + 2018-09-26 Ed Schonberg * gnat.dg/predicate3.adb, gnat.dg/predicate3_pkg.ads: New diff --git a/gcc/testsuite/gnat.dg/expr_func8.adb b/gcc/testsuite/gnat.dg/expr_func8.adb new file mode 100644 index 0000000..90d3c93 --- /dev/null +++ b/gcc/testsuite/gnat.dg/expr_func8.adb @@ -0,0 +1,37 @@ +-- { dg-do compile } +-- { dg-options "-gnata" } + +procedure Expr_Func8 is + + type Node_Set is array (Positive range <>) of Integer; + + function Nodes return Node_Set is + ((1,2,3,4,5,6,7,8,9)); + + X1 : Boolean := (for all N of Nodes => N = N); + + function Predecessors (N : Integer) return Node_Set Is + (Nodes (1 .. N - 1)); + function Successors (N : Integer) return Node_Set Is + (Nodes (N + 1 .. Nodes'Last)); + + pragma Assert + (for all N of Nodes => + (for some S of Successors (N) => S = N)); + + X2 : Boolean := + (for all N of Nodes => + (for some S of Successors (N) => S = N)); + + X3 : Boolean := + (for all N of Nodes => + (for some S of Successors (N) => S = N)) with Ghost; + + pragma Assert + (for all N of Nodes => + (for all P of Predecessors (N) => + (for some S of Successors (P) => S = N))); + +begin + null; +end; -- cgit v1.1 From 52ba224d888aead9a9f00ce04b14200f2f4ef8a5 Mon Sep 17 00:00:00 2001 From: Thomas Quinot Date: Wed, 26 Sep 2018 09:17:26 +0000 Subject: [Ada] Propagate bit order and SSO from root to classwide equivalent type 2018-09-26 Thomas Quinot gcc/ada/ * exp_util.adb (Make_CW_Equivalent_Type): Propagate bit order and scalar storage order from root type to classwide equivalent type, to prevent rejection of the equivalent type by the freezing circuitry. gcc/testsuite/ * gnat.dg/sso12.adb: New testcase. From-SVN: r264613 --- gcc/ada/ChangeLog | 7 +++++++ gcc/ada/exp_util.adb | 17 ++++++++++++++--- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gnat.dg/sso12.adb | 17 +++++++++++++++++ 4 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gnat.dg/sso12.adb (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 4ab1bcd..94f90d3 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2018-09-26 Thomas Quinot + + * exp_util.adb (Make_CW_Equivalent_Type): Propagate bit order + and scalar storage order from root type to classwide equivalent + type, to prevent rejection of the equivalent type by the + freezing circuitry. + 2018-09-26 Justin Squirek * sem_ch5.adb (Analyze_Iterator_Specification): Add conditional diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 314e3ee..31e36ee 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -9004,12 +9004,17 @@ package body Exp_Util is -- Generate the following code: -- type Equiv_T is record - -- _parent : T (List of discriminant constraints taken from Exp); + -- _parent : T (List of discriminant constraints taken from Exp); -- Ext__50 : Storage_Array (1 .. (Exp'size - Typ'object_size)/8); -- end Equiv_T; -- - -- ??? Note that this type does not guarantee same alignment as all - -- derived types + -- ??? Note that this type does not guarantee same alignment as all + -- derived types + -- + -- Note: for the freezing circuitry, this looks like a record extension, + -- and so we need to make sure that the scalar storage order is the same + -- as that of the parent type. (This does not change anything for the + -- representation of the extension part.) function Make_CW_Equivalent_Type (T : Entity_Id; @@ -9017,6 +9022,7 @@ package body Exp_Util is is Loc : constant Source_Ptr := Sloc (E); Root_Typ : constant Entity_Id := Root_Type (T); + Root_Utyp : constant Entity_Id := Underlying_Type (Root_Typ); List_Def : constant List_Id := Empty_List; Comp_List : constant List_Id := New_List; Equiv_Type : Entity_Id; @@ -9147,6 +9153,11 @@ package body Exp_Util is Make_Component_Definition (Loc, Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (Constr_Root, Loc)))); + + Set_Reverse_Storage_Order (Equiv_Type, + Reverse_Storage_Order (Base_Type (Root_Utyp))); + Set_Reverse_Bit_Order (Equiv_Type, + Reverse_Bit_Order (Base_Type (Root_Utyp))); end if; Append_To (Comp_List, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f8591aa..5e7a15d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-09-26 Thomas Quinot + + * gnat.dg/sso12.adb: New testcase. + 2018-09-26 Justin Squirek * gnat.dg/expr_func8.adb: New testcase. diff --git a/gcc/testsuite/gnat.dg/sso12.adb b/gcc/testsuite/gnat.dg/sso12.adb new file mode 100644 index 0000000..c36b1e3 --- /dev/null +++ b/gcc/testsuite/gnat.dg/sso12.adb @@ -0,0 +1,17 @@ +-- { dg-do compile } + +with Ada.Unchecked_Deallocation; +with System; + +procedure SSO12 is + type Rec is abstract tagged null record; + for Rec'Scalar_Storage_Order use System.High_Order_First; -- { dg-warning "scalar storage order specified but no component clause" } + for Rec'Bit_Order use System.High_Order_First; + + type Rec_Acc is access all Rec'Class; + + procedure Free is new Ada.Unchecked_Deallocation (Rec'Class, Rec_Acc); + X : Rec_Acc; +begin + Free (X); +end SSO12; -- cgit v1.1 From d58008d23d073916471ca95587b5fcd090675243 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 26 Sep 2018 09:17:31 +0000 Subject: [Ada] Preparation for new description of interface thunks This adjusts and exposes a couple of functions of the front-end used for the generation of interface thunks so as to make them callable from gigi. This also propagates the debug info setting from the targets to the thunks so as to make stepping into primitives work better in the debugger. 2018-09-26 Eric Botcazou gcc/ada/ * exp_disp.adb (Expand_Interface_Conversion): Use Present test. (Expand_Interface_Thunk): Propagate debug info setting from target. * exp_util.ads (Find_Interface_Tag): Adjust comment. * exp_util.adb (Find_Interface_Tag): Remove assertions of success. * sem_util.adb (Is_Variable_Size_Record): Only look at components and robustify the implementation. * fe.h (Find_Interface_Tag): Declare. (Is_Variable_Size_Record): Likewise. From-SVN: r264614 --- gcc/ada/ChangeLog | 13 +++++++++++++ gcc/ada/exp_disp.adb | 3 ++- gcc/ada/exp_util.adb | 3 --- gcc/ada/exp_util.ads | 5 +++-- gcc/ada/fe.h | 6 +++++- gcc/ada/sem_util.adb | 6 +++--- 6 files changed, 26 insertions(+), 10 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 94f90d3..08087d9 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,16 @@ +2018-09-26 Eric Botcazou + + * exp_disp.adb (Expand_Interface_Conversion): Use Present test. + (Expand_Interface_Thunk): Propagate debug info setting from + target. + * exp_util.ads (Find_Interface_Tag): Adjust comment. + * exp_util.adb (Find_Interface_Tag): Remove assertions of + success. + * sem_util.adb (Is_Variable_Size_Record): Only look at + components and robustify the implementation. + * fe.h (Find_Interface_Tag): Declare. + (Is_Variable_Size_Record): Likewise. + 2018-09-26 Thomas Quinot * exp_util.adb (Make_CW_Equivalent_Type): Propagate bit order diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index 8270492..cf7ce49 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -1454,7 +1454,7 @@ package body Exp_Disp is end if; Iface_Tag := Find_Interface_Tag (Operand_Typ, Iface_Typ); - pragma Assert (Iface_Tag /= Empty); + pragma Assert (Present (Iface_Tag)); -- Keep separate access types to interfaces because one internal -- function is used to handle the null value (see following comments) @@ -2046,6 +2046,7 @@ package body Exp_Disp is Set_Ekind (Thunk_Id, Ekind (Prim)); Set_Is_Thunk (Thunk_Id); Set_Convention (Thunk_Id, Convention (Prim)); + Set_Needs_Debug_Info (Thunk_Id, Needs_Debug_Info (Target)); Set_Thunk_Entity (Thunk_Id, Target); -- Procedure case diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 31e36ee..183797c 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -5529,7 +5529,6 @@ package body Exp_Util is then -- Skip the tag associated with the primary table - pragma Assert (Etype (First_Tag_Component (Typ)) = RTE (RE_Tag)); AI_Tag := Next_Tag_Component (First_Tag_Component (Typ)); pragma Assert (Present (AI_Tag)); @@ -5590,14 +5589,12 @@ package body Exp_Util is -- primary dispatch table. if Is_Ancestor (Iface, Typ, Use_Full_View => True) then - pragma Assert (Etype (First_Tag_Component (Typ)) = RTE (RE_Tag)); return First_Tag_Component (Typ); -- Otherwise we need to search for its associated tag component else Find_Tag (Typ); - pragma Assert (Found); return AI_Tag; end if; end Find_Interface_Tag; diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads index 708da20..b5e2a7b 100644 --- a/gcc/ada/exp_util.ads +++ b/gcc/ada/exp_util.ads @@ -585,8 +585,9 @@ package Exp_Util is function Find_Interface_Tag (T : Entity_Id; Iface : Entity_Id) return Entity_Id; - -- Ada 2005 (AI-251): Given a type T implementing the interface Iface, - -- return the record component containing the tag of Iface. + -- Ada 2005 (AI-251): Given a type T and an interface Iface, return the + -- record component containing the tag of Iface if T implements Iface or + -- Empty if it does not. function Find_Prim_Op (T : Entity_Id; Name : Name_Id) return Entity_Id; -- Find the first primitive operation of a tagged type T with name Name. diff --git a/gcc/ada/fe.h b/gcc/ada/fe.h index 2d07aa5..7c32044 100644 --- a/gcc/ada/fe.h +++ b/gcc/ada/fe.h @@ -159,8 +159,10 @@ extern void Get_External_Name (Entity_Id, Boolean, String_Pointer); /* exp_util: */ #define Is_Fully_Repped_Tagged_Type exp_util__is_fully_repped_tagged_type +#define Find_Interface_Tag exp_util__find_interface_tag extern Boolean Is_Fully_Repped_Tagged_Type (Entity_Id); +extern Entity_Id Find_Interface_Tag (Entity_Id, Entity_Id); /* lib: */ @@ -269,12 +271,14 @@ extern Boolean Is_OK_Static_Subtype (Entity_Id); #define Defining_Entity sem_util__defining_entity #define First_Actual sem_util__first_actual #define Next_Actual sem_util__next_actual +#define Is_Variable_Size_Record sem_util__is_variable_size_record #define Requires_Transient_Scope sem_util__requires_transient_scope extern Entity_Id Defining_Entity (Node_Id); extern Node_Id First_Actual (Node_Id); extern Node_Id Next_Actual (Node_Id); -extern Boolean Requires_Transient_Scope (Entity_Id); +extern Boolean Is_Variable_Size_Record (Entity_Id Id); +extern Boolean Requires_Transient_Scope (Entity_Id); /* sinfo: */ diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 2b31cf7..7235c96 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -17714,9 +17714,9 @@ package body Sem_Util is begin pragma Assert (Is_Record_Type (E)); - Comp := First_Entity (E); + Comp := First_Component (E); while Present (Comp) loop - Comp_Typ := Etype (Comp); + Comp_Typ := Underlying_Type (Etype (Comp)); -- Recursive call if the record type has discriminants @@ -17732,7 +17732,7 @@ package body Sem_Util is return True; end if; - Next_Entity (Comp); + Next_Component (Comp); end loop; return False; -- cgit v1.1 From 56c3e620aa79524033973d09f44cf587c2038198 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 26 Sep 2018 09:17:36 +0000 Subject: [Ada] Inlining of renamed subprogram instances in package body This fixes a small discrepancy in the handling of renamed subprograms declared in a package body, between those originally a regular subprogram and those an instance of a generic subprogram, the latter being slightly hindered. The difference comes from the setting of the Is_Public flag, which was more conservative in the latter case because instantiations of generic subprograms are done in compiler-generated local packages. It is eliminated by allowing Has_Referencer to recurse into nested packages, but only if they are themselves not instances of generic packages. The compiler must now fully inline Doit_I into Doit at -O2 in: package P is generic procedure Doit_G; procedure Doit; end P; package body P is N : Natural := 0; procedure Doit_G is begin N := 1; end Doit_G; procedure Doit_I is new Doit_G; procedure Doit renames Doit_I; end P; 2018-09-26 Eric Botcazou gcc/ada/ * sem_ch7.adb (Has_Referencer): Remove Top_Level parameter and add In_Nested_Instance and Has_Outer_Referencer_Of_Non_Subprograms parameters. Rename Has_Non_Subprograms_Referencer variable into Has_Referencer_Of_Non_Subprograms and initialize it with the new third parameter. Adjust recursive calls and to the renaming. Replace test on Top_Level with test on In_Nested_Instance to decide whether to clear the Is_Public flag on entities. (Hide_Public_Entities): Adjust call to Has_Referencer. From-SVN: r264615 --- gcc/ada/ChangeLog | 12 ++++++++++ gcc/ada/sem_ch7.adb | 65 ++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 56 insertions(+), 21 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 08087d9..05530af 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,17 @@ 2018-09-26 Eric Botcazou + * sem_ch7.adb (Has_Referencer): Remove Top_Level parameter and + add In_Nested_Instance and + Has_Outer_Referencer_Of_Non_Subprograms parameters. Rename + Has_Non_Subprograms_Referencer variable into + Has_Referencer_Of_Non_Subprograms and initialize it with the new + third parameter. Adjust recursive calls and to the renaming. + Replace test on Top_Level with test on In_Nested_Instance to + decide whether to clear the Is_Public flag on entities. + (Hide_Public_Entities): Adjust call to Has_Referencer. + +2018-09-26 Eric Botcazou + * exp_disp.adb (Expand_Interface_Conversion): Use Present test. (Expand_Interface_Thunk): Propagate debug info setting from target. diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index cb4b853..8aebb0f 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -259,11 +259,12 @@ package body Sem_Ch7 is procedure Hide_Public_Entities (Decls : List_Id) is function Has_Referencer - (Decls : List_Id; - Top_Level : Boolean := False) return Boolean; + (Decls : List_Id; + In_Nested_Instance : Boolean; + Has_Outer_Referencer_Of_Non_Subprograms : Boolean) return Boolean; -- A "referencer" is a construct which may reference a previous -- declaration. Examine all declarations in list Decls in reverse - -- and determine whether once such referencer exists. All entities + -- and determine whether one such referencer exists. All entities -- in the range Last (Decls) .. Referencer are hidden from external -- visibility. @@ -286,14 +287,16 @@ package body Sem_Ch7 is -------------------- function Has_Referencer - (Decls : List_Id; - Top_Level : Boolean := False) return Boolean + (Decls : List_Id; + In_Nested_Instance : Boolean; + Has_Outer_Referencer_Of_Non_Subprograms : Boolean) return Boolean is Decl : Node_Id; Decl_Id : Entity_Id; Spec : Node_Id; - Has_Non_Subprograms_Referencer : Boolean := False; + Has_Referencer_Of_Non_Subprograms : Boolean := + Has_Outer_Referencer_Of_Non_Subprograms; -- Set if an inlined subprogram body was detected as a referencer. -- In this case, we do not return True immediately but keep hiding -- subprograms from external visibility. @@ -319,13 +322,23 @@ package body Sem_Ch7 is elsif Nkind (Decl) = N_Package_Declaration then Spec := Specification (Decl); + Decl_Id := Defining_Entity (Spec); -- Inspect the declarations of a non-generic package to try -- and hide more entities from external visibility. - if not Is_Generic_Unit (Defining_Entity (Spec)) then - if Has_Referencer (Private_Declarations (Spec)) - or else Has_Referencer (Visible_Declarations (Spec)) + if not Is_Generic_Unit (Decl_Id) then + if Has_Referencer (Private_Declarations (Spec), + In_Nested_Instance + or else + Is_Generic_Instance (Decl_Id), + Has_Referencer_Of_Non_Subprograms) + or else + Has_Referencer (Visible_Declarations (Spec), + In_Nested_Instance + or else + Is_Generic_Instance (Decl_Id), + Has_Referencer_Of_Non_Subprograms) then return True; end if; @@ -354,7 +367,12 @@ package body Sem_Ch7 is -- Inspect the declarations of a non-generic package body to -- try and hide more entities from external visibility. - elsif Has_Referencer (Declarations (Decl)) then + elsif Has_Referencer (Declarations (Decl), + In_Nested_Instance + or else + Is_Generic_Instance (Decl_Id), + Has_Referencer_Of_Non_Subprograms) + then return True; end if; @@ -382,7 +400,7 @@ package body Sem_Ch7 is if Is_Inlined (Decl_Id) or else Has_Pragma_Inline (Decl_Id) then - Has_Non_Subprograms_Referencer := True; + Has_Referencer_Of_Non_Subprograms := True; -- Inspect the statements of the subprogram body -- to determine whether the body references other @@ -401,7 +419,7 @@ package body Sem_Ch7 is if Is_Inlined (Decl_Id) or else Has_Pragma_Inline (Decl_Id) then - Has_Non_Subprograms_Referencer := True; + Has_Referencer_Of_Non_Subprograms := True; -- Inspect the statements of the subprogram body -- to determine whether the body references other @@ -425,15 +443,20 @@ package body Sem_Ch7 is begin -- Inspect the actions to find references to subprograms - Discard := Has_Referencer (Actions (Decl)); + Discard := + Has_Referencer (Actions (Decl), + In_Nested_Instance, + Has_Referencer_Of_Non_Subprograms); end; -- Exceptions, objects and renamings do not need to be public -- if they are not followed by a construct which can reference - -- and export them. The Is_Public flag is reset on top level - -- entities only as anything nested is local to its context. - -- Likewise for subprograms, but we work harder for them. - + -- and export them. Likewise for subprograms but we work harder + -- for them to see whether they are referenced on an individual + -- basis by looking into the table of referenced subprograms. + -- But we cannot say anything for entities declared in nested + -- instances because instantiations are not done yet so the + -- bodies are not visible and could contain references to them. elsif Nkind_In (Decl, N_Exception_Declaration, N_Object_Declaration, N_Object_Renaming_Declaration, @@ -442,12 +465,12 @@ package body Sem_Ch7 is then Decl_Id := Defining_Entity (Decl); - if Top_Level + if not In_Nested_Instance and then not Is_Imported (Decl_Id) and then not Is_Exported (Decl_Id) and then No (Interface_Name (Decl_Id)) and then - (not Has_Non_Subprograms_Referencer + (not Has_Referencer_Of_Non_Subprograms or else (Nkind (Decl) = N_Subprogram_Declaration and then not Subprogram_Table.Get (Decl_Id))) then @@ -475,7 +498,7 @@ package body Sem_Ch7 is Prev (Decl); end loop; - return Has_Non_Subprograms_Referencer; + return Has_Referencer_Of_Non_Subprograms; end Has_Referencer; ------------------------- @@ -609,7 +632,7 @@ package body Sem_Ch7 is Traversed_Table.Reset; Subprogram_Table.Reset; - Discard := Has_Referencer (Decls, Top_Level => True); + Discard := Has_Referencer (Decls, False, False); end Hide_Public_Entities; ---------------------------------- -- cgit v1.1 From 8e53268102e205b1b10664b53ad41c31a9257b32 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Wed, 26 Sep 2018 09:17:41 +0000 Subject: [Ada] Missing error on non-limited derived type with limited component This patch fixes a missing error on a type extension with limited components, when the parent type is a derived limited interface. This may allow the unit to improperly compile, but may lead to bind-time errors when compiling a client of that unit. Compiling p.adb must yield: keys.ads:8:06: extension of nonlimited type cannot have limited components keys.ads:8:06: limitedness is not inherited from limited interface keys.ads:8:06: add "limited" to type indication ---- with Keys; procedure P is begin null; end; ---- with GNAT.Semaphores; package Keys is type Ref0 is limited interface; type Ref2 is limited interface and Ref0; type Object is new Ref2 with record Lock : aliased GNAT.Semaphores.Binary_Semaphore (True, GNAT.Semaphores.Default_Ceiling); end record; end; 2018-09-26 Ed Schonberg gcc/ada/ * sem_ch3.adb (Is_Onown_Limited): A derived type whose parent P is a derived limited record is not itself limited if P is a derived limited interface. From-SVN: r264616 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/sem_ch3.adb | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 05530af..88eb18e 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Ed Schonberg + + * sem_ch3.adb (Is_Onown_Limited): A derived type whose parent P + is a derived limited record is not itself limited if P is a + derived limited interface. + 2018-09-26 Eric Botcazou * sem_ch7.adb (Has_Referencer): Remove Top_Level parameter and diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index cc84f9c..8b13cd0 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -1928,9 +1928,12 @@ package body Sem_Ch3 is return True; -- Else the type may have a limited interface progenitor, but a - -- limited record parent. + -- limited record parent that is not an interface. - elsif R /= P and then Is_Limited_Record (P) then + elsif R /= P + and then Is_Limited_Record (P) + and then not Is_Interface (P) + then return True; else -- cgit v1.1 From 95f2be29446f6d04e4b221b228eac190057d839b Mon Sep 17 00:00:00 2001 From: Olivier Hainque Date: Wed, 26 Sep 2018 09:17:46 +0000 Subject: [Ada] Front-end support for OpenACC pragmas This patch introduces the upper part of the Ada front-end support for a first set of OpenACC directives (Acc_Kernels, Acc_Loop, Acc_Parallel, Acc_Data) and their clauses. The pragmas syntax is documented, pragmas are recognized and checked for syntactic correctness, keyed on -fopenacc. A couple of new flags are defined on loop statements in the GNAT tree. 2018-09-26 Olivier Hainque gcc/ada/ * opt.ads (OpenAcc_Enabled): New flag. False by default. True when OpenACC pragmas are requested to be honored, when -fopenacc is found on the command line. * back_end.adb (Scan_Compiler_Arguments): Set OpenACC_Enabled if -fopenacc is seen on the command line. * sinfo.adb, sinfo.ads (Is_OpenAcc_Environment): New flag/predicate on Loop statements which embed an Acc_Kernels, Acc_Parallel or Acc_Data pragma. (Is_OpenAcc_Loop): New flag/predicate on Loop statements which embed an Acc_Loop pragma. (Set_Is_OpenAcc_Environment, Set_Is_OpenAcc_Loop): Setters for the new flags. * par-prag.adb (Prag): Handle Acc_Data, Acc_Loop, Acc_Parallel and Acc_Kernels pragmas. Nothing to do here, all handled by sem_prag. * sem_prag.adb (Acc_First, Acc_Next, Validate_Acc_Condition_Clause, Validate_Acc_Data_Clause, Validate_Acc_Int_Expr_Clause, Validate_Acc_Int_Expr_List_Clause, Validate_Acc_Loop_Collapse, Validate_Acc_Loop_Gang, Validate_Acc_Loop_Vector, Validate_Acc_Loop_Worker, Validate_Acc_Name_Reduction, Validate_Acc_Size_Expressions): New helper for Analyze_Pragma, to handle OpenACC pragmas. (Analyze_Pragma): Handle Acc_Data, Acc_Loop, Acc_Parallel and Acc_Kernels pragmas. * sem_ch5.adb (Disable_Constant): Unset Is_True_Constant on variable entity, action for ... (Disable_Constants): Helper for Analyze_Loop_Statement, to ... (Analyze_Loop_Statement): Disable True_Constant on variables referenced within an OpenACC environment. * snames.ads-tmpl: Declare Name_Ids for the OpenACC directives and clauses we can handle. Remove an exraneous whitespace before columns, preventing line length overflow in the generated spec with Ids now reaching beyond 999. * doc/gnat_rm/implementation_defined_pragmas.rst: Document pragma Acc_Parallel, Acc_Loop, Acc_Kernels and Acc_Data. * gnat_rm.texi: Regenerate. From-SVN: r264617 --- gcc/ada/ChangeLog | 39 + gcc/ada/back_end.adb | 3 + .../doc/gnat_rm/implementation_defined_pragmas.rst | 152 ++ gcc/ada/gnat_rm.texi | 1833 +++++++++++--------- gcc/ada/opt.ads | 9 + gcc/ada/par-prag.adb | 4 + gcc/ada/sem_ch5.adb | 31 + gcc/ada/sem_prag.adb | 581 +++++++ gcc/ada/sinfo.adb | 32 + gcc/ada/sinfo.ads | 26 + gcc/ada/snames.ads-tmpl | 368 ++-- 11 files changed, 2081 insertions(+), 997 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 88eb18e..825722a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,42 @@ +2018-09-26 Olivier Hainque + + * opt.ads (OpenAcc_Enabled): New flag. False by default. True + when OpenACC pragmas are requested to be honored, when -fopenacc + is found on the command line. + * back_end.adb (Scan_Compiler_Arguments): Set OpenACC_Enabled if + -fopenacc is seen on the command line. + * sinfo.adb, sinfo.ads (Is_OpenAcc_Environment): New + flag/predicate on Loop statements which embed an Acc_Kernels, + Acc_Parallel or Acc_Data pragma. + (Is_OpenAcc_Loop): New flag/predicate on Loop statements which + embed an Acc_Loop pragma. + (Set_Is_OpenAcc_Environment, Set_Is_OpenAcc_Loop): Setters for + the new flags. + * par-prag.adb (Prag): Handle Acc_Data, Acc_Loop, Acc_Parallel + and Acc_Kernels pragmas. Nothing to do here, all handled by + sem_prag. + * sem_prag.adb (Acc_First, Acc_Next, + Validate_Acc_Condition_Clause, Validate_Acc_Data_Clause, + Validate_Acc_Int_Expr_Clause, Validate_Acc_Int_Expr_List_Clause, + Validate_Acc_Loop_Collapse, Validate_Acc_Loop_Gang, + Validate_Acc_Loop_Vector, Validate_Acc_Loop_Worker, + Validate_Acc_Name_Reduction, Validate_Acc_Size_Expressions): New + helper for Analyze_Pragma, to handle OpenACC pragmas. + (Analyze_Pragma): Handle Acc_Data, Acc_Loop, Acc_Parallel and + Acc_Kernels pragmas. + * sem_ch5.adb (Disable_Constant): Unset Is_True_Constant on + variable entity, action for ... + (Disable_Constants): Helper for Analyze_Loop_Statement, to ... + (Analyze_Loop_Statement): Disable True_Constant on variables + referenced within an OpenACC environment. + * snames.ads-tmpl: Declare Name_Ids for the OpenACC directives + and clauses we can handle. Remove an exraneous whitespace before + columns, preventing line length overflow in the generated spec + with Ids now reaching beyond 999. + * doc/gnat_rm/implementation_defined_pragmas.rst: Document + pragma Acc_Parallel, Acc_Loop, Acc_Kernels and Acc_Data. + * gnat_rm.texi: Regenerate. + 2018-09-26 Ed Schonberg * sem_ch3.adb (Is_Onown_Limited): A derived type whose parent P diff --git a/gcc/ada/back_end.adb b/gcc/ada/back_end.adb index 139e92c..520a8b2 100644 --- a/gcc/ada/back_end.adb +++ b/gcc/ada/back_end.adb @@ -375,6 +375,9 @@ package body Back_End is elsif Is_Front_End_Switch (Argv) then Scan_Front_End_Switches (Argv, Args, Next_Arg); + elsif Argv (Argv'First + 1 .. Argv'Last) = "fopenacc" then + Opt.OpenAcc_Enabled := True; + -- All non-front-end switches are back-end switches else diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst index 44afec4..6074cd4 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst @@ -89,6 +89,158 @@ Syntax: For the semantics of this pragma, see the entry for aspect ``Abstract_State`` in the SPARK 2014 Reference Manual, section 7.1.4. +Pragma Acc_Parallel +=================== +Syntax: + +.. code-block:: ada + + pragma Acc_Parallel [( ACC_PARALLEL_CLAUSE [, ACC_PARALLEL_CLAUSE... ])]; + + ACC_PARALLEL_CLAUSE ::= + Acc_If => boolean_EXPRESSION + | Acc_Private => IDENTIFIERS + | Async => integer_EXPRESSION + | Copy => IDENTIFIERS + | Copy_In => IDENTIFIERS + | Copy_Out => IDENTIFIERS + | Create => IDENTIFIERS + | Default => None + | Device_Ptr => IDENTIFIERS + | First_Private => IDENTIFIERS + | Num_Gangs => integer_EXPRESSION + | Num_Workers => integer_EXPRESSION + | Present => IDENTIFIERS + | Reduction => (REDUCTION_RECORD) + | Vector_Length => integer_EXPRESSION + | Wait => INTEGERS + + REDUCTION_RECORD ::= + "+" => IDENTIFIERS + | "*" => IDENTIFIERS + | "min" => IDENTIFIERS + | "max" => IDENTIFIERS + | "or" => IDENTIFIERS + | "and" => IDENTIFIERS + + IDENTIFIERS ::= + | IDENTIFIER + | (IDENTIFIER, IDENTIFIERS) + + INTEGERS ::= + | integer_EXPRESSION + | (integer_EXPRESSION, INTEGERS) + +Requires the :switch:`-fopenacc` flag. + +Equivalent to the ``parallel`` directive of the OpenAcc standard. This pragma +should be placed in loops. It offloads the content of the loop to an +accelerator device. + +For more information about the effect of the clauses, see the OpenAcc +specification. + +Pragma Acc_Loop +=============== +Syntax: + +.. code-block:: ada + + pragma Acc_Loop [( ACC_LOOP_CLAUSE [, ACC_LOOP_CLAUSE... ])]; + + ACC_LOOP_CLAUSE ::= + Auto + | Collapse => INTEGER_LITERAL + | Gang [=> GANG_ARG] + | Independent + | Private => IDENTIFIERS + | Reduction => (REDUCTION_RECORD) + | Seq + | Tile => SIZE_EXPRESSION + | Vector [=> integer_EXPRESSION] + | Worker [=> integer_EXPRESSION] + + GANG_ARG ::= + integer_EXPRESSION + | Static => SIZE_EXPRESSION + + SIZE_EXPRESSION ::= + * + | integer_EXPRESSION + +Requires the :switch:`-fopenacc` flag. + +Equivalent to the ``loop`` directive of the OpenAcc standard. This pragma +should be placed in for loops after the "Acc_Parallel" pragma. It tells the +compiler how to parallelize the loop. + +For more information about the effect of the clauses, see the OpenAcc +specification. + +Pragma Acc_Kernels +================== +Syntax: + +.. code-block:: ada + + pragma Acc_Kernels [( ACC_KERNELS_CLAUSE [, ACC_KERNELS_CLAUSE...])]; + + ACC_KERNELS_CLAUSE ::= + Acc_If => boolean_EXPRESSION + | Async => integer_EXPRESSION + | Copy => IDENTIFIERS + | Copy_In => IDENTIFIERS + | Copy_Out => IDENTIFIERS + | Create => IDENTIFIERS + | Default => None + | Device_Ptr => IDENTIFIERS + | Num_Gangs => integer_EXPRESSION + | Num_Workers => integer_EXPRESSION + | Present => IDENTIFIERS + | Vector_Length => integer_EXPRESSION + | Wait => INTEGERS + + IDENTIFIERS ::= + | IDENTIFIER + | (IDENTIFIER, IDENTIFIERS) + + INTEGERS ::= + | integer_EXPRESSION + | (integer_EXPRESSION, INTEGERS) + +Requires the :switch:`-fopenacc` flag. + +Equivalent to the kernels directive of the OpenAcc standard. This pragma should +be placed in loops. + +For more information about the effect of the clauses, see the OpenAcc +specification. + +Pragma Acc_Data +=============== +Syntax: + +.. code-block:: ada + + pragma Acc_Data ([ ACC_DATA_CLAUSE [, ACC_DATA_CLAUSE...]]); + + ACC_DATA_CLAUSE ::= + Copy => IDENTIFIERS + | Copy_In => IDENTIFIERS + | Copy_Out => IDENTIFIERS + | Create => IDENTIFIERS + | Device_Ptr => IDENTIFIERS + | Present => IDENTIFIERS + +Requires the :switch:`-fopenacc` flag. + +Equivalent to the ``data`` directive of the OpenAcc standard. This pragma +should be placed in loops. + +For more information about the effect of the clauses, see the OpenAcc +specification. + + Pragma Ada_83 ============= diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 95e63b7..fbe92ad 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -21,7 +21,7 @@ @copying @quotation -GNAT Reference Manual , Jun 06, 2018 +GNAT Reference Manual , Sep 24, 2018 AdaCore @@ -97,6 +97,10 @@ Implementation Defined Pragmas * Pragma Abort_Defer:: * Pragma Abstract_State:: +* Pragma Acc_Parallel:: +* Pragma Acc_Loop:: +* Pragma Acc_Kernels:: +* Pragma Acc_Data:: * Pragma Ada_83:: * Pragma Ada_95:: * Pragma Ada_05:: @@ -1167,6 +1171,10 @@ consideration, the use of these pragmas should be minimized. @menu * Pragma Abort_Defer:: * Pragma Abstract_State:: +* Pragma Acc_Parallel:: +* Pragma Acc_Loop:: +* Pragma Acc_Kernels:: +* Pragma Acc_Data:: * Pragma Ada_83:: * Pragma Ada_95:: * Pragma Ada_05:: @@ -1390,7 +1398,7 @@ the effect of deferring aborts for the sequence of statements (but not for the declarations or handlers, if any, associated with this statement sequence). -@node Pragma Abstract_State,Pragma Ada_83,Pragma Abort_Defer,Implementation Defined Pragmas +@node Pragma Abstract_State,Pragma Acc_Parallel,Pragma Abort_Defer,Implementation Defined Pragmas @anchor{gnat_rm/implementation_defined_pragmas pragma-abstract-state}@anchor{1c}@anchor{gnat_rm/implementation_defined_pragmas id2}@anchor{1d} @section Pragma Abstract_State @@ -1440,8 +1448,171 @@ ABSTRACT_STATE ::= name For the semantics of this pragma, see the entry for aspect @code{Abstract_State} in the SPARK 2014 Reference Manual, section 7.1.4. -@node Pragma Ada_83,Pragma Ada_95,Pragma Abstract_State,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ada-83}@anchor{1e} +@node Pragma Acc_Parallel,Pragma Acc_Loop,Pragma Abstract_State,Implementation Defined Pragmas +@anchor{gnat_rm/implementation_defined_pragmas pragma-acc-parallel}@anchor{1e} +@section Pragma Acc_Parallel + + +Syntax: + +@example +pragma Acc_Parallel [( ACC_PARALLEL_CLAUSE [, ACC_PARALLEL_CLAUSE... ])]; + +ACC_PARALLEL_CLAUSE ::= + Acc_If => boolean_EXPRESSION + | Acc_Private => IDENTIFIERS + | Async => integer_EXPRESSION + | Copy => IDENTIFIERS + | Copy_In => IDENTIFIERS + | Copy_Out => IDENTIFIERS + | Create => IDENTIFIERS + | Default => None + | Device_Ptr => IDENTIFIERS + | First_Private => IDENTIFIERS + | Num_Gangs => integer_EXPRESSION + | Num_Workers => integer_EXPRESSION + | Present => IDENTIFIERS + | Reduction => (REDUCTION_RECORD) + | Vector_Length => integer_EXPRESSION + | Wait => INTEGERS + +REDUCTION_RECORD ::= + "+" => IDENTIFIERS + | "*" => IDENTIFIERS + | "min" => IDENTIFIERS + | "max" => IDENTIFIERS + | "or" => IDENTIFIERS + | "and" => IDENTIFIERS + +IDENTIFIERS ::= + | IDENTIFIER + | (IDENTIFIER, IDENTIFIERS) + +INTEGERS ::= + | integer_EXPRESSION + | (integer_EXPRESSION, INTEGERS) +@end example + +Requires the @code{-fopenacc} flag. + +Equivalent to the @code{parallel} directive of the OpenAcc standard. This pragma +should be placed in loops. It offloads the content of the loop to an +accelerator device. + +For more information about the effect of the clauses, see the OpenAcc +specification. + +@node Pragma Acc_Loop,Pragma Acc_Kernels,Pragma Acc_Parallel,Implementation Defined Pragmas +@anchor{gnat_rm/implementation_defined_pragmas pragma-acc-loop}@anchor{1f} +@section Pragma Acc_Loop + + +Syntax: + +@example +pragma Acc_Loop [( ACC_LOOP_CLAUSE [, ACC_LOOP_CLAUSE... ])]; + +ACC_LOOP_CLAUSE ::= + Auto + | Collapse => INTEGER_LITERAL + | Gang [=> GANG_ARG] + | Independent + | Private => IDENTIFIERS + | Reduction => (REDUCTION_RECORD) + | Seq + | Tile => SIZE_EXPRESSION + | Vector [=> integer_EXPRESSION] + | Worker [=> integer_EXPRESSION] + +GANG_ARG ::= + integer_EXPRESSION + | Static => SIZE_EXPRESSION + +SIZE_EXPRESSION ::= + * + | integer_EXPRESSION +@end example + +Requires the @code{-fopenacc} flag. + +Equivalent to the @code{loop} directive of the OpenAcc standard. This pragma +should be placed in for loops after the "Acc_Parallel" pragma. It tells the +compiler how to parallelize the loop. + +For more information about the effect of the clauses, see the OpenAcc +specification. + +@node Pragma Acc_Kernels,Pragma Acc_Data,Pragma Acc_Loop,Implementation Defined Pragmas +@anchor{gnat_rm/implementation_defined_pragmas pragma-acc-kernels}@anchor{20} +@section Pragma Acc_Kernels + + +Syntax: + +@example +pragma Acc_Kernels [( ACC_KERNELS_CLAUSE [, ACC_KERNELS_CLAUSE...])]; + +ACC_KERNELS_CLAUSE ::= + Acc_If => boolean_EXPRESSION + | Async => integer_EXPRESSION + | Copy => IDENTIFIERS + | Copy_In => IDENTIFIERS + | Copy_Out => IDENTIFIERS + | Create => IDENTIFIERS + | Default => None + | Device_Ptr => IDENTIFIERS + | Num_Gangs => integer_EXPRESSION + | Num_Workers => integer_EXPRESSION + | Present => IDENTIFIERS + | Vector_Length => integer_EXPRESSION + | Wait => INTEGERS + +IDENTIFIERS ::= + | IDENTIFIER + | (IDENTIFIER, IDENTIFIERS) + +INTEGERS ::= + | integer_EXPRESSION + | (integer_EXPRESSION, INTEGERS) +@end example + +Requires the @code{-fopenacc} flag. + +Equivalent to the kernels directive of the OpenAcc standard. This pragma should +be placed in loops. + +For more information about the effect of the clauses, see the OpenAcc +specification. + +@node Pragma Acc_Data,Pragma Ada_83,Pragma Acc_Kernels,Implementation Defined Pragmas +@anchor{gnat_rm/implementation_defined_pragmas pragma-acc-data}@anchor{21} +@section Pragma Acc_Data + + +Syntax: + +@example +pragma Acc_Data ([ ACC_DATA_CLAUSE [, ACC_DATA_CLAUSE...]]); + +ACC_DATA_CLAUSE ::= + Copy => IDENTIFIERS + | Copy_In => IDENTIFIERS + | Copy_Out => IDENTIFIERS + | Create => IDENTIFIERS + | Device_Ptr => IDENTIFIERS + | Present => IDENTIFIERS +@end example + +Requires the @code{-fopenacc} flag. + +Equivalent to the @code{data} directive of the OpenAcc standard. This pragma +should be placed in loops. + +For more information about the effect of the clauses, see the OpenAcc +specification. + +@node Pragma Ada_83,Pragma Ada_95,Pragma Acc_Data,Implementation Defined Pragmas +@anchor{gnat_rm/implementation_defined_pragmas pragma-ada-83}@anchor{22} @section Pragma Ada_83 @@ -1470,7 +1641,7 @@ by GNAT in Ada 83 mode will in fact compile and execute with an Ada required by Ada 83. @node Pragma Ada_95,Pragma Ada_05,Pragma Ada_83,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ada-95}@anchor{1f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ada-95}@anchor{23} @section Pragma Ada_95 @@ -1489,7 +1660,7 @@ itself uses Ada 95 features, but which is intended to be usable from either Ada 83 or Ada 95 programs. @node Pragma Ada_05,Pragma Ada_2005,Pragma Ada_95,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ada-05}@anchor{20} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ada-05}@anchor{24} @section Pragma Ada_05 @@ -1518,7 +1689,7 @@ otherwise legal pre-Ada_2005 programs. The one argument form is intended for exclusive use in the GNAT run-time library. @node Pragma Ada_2005,Pragma Ada_12,Pragma Ada_05,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ada-2005}@anchor{21} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ada-2005}@anchor{25} @section Pragma Ada_2005 @@ -1532,7 +1703,7 @@ This configuration pragma is a synonym for pragma Ada_05 and has the same syntax and effect. @node Pragma Ada_12,Pragma Ada_2012,Pragma Ada_2005,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ada-12}@anchor{22} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ada-12}@anchor{26} @section Pragma Ada_12 @@ -1563,7 +1734,7 @@ otherwise legal pre-Ada_2012 programs. The one argument form is intended for exclusive use in the GNAT run-time library. @node Pragma Ada_2012,Pragma Allow_Integer_Address,Pragma Ada_12,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ada-2012}@anchor{23} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ada-2012}@anchor{27} @section Pragma Ada_2012 @@ -1577,7 +1748,7 @@ This configuration pragma is a synonym for pragma Ada_12 and has the same syntax and effect. @node Pragma Allow_Integer_Address,Pragma Annotate,Pragma Ada_2012,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-allow-integer-address}@anchor{24} +@anchor{gnat_rm/implementation_defined_pragmas pragma-allow-integer-address}@anchor{28} @section Pragma Allow_Integer_Address @@ -1627,7 +1798,7 @@ rather than rejected to allow common sets of sources to be used in the two situations. @node Pragma Annotate,Pragma Assert,Pragma Allow_Integer_Address,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-annotate}@anchor{25}@anchor{gnat_rm/implementation_defined_pragmas id3}@anchor{26} +@anchor{gnat_rm/implementation_defined_pragmas pragma-annotate}@anchor{29}@anchor{gnat_rm/implementation_defined_pragmas id3}@anchor{2a} @section Pragma Annotate @@ -1661,7 +1832,7 @@ affect the compilation process in any way. This pragma may be used as a configuration pragma. @node Pragma Assert,Pragma Assert_And_Cut,Pragma Annotate,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-assert}@anchor{27} +@anchor{gnat_rm/implementation_defined_pragmas pragma-assert}@anchor{2b} @section Pragma Assert @@ -1727,7 +1898,7 @@ of Ada, and the DISABLE policy is an implementation-defined addition. @node Pragma Assert_And_Cut,Pragma Assertion_Policy,Pragma Assert,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-assert-and-cut}@anchor{28} +@anchor{gnat_rm/implementation_defined_pragmas pragma-assert-and-cut}@anchor{2c} @section Pragma Assert_And_Cut @@ -1754,7 +1925,7 @@ formal verification. The pragma also serves as useful documentation. @node Pragma Assertion_Policy,Pragma Assume,Pragma Assert_And_Cut,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-assertion-policy}@anchor{29} +@anchor{gnat_rm/implementation_defined_pragmas pragma-assertion-policy}@anchor{2d} @section Pragma Assertion_Policy @@ -1838,7 +2009,7 @@ applies to @code{Assert}, @code{Assert_And_Cut}, @code{Assume}, @code{Loop_Invariant}, and @code{Loop_Variant}. @node Pragma Assume,Pragma Assume_No_Invalid_Values,Pragma Assertion_Policy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-assume}@anchor{2a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-assume}@anchor{2e} @section Pragma Assume @@ -1872,7 +2043,7 @@ is met, and documents the need to ensure that it is met by reference to information outside the program. @node Pragma Assume_No_Invalid_Values,Pragma Async_Readers,Pragma Assume,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-assume-no-invalid-values}@anchor{2b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-assume-no-invalid-values}@anchor{2f} @section Pragma Assume_No_Invalid_Values @@ -1925,7 +2096,7 @@ is erroneous so there are no guarantees that this will always be the case, and it is recommended that these two options not be used together. @node Pragma Async_Readers,Pragma Async_Writers,Pragma Assume_No_Invalid_Values,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-async-readers}@anchor{2c}@anchor{gnat_rm/implementation_defined_pragmas id4}@anchor{2d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-async-readers}@anchor{30}@anchor{gnat_rm/implementation_defined_pragmas id4}@anchor{31} @section Pragma Async_Readers @@ -1939,7 +2110,7 @@ For the semantics of this pragma, see the entry for aspect @code{Async_Readers} the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Async_Writers,Pragma Attribute_Definition,Pragma Async_Readers,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id5}@anchor{2e}@anchor{gnat_rm/implementation_defined_pragmas pragma-async-writers}@anchor{2f} +@anchor{gnat_rm/implementation_defined_pragmas id5}@anchor{32}@anchor{gnat_rm/implementation_defined_pragmas pragma-async-writers}@anchor{33} @section Pragma Async_Writers @@ -1953,7 +2124,7 @@ For the semantics of this pragma, see the entry for aspect @code{Async_Writers} the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Attribute_Definition,Pragma C_Pass_By_Copy,Pragma Async_Writers,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-attribute-definition}@anchor{30} +@anchor{gnat_rm/implementation_defined_pragmas pragma-attribute-definition}@anchor{34} @section Pragma Attribute_Definition @@ -1979,7 +2150,7 @@ code to be written that takes advantage of some new attribute, while remaining compilable with earlier compilers. @node Pragma C_Pass_By_Copy,Pragma Check,Pragma Attribute_Definition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-c-pass-by-copy}@anchor{31} +@anchor{gnat_rm/implementation_defined_pragmas pragma-c-pass-by-copy}@anchor{35} @section Pragma C_Pass_By_Copy @@ -2023,7 +2194,7 @@ You can also pass records by copy by specifying the convention passing mechanisms on a parameter by parameter basis. @node Pragma Check,Pragma Check_Float_Overflow,Pragma C_Pass_By_Copy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-check}@anchor{32} +@anchor{gnat_rm/implementation_defined_pragmas pragma-check}@anchor{36} @section Pragma Check @@ -2062,7 +2233,7 @@ of these identifiers in @code{Assertion_Policy} and @code{Check_Policy} pragmas, where they are used to refer to sets of assertions. @node Pragma Check_Float_Overflow,Pragma Check_Name,Pragma Check,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-check-float-overflow}@anchor{33} +@anchor{gnat_rm/implementation_defined_pragmas pragma-check-float-overflow}@anchor{37} @section Pragma Check_Float_Overflow @@ -2118,7 +2289,7 @@ This mode can also be set by use of the compiler switch @emph{-gnateF}. @node Pragma Check_Name,Pragma Check_Policy,Pragma Check_Float_Overflow,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-check-name}@anchor{34} +@anchor{gnat_rm/implementation_defined_pragmas pragma-check-name}@anchor{38} @section Pragma Check_Name @@ -2154,7 +2325,7 @@ Check names introduced by this pragma are subject to control by compiler switches (in particular -gnatp) in the usual manner. @node Pragma Check_Policy,Pragma Comment,Pragma Check_Name,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-check-policy}@anchor{35} +@anchor{gnat_rm/implementation_defined_pragmas pragma-check-policy}@anchor{39} @section Pragma Check_Policy @@ -2234,7 +2405,7 @@ policy setting @code{DISABLE} causes the second argument of a corresponding @code{Check} pragma to be completely ignored and not analyzed. @node Pragma Comment,Pragma Common_Object,Pragma Check_Policy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-comment}@anchor{36} +@anchor{gnat_rm/implementation_defined_pragmas pragma-comment}@anchor{3a} @section Pragma Comment @@ -2253,7 +2424,7 @@ anywhere in the main source unit), and if more than one pragma is used, all comments are retained. @node Pragma Common_Object,Pragma Compile_Time_Error,Pragma Comment,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-common-object}@anchor{37} +@anchor{gnat_rm/implementation_defined_pragmas pragma-common-object}@anchor{3b} @section Pragma Common_Object @@ -2285,7 +2456,7 @@ indicating that the necessary attribute for implementation of this pragma is not available. @node Pragma Compile_Time_Error,Pragma Compile_Time_Warning,Pragma Common_Object,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-compile-time-error}@anchor{38} +@anchor{gnat_rm/implementation_defined_pragmas pragma-compile-time-error}@anchor{3c} @section Pragma Compile_Time_Error @@ -2312,7 +2483,7 @@ the value given as the second argument. This string value may contain embedded ASCII.LF characters to break the message into multiple lines. @node Pragma Compile_Time_Warning,Pragma Compiler_Unit,Pragma Compile_Time_Error,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-compile-time-warning}@anchor{39} +@anchor{gnat_rm/implementation_defined_pragmas pragma-compile-time-warning}@anchor{3d} @section Pragma Compile_Time_Warning @@ -2335,7 +2506,7 @@ with a first parameter of True is to warn a client about use of a package, for example that it is not fully implemented. @node Pragma Compiler_Unit,Pragma Compiler_Unit_Warning,Pragma Compile_Time_Warning,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-compiler-unit}@anchor{3a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-compiler-unit}@anchor{3e} @section Pragma Compiler_Unit @@ -2350,7 +2521,7 @@ retained so that old versions of the GNAT run-time that use this pragma can be compiled with newer versions of the compiler. @node Pragma Compiler_Unit_Warning,Pragma Complete_Representation,Pragma Compiler_Unit,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-compiler-unit-warning}@anchor{3b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-compiler-unit-warning}@anchor{3f} @section Pragma Compiler_Unit_Warning @@ -2368,7 +2539,7 @@ version of GNAT. For the exact list of restrictions, see the compiler sources and references to Check_Compiler_Unit. @node Pragma Complete_Representation,Pragma Complex_Representation,Pragma Compiler_Unit_Warning,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-complete-representation}@anchor{3c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-complete-representation}@anchor{40} @section Pragma Complete_Representation @@ -2387,7 +2558,7 @@ complete, and that this invariant is maintained if fields are added to the record in the future. @node Pragma Complex_Representation,Pragma Component_Alignment,Pragma Complete_Representation,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-complex-representation}@anchor{3d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-complex-representation}@anchor{41} @section Pragma Complex_Representation @@ -2409,7 +2580,7 @@ records by pointer, and the use of this pragma may result in passing this type in floating-point registers. @node Pragma Component_Alignment,Pragma Constant_After_Elaboration,Pragma Complex_Representation,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-component-alignment}@anchor{3e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-component-alignment}@anchor{42} @section Pragma Component_Alignment @@ -2500,7 +2671,7 @@ pragma @code{Pack}, pragma @code{Component_Alignment}, or a record rep clause), the GNAT uses the default alignment as described previously. @node Pragma Constant_After_Elaboration,Pragma Contract_Cases,Pragma Component_Alignment,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id6}@anchor{3f}@anchor{gnat_rm/implementation_defined_pragmas pragma-constant-after-elaboration}@anchor{40} +@anchor{gnat_rm/implementation_defined_pragmas id6}@anchor{43}@anchor{gnat_rm/implementation_defined_pragmas pragma-constant-after-elaboration}@anchor{44} @section Pragma Constant_After_Elaboration @@ -2514,7 +2685,7 @@ For the semantics of this pragma, see the entry for aspect @code{Constant_After_Elaboration} in the SPARK 2014 Reference Manual, section 3.3.1. @node Pragma Contract_Cases,Pragma Convention_Identifier,Pragma Constant_After_Elaboration,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id7}@anchor{41}@anchor{gnat_rm/implementation_defined_pragmas pragma-contract-cases}@anchor{42} +@anchor{gnat_rm/implementation_defined_pragmas id7}@anchor{45}@anchor{gnat_rm/implementation_defined_pragmas pragma-contract-cases}@anchor{46} @section Pragma Contract_Cases @@ -2599,7 +2770,7 @@ and that the consequence for this case should hold when the subprogram returns. @node Pragma Convention_Identifier,Pragma CPP_Class,Pragma Contract_Cases,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-convention-identifier}@anchor{43} +@anchor{gnat_rm/implementation_defined_pragmas pragma-convention-identifier}@anchor{47} @section Pragma Convention_Identifier @@ -2635,7 +2806,7 @@ define a convention identifier @code{Library} and use a single would be used system-wide. @node Pragma CPP_Class,Pragma CPP_Constructor,Pragma Convention_Identifier,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-class}@anchor{44} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-class}@anchor{48} @section Pragma CPP_Class @@ -2660,14 +2831,14 @@ functions (see pragma @code{CPP_Constructor}). Such types are implicitly limited if not explicitly declared as limited or derived from a limited type, and an error is issued in that case. -See @ref{45,,Interfacing to C++} for related information. +See @ref{49,,Interfacing to C++} for related information. Note: Pragma @code{CPP_Class} is currently obsolete. It is supported for backward compatibility but its functionality is available using pragma @code{Import} with @code{Convention} = @code{CPP}. @node Pragma CPP_Constructor,Pragma CPP_Virtual,Pragma CPP_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-constructor}@anchor{46} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-constructor}@anchor{4a} @section Pragma CPP_Constructor @@ -2718,7 +2889,7 @@ on the Ada side and the type is implicitly declared abstract. Pragma @code{CPP_Constructor} is intended primarily for automatic generation using an automatic binding generator tool (such as the @code{-fdump-ada-spec} GCC switch). -See @ref{45,,Interfacing to C++} for more related information. +See @ref{49,,Interfacing to C++} for more related information. Note: The use of functions returning class-wide types for constructors is currently obsolete. They are supported for backward compatibility. The @@ -2727,7 +2898,7 @@ because the imported C++ constructors always return an object of type T; that is, they never return an object whose type is a descendant of type T. @node Pragma CPP_Virtual,Pragma CPP_Vtable,Pragma CPP_Constructor,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-virtual}@anchor{47} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-virtual}@anchor{4b} @section Pragma CPP_Virtual @@ -2740,10 +2911,10 @@ purposes. It used to be required to ensure compoatibility with C++, but is no longer required for that purpose because GNAT generates the same object layout as the G++ compiler by default. -See @ref{45,,Interfacing to C++} for related information. +See @ref{49,,Interfacing to C++} for related information. @node Pragma CPP_Vtable,Pragma CPU,Pragma CPP_Virtual,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-vtable}@anchor{48} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-vtable}@anchor{4c} @section Pragma CPP_Vtable @@ -2755,10 +2926,10 @@ It used to be required to ensure compatibility with C++, but is no longer required for that purpose because GNAT generates the same object layout as the G++ compiler by default. -See @ref{45,,Interfacing to C++} for related information. +See @ref{49,,Interfacing to C++} for related information. @node Pragma CPU,Pragma Deadline_Floor,Pragma CPP_Vtable,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpu}@anchor{49} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpu}@anchor{4d} @section Pragma CPU @@ -2773,7 +2944,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Deadline_Floor,Pragma Default_Initial_Condition,Pragma CPU,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-deadline-floor}@anchor{4a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-deadline-floor}@anchor{4e} @section Pragma Deadline_Floor @@ -2788,7 +2959,7 @@ deadline inherited by a task when the task enters a protected object. It is effective only when the EDF scheduling policy is used. @node Pragma Default_Initial_Condition,Pragma Debug,Pragma Deadline_Floor,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id8}@anchor{4b}@anchor{gnat_rm/implementation_defined_pragmas pragma-default-initial-condition}@anchor{4c} +@anchor{gnat_rm/implementation_defined_pragmas id8}@anchor{4f}@anchor{gnat_rm/implementation_defined_pragmas pragma-default-initial-condition}@anchor{50} @section Pragma Default_Initial_Condition @@ -2802,7 +2973,7 @@ For the semantics of this pragma, see the entry for aspect @code{Default_Initial_Condition} in the SPARK 2014 Reference Manual, section 7.3.3. @node Pragma Debug,Pragma Debug_Policy,Pragma Default_Initial_Condition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-debug}@anchor{4d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-debug}@anchor{51} @section Pragma Debug @@ -2830,7 +3001,7 @@ or by use of the pragma @code{Check_Policy} with a first argument of @code{Debug}. @node Pragma Debug_Policy,Pragma Default_Scalar_Storage_Order,Pragma Debug,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-debug-policy}@anchor{4e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-debug-policy}@anchor{52} @section Pragma Debug_Policy @@ -2845,7 +3016,7 @@ with a first argument of @code{Debug}. It is retained for historical compatibility reasons. @node Pragma Default_Scalar_Storage_Order,Pragma Default_Storage_Pool,Pragma Debug_Policy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-default-scalar-storage-order}@anchor{4f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-default-scalar-storage-order}@anchor{53} @section Pragma Default_Scalar_Storage_Order @@ -2918,7 +3089,7 @@ it may significantly degrade the run-time performance of the software, instead the default scalar storage order ought to be changed only on a local basis. @node Pragma Default_Storage_Pool,Pragma Depends,Pragma Default_Scalar_Storage_Order,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-default-storage-pool}@anchor{50} +@anchor{gnat_rm/implementation_defined_pragmas pragma-default-storage-pool}@anchor{54} @section Pragma Default_Storage_Pool @@ -2935,7 +3106,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Depends,Pragma Detect_Blocking,Pragma Default_Storage_Pool,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-depends}@anchor{51}@anchor{gnat_rm/implementation_defined_pragmas id9}@anchor{52} +@anchor{gnat_rm/implementation_defined_pragmas pragma-depends}@anchor{55}@anchor{gnat_rm/implementation_defined_pragmas id9}@anchor{56} @section Pragma Depends @@ -2968,7 +3139,7 @@ For the semantics of this pragma, see the entry for aspect @code{Depends} in the SPARK 2014 Reference Manual, section 6.1.5. @node Pragma Detect_Blocking,Pragma Disable_Atomic_Synchronization,Pragma Depends,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-detect-blocking}@anchor{53} +@anchor{gnat_rm/implementation_defined_pragmas pragma-detect-blocking}@anchor{57} @section Pragma Detect_Blocking @@ -2986,7 +3157,7 @@ blocking operations within a protected operation, and to raise Program_Error if that happens. @node Pragma Disable_Atomic_Synchronization,Pragma Dispatching_Domain,Pragma Detect_Blocking,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-disable-atomic-synchronization}@anchor{54} +@anchor{gnat_rm/implementation_defined_pragmas pragma-disable-atomic-synchronization}@anchor{58} @section Pragma Disable_Atomic_Synchronization @@ -3012,7 +3183,7 @@ till the end of the scope. If an @code{Entity} argument is present, the action applies only to that entity. @node Pragma Dispatching_Domain,Pragma Effective_Reads,Pragma Disable_Atomic_Synchronization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-dispatching-domain}@anchor{55} +@anchor{gnat_rm/implementation_defined_pragmas pragma-dispatching-domain}@anchor{59} @section Pragma Dispatching_Domain @@ -3027,7 +3198,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Effective_Reads,Pragma Effective_Writes,Pragma Dispatching_Domain,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id10}@anchor{56}@anchor{gnat_rm/implementation_defined_pragmas pragma-effective-reads}@anchor{57} +@anchor{gnat_rm/implementation_defined_pragmas id10}@anchor{5a}@anchor{gnat_rm/implementation_defined_pragmas pragma-effective-reads}@anchor{5b} @section Pragma Effective_Reads @@ -3041,7 +3212,7 @@ For the semantics of this pragma, see the entry for aspect @code{Effective_Reads the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Effective_Writes,Pragma Elaboration_Checks,Pragma Effective_Reads,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id11}@anchor{58}@anchor{gnat_rm/implementation_defined_pragmas pragma-effective-writes}@anchor{59} +@anchor{gnat_rm/implementation_defined_pragmas id11}@anchor{5c}@anchor{gnat_rm/implementation_defined_pragmas pragma-effective-writes}@anchor{5d} @section Pragma Effective_Writes @@ -3055,7 +3226,7 @@ For the semantics of this pragma, see the entry for aspect @code{Effective_Write in the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Elaboration_Checks,Pragma Eliminate,Pragma Effective_Writes,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-elaboration-checks}@anchor{5a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-elaboration-checks}@anchor{5e} @section Pragma Elaboration_Checks @@ -3092,7 +3263,7 @@ effect. If the pragma argument is @code{Static}, then the static elaboration mod is in effect. @node Pragma Eliminate,Pragma Enable_Atomic_Synchronization,Pragma Elaboration_Checks,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-eliminate}@anchor{5b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-eliminate}@anchor{5f} @section Pragma Eliminate @@ -3252,7 +3423,7 @@ pragma Eliminate (Q, Proc, @end quotation @node Pragma Enable_Atomic_Synchronization,Pragma Export_Function,Pragma Eliminate,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-enable-atomic-synchronization}@anchor{5c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-enable-atomic-synchronization}@anchor{60} @section Pragma Enable_Atomic_Synchronization @@ -3280,7 +3451,7 @@ till the end of the scope. If an @code{Entity} argument is present, the action applies only to that entity. @node Pragma Export_Function,Pragma Export_Object,Pragma Enable_Atomic_Synchronization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-function}@anchor{5d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-export-function}@anchor{61} @section Pragma Export_Function @@ -3352,7 +3523,7 @@ string. In this case, no external name is generated. This form still allows the specification of parameter mechanisms. @node Pragma Export_Object,Pragma Export_Procedure,Pragma Export_Function,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-object}@anchor{5e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-export-object}@anchor{62} @section Pragma Export_Object @@ -3377,7 +3548,7 @@ of portability), but it is not required. @code{Size} is syntax checked, but otherwise ignored by GNAT. @node Pragma Export_Procedure,Pragma Export_Value,Pragma Export_Object,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-procedure}@anchor{5f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-export-procedure}@anchor{63} @section Pragma Export_Procedure @@ -3430,7 +3601,7 @@ string. In this case, no external name is generated. This form still allows the specification of parameter mechanisms. @node Pragma Export_Value,Pragma Export_Valued_Procedure,Pragma Export_Procedure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-value}@anchor{60} +@anchor{gnat_rm/implementation_defined_pragmas pragma-export-value}@anchor{64} @section Pragma Export_Value @@ -3451,7 +3622,7 @@ the application. This pragma is currently supported only for the AAMP target and is ignored for other targets. @node Pragma Export_Valued_Procedure,Pragma Extend_System,Pragma Export_Value,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-valued-procedure}@anchor{61} +@anchor{gnat_rm/implementation_defined_pragmas pragma-export-valued-procedure}@anchor{65} @section Pragma Export_Valued_Procedure @@ -3509,7 +3680,7 @@ string. In this case, no external name is generated. This form still allows the specification of parameter mechanisms. @node Pragma Extend_System,Pragma Extensions_Allowed,Pragma Export_Valued_Procedure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-extend-system}@anchor{62} +@anchor{gnat_rm/implementation_defined_pragmas pragma-extend-system}@anchor{66} @section Pragma Extend_System @@ -3560,7 +3731,7 @@ for compiling System units, as explained in the GNAT User's Guide. @node Pragma Extensions_Allowed,Pragma Extensions_Visible,Pragma Extend_System,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-allowed}@anchor{63} +@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-allowed}@anchor{67} @section Pragma Extensions_Allowed @@ -3593,7 +3764,7 @@ is constrained. @end table @node Pragma Extensions_Visible,Pragma External,Pragma Extensions_Allowed,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id12}@anchor{64}@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-visible}@anchor{65} +@anchor{gnat_rm/implementation_defined_pragmas id12}@anchor{68}@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-visible}@anchor{69} @section Pragma Extensions_Visible @@ -3607,7 +3778,7 @@ For the semantics of this pragma, see the entry for aspect @code{Extensions_Visi in the SPARK 2014 Reference Manual, section 6.1.7. @node Pragma External,Pragma External_Name_Casing,Pragma Extensions_Visible,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-external}@anchor{66} +@anchor{gnat_rm/implementation_defined_pragmas pragma-external}@anchor{6a} @section Pragma External @@ -3628,7 +3799,7 @@ used this pragma for exactly the same purposes as pragma @code{Export} before the latter was standardized. @node Pragma External_Name_Casing,Pragma Fast_Math,Pragma External,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-external-name-casing}@anchor{67} +@anchor{gnat_rm/implementation_defined_pragmas pragma-external-name-casing}@anchor{6b} @section Pragma External_Name_Casing @@ -3717,7 +3888,7 @@ pragma External_Name_Casing (Uppercase, Uppercase); to enforce the upper casing of all external symbols. @node Pragma Fast_Math,Pragma Favor_Top_Level,Pragma External_Name_Casing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-fast-math}@anchor{68} +@anchor{gnat_rm/implementation_defined_pragmas pragma-fast-math}@anchor{6c} @section Pragma Fast_Math @@ -3746,7 +3917,7 @@ under control of the pragma, rather than use the preinstantiated versions. @end table @node Pragma Favor_Top_Level,Pragma Finalize_Storage_Only,Pragma Fast_Math,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id13}@anchor{69}@anchor{gnat_rm/implementation_defined_pragmas pragma-favor-top-level}@anchor{6a} +@anchor{gnat_rm/implementation_defined_pragmas id13}@anchor{6d}@anchor{gnat_rm/implementation_defined_pragmas pragma-favor-top-level}@anchor{6e} @section Pragma Favor_Top_Level @@ -3765,7 +3936,7 @@ When this pragma is used, dynamically generated trampolines may be used on some targets for nested subprograms. See restriction @code{No_Implicit_Dynamic_Code}. @node Pragma Finalize_Storage_Only,Pragma Float_Representation,Pragma Favor_Top_Level,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-finalize-storage-only}@anchor{6b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-finalize-storage-only}@anchor{6f} @section Pragma Finalize_Storage_Only @@ -3785,7 +3956,7 @@ name. Note that this pragma does not suppress Finalize calls for library-level heap-allocated objects (see pragma @code{No_Heap_Finalization}). @node Pragma Float_Representation,Pragma Ghost,Pragma Finalize_Storage_Only,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-float-representation}@anchor{6c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-float-representation}@anchor{70} @section Pragma Float_Representation @@ -3820,7 +3991,7 @@ No other value of digits is permitted. @end itemize @node Pragma Ghost,Pragma Global,Pragma Float_Representation,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ghost}@anchor{6d}@anchor{gnat_rm/implementation_defined_pragmas id14}@anchor{6e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ghost}@anchor{71}@anchor{gnat_rm/implementation_defined_pragmas id14}@anchor{72} @section Pragma Ghost @@ -3834,7 +4005,7 @@ For the semantics of this pragma, see the entry for aspect @code{Ghost} in the S 2014 Reference Manual, section 6.9. @node Pragma Global,Pragma Ident,Pragma Ghost,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-global}@anchor{6f}@anchor{gnat_rm/implementation_defined_pragmas id15}@anchor{70} +@anchor{gnat_rm/implementation_defined_pragmas pragma-global}@anchor{73}@anchor{gnat_rm/implementation_defined_pragmas id15}@anchor{74} @section Pragma Global @@ -3859,7 +4030,7 @@ For the semantics of this pragma, see the entry for aspect @code{Global} in the SPARK 2014 Reference Manual, section 6.1.4. @node Pragma Ident,Pragma Ignore_Pragma,Pragma Global,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ident}@anchor{71} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ident}@anchor{75} @section Pragma Ident @@ -3873,7 +4044,7 @@ This pragma is identical in effect to pragma @code{Comment}. It is provided for compatibility with other Ada compilers providing this pragma. @node Pragma Ignore_Pragma,Pragma Implementation_Defined,Pragma Ident,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ignore-pragma}@anchor{72} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ignore-pragma}@anchor{76} @section Pragma Ignore_Pragma @@ -3893,7 +4064,7 @@ pragma allows such pragmas to be ignored, which may be useful in CodePeer mode, or during porting of legacy code. @node Pragma Implementation_Defined,Pragma Implemented,Pragma Ignore_Pragma,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-implementation-defined}@anchor{73} +@anchor{gnat_rm/implementation_defined_pragmas pragma-implementation-defined}@anchor{77} @section Pragma Implementation_Defined @@ -3920,7 +4091,7 @@ for the purpose of implementing the No_Implementation_Identifiers restriction. @node Pragma Implemented,Pragma Implicit_Packing,Pragma Implementation_Defined,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-implemented}@anchor{74} +@anchor{gnat_rm/implementation_defined_pragmas pragma-implemented}@anchor{78} @section Pragma Implemented @@ -3966,7 +4137,7 @@ By_Any shares the behavior of By_Entry and By_Protected_Procedure depending on the target's overriding subprogram kind. @node Pragma Implicit_Packing,Pragma Import_Function,Pragma Implemented,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-implicit-packing}@anchor{75} +@anchor{gnat_rm/implementation_defined_pragmas pragma-implicit-packing}@anchor{79} @section Pragma Implicit_Packing @@ -4020,7 +4191,7 @@ sufficient. The use of pragma Implicit_Packing allows this record declaration to compile without an explicit pragma Pack. @node Pragma Import_Function,Pragma Import_Object,Pragma Implicit_Packing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-import-function}@anchor{76} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-function}@anchor{7a} @section Pragma Import_Function @@ -4085,7 +4256,7 @@ notation. If the mechanism is not specified, the default mechanism is used. @node Pragma Import_Object,Pragma Import_Procedure,Pragma Import_Function,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-import-object}@anchor{77} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-object}@anchor{7b} @section Pragma Import_Object @@ -4111,7 +4282,7 @@ point of view). @code{size} is syntax checked, but otherwise ignored by GNAT. @node Pragma Import_Procedure,Pragma Import_Valued_Procedure,Pragma Import_Object,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-import-procedure}@anchor{78} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-procedure}@anchor{7c} @section Pragma Import_Procedure @@ -4151,7 +4322,7 @@ applies to a procedure rather than a function and the parameters @code{Result_Type} and @code{Result_Mechanism} are not permitted. @node Pragma Import_Valued_Procedure,Pragma Independent,Pragma Import_Procedure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-import-valued-procedure}@anchor{79} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-valued-procedure}@anchor{7d} @section Pragma Import_Valued_Procedure @@ -4204,7 +4375,7 @@ pragma Import that specifies the desired convention, since otherwise the default convention is Ada, which is almost certainly not what is required. @node Pragma Independent,Pragma Independent_Components,Pragma Import_Valued_Procedure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-independent}@anchor{7a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-independent}@anchor{7e} @section Pragma Independent @@ -4226,7 +4397,7 @@ constraints on the representation of the object (for instance prohibiting tight packing). @node Pragma Independent_Components,Pragma Initial_Condition,Pragma Independent,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-independent-components}@anchor{7b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-independent-components}@anchor{7f} @section Pragma Independent_Components @@ -4247,7 +4418,7 @@ constraints on the representation of the object (for instance prohibiting tight packing). @node Pragma Initial_Condition,Pragma Initialize_Scalars,Pragma Independent_Components,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id16}@anchor{7c}@anchor{gnat_rm/implementation_defined_pragmas pragma-initial-condition}@anchor{7d} +@anchor{gnat_rm/implementation_defined_pragmas id16}@anchor{80}@anchor{gnat_rm/implementation_defined_pragmas pragma-initial-condition}@anchor{81} @section Pragma Initial_Condition @@ -4261,7 +4432,7 @@ For the semantics of this pragma, see the entry for aspect @code{Initial_Conditi in the SPARK 2014 Reference Manual, section 7.1.6. @node Pragma Initialize_Scalars,Pragma Initializes,Pragma Initial_Condition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-initialize-scalars}@anchor{7e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-initialize-scalars}@anchor{82} @section Pragma Initialize_Scalars @@ -4324,7 +4495,7 @@ checking (see description of stack checking in the GNAT User's Guide) when using this pragma. @node Pragma Initializes,Pragma Inline_Always,Pragma Initialize_Scalars,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-initializes}@anchor{7f}@anchor{gnat_rm/implementation_defined_pragmas id17}@anchor{80} +@anchor{gnat_rm/implementation_defined_pragmas pragma-initializes}@anchor{83}@anchor{gnat_rm/implementation_defined_pragmas id17}@anchor{84} @section Pragma Initializes @@ -4351,7 +4522,7 @@ For the semantics of this pragma, see the entry for aspect @code{Initializes} in SPARK 2014 Reference Manual, section 7.1.5. @node Pragma Inline_Always,Pragma Inline_Generic,Pragma Initializes,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id18}@anchor{81}@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-always}@anchor{82} +@anchor{gnat_rm/implementation_defined_pragmas id18}@anchor{85}@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-always}@anchor{86} @section Pragma Inline_Always @@ -4370,7 +4541,7 @@ apply this pragma to a primitive operation of a tagged type. Thanks to such restrictions, the compiler is allowed to remove the out-of-line body of @code{NAME}. @node Pragma Inline_Generic,Pragma Interface,Pragma Inline_Always,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-generic}@anchor{83} +@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-generic}@anchor{87} @section Pragma Inline_Generic @@ -4388,7 +4559,7 @@ than to check that the given names are all names of generic units or generic instances. @node Pragma Interface,Pragma Interface_Name,Pragma Inline_Generic,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-interface}@anchor{84} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interface}@anchor{88} @section Pragma Interface @@ -4415,7 +4586,7 @@ maintaining Ada 83/Ada 95 compatibility and is compatible with other Ada 83 compilers. @node Pragma Interface_Name,Pragma Interrupt_Handler,Pragma Interface,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-interface-name}@anchor{85} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interface-name}@anchor{89} @section Pragma Interface_Name @@ -4434,7 +4605,7 @@ for an interfaced subprogram, and is provided for compatibility with Ada least one of @code{External_Name} or @code{Link_Name}. @node Pragma Interrupt_Handler,Pragma Interrupt_State,Pragma Interface_Name,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-handler}@anchor{86} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-handler}@anchor{8a} @section Pragma Interrupt_Handler @@ -4454,7 +4625,7 @@ when this pragma is applied to a nonprotected procedure, the instruction maskable interrupts, in place of the normal return instruction. @node Pragma Interrupt_State,Pragma Invariant,Pragma Interrupt_Handler,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-state}@anchor{87} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-state}@anchor{8b} @section Pragma Interrupt_State @@ -4540,7 +4711,7 @@ with an application's runtime behavior in the cases of the synchronous signals, and in the case of the signal used to implement the @code{abort} statement. @node Pragma Invariant,Pragma Keep_Names,Pragma Interrupt_State,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id19}@anchor{88}@anchor{gnat_rm/implementation_defined_pragmas pragma-invariant}@anchor{89} +@anchor{gnat_rm/implementation_defined_pragmas id19}@anchor{8c}@anchor{gnat_rm/implementation_defined_pragmas pragma-invariant}@anchor{8d} @section Pragma Invariant @@ -4579,7 +4750,7 @@ For further details on the use of this pragma, see the Ada 2012 documentation of the Type_Invariant aspect. @node Pragma Keep_Names,Pragma License,Pragma Invariant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-keep-names}@anchor{8a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-keep-names}@anchor{8e} @section Pragma Keep_Names @@ -4599,7 +4770,7 @@ use a @code{Discard_Names} pragma in the @code{gnat.adc} file, but you want to retain the names for specific enumeration types. @node Pragma License,Pragma Link_With,Pragma Keep_Names,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-license}@anchor{8b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-license}@anchor{8f} @section Pragma License @@ -4694,7 +4865,7 @@ GPL, but no warning for @code{GNAT.Sockets} which is part of the GNAT run time, and is therefore licensed under the modified GPL. @node Pragma Link_With,Pragma Linker_Alias,Pragma License,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-link-with}@anchor{8c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-link-with}@anchor{90} @section Pragma Link_With @@ -4718,7 +4889,7 @@ separate arguments to the linker. In addition pragma Link_With allows multiple arguments, with the same effect as successive pragmas. @node Pragma Linker_Alias,Pragma Linker_Constructor,Pragma Link_With,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-alias}@anchor{8d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-alias}@anchor{91} @section Pragma Linker_Alias @@ -4759,7 +4930,7 @@ end p; @end example @node Pragma Linker_Constructor,Pragma Linker_Destructor,Pragma Linker_Alias,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-constructor}@anchor{8e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-constructor}@anchor{92} @section Pragma Linker_Constructor @@ -4789,7 +4960,7 @@ listed above. Where possible, the use of Stand Alone Libraries is preferable to the use of this pragma. @node Pragma Linker_Destructor,Pragma Linker_Section,Pragma Linker_Constructor,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-destructor}@anchor{8f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-destructor}@anchor{93} @section Pragma Linker_Destructor @@ -4812,7 +4983,7 @@ See @code{pragma Linker_Constructor} for the set of restrictions that apply because of these specific contexts. @node Pragma Linker_Section,Pragma Lock_Free,Pragma Linker_Destructor,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id20}@anchor{90}@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-section}@anchor{91} +@anchor{gnat_rm/implementation_defined_pragmas id20}@anchor{94}@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-section}@anchor{95} @section Pragma Linker_Section @@ -4886,7 +5057,7 @@ end IO_Card; @end example @node Pragma Lock_Free,Pragma Loop_Invariant,Pragma Linker_Section,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id21}@anchor{92}@anchor{gnat_rm/implementation_defined_pragmas pragma-lock-free}@anchor{93} +@anchor{gnat_rm/implementation_defined_pragmas id21}@anchor{96}@anchor{gnat_rm/implementation_defined_pragmas pragma-lock-free}@anchor{97} @section Pragma Lock_Free @@ -4897,7 +5068,7 @@ Compilation fails if the compiler cannot generate lock-free code for the operations. @node Pragma Loop_Invariant,Pragma Loop_Optimize,Pragma Lock_Free,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-invariant}@anchor{94} +@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-invariant}@anchor{98} @section Pragma Loop_Invariant @@ -4930,7 +5101,7 @@ attribute can only be used within the expression of a @code{Loop_Invariant} pragma. For full details, see documentation of attribute @code{Loop_Entry}. @node Pragma Loop_Optimize,Pragma Loop_Variant,Pragma Loop_Invariant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-optimize}@anchor{95} +@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-optimize}@anchor{99} @section Pragma Loop_Optimize @@ -4992,7 +5163,7 @@ compiler in order to enable the relevant optimizations, that is to say vectorization. @node Pragma Loop_Variant,Pragma Machine_Attribute,Pragma Loop_Optimize,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-variant}@anchor{96} +@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-variant}@anchor{9a} @section Pragma Loop_Variant @@ -5039,7 +5210,7 @@ The @code{Loop_Entry} attribute may be used within the expressions of the @code{Loop_Variant} pragma to refer to values on entry to the loop. @node Pragma Machine_Attribute,Pragma Main,Pragma Loop_Variant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-machine-attribute}@anchor{97} +@anchor{gnat_rm/implementation_defined_pragmas pragma-machine-attribute}@anchor{9b} @section Pragma Machine_Attribute @@ -5064,7 +5235,7 @@ for some attributes. For further information see @cite{GNU Compiler Collection (GCC) Internals}. @node Pragma Main,Pragma Main_Storage,Pragma Machine_Attribute,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-main}@anchor{98} +@anchor{gnat_rm/implementation_defined_pragmas pragma-main}@anchor{9c} @section Pragma Main @@ -5084,7 +5255,7 @@ This pragma is provided for compatibility with OpenVMS VAX Systems. It has no effect in GNAT, other than being syntax checked. @node Pragma Main_Storage,Pragma Max_Queue_Length,Pragma Main,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-main-storage}@anchor{99} +@anchor{gnat_rm/implementation_defined_pragmas pragma-main-storage}@anchor{9d} @section Pragma Main_Storage @@ -5103,7 +5274,7 @@ This pragma is provided for compatibility with OpenVMS VAX Systems. It has no effect in GNAT, other than being syntax checked. @node Pragma Max_Queue_Length,Pragma No_Body,Pragma Main_Storage,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id22}@anchor{9a}@anchor{gnat_rm/implementation_defined_pragmas pragma-max-queue-length}@anchor{9b} +@anchor{gnat_rm/implementation_defined_pragmas id22}@anchor{9e}@anchor{gnat_rm/implementation_defined_pragmas pragma-max-queue-length}@anchor{9f} @section Pragma Max_Queue_Length @@ -5119,7 +5290,7 @@ positive integer as a parameter and must appear after the declaration of an entry. @node Pragma No_Body,Pragma No_Component_Reordering,Pragma Max_Queue_Length,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-body}@anchor{9c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-body}@anchor{a0} @section Pragma No_Body @@ -5142,7 +5313,7 @@ dummy body with a No_Body pragma ensures that there is no interference from earlier versions of the package body. @node Pragma No_Component_Reordering,Pragma No_Elaboration_Code_All,Pragma No_Body,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-component-reordering}@anchor{9d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-component-reordering}@anchor{a1} @section Pragma No_Component_Reordering @@ -5161,7 +5332,7 @@ declared in units to which the pragma applies and there is a requirement that this pragma be used consistently within a partition. @node Pragma No_Elaboration_Code_All,Pragma No_Heap_Finalization,Pragma No_Component_Reordering,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id23}@anchor{9e}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-elaboration-code-all}@anchor{9f} +@anchor{gnat_rm/implementation_defined_pragmas id23}@anchor{a2}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-elaboration-code-all}@anchor{a3} @section Pragma No_Elaboration_Code_All @@ -5180,7 +5351,7 @@ current unit, it must also have the No_Elaboration_Code_All aspect set. It may be applied to package or subprogram specs or their generic versions. @node Pragma No_Heap_Finalization,Pragma No_Inline,Pragma No_Elaboration_Code_All,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-heap-finalization}@anchor{a0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-heap-finalization}@anchor{a4} @section Pragma No_Heap_Finalization @@ -5212,7 +5383,7 @@ lose its @code{No_Heap_Finalization} pragma when the corresponding instance does appear at the library level. @node Pragma No_Inline,Pragma No_Return,Pragma No_Heap_Finalization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id24}@anchor{a1}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-inline}@anchor{a2} +@anchor{gnat_rm/implementation_defined_pragmas id24}@anchor{a5}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-inline}@anchor{a6} @section Pragma No_Inline @@ -5230,7 +5401,7 @@ in particular it is not subject to the use of option @emph{-gnatn} or pragma @code{Inline_Always} for the same @code{NAME}. @node Pragma No_Return,Pragma No_Run_Time,Pragma No_Inline,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-return}@anchor{a3} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-return}@anchor{a7} @section Pragma No_Return @@ -5257,7 +5428,7 @@ available in all earlier versions of Ada as an implementation-defined pragma. @node Pragma No_Run_Time,Pragma No_Strict_Aliasing,Pragma No_Return,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-run-time}@anchor{a4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-run-time}@anchor{a8} @section Pragma No_Run_Time @@ -5273,7 +5444,7 @@ internal testing. The pragma has been superseded by the reconfigurable runtime capability of GNAT. @node Pragma No_Strict_Aliasing,Pragma No_Tagged_Streams,Pragma No_Run_Time,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-strict-aliasing}@anchor{a5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-strict-aliasing}@anchor{a9} @section Pragma No_Strict_Aliasing @@ -5295,7 +5466,7 @@ in the @cite{GNAT User's Guide}. This pragma currently has no effects on access to unconstrained array types. @node Pragma No_Tagged_Streams,Pragma Normalize_Scalars,Pragma No_Strict_Aliasing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-tagged-streams}@anchor{a6}@anchor{gnat_rm/implementation_defined_pragmas id25}@anchor{a7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-tagged-streams}@anchor{aa}@anchor{gnat_rm/implementation_defined_pragmas id25}@anchor{ab} @section Pragma No_Tagged_Streams @@ -5334,7 +5505,7 @@ with empty strings. This is useful to avoid exposing entity names at binary level but has a negative impact on the debuggability of tagged types. @node Pragma Normalize_Scalars,Pragma Obsolescent,Pragma No_Tagged_Streams,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-normalize-scalars}@anchor{a8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-normalize-scalars}@anchor{ac} @section Pragma Normalize_Scalars @@ -5416,7 +5587,7 @@ will always generate an invalid value if one exists. @end table @node Pragma Obsolescent,Pragma Optimize_Alignment,Pragma Normalize_Scalars,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-obsolescent}@anchor{a9}@anchor{gnat_rm/implementation_defined_pragmas id26}@anchor{aa} +@anchor{gnat_rm/implementation_defined_pragmas pragma-obsolescent}@anchor{ad}@anchor{gnat_rm/implementation_defined_pragmas id26}@anchor{ae} @section Pragma Obsolescent @@ -5512,7 +5683,7 @@ So if you specify @code{Entity =>} for the @code{Entity} argument, and a @code{M argument is present, it must be preceded by @code{Message =>}. @node Pragma Optimize_Alignment,Pragma Ordered,Pragma Obsolescent,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-optimize-alignment}@anchor{ab} +@anchor{gnat_rm/implementation_defined_pragmas pragma-optimize-alignment}@anchor{af} @section Pragma Optimize_Alignment @@ -5598,7 +5769,7 @@ latter are compiled by default in pragma Optimize_Alignment (Off) mode if no pragma appears at the start of the file. @node Pragma Ordered,Pragma Overflow_Mode,Pragma Optimize_Alignment,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ordered}@anchor{ac} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ordered}@anchor{b0} @section Pragma Ordered @@ -5690,7 +5861,7 @@ For additional information please refer to the description of the @emph{-gnatw.u} switch in the GNAT User's Guide. @node Pragma Overflow_Mode,Pragma Overriding_Renamings,Pragma Ordered,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-overflow-mode}@anchor{ad} +@anchor{gnat_rm/implementation_defined_pragmas pragma-overflow-mode}@anchor{b1} @section Pragma Overflow_Mode @@ -5729,7 +5900,7 @@ The pragma @code{Unsuppress (Overflow_Check)} unsuppresses (enables) overflow checking, but does not affect the overflow mode. @node Pragma Overriding_Renamings,Pragma Partition_Elaboration_Policy,Pragma Overflow_Mode,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-overriding-renamings}@anchor{ae} +@anchor{gnat_rm/implementation_defined_pragmas pragma-overriding-renamings}@anchor{b2} @section Pragma Overriding_Renamings @@ -5764,7 +5935,7 @@ RM 8.3 (15) stipulates that an overridden operation is not visible within the declaration of the overriding operation. @node Pragma Partition_Elaboration_Policy,Pragma Part_Of,Pragma Overriding_Renamings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-partition-elaboration-policy}@anchor{af} +@anchor{gnat_rm/implementation_defined_pragmas pragma-partition-elaboration-policy}@anchor{b3} @section Pragma Partition_Elaboration_Policy @@ -5781,7 +5952,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Part_Of,Pragma Passive,Pragma Partition_Elaboration_Policy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id27}@anchor{b0}@anchor{gnat_rm/implementation_defined_pragmas pragma-part-of}@anchor{b1} +@anchor{gnat_rm/implementation_defined_pragmas id27}@anchor{b4}@anchor{gnat_rm/implementation_defined_pragmas pragma-part-of}@anchor{b5} @section Pragma Part_Of @@ -5797,7 +5968,7 @@ For the semantics of this pragma, see the entry for aspect @code{Part_Of} in the SPARK 2014 Reference Manual, section 7.2.6. @node Pragma Passive,Pragma Persistent_BSS,Pragma Part_Of,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-passive}@anchor{b2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-passive}@anchor{b6} @section Pragma Passive @@ -5821,7 +5992,7 @@ For more information on the subject of passive tasks, see the section 'Passive Task Optimization' in the GNAT Users Guide. @node Pragma Persistent_BSS,Pragma Polling,Pragma Passive,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id28}@anchor{b3}@anchor{gnat_rm/implementation_defined_pragmas pragma-persistent-bss}@anchor{b4} +@anchor{gnat_rm/implementation_defined_pragmas id28}@anchor{b7}@anchor{gnat_rm/implementation_defined_pragmas pragma-persistent-bss}@anchor{b8} @section Pragma Persistent_BSS @@ -5852,7 +6023,7 @@ If this pragma is used on a target where this feature is not supported, then the pragma will be ignored. See also @code{pragma Linker_Section}. @node Pragma Polling,Pragma Post,Pragma Persistent_BSS,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-polling}@anchor{b5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-polling}@anchor{b9} @section Pragma Polling @@ -5894,7 +6065,7 @@ Note that polling can also be enabled by use of the @emph{-gnatP} switch. See the section on switches for gcc in the @cite{GNAT User's Guide}. @node Pragma Post,Pragma Postcondition,Pragma Polling,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-post}@anchor{b6} +@anchor{gnat_rm/implementation_defined_pragmas pragma-post}@anchor{ba} @section Pragma Post @@ -5919,7 +6090,7 @@ appear at the start of the declarations in a subprogram body (preceded only by other pragmas). @node Pragma Postcondition,Pragma Post_Class,Pragma Post,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-postcondition}@anchor{b7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-postcondition}@anchor{bb} @section Pragma Postcondition @@ -6084,7 +6255,7 @@ Ada 2012, and has been retained in its original form for compatibility purposes. @node Pragma Post_Class,Pragma Rename_Pragma,Pragma Postcondition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-post-class}@anchor{b8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-post-class}@anchor{bc} @section Pragma Post_Class @@ -6119,7 +6290,7 @@ policy that controls this pragma is @code{Post'Class}, not @code{Post_Class}. @node Pragma Rename_Pragma,Pragma Pre,Pragma Post_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-rename-pragma}@anchor{b9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-rename-pragma}@anchor{bd} @section Pragma Rename_Pragma @@ -6158,7 +6329,7 @@ Pragma Inline_Only will not necessarily mean the same thing as the other Ada compiler; it's up to you to make sure the semantics are close enough. @node Pragma Pre,Pragma Precondition,Pragma Rename_Pragma,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-pre}@anchor{ba} +@anchor{gnat_rm/implementation_defined_pragmas pragma-pre}@anchor{be} @section Pragma Pre @@ -6183,7 +6354,7 @@ appear at the start of the declarations in a subprogram body (preceded only by other pragmas). @node Pragma Precondition,Pragma Predicate,Pragma Pre,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-precondition}@anchor{bb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-precondition}@anchor{bf} @section Pragma Precondition @@ -6242,7 +6413,7 @@ Ada 2012, and has been retained in its original form for compatibility purposes. @node Pragma Predicate,Pragma Predicate_Failure,Pragma Precondition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id29}@anchor{bc}@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate}@anchor{bd} +@anchor{gnat_rm/implementation_defined_pragmas id29}@anchor{c0}@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate}@anchor{c1} @section Pragma Predicate @@ -6296,7 +6467,7 @@ defined for subtype B). When following this approach, the use of predicates should be avoided. @node Pragma Predicate_Failure,Pragma Preelaborable_Initialization,Pragma Predicate,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate-failure}@anchor{be} +@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate-failure}@anchor{c2} @section Pragma Predicate_Failure @@ -6313,7 +6484,7 @@ the language-defined @code{Predicate_Failure} aspect, and shares its restrictions and semantics. @node Pragma Preelaborable_Initialization,Pragma Prefix_Exception_Messages,Pragma Predicate_Failure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-preelaborable-initialization}@anchor{bf} +@anchor{gnat_rm/implementation_defined_pragmas pragma-preelaborable-initialization}@anchor{c3} @section Pragma Preelaborable_Initialization @@ -6328,7 +6499,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Prefix_Exception_Messages,Pragma Pre_Class,Pragma Preelaborable_Initialization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-prefix-exception-messages}@anchor{c0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-prefix-exception-messages}@anchor{c4} @section Pragma Prefix_Exception_Messages @@ -6359,7 +6530,7 @@ prefixing in this case, you can always call @code{GNAT.Source_Info.Enclosing_Entity} and prepend the string manually. @node Pragma Pre_Class,Pragma Priority_Specific_Dispatching,Pragma Prefix_Exception_Messages,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-pre-class}@anchor{c1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-pre-class}@anchor{c5} @section Pragma Pre_Class @@ -6394,7 +6565,7 @@ policy that controls this pragma is @code{Pre'Class}, not @code{Pre_Class}. @node Pragma Priority_Specific_Dispatching,Pragma Profile,Pragma Pre_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-priority-specific-dispatching}@anchor{c2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-priority-specific-dispatching}@anchor{c6} @section Pragma Priority_Specific_Dispatching @@ -6418,7 +6589,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Profile,Pragma Profile_Warnings,Pragma Priority_Specific_Dispatching,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-profile}@anchor{c3} +@anchor{gnat_rm/implementation_defined_pragmas pragma-profile}@anchor{c7} @section Pragma Profile @@ -6692,7 +6863,7 @@ conforming Ada constructs. The profile enables the following three pragmas: @end itemize @node Pragma Profile_Warnings,Pragma Propagate_Exceptions,Pragma Profile,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-profile-warnings}@anchor{c4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-profile-warnings}@anchor{c8} @section Pragma Profile_Warnings @@ -6710,7 +6881,7 @@ violations of the profile generate warning messages instead of error messages. @node Pragma Propagate_Exceptions,Pragma Provide_Shift_Operators,Pragma Profile_Warnings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-propagate-exceptions}@anchor{c5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-propagate-exceptions}@anchor{c9} @section Pragma Propagate_Exceptions @@ -6729,7 +6900,7 @@ purposes. It used to be used in connection with optimization of a now-obsolete mechanism for implementation of exceptions. @node Pragma Provide_Shift_Operators,Pragma Psect_Object,Pragma Propagate_Exceptions,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-provide-shift-operators}@anchor{c6} +@anchor{gnat_rm/implementation_defined_pragmas pragma-provide-shift-operators}@anchor{ca} @section Pragma Provide_Shift_Operators @@ -6749,7 +6920,7 @@ including the function declarations for these five operators, together with the pragma Import (Intrinsic, ...) statements. @node Pragma Psect_Object,Pragma Pure_Function,Pragma Provide_Shift_Operators,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-psect-object}@anchor{c7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-psect-object}@anchor{cb} @section Pragma Psect_Object @@ -6769,7 +6940,7 @@ EXTERNAL_SYMBOL ::= This pragma is identical in effect to pragma @code{Common_Object}. @node Pragma Pure_Function,Pragma Rational,Pragma Psect_Object,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-pure-function}@anchor{c8}@anchor{gnat_rm/implementation_defined_pragmas id30}@anchor{c9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-pure-function}@anchor{cc}@anchor{gnat_rm/implementation_defined_pragmas id30}@anchor{cd} @section Pragma Pure_Function @@ -6831,7 +7002,7 @@ unit is not a Pure unit in the categorization sense. So for example, a function thus marked is free to @code{with} non-pure units. @node Pragma Rational,Pragma Ravenscar,Pragma Pure_Function,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-rational}@anchor{ca} +@anchor{gnat_rm/implementation_defined_pragmas pragma-rational}@anchor{ce} @section Pragma Rational @@ -6849,7 +7020,7 @@ pragma Profile (Rational); @end example @node Pragma Ravenscar,Pragma Refined_Depends,Pragma Rational,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ravenscar}@anchor{cb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ravenscar}@anchor{cf} @section Pragma Ravenscar @@ -6869,7 +7040,7 @@ pragma Profile (Ravenscar); which is the preferred method of setting the @code{Ravenscar} profile. @node Pragma Refined_Depends,Pragma Refined_Global,Pragma Ravenscar,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-depends}@anchor{cc}@anchor{gnat_rm/implementation_defined_pragmas id31}@anchor{cd} +@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-depends}@anchor{d0}@anchor{gnat_rm/implementation_defined_pragmas id31}@anchor{d1} @section Pragma Refined_Depends @@ -6902,7 +7073,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_Depends the SPARK 2014 Reference Manual, section 6.1.5. @node Pragma Refined_Global,Pragma Refined_Post,Pragma Refined_Depends,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-global}@anchor{ce}@anchor{gnat_rm/implementation_defined_pragmas id32}@anchor{cf} +@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-global}@anchor{d2}@anchor{gnat_rm/implementation_defined_pragmas id32}@anchor{d3} @section Pragma Refined_Global @@ -6927,7 +7098,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_Global} the SPARK 2014 Reference Manual, section 6.1.4. @node Pragma Refined_Post,Pragma Refined_State,Pragma Refined_Global,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-post}@anchor{d0}@anchor{gnat_rm/implementation_defined_pragmas id33}@anchor{d1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-post}@anchor{d4}@anchor{gnat_rm/implementation_defined_pragmas id33}@anchor{d5} @section Pragma Refined_Post @@ -6941,7 +7112,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_Post} i the SPARK 2014 Reference Manual, section 7.2.7. @node Pragma Refined_State,Pragma Relative_Deadline,Pragma Refined_Post,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-state}@anchor{d2}@anchor{gnat_rm/implementation_defined_pragmas id34}@anchor{d3} +@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-state}@anchor{d6}@anchor{gnat_rm/implementation_defined_pragmas id34}@anchor{d7} @section Pragma Refined_State @@ -6967,7 +7138,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_State} the SPARK 2014 Reference Manual, section 7.2.2. @node Pragma Relative_Deadline,Pragma Remote_Access_Type,Pragma Refined_State,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-relative-deadline}@anchor{d4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-relative-deadline}@anchor{d8} @section Pragma Relative_Deadline @@ -6982,7 +7153,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Remote_Access_Type,Pragma Restricted_Run_Time,Pragma Relative_Deadline,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id35}@anchor{d5}@anchor{gnat_rm/implementation_defined_pragmas pragma-remote-access-type}@anchor{d6} +@anchor{gnat_rm/implementation_defined_pragmas id35}@anchor{d9}@anchor{gnat_rm/implementation_defined_pragmas pragma-remote-access-type}@anchor{da} @section Pragma Remote_Access_Type @@ -7008,7 +7179,7 @@ pertaining to remote access to class-wide types. At instantiation, the actual type must be a remote access to class-wide type. @node Pragma Restricted_Run_Time,Pragma Restriction_Warnings,Pragma Remote_Access_Type,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-restricted-run-time}@anchor{d7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-restricted-run-time}@anchor{db} @section Pragma Restricted_Run_Time @@ -7029,7 +7200,7 @@ which is the preferred method of setting the restricted run time profile. @node Pragma Restriction_Warnings,Pragma Reviewable,Pragma Restricted_Run_Time,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-restriction-warnings}@anchor{d8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-restriction-warnings}@anchor{dc} @section Pragma Restriction_Warnings @@ -7067,7 +7238,7 @@ generating a warning, but any other use of implementation defined pragmas will cause a warning to be generated. @node Pragma Reviewable,Pragma Secondary_Stack_Size,Pragma Restriction_Warnings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-reviewable}@anchor{d9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-reviewable}@anchor{dd} @section Pragma Reviewable @@ -7171,7 +7342,7 @@ comprehensive messages identifying possible problems based on this information. @node Pragma Secondary_Stack_Size,Pragma Share_Generic,Pragma Reviewable,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id36}@anchor{da}@anchor{gnat_rm/implementation_defined_pragmas pragma-secondary-stack-size}@anchor{db} +@anchor{gnat_rm/implementation_defined_pragmas id36}@anchor{de}@anchor{gnat_rm/implementation_defined_pragmas pragma-secondary-stack-size}@anchor{df} @section Pragma Secondary_Stack_Size @@ -7207,7 +7378,7 @@ Note the pragma cannot appear when the restriction @code{No_Secondary_Stack} is in effect. @node Pragma Share_Generic,Pragma Shared,Pragma Secondary_Stack_Size,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-share-generic}@anchor{dc} +@anchor{gnat_rm/implementation_defined_pragmas pragma-share-generic}@anchor{e0} @section Pragma Share_Generic @@ -7225,7 +7396,7 @@ than to check that the given names are all names of generic units or generic instances. @node Pragma Shared,Pragma Short_Circuit_And_Or,Pragma Share_Generic,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id37}@anchor{dd}@anchor{gnat_rm/implementation_defined_pragmas pragma-shared}@anchor{de} +@anchor{gnat_rm/implementation_defined_pragmas id37}@anchor{e1}@anchor{gnat_rm/implementation_defined_pragmas pragma-shared}@anchor{e2} @section Pragma Shared @@ -7233,7 +7404,7 @@ This pragma is provided for compatibility with Ada 83. The syntax and semantics are identical to pragma Atomic. @node Pragma Short_Circuit_And_Or,Pragma Short_Descriptors,Pragma Shared,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-short-circuit-and-or}@anchor{df} +@anchor{gnat_rm/implementation_defined_pragmas pragma-short-circuit-and-or}@anchor{e3} @section Pragma Short_Circuit_And_Or @@ -7252,7 +7423,7 @@ within the file being compiled, it applies only to the file being compiled. There is no requirement that all units in a partition use this option. @node Pragma Short_Descriptors,Pragma Simple_Storage_Pool_Type,Pragma Short_Circuit_And_Or,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-short-descriptors}@anchor{e0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-short-descriptors}@anchor{e4} @section Pragma Short_Descriptors @@ -7266,7 +7437,7 @@ This pragma is provided for compatibility with other Ada implementations. It is recognized but ignored by all current versions of GNAT. @node Pragma Simple_Storage_Pool_Type,Pragma Source_File_Name,Pragma Short_Descriptors,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-simple-storage-pool-type}@anchor{e1}@anchor{gnat_rm/implementation_defined_pragmas id38}@anchor{e2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-simple-storage-pool-type}@anchor{e5}@anchor{gnat_rm/implementation_defined_pragmas id38}@anchor{e6} @section Pragma Simple_Storage_Pool_Type @@ -7320,7 +7491,7 @@ storage-management discipline). An object of a simple storage pool type can be associated with an access type by specifying the attribute -@ref{e3,,Simple_Storage_Pool}. For example: +@ref{e7,,Simple_Storage_Pool}. For example: @example My_Pool : My_Simple_Storage_Pool_Type; @@ -7330,11 +7501,11 @@ type Acc is access My_Data_Type; for Acc'Simple_Storage_Pool use My_Pool; @end example -See attribute @ref{e3,,Simple_Storage_Pool} +See attribute @ref{e7,,Simple_Storage_Pool} for further details. @node Pragma Source_File_Name,Pragma Source_File_Name_Project,Pragma Simple_Storage_Pool_Type,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name}@anchor{e4}@anchor{gnat_rm/implementation_defined_pragmas id39}@anchor{e5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name}@anchor{e8}@anchor{gnat_rm/implementation_defined_pragmas id39}@anchor{e9} @section Pragma Source_File_Name @@ -7426,19 +7597,19 @@ aware of these pragmas, and so other tools that use the projet file would not be aware of the intended naming conventions. If you are using project files, file naming is controlled by Source_File_Name_Project pragmas, which are usually supplied automatically by the project manager. A pragma -Source_File_Name cannot appear after a @ref{e6,,Pragma Source_File_Name_Project}. +Source_File_Name cannot appear after a @ref{ea,,Pragma Source_File_Name_Project}. For more details on the use of the @code{Source_File_Name} pragma, see the sections on @code{Using Other File Names} and @cite{Alternative File Naming Schemes' in the :title:`GNAT User's Guide}. @node Pragma Source_File_Name_Project,Pragma Source_Reference,Pragma Source_File_Name,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name-project}@anchor{e6}@anchor{gnat_rm/implementation_defined_pragmas id40}@anchor{e7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name-project}@anchor{ea}@anchor{gnat_rm/implementation_defined_pragmas id40}@anchor{eb} @section Pragma Source_File_Name_Project This pragma has the same syntax and semantics as pragma Source_File_Name. It is only allowed as a stand-alone configuration pragma. -It cannot appear after a @ref{e4,,Pragma Source_File_Name}, and +It cannot appear after a @ref{e8,,Pragma Source_File_Name}, and most importantly, once pragma Source_File_Name_Project appears, no further Source_File_Name pragmas are allowed. @@ -7450,7 +7621,7 @@ Source_File_Name or Source_File_Name_Project pragmas (which would not be known to the project manager). @node Pragma Source_Reference,Pragma SPARK_Mode,Pragma Source_File_Name_Project,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-source-reference}@anchor{e8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-source-reference}@anchor{ec} @section Pragma Source_Reference @@ -7474,7 +7645,7 @@ string expression other than a string literal. This is because its value is needed for error messages issued by all phases of the compiler. @node Pragma SPARK_Mode,Pragma Static_Elaboration_Desired,Pragma Source_Reference,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-spark-mode}@anchor{e9}@anchor{gnat_rm/implementation_defined_pragmas id41}@anchor{ea} +@anchor{gnat_rm/implementation_defined_pragmas pragma-spark-mode}@anchor{ed}@anchor{gnat_rm/implementation_defined_pragmas id41}@anchor{ee} @section Pragma SPARK_Mode @@ -7556,7 +7727,7 @@ SPARK_Mode (@code{Off}), then that pragma will need to be repeated in the package body. @node Pragma Static_Elaboration_Desired,Pragma Stream_Convert,Pragma SPARK_Mode,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-static-elaboration-desired}@anchor{eb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-static-elaboration-desired}@anchor{ef} @section Pragma Static_Elaboration_Desired @@ -7580,7 +7751,7 @@ construction of larger aggregates with static components that include an others choice.) @node Pragma Stream_Convert,Pragma Style_Checks,Pragma Static_Elaboration_Desired,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-stream-convert}@anchor{ec} +@anchor{gnat_rm/implementation_defined_pragmas pragma-stream-convert}@anchor{f0} @section Pragma Stream_Convert @@ -7657,7 +7828,7 @@ the pragma is silently ignored, and the default implementation of the stream attributes is used instead. @node Pragma Style_Checks,Pragma Subtitle,Pragma Stream_Convert,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-style-checks}@anchor{ed} +@anchor{gnat_rm/implementation_defined_pragmas pragma-style-checks}@anchor{f1} @section Pragma Style_Checks @@ -7730,7 +7901,7 @@ Rf2 : Integer := ARG; -- OK, no error @end example @node Pragma Subtitle,Pragma Suppress,Pragma Style_Checks,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-subtitle}@anchor{ee} +@anchor{gnat_rm/implementation_defined_pragmas pragma-subtitle}@anchor{f2} @section Pragma Subtitle @@ -7744,7 +7915,7 @@ This pragma is recognized for compatibility with other Ada compilers but is ignored by GNAT. @node Pragma Suppress,Pragma Suppress_All,Pragma Subtitle,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress}@anchor{ef} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress}@anchor{f3} @section Pragma Suppress @@ -7817,7 +7988,7 @@ Of course, run-time checks are omitted whenever the compiler can prove that they will not fail, whether or not checks are suppressed. @node Pragma Suppress_All,Pragma Suppress_Debug_Info,Pragma Suppress,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-all}@anchor{f0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-all}@anchor{f4} @section Pragma Suppress_All @@ -7836,7 +8007,7 @@ The use of the standard Ada pragma @code{Suppress (All_Checks)} as a normal configuration pragma is the preferred usage in GNAT. @node Pragma Suppress_Debug_Info,Pragma Suppress_Exception_Locations,Pragma Suppress_All,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-debug-info}@anchor{f1}@anchor{gnat_rm/implementation_defined_pragmas id42}@anchor{f2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-debug-info}@anchor{f5}@anchor{gnat_rm/implementation_defined_pragmas id42}@anchor{f6} @section Pragma Suppress_Debug_Info @@ -7851,7 +8022,7 @@ for the specified entity. It is intended primarily for use in debugging the debugger, and navigating around debugger problems. @node Pragma Suppress_Exception_Locations,Pragma Suppress_Initialization,Pragma Suppress_Debug_Info,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-exception-locations}@anchor{f3} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-exception-locations}@anchor{f7} @section Pragma Suppress_Exception_Locations @@ -7874,7 +8045,7 @@ a partition, so it is fine to have some units within a partition compiled with this pragma and others compiled in normal mode without it. @node Pragma Suppress_Initialization,Pragma Task_Name,Pragma Suppress_Exception_Locations,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id43}@anchor{f4}@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-initialization}@anchor{f5} +@anchor{gnat_rm/implementation_defined_pragmas id43}@anchor{f8}@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-initialization}@anchor{f9} @section Pragma Suppress_Initialization @@ -7919,7 +8090,7 @@ is suppressed, just as though its subtype had been given in a pragma Suppress_Initialization, as described above. @node Pragma Task_Name,Pragma Task_Storage,Pragma Suppress_Initialization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-task-name}@anchor{f6} +@anchor{gnat_rm/implementation_defined_pragmas pragma-task-name}@anchor{fa} @section Pragma Task_Name @@ -7975,7 +8146,7 @@ end; @end example @node Pragma Task_Storage,Pragma Test_Case,Pragma Task_Name,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-task-storage}@anchor{f7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-task-storage}@anchor{fb} @section Pragma Task_Storage @@ -7995,7 +8166,7 @@ created, depending on the target. This pragma can appear anywhere a type. @node Pragma Test_Case,Pragma Thread_Local_Storage,Pragma Task_Storage,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-test-case}@anchor{f8}@anchor{gnat_rm/implementation_defined_pragmas id44}@anchor{f9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-test-case}@anchor{fc}@anchor{gnat_rm/implementation_defined_pragmas id44}@anchor{fd} @section Pragma Test_Case @@ -8051,7 +8222,7 @@ postcondition. Mode @code{Robustness} indicates that the precondition and postcondition of the subprogram should be ignored for this test case. @node Pragma Thread_Local_Storage,Pragma Time_Slice,Pragma Test_Case,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-thread-local-storage}@anchor{fa}@anchor{gnat_rm/implementation_defined_pragmas id45}@anchor{fb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-thread-local-storage}@anchor{fe}@anchor{gnat_rm/implementation_defined_pragmas id45}@anchor{ff} @section Pragma Thread_Local_Storage @@ -8089,7 +8260,7 @@ If this pragma is used on a system where @code{TLS} is not supported, then an error message will be generated and the program will be rejected. @node Pragma Time_Slice,Pragma Title,Pragma Thread_Local_Storage,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-time-slice}@anchor{fc} +@anchor{gnat_rm/implementation_defined_pragmas pragma-time-slice}@anchor{100} @section Pragma Time_Slice @@ -8105,7 +8276,7 @@ It is ignored if it is used in a system that does not allow this control, or if it appears in other than the main program unit. @node Pragma Title,Pragma Type_Invariant,Pragma Time_Slice,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-title}@anchor{fd} +@anchor{gnat_rm/implementation_defined_pragmas pragma-title}@anchor{101} @section Pragma Title @@ -8130,7 +8301,7 @@ notation is used, and named and positional notation can be mixed following the normal rules for procedure calls in Ada. @node Pragma Type_Invariant,Pragma Type_Invariant_Class,Pragma Title,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant}@anchor{fe} +@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant}@anchor{102} @section Pragma Type_Invariant @@ -8151,7 +8322,7 @@ controlled by the assertion identifier @code{Type_Invariant} rather than @code{Invariant}. @node Pragma Type_Invariant_Class,Pragma Unchecked_Union,Pragma Type_Invariant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id46}@anchor{ff}@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant-class}@anchor{100} +@anchor{gnat_rm/implementation_defined_pragmas id46}@anchor{103}@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant-class}@anchor{104} @section Pragma Type_Invariant_Class @@ -8178,7 +8349,7 @@ policy that controls this pragma is @code{Type_Invariant'Class}, not @code{Type_Invariant_Class}. @node Pragma Unchecked_Union,Pragma Unevaluated_Use_Of_Old,Pragma Type_Invariant_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unchecked-union}@anchor{101} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unchecked-union}@anchor{105} @section Pragma Unchecked_Union @@ -8198,7 +8369,7 @@ version in all language modes (Ada 83, Ada 95, and Ada 2005). For full details, consult the Ada 2012 Reference Manual, section B.3.3. @node Pragma Unevaluated_Use_Of_Old,Pragma Unimplemented_Unit,Pragma Unchecked_Union,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unevaluated-use-of-old}@anchor{102} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unevaluated-use-of-old}@anchor{106} @section Pragma Unevaluated_Use_Of_Old @@ -8253,7 +8424,7 @@ uses up to the end of the corresponding statement sequence or sequence of package declarations. @node Pragma Unimplemented_Unit,Pragma Universal_Aliasing,Pragma Unevaluated_Use_Of_Old,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unimplemented-unit}@anchor{103} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unimplemented-unit}@anchor{107} @section Pragma Unimplemented_Unit @@ -8273,7 +8444,7 @@ The abort only happens if code is being generated. Thus you can use specs of unimplemented packages in syntax or semantic checking mode. @node Pragma Universal_Aliasing,Pragma Universal_Data,Pragma Unimplemented_Unit,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id47}@anchor{104}@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-aliasing}@anchor{105} +@anchor{gnat_rm/implementation_defined_pragmas id47}@anchor{108}@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-aliasing}@anchor{109} @section Pragma Universal_Aliasing @@ -8292,7 +8463,7 @@ situations in which it must be suppressed, see the section on @code{Optimization and Strict Aliasing} in the @cite{GNAT User's Guide}. @node Pragma Universal_Data,Pragma Unmodified,Pragma Universal_Aliasing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-data}@anchor{106}@anchor{gnat_rm/implementation_defined_pragmas id48}@anchor{107} +@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-data}@anchor{10a}@anchor{gnat_rm/implementation_defined_pragmas id48}@anchor{10b} @section Pragma Universal_Data @@ -8316,7 +8487,7 @@ of this pragma is also available by applying the -univ switch on the compilations of units where universal addressing of the data is desired. @node Pragma Unmodified,Pragma Unreferenced,Pragma Universal_Data,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unmodified}@anchor{108}@anchor{gnat_rm/implementation_defined_pragmas id49}@anchor{109} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unmodified}@anchor{10c}@anchor{gnat_rm/implementation_defined_pragmas id49}@anchor{10d} @section Pragma Unmodified @@ -8350,7 +8521,7 @@ Thus it is never necessary to use @code{pragma Unmodified} for such variables, though it is harmless to do so. @node Pragma Unreferenced,Pragma Unreferenced_Objects,Pragma Unmodified,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced}@anchor{10a}@anchor{gnat_rm/implementation_defined_pragmas id50}@anchor{10b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced}@anchor{10e}@anchor{gnat_rm/implementation_defined_pragmas id50}@anchor{10f} @section Pragma Unreferenced @@ -8394,7 +8565,7 @@ Note that if a warning is desired for all calls to a given subprogram, regardless of whether they occur in the same unit as the subprogram declaration, then this pragma should not be used (calls from another unit would not be flagged); pragma Obsolescent can be used instead -for this purpose, see @ref{a9,,Pragma Obsolescent}. +for this purpose, see @ref{ad,,Pragma Obsolescent}. The second form of pragma @code{Unreferenced} is used within a context clause. In this case the arguments must be unit names of units previously @@ -8410,7 +8581,7 @@ Thus it is never necessary to use @code{pragma Unreferenced} for such variables, though it is harmless to do so. @node Pragma Unreferenced_Objects,Pragma Unreserve_All_Interrupts,Pragma Unreferenced,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced-objects}@anchor{10c}@anchor{gnat_rm/implementation_defined_pragmas id51}@anchor{10d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced-objects}@anchor{110}@anchor{gnat_rm/implementation_defined_pragmas id51}@anchor{111} @section Pragma Unreferenced_Objects @@ -8435,7 +8606,7 @@ compiler will automatically suppress unwanted warnings about these variables not being referenced. @node Pragma Unreserve_All_Interrupts,Pragma Unsuppress,Pragma Unreferenced_Objects,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unreserve-all-interrupts}@anchor{10e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unreserve-all-interrupts}@anchor{112} @section Pragma Unreserve_All_Interrupts @@ -8471,7 +8642,7 @@ handled, see pragma @code{Interrupt_State}, which subsumes the functionality of the @code{Unreserve_All_Interrupts} pragma. @node Pragma Unsuppress,Pragma Use_VADS_Size,Pragma Unreserve_All_Interrupts,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unsuppress}@anchor{10f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unsuppress}@anchor{113} @section Pragma Unsuppress @@ -8507,7 +8678,7 @@ number of implementation-defined check names. See the description of pragma @code{Suppress} for full details. @node Pragma Use_VADS_Size,Pragma Unused,Pragma Unsuppress,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-use-vads-size}@anchor{110} +@anchor{gnat_rm/implementation_defined_pragmas pragma-use-vads-size}@anchor{114} @section Pragma Use_VADS_Size @@ -8531,7 +8702,7 @@ as implemented in the VADS compiler. See description of the VADS_Size attribute for further details. @node Pragma Unused,Pragma Validity_Checks,Pragma Use_VADS_Size,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unused}@anchor{111}@anchor{gnat_rm/implementation_defined_pragmas id52}@anchor{112} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unused}@anchor{115}@anchor{gnat_rm/implementation_defined_pragmas id52}@anchor{116} @section Pragma Unused @@ -8565,7 +8736,7 @@ Thus it is never necessary to use @code{pragma Unmodified} for such variables, though it is harmless to do so. @node Pragma Validity_Checks,Pragma Volatile,Pragma Unused,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-validity-checks}@anchor{113} +@anchor{gnat_rm/implementation_defined_pragmas pragma-validity-checks}@anchor{117} @section Pragma Validity_Checks @@ -8622,7 +8793,7 @@ A := C; -- C will be validity checked @end example @node Pragma Volatile,Pragma Volatile_Full_Access,Pragma Validity_Checks,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile}@anchor{114} +@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile}@anchor{118} @section Pragma Volatile @@ -8640,7 +8811,7 @@ implementation of pragma Volatile is upwards compatible with the implementation in DEC Ada 83. @node Pragma Volatile_Full_Access,Pragma Volatile_Function,Pragma Volatile,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-full-access}@anchor{115}@anchor{gnat_rm/implementation_defined_pragmas id53}@anchor{116} +@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-full-access}@anchor{119}@anchor{gnat_rm/implementation_defined_pragmas id53}@anchor{11a} @section Pragma Volatile_Full_Access @@ -8672,7 +8843,7 @@ It is not permissible to specify @code{Volatile_Full_Access} for a composite (record or array) type or object that has at least one @code{Aliased} component. @node Pragma Volatile_Function,Pragma Warning_As_Error,Pragma Volatile_Full_Access,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id54}@anchor{117}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-function}@anchor{118} +@anchor{gnat_rm/implementation_defined_pragmas id54}@anchor{11b}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-function}@anchor{11c} @section Pragma Volatile_Function @@ -8686,7 +8857,7 @@ For the semantics of this pragma, see the entry for aspect @code{Volatile_Functi in the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Warning_As_Error,Pragma Warnings,Pragma Volatile_Function,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-warning-as-error}@anchor{119} +@anchor{gnat_rm/implementation_defined_pragmas pragma-warning-as-error}@anchor{11d} @section Pragma Warning_As_Error @@ -8721,7 +8892,7 @@ as shown in the example below, to treat a class of warnings as errors. The above use of patterns to match the message applies only to warning messages generated by the front end. This pragma can also be applied to -warnings provided by the back end and mentioned in @ref{11a,,Pragma Warnings}. +warnings provided by the back end and mentioned in @ref{11e,,Pragma Warnings}. By using a single full @emph{-Wxxx} switch in the pragma, such warnings can also be treated as errors. @@ -8771,7 +8942,7 @@ the tag is changed from "warning:" to "error:" and the string "[warning-as-error]" is appended to the end of the message. @node Pragma Warnings,Pragma Weak_External,Pragma Warning_As_Error,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id55}@anchor{11b}@anchor{gnat_rm/implementation_defined_pragmas pragma-warnings}@anchor{11a} +@anchor{gnat_rm/implementation_defined_pragmas id55}@anchor{11f}@anchor{gnat_rm/implementation_defined_pragmas pragma-warnings}@anchor{11e} @section Pragma Warnings @@ -8927,7 +9098,7 @@ selectively for each tool, and as a consequence to detect useless pragma Warnings with switch @code{-gnatw.w}. @node Pragma Weak_External,Pragma Wide_Character_Encoding,Pragma Warnings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-weak-external}@anchor{11c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-weak-external}@anchor{120} @section Pragma Weak_External @@ -8978,7 +9149,7 @@ end External_Module; @end example @node Pragma Wide_Character_Encoding,,Pragma Weak_External,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-wide-character-encoding}@anchor{11d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-wide-character-encoding}@anchor{121} @section Pragma Wide_Character_Encoding @@ -9009,7 +9180,7 @@ encoding within that file, and does not affect withed units, specs, or subunits. @node Implementation Defined Aspects,Implementation Defined Attributes,Implementation Defined Pragmas,Top -@anchor{gnat_rm/implementation_defined_aspects implementation-defined-aspects}@anchor{11e}@anchor{gnat_rm/implementation_defined_aspects doc}@anchor{11f}@anchor{gnat_rm/implementation_defined_aspects id1}@anchor{120} +@anchor{gnat_rm/implementation_defined_aspects implementation-defined-aspects}@anchor{122}@anchor{gnat_rm/implementation_defined_aspects doc}@anchor{123}@anchor{gnat_rm/implementation_defined_aspects id1}@anchor{124} @chapter Implementation Defined Aspects @@ -9127,7 +9298,7 @@ or attribute definition clause. @end menu @node Aspect Abstract_State,Aspect Annotate,,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-abstract-state}@anchor{121} +@anchor{gnat_rm/implementation_defined_aspects aspect-abstract-state}@anchor{125} @section Aspect Abstract_State @@ -9136,7 +9307,7 @@ or attribute definition clause. This aspect is equivalent to @ref{1c,,pragma Abstract_State}. @node Aspect Annotate,Aspect Async_Readers,Aspect Abstract_State,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-annotate}@anchor{122} +@anchor{gnat_rm/implementation_defined_aspects aspect-annotate}@anchor{126} @section Aspect Annotate @@ -9144,7 +9315,7 @@ This aspect is equivalent to @ref{1c,,pragma Abstract_State}. There are three forms of this aspect (where ID is an identifier, and ARG is a general expression), -corresponding to @ref{25,,pragma Annotate}. +corresponding to @ref{29,,pragma Annotate}. @table @asis @@ -9163,63 +9334,63 @@ Equivalent to @code{pragma Annotate (ID, ID @{, ARG@}, Entity => Name);} @end table @node Aspect Async_Readers,Aspect Async_Writers,Aspect Annotate,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-async-readers}@anchor{123} +@anchor{gnat_rm/implementation_defined_aspects aspect-async-readers}@anchor{127} @section Aspect Async_Readers @geindex Async_Readers -This boolean aspect is equivalent to @ref{2c,,pragma Async_Readers}. +This boolean aspect is equivalent to @ref{30,,pragma Async_Readers}. @node Aspect Async_Writers,Aspect Constant_After_Elaboration,Aspect Async_Readers,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-async-writers}@anchor{124} +@anchor{gnat_rm/implementation_defined_aspects aspect-async-writers}@anchor{128} @section Aspect Async_Writers @geindex Async_Writers -This boolean aspect is equivalent to @ref{2f,,pragma Async_Writers}. +This boolean aspect is equivalent to @ref{33,,pragma Async_Writers}. @node Aspect Constant_After_Elaboration,Aspect Contract_Cases,Aspect Async_Writers,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-constant-after-elaboration}@anchor{125} +@anchor{gnat_rm/implementation_defined_aspects aspect-constant-after-elaboration}@anchor{129} @section Aspect Constant_After_Elaboration @geindex Constant_After_Elaboration -This aspect is equivalent to @ref{40,,pragma Constant_After_Elaboration}. +This aspect is equivalent to @ref{44,,pragma Constant_After_Elaboration}. @node Aspect Contract_Cases,Aspect Depends,Aspect Constant_After_Elaboration,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-contract-cases}@anchor{126} +@anchor{gnat_rm/implementation_defined_aspects aspect-contract-cases}@anchor{12a} @section Aspect Contract_Cases @geindex Contract_Cases -This aspect is equivalent to @ref{42,,pragma Contract_Cases}, the sequence +This aspect is equivalent to @ref{46,,pragma Contract_Cases}, the sequence of clauses being enclosed in parentheses so that syntactically it is an aggregate. @node Aspect Depends,Aspect Default_Initial_Condition,Aspect Contract_Cases,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-depends}@anchor{127} +@anchor{gnat_rm/implementation_defined_aspects aspect-depends}@anchor{12b} @section Aspect Depends @geindex Depends -This aspect is equivalent to @ref{51,,pragma Depends}. +This aspect is equivalent to @ref{55,,pragma Depends}. @node Aspect Default_Initial_Condition,Aspect Dimension,Aspect Depends,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-default-initial-condition}@anchor{128} +@anchor{gnat_rm/implementation_defined_aspects aspect-default-initial-condition}@anchor{12c} @section Aspect Default_Initial_Condition @geindex Default_Initial_Condition -This aspect is equivalent to @ref{4c,,pragma Default_Initial_Condition}. +This aspect is equivalent to @ref{50,,pragma Default_Initial_Condition}. @node Aspect Dimension,Aspect Dimension_System,Aspect Default_Initial_Condition,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-dimension}@anchor{129} +@anchor{gnat_rm/implementation_defined_aspects aspect-dimension}@anchor{12d} @section Aspect Dimension @@ -9255,7 +9426,7 @@ Note that when the dimensioned type is an integer type, then any dimension value must be an integer literal. @node Aspect Dimension_System,Aspect Disable_Controlled,Aspect Dimension,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-dimension-system}@anchor{12a} +@anchor{gnat_rm/implementation_defined_aspects aspect-dimension-system}@anchor{12e} @section Aspect Dimension_System @@ -9315,7 +9486,7 @@ See section 'Performing Dimensionality Analysis in GNAT' in the GNAT Users Guide for detailed examples of use of the dimension system. @node Aspect Disable_Controlled,Aspect Effective_Reads,Aspect Dimension_System,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-disable-controlled}@anchor{12b} +@anchor{gnat_rm/implementation_defined_aspects aspect-disable-controlled}@anchor{12f} @section Aspect Disable_Controlled @@ -9328,110 +9499,110 @@ where for example you might want a record to be controlled or not depending on whether some run-time check is enabled or suppressed. @node Aspect Effective_Reads,Aspect Effective_Writes,Aspect Disable_Controlled,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-effective-reads}@anchor{12c} +@anchor{gnat_rm/implementation_defined_aspects aspect-effective-reads}@anchor{130} @section Aspect Effective_Reads @geindex Effective_Reads -This aspect is equivalent to @ref{57,,pragma Effective_Reads}. +This aspect is equivalent to @ref{5b,,pragma Effective_Reads}. @node Aspect Effective_Writes,Aspect Extensions_Visible,Aspect Effective_Reads,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-effective-writes}@anchor{12d} +@anchor{gnat_rm/implementation_defined_aspects aspect-effective-writes}@anchor{131} @section Aspect Effective_Writes @geindex Effective_Writes -This aspect is equivalent to @ref{59,,pragma Effective_Writes}. +This aspect is equivalent to @ref{5d,,pragma Effective_Writes}. @node Aspect Extensions_Visible,Aspect Favor_Top_Level,Aspect Effective_Writes,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-extensions-visible}@anchor{12e} +@anchor{gnat_rm/implementation_defined_aspects aspect-extensions-visible}@anchor{132} @section Aspect Extensions_Visible @geindex Extensions_Visible -This aspect is equivalent to @ref{65,,pragma Extensions_Visible}. +This aspect is equivalent to @ref{69,,pragma Extensions_Visible}. @node Aspect Favor_Top_Level,Aspect Ghost,Aspect Extensions_Visible,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-favor-top-level}@anchor{12f} +@anchor{gnat_rm/implementation_defined_aspects aspect-favor-top-level}@anchor{133} @section Aspect Favor_Top_Level @geindex Favor_Top_Level -This boolean aspect is equivalent to @ref{6a,,pragma Favor_Top_Level}. +This boolean aspect is equivalent to @ref{6e,,pragma Favor_Top_Level}. @node Aspect Ghost,Aspect Global,Aspect Favor_Top_Level,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-ghost}@anchor{130} +@anchor{gnat_rm/implementation_defined_aspects aspect-ghost}@anchor{134} @section Aspect Ghost @geindex Ghost -This aspect is equivalent to @ref{6d,,pragma Ghost}. +This aspect is equivalent to @ref{71,,pragma Ghost}. @node Aspect Global,Aspect Initial_Condition,Aspect Ghost,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-global}@anchor{131} +@anchor{gnat_rm/implementation_defined_aspects aspect-global}@anchor{135} @section Aspect Global @geindex Global -This aspect is equivalent to @ref{6f,,pragma Global}. +This aspect is equivalent to @ref{73,,pragma Global}. @node Aspect Initial_Condition,Aspect Initializes,Aspect Global,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-initial-condition}@anchor{132} +@anchor{gnat_rm/implementation_defined_aspects aspect-initial-condition}@anchor{136} @section Aspect Initial_Condition @geindex Initial_Condition -This aspect is equivalent to @ref{7d,,pragma Initial_Condition}. +This aspect is equivalent to @ref{81,,pragma Initial_Condition}. @node Aspect Initializes,Aspect Inline_Always,Aspect Initial_Condition,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-initializes}@anchor{133} +@anchor{gnat_rm/implementation_defined_aspects aspect-initializes}@anchor{137} @section Aspect Initializes @geindex Initializes -This aspect is equivalent to @ref{7f,,pragma Initializes}. +This aspect is equivalent to @ref{83,,pragma Initializes}. @node Aspect Inline_Always,Aspect Invariant,Aspect Initializes,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-inline-always}@anchor{134} +@anchor{gnat_rm/implementation_defined_aspects aspect-inline-always}@anchor{138} @section Aspect Inline_Always @geindex Inline_Always -This boolean aspect is equivalent to @ref{82,,pragma Inline_Always}. +This boolean aspect is equivalent to @ref{86,,pragma Inline_Always}. @node Aspect Invariant,Aspect Invariant'Class,Aspect Inline_Always,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-invariant}@anchor{135} +@anchor{gnat_rm/implementation_defined_aspects aspect-invariant}@anchor{139} @section Aspect Invariant @geindex Invariant -This aspect is equivalent to @ref{89,,pragma Invariant}. It is a +This aspect is equivalent to @ref{8d,,pragma Invariant}. It is a synonym for the language defined aspect @code{Type_Invariant} except that it is separately controllable using pragma @code{Assertion_Policy}. @node Aspect Invariant'Class,Aspect Iterable,Aspect Invariant,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-invariant-class}@anchor{136} +@anchor{gnat_rm/implementation_defined_aspects aspect-invariant-class}@anchor{13a} @section Aspect Invariant'Class @geindex Invariant'Class -This aspect is equivalent to @ref{100,,pragma Type_Invariant_Class}. It is a +This aspect is equivalent to @ref{104,,pragma Type_Invariant_Class}. It is a synonym for the language defined aspect @code{Type_Invariant'Class} except that it is separately controllable using pragma @code{Assertion_Policy}. @node Aspect Iterable,Aspect Linker_Section,Aspect Invariant'Class,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-iterable}@anchor{137} +@anchor{gnat_rm/implementation_defined_aspects aspect-iterable}@anchor{13b} @section Aspect Iterable @@ -9511,108 +9682,108 @@ function Get_Element (Cont : Container; Position : Cursor) return Element_Type; This aspect is used in the GNAT-defined formal container packages. @node Aspect Linker_Section,Aspect Lock_Free,Aspect Iterable,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-linker-section}@anchor{138} +@anchor{gnat_rm/implementation_defined_aspects aspect-linker-section}@anchor{13c} @section Aspect Linker_Section @geindex Linker_Section -This aspect is equivalent to @ref{91,,pragma Linker_Section}. +This aspect is equivalent to @ref{95,,pragma Linker_Section}. @node Aspect Lock_Free,Aspect Max_Queue_Length,Aspect Linker_Section,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-lock-free}@anchor{139} +@anchor{gnat_rm/implementation_defined_aspects aspect-lock-free}@anchor{13d} @section Aspect Lock_Free @geindex Lock_Free -This boolean aspect is equivalent to @ref{93,,pragma Lock_Free}. +This boolean aspect is equivalent to @ref{97,,pragma Lock_Free}. @node Aspect Max_Queue_Length,Aspect No_Elaboration_Code_All,Aspect Lock_Free,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-max-queue-length}@anchor{13a} +@anchor{gnat_rm/implementation_defined_aspects aspect-max-queue-length}@anchor{13e} @section Aspect Max_Queue_Length @geindex Max_Queue_Length -This aspect is equivalent to @ref{9b,,pragma Max_Queue_Length}. +This aspect is equivalent to @ref{9f,,pragma Max_Queue_Length}. @node Aspect No_Elaboration_Code_All,Aspect No_Inline,Aspect Max_Queue_Length,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-elaboration-code-all}@anchor{13b} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-elaboration-code-all}@anchor{13f} @section Aspect No_Elaboration_Code_All @geindex No_Elaboration_Code_All -This aspect is equivalent to @ref{9f,,pragma No_Elaboration_Code_All} +This aspect is equivalent to @ref{a3,,pragma No_Elaboration_Code_All} for a program unit. @node Aspect No_Inline,Aspect No_Tagged_Streams,Aspect No_Elaboration_Code_All,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-inline}@anchor{13c} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-inline}@anchor{140} @section Aspect No_Inline @geindex No_Inline -This boolean aspect is equivalent to @ref{a2,,pragma No_Inline}. +This boolean aspect is equivalent to @ref{a6,,pragma No_Inline}. @node Aspect No_Tagged_Streams,Aspect Object_Size,Aspect No_Inline,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-tagged-streams}@anchor{13d} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-tagged-streams}@anchor{141} @section Aspect No_Tagged_Streams @geindex No_Tagged_Streams -This aspect is equivalent to @ref{a6,,pragma No_Tagged_Streams} with an +This aspect is equivalent to @ref{aa,,pragma No_Tagged_Streams} with an argument specifying a root tagged type (thus this aspect can only be applied to such a type). @node Aspect Object_Size,Aspect Obsolescent,Aspect No_Tagged_Streams,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-object-size}@anchor{13e} +@anchor{gnat_rm/implementation_defined_aspects aspect-object-size}@anchor{142} @section Aspect Object_Size @geindex Object_Size -This aspect is equivalent to @ref{13f,,attribute Object_Size}. +This aspect is equivalent to @ref{143,,attribute Object_Size}. @node Aspect Obsolescent,Aspect Part_Of,Aspect Object_Size,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-obsolescent}@anchor{140} +@anchor{gnat_rm/implementation_defined_aspects aspect-obsolescent}@anchor{144} @section Aspect Obsolescent @geindex Obsolsecent -This aspect is equivalent to @ref{a9,,pragma Obsolescent}. Note that the +This aspect is equivalent to @ref{ad,,pragma Obsolescent}. Note that the evaluation of this aspect happens at the point of occurrence, it is not delayed until the freeze point. @node Aspect Part_Of,Aspect Persistent_BSS,Aspect Obsolescent,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-part-of}@anchor{141} +@anchor{gnat_rm/implementation_defined_aspects aspect-part-of}@anchor{145} @section Aspect Part_Of @geindex Part_Of -This aspect is equivalent to @ref{b1,,pragma Part_Of}. +This aspect is equivalent to @ref{b5,,pragma Part_Of}. @node Aspect Persistent_BSS,Aspect Predicate,Aspect Part_Of,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-persistent-bss}@anchor{142} +@anchor{gnat_rm/implementation_defined_aspects aspect-persistent-bss}@anchor{146} @section Aspect Persistent_BSS @geindex Persistent_BSS -This boolean aspect is equivalent to @ref{b4,,pragma Persistent_BSS}. +This boolean aspect is equivalent to @ref{b8,,pragma Persistent_BSS}. @node Aspect Predicate,Aspect Pure_Function,Aspect Persistent_BSS,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-predicate}@anchor{143} +@anchor{gnat_rm/implementation_defined_aspects aspect-predicate}@anchor{147} @section Aspect Predicate @geindex Predicate -This aspect is equivalent to @ref{bd,,pragma Predicate}. It is thus +This aspect is equivalent to @ref{c1,,pragma Predicate}. It is thus similar to the language defined aspects @code{Dynamic_Predicate} and @code{Static_Predicate} except that whether the resulting predicate is static or dynamic is controlled by the form of the @@ -9620,239 +9791,239 @@ expression. It is also separately controllable using pragma @code{Assertion_Policy}. @node Aspect Pure_Function,Aspect Refined_Depends,Aspect Predicate,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-pure-function}@anchor{144} +@anchor{gnat_rm/implementation_defined_aspects aspect-pure-function}@anchor{148} @section Aspect Pure_Function @geindex Pure_Function -This boolean aspect is equivalent to @ref{c8,,pragma Pure_Function}. +This boolean aspect is equivalent to @ref{cc,,pragma Pure_Function}. @node Aspect Refined_Depends,Aspect Refined_Global,Aspect Pure_Function,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-depends}@anchor{145} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-depends}@anchor{149} @section Aspect Refined_Depends @geindex Refined_Depends -This aspect is equivalent to @ref{cc,,pragma Refined_Depends}. +This aspect is equivalent to @ref{d0,,pragma Refined_Depends}. @node Aspect Refined_Global,Aspect Refined_Post,Aspect Refined_Depends,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-global}@anchor{146} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-global}@anchor{14a} @section Aspect Refined_Global @geindex Refined_Global -This aspect is equivalent to @ref{ce,,pragma Refined_Global}. +This aspect is equivalent to @ref{d2,,pragma Refined_Global}. @node Aspect Refined_Post,Aspect Refined_State,Aspect Refined_Global,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-post}@anchor{147} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-post}@anchor{14b} @section Aspect Refined_Post @geindex Refined_Post -This aspect is equivalent to @ref{d0,,pragma Refined_Post}. +This aspect is equivalent to @ref{d4,,pragma Refined_Post}. @node Aspect Refined_State,Aspect Remote_Access_Type,Aspect Refined_Post,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-state}@anchor{148} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-state}@anchor{14c} @section Aspect Refined_State @geindex Refined_State -This aspect is equivalent to @ref{d2,,pragma Refined_State}. +This aspect is equivalent to @ref{d6,,pragma Refined_State}. @node Aspect Remote_Access_Type,Aspect Secondary_Stack_Size,Aspect Refined_State,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-remote-access-type}@anchor{149} +@anchor{gnat_rm/implementation_defined_aspects aspect-remote-access-type}@anchor{14d} @section Aspect Remote_Access_Type @geindex Remote_Access_Type -This aspect is equivalent to @ref{d6,,pragma Remote_Access_Type}. +This aspect is equivalent to @ref{da,,pragma Remote_Access_Type}. @node Aspect Secondary_Stack_Size,Aspect Scalar_Storage_Order,Aspect Remote_Access_Type,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-secondary-stack-size}@anchor{14a} +@anchor{gnat_rm/implementation_defined_aspects aspect-secondary-stack-size}@anchor{14e} @section Aspect Secondary_Stack_Size @geindex Secondary_Stack_Size -This aspect is equivalent to @ref{db,,pragma Secondary_Stack_Size}. +This aspect is equivalent to @ref{df,,pragma Secondary_Stack_Size}. @node Aspect Scalar_Storage_Order,Aspect Shared,Aspect Secondary_Stack_Size,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-scalar-storage-order}@anchor{14b} +@anchor{gnat_rm/implementation_defined_aspects aspect-scalar-storage-order}@anchor{14f} @section Aspect Scalar_Storage_Order @geindex Scalar_Storage_Order -This aspect is equivalent to a @ref{14c,,attribute Scalar_Storage_Order}. +This aspect is equivalent to a @ref{150,,attribute Scalar_Storage_Order}. @node Aspect Shared,Aspect Simple_Storage_Pool,Aspect Scalar_Storage_Order,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-shared}@anchor{14d} +@anchor{gnat_rm/implementation_defined_aspects aspect-shared}@anchor{151} @section Aspect Shared @geindex Shared -This boolean aspect is equivalent to @ref{de,,pragma Shared} +This boolean aspect is equivalent to @ref{e2,,pragma Shared} and is thus a synonym for aspect @code{Atomic}. @node Aspect Simple_Storage_Pool,Aspect Simple_Storage_Pool_Type,Aspect Shared,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool}@anchor{14e} +@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool}@anchor{152} @section Aspect Simple_Storage_Pool @geindex Simple_Storage_Pool -This aspect is equivalent to @ref{e3,,attribute Simple_Storage_Pool}. +This aspect is equivalent to @ref{e7,,attribute Simple_Storage_Pool}. @node Aspect Simple_Storage_Pool_Type,Aspect SPARK_Mode,Aspect Simple_Storage_Pool,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool-type}@anchor{14f} +@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool-type}@anchor{153} @section Aspect Simple_Storage_Pool_Type @geindex Simple_Storage_Pool_Type -This boolean aspect is equivalent to @ref{e1,,pragma Simple_Storage_Pool_Type}. +This boolean aspect is equivalent to @ref{e5,,pragma Simple_Storage_Pool_Type}. @node Aspect SPARK_Mode,Aspect Suppress_Debug_Info,Aspect Simple_Storage_Pool_Type,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-spark-mode}@anchor{150} +@anchor{gnat_rm/implementation_defined_aspects aspect-spark-mode}@anchor{154} @section Aspect SPARK_Mode @geindex SPARK_Mode -This aspect is equivalent to @ref{e9,,pragma SPARK_Mode} and +This aspect is equivalent to @ref{ed,,pragma SPARK_Mode} and may be specified for either or both of the specification and body of a subprogram or package. @node Aspect Suppress_Debug_Info,Aspect Suppress_Initialization,Aspect SPARK_Mode,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-debug-info}@anchor{151} +@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-debug-info}@anchor{155} @section Aspect Suppress_Debug_Info @geindex Suppress_Debug_Info -This boolean aspect is equivalent to @ref{f1,,pragma Suppress_Debug_Info}. +This boolean aspect is equivalent to @ref{f5,,pragma Suppress_Debug_Info}. @node Aspect Suppress_Initialization,Aspect Test_Case,Aspect Suppress_Debug_Info,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-initialization}@anchor{152} +@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-initialization}@anchor{156} @section Aspect Suppress_Initialization @geindex Suppress_Initialization -This boolean aspect is equivalent to @ref{f5,,pragma Suppress_Initialization}. +This boolean aspect is equivalent to @ref{f9,,pragma Suppress_Initialization}. @node Aspect Test_Case,Aspect Thread_Local_Storage,Aspect Suppress_Initialization,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-test-case}@anchor{153} +@anchor{gnat_rm/implementation_defined_aspects aspect-test-case}@anchor{157} @section Aspect Test_Case @geindex Test_Case -This aspect is equivalent to @ref{f8,,pragma Test_Case}. +This aspect is equivalent to @ref{fc,,pragma Test_Case}. @node Aspect Thread_Local_Storage,Aspect Universal_Aliasing,Aspect Test_Case,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-thread-local-storage}@anchor{154} +@anchor{gnat_rm/implementation_defined_aspects aspect-thread-local-storage}@anchor{158} @section Aspect Thread_Local_Storage @geindex Thread_Local_Storage -This boolean aspect is equivalent to @ref{fa,,pragma Thread_Local_Storage}. +This boolean aspect is equivalent to @ref{fe,,pragma Thread_Local_Storage}. @node Aspect Universal_Aliasing,Aspect Universal_Data,Aspect Thread_Local_Storage,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-universal-aliasing}@anchor{155} +@anchor{gnat_rm/implementation_defined_aspects aspect-universal-aliasing}@anchor{159} @section Aspect Universal_Aliasing @geindex Universal_Aliasing -This boolean aspect is equivalent to @ref{105,,pragma Universal_Aliasing}. +This boolean aspect is equivalent to @ref{109,,pragma Universal_Aliasing}. @node Aspect Universal_Data,Aspect Unmodified,Aspect Universal_Aliasing,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-universal-data}@anchor{156} +@anchor{gnat_rm/implementation_defined_aspects aspect-universal-data}@anchor{15a} @section Aspect Universal_Data @geindex Universal_Data -This aspect is equivalent to @ref{106,,pragma Universal_Data}. +This aspect is equivalent to @ref{10a,,pragma Universal_Data}. @node Aspect Unmodified,Aspect Unreferenced,Aspect Universal_Data,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unmodified}@anchor{157} +@anchor{gnat_rm/implementation_defined_aspects aspect-unmodified}@anchor{15b} @section Aspect Unmodified @geindex Unmodified -This boolean aspect is equivalent to @ref{108,,pragma Unmodified}. +This boolean aspect is equivalent to @ref{10c,,pragma Unmodified}. @node Aspect Unreferenced,Aspect Unreferenced_Objects,Aspect Unmodified,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced}@anchor{158} +@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced}@anchor{15c} @section Aspect Unreferenced @geindex Unreferenced -This boolean aspect is equivalent to @ref{10a,,pragma Unreferenced}. Note that +This boolean aspect is equivalent to @ref{10e,,pragma Unreferenced}. Note that in the case of formal parameters, it is not permitted to have aspects for a formal parameter, so in this case the pragma form must be used. @node Aspect Unreferenced_Objects,Aspect Value_Size,Aspect Unreferenced,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced-objects}@anchor{159} +@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced-objects}@anchor{15d} @section Aspect Unreferenced_Objects @geindex Unreferenced_Objects -This boolean aspect is equivalent to @ref{10c,,pragma Unreferenced_Objects}. +This boolean aspect is equivalent to @ref{110,,pragma Unreferenced_Objects}. @node Aspect Value_Size,Aspect Volatile_Full_Access,Aspect Unreferenced_Objects,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-value-size}@anchor{15a} +@anchor{gnat_rm/implementation_defined_aspects aspect-value-size}@anchor{15e} @section Aspect Value_Size @geindex Value_Size -This aspect is equivalent to @ref{15b,,attribute Value_Size}. +This aspect is equivalent to @ref{15f,,attribute Value_Size}. @node Aspect Volatile_Full_Access,Aspect Volatile_Function,Aspect Value_Size,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-full-access}@anchor{15c} +@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-full-access}@anchor{160} @section Aspect Volatile_Full_Access @geindex Volatile_Full_Access -This boolean aspect is equivalent to @ref{115,,pragma Volatile_Full_Access}. +This boolean aspect is equivalent to @ref{119,,pragma Volatile_Full_Access}. @node Aspect Volatile_Function,Aspect Warnings,Aspect Volatile_Full_Access,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-function}@anchor{15d} +@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-function}@anchor{161} @section Aspect Volatile_Function @geindex Volatile_Function -This boolean aspect is equivalent to @ref{118,,pragma Volatile_Function}. +This boolean aspect is equivalent to @ref{11c,,pragma Volatile_Function}. @node Aspect Warnings,,Aspect Volatile_Function,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-warnings}@anchor{15e} +@anchor{gnat_rm/implementation_defined_aspects aspect-warnings}@anchor{162} @section Aspect Warnings @geindex Warnings -This aspect is equivalent to the two argument form of @ref{11a,,pragma Warnings}, +This aspect is equivalent to the two argument form of @ref{11e,,pragma Warnings}, where the first argument is @code{ON} or @code{OFF} and the second argument is the entity. @node Implementation Defined Attributes,Standard and Implementation Defined Restrictions,Implementation Defined Aspects,Top -@anchor{gnat_rm/implementation_defined_attributes doc}@anchor{15f}@anchor{gnat_rm/implementation_defined_attributes implementation-defined-attributes}@anchor{8}@anchor{gnat_rm/implementation_defined_attributes id1}@anchor{160} +@anchor{gnat_rm/implementation_defined_attributes doc}@anchor{163}@anchor{gnat_rm/implementation_defined_attributes implementation-defined-attributes}@anchor{8}@anchor{gnat_rm/implementation_defined_attributes id1}@anchor{164} @chapter Implementation Defined Attributes @@ -9953,7 +10124,7 @@ consideration, you should minimize the use of these attributes. @end menu @node Attribute Abort_Signal,Attribute Address_Size,,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-abort-signal}@anchor{161} +@anchor{gnat_rm/implementation_defined_attributes attribute-abort-signal}@anchor{165} @section Attribute Abort_Signal @@ -9967,7 +10138,7 @@ completely outside the normal semantics of Ada, for a user program to intercept the abort exception). @node Attribute Address_Size,Attribute Asm_Input,Attribute Abort_Signal,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-address-size}@anchor{162} +@anchor{gnat_rm/implementation_defined_attributes attribute-address-size}@anchor{166} @section Attribute Address_Size @@ -9983,7 +10154,7 @@ reference to System.Address'Size is nonstatic because Address is a private type. @node Attribute Asm_Input,Attribute Asm_Output,Attribute Address_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-asm-input}@anchor{163} +@anchor{gnat_rm/implementation_defined_attributes attribute-asm-input}@anchor{167} @section Attribute Asm_Input @@ -9997,10 +10168,10 @@ to be a static expression, and is the constraint for the parameter, value to be used as the input argument. The possible values for the constant are the same as those used in the RTL, and are dependent on the configuration file used to built the GCC back end. -@ref{164,,Machine Code Insertions} +@ref{168,,Machine Code Insertions} @node Attribute Asm_Output,Attribute Atomic_Always_Lock_Free,Attribute Asm_Input,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-asm-output}@anchor{165} +@anchor{gnat_rm/implementation_defined_attributes attribute-asm-output}@anchor{169} @section Attribute Asm_Output @@ -10016,10 +10187,10 @@ result. The possible values for constraint are the same as those used in the RTL, and are dependent on the configuration file used to build the GCC back end. If there are no output operands, then this argument may either be omitted, or explicitly given as @code{No_Output_Operands}. -@ref{164,,Machine Code Insertions} +@ref{168,,Machine Code Insertions} @node Attribute Atomic_Always_Lock_Free,Attribute Bit,Attribute Asm_Output,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-atomic-always-lock-free}@anchor{166} +@anchor{gnat_rm/implementation_defined_attributes attribute-atomic-always-lock-free}@anchor{16a} @section Attribute Atomic_Always_Lock_Free @@ -10031,7 +10202,7 @@ and False otherwise. The result indicate whether atomic operations are supported by the target for the given type. @node Attribute Bit,Attribute Bit_Position,Attribute Atomic_Always_Lock_Free,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-bit}@anchor{167} +@anchor{gnat_rm/implementation_defined_attributes attribute-bit}@anchor{16b} @section Attribute Bit @@ -10062,7 +10233,7 @@ This attribute is designed to be compatible with the DEC Ada 83 definition and implementation of the @code{Bit} attribute. @node Attribute Bit_Position,Attribute Code_Address,Attribute Bit,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-bit-position}@anchor{168} +@anchor{gnat_rm/implementation_defined_attributes attribute-bit-position}@anchor{16c} @section Attribute Bit_Position @@ -10077,7 +10248,7 @@ type @emph{universal_integer}. The value depends only on the field the containing record @code{R}. @node Attribute Code_Address,Attribute Compiler_Version,Attribute Bit_Position,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-code-address}@anchor{169} +@anchor{gnat_rm/implementation_defined_attributes attribute-code-address}@anchor{16d} @section Attribute Code_Address @@ -10120,7 +10291,7 @@ the same value as is returned by the corresponding @code{'Address} attribute. @node Attribute Compiler_Version,Attribute Constrained,Attribute Code_Address,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-compiler-version}@anchor{16a} +@anchor{gnat_rm/implementation_defined_attributes attribute-compiler-version}@anchor{16e} @section Attribute Compiler_Version @@ -10131,7 +10302,7 @@ prefix) yields a static string identifying the version of the compiler being used to compile the unit containing the attribute reference. @node Attribute Constrained,Attribute Default_Bit_Order,Attribute Compiler_Version,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-constrained}@anchor{16b} +@anchor{gnat_rm/implementation_defined_attributes attribute-constrained}@anchor{16f} @section Attribute Constrained @@ -10146,7 +10317,7 @@ record type without discriminants is always @code{True}. This usage is compatible with older Ada compilers, including notably DEC Ada. @node Attribute Default_Bit_Order,Attribute Default_Scalar_Storage_Order,Attribute Constrained,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-default-bit-order}@anchor{16c} +@anchor{gnat_rm/implementation_defined_attributes attribute-default-bit-order}@anchor{170} @section Attribute Default_Bit_Order @@ -10163,7 +10334,7 @@ as a @code{Pos} value (0 for @code{High_Order_First}, 1 for @code{Default_Bit_Order} in package @code{System}. @node Attribute Default_Scalar_Storage_Order,Attribute Deref,Attribute Default_Bit_Order,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-default-scalar-storage-order}@anchor{16d} +@anchor{gnat_rm/implementation_defined_attributes attribute-default-scalar-storage-order}@anchor{171} @section Attribute Default_Scalar_Storage_Order @@ -10180,7 +10351,7 @@ equal to @code{Default_Bit_Order} if unspecified) as a @code{System.Bit_Order} value. This is a static attribute. @node Attribute Deref,Attribute Descriptor_Size,Attribute Default_Scalar_Storage_Order,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-deref}@anchor{16e} +@anchor{gnat_rm/implementation_defined_attributes attribute-deref}@anchor{172} @section Attribute Deref @@ -10193,7 +10364,7 @@ a named access-to-@cite{typ} type, except that it yields a variable, so it can b used on the left side of an assignment. @node Attribute Descriptor_Size,Attribute Elaborated,Attribute Deref,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-descriptor-size}@anchor{16f} +@anchor{gnat_rm/implementation_defined_attributes attribute-descriptor-size}@anchor{173} @section Attribute Descriptor_Size @@ -10220,7 +10391,7 @@ In the example above, the descriptor contains two values of type a size of 31 bits and an alignment of 4, the descriptor size is @code{2 * Positive'Size + 2} or 64 bits. @node Attribute Elaborated,Attribute Elab_Body,Attribute Descriptor_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elaborated}@anchor{170} +@anchor{gnat_rm/implementation_defined_attributes attribute-elaborated}@anchor{174} @section Attribute Elaborated @@ -10235,7 +10406,7 @@ units has been completed. An exception is for units which need no elaboration, the value is always False for such units. @node Attribute Elab_Body,Attribute Elab_Spec,Attribute Elaborated,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elab-body}@anchor{171} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-body}@anchor{175} @section Attribute Elab_Body @@ -10251,7 +10422,7 @@ e.g., if it is necessary to do selective re-elaboration to fix some error. @node Attribute Elab_Spec,Attribute Elab_Subp_Body,Attribute Elab_Body,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elab-spec}@anchor{172} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-spec}@anchor{176} @section Attribute Elab_Spec @@ -10267,7 +10438,7 @@ Ada code, e.g., if it is necessary to do selective re-elaboration to fix some error. @node Attribute Elab_Subp_Body,Attribute Emax,Attribute Elab_Spec,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elab-subp-body}@anchor{173} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-subp-body}@anchor{177} @section Attribute Elab_Subp_Body @@ -10281,7 +10452,7 @@ elaboration procedure by the binder in CodePeer mode only and is unrecognized otherwise. @node Attribute Emax,Attribute Enabled,Attribute Elab_Subp_Body,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-emax}@anchor{174} +@anchor{gnat_rm/implementation_defined_attributes attribute-emax}@anchor{178} @section Attribute Emax @@ -10294,7 +10465,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Enabled,Attribute Enum_Rep,Attribute Emax,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-enabled}@anchor{175} +@anchor{gnat_rm/implementation_defined_attributes attribute-enabled}@anchor{179} @section Attribute Enabled @@ -10318,7 +10489,7 @@ a @code{pragma Suppress} or @code{pragma Unsuppress} before instantiating the package or subprogram, controlling whether the check will be present. @node Attribute Enum_Rep,Attribute Enum_Val,Attribute Enabled,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-enum-rep}@anchor{176} +@anchor{gnat_rm/implementation_defined_attributes attribute-enum-rep}@anchor{17a} @section Attribute Enum_Rep @@ -10355,7 +10526,7 @@ integer calculation is done at run time, then the call to @code{Enum_Rep} may raise @code{Constraint_Error}. @node Attribute Enum_Val,Attribute Epsilon,Attribute Enum_Rep,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-enum-val}@anchor{177} +@anchor{gnat_rm/implementation_defined_attributes attribute-enum-val}@anchor{17b} @section Attribute Enum_Val @@ -10378,7 +10549,7 @@ absence of an enumeration representation clause. This is a static attribute (i.e., the result is static if the argument is static). @node Attribute Epsilon,Attribute Fast_Math,Attribute Enum_Val,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-epsilon}@anchor{178} +@anchor{gnat_rm/implementation_defined_attributes attribute-epsilon}@anchor{17c} @section Attribute Epsilon @@ -10391,7 +10562,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Fast_Math,Attribute Finalization_Size,Attribute Epsilon,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-fast-math}@anchor{179} +@anchor{gnat_rm/implementation_defined_attributes attribute-fast-math}@anchor{17d} @section Attribute Fast_Math @@ -10402,7 +10573,7 @@ prefix) yields a static Boolean value that is True if pragma @code{Fast_Math} is active, and False otherwise. @node Attribute Finalization_Size,Attribute Fixed_Value,Attribute Fast_Math,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-finalization-size}@anchor{17a} +@anchor{gnat_rm/implementation_defined_attributes attribute-finalization-size}@anchor{17e} @section Attribute Finalization_Size @@ -10420,7 +10591,7 @@ class-wide type whose tag denotes a type with no controlled parts. Note that only heap-allocated objects contain finalization data. @node Attribute Fixed_Value,Attribute From_Any,Attribute Finalization_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-fixed-value}@anchor{17b} +@anchor{gnat_rm/implementation_defined_attributes attribute-fixed-value}@anchor{17f} @section Attribute Fixed_Value @@ -10447,7 +10618,7 @@ This attribute is primarily intended for use in implementation of the input-output functions for fixed-point values. @node Attribute From_Any,Attribute Has_Access_Values,Attribute Fixed_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-from-any}@anchor{17c} +@anchor{gnat_rm/implementation_defined_attributes attribute-from-any}@anchor{180} @section Attribute From_Any @@ -10457,7 +10628,7 @@ This internal attribute is used for the generation of remote subprogram stubs in the context of the Distributed Systems Annex. @node Attribute Has_Access_Values,Attribute Has_Discriminants,Attribute From_Any,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-has-access-values}@anchor{17d} +@anchor{gnat_rm/implementation_defined_attributes attribute-has-access-values}@anchor{181} @section Attribute Has_Access_Values @@ -10475,7 +10646,7 @@ definitions. If the attribute is applied to a generic private type, it indicates whether or not the corresponding actual type has access values. @node Attribute Has_Discriminants,Attribute Img,Attribute Has_Access_Values,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-has-discriminants}@anchor{17e} +@anchor{gnat_rm/implementation_defined_attributes attribute-has-discriminants}@anchor{182} @section Attribute Has_Discriminants @@ -10491,7 +10662,7 @@ definitions. If the attribute is applied to a generic private type, it indicates whether or not the corresponding actual type has discriminants. @node Attribute Img,Attribute Integer_Value,Attribute Has_Discriminants,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-img}@anchor{17f} +@anchor{gnat_rm/implementation_defined_attributes attribute-img}@anchor{183} @section Attribute Img @@ -10521,7 +10692,7 @@ that returns the appropriate string when called. This means that in an instantiation as a function parameter. @node Attribute Integer_Value,Attribute Invalid_Value,Attribute Img,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-integer-value}@anchor{180} +@anchor{gnat_rm/implementation_defined_attributes attribute-integer-value}@anchor{184} @section Attribute Integer_Value @@ -10549,7 +10720,7 @@ This attribute is primarily intended for use in implementation of the standard input-output functions for fixed-point values. @node Attribute Invalid_Value,Attribute Iterable,Attribute Integer_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-invalid-value}@anchor{181} +@anchor{gnat_rm/implementation_defined_attributes attribute-invalid-value}@anchor{185} @section Attribute Invalid_Value @@ -10563,7 +10734,7 @@ including the ability to modify the value with the binder -Sxx flag and relevant environment variables at run time. @node Attribute Iterable,Attribute Large,Attribute Invalid_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-iterable}@anchor{182} +@anchor{gnat_rm/implementation_defined_attributes attribute-iterable}@anchor{186} @section Attribute Iterable @@ -10572,7 +10743,7 @@ relevant environment variables at run time. Equivalent to Aspect Iterable. @node Attribute Large,Attribute Library_Level,Attribute Iterable,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-large}@anchor{183} +@anchor{gnat_rm/implementation_defined_attributes attribute-large}@anchor{187} @section Attribute Large @@ -10585,7 +10756,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Library_Level,Attribute Lock_Free,Attribute Large,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-library-level}@anchor{184} +@anchor{gnat_rm/implementation_defined_attributes attribute-library-level}@anchor{188} @section Attribute Library_Level @@ -10611,7 +10782,7 @@ end Gen; @end example @node Attribute Lock_Free,Attribute Loop_Entry,Attribute Library_Level,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-lock-free}@anchor{185} +@anchor{gnat_rm/implementation_defined_attributes attribute-lock-free}@anchor{189} @section Attribute Lock_Free @@ -10621,7 +10792,7 @@ end Gen; pragma @code{Lock_Free} applies to P. @node Attribute Loop_Entry,Attribute Machine_Size,Attribute Lock_Free,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-loop-entry}@anchor{186} +@anchor{gnat_rm/implementation_defined_attributes attribute-loop-entry}@anchor{18a} @section Attribute Loop_Entry @@ -10651,7 +10822,7 @@ entry. This copy is not performed if the loop is not entered, or if the corresponding pragmas are ignored or disabled. @node Attribute Machine_Size,Attribute Mantissa,Attribute Loop_Entry,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-machine-size}@anchor{187} +@anchor{gnat_rm/implementation_defined_attributes attribute-machine-size}@anchor{18b} @section Attribute Machine_Size @@ -10661,7 +10832,7 @@ This attribute is identical to the @code{Object_Size} attribute. It is provided for compatibility with the DEC Ada 83 attribute of this name. @node Attribute Mantissa,Attribute Maximum_Alignment,Attribute Machine_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-mantissa}@anchor{188} +@anchor{gnat_rm/implementation_defined_attributes attribute-mantissa}@anchor{18c} @section Attribute Mantissa @@ -10674,7 +10845,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Maximum_Alignment,Attribute Mechanism_Code,Attribute Mantissa,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-maximum-alignment}@anchor{189}@anchor{gnat_rm/implementation_defined_attributes id2}@anchor{18a} +@anchor{gnat_rm/implementation_defined_attributes attribute-maximum-alignment}@anchor{18d}@anchor{gnat_rm/implementation_defined_attributes id2}@anchor{18e} @section Attribute Maximum_Alignment @@ -10690,7 +10861,7 @@ for an object, guaranteeing that it is properly aligned in all cases. @node Attribute Mechanism_Code,Attribute Null_Parameter,Attribute Maximum_Alignment,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-mechanism-code}@anchor{18b} +@anchor{gnat_rm/implementation_defined_attributes attribute-mechanism-code}@anchor{18f} @section Attribute Mechanism_Code @@ -10721,7 +10892,7 @@ by reference @end table @node Attribute Null_Parameter,Attribute Object_Size,Attribute Mechanism_Code,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-null-parameter}@anchor{18c} +@anchor{gnat_rm/implementation_defined_attributes attribute-null-parameter}@anchor{190} @section Attribute Null_Parameter @@ -10746,7 +10917,7 @@ There is no way of indicating this without the @code{Null_Parameter} attribute. @node Attribute Object_Size,Attribute Old,Attribute Null_Parameter,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-object-size}@anchor{13f}@anchor{gnat_rm/implementation_defined_attributes id3}@anchor{18d} +@anchor{gnat_rm/implementation_defined_attributes attribute-object-size}@anchor{143}@anchor{gnat_rm/implementation_defined_attributes id3}@anchor{191} @section Attribute Object_Size @@ -10816,7 +10987,7 @@ Similar additional checks are performed in other contexts requiring statically matching subtypes. @node Attribute Old,Attribute Passed_By_Reference,Attribute Object_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-old}@anchor{18e} +@anchor{gnat_rm/implementation_defined_attributes attribute-old}@anchor{192} @section Attribute Old @@ -10831,7 +11002,7 @@ definition are allowed under control of implementation defined pragma @code{Unevaluated_Use_Of_Old}. @node Attribute Passed_By_Reference,Attribute Pool_Address,Attribute Old,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-passed-by-reference}@anchor{18f} +@anchor{gnat_rm/implementation_defined_attributes attribute-passed-by-reference}@anchor{193} @section Attribute Passed_By_Reference @@ -10847,7 +11018,7 @@ passed by copy in calls. For scalar types, the result is always @code{False} and is static. For non-scalar types, the result is nonstatic. @node Attribute Pool_Address,Attribute Range_Length,Attribute Passed_By_Reference,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-pool-address}@anchor{190} +@anchor{gnat_rm/implementation_defined_attributes attribute-pool-address}@anchor{194} @section Attribute Pool_Address @@ -10872,7 +11043,7 @@ For an object created by @code{new}, @code{Ptr.all'Pool_Address} is what is passed to @code{Allocate} and returned from @code{Deallocate}. @node Attribute Range_Length,Attribute Restriction_Set,Attribute Pool_Address,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-range-length}@anchor{191} +@anchor{gnat_rm/implementation_defined_attributes attribute-range-length}@anchor{195} @section Attribute Range_Length @@ -10885,7 +11056,7 @@ applied to the index subtype of a one dimensional array always gives the same result as @code{Length} applied to the array itself. @node Attribute Restriction_Set,Attribute Result,Attribute Range_Length,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-restriction-set}@anchor{192} +@anchor{gnat_rm/implementation_defined_attributes attribute-restriction-set}@anchor{196} @section Attribute Restriction_Set @@ -10955,7 +11126,7 @@ Restrictions pragma, they are not analyzed semantically, so they do not have a type. @node Attribute Result,Attribute Safe_Emax,Attribute Restriction_Set,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-result}@anchor{193} +@anchor{gnat_rm/implementation_defined_attributes attribute-result}@anchor{197} @section Attribute Result @@ -10968,7 +11139,7 @@ For a further discussion of the use of this attribute and examples of its use, see the description of pragma Postcondition. @node Attribute Safe_Emax,Attribute Safe_Large,Attribute Result,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-emax}@anchor{194} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-emax}@anchor{198} @section Attribute Safe_Emax @@ -10981,7 +11152,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Safe_Large,Attribute Safe_Small,Attribute Safe_Emax,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-large}@anchor{195} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-large}@anchor{199} @section Attribute Safe_Large @@ -10994,7 +11165,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Safe_Small,Attribute Scalar_Storage_Order,Attribute Safe_Large,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-small}@anchor{196} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-small}@anchor{19a} @section Attribute Safe_Small @@ -11007,7 +11178,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Scalar_Storage_Order,Attribute Simple_Storage_Pool,Attribute Safe_Small,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes id4}@anchor{197}@anchor{gnat_rm/implementation_defined_attributes attribute-scalar-storage-order}@anchor{14c} +@anchor{gnat_rm/implementation_defined_attributes id4}@anchor{19b}@anchor{gnat_rm/implementation_defined_attributes attribute-scalar-storage-order}@anchor{150} @section Attribute Scalar_Storage_Order @@ -11127,7 +11298,7 @@ representation. It has no effect on the representation used by stream attributes. @node Attribute Simple_Storage_Pool,Attribute Small,Attribute Scalar_Storage_Order,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-simple-storage-pool}@anchor{e3}@anchor{gnat_rm/implementation_defined_attributes id5}@anchor{198} +@anchor{gnat_rm/implementation_defined_attributes attribute-simple-storage-pool}@anchor{e7}@anchor{gnat_rm/implementation_defined_attributes id5}@anchor{19c} @section Attribute Simple_Storage_Pool @@ -11190,7 +11361,7 @@ as defined in section 13.11.2 of the Ada Reference Manual, except that the term @emph{simple storage pool} is substituted for @emph{storage pool}. @node Attribute Small,Attribute Storage_Unit,Attribute Simple_Storage_Pool,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-small}@anchor{199} +@anchor{gnat_rm/implementation_defined_attributes attribute-small}@anchor{19d} @section Attribute Small @@ -11206,7 +11377,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute when applied to floating-point types. @node Attribute Storage_Unit,Attribute Stub_Type,Attribute Small,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-storage-unit}@anchor{19a} +@anchor{gnat_rm/implementation_defined_attributes attribute-storage-unit}@anchor{19e} @section Attribute Storage_Unit @@ -11216,7 +11387,7 @@ this attribute when applied to floating-point types. prefix) provides the same value as @code{System.Storage_Unit}. @node Attribute Stub_Type,Attribute System_Allocator_Alignment,Attribute Storage_Unit,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-stub-type}@anchor{19b} +@anchor{gnat_rm/implementation_defined_attributes attribute-stub-type}@anchor{19f} @section Attribute Stub_Type @@ -11240,7 +11411,7 @@ unit @code{System.Partition_Interface}. Use of this attribute will create an implicit dependency on this unit. @node Attribute System_Allocator_Alignment,Attribute Target_Name,Attribute Stub_Type,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-system-allocator-alignment}@anchor{19c} +@anchor{gnat_rm/implementation_defined_attributes attribute-system-allocator-alignment}@anchor{1a0} @section Attribute System_Allocator_Alignment @@ -11257,7 +11428,7 @@ with alignment too large or to enable a realignment circuitry if the alignment request is larger than this value. @node Attribute Target_Name,Attribute To_Address,Attribute System_Allocator_Alignment,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-target-name}@anchor{19d} +@anchor{gnat_rm/implementation_defined_attributes attribute-target-name}@anchor{1a1} @section Attribute Target_Name @@ -11270,7 +11441,7 @@ standard gcc target name without the terminating slash (for example, GNAT 5.0 on windows yields "i586-pc-mingw32msv"). @node Attribute To_Address,Attribute To_Any,Attribute Target_Name,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-to-address}@anchor{19e} +@anchor{gnat_rm/implementation_defined_attributes attribute-to-address}@anchor{1a2} @section Attribute To_Address @@ -11293,7 +11464,7 @@ modular manner (e.g., -1 means the same as 16#FFFF_FFFF# on a 32 bits machine). @node Attribute To_Any,Attribute Type_Class,Attribute To_Address,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-to-any}@anchor{19f} +@anchor{gnat_rm/implementation_defined_attributes attribute-to-any}@anchor{1a3} @section Attribute To_Any @@ -11303,7 +11474,7 @@ This internal attribute is used for the generation of remote subprogram stubs in the context of the Distributed Systems Annex. @node Attribute Type_Class,Attribute Type_Key,Attribute To_Any,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-type-class}@anchor{1a0} +@anchor{gnat_rm/implementation_defined_attributes attribute-type-class}@anchor{1a4} @section Attribute Type_Class @@ -11333,7 +11504,7 @@ applies to all concurrent types. This attribute is designed to be compatible with the DEC Ada 83 attribute of the same name. @node Attribute Type_Key,Attribute TypeCode,Attribute Type_Class,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-type-key}@anchor{1a1} +@anchor{gnat_rm/implementation_defined_attributes attribute-type-key}@anchor{1a5} @section Attribute Type_Key @@ -11345,7 +11516,7 @@ about the type or subtype. This provides improved compatibility with other implementations that support this attribute. @node Attribute TypeCode,Attribute Unconstrained_Array,Attribute Type_Key,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-typecode}@anchor{1a2} +@anchor{gnat_rm/implementation_defined_attributes attribute-typecode}@anchor{1a6} @section Attribute TypeCode @@ -11355,7 +11526,7 @@ This internal attribute is used for the generation of remote subprogram stubs in the context of the Distributed Systems Annex. @node Attribute Unconstrained_Array,Attribute Universal_Literal_String,Attribute TypeCode,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-unconstrained-array}@anchor{1a3} +@anchor{gnat_rm/implementation_defined_attributes attribute-unconstrained-array}@anchor{1a7} @section Attribute Unconstrained_Array @@ -11369,7 +11540,7 @@ still static, and yields the result of applying this test to the generic actual. @node Attribute Universal_Literal_String,Attribute Unrestricted_Access,Attribute Unconstrained_Array,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-universal-literal-string}@anchor{1a4} +@anchor{gnat_rm/implementation_defined_attributes attribute-universal-literal-string}@anchor{1a8} @section Attribute Universal_Literal_String @@ -11397,7 +11568,7 @@ end; @end example @node Attribute Unrestricted_Access,Attribute Update,Attribute Universal_Literal_String,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-unrestricted-access}@anchor{1a5} +@anchor{gnat_rm/implementation_defined_attributes attribute-unrestricted-access}@anchor{1a9} @section Attribute Unrestricted_Access @@ -11584,7 +11755,7 @@ In general this is a risky approach. It may appear to "work" but such uses of of GNAT to another, so are best avoided if possible. @node Attribute Update,Attribute Valid_Scalars,Attribute Unrestricted_Access,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-update}@anchor{1a6} +@anchor{gnat_rm/implementation_defined_attributes attribute-update}@anchor{1aa} @section Attribute Update @@ -11665,7 +11836,7 @@ A := A'Update ((1, 2) => 20, (3, 4) => 30); which changes element (1,2) to 20 and (3,4) to 30. @node Attribute Valid_Scalars,Attribute VADS_Size,Attribute Update,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-valid-scalars}@anchor{1a7} +@anchor{gnat_rm/implementation_defined_attributes attribute-valid-scalars}@anchor{1ab} @section Attribute Valid_Scalars @@ -11699,7 +11870,7 @@ write a function with a single use of the attribute, and then call that function from multiple places. @node Attribute VADS_Size,Attribute Value_Size,Attribute Valid_Scalars,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-vads-size}@anchor{1a8} +@anchor{gnat_rm/implementation_defined_attributes attribute-vads-size}@anchor{1ac} @section Attribute VADS_Size @@ -11719,7 +11890,7 @@ gives the result that would be obtained by applying the attribute to the corresponding type. @node Attribute Value_Size,Attribute Wchar_T_Size,Attribute VADS_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes id6}@anchor{1a9}@anchor{gnat_rm/implementation_defined_attributes attribute-value-size}@anchor{15b} +@anchor{gnat_rm/implementation_defined_attributes id6}@anchor{1ad}@anchor{gnat_rm/implementation_defined_attributes attribute-value-size}@anchor{15f} @section Attribute Value_Size @@ -11733,7 +11904,7 @@ a value of the given subtype. It is the same as @code{type'Size}, but, unlike @code{Size}, may be set for non-first subtypes. @node Attribute Wchar_T_Size,Attribute Word_Size,Attribute Value_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-wchar-t-size}@anchor{1aa} +@anchor{gnat_rm/implementation_defined_attributes attribute-wchar-t-size}@anchor{1ae} @section Attribute Wchar_T_Size @@ -11745,7 +11916,7 @@ primarily for constructing the definition of this type in package @code{Interfaces.C}. The result is a static constant. @node Attribute Word_Size,,Attribute Wchar_T_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-word-size}@anchor{1ab} +@anchor{gnat_rm/implementation_defined_attributes attribute-word-size}@anchor{1af} @section Attribute Word_Size @@ -11756,7 +11927,7 @@ prefix) provides the value @code{System.Word_Size}. The result is a static constant. @node Standard and Implementation Defined Restrictions,Implementation Advice,Implementation Defined Attributes,Top -@anchor{gnat_rm/standard_and_implementation_defined_restrictions standard-and-implementation-defined-restrictions}@anchor{9}@anchor{gnat_rm/standard_and_implementation_defined_restrictions doc}@anchor{1ac}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id1}@anchor{1ad} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions standard-and-implementation-defined-restrictions}@anchor{9}@anchor{gnat_rm/standard_and_implementation_defined_restrictions doc}@anchor{1b0}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id1}@anchor{1b1} @chapter Standard and Implementation Defined Restrictions @@ -11785,7 +11956,7 @@ language defined or GNAT-specific, are listed in the following. @end menu @node Partition-Wide Restrictions,Program Unit Level Restrictions,,Standard and Implementation Defined Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions partition-wide-restrictions}@anchor{1ae}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id2}@anchor{1af} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions partition-wide-restrictions}@anchor{1b2}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id2}@anchor{1b3} @section Partition-Wide Restrictions @@ -11874,7 +12045,7 @@ then all compilation units in the partition must obey the restriction). @end menu @node Immediate_Reclamation,Max_Asynchronous_Select_Nesting,,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions immediate-reclamation}@anchor{1b0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions immediate-reclamation}@anchor{1b4} @subsection Immediate_Reclamation @@ -11886,7 +12057,7 @@ deallocation, any storage reserved at run time for an object is immediately reclaimed when the object no longer exists. @node Max_Asynchronous_Select_Nesting,Max_Entry_Queue_Length,Immediate_Reclamation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-asynchronous-select-nesting}@anchor{1b1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-asynchronous-select-nesting}@anchor{1b5} @subsection Max_Asynchronous_Select_Nesting @@ -11898,7 +12069,7 @@ detected at compile time. Violations of this restriction with values other than zero cause Storage_Error to be raised. @node Max_Entry_Queue_Length,Max_Protected_Entries,Max_Asynchronous_Select_Nesting,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-entry-queue-length}@anchor{1b2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-entry-queue-length}@anchor{1b6} @subsection Max_Entry_Queue_Length @@ -11919,7 +12090,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node Max_Protected_Entries,Max_Select_Alternatives,Max_Entry_Queue_Length,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-protected-entries}@anchor{1b3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-protected-entries}@anchor{1b7} @subsection Max_Protected_Entries @@ -11930,7 +12101,7 @@ bounds of every entry family of a protected unit shall be static, or shall be defined by a discriminant of a subtype whose corresponding bound is static. @node Max_Select_Alternatives,Max_Storage_At_Blocking,Max_Protected_Entries,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-select-alternatives}@anchor{1b4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-select-alternatives}@anchor{1b8} @subsection Max_Select_Alternatives @@ -11939,7 +12110,7 @@ defined by a discriminant of a subtype whose corresponding bound is static. [RM D.7] Specifies the maximum number of alternatives in a selective accept. @node Max_Storage_At_Blocking,Max_Task_Entries,Max_Select_Alternatives,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-storage-at-blocking}@anchor{1b5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-storage-at-blocking}@anchor{1b9} @subsection Max_Storage_At_Blocking @@ -11950,7 +12121,7 @@ Storage_Size that can be retained by a blocked task. A violation of this restriction causes Storage_Error to be raised. @node Max_Task_Entries,Max_Tasks,Max_Storage_At_Blocking,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-task-entries}@anchor{1b6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-task-entries}@anchor{1ba} @subsection Max_Task_Entries @@ -11963,7 +12134,7 @@ defined by a discriminant of a subtype whose corresponding bound is static. @node Max_Tasks,No_Abort_Statements,Max_Task_Entries,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-tasks}@anchor{1b7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-tasks}@anchor{1bb} @subsection Max_Tasks @@ -11976,7 +12147,7 @@ time. Violations of this restriction with values other than zero cause Storage_Error to be raised. @node No_Abort_Statements,No_Access_Parameter_Allocators,Max_Tasks,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-abort-statements}@anchor{1b8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-abort-statements}@anchor{1bc} @subsection No_Abort_Statements @@ -11986,7 +12157,7 @@ Storage_Error to be raised. no calls to Task_Identification.Abort_Task. @node No_Access_Parameter_Allocators,No_Access_Subprograms,No_Abort_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-parameter-allocators}@anchor{1b9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-parameter-allocators}@anchor{1bd} @subsection No_Access_Parameter_Allocators @@ -11997,7 +12168,7 @@ occurrences of an allocator as the actual parameter to an access parameter. @node No_Access_Subprograms,No_Allocators,No_Access_Parameter_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-subprograms}@anchor{1ba} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-subprograms}@anchor{1be} @subsection No_Access_Subprograms @@ -12007,7 +12178,7 @@ parameter. declarations of access-to-subprogram types. @node No_Allocators,No_Anonymous_Allocators,No_Access_Subprograms,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-allocators}@anchor{1bb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-allocators}@anchor{1bf} @subsection No_Allocators @@ -12017,7 +12188,7 @@ declarations of access-to-subprogram types. occurrences of an allocator. @node No_Anonymous_Allocators,No_Asynchronous_Control,No_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-anonymous-allocators}@anchor{1bc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-anonymous-allocators}@anchor{1c0} @subsection No_Anonymous_Allocators @@ -12027,7 +12198,7 @@ occurrences of an allocator. occurrences of an allocator of anonymous access type. @node No_Asynchronous_Control,No_Calendar,No_Anonymous_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-asynchronous-control}@anchor{1bd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-asynchronous-control}@anchor{1c1} @subsection No_Asynchronous_Control @@ -12037,7 +12208,7 @@ occurrences of an allocator of anonymous access type. dependences on the predefined package Asynchronous_Task_Control. @node No_Calendar,No_Coextensions,No_Asynchronous_Control,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-calendar}@anchor{1be} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-calendar}@anchor{1c2} @subsection No_Calendar @@ -12047,7 +12218,7 @@ dependences on the predefined package Asynchronous_Task_Control. dependences on package Calendar. @node No_Coextensions,No_Default_Initialization,No_Calendar,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-coextensions}@anchor{1bf} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-coextensions}@anchor{1c3} @subsection No_Coextensions @@ -12057,7 +12228,7 @@ dependences on package Calendar. coextensions. See 3.10.2. @node No_Default_Initialization,No_Delay,No_Coextensions,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-default-initialization}@anchor{1c0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-default-initialization}@anchor{1c4} @subsection No_Default_Initialization @@ -12074,7 +12245,7 @@ is to prohibit all cases of variables declared without a specific initializer (including the case of OUT scalar parameters). @node No_Delay,No_Dependence,No_Default_Initialization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-delay}@anchor{1c1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-delay}@anchor{1c5} @subsection No_Delay @@ -12084,7 +12255,7 @@ initializer (including the case of OUT scalar parameters). delay statements and no semantic dependences on package Calendar. @node No_Dependence,No_Direct_Boolean_Operators,No_Delay,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dependence}@anchor{1c2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dependence}@anchor{1c6} @subsection No_Dependence @@ -12094,7 +12265,7 @@ delay statements and no semantic dependences on package Calendar. dependences on a library unit. @node No_Direct_Boolean_Operators,No_Dispatch,No_Dependence,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-direct-boolean-operators}@anchor{1c3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-direct-boolean-operators}@anchor{1c7} @subsection No_Direct_Boolean_Operators @@ -12107,7 +12278,7 @@ protocol requires the use of short-circuit (and then, or else) forms for all composite boolean operations. @node No_Dispatch,No_Dispatching_Calls,No_Direct_Boolean_Operators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatch}@anchor{1c4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatch}@anchor{1c8} @subsection No_Dispatch @@ -12117,7 +12288,7 @@ composite boolean operations. occurrences of @code{T'Class}, for any (tagged) subtype @code{T}. @node No_Dispatching_Calls,No_Dynamic_Attachment,No_Dispatch,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatching-calls}@anchor{1c5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatching-calls}@anchor{1c9} @subsection No_Dispatching_Calls @@ -12178,7 +12349,7 @@ end Example; @end example @node No_Dynamic_Attachment,No_Dynamic_Priorities,No_Dispatching_Calls,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-attachment}@anchor{1c6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-attachment}@anchor{1ca} @subsection No_Dynamic_Attachment @@ -12197,7 +12368,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node No_Dynamic_Priorities,No_Entry_Calls_In_Elaboration_Code,No_Dynamic_Attachment,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-priorities}@anchor{1c7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-priorities}@anchor{1cb} @subsection No_Dynamic_Priorities @@ -12206,7 +12377,7 @@ warnings on obsolescent features are activated). [RM D.7] There are no semantic dependencies on the package Dynamic_Priorities. @node No_Entry_Calls_In_Elaboration_Code,No_Enumeration_Maps,No_Dynamic_Priorities,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-calls-in-elaboration-code}@anchor{1c8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-calls-in-elaboration-code}@anchor{1cc} @subsection No_Entry_Calls_In_Elaboration_Code @@ -12218,7 +12389,7 @@ restriction, the compiler can assume that no code past an accept statement in a task can be executed at elaboration time. @node No_Enumeration_Maps,No_Exception_Handlers,No_Entry_Calls_In_Elaboration_Code,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-enumeration-maps}@anchor{1c9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-enumeration-maps}@anchor{1cd} @subsection No_Enumeration_Maps @@ -12229,7 +12400,7 @@ enumeration maps are used (that is Image and Value attributes applied to enumeration types). @node No_Exception_Handlers,No_Exception_Propagation,No_Enumeration_Maps,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-handlers}@anchor{1ca} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-handlers}@anchor{1ce} @subsection No_Exception_Handlers @@ -12254,7 +12425,7 @@ statement generated by the compiler). The Line parameter when nonzero represents the line number in the source program where the raise occurs. @node No_Exception_Propagation,No_Exception_Registration,No_Exception_Handlers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-propagation}@anchor{1cb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-propagation}@anchor{1cf} @subsection No_Exception_Propagation @@ -12271,7 +12442,7 @@ the package GNAT.Current_Exception is not permitted, and reraise statements (raise with no operand) are not permitted. @node No_Exception_Registration,No_Exceptions,No_Exception_Propagation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-registration}@anchor{1cc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-registration}@anchor{1d0} @subsection No_Exception_Registration @@ -12285,7 +12456,7 @@ code is simplified by omitting the otherwise-required global registration of exceptions when they are declared. @node No_Exceptions,No_Finalization,No_Exception_Registration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exceptions}@anchor{1cd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exceptions}@anchor{1d1} @subsection No_Exceptions @@ -12295,7 +12466,7 @@ of exceptions when they are declared. raise statements and no exception handlers. @node No_Finalization,No_Fixed_Point,No_Exceptions,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-finalization}@anchor{1ce} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-finalization}@anchor{1d2} @subsection No_Finalization @@ -12336,7 +12507,7 @@ object or a nested component, either declared on the stack or on the heap. The deallocation of a controlled object no longer finalizes its contents. @node No_Fixed_Point,No_Floating_Point,No_Finalization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-fixed-point}@anchor{1cf} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-fixed-point}@anchor{1d3} @subsection No_Fixed_Point @@ -12346,7 +12517,7 @@ deallocation of a controlled object no longer finalizes its contents. occurrences of fixed point types and operations. @node No_Floating_Point,No_Implicit_Conditionals,No_Fixed_Point,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-floating-point}@anchor{1d0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-floating-point}@anchor{1d4} @subsection No_Floating_Point @@ -12356,7 +12527,7 @@ occurrences of fixed point types and operations. occurrences of floating point types and operations. @node No_Implicit_Conditionals,No_Implicit_Dynamic_Code,No_Floating_Point,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-conditionals}@anchor{1d1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-conditionals}@anchor{1d5} @subsection No_Implicit_Conditionals @@ -12372,7 +12543,7 @@ normal manner. Constructs generating implicit conditionals include comparisons of composite objects and the Max/Min attributes. @node No_Implicit_Dynamic_Code,No_Implicit_Heap_Allocations,No_Implicit_Conditionals,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-dynamic-code}@anchor{1d2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-dynamic-code}@anchor{1d6} @subsection No_Implicit_Dynamic_Code @@ -12402,7 +12573,7 @@ foreign-language convention; primitive operations of nested tagged types. @node No_Implicit_Heap_Allocations,No_Implicit_Protected_Object_Allocations,No_Implicit_Dynamic_Code,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-heap-allocations}@anchor{1d3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-heap-allocations}@anchor{1d7} @subsection No_Implicit_Heap_Allocations @@ -12411,7 +12582,7 @@ types. [RM D.7] No constructs are allowed to cause implicit heap allocation. @node No_Implicit_Protected_Object_Allocations,No_Implicit_Task_Allocations,No_Implicit_Heap_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-protected-object-allocations}@anchor{1d4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-protected-object-allocations}@anchor{1d8} @subsection No_Implicit_Protected_Object_Allocations @@ -12421,7 +12592,7 @@ types. protected object. @node No_Implicit_Task_Allocations,No_Initialize_Scalars,No_Implicit_Protected_Object_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-task-allocations}@anchor{1d5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-task-allocations}@anchor{1d9} @subsection No_Implicit_Task_Allocations @@ -12430,7 +12601,7 @@ protected object. [GNAT] No constructs are allowed to cause implicit heap allocation of a task. @node No_Initialize_Scalars,No_IO,No_Implicit_Task_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-initialize-scalars}@anchor{1d6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-initialize-scalars}@anchor{1da} @subsection No_Initialize_Scalars @@ -12442,7 +12613,7 @@ code, and in particular eliminates dummy null initialization routines that are otherwise generated for some record and array types. @node No_IO,No_Local_Allocators,No_Initialize_Scalars,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-io}@anchor{1d7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-io}@anchor{1db} @subsection No_IO @@ -12453,7 +12624,7 @@ dependences on any of the library units Sequential_IO, Direct_IO, Text_IO, Wide_Text_IO, Wide_Wide_Text_IO, or Stream_IO. @node No_Local_Allocators,No_Local_Protected_Objects,No_IO,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-allocators}@anchor{1d8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-allocators}@anchor{1dc} @subsection No_Local_Allocators @@ -12464,7 +12635,7 @@ occurrences of an allocator in subprograms, generic subprograms, tasks, and entry bodies. @node No_Local_Protected_Objects,No_Local_Timing_Events,No_Local_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-protected-objects}@anchor{1d9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-protected-objects}@anchor{1dd} @subsection No_Local_Protected_Objects @@ -12474,7 +12645,7 @@ and entry bodies. only declared at the library level. @node No_Local_Timing_Events,No_Long_Long_Integers,No_Local_Protected_Objects,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-timing-events}@anchor{1da} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-timing-events}@anchor{1de} @subsection No_Local_Timing_Events @@ -12484,7 +12655,7 @@ only declared at the library level. declared at the library level. @node No_Long_Long_Integers,No_Multiple_Elaboration,No_Local_Timing_Events,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-long-long-integers}@anchor{1db} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-long-long-integers}@anchor{1df} @subsection No_Long_Long_Integers @@ -12496,7 +12667,7 @@ implicit base type is Long_Long_Integer, and modular types whose size exceeds Long_Integer'Size. @node No_Multiple_Elaboration,No_Nested_Finalization,No_Long_Long_Integers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-multiple-elaboration}@anchor{1dc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-multiple-elaboration}@anchor{1e0} @subsection No_Multiple_Elaboration @@ -12513,7 +12684,7 @@ programs and Stand Alone libraries, are not permitted and will be diagnosed by the binder. @node No_Nested_Finalization,No_Protected_Type_Allocators,No_Multiple_Elaboration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-nested-finalization}@anchor{1dd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-nested-finalization}@anchor{1e1} @subsection No_Nested_Finalization @@ -12522,7 +12693,7 @@ by the binder. [RM D.7] All objects requiring finalization are declared at the library level. @node No_Protected_Type_Allocators,No_Protected_Types,No_Nested_Finalization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-type-allocators}@anchor{1de} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-type-allocators}@anchor{1e2} @subsection No_Protected_Type_Allocators @@ -12532,7 +12703,7 @@ by the binder. expressions that attempt to allocate protected objects. @node No_Protected_Types,No_Recursion,No_Protected_Type_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-types}@anchor{1df} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-types}@anchor{1e3} @subsection No_Protected_Types @@ -12542,7 +12713,7 @@ expressions that attempt to allocate protected objects. declarations of protected types or protected objects. @node No_Recursion,No_Reentrancy,No_Protected_Types,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-recursion}@anchor{1e0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-recursion}@anchor{1e4} @subsection No_Recursion @@ -12552,7 +12723,7 @@ declarations of protected types or protected objects. part of its execution. @node No_Reentrancy,No_Relative_Delay,No_Recursion,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-reentrancy}@anchor{1e1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-reentrancy}@anchor{1e5} @subsection No_Reentrancy @@ -12562,7 +12733,7 @@ part of its execution. two tasks at the same time. @node No_Relative_Delay,No_Requeue_Statements,No_Reentrancy,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-relative-delay}@anchor{1e2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-relative-delay}@anchor{1e6} @subsection No_Relative_Delay @@ -12573,7 +12744,7 @@ relative statements and prevents expressions such as @code{delay 1.23;} from appearing in source code. @node No_Requeue_Statements,No_Secondary_Stack,No_Relative_Delay,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-requeue-statements}@anchor{1e3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-requeue-statements}@anchor{1e7} @subsection No_Requeue_Statements @@ -12591,7 +12762,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on oNobsolescent features are activated). @node No_Secondary_Stack,No_Select_Statements,No_Requeue_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-secondary-stack}@anchor{1e4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-secondary-stack}@anchor{1e8} @subsection No_Secondary_Stack @@ -12604,7 +12775,7 @@ stack is used to implement functions returning unconstrained objects secondary stacks for tasks (excluding the environment task) at run time. @node No_Select_Statements,No_Specific_Termination_Handlers,No_Secondary_Stack,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-select-statements}@anchor{1e5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-select-statements}@anchor{1e9} @subsection No_Select_Statements @@ -12614,7 +12785,7 @@ secondary stacks for tasks (excluding the environment task) at run time. kind are permitted, that is the keyword @code{select} may not appear. @node No_Specific_Termination_Handlers,No_Specification_of_Aspect,No_Select_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specific-termination-handlers}@anchor{1e6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specific-termination-handlers}@anchor{1ea} @subsection No_Specific_Termination_Handlers @@ -12624,7 +12795,7 @@ kind are permitted, that is the keyword @code{select} may not appear. or to Ada.Task_Termination.Specific_Handler. @node No_Specification_of_Aspect,No_Standard_Allocators_After_Elaboration,No_Specific_Termination_Handlers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specification-of-aspect}@anchor{1e7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specification-of-aspect}@anchor{1eb} @subsection No_Specification_of_Aspect @@ -12635,7 +12806,7 @@ specification, attribute definition clause, or pragma is given for a given aspect. @node No_Standard_Allocators_After_Elaboration,No_Standard_Storage_Pools,No_Specification_of_Aspect,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-allocators-after-elaboration}@anchor{1e8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-allocators-after-elaboration}@anchor{1ec} @subsection No_Standard_Allocators_After_Elaboration @@ -12647,7 +12818,7 @@ library items of the partition has completed. Otherwise, Storage_Error is raised. @node No_Standard_Storage_Pools,No_Stream_Optimizations,No_Standard_Allocators_After_Elaboration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-storage-pools}@anchor{1e9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-storage-pools}@anchor{1ed} @subsection No_Standard_Storage_Pools @@ -12659,7 +12830,7 @@ have an explicit Storage_Pool attribute defined specifying a user-defined storage pool. @node No_Stream_Optimizations,No_Streams,No_Standard_Storage_Pools,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-stream-optimizations}@anchor{1ea} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-stream-optimizations}@anchor{1ee} @subsection No_Stream_Optimizations @@ -12672,7 +12843,7 @@ due to their supperior performance. When this restriction is in effect, the compiler performs all IO operations on a per-character basis. @node No_Streams,No_Task_Allocators,No_Stream_Optimizations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-streams}@anchor{1eb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-streams}@anchor{1ef} @subsection No_Streams @@ -12693,7 +12864,7 @@ unit declaring a tagged type should be compiled with the restriction, though this is not required. @node No_Task_Allocators,No_Task_At_Interrupt_Priority,No_Streams,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-allocators}@anchor{1ec} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-allocators}@anchor{1f0} @subsection No_Task_Allocators @@ -12703,7 +12874,7 @@ though this is not required. or types containing task subcomponents. @node No_Task_At_Interrupt_Priority,No_Task_Attributes_Package,No_Task_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-at-interrupt-priority}@anchor{1ed} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-at-interrupt-priority}@anchor{1f1} @subsection No_Task_At_Interrupt_Priority @@ -12715,7 +12886,7 @@ a consequence, the tasks are always created with a priority below that an interrupt priority. @node No_Task_Attributes_Package,No_Task_Hierarchy,No_Task_At_Interrupt_Priority,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-attributes-package}@anchor{1ee} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-attributes-package}@anchor{1f2} @subsection No_Task_Attributes_Package @@ -12732,7 +12903,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node No_Task_Hierarchy,No_Task_Termination,No_Task_Attributes_Package,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-hierarchy}@anchor{1ef} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-hierarchy}@anchor{1f3} @subsection No_Task_Hierarchy @@ -12742,7 +12913,7 @@ warnings on obsolescent features are activated). directly on the environment task of the partition. @node No_Task_Termination,No_Tasking,No_Task_Hierarchy,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-termination}@anchor{1f0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-termination}@anchor{1f4} @subsection No_Task_Termination @@ -12751,7 +12922,7 @@ directly on the environment task of the partition. [RM D.7] Tasks that terminate are erroneous. @node No_Tasking,No_Terminate_Alternatives,No_Task_Termination,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tasking}@anchor{1f1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tasking}@anchor{1f5} @subsection No_Tasking @@ -12764,7 +12935,7 @@ and cause an error message to be output either by the compiler or binder. @node No_Terminate_Alternatives,No_Unchecked_Access,No_Tasking,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-terminate-alternatives}@anchor{1f2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-terminate-alternatives}@anchor{1f6} @subsection No_Terminate_Alternatives @@ -12773,7 +12944,7 @@ binder. [RM D.7] There are no selective accepts with terminate alternatives. @node No_Unchecked_Access,No_Unchecked_Conversion,No_Terminate_Alternatives,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-access}@anchor{1f3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-access}@anchor{1f7} @subsection No_Unchecked_Access @@ -12783,7 +12954,7 @@ binder. occurrences of the Unchecked_Access attribute. @node No_Unchecked_Conversion,No_Unchecked_Deallocation,No_Unchecked_Access,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-conversion}@anchor{1f4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-conversion}@anchor{1f8} @subsection No_Unchecked_Conversion @@ -12793,7 +12964,7 @@ occurrences of the Unchecked_Access attribute. dependences on the predefined generic function Unchecked_Conversion. @node No_Unchecked_Deallocation,No_Use_Of_Entity,No_Unchecked_Conversion,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-deallocation}@anchor{1f5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-deallocation}@anchor{1f9} @subsection No_Unchecked_Deallocation @@ -12803,7 +12974,7 @@ dependences on the predefined generic function Unchecked_Conversion. dependences on the predefined generic procedure Unchecked_Deallocation. @node No_Use_Of_Entity,Pure_Barriers,No_Unchecked_Deallocation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-entity}@anchor{1f6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-entity}@anchor{1fa} @subsection No_Use_Of_Entity @@ -12823,7 +12994,7 @@ No_Use_Of_Entity => Ada.Text_IO.Put_Line @end example @node Pure_Barriers,Simple_Barriers,No_Use_Of_Entity,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions pure-barriers}@anchor{1f7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions pure-barriers}@anchor{1fb} @subsection Pure_Barriers @@ -12874,7 +13045,7 @@ but still ensures absence of side effects, exceptions, and recursion during the evaluation of the barriers. @node Simple_Barriers,Static_Priorities,Pure_Barriers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions simple-barriers}@anchor{1f8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions simple-barriers}@anchor{1fc} @subsection Simple_Barriers @@ -12893,7 +13064,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node Static_Priorities,Static_Storage_Size,Simple_Barriers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-priorities}@anchor{1f9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-priorities}@anchor{1fd} @subsection Static_Priorities @@ -12904,7 +13075,7 @@ are static, and that there are no dependences on the package @code{Ada.Dynamic_Priorities}. @node Static_Storage_Size,,Static_Priorities,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-storage-size}@anchor{1fa} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-storage-size}@anchor{1fe} @subsection Static_Storage_Size @@ -12914,7 +13085,7 @@ are static, and that there are no dependences on the package in a Storage_Size pragma or attribute definition clause is static. @node Program Unit Level Restrictions,,Partition-Wide Restrictions,Standard and Implementation Defined Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions program-unit-level-restrictions}@anchor{1fb}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id3}@anchor{1fc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions program-unit-level-restrictions}@anchor{1ff}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id3}@anchor{200} @section Program Unit Level Restrictions @@ -12944,7 +13115,7 @@ other compilation units in the partition. @end menu @node No_Elaboration_Code,No_Dynamic_Sized_Objects,,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-elaboration-code}@anchor{1fd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-elaboration-code}@anchor{201} @subsection No_Elaboration_Code @@ -13000,7 +13171,7 @@ associated with the unit. This counter is typically used to check for access before elaboration and to control multiple elaboration attempts. @node No_Dynamic_Sized_Objects,No_Entry_Queue,No_Elaboration_Code,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-sized-objects}@anchor{1fe} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-sized-objects}@anchor{202} @subsection No_Dynamic_Sized_Objects @@ -13018,7 +13189,7 @@ access discriminants. It is often a good idea to combine this restriction with No_Secondary_Stack. @node No_Entry_Queue,No_Implementation_Aspect_Specifications,No_Dynamic_Sized_Objects,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-queue}@anchor{1ff} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-queue}@anchor{203} @subsection No_Entry_Queue @@ -13031,7 +13202,7 @@ checked at compile time. A program execution is erroneous if an attempt is made to queue a second task on such an entry. @node No_Implementation_Aspect_Specifications,No_Implementation_Attributes,No_Entry_Queue,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-aspect-specifications}@anchor{200} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-aspect-specifications}@anchor{204} @subsection No_Implementation_Aspect_Specifications @@ -13042,7 +13213,7 @@ GNAT-defined aspects are present. With this restriction, the only aspects that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Attributes,No_Implementation_Identifiers,No_Implementation_Aspect_Specifications,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-attributes}@anchor{201} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-attributes}@anchor{205} @subsection No_Implementation_Attributes @@ -13054,7 +13225,7 @@ attributes that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Identifiers,No_Implementation_Pragmas,No_Implementation_Attributes,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-identifiers}@anchor{202} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-identifiers}@anchor{206} @subsection No_Implementation_Identifiers @@ -13065,7 +13236,7 @@ implementation-defined identifiers (marked with pragma Implementation_Defined) occur within language-defined packages. @node No_Implementation_Pragmas,No_Implementation_Restrictions,No_Implementation_Identifiers,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-pragmas}@anchor{203} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-pragmas}@anchor{207} @subsection No_Implementation_Pragmas @@ -13076,7 +13247,7 @@ GNAT-defined pragmas are present. With this restriction, the only pragmas that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Restrictions,No_Implementation_Units,No_Implementation_Pragmas,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-restrictions}@anchor{204} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-restrictions}@anchor{208} @subsection No_Implementation_Restrictions @@ -13088,7 +13259,7 @@ are present. With this restriction, the only other restriction identifiers that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Units,No_Implicit_Aliasing,No_Implementation_Restrictions,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-units}@anchor{205} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-units}@anchor{209} @subsection No_Implementation_Units @@ -13099,7 +13270,7 @@ mention in the context clause of any implementation-defined descendants of packages Ada, Interfaces, or System. @node No_Implicit_Aliasing,No_Implicit_Loops,No_Implementation_Units,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-aliasing}@anchor{206} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-aliasing}@anchor{20a} @subsection No_Implicit_Aliasing @@ -13114,7 +13285,7 @@ to be aliased, and in such cases, it can always be replaced by the standard attribute Unchecked_Access which is preferable. @node No_Implicit_Loops,No_Obsolescent_Features,No_Implicit_Aliasing,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-loops}@anchor{207} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-loops}@anchor{20b} @subsection No_Implicit_Loops @@ -13131,7 +13302,7 @@ arrays larger than about 5000 scalar components. Note that if this restriction is set in the spec of a package, it will not apply to its body. @node No_Obsolescent_Features,No_Wide_Characters,No_Implicit_Loops,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-obsolescent-features}@anchor{208} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-obsolescent-features}@anchor{20c} @subsection No_Obsolescent_Features @@ -13141,7 +13312,7 @@ is set in the spec of a package, it will not apply to its body. features are used, as defined in Annex J of the Ada Reference Manual. @node No_Wide_Characters,Static_Dispatch_Tables,No_Obsolescent_Features,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-wide-characters}@anchor{209} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-wide-characters}@anchor{20d} @subsection No_Wide_Characters @@ -13155,7 +13326,7 @@ appear in the program (that is literals representing characters not in type @code{Character}). @node Static_Dispatch_Tables,SPARK_05,No_Wide_Characters,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-dispatch-tables}@anchor{20a} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-dispatch-tables}@anchor{20e} @subsection Static_Dispatch_Tables @@ -13165,7 +13336,7 @@ type @code{Character}). associated with dispatch tables can be placed in read-only memory. @node SPARK_05,,Static_Dispatch_Tables,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions spark-05}@anchor{20b} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions spark-05}@anchor{20f} @subsection SPARK_05 @@ -13539,7 +13710,7 @@ violations will be reported for constructs forbidden in SPARK 95, instead of SPARK 2005. @node Implementation Advice,Implementation Defined Characteristics,Standard and Implementation Defined Restrictions,Top -@anchor{gnat_rm/implementation_advice doc}@anchor{20c}@anchor{gnat_rm/implementation_advice implementation-advice}@anchor{a}@anchor{gnat_rm/implementation_advice id1}@anchor{20d} +@anchor{gnat_rm/implementation_advice doc}@anchor{210}@anchor{gnat_rm/implementation_advice implementation-advice}@anchor{a}@anchor{gnat_rm/implementation_advice id1}@anchor{211} @chapter Implementation Advice @@ -13636,7 +13807,7 @@ case the text describes what GNAT does and why. @end menu @node RM 1 1 3 20 Error Detection,RM 1 1 3 31 Child Units,,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-3-20-error-detection}@anchor{20e} +@anchor{gnat_rm/implementation_advice rm-1-1-3-20-error-detection}@anchor{212} @section RM 1.1.3(20): Error Detection @@ -13653,7 +13824,7 @@ or diagnosed at compile time. @geindex Child Units @node RM 1 1 3 31 Child Units,RM 1 1 5 12 Bounded Errors,RM 1 1 3 20 Error Detection,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-3-31-child-units}@anchor{20f} +@anchor{gnat_rm/implementation_advice rm-1-1-3-31-child-units}@anchor{213} @section RM 1.1.3(31): Child Units @@ -13669,7 +13840,7 @@ Followed. @geindex Bounded errors @node RM 1 1 5 12 Bounded Errors,RM 2 8 16 Pragmas,RM 1 1 3 31 Child Units,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-5-12-bounded-errors}@anchor{210} +@anchor{gnat_rm/implementation_advice rm-1-1-5-12-bounded-errors}@anchor{214} @section RM 1.1.5(12): Bounded Errors @@ -13686,7 +13857,7 @@ runtime. @geindex Pragmas @node RM 2 8 16 Pragmas,RM 2 8 17-19 Pragmas,RM 1 1 5 12 Bounded Errors,Implementation Advice -@anchor{gnat_rm/implementation_advice id2}@anchor{211}@anchor{gnat_rm/implementation_advice rm-2-8-16-pragmas}@anchor{212} +@anchor{gnat_rm/implementation_advice id2}@anchor{215}@anchor{gnat_rm/implementation_advice rm-2-8-16-pragmas}@anchor{216} @section RM 2.8(16): Pragmas @@ -13799,7 +13970,7 @@ that this advice not be followed. For details see @ref{7,,Implementation Defined Pragmas}. @node RM 2 8 17-19 Pragmas,RM 3 5 2 5 Alternative Character Sets,RM 2 8 16 Pragmas,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-2-8-17-19-pragmas}@anchor{213} +@anchor{gnat_rm/implementation_advice rm-2-8-17-19-pragmas}@anchor{217} @section RM 2.8(17-19): Pragmas @@ -13820,14 +13991,14 @@ replacing @code{library_items}." @end itemize @end quotation -See @ref{212,,RM 2.8(16); Pragmas}. +See @ref{216,,RM 2.8(16); Pragmas}. @geindex Character Sets @geindex Alternative Character Sets @node RM 3 5 2 5 Alternative Character Sets,RM 3 5 4 28 Integer Types,RM 2 8 17-19 Pragmas,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-2-5-alternative-character-sets}@anchor{214} +@anchor{gnat_rm/implementation_advice rm-3-5-2-5-alternative-character-sets}@anchor{218} @section RM 3.5.2(5): Alternative Character Sets @@ -13855,7 +14026,7 @@ there is no such restriction. @geindex Integer types @node RM 3 5 4 28 Integer Types,RM 3 5 4 29 Integer Types,RM 3 5 2 5 Alternative Character Sets,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-4-28-integer-types}@anchor{215} +@anchor{gnat_rm/implementation_advice rm-3-5-4-28-integer-types}@anchor{219} @section RM 3.5.4(28): Integer Types @@ -13874,7 +14045,7 @@ are supported for convenient interface to C, and so that all hardware types of the machine are easily available. @node RM 3 5 4 29 Integer Types,RM 3 5 5 8 Enumeration Values,RM 3 5 4 28 Integer Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-4-29-integer-types}@anchor{216} +@anchor{gnat_rm/implementation_advice rm-3-5-4-29-integer-types}@anchor{21a} @section RM 3.5.4(29): Integer Types @@ -13890,7 +14061,7 @@ Followed. @geindex Enumeration values @node RM 3 5 5 8 Enumeration Values,RM 3 5 7 17 Float Types,RM 3 5 4 29 Integer Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-5-8-enumeration-values}@anchor{217} +@anchor{gnat_rm/implementation_advice rm-3-5-5-8-enumeration-values}@anchor{21b} @section RM 3.5.5(8): Enumeration Values @@ -13910,7 +14081,7 @@ Followed. @geindex Float types @node RM 3 5 7 17 Float Types,RM 3 6 2 11 Multidimensional Arrays,RM 3 5 5 8 Enumeration Values,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-7-17-float-types}@anchor{218} +@anchor{gnat_rm/implementation_advice rm-3-5-7-17-float-types}@anchor{21c} @section RM 3.5.7(17): Float Types @@ -13940,7 +14111,7 @@ since this is a software rather than a hardware format. @geindex multidimensional @node RM 3 6 2 11 Multidimensional Arrays,RM 9 6 30-31 Duration'Small,RM 3 5 7 17 Float Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-6-2-11-multidimensional-arrays}@anchor{219} +@anchor{gnat_rm/implementation_advice rm-3-6-2-11-multidimensional-arrays}@anchor{21d} @section RM 3.6.2(11): Multidimensional Arrays @@ -13958,7 +14129,7 @@ Followed. @geindex Duration'Small @node RM 9 6 30-31 Duration'Small,RM 10 2 1 12 Consistent Representation,RM 3 6 2 11 Multidimensional Arrays,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-9-6-30-31-duration-small}@anchor{21a} +@anchor{gnat_rm/implementation_advice rm-9-6-30-31-duration-small}@anchor{21e} @section RM 9.6(30-31): Duration'Small @@ -13979,7 +14150,7 @@ it need not be the same time base as used for @code{Calendar.Clock}." Followed. @node RM 10 2 1 12 Consistent Representation,RM 11 4 1 19 Exception Information,RM 9 6 30-31 Duration'Small,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-10-2-1-12-consistent-representation}@anchor{21b} +@anchor{gnat_rm/implementation_advice rm-10-2-1-12-consistent-representation}@anchor{21f} @section RM 10.2.1(12): Consistent Representation @@ -14001,7 +14172,7 @@ advice without severely impacting efficiency of execution. @geindex Exception information @node RM 11 4 1 19 Exception Information,RM 11 5 28 Suppression of Checks,RM 10 2 1 12 Consistent Representation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-11-4-1-19-exception-information}@anchor{21c} +@anchor{gnat_rm/implementation_advice rm-11-4-1-19-exception-information}@anchor{220} @section RM 11.4.1(19): Exception Information @@ -14032,7 +14203,7 @@ Pragma @code{Discard_Names}. @geindex suppression of @node RM 11 5 28 Suppression of Checks,RM 13 1 21-24 Representation Clauses,RM 11 4 1 19 Exception Information,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-11-5-28-suppression-of-checks}@anchor{21d} +@anchor{gnat_rm/implementation_advice rm-11-5-28-suppression-of-checks}@anchor{221} @section RM 11.5(28): Suppression of Checks @@ -14047,7 +14218,7 @@ Followed. @geindex Representation clauses @node RM 13 1 21-24 Representation Clauses,RM 13 2 6-8 Packed Types,RM 11 5 28 Suppression of Checks,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-1-21-24-representation-clauses}@anchor{21e} +@anchor{gnat_rm/implementation_advice rm-13-1-21-24-representation-clauses}@anchor{222} @section RM 13.1 (21-24): Representation Clauses @@ -14096,7 +14267,7 @@ Followed. @geindex Packed types @node RM 13 2 6-8 Packed Types,RM 13 3 14-19 Address Clauses,RM 13 1 21-24 Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-2-6-8-packed-types}@anchor{21f} +@anchor{gnat_rm/implementation_advice rm-13-2-6-8-packed-types}@anchor{223} @section RM 13.2(6-8): Packed Types @@ -14135,7 +14306,7 @@ Followed. @geindex Address clauses @node RM 13 3 14-19 Address Clauses,RM 13 3 29-35 Alignment Clauses,RM 13 2 6-8 Packed Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-14-19-address-clauses}@anchor{220} +@anchor{gnat_rm/implementation_advice rm-13-3-14-19-address-clauses}@anchor{224} @section RM 13.3(14-19): Address Clauses @@ -14188,7 +14359,7 @@ Followed. @geindex Alignment clauses @node RM 13 3 29-35 Alignment Clauses,RM 13 3 42-43 Size Clauses,RM 13 3 14-19 Address Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-29-35-alignment-clauses}@anchor{221} +@anchor{gnat_rm/implementation_advice rm-13-3-29-35-alignment-clauses}@anchor{225} @section RM 13.3(29-35): Alignment Clauses @@ -14245,7 +14416,7 @@ Followed. @geindex Size clauses @node RM 13 3 42-43 Size Clauses,RM 13 3 50-56 Size Clauses,RM 13 3 29-35 Alignment Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-42-43-size-clauses}@anchor{222} +@anchor{gnat_rm/implementation_advice rm-13-3-42-43-size-clauses}@anchor{226} @section RM 13.3(42-43): Size Clauses @@ -14263,7 +14434,7 @@ object's @code{Alignment} (if the @code{Alignment} is nonzero)." Followed. @node RM 13 3 50-56 Size Clauses,RM 13 3 71-73 Component Size Clauses,RM 13 3 42-43 Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-50-56-size-clauses}@anchor{223} +@anchor{gnat_rm/implementation_advice rm-13-3-50-56-size-clauses}@anchor{227} @section RM 13.3(50-56): Size Clauses @@ -14314,7 +14485,7 @@ Followed. @geindex Component_Size clauses @node RM 13 3 71-73 Component Size Clauses,RM 13 4 9-10 Enumeration Representation Clauses,RM 13 3 50-56 Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-71-73-component-size-clauses}@anchor{224} +@anchor{gnat_rm/implementation_advice rm-13-3-71-73-component-size-clauses}@anchor{228} @section RM 13.3(71-73): Component Size Clauses @@ -14348,7 +14519,7 @@ Followed. @geindex enumeration @node RM 13 4 9-10 Enumeration Representation Clauses,RM 13 5 1 17-22 Record Representation Clauses,RM 13 3 71-73 Component Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-4-9-10-enumeration-representation-clauses}@anchor{225} +@anchor{gnat_rm/implementation_advice rm-13-4-9-10-enumeration-representation-clauses}@anchor{229} @section RM 13.4(9-10): Enumeration Representation Clauses @@ -14370,7 +14541,7 @@ Followed. @geindex records @node RM 13 5 1 17-22 Record Representation Clauses,RM 13 5 2 5 Storage Place Attributes,RM 13 4 9-10 Enumeration Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-1-17-22-record-representation-clauses}@anchor{226} +@anchor{gnat_rm/implementation_advice rm-13-5-1-17-22-record-representation-clauses}@anchor{22a} @section RM 13.5.1(17-22): Record Representation Clauses @@ -14430,7 +14601,7 @@ and all mentioned features are implemented. @geindex Storage place attributes @node RM 13 5 2 5 Storage Place Attributes,RM 13 5 3 7-8 Bit Ordering,RM 13 5 1 17-22 Record Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-2-5-storage-place-attributes}@anchor{227} +@anchor{gnat_rm/implementation_advice rm-13-5-2-5-storage-place-attributes}@anchor{22b} @section RM 13.5.2(5): Storage Place Attributes @@ -14450,7 +14621,7 @@ Followed. There are no such components in GNAT. @geindex Bit ordering @node RM 13 5 3 7-8 Bit Ordering,RM 13 7 37 Address as Private,RM 13 5 2 5 Storage Place Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-3-7-8-bit-ordering}@anchor{228} +@anchor{gnat_rm/implementation_advice rm-13-5-3-7-8-bit-ordering}@anchor{22c} @section RM 13.5.3(7-8): Bit Ordering @@ -14470,7 +14641,7 @@ Thus non-default bit ordering is not supported. @geindex as private type @node RM 13 7 37 Address as Private,RM 13 7 1 16 Address Operations,RM 13 5 3 7-8 Bit Ordering,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-7-37-address-as-private}@anchor{229} +@anchor{gnat_rm/implementation_advice rm-13-7-37-address-as-private}@anchor{22d} @section RM 13.7(37): Address as Private @@ -14488,7 +14659,7 @@ Followed. @geindex operations of @node RM 13 7 1 16 Address Operations,RM 13 9 14-17 Unchecked Conversion,RM 13 7 37 Address as Private,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-7-1-16-address-operations}@anchor{22a} +@anchor{gnat_rm/implementation_advice rm-13-7-1-16-address-operations}@anchor{22e} @section RM 13.7.1(16): Address Operations @@ -14506,7 +14677,7 @@ operation raises @code{Program_Error}, since all operations make sense. @geindex Unchecked conversion @node RM 13 9 14-17 Unchecked Conversion,RM 13 11 23-25 Implicit Heap Usage,RM 13 7 1 16 Address Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-9-14-17-unchecked-conversion}@anchor{22b} +@anchor{gnat_rm/implementation_advice rm-13-9-14-17-unchecked-conversion}@anchor{22f} @section RM 13.9(14-17): Unchecked Conversion @@ -14550,7 +14721,7 @@ Followed. @geindex implicit @node RM 13 11 23-25 Implicit Heap Usage,RM 13 11 2 17 Unchecked Deallocation,RM 13 9 14-17 Unchecked Conversion,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-11-23-25-implicit-heap-usage}@anchor{22c} +@anchor{gnat_rm/implementation_advice rm-13-11-23-25-implicit-heap-usage}@anchor{230} @section RM 13.11(23-25): Implicit Heap Usage @@ -14601,7 +14772,7 @@ Followed. @geindex Unchecked deallocation @node RM 13 11 2 17 Unchecked Deallocation,RM 13 13 2 17 Stream Oriented Attributes,RM 13 11 23-25 Implicit Heap Usage,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-11-2-17-unchecked-deallocation}@anchor{22d} +@anchor{gnat_rm/implementation_advice rm-13-11-2-17-unchecked-deallocation}@anchor{231} @section RM 13.11.2(17): Unchecked Deallocation @@ -14616,7 +14787,7 @@ Followed. @geindex Stream oriented attributes @node RM 13 13 2 17 Stream Oriented Attributes,RM A 1 52 Names of Predefined Numeric Types,RM 13 11 2 17 Unchecked Deallocation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-13-2-17-stream-oriented-attributes}@anchor{22e} +@anchor{gnat_rm/implementation_advice rm-13-13-2-17-stream-oriented-attributes}@anchor{232} @section RM 13.13.2(17): Stream Oriented Attributes @@ -14671,7 +14842,7 @@ the @emph{GNAT and Libraries} section of the @cite{GNAT User's Guide}. @end itemize @node RM A 1 52 Names of Predefined Numeric Types,RM A 3 2 49 Ada Characters Handling,RM 13 13 2 17 Stream Oriented Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-1-52-names-of-predefined-numeric-types}@anchor{22f} +@anchor{gnat_rm/implementation_advice rm-a-1-52-names-of-predefined-numeric-types}@anchor{233} @section RM A.1(52): Names of Predefined Numeric Types @@ -14689,7 +14860,7 @@ Followed. @geindex Ada.Characters.Handling @node RM A 3 2 49 Ada Characters Handling,RM A 4 4 106 Bounded-Length String Handling,RM A 1 52 Names of Predefined Numeric Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-3-2-49-ada-characters-handling}@anchor{230} +@anchor{gnat_rm/implementation_advice rm-a-3-2-49-ada-characters-handling}@anchor{234} @section RM A.3.2(49): @code{Ada.Characters.Handling} @@ -14706,7 +14877,7 @@ Followed. GNAT provides no such localized definitions. @geindex Bounded-length strings @node RM A 4 4 106 Bounded-Length String Handling,RM A 5 2 46-47 Random Number Generation,RM A 3 2 49 Ada Characters Handling,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-4-4-106-bounded-length-string-handling}@anchor{231} +@anchor{gnat_rm/implementation_advice rm-a-4-4-106-bounded-length-string-handling}@anchor{235} @section RM A.4.4(106): Bounded-Length String Handling @@ -14721,7 +14892,7 @@ Followed. No implicit pointers or dynamic allocation are used. @geindex Random number generation @node RM A 5 2 46-47 Random Number Generation,RM A 10 7 23 Get_Immediate,RM A 4 4 106 Bounded-Length String Handling,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-5-2-46-47-random-number-generation}@anchor{232} +@anchor{gnat_rm/implementation_advice rm-a-5-2-46-47-random-number-generation}@anchor{236} @section RM A.5.2(46-47): Random Number Generation @@ -14750,7 +14921,7 @@ condition here to hold true. @geindex Get_Immediate @node RM A 10 7 23 Get_Immediate,RM B 1 39-41 Pragma Export,RM A 5 2 46-47 Random Number Generation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-10-7-23-get-immediate}@anchor{233} +@anchor{gnat_rm/implementation_advice rm-a-10-7-23-get-immediate}@anchor{237} @section RM A.10.7(23): @code{Get_Immediate} @@ -14774,7 +14945,7 @@ this functionality. @geindex Export @node RM B 1 39-41 Pragma Export,RM B 2 12-13 Package Interfaces,RM A 10 7 23 Get_Immediate,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-1-39-41-pragma-export}@anchor{234} +@anchor{gnat_rm/implementation_advice rm-b-1-39-41-pragma-export}@anchor{238} @section RM B.1(39-41): Pragma @code{Export} @@ -14822,7 +14993,7 @@ Followed. @geindex Interfaces @node RM B 2 12-13 Package Interfaces,RM B 3 63-71 Interfacing with C,RM B 1 39-41 Pragma Export,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-2-12-13-package-interfaces}@anchor{235} +@anchor{gnat_rm/implementation_advice rm-b-2-12-13-package-interfaces}@anchor{239} @section RM B.2(12-13): Package @code{Interfaces} @@ -14852,7 +15023,7 @@ Followed. GNAT provides all the packages described in this section. @geindex interfacing with @node RM B 3 63-71 Interfacing with C,RM B 4 95-98 Interfacing with COBOL,RM B 2 12-13 Package Interfaces,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-3-63-71-interfacing-with-c}@anchor{236} +@anchor{gnat_rm/implementation_advice rm-b-3-63-71-interfacing-with-c}@anchor{23a} @section RM B.3(63-71): Interfacing with C @@ -14940,7 +15111,7 @@ Followed. @geindex interfacing with @node RM B 4 95-98 Interfacing with COBOL,RM B 5 22-26 Interfacing with Fortran,RM B 3 63-71 Interfacing with C,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-4-95-98-interfacing-with-cobol}@anchor{237} +@anchor{gnat_rm/implementation_advice rm-b-4-95-98-interfacing-with-cobol}@anchor{23b} @section RM B.4(95-98): Interfacing with COBOL @@ -14981,7 +15152,7 @@ Followed. @geindex interfacing with @node RM B 5 22-26 Interfacing with Fortran,RM C 1 3-5 Access to Machine Operations,RM B 4 95-98 Interfacing with COBOL,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-5-22-26-interfacing-with-fortran}@anchor{238} +@anchor{gnat_rm/implementation_advice rm-b-5-22-26-interfacing-with-fortran}@anchor{23c} @section RM B.5(22-26): Interfacing with Fortran @@ -15032,7 +15203,7 @@ Followed. @geindex Machine operations @node RM C 1 3-5 Access to Machine Operations,RM C 1 10-16 Access to Machine Operations,RM B 5 22-26 Interfacing with Fortran,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-1-3-5-access-to-machine-operations}@anchor{239} +@anchor{gnat_rm/implementation_advice rm-c-1-3-5-access-to-machine-operations}@anchor{23d} @section RM C.1(3-5): Access to Machine Operations @@ -15067,7 +15238,7 @@ object that is specified as exported." Followed. @node RM C 1 10-16 Access to Machine Operations,RM C 3 28 Interrupt Support,RM C 1 3-5 Access to Machine Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-1-10-16-access-to-machine-operations}@anchor{23a} +@anchor{gnat_rm/implementation_advice rm-c-1-10-16-access-to-machine-operations}@anchor{23e} @section RM C.1(10-16): Access to Machine Operations @@ -15128,7 +15299,7 @@ Followed on any target supporting such operations. @geindex Interrupt support @node RM C 3 28 Interrupt Support,RM C 3 1 20-21 Protected Procedure Handlers,RM C 1 10-16 Access to Machine Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-28-interrupt-support}@anchor{23b} +@anchor{gnat_rm/implementation_advice rm-c-3-28-interrupt-support}@anchor{23f} @section RM C.3(28): Interrupt Support @@ -15146,7 +15317,7 @@ of interrupt blocking. @geindex Protected procedure handlers @node RM C 3 1 20-21 Protected Procedure Handlers,RM C 3 2 25 Package Interrupts,RM C 3 28 Interrupt Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-1-20-21-protected-procedure-handlers}@anchor{23c} +@anchor{gnat_rm/implementation_advice rm-c-3-1-20-21-protected-procedure-handlers}@anchor{240} @section RM C.3.1(20-21): Protected Procedure Handlers @@ -15172,7 +15343,7 @@ Followed. Compile time warnings are given when possible. @geindex Interrupts @node RM C 3 2 25 Package Interrupts,RM C 4 14 Pre-elaboration Requirements,RM C 3 1 20-21 Protected Procedure Handlers,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-2-25-package-interrupts}@anchor{23d} +@anchor{gnat_rm/implementation_advice rm-c-3-2-25-package-interrupts}@anchor{241} @section RM C.3.2(25): Package @code{Interrupts} @@ -15190,7 +15361,7 @@ Followed. @geindex Pre-elaboration requirements @node RM C 4 14 Pre-elaboration Requirements,RM C 5 8 Pragma Discard_Names,RM C 3 2 25 Package Interrupts,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-4-14-pre-elaboration-requirements}@anchor{23e} +@anchor{gnat_rm/implementation_advice rm-c-4-14-pre-elaboration-requirements}@anchor{242} @section RM C.4(14): Pre-elaboration Requirements @@ -15206,7 +15377,7 @@ Followed. Executable code is generated in some cases, e.g., loops to initialize large arrays. @node RM C 5 8 Pragma Discard_Names,RM C 7 2 30 The Package Task_Attributes,RM C 4 14 Pre-elaboration Requirements,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-5-8-pragma-discard-names}@anchor{23f} +@anchor{gnat_rm/implementation_advice rm-c-5-8-pragma-discard-names}@anchor{243} @section RM C.5(8): Pragma @code{Discard_Names} @@ -15224,7 +15395,7 @@ Followed. @geindex Task_Attributes @node RM C 7 2 30 The Package Task_Attributes,RM D 3 17 Locking Policies,RM C 5 8 Pragma Discard_Names,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-7-2-30-the-package-task-attributes}@anchor{240} +@anchor{gnat_rm/implementation_advice rm-c-7-2-30-the-package-task-attributes}@anchor{244} @section RM C.7.2(30): The Package Task_Attributes @@ -15245,7 +15416,7 @@ Not followed. This implementation is not targeted to such a domain. @geindex Locking Policies @node RM D 3 17 Locking Policies,RM D 4 16 Entry Queuing Policies,RM C 7 2 30 The Package Task_Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-3-17-locking-policies}@anchor{241} +@anchor{gnat_rm/implementation_advice rm-d-3-17-locking-policies}@anchor{245} @section RM D.3(17): Locking Policies @@ -15262,7 +15433,7 @@ whose names (@code{Inheritance_Locking} and @geindex Entry queuing policies @node RM D 4 16 Entry Queuing Policies,RM D 6 9-10 Preemptive Abort,RM D 3 17 Locking Policies,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-4-16-entry-queuing-policies}@anchor{242} +@anchor{gnat_rm/implementation_advice rm-d-4-16-entry-queuing-policies}@anchor{246} @section RM D.4(16): Entry Queuing Policies @@ -15277,7 +15448,7 @@ Followed. No such implementation-defined queuing policies exist. @geindex Preemptive abort @node RM D 6 9-10 Preemptive Abort,RM D 7 21 Tasking Restrictions,RM D 4 16 Entry Queuing Policies,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-6-9-10-preemptive-abort}@anchor{243} +@anchor{gnat_rm/implementation_advice rm-d-6-9-10-preemptive-abort}@anchor{247} @section RM D.6(9-10): Preemptive Abort @@ -15303,7 +15474,7 @@ Followed. @geindex Tasking restrictions @node RM D 7 21 Tasking Restrictions,RM D 8 47-49 Monotonic Time,RM D 6 9-10 Preemptive Abort,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-7-21-tasking-restrictions}@anchor{244} +@anchor{gnat_rm/implementation_advice rm-d-7-21-tasking-restrictions}@anchor{248} @section RM D.7(21): Tasking Restrictions @@ -15322,7 +15493,7 @@ pragma @code{Profile (Restricted)} for more details. @geindex monotonic @node RM D 8 47-49 Monotonic Time,RM E 5 28-29 Partition Communication Subsystem,RM D 7 21 Tasking Restrictions,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-8-47-49-monotonic-time}@anchor{245} +@anchor{gnat_rm/implementation_advice rm-d-8-47-49-monotonic-time}@anchor{249} @section RM D.8(47-49): Monotonic Time @@ -15357,7 +15528,7 @@ Followed. @geindex PCS @node RM E 5 28-29 Partition Communication Subsystem,RM F 7 COBOL Support,RM D 8 47-49 Monotonic Time,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-e-5-28-29-partition-communication-subsystem}@anchor{246} +@anchor{gnat_rm/implementation_advice rm-e-5-28-29-partition-communication-subsystem}@anchor{24a} @section RM E.5(28-29): Partition Communication Subsystem @@ -15385,7 +15556,7 @@ GNAT. @geindex COBOL support @node RM F 7 COBOL Support,RM F 1 2 Decimal Radix Support,RM E 5 28-29 Partition Communication Subsystem,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-f-7-cobol-support}@anchor{247} +@anchor{gnat_rm/implementation_advice rm-f-7-cobol-support}@anchor{24b} @section RM F(7): COBOL Support @@ -15405,7 +15576,7 @@ Followed. @geindex Decimal radix support @node RM F 1 2 Decimal Radix Support,RM G Numerics,RM F 7 COBOL Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-f-1-2-decimal-radix-support}@anchor{248} +@anchor{gnat_rm/implementation_advice rm-f-1-2-decimal-radix-support}@anchor{24c} @section RM F.1(2): Decimal Radix Support @@ -15421,7 +15592,7 @@ representations. @geindex Numerics @node RM G Numerics,RM G 1 1 56-58 Complex Types,RM F 1 2 Decimal Radix Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-numerics}@anchor{249} +@anchor{gnat_rm/implementation_advice rm-g-numerics}@anchor{24d} @section RM G: Numerics @@ -15441,7 +15612,7 @@ Followed. @geindex Complex types @node RM G 1 1 56-58 Complex Types,RM G 1 2 49 Complex Elementary Functions,RM G Numerics,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-1-1-56-58-complex-types}@anchor{24a} +@anchor{gnat_rm/implementation_advice rm-g-1-1-56-58-complex-types}@anchor{24e} @section RM G.1.1(56-58): Complex Types @@ -15503,7 +15674,7 @@ Followed. @geindex Complex elementary functions @node RM G 1 2 49 Complex Elementary Functions,RM G 2 4 19 Accuracy Requirements,RM G 1 1 56-58 Complex Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-1-2-49-complex-elementary-functions}@anchor{24b} +@anchor{gnat_rm/implementation_advice rm-g-1-2-49-complex-elementary-functions}@anchor{24f} @section RM G.1.2(49): Complex Elementary Functions @@ -15525,7 +15696,7 @@ Followed. @geindex Accuracy requirements @node RM G 2 4 19 Accuracy Requirements,RM G 2 6 15 Complex Arithmetic Accuracy,RM G 1 2 49 Complex Elementary Functions,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-2-4-19-accuracy-requirements}@anchor{24c} +@anchor{gnat_rm/implementation_advice rm-g-2-4-19-accuracy-requirements}@anchor{250} @section RM G.2.4(19): Accuracy Requirements @@ -15549,7 +15720,7 @@ Followed. @geindex complex arithmetic @node RM G 2 6 15 Complex Arithmetic Accuracy,RM H 6 15/2 Pragma Partition_Elaboration_Policy,RM G 2 4 19 Accuracy Requirements,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-2-6-15-complex-arithmetic-accuracy}@anchor{24d} +@anchor{gnat_rm/implementation_advice rm-g-2-6-15-complex-arithmetic-accuracy}@anchor{251} @section RM G.2.6(15): Complex Arithmetic Accuracy @@ -15567,7 +15738,7 @@ Followed. @geindex Sequential elaboration policy @node RM H 6 15/2 Pragma Partition_Elaboration_Policy,,RM G 2 6 15 Complex Arithmetic Accuracy,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-h-6-15-2-pragma-partition-elaboration-policy}@anchor{24e} +@anchor{gnat_rm/implementation_advice rm-h-6-15-2-pragma-partition-elaboration-policy}@anchor{252} @section RM H.6(15/2): Pragma Partition_Elaboration_Policy @@ -15582,7 +15753,7 @@ immediately terminated." Not followed. @node Implementation Defined Characteristics,Intrinsic Subprograms,Implementation Advice,Top -@anchor{gnat_rm/implementation_defined_characteristics implementation-defined-characteristics}@anchor{b}@anchor{gnat_rm/implementation_defined_characteristics doc}@anchor{24f}@anchor{gnat_rm/implementation_defined_characteristics id1}@anchor{250} +@anchor{gnat_rm/implementation_defined_characteristics implementation-defined-characteristics}@anchor{b}@anchor{gnat_rm/implementation_defined_characteristics doc}@anchor{253}@anchor{gnat_rm/implementation_defined_characteristics id1}@anchor{254} @chapter Implementation Defined Characteristics @@ -16778,7 +16949,7 @@ When the @code{Pattern} parameter is not the null string, it is interpreted according to the syntax of regular expressions as defined in the @code{GNAT.Regexp} package. -See @ref{251,,GNAT.Regexp (g-regexp.ads)}. +See @ref{255,,GNAT.Regexp (g-regexp.ads)}. @itemize * @@ -17827,7 +17998,7 @@ H.4(27)." There are no restrictions on pragma @code{Restrictions}. @node Intrinsic Subprograms,Representation Clauses and Pragmas,Implementation Defined Characteristics,Top -@anchor{gnat_rm/intrinsic_subprograms doc}@anchor{252}@anchor{gnat_rm/intrinsic_subprograms intrinsic-subprograms}@anchor{c}@anchor{gnat_rm/intrinsic_subprograms id1}@anchor{253} +@anchor{gnat_rm/intrinsic_subprograms doc}@anchor{256}@anchor{gnat_rm/intrinsic_subprograms intrinsic-subprograms}@anchor{c}@anchor{gnat_rm/intrinsic_subprograms id1}@anchor{257} @chapter Intrinsic Subprograms @@ -17865,7 +18036,7 @@ Ada standard does not require Ada compilers to implement this feature. @end menu @node Intrinsic Operators,Compilation_ISO_Date,,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id2}@anchor{254}@anchor{gnat_rm/intrinsic_subprograms intrinsic-operators}@anchor{255} +@anchor{gnat_rm/intrinsic_subprograms id2}@anchor{258}@anchor{gnat_rm/intrinsic_subprograms intrinsic-operators}@anchor{259} @section Intrinsic Operators @@ -17896,7 +18067,7 @@ It is also possible to specify such operators for private types, if the full views are appropriate arithmetic types. @node Compilation_ISO_Date,Compilation_Date,Intrinsic Operators,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id3}@anchor{256}@anchor{gnat_rm/intrinsic_subprograms compilation-iso-date}@anchor{257} +@anchor{gnat_rm/intrinsic_subprograms id3}@anchor{25a}@anchor{gnat_rm/intrinsic_subprograms compilation-iso-date}@anchor{25b} @section Compilation_ISO_Date @@ -17910,7 +18081,7 @@ application program should simply call the function the current compilation (in local time format YYYY-MM-DD). @node Compilation_Date,Compilation_Time,Compilation_ISO_Date,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms compilation-date}@anchor{258}@anchor{gnat_rm/intrinsic_subprograms id4}@anchor{259} +@anchor{gnat_rm/intrinsic_subprograms compilation-date}@anchor{25c}@anchor{gnat_rm/intrinsic_subprograms id4}@anchor{25d} @section Compilation_Date @@ -17920,7 +18091,7 @@ Same as Compilation_ISO_Date, except the string is in the form MMM DD YYYY. @node Compilation_Time,Enclosing_Entity,Compilation_Date,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms compilation-time}@anchor{25a}@anchor{gnat_rm/intrinsic_subprograms id5}@anchor{25b} +@anchor{gnat_rm/intrinsic_subprograms compilation-time}@anchor{25e}@anchor{gnat_rm/intrinsic_subprograms id5}@anchor{25f} @section Compilation_Time @@ -17934,7 +18105,7 @@ application program should simply call the function the current compilation (in local time format HH:MM:SS). @node Enclosing_Entity,Exception_Information,Compilation_Time,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id6}@anchor{25c}@anchor{gnat_rm/intrinsic_subprograms enclosing-entity}@anchor{25d} +@anchor{gnat_rm/intrinsic_subprograms id6}@anchor{260}@anchor{gnat_rm/intrinsic_subprograms enclosing-entity}@anchor{261} @section Enclosing_Entity @@ -17948,7 +18119,7 @@ application program should simply call the function the current subprogram, package, task, entry, or protected subprogram. @node Exception_Information,Exception_Message,Enclosing_Entity,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id7}@anchor{25e}@anchor{gnat_rm/intrinsic_subprograms exception-information}@anchor{25f} +@anchor{gnat_rm/intrinsic_subprograms id7}@anchor{262}@anchor{gnat_rm/intrinsic_subprograms exception-information}@anchor{263} @section Exception_Information @@ -17962,7 +18133,7 @@ so an application program should simply call the function the exception information associated with the current exception. @node Exception_Message,Exception_Name,Exception_Information,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms exception-message}@anchor{260}@anchor{gnat_rm/intrinsic_subprograms id8}@anchor{261} +@anchor{gnat_rm/intrinsic_subprograms exception-message}@anchor{264}@anchor{gnat_rm/intrinsic_subprograms id8}@anchor{265} @section Exception_Message @@ -17976,7 +18147,7 @@ so an application program should simply call the function the message associated with the current exception. @node Exception_Name,File,Exception_Message,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms exception-name}@anchor{262}@anchor{gnat_rm/intrinsic_subprograms id9}@anchor{263} +@anchor{gnat_rm/intrinsic_subprograms exception-name}@anchor{266}@anchor{gnat_rm/intrinsic_subprograms id9}@anchor{267} @section Exception_Name @@ -17990,7 +18161,7 @@ so an application program should simply call the function the name of the current exception. @node File,Line,Exception_Name,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id10}@anchor{264}@anchor{gnat_rm/intrinsic_subprograms file}@anchor{265} +@anchor{gnat_rm/intrinsic_subprograms id10}@anchor{268}@anchor{gnat_rm/intrinsic_subprograms file}@anchor{269} @section File @@ -18004,7 +18175,7 @@ application program should simply call the function file. @node Line,Shifts and Rotates,File,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id11}@anchor{266}@anchor{gnat_rm/intrinsic_subprograms line}@anchor{267} +@anchor{gnat_rm/intrinsic_subprograms id11}@anchor{26a}@anchor{gnat_rm/intrinsic_subprograms line}@anchor{26b} @section Line @@ -18018,7 +18189,7 @@ application program should simply call the function source line. @node Shifts and Rotates,Source_Location,Line,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms shifts-and-rotates}@anchor{268}@anchor{gnat_rm/intrinsic_subprograms id12}@anchor{269} +@anchor{gnat_rm/intrinsic_subprograms shifts-and-rotates}@anchor{26c}@anchor{gnat_rm/intrinsic_subprograms id12}@anchor{26d} @section Shifts and Rotates @@ -18057,7 +18228,7 @@ the Provide_Shift_Operators pragma, which provides the function declarations and corresponding pragma Import's for all five shift functions. @node Source_Location,,Shifts and Rotates,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms source-location}@anchor{26a}@anchor{gnat_rm/intrinsic_subprograms id13}@anchor{26b} +@anchor{gnat_rm/intrinsic_subprograms source-location}@anchor{26e}@anchor{gnat_rm/intrinsic_subprograms id13}@anchor{26f} @section Source_Location @@ -18071,7 +18242,7 @@ application program should simply call the function source file location. @node Representation Clauses and Pragmas,Standard Library Routines,Intrinsic Subprograms,Top -@anchor{gnat_rm/representation_clauses_and_pragmas representation-clauses-and-pragmas}@anchor{d}@anchor{gnat_rm/representation_clauses_and_pragmas doc}@anchor{26c}@anchor{gnat_rm/representation_clauses_and_pragmas id1}@anchor{26d} +@anchor{gnat_rm/representation_clauses_and_pragmas representation-clauses-and-pragmas}@anchor{d}@anchor{gnat_rm/representation_clauses_and_pragmas doc}@anchor{270}@anchor{gnat_rm/representation_clauses_and_pragmas id1}@anchor{271} @chapter Representation Clauses and Pragmas @@ -18117,7 +18288,7 @@ and this section describes the additional capabilities provided. @end menu @node Alignment Clauses,Size Clauses,,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id2}@anchor{26e}@anchor{gnat_rm/representation_clauses_and_pragmas alignment-clauses}@anchor{26f} +@anchor{gnat_rm/representation_clauses_and_pragmas id2}@anchor{272}@anchor{gnat_rm/representation_clauses_and_pragmas alignment-clauses}@anchor{273} @section Alignment Clauses @@ -18137,7 +18308,7 @@ For elementary types, the alignment is the minimum of the actual size of objects of the type divided by @code{Storage_Unit}, and the maximum alignment supported by the target. (This maximum alignment is given by the GNAT-specific attribute -@code{Standard'Maximum_Alignment}; see @ref{189,,Attribute Maximum_Alignment}.) +@code{Standard'Maximum_Alignment}; see @ref{18d,,Attribute Maximum_Alignment}.) @geindex Maximum_Alignment attribute @@ -18246,7 +18417,7 @@ assumption is non-portable, and other compilers may choose different alignments for the subtype @code{RS}. @node Size Clauses,Storage_Size Clauses,Alignment Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id3}@anchor{270}@anchor{gnat_rm/representation_clauses_and_pragmas size-clauses}@anchor{271} +@anchor{gnat_rm/representation_clauses_and_pragmas id3}@anchor{274}@anchor{gnat_rm/representation_clauses_and_pragmas size-clauses}@anchor{275} @section Size Clauses @@ -18323,7 +18494,7 @@ if it is known that a Size value can be accommodated in an object of type Integer. @node Storage_Size Clauses,Size of Variant Record Objects,Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas storage-size-clauses}@anchor{272}@anchor{gnat_rm/representation_clauses_and_pragmas id4}@anchor{273} +@anchor{gnat_rm/representation_clauses_and_pragmas storage-size-clauses}@anchor{276}@anchor{gnat_rm/representation_clauses_and_pragmas id4}@anchor{277} @section Storage_Size Clauses @@ -18396,7 +18567,7 @@ Of course in practice, there will not be any explicit allocators in the case of such an access declaration. @node Size of Variant Record Objects,Biased Representation,Storage_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id5}@anchor{274}@anchor{gnat_rm/representation_clauses_and_pragmas size-of-variant-record-objects}@anchor{275} +@anchor{gnat_rm/representation_clauses_and_pragmas id5}@anchor{278}@anchor{gnat_rm/representation_clauses_and_pragmas size-of-variant-record-objects}@anchor{279} @section Size of Variant Record Objects @@ -18506,7 +18677,7 @@ the maximum size, regardless of the current variant value, the variant value. @node Biased Representation,Value_Size and Object_Size Clauses,Size of Variant Record Objects,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id6}@anchor{276}@anchor{gnat_rm/representation_clauses_and_pragmas biased-representation}@anchor{277} +@anchor{gnat_rm/representation_clauses_and_pragmas id6}@anchor{27a}@anchor{gnat_rm/representation_clauses_and_pragmas biased-representation}@anchor{27b} @section Biased Representation @@ -18544,7 +18715,7 @@ biased representation can be used for all discrete types except for enumeration types for which a representation clause is given. @node Value_Size and Object_Size Clauses,Component_Size Clauses,Biased Representation,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id7}@anchor{278}@anchor{gnat_rm/representation_clauses_and_pragmas value-size-and-object-size-clauses}@anchor{279} +@anchor{gnat_rm/representation_clauses_and_pragmas id7}@anchor{27c}@anchor{gnat_rm/representation_clauses_and_pragmas value-size-and-object-size-clauses}@anchor{27d} @section Value_Size and Object_Size Clauses @@ -18851,7 +19022,7 @@ definition clause forces biased representation. This warning can be turned off using @code{-gnatw.B}. @node Component_Size Clauses,Bit_Order Clauses,Value_Size and Object_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id8}@anchor{27a}@anchor{gnat_rm/representation_clauses_and_pragmas component-size-clauses}@anchor{27b} +@anchor{gnat_rm/representation_clauses_and_pragmas id8}@anchor{27e}@anchor{gnat_rm/representation_clauses_and_pragmas component-size-clauses}@anchor{27f} @section Component_Size Clauses @@ -18898,7 +19069,7 @@ and a pragma Pack for the same array type. if such duplicate clauses are given, the pragma Pack will be ignored. @node Bit_Order Clauses,Effect of Bit_Order on Byte Ordering,Component_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas bit-order-clauses}@anchor{27c}@anchor{gnat_rm/representation_clauses_and_pragmas id9}@anchor{27d} +@anchor{gnat_rm/representation_clauses_and_pragmas bit-order-clauses}@anchor{280}@anchor{gnat_rm/representation_clauses_and_pragmas id9}@anchor{281} @section Bit_Order Clauses @@ -19004,7 +19175,7 @@ if desired. The following section contains additional details regarding the issue of byte ordering. @node Effect of Bit_Order on Byte Ordering,Pragma Pack for Arrays,Bit_Order Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id10}@anchor{27e}@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-bit-order-on-byte-ordering}@anchor{27f} +@anchor{gnat_rm/representation_clauses_and_pragmas id10}@anchor{282}@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-bit-order-on-byte-ordering}@anchor{283} @section Effect of Bit_Order on Byte Ordering @@ -19261,7 +19432,7 @@ to set the boolean constant @code{Master_Byte_First} in an appropriate manner. @node Pragma Pack for Arrays,Pragma Pack for Records,Effect of Bit_Order on Byte Ordering,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-arrays}@anchor{280}@anchor{gnat_rm/representation_clauses_and_pragmas id11}@anchor{281} +@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-arrays}@anchor{284}@anchor{gnat_rm/representation_clauses_and_pragmas id11}@anchor{285} @section Pragma Pack for Arrays @@ -19378,7 +19549,7 @@ Here 31-bit packing is achieved as required, and no warning is generated, since in this case the programmer intention is clear. @node Pragma Pack for Records,Record Representation Clauses,Pragma Pack for Arrays,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-records}@anchor{282}@anchor{gnat_rm/representation_clauses_and_pragmas id12}@anchor{283} +@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-records}@anchor{286}@anchor{gnat_rm/representation_clauses_and_pragmas id12}@anchor{287} @section Pragma Pack for Records @@ -19463,7 +19634,7 @@ the @code{L6} field is aligned to the next byte boundary, and takes an integral number of bytes, i.e., 72 bits. @node Record Representation Clauses,Handling of Records with Holes,Pragma Pack for Records,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id13}@anchor{284}@anchor{gnat_rm/representation_clauses_and_pragmas record-representation-clauses}@anchor{285} +@anchor{gnat_rm/representation_clauses_and_pragmas id13}@anchor{288}@anchor{gnat_rm/representation_clauses_and_pragmas record-representation-clauses}@anchor{289} @section Record Representation Clauses @@ -19541,7 +19712,7 @@ end record; @end example @node Handling of Records with Holes,Enumeration Clauses,Record Representation Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas handling-of-records-with-holes}@anchor{286}@anchor{gnat_rm/representation_clauses_and_pragmas id14}@anchor{287} +@anchor{gnat_rm/representation_clauses_and_pragmas handling-of-records-with-holes}@anchor{28a}@anchor{gnat_rm/representation_clauses_and_pragmas id14}@anchor{28b} @section Handling of Records with Holes @@ -19618,7 +19789,7 @@ for Hrec'Size use 64; @end example @node Enumeration Clauses,Address Clauses,Handling of Records with Holes,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas enumeration-clauses}@anchor{288}@anchor{gnat_rm/representation_clauses_and_pragmas id15}@anchor{289} +@anchor{gnat_rm/representation_clauses_and_pragmas enumeration-clauses}@anchor{28c}@anchor{gnat_rm/representation_clauses_and_pragmas id15}@anchor{28d} @section Enumeration Clauses @@ -19661,7 +19832,7 @@ the overhead of converting representation values to the corresponding positional values, (i.e., the value delivered by the @code{Pos} attribute). @node Address Clauses,Use of Address Clauses for Memory-Mapped I/O,Enumeration Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id16}@anchor{28a}@anchor{gnat_rm/representation_clauses_and_pragmas address-clauses}@anchor{28b} +@anchor{gnat_rm/representation_clauses_and_pragmas id16}@anchor{28e}@anchor{gnat_rm/representation_clauses_and_pragmas address-clauses}@anchor{28f} @section Address Clauses @@ -19990,7 +20161,7 @@ then the program compiles without the warning and when run will generate the output @code{X was not clobbered}. @node Use of Address Clauses for Memory-Mapped I/O,Effect of Convention on Representation,Address Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id17}@anchor{28c}@anchor{gnat_rm/representation_clauses_and_pragmas use-of-address-clauses-for-memory-mapped-i-o}@anchor{28d} +@anchor{gnat_rm/representation_clauses_and_pragmas id17}@anchor{290}@anchor{gnat_rm/representation_clauses_and_pragmas use-of-address-clauses-for-memory-mapped-i-o}@anchor{291} @section Use of Address Clauses for Memory-Mapped I/O @@ -20048,7 +20219,7 @@ provides the pragma @code{Volatile_Full_Access} which can be used in lieu of pragma @code{Atomic} and will give the additional guarantee. @node Effect of Convention on Representation,Conventions and Anonymous Access Types,Use of Address Clauses for Memory-Mapped I/O,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id18}@anchor{28e}@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-convention-on-representation}@anchor{28f} +@anchor{gnat_rm/representation_clauses_and_pragmas id18}@anchor{292}@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-convention-on-representation}@anchor{293} @section Effect of Convention on Representation @@ -20126,7 +20297,7 @@ when one of these values is read, any nonzero value is treated as True. @end itemize @node Conventions and Anonymous Access Types,Determining the Representations chosen by GNAT,Effect of Convention on Representation,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas conventions-and-anonymous-access-types}@anchor{290}@anchor{gnat_rm/representation_clauses_and_pragmas id19}@anchor{291} +@anchor{gnat_rm/representation_clauses_and_pragmas conventions-and-anonymous-access-types}@anchor{294}@anchor{gnat_rm/representation_clauses_and_pragmas id19}@anchor{295} @section Conventions and Anonymous Access Types @@ -20202,7 +20373,7 @@ package ConvComp is @end example @node Determining the Representations chosen by GNAT,,Conventions and Anonymous Access Types,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id20}@anchor{292}@anchor{gnat_rm/representation_clauses_and_pragmas determining-the-representations-chosen-by-gnat}@anchor{293} +@anchor{gnat_rm/representation_clauses_and_pragmas id20}@anchor{296}@anchor{gnat_rm/representation_clauses_and_pragmas determining-the-representations-chosen-by-gnat}@anchor{297} @section Determining the Representations chosen by GNAT @@ -20354,7 +20525,7 @@ generated by the compiler into the original source to fix and guarantee the actual representation to be used. @node Standard Library Routines,The Implementation of Standard I/O,Representation Clauses and Pragmas,Top -@anchor{gnat_rm/standard_library_routines standard-library-routines}@anchor{e}@anchor{gnat_rm/standard_library_routines doc}@anchor{294}@anchor{gnat_rm/standard_library_routines id1}@anchor{295} +@anchor{gnat_rm/standard_library_routines standard-library-routines}@anchor{e}@anchor{gnat_rm/standard_library_routines doc}@anchor{298}@anchor{gnat_rm/standard_library_routines id1}@anchor{299} @chapter Standard Library Routines @@ -21178,7 +21349,7 @@ For packages in Interfaces and System, all the RM defined packages are available in GNAT, see the Ada 2012 RM for full details. @node The Implementation of Standard I/O,The GNAT Library,Standard Library Routines,Top -@anchor{gnat_rm/the_implementation_of_standard_i_o the-implementation-of-standard-i-o}@anchor{f}@anchor{gnat_rm/the_implementation_of_standard_i_o doc}@anchor{296}@anchor{gnat_rm/the_implementation_of_standard_i_o id1}@anchor{297} +@anchor{gnat_rm/the_implementation_of_standard_i_o the-implementation-of-standard-i-o}@anchor{f}@anchor{gnat_rm/the_implementation_of_standard_i_o doc}@anchor{29a}@anchor{gnat_rm/the_implementation_of_standard_i_o id1}@anchor{29b} @chapter The Implementation of Standard I/O @@ -21230,7 +21401,7 @@ these additional facilities are also described in this chapter. @end menu @node Standard I/O Packages,FORM Strings,,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o standard-i-o-packages}@anchor{298}@anchor{gnat_rm/the_implementation_of_standard_i_o id2}@anchor{299} +@anchor{gnat_rm/the_implementation_of_standard_i_o standard-i-o-packages}@anchor{29c}@anchor{gnat_rm/the_implementation_of_standard_i_o id2}@anchor{29d} @section Standard I/O Packages @@ -21301,7 +21472,7 @@ flush the common I/O streams and in particular Standard_Output before elaborating the Ada code. @node FORM Strings,Direct_IO,Standard I/O Packages,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o form-strings}@anchor{29a}@anchor{gnat_rm/the_implementation_of_standard_i_o id3}@anchor{29b} +@anchor{gnat_rm/the_implementation_of_standard_i_o form-strings}@anchor{29e}@anchor{gnat_rm/the_implementation_of_standard_i_o id3}@anchor{29f} @section FORM Strings @@ -21327,7 +21498,7 @@ unrecognized keyword appears in a form string, it is silently ignored and not considered invalid. @node Direct_IO,Sequential_IO,FORM Strings,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o direct-io}@anchor{29c}@anchor{gnat_rm/the_implementation_of_standard_i_o id4}@anchor{29d} +@anchor{gnat_rm/the_implementation_of_standard_i_o direct-io}@anchor{2a0}@anchor{gnat_rm/the_implementation_of_standard_i_o id4}@anchor{2a1} @section Direct_IO @@ -21347,7 +21518,7 @@ There is no limit on the size of Direct_IO files, they are expanded as necessary to accommodate whatever records are written to the file. @node Sequential_IO,Text_IO,Direct_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o sequential-io}@anchor{29e}@anchor{gnat_rm/the_implementation_of_standard_i_o id5}@anchor{29f} +@anchor{gnat_rm/the_implementation_of_standard_i_o sequential-io}@anchor{2a2}@anchor{gnat_rm/the_implementation_of_standard_i_o id5}@anchor{2a3} @section Sequential_IO @@ -21394,7 +21565,7 @@ using Stream_IO, and this is the preferred mechanism. In particular, the above program fragment rewritten to use Stream_IO will work correctly. @node Text_IO,Wide_Text_IO,Sequential_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id6}@anchor{2a0}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io}@anchor{2a1} +@anchor{gnat_rm/the_implementation_of_standard_i_o id6}@anchor{2a4}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io}@anchor{2a5} @section Text_IO @@ -21477,7 +21648,7 @@ the file. @end menu @node Stream Pointer Positioning,Reading and Writing Non-Regular Files,,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id7}@anchor{2a2}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning}@anchor{2a3} +@anchor{gnat_rm/the_implementation_of_standard_i_o id7}@anchor{2a6}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning}@anchor{2a7} @subsection Stream Pointer Positioning @@ -21513,7 +21684,7 @@ between two Ada files, then the difference may be observable in some situations. @node Reading and Writing Non-Regular Files,Get_Immediate,Stream Pointer Positioning,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files}@anchor{2a4}@anchor{gnat_rm/the_implementation_of_standard_i_o id8}@anchor{2a5} +@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files}@anchor{2a8}@anchor{gnat_rm/the_implementation_of_standard_i_o id8}@anchor{2a9} @subsection Reading and Writing Non-Regular Files @@ -21564,7 +21735,7 @@ to read data past that end of file indication, until another end of file indication is entered. @node Get_Immediate,Treating Text_IO Files as Streams,Reading and Writing Non-Regular Files,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o get-immediate}@anchor{2a6}@anchor{gnat_rm/the_implementation_of_standard_i_o id9}@anchor{2a7} +@anchor{gnat_rm/the_implementation_of_standard_i_o get-immediate}@anchor{2aa}@anchor{gnat_rm/the_implementation_of_standard_i_o id9}@anchor{2ab} @subsection Get_Immediate @@ -21582,7 +21753,7 @@ possible), it is undefined whether the FF character will be treated as a page mark. @node Treating Text_IO Files as Streams,Text_IO Extensions,Get_Immediate,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id10}@anchor{2a8}@anchor{gnat_rm/the_implementation_of_standard_i_o treating-text-io-files-as-streams}@anchor{2a9} +@anchor{gnat_rm/the_implementation_of_standard_i_o id10}@anchor{2ac}@anchor{gnat_rm/the_implementation_of_standard_i_o treating-text-io-files-as-streams}@anchor{2ad} @subsection Treating Text_IO Files as Streams @@ -21598,7 +21769,7 @@ skipped and the effect is similar to that described above for @code{Get_Immediate}. @node Text_IO Extensions,Text_IO Facilities for Unbounded Strings,Treating Text_IO Files as Streams,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id11}@anchor{2aa}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-extensions}@anchor{2ab} +@anchor{gnat_rm/the_implementation_of_standard_i_o id11}@anchor{2ae}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-extensions}@anchor{2af} @subsection Text_IO Extensions @@ -21626,7 +21797,7 @@ the string is to be read. @end itemize @node Text_IO Facilities for Unbounded Strings,,Text_IO Extensions,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-facilities-for-unbounded-strings}@anchor{2ac}@anchor{gnat_rm/the_implementation_of_standard_i_o id12}@anchor{2ad} +@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-facilities-for-unbounded-strings}@anchor{2b0}@anchor{gnat_rm/the_implementation_of_standard_i_o id12}@anchor{2b1} @subsection Text_IO Facilities for Unbounded Strings @@ -21674,7 +21845,7 @@ files @code{a-szuzti.ads} and @code{a-szuzti.adb} provides similar extended @code{Wide_Wide_Text_IO} functionality for unbounded wide wide strings. @node Wide_Text_IO,Wide_Wide_Text_IO,Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o wide-text-io}@anchor{2ae}@anchor{gnat_rm/the_implementation_of_standard_i_o id13}@anchor{2af} +@anchor{gnat_rm/the_implementation_of_standard_i_o wide-text-io}@anchor{2b2}@anchor{gnat_rm/the_implementation_of_standard_i_o id13}@anchor{2b3} @section Wide_Text_IO @@ -21921,12 +22092,12 @@ input also causes Constraint_Error to be raised. @end menu @node Stream Pointer Positioning<2>,Reading and Writing Non-Regular Files<2>,,Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-1}@anchor{2b0}@anchor{gnat_rm/the_implementation_of_standard_i_o id14}@anchor{2b1} +@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-1}@anchor{2b4}@anchor{gnat_rm/the_implementation_of_standard_i_o id14}@anchor{2b5} @subsection Stream Pointer Positioning @code{Ada.Wide_Text_IO} is similar to @code{Ada.Text_IO} in its handling -of stream pointer positioning (@ref{2a1,,Text_IO}). There is one additional +of stream pointer positioning (@ref{2a5,,Text_IO}). There is one additional case: If @code{Ada.Wide_Text_IO.Look_Ahead} reads a character outside the @@ -21945,7 +22116,7 @@ to a normal program using @code{Wide_Text_IO}. However, this discrepancy can be observed if the wide text file shares a stream with another file. @node Reading and Writing Non-Regular Files<2>,,Stream Pointer Positioning<2>,Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-1}@anchor{2b2}@anchor{gnat_rm/the_implementation_of_standard_i_o id15}@anchor{2b3} +@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-1}@anchor{2b6}@anchor{gnat_rm/the_implementation_of_standard_i_o id15}@anchor{2b7} @subsection Reading and Writing Non-Regular Files @@ -21956,7 +22127,7 @@ treated as data characters), and @code{End_Of_Page} always returns it is possible to read beyond an end of file. @node Wide_Wide_Text_IO,Stream_IO,Wide_Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id16}@anchor{2b4}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-wide-text-io}@anchor{2b5} +@anchor{gnat_rm/the_implementation_of_standard_i_o id16}@anchor{2b8}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-wide-text-io}@anchor{2b9} @section Wide_Wide_Text_IO @@ -22125,12 +22296,12 @@ input also causes Constraint_Error to be raised. @end menu @node Stream Pointer Positioning<3>,Reading and Writing Non-Regular Files<3>,,Wide_Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-2}@anchor{2b6}@anchor{gnat_rm/the_implementation_of_standard_i_o id17}@anchor{2b7} +@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-2}@anchor{2ba}@anchor{gnat_rm/the_implementation_of_standard_i_o id17}@anchor{2bb} @subsection Stream Pointer Positioning @code{Ada.Wide_Wide_Text_IO} is similar to @code{Ada.Text_IO} in its handling -of stream pointer positioning (@ref{2a1,,Text_IO}). There is one additional +of stream pointer positioning (@ref{2a5,,Text_IO}). There is one additional case: If @code{Ada.Wide_Wide_Text_IO.Look_Ahead} reads a character outside the @@ -22149,7 +22320,7 @@ to a normal program using @code{Wide_Wide_Text_IO}. However, this discrepancy can be observed if the wide text file shares a stream with another file. @node Reading and Writing Non-Regular Files<3>,,Stream Pointer Positioning<3>,Wide_Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id18}@anchor{2b8}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-2}@anchor{2b9} +@anchor{gnat_rm/the_implementation_of_standard_i_o id18}@anchor{2bc}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-2}@anchor{2bd} @subsection Reading and Writing Non-Regular Files @@ -22160,7 +22331,7 @@ treated as data characters), and @code{End_Of_Page} always returns it is possible to read beyond an end of file. @node Stream_IO,Text Translation,Wide_Wide_Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id19}@anchor{2ba}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-io}@anchor{2bb} +@anchor{gnat_rm/the_implementation_of_standard_i_o id19}@anchor{2be}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-io}@anchor{2bf} @section Stream_IO @@ -22182,7 +22353,7 @@ manner described for stream attributes. @end itemize @node Text Translation,Shared Files,Stream_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id20}@anchor{2bc}@anchor{gnat_rm/the_implementation_of_standard_i_o text-translation}@anchor{2bd} +@anchor{gnat_rm/the_implementation_of_standard_i_o id20}@anchor{2c0}@anchor{gnat_rm/the_implementation_of_standard_i_o text-translation}@anchor{2c1} @section Text Translation @@ -22216,7 +22387,7 @@ mode. (corresponds to_O_U16TEXT). @end itemize @node Shared Files,Filenames encoding,Text Translation,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id21}@anchor{2be}@anchor{gnat_rm/the_implementation_of_standard_i_o shared-files}@anchor{2bf} +@anchor{gnat_rm/the_implementation_of_standard_i_o id21}@anchor{2c2}@anchor{gnat_rm/the_implementation_of_standard_i_o shared-files}@anchor{2c3} @section Shared Files @@ -22279,7 +22450,7 @@ heterogeneous input-output. Although this approach will work in GNAT if for this purpose (using the stream attributes) @node Filenames encoding,File content encoding,Shared Files,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o filenames-encoding}@anchor{2c0}@anchor{gnat_rm/the_implementation_of_standard_i_o id22}@anchor{2c1} +@anchor{gnat_rm/the_implementation_of_standard_i_o filenames-encoding}@anchor{2c4}@anchor{gnat_rm/the_implementation_of_standard_i_o id22}@anchor{2c5} @section Filenames encoding @@ -22319,7 +22490,7 @@ platform. On the other Operating Systems the run-time is supporting UTF-8 natively. @node File content encoding,Open Modes,Filenames encoding,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o file-content-encoding}@anchor{2c2}@anchor{gnat_rm/the_implementation_of_standard_i_o id23}@anchor{2c3} +@anchor{gnat_rm/the_implementation_of_standard_i_o file-content-encoding}@anchor{2c6}@anchor{gnat_rm/the_implementation_of_standard_i_o id23}@anchor{2c7} @section File content encoding @@ -22352,7 +22523,7 @@ Unicode 8-bit encoding This encoding is only supported on the Windows platform. @node Open Modes,Operations on C Streams,File content encoding,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o open-modes}@anchor{2c4}@anchor{gnat_rm/the_implementation_of_standard_i_o id24}@anchor{2c5} +@anchor{gnat_rm/the_implementation_of_standard_i_o open-modes}@anchor{2c8}@anchor{gnat_rm/the_implementation_of_standard_i_o id24}@anchor{2c9} @section Open Modes @@ -22455,7 +22626,7 @@ subsequently requires switching from reading to writing or vice-versa, then the file is reopened in @code{r+} mode to permit the required operation. @node Operations on C Streams,Interfacing to C Streams,Open Modes,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o operations-on-c-streams}@anchor{2c6}@anchor{gnat_rm/the_implementation_of_standard_i_o id25}@anchor{2c7} +@anchor{gnat_rm/the_implementation_of_standard_i_o operations-on-c-streams}@anchor{2ca}@anchor{gnat_rm/the_implementation_of_standard_i_o id25}@anchor{2cb} @section Operations on C Streams @@ -22615,7 +22786,7 @@ end Interfaces.C_Streams; @end example @node Interfacing to C Streams,,Operations on C Streams,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o interfacing-to-c-streams}@anchor{2c8}@anchor{gnat_rm/the_implementation_of_standard_i_o id26}@anchor{2c9} +@anchor{gnat_rm/the_implementation_of_standard_i_o interfacing-to-c-streams}@anchor{2cc}@anchor{gnat_rm/the_implementation_of_standard_i_o id26}@anchor{2cd} @section Interfacing to C Streams @@ -22708,7 +22879,7 @@ imported from a C program, allowing an Ada file to operate on an existing C file. @node The GNAT Library,Interfacing to Other Languages,The Implementation of Standard I/O,Top -@anchor{gnat_rm/the_gnat_library the-gnat-library}@anchor{10}@anchor{gnat_rm/the_gnat_library doc}@anchor{2ca}@anchor{gnat_rm/the_gnat_library id1}@anchor{2cb} +@anchor{gnat_rm/the_gnat_library the-gnat-library}@anchor{10}@anchor{gnat_rm/the_gnat_library doc}@anchor{2ce}@anchor{gnat_rm/the_gnat_library id1}@anchor{2cf} @chapter The GNAT Library @@ -22900,7 +23071,7 @@ of GNAT, and will generate a warning message. @end menu @node Ada Characters Latin_9 a-chlat9 ads,Ada Characters Wide_Latin_1 a-cwila1 ads,,The GNAT Library -@anchor{gnat_rm/the_gnat_library id2}@anchor{2cc}@anchor{gnat_rm/the_gnat_library ada-characters-latin-9-a-chlat9-ads}@anchor{2cd} +@anchor{gnat_rm/the_gnat_library id2}@anchor{2d0}@anchor{gnat_rm/the_gnat_library ada-characters-latin-9-a-chlat9-ads}@anchor{2d1} @section @code{Ada.Characters.Latin_9} (@code{a-chlat9.ads}) @@ -22917,7 +23088,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Latin_1 a-cwila1 ads,Ada Characters Wide_Latin_9 a-cwila1 ads,Ada Characters Latin_9 a-chlat9 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-1-a-cwila1-ads}@anchor{2ce}@anchor{gnat_rm/the_gnat_library id3}@anchor{2cf} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-1-a-cwila1-ads}@anchor{2d2}@anchor{gnat_rm/the_gnat_library id3}@anchor{2d3} @section @code{Ada.Characters.Wide_Latin_1} (@code{a-cwila1.ads}) @@ -22934,7 +23105,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Latin_9 a-cwila1 ads,Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,Ada Characters Wide_Latin_1 a-cwila1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id4}@anchor{2d0}@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-9-a-cwila1-ads}@anchor{2d1} +@anchor{gnat_rm/the_gnat_library id4}@anchor{2d4}@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-9-a-cwila1-ads}@anchor{2d5} @section @code{Ada.Characters.Wide_Latin_9} (@code{a-cwila1.ads}) @@ -22951,7 +23122,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,Ada Characters Wide_Latin_9 a-cwila1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-1-a-chzla1-ads}@anchor{2d2}@anchor{gnat_rm/the_gnat_library id5}@anchor{2d3} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-1-a-chzla1-ads}@anchor{2d6}@anchor{gnat_rm/the_gnat_library id5}@anchor{2d7} @section @code{Ada.Characters.Wide_Wide_Latin_1} (@code{a-chzla1.ads}) @@ -22968,7 +23139,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,Ada Containers Formal_Doubly_Linked_Lists a-cfdlli ads,Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-9-a-chzla9-ads}@anchor{2d4}@anchor{gnat_rm/the_gnat_library id6}@anchor{2d5} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-9-a-chzla9-ads}@anchor{2d8}@anchor{gnat_rm/the_gnat_library id6}@anchor{2d9} @section @code{Ada.Characters.Wide_Wide_Latin_9} (@code{a-chzla9.ads}) @@ -22985,7 +23156,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Containers Formal_Doubly_Linked_Lists a-cfdlli ads,Ada Containers Formal_Hashed_Maps a-cfhama ads,Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id7}@anchor{2d6}@anchor{gnat_rm/the_gnat_library ada-containers-formal-doubly-linked-lists-a-cfdlli-ads}@anchor{2d7} +@anchor{gnat_rm/the_gnat_library id7}@anchor{2da}@anchor{gnat_rm/the_gnat_library ada-containers-formal-doubly-linked-lists-a-cfdlli-ads}@anchor{2db} @section @code{Ada.Containers.Formal_Doubly_Linked_Lists} (@code{a-cfdlli.ads}) @@ -23004,7 +23175,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Hashed_Maps a-cfhama ads,Ada Containers Formal_Hashed_Sets a-cfhase ads,Ada Containers Formal_Doubly_Linked_Lists a-cfdlli ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id8}@anchor{2d8}@anchor{gnat_rm/the_gnat_library ada-containers-formal-hashed-maps-a-cfhama-ads}@anchor{2d9} +@anchor{gnat_rm/the_gnat_library id8}@anchor{2dc}@anchor{gnat_rm/the_gnat_library ada-containers-formal-hashed-maps-a-cfhama-ads}@anchor{2dd} @section @code{Ada.Containers.Formal_Hashed_Maps} (@code{a-cfhama.ads}) @@ -23023,7 +23194,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Hashed_Sets a-cfhase ads,Ada Containers Formal_Ordered_Maps a-cforma ads,Ada Containers Formal_Hashed_Maps a-cfhama ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id9}@anchor{2da}@anchor{gnat_rm/the_gnat_library ada-containers-formal-hashed-sets-a-cfhase-ads}@anchor{2db} +@anchor{gnat_rm/the_gnat_library id9}@anchor{2de}@anchor{gnat_rm/the_gnat_library ada-containers-formal-hashed-sets-a-cfhase-ads}@anchor{2df} @section @code{Ada.Containers.Formal_Hashed_Sets} (@code{a-cfhase.ads}) @@ -23042,7 +23213,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Ordered_Maps a-cforma ads,Ada Containers Formal_Ordered_Sets a-cforse ads,Ada Containers Formal_Hashed_Sets a-cfhase ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id10}@anchor{2dc}@anchor{gnat_rm/the_gnat_library ada-containers-formal-ordered-maps-a-cforma-ads}@anchor{2dd} +@anchor{gnat_rm/the_gnat_library id10}@anchor{2e0}@anchor{gnat_rm/the_gnat_library ada-containers-formal-ordered-maps-a-cforma-ads}@anchor{2e1} @section @code{Ada.Containers.Formal_Ordered_Maps} (@code{a-cforma.ads}) @@ -23061,7 +23232,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Ordered_Sets a-cforse ads,Ada Containers Formal_Vectors a-cofove ads,Ada Containers Formal_Ordered_Maps a-cforma ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-containers-formal-ordered-sets-a-cforse-ads}@anchor{2de}@anchor{gnat_rm/the_gnat_library id11}@anchor{2df} +@anchor{gnat_rm/the_gnat_library ada-containers-formal-ordered-sets-a-cforse-ads}@anchor{2e2}@anchor{gnat_rm/the_gnat_library id11}@anchor{2e3} @section @code{Ada.Containers.Formal_Ordered_Sets} (@code{a-cforse.ads}) @@ -23080,7 +23251,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Vectors a-cofove ads,Ada Containers Formal_Indefinite_Vectors a-cfinve ads,Ada Containers Formal_Ordered_Sets a-cforse ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id12}@anchor{2e0}@anchor{gnat_rm/the_gnat_library ada-containers-formal-vectors-a-cofove-ads}@anchor{2e1} +@anchor{gnat_rm/the_gnat_library id12}@anchor{2e4}@anchor{gnat_rm/the_gnat_library ada-containers-formal-vectors-a-cofove-ads}@anchor{2e5} @section @code{Ada.Containers.Formal_Vectors} (@code{a-cofove.ads}) @@ -23099,7 +23270,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Indefinite_Vectors a-cfinve ads,Ada Containers Functional_Vectors a-cofuve ads,Ada Containers Formal_Vectors a-cofove ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id13}@anchor{2e2}@anchor{gnat_rm/the_gnat_library ada-containers-formal-indefinite-vectors-a-cfinve-ads}@anchor{2e3} +@anchor{gnat_rm/the_gnat_library id13}@anchor{2e6}@anchor{gnat_rm/the_gnat_library ada-containers-formal-indefinite-vectors-a-cfinve-ads}@anchor{2e7} @section @code{Ada.Containers.Formal_Indefinite_Vectors} (@code{a-cfinve.ads}) @@ -23118,7 +23289,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Functional_Vectors a-cofuve ads,Ada Containers Functional_Sets a-cofuse ads,Ada Containers Formal_Indefinite_Vectors a-cfinve ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id14}@anchor{2e4}@anchor{gnat_rm/the_gnat_library ada-containers-functional-vectors-a-cofuve-ads}@anchor{2e5} +@anchor{gnat_rm/the_gnat_library id14}@anchor{2e8}@anchor{gnat_rm/the_gnat_library ada-containers-functional-vectors-a-cofuve-ads}@anchor{2e9} @section @code{Ada.Containers.Functional_Vectors} (@code{a-cofuve.ads}) @@ -23140,7 +23311,7 @@ and annotations, so that they can be removed from the final executable. The specification of this unit is compatible with SPARK 2014. @node Ada Containers Functional_Sets a-cofuse ads,Ada Containers Functional_Maps a-cofuma ads,Ada Containers Functional_Vectors a-cofuve ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-containers-functional-sets-a-cofuse-ads}@anchor{2e6}@anchor{gnat_rm/the_gnat_library id15}@anchor{2e7} +@anchor{gnat_rm/the_gnat_library ada-containers-functional-sets-a-cofuse-ads}@anchor{2ea}@anchor{gnat_rm/the_gnat_library id15}@anchor{2eb} @section @code{Ada.Containers.Functional_Sets} (@code{a-cofuse.ads}) @@ -23162,7 +23333,7 @@ and annotations, so that they can be removed from the final executable. The specification of this unit is compatible with SPARK 2014. @node Ada Containers Functional_Maps a-cofuma ads,Ada Containers Bounded_Holders a-coboho ads,Ada Containers Functional_Sets a-cofuse ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id16}@anchor{2e8}@anchor{gnat_rm/the_gnat_library ada-containers-functional-maps-a-cofuma-ads}@anchor{2e9} +@anchor{gnat_rm/the_gnat_library id16}@anchor{2ec}@anchor{gnat_rm/the_gnat_library ada-containers-functional-maps-a-cofuma-ads}@anchor{2ed} @section @code{Ada.Containers.Functional_Maps} (@code{a-cofuma.ads}) @@ -23184,7 +23355,7 @@ and annotations, so that they can be removed from the final executable. The specification of this unit is compatible with SPARK 2014. @node Ada Containers Bounded_Holders a-coboho ads,Ada Command_Line Environment a-colien ads,Ada Containers Functional_Maps a-cofuma ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-containers-bounded-holders-a-coboho-ads}@anchor{2ea}@anchor{gnat_rm/the_gnat_library id17}@anchor{2eb} +@anchor{gnat_rm/the_gnat_library ada-containers-bounded-holders-a-coboho-ads}@anchor{2ee}@anchor{gnat_rm/the_gnat_library id17}@anchor{2ef} @section @code{Ada.Containers.Bounded_Holders} (@code{a-coboho.ads}) @@ -23196,7 +23367,7 @@ This child of @code{Ada.Containers} defines a modified version of Indefinite_Holders that avoids heap allocation. @node Ada Command_Line Environment a-colien ads,Ada Command_Line Remove a-colire ads,Ada Containers Bounded_Holders a-coboho ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-command-line-environment-a-colien-ads}@anchor{2ec}@anchor{gnat_rm/the_gnat_library id18}@anchor{2ed} +@anchor{gnat_rm/the_gnat_library ada-command-line-environment-a-colien-ads}@anchor{2f0}@anchor{gnat_rm/the_gnat_library id18}@anchor{2f1} @section @code{Ada.Command_Line.Environment} (@code{a-colien.ads}) @@ -23209,7 +23380,7 @@ provides a mechanism for obtaining environment values on systems where this concept makes sense. @node Ada Command_Line Remove a-colire ads,Ada Command_Line Response_File a-clrefi ads,Ada Command_Line Environment a-colien ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id19}@anchor{2ee}@anchor{gnat_rm/the_gnat_library ada-command-line-remove-a-colire-ads}@anchor{2ef} +@anchor{gnat_rm/the_gnat_library id19}@anchor{2f2}@anchor{gnat_rm/the_gnat_library ada-command-line-remove-a-colire-ads}@anchor{2f3} @section @code{Ada.Command_Line.Remove} (@code{a-colire.ads}) @@ -23227,7 +23398,7 @@ to further calls on the subprograms in @code{Ada.Command_Line} will not see the removed argument. @node Ada Command_Line Response_File a-clrefi ads,Ada Direct_IO C_Streams a-diocst ads,Ada Command_Line Remove a-colire ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id20}@anchor{2f0}@anchor{gnat_rm/the_gnat_library ada-command-line-response-file-a-clrefi-ads}@anchor{2f1} +@anchor{gnat_rm/the_gnat_library id20}@anchor{2f4}@anchor{gnat_rm/the_gnat_library ada-command-line-response-file-a-clrefi-ads}@anchor{2f5} @section @code{Ada.Command_Line.Response_File} (@code{a-clrefi.ads}) @@ -23247,7 +23418,7 @@ Using a response file allow passing a set of arguments to an executable longer than the maximum allowed by the system on the command line. @node Ada Direct_IO C_Streams a-diocst ads,Ada Exceptions Is_Null_Occurrence a-einuoc ads,Ada Command_Line Response_File a-clrefi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id21}@anchor{2f2}@anchor{gnat_rm/the_gnat_library ada-direct-io-c-streams-a-diocst-ads}@anchor{2f3} +@anchor{gnat_rm/the_gnat_library id21}@anchor{2f6}@anchor{gnat_rm/the_gnat_library ada-direct-io-c-streams-a-diocst-ads}@anchor{2f7} @section @code{Ada.Direct_IO.C_Streams} (@code{a-diocst.ads}) @@ -23262,7 +23433,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Exceptions Is_Null_Occurrence a-einuoc ads,Ada Exceptions Last_Chance_Handler a-elchha ads,Ada Direct_IO C_Streams a-diocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id22}@anchor{2f4}@anchor{gnat_rm/the_gnat_library ada-exceptions-is-null-occurrence-a-einuoc-ads}@anchor{2f5} +@anchor{gnat_rm/the_gnat_library id22}@anchor{2f8}@anchor{gnat_rm/the_gnat_library ada-exceptions-is-null-occurrence-a-einuoc-ads}@anchor{2f9} @section @code{Ada.Exceptions.Is_Null_Occurrence} (@code{a-einuoc.ads}) @@ -23276,7 +23447,7 @@ exception occurrence (@code{Null_Occurrence}) without raising an exception. @node Ada Exceptions Last_Chance_Handler a-elchha ads,Ada Exceptions Traceback a-exctra ads,Ada Exceptions Is_Null_Occurrence a-einuoc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id23}@anchor{2f6}@anchor{gnat_rm/the_gnat_library ada-exceptions-last-chance-handler-a-elchha-ads}@anchor{2f7} +@anchor{gnat_rm/the_gnat_library id23}@anchor{2fa}@anchor{gnat_rm/the_gnat_library ada-exceptions-last-chance-handler-a-elchha-ads}@anchor{2fb} @section @code{Ada.Exceptions.Last_Chance_Handler} (@code{a-elchha.ads}) @@ -23290,7 +23461,7 @@ exceptions (hence the name last chance), and perform clean ups before terminating the program. Note that this subprogram never returns. @node Ada Exceptions Traceback a-exctra ads,Ada Sequential_IO C_Streams a-siocst ads,Ada Exceptions Last_Chance_Handler a-elchha ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-exceptions-traceback-a-exctra-ads}@anchor{2f8}@anchor{gnat_rm/the_gnat_library id24}@anchor{2f9} +@anchor{gnat_rm/the_gnat_library ada-exceptions-traceback-a-exctra-ads}@anchor{2fc}@anchor{gnat_rm/the_gnat_library id24}@anchor{2fd} @section @code{Ada.Exceptions.Traceback} (@code{a-exctra.ads}) @@ -23303,7 +23474,7 @@ give a traceback array of addresses based on an exception occurrence. @node Ada Sequential_IO C_Streams a-siocst ads,Ada Streams Stream_IO C_Streams a-ssicst ads,Ada Exceptions Traceback a-exctra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-sequential-io-c-streams-a-siocst-ads}@anchor{2fa}@anchor{gnat_rm/the_gnat_library id25}@anchor{2fb} +@anchor{gnat_rm/the_gnat_library ada-sequential-io-c-streams-a-siocst-ads}@anchor{2fe}@anchor{gnat_rm/the_gnat_library id25}@anchor{2ff} @section @code{Ada.Sequential_IO.C_Streams} (@code{a-siocst.ads}) @@ -23318,7 +23489,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Streams Stream_IO C_Streams a-ssicst ads,Ada Strings Unbounded Text_IO a-suteio ads,Ada Sequential_IO C_Streams a-siocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id26}@anchor{2fc}@anchor{gnat_rm/the_gnat_library ada-streams-stream-io-c-streams-a-ssicst-ads}@anchor{2fd} +@anchor{gnat_rm/the_gnat_library id26}@anchor{300}@anchor{gnat_rm/the_gnat_library ada-streams-stream-io-c-streams-a-ssicst-ads}@anchor{301} @section @code{Ada.Streams.Stream_IO.C_Streams} (@code{a-ssicst.ads}) @@ -23333,7 +23504,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Strings Unbounded Text_IO a-suteio ads,Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,Ada Streams Stream_IO C_Streams a-ssicst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-strings-unbounded-text-io-a-suteio-ads}@anchor{2fe}@anchor{gnat_rm/the_gnat_library id27}@anchor{2ff} +@anchor{gnat_rm/the_gnat_library ada-strings-unbounded-text-io-a-suteio-ads}@anchor{302}@anchor{gnat_rm/the_gnat_library id27}@anchor{303} @section @code{Ada.Strings.Unbounded.Text_IO} (@code{a-suteio.ads}) @@ -23350,7 +23521,7 @@ strings, avoiding the necessity for an intermediate operation with ordinary strings. @node Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,Ada Strings Unbounded Text_IO a-suteio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id28}@anchor{300}@anchor{gnat_rm/the_gnat_library ada-strings-wide-unbounded-wide-text-io-a-swuwti-ads}@anchor{301} +@anchor{gnat_rm/the_gnat_library id28}@anchor{304}@anchor{gnat_rm/the_gnat_library ada-strings-wide-unbounded-wide-text-io-a-swuwti-ads}@anchor{305} @section @code{Ada.Strings.Wide_Unbounded.Wide_Text_IO} (@code{a-swuwti.ads}) @@ -23367,7 +23538,7 @@ wide strings, avoiding the necessity for an intermediate operation with ordinary wide strings. @node Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,Ada Text_IO C_Streams a-tiocst ads,Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id29}@anchor{302}@anchor{gnat_rm/the_gnat_library ada-strings-wide-wide-unbounded-wide-wide-text-io-a-szuzti-ads}@anchor{303} +@anchor{gnat_rm/the_gnat_library id29}@anchor{306}@anchor{gnat_rm/the_gnat_library ada-strings-wide-wide-unbounded-wide-wide-text-io-a-szuzti-ads}@anchor{307} @section @code{Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO} (@code{a-szuzti.ads}) @@ -23384,7 +23555,7 @@ wide wide strings, avoiding the necessity for an intermediate operation with ordinary wide wide strings. @node Ada Text_IO C_Streams a-tiocst ads,Ada Text_IO Reset_Standard_Files a-tirsfi ads,Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-text-io-c-streams-a-tiocst-ads}@anchor{304}@anchor{gnat_rm/the_gnat_library id30}@anchor{305} +@anchor{gnat_rm/the_gnat_library ada-text-io-c-streams-a-tiocst-ads}@anchor{308}@anchor{gnat_rm/the_gnat_library id30}@anchor{309} @section @code{Ada.Text_IO.C_Streams} (@code{a-tiocst.ads}) @@ -23399,7 +23570,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Text_IO Reset_Standard_Files a-tirsfi ads,Ada Wide_Characters Unicode a-wichun ads,Ada Text_IO C_Streams a-tiocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-text-io-reset-standard-files-a-tirsfi-ads}@anchor{306}@anchor{gnat_rm/the_gnat_library id31}@anchor{307} +@anchor{gnat_rm/the_gnat_library ada-text-io-reset-standard-files-a-tirsfi-ads}@anchor{30a}@anchor{gnat_rm/the_gnat_library id31}@anchor{30b} @section @code{Ada.Text_IO.Reset_Standard_Files} (@code{a-tirsfi.ads}) @@ -23414,7 +23585,7 @@ execution (for example a standard input file may be redefined to be interactive). @node Ada Wide_Characters Unicode a-wichun ads,Ada Wide_Text_IO C_Streams a-wtcstr ads,Ada Text_IO Reset_Standard_Files a-tirsfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id32}@anchor{308}@anchor{gnat_rm/the_gnat_library ada-wide-characters-unicode-a-wichun-ads}@anchor{309} +@anchor{gnat_rm/the_gnat_library id32}@anchor{30c}@anchor{gnat_rm/the_gnat_library ada-wide-characters-unicode-a-wichun-ads}@anchor{30d} @section @code{Ada.Wide_Characters.Unicode} (@code{a-wichun.ads}) @@ -23427,7 +23598,7 @@ This package provides subprograms that allow categorization of Wide_Character values according to Unicode categories. @node Ada Wide_Text_IO C_Streams a-wtcstr ads,Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,Ada Wide_Characters Unicode a-wichun ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-text-io-c-streams-a-wtcstr-ads}@anchor{30a}@anchor{gnat_rm/the_gnat_library id33}@anchor{30b} +@anchor{gnat_rm/the_gnat_library ada-wide-text-io-c-streams-a-wtcstr-ads}@anchor{30e}@anchor{gnat_rm/the_gnat_library id33}@anchor{30f} @section @code{Ada.Wide_Text_IO.C_Streams} (@code{a-wtcstr.ads}) @@ -23442,7 +23613,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,Ada Wide_Wide_Characters Unicode a-zchuni ads,Ada Wide_Text_IO C_Streams a-wtcstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-text-io-reset-standard-files-a-wrstfi-ads}@anchor{30c}@anchor{gnat_rm/the_gnat_library id34}@anchor{30d} +@anchor{gnat_rm/the_gnat_library ada-wide-text-io-reset-standard-files-a-wrstfi-ads}@anchor{310}@anchor{gnat_rm/the_gnat_library id34}@anchor{311} @section @code{Ada.Wide_Text_IO.Reset_Standard_Files} (@code{a-wrstfi.ads}) @@ -23457,7 +23628,7 @@ execution (for example a standard input file may be redefined to be interactive). @node Ada Wide_Wide_Characters Unicode a-zchuni ads,Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id35}@anchor{30e}@anchor{gnat_rm/the_gnat_library ada-wide-wide-characters-unicode-a-zchuni-ads}@anchor{30f} +@anchor{gnat_rm/the_gnat_library id35}@anchor{312}@anchor{gnat_rm/the_gnat_library ada-wide-wide-characters-unicode-a-zchuni-ads}@anchor{313} @section @code{Ada.Wide_Wide_Characters.Unicode} (@code{a-zchuni.ads}) @@ -23470,7 +23641,7 @@ This package provides subprograms that allow categorization of Wide_Wide_Character values according to Unicode categories. @node Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,Ada Wide_Wide_Characters Unicode a-zchuni ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id36}@anchor{310}@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-c-streams-a-ztcstr-ads}@anchor{311} +@anchor{gnat_rm/the_gnat_library id36}@anchor{314}@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-c-streams-a-ztcstr-ads}@anchor{315} @section @code{Ada.Wide_Wide_Text_IO.C_Streams} (@code{a-ztcstr.ads}) @@ -23485,7 +23656,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,GNAT Altivec g-altive ads,Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id37}@anchor{312}@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-reset-standard-files-a-zrstfi-ads}@anchor{313} +@anchor{gnat_rm/the_gnat_library id37}@anchor{316}@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-reset-standard-files-a-zrstfi-ads}@anchor{317} @section @code{Ada.Wide_Wide_Text_IO.Reset_Standard_Files} (@code{a-zrstfi.ads}) @@ -23500,7 +23671,7 @@ change during execution (for example a standard input file may be redefined to be interactive). @node GNAT Altivec g-altive ads,GNAT Altivec Conversions g-altcon ads,Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-g-altive-ads}@anchor{314}@anchor{gnat_rm/the_gnat_library id38}@anchor{315} +@anchor{gnat_rm/the_gnat_library gnat-altivec-g-altive-ads}@anchor{318}@anchor{gnat_rm/the_gnat_library id38}@anchor{319} @section @code{GNAT.Altivec} (@code{g-altive.ads}) @@ -23513,7 +23684,7 @@ definitions of constants and types common to all the versions of the binding. @node GNAT Altivec Conversions g-altcon ads,GNAT Altivec Vector_Operations g-alveop ads,GNAT Altivec g-altive ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-conversions-g-altcon-ads}@anchor{316}@anchor{gnat_rm/the_gnat_library id39}@anchor{317} +@anchor{gnat_rm/the_gnat_library gnat-altivec-conversions-g-altcon-ads}@anchor{31a}@anchor{gnat_rm/the_gnat_library id39}@anchor{31b} @section @code{GNAT.Altivec.Conversions} (@code{g-altcon.ads}) @@ -23524,7 +23695,7 @@ binding. This package provides the Vector/View conversion routines. @node GNAT Altivec Vector_Operations g-alveop ads,GNAT Altivec Vector_Types g-alvety ads,GNAT Altivec Conversions g-altcon ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-operations-g-alveop-ads}@anchor{318}@anchor{gnat_rm/the_gnat_library id40}@anchor{319} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-operations-g-alveop-ads}@anchor{31c}@anchor{gnat_rm/the_gnat_library id40}@anchor{31d} @section @code{GNAT.Altivec.Vector_Operations} (@code{g-alveop.ads}) @@ -23538,7 +23709,7 @@ library. The hard binding is provided as a separate package. This unit is common to both bindings. @node GNAT Altivec Vector_Types g-alvety ads,GNAT Altivec Vector_Views g-alvevi ads,GNAT Altivec Vector_Operations g-alveop ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-types-g-alvety-ads}@anchor{31a}@anchor{gnat_rm/the_gnat_library id41}@anchor{31b} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-types-g-alvety-ads}@anchor{31e}@anchor{gnat_rm/the_gnat_library id41}@anchor{31f} @section @code{GNAT.Altivec.Vector_Types} (@code{g-alvety.ads}) @@ -23550,7 +23721,7 @@ This package exposes the various vector types part of the Ada binding to AltiVec facilities. @node GNAT Altivec Vector_Views g-alvevi ads,GNAT Array_Split g-arrspl ads,GNAT Altivec Vector_Types g-alvety ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-views-g-alvevi-ads}@anchor{31c}@anchor{gnat_rm/the_gnat_library id42}@anchor{31d} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-views-g-alvevi-ads}@anchor{320}@anchor{gnat_rm/the_gnat_library id42}@anchor{321} @section @code{GNAT.Altivec.Vector_Views} (@code{g-alvevi.ads}) @@ -23565,7 +23736,7 @@ vector elements and provides a simple way to initialize vector objects. @node GNAT Array_Split g-arrspl ads,GNAT AWK g-awk ads,GNAT Altivec Vector_Views g-alvevi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-array-split-g-arrspl-ads}@anchor{31e}@anchor{gnat_rm/the_gnat_library id43}@anchor{31f} +@anchor{gnat_rm/the_gnat_library gnat-array-split-g-arrspl-ads}@anchor{322}@anchor{gnat_rm/the_gnat_library id43}@anchor{323} @section @code{GNAT.Array_Split} (@code{g-arrspl.ads}) @@ -23578,7 +23749,7 @@ an array wherever the separators appear, and provide direct access to the resulting slices. @node GNAT AWK g-awk ads,GNAT Bind_Environment g-binenv ads,GNAT Array_Split g-arrspl ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id44}@anchor{320}@anchor{gnat_rm/the_gnat_library gnat-awk-g-awk-ads}@anchor{321} +@anchor{gnat_rm/the_gnat_library id44}@anchor{324}@anchor{gnat_rm/the_gnat_library gnat-awk-g-awk-ads}@anchor{325} @section @code{GNAT.AWK} (@code{g-awk.ads}) @@ -23593,7 +23764,7 @@ or more files containing formatted data. The file is viewed as a database where each record is a line and a field is a data element in this line. @node GNAT Bind_Environment g-binenv ads,GNAT Bounded_Buffers g-boubuf ads,GNAT AWK g-awk ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bind-environment-g-binenv-ads}@anchor{322}@anchor{gnat_rm/the_gnat_library id45}@anchor{323} +@anchor{gnat_rm/the_gnat_library gnat-bind-environment-g-binenv-ads}@anchor{326}@anchor{gnat_rm/the_gnat_library id45}@anchor{327} @section @code{GNAT.Bind_Environment} (@code{g-binenv.ads}) @@ -23606,7 +23777,7 @@ These associations can be specified using the @code{-V} binder command line switch. @node GNAT Bounded_Buffers g-boubuf ads,GNAT Bounded_Mailboxes g-boumai ads,GNAT Bind_Environment g-binenv ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id46}@anchor{324}@anchor{gnat_rm/the_gnat_library gnat-bounded-buffers-g-boubuf-ads}@anchor{325} +@anchor{gnat_rm/the_gnat_library id46}@anchor{328}@anchor{gnat_rm/the_gnat_library gnat-bounded-buffers-g-boubuf-ads}@anchor{329} @section @code{GNAT.Bounded_Buffers} (@code{g-boubuf.ads}) @@ -23621,7 +23792,7 @@ useful directly or as parts of the implementations of other abstractions, such as mailboxes. @node GNAT Bounded_Mailboxes g-boumai ads,GNAT Bubble_Sort g-bubsor ads,GNAT Bounded_Buffers g-boubuf ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id47}@anchor{326}@anchor{gnat_rm/the_gnat_library gnat-bounded-mailboxes-g-boumai-ads}@anchor{327} +@anchor{gnat_rm/the_gnat_library id47}@anchor{32a}@anchor{gnat_rm/the_gnat_library gnat-bounded-mailboxes-g-boumai-ads}@anchor{32b} @section @code{GNAT.Bounded_Mailboxes} (@code{g-boumai.ads}) @@ -23634,7 +23805,7 @@ such as mailboxes. Provides a thread-safe asynchronous intertask mailbox communication facility. @node GNAT Bubble_Sort g-bubsor ads,GNAT Bubble_Sort_A g-busora ads,GNAT Bounded_Mailboxes g-boumai ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-bubsor-ads}@anchor{328}@anchor{gnat_rm/the_gnat_library id48}@anchor{329} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-bubsor-ads}@anchor{32c}@anchor{gnat_rm/the_gnat_library id48}@anchor{32d} @section @code{GNAT.Bubble_Sort} (@code{g-bubsor.ads}) @@ -23649,7 +23820,7 @@ data items. Exchange and comparison procedures are provided by passing access-to-procedure values. @node GNAT Bubble_Sort_A g-busora ads,GNAT Bubble_Sort_G g-busorg ads,GNAT Bubble_Sort g-bubsor ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id49}@anchor{32a}@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-a-g-busora-ads}@anchor{32b} +@anchor{gnat_rm/the_gnat_library id49}@anchor{32e}@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-a-g-busora-ads}@anchor{32f} @section @code{GNAT.Bubble_Sort_A} (@code{g-busora.ads}) @@ -23665,7 +23836,7 @@ access-to-procedure values. This is an older version, retained for compatibility. Usually @code{GNAT.Bubble_Sort} will be preferable. @node GNAT Bubble_Sort_G g-busorg ads,GNAT Byte_Order_Mark g-byorma ads,GNAT Bubble_Sort_A g-busora ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-g-busorg-ads}@anchor{32c}@anchor{gnat_rm/the_gnat_library id50}@anchor{32d} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-g-busorg-ads}@anchor{330}@anchor{gnat_rm/the_gnat_library id50}@anchor{331} @section @code{GNAT.Bubble_Sort_G} (@code{g-busorg.ads}) @@ -23681,7 +23852,7 @@ if the procedures can be inlined, at the expense of duplicating code for multiple instantiations. @node GNAT Byte_Order_Mark g-byorma ads,GNAT Byte_Swapping g-bytswa ads,GNAT Bubble_Sort_G g-busorg ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-byte-order-mark-g-byorma-ads}@anchor{32e}@anchor{gnat_rm/the_gnat_library id51}@anchor{32f} +@anchor{gnat_rm/the_gnat_library gnat-byte-order-mark-g-byorma-ads}@anchor{332}@anchor{gnat_rm/the_gnat_library id51}@anchor{333} @section @code{GNAT.Byte_Order_Mark} (@code{g-byorma.ads}) @@ -23697,7 +23868,7 @@ the encoding of the string. The routine includes detection of special XML sequences for various UCS input formats. @node GNAT Byte_Swapping g-bytswa ads,GNAT Calendar g-calend ads,GNAT Byte_Order_Mark g-byorma ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-byte-swapping-g-bytswa-ads}@anchor{330}@anchor{gnat_rm/the_gnat_library id52}@anchor{331} +@anchor{gnat_rm/the_gnat_library gnat-byte-swapping-g-bytswa-ads}@anchor{334}@anchor{gnat_rm/the_gnat_library id52}@anchor{335} @section @code{GNAT.Byte_Swapping} (@code{g-bytswa.ads}) @@ -23711,7 +23882,7 @@ General routines for swapping the bytes in 2-, 4-, and 8-byte quantities. Machine-specific implementations are available in some cases. @node GNAT Calendar g-calend ads,GNAT Calendar Time_IO g-catiio ads,GNAT Byte_Swapping g-bytswa ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-calendar-g-calend-ads}@anchor{332}@anchor{gnat_rm/the_gnat_library id53}@anchor{333} +@anchor{gnat_rm/the_gnat_library gnat-calendar-g-calend-ads}@anchor{336}@anchor{gnat_rm/the_gnat_library id53}@anchor{337} @section @code{GNAT.Calendar} (@code{g-calend.ads}) @@ -23725,7 +23896,7 @@ Also provides conversion of @code{Ada.Calendar.Time} values to and from the C @code{timeval} format. @node GNAT Calendar Time_IO g-catiio ads,GNAT CRC32 g-crc32 ads,GNAT Calendar g-calend ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id54}@anchor{334}@anchor{gnat_rm/the_gnat_library gnat-calendar-time-io-g-catiio-ads}@anchor{335} +@anchor{gnat_rm/the_gnat_library id54}@anchor{338}@anchor{gnat_rm/the_gnat_library gnat-calendar-time-io-g-catiio-ads}@anchor{339} @section @code{GNAT.Calendar.Time_IO} (@code{g-catiio.ads}) @@ -23736,7 +23907,7 @@ C @code{timeval} format. @geindex GNAT.Calendar.Time_IO (g-catiio.ads) @node GNAT CRC32 g-crc32 ads,GNAT Case_Util g-casuti ads,GNAT Calendar Time_IO g-catiio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id55}@anchor{336}@anchor{gnat_rm/the_gnat_library gnat-crc32-g-crc32-ads}@anchor{337} +@anchor{gnat_rm/the_gnat_library id55}@anchor{33a}@anchor{gnat_rm/the_gnat_library gnat-crc32-g-crc32-ads}@anchor{33b} @section @code{GNAT.CRC32} (@code{g-crc32.ads}) @@ -23753,7 +23924,7 @@ of this algorithm see Aug. 1988. Sarwate, D.V. @node GNAT Case_Util g-casuti ads,GNAT CGI g-cgi ads,GNAT CRC32 g-crc32 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id56}@anchor{338}@anchor{gnat_rm/the_gnat_library gnat-case-util-g-casuti-ads}@anchor{339} +@anchor{gnat_rm/the_gnat_library id56}@anchor{33c}@anchor{gnat_rm/the_gnat_library gnat-case-util-g-casuti-ads}@anchor{33d} @section @code{GNAT.Case_Util} (@code{g-casuti.ads}) @@ -23768,7 +23939,7 @@ without the overhead of the full casing tables in @code{Ada.Characters.Handling}. @node GNAT CGI g-cgi ads,GNAT CGI Cookie g-cgicoo ads,GNAT Case_Util g-casuti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id57}@anchor{33a}@anchor{gnat_rm/the_gnat_library gnat-cgi-g-cgi-ads}@anchor{33b} +@anchor{gnat_rm/the_gnat_library id57}@anchor{33e}@anchor{gnat_rm/the_gnat_library gnat-cgi-g-cgi-ads}@anchor{33f} @section @code{GNAT.CGI} (@code{g-cgi.ads}) @@ -23783,7 +23954,7 @@ builds a table whose index is the key and provides some services to deal with this table. @node GNAT CGI Cookie g-cgicoo ads,GNAT CGI Debug g-cgideb ads,GNAT CGI g-cgi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-cookie-g-cgicoo-ads}@anchor{33c}@anchor{gnat_rm/the_gnat_library id58}@anchor{33d} +@anchor{gnat_rm/the_gnat_library gnat-cgi-cookie-g-cgicoo-ads}@anchor{340}@anchor{gnat_rm/the_gnat_library id58}@anchor{341} @section @code{GNAT.CGI.Cookie} (@code{g-cgicoo.ads}) @@ -23798,7 +23969,7 @@ Common Gateway Interface (CGI). It exports services to deal with Web cookies (piece of information kept in the Web client software). @node GNAT CGI Debug g-cgideb ads,GNAT Command_Line g-comlin ads,GNAT CGI Cookie g-cgicoo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-debug-g-cgideb-ads}@anchor{33e}@anchor{gnat_rm/the_gnat_library id59}@anchor{33f} +@anchor{gnat_rm/the_gnat_library gnat-cgi-debug-g-cgideb-ads}@anchor{342}@anchor{gnat_rm/the_gnat_library id59}@anchor{343} @section @code{GNAT.CGI.Debug} (@code{g-cgideb.ads}) @@ -23810,7 +23981,7 @@ This is a package to help debugging CGI (Common Gateway Interface) programs written in Ada. @node GNAT Command_Line g-comlin ads,GNAT Compiler_Version g-comver ads,GNAT CGI Debug g-cgideb ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id60}@anchor{340}@anchor{gnat_rm/the_gnat_library gnat-command-line-g-comlin-ads}@anchor{341} +@anchor{gnat_rm/the_gnat_library id60}@anchor{344}@anchor{gnat_rm/the_gnat_library gnat-command-line-g-comlin-ads}@anchor{345} @section @code{GNAT.Command_Line} (@code{g-comlin.ads}) @@ -23823,7 +23994,7 @@ including the ability to scan for named switches with optional parameters and expand file names using wild card notations. @node GNAT Compiler_Version g-comver ads,GNAT Ctrl_C g-ctrl_c ads,GNAT Command_Line g-comlin ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-compiler-version-g-comver-ads}@anchor{342}@anchor{gnat_rm/the_gnat_library id61}@anchor{343} +@anchor{gnat_rm/the_gnat_library gnat-compiler-version-g-comver-ads}@anchor{346}@anchor{gnat_rm/the_gnat_library id61}@anchor{347} @section @code{GNAT.Compiler_Version} (@code{g-comver.ads}) @@ -23841,7 +24012,7 @@ of the compiler if a consistent tool set is used to compile all units of a partition). @node GNAT Ctrl_C g-ctrl_c ads,GNAT Current_Exception g-curexc ads,GNAT Compiler_Version g-comver ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-ctrl-c-g-ctrl-c-ads}@anchor{344}@anchor{gnat_rm/the_gnat_library id62}@anchor{345} +@anchor{gnat_rm/the_gnat_library gnat-ctrl-c-g-ctrl-c-ads}@anchor{348}@anchor{gnat_rm/the_gnat_library id62}@anchor{349} @section @code{GNAT.Ctrl_C} (@code{g-ctrl_c.ads}) @@ -23852,7 +24023,7 @@ of a partition). Provides a simple interface to handle Ctrl-C keyboard events. @node GNAT Current_Exception g-curexc ads,GNAT Debug_Pools g-debpoo ads,GNAT Ctrl_C g-ctrl_c ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id63}@anchor{346}@anchor{gnat_rm/the_gnat_library gnat-current-exception-g-curexc-ads}@anchor{347} +@anchor{gnat_rm/the_gnat_library id63}@anchor{34a}@anchor{gnat_rm/the_gnat_library gnat-current-exception-g-curexc-ads}@anchor{34b} @section @code{GNAT.Current_Exception} (@code{g-curexc.ads}) @@ -23869,7 +24040,7 @@ This is particularly useful in simulating typical facilities for obtaining information about exceptions provided by Ada 83 compilers. @node GNAT Debug_Pools g-debpoo ads,GNAT Debug_Utilities g-debuti ads,GNAT Current_Exception g-curexc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-debug-pools-g-debpoo-ads}@anchor{348}@anchor{gnat_rm/the_gnat_library id64}@anchor{349} +@anchor{gnat_rm/the_gnat_library gnat-debug-pools-g-debpoo-ads}@anchor{34c}@anchor{gnat_rm/the_gnat_library id64}@anchor{34d} @section @code{GNAT.Debug_Pools} (@code{g-debpoo.ads}) @@ -23886,7 +24057,7 @@ problems. See @code{The GNAT Debug_Pool Facility} section in the @cite{GNAT User's Guide}. @node GNAT Debug_Utilities g-debuti ads,GNAT Decode_String g-decstr ads,GNAT Debug_Pools g-debpoo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id65}@anchor{34a}@anchor{gnat_rm/the_gnat_library gnat-debug-utilities-g-debuti-ads}@anchor{34b} +@anchor{gnat_rm/the_gnat_library id65}@anchor{34e}@anchor{gnat_rm/the_gnat_library gnat-debug-utilities-g-debuti-ads}@anchor{34f} @section @code{GNAT.Debug_Utilities} (@code{g-debuti.ads}) @@ -23899,7 +24070,7 @@ to and from string images of address values. Supports both C and Ada formats for hexadecimal literals. @node GNAT Decode_String g-decstr ads,GNAT Decode_UTF8_String g-deutst ads,GNAT Debug_Utilities g-debuti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-decode-string-g-decstr-ads}@anchor{34c}@anchor{gnat_rm/the_gnat_library id66}@anchor{34d} +@anchor{gnat_rm/the_gnat_library gnat-decode-string-g-decstr-ads}@anchor{350}@anchor{gnat_rm/the_gnat_library id66}@anchor{351} @section @code{GNAT.Decode_String} (@code{g-decstr.ads}) @@ -23923,7 +24094,7 @@ Useful in conjunction with Unicode character coding. Note there is a preinstantiation for UTF-8. See next entry. @node GNAT Decode_UTF8_String g-deutst ads,GNAT Directory_Operations g-dirope ads,GNAT Decode_String g-decstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-decode-utf8-string-g-deutst-ads}@anchor{34e}@anchor{gnat_rm/the_gnat_library id67}@anchor{34f} +@anchor{gnat_rm/the_gnat_library gnat-decode-utf8-string-g-deutst-ads}@anchor{352}@anchor{gnat_rm/the_gnat_library id67}@anchor{353} @section @code{GNAT.Decode_UTF8_String} (@code{g-deutst.ads}) @@ -23944,7 +24115,7 @@ preinstantiation for UTF-8. See next entry. A preinstantiation of GNAT.Decode_Strings for UTF-8 encoding. @node GNAT Directory_Operations g-dirope ads,GNAT Directory_Operations Iteration g-diopit ads,GNAT Decode_UTF8_String g-deutst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-directory-operations-g-dirope-ads}@anchor{350}@anchor{gnat_rm/the_gnat_library id68}@anchor{351} +@anchor{gnat_rm/the_gnat_library gnat-directory-operations-g-dirope-ads}@anchor{354}@anchor{gnat_rm/the_gnat_library id68}@anchor{355} @section @code{GNAT.Directory_Operations} (@code{g-dirope.ads}) @@ -23957,7 +24128,7 @@ the current directory, making new directories, and scanning the files in a directory. @node GNAT Directory_Operations Iteration g-diopit ads,GNAT Dynamic_HTables g-dynhta ads,GNAT Directory_Operations g-dirope ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id69}@anchor{352}@anchor{gnat_rm/the_gnat_library gnat-directory-operations-iteration-g-diopit-ads}@anchor{353} +@anchor{gnat_rm/the_gnat_library id69}@anchor{356}@anchor{gnat_rm/the_gnat_library gnat-directory-operations-iteration-g-diopit-ads}@anchor{357} @section @code{GNAT.Directory_Operations.Iteration} (@code{g-diopit.ads}) @@ -23969,7 +24140,7 @@ A child unit of GNAT.Directory_Operations providing additional operations for iterating through directories. @node GNAT Dynamic_HTables g-dynhta ads,GNAT Dynamic_Tables g-dyntab ads,GNAT Directory_Operations Iteration g-diopit ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id70}@anchor{354}@anchor{gnat_rm/the_gnat_library gnat-dynamic-htables-g-dynhta-ads}@anchor{355} +@anchor{gnat_rm/the_gnat_library id70}@anchor{358}@anchor{gnat_rm/the_gnat_library gnat-dynamic-htables-g-dynhta-ads}@anchor{359} @section @code{GNAT.Dynamic_HTables} (@code{g-dynhta.ads}) @@ -23987,7 +24158,7 @@ dynamic instances of the hash table, while an instantiation of @code{GNAT.HTable} creates a single instance of the hash table. @node GNAT Dynamic_Tables g-dyntab ads,GNAT Encode_String g-encstr ads,GNAT Dynamic_HTables g-dynhta ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-dynamic-tables-g-dyntab-ads}@anchor{356}@anchor{gnat_rm/the_gnat_library id71}@anchor{357} +@anchor{gnat_rm/the_gnat_library gnat-dynamic-tables-g-dyntab-ads}@anchor{35a}@anchor{gnat_rm/the_gnat_library id71}@anchor{35b} @section @code{GNAT.Dynamic_Tables} (@code{g-dyntab.ads}) @@ -24007,7 +24178,7 @@ dynamic instances of the table, while an instantiation of @code{GNAT.Table} creates a single instance of the table type. @node GNAT Encode_String g-encstr ads,GNAT Encode_UTF8_String g-enutst ads,GNAT Dynamic_Tables g-dyntab ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id72}@anchor{358}@anchor{gnat_rm/the_gnat_library gnat-encode-string-g-encstr-ads}@anchor{359} +@anchor{gnat_rm/the_gnat_library id72}@anchor{35c}@anchor{gnat_rm/the_gnat_library gnat-encode-string-g-encstr-ads}@anchor{35d} @section @code{GNAT.Encode_String} (@code{g-encstr.ads}) @@ -24029,7 +24200,7 @@ encoding method. Useful in conjunction with Unicode character coding. Note there is a preinstantiation for UTF-8. See next entry. @node GNAT Encode_UTF8_String g-enutst ads,GNAT Exception_Actions g-excact ads,GNAT Encode_String g-encstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-encode-utf8-string-g-enutst-ads}@anchor{35a}@anchor{gnat_rm/the_gnat_library id73}@anchor{35b} +@anchor{gnat_rm/the_gnat_library gnat-encode-utf8-string-g-enutst-ads}@anchor{35e}@anchor{gnat_rm/the_gnat_library id73}@anchor{35f} @section @code{GNAT.Encode_UTF8_String} (@code{g-enutst.ads}) @@ -24050,7 +24221,7 @@ Note there is a preinstantiation for UTF-8. See next entry. A preinstantiation of GNAT.Encode_Strings for UTF-8 encoding. @node GNAT Exception_Actions g-excact ads,GNAT Exception_Traces g-exctra ads,GNAT Encode_UTF8_String g-enutst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exception-actions-g-excact-ads}@anchor{35c}@anchor{gnat_rm/the_gnat_library id74}@anchor{35d} +@anchor{gnat_rm/the_gnat_library gnat-exception-actions-g-excact-ads}@anchor{360}@anchor{gnat_rm/the_gnat_library id74}@anchor{361} @section @code{GNAT.Exception_Actions} (@code{g-excact.ads}) @@ -24063,7 +24234,7 @@ for specific exceptions, or when any exception is raised. This can be used for instance to force a core dump to ease debugging. @node GNAT Exception_Traces g-exctra ads,GNAT Exceptions g-except ads,GNAT Exception_Actions g-excact ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exception-traces-g-exctra-ads}@anchor{35e}@anchor{gnat_rm/the_gnat_library id75}@anchor{35f} +@anchor{gnat_rm/the_gnat_library gnat-exception-traces-g-exctra-ads}@anchor{362}@anchor{gnat_rm/the_gnat_library id75}@anchor{363} @section @code{GNAT.Exception_Traces} (@code{g-exctra.ads}) @@ -24077,7 +24248,7 @@ Provides an interface allowing to control automatic output upon exception occurrences. @node GNAT Exceptions g-except ads,GNAT Expect g-expect ads,GNAT Exception_Traces g-exctra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id76}@anchor{360}@anchor{gnat_rm/the_gnat_library gnat-exceptions-g-except-ads}@anchor{361} +@anchor{gnat_rm/the_gnat_library id76}@anchor{364}@anchor{gnat_rm/the_gnat_library gnat-exceptions-g-except-ads}@anchor{365} @section @code{GNAT.Exceptions} (@code{g-except.ads}) @@ -24098,7 +24269,7 @@ predefined exceptions, and for example allow raising @code{Constraint_Error} with a message from a pure subprogram. @node GNAT Expect g-expect ads,GNAT Expect TTY g-exptty ads,GNAT Exceptions g-except ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-expect-g-expect-ads}@anchor{362}@anchor{gnat_rm/the_gnat_library id77}@anchor{363} +@anchor{gnat_rm/the_gnat_library gnat-expect-g-expect-ads}@anchor{366}@anchor{gnat_rm/the_gnat_library id77}@anchor{367} @section @code{GNAT.Expect} (@code{g-expect.ads}) @@ -24114,7 +24285,7 @@ It is not implemented for cross ports, and in particular is not implemented for VxWorks or LynxOS. @node GNAT Expect TTY g-exptty ads,GNAT Float_Control g-flocon ads,GNAT Expect g-expect ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id78}@anchor{364}@anchor{gnat_rm/the_gnat_library gnat-expect-tty-g-exptty-ads}@anchor{365} +@anchor{gnat_rm/the_gnat_library id78}@anchor{368}@anchor{gnat_rm/the_gnat_library gnat-expect-tty-g-exptty-ads}@anchor{369} @section @code{GNAT.Expect.TTY} (@code{g-exptty.ads}) @@ -24126,7 +24297,7 @@ ports. It is not implemented for cross ports, and in particular is not implemented for VxWorks or LynxOS. @node GNAT Float_Control g-flocon ads,GNAT Formatted_String g-forstr ads,GNAT Expect TTY g-exptty ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id79}@anchor{366}@anchor{gnat_rm/the_gnat_library gnat-float-control-g-flocon-ads}@anchor{367} +@anchor{gnat_rm/the_gnat_library id79}@anchor{36a}@anchor{gnat_rm/the_gnat_library gnat-float-control-g-flocon-ads}@anchor{36b} @section @code{GNAT.Float_Control} (@code{g-flocon.ads}) @@ -24140,7 +24311,7 @@ library calls may cause this mode to be modified, and the Reset procedure in this package can be used to reestablish the required mode. @node GNAT Formatted_String g-forstr ads,GNAT Heap_Sort g-heasor ads,GNAT Float_Control g-flocon ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id80}@anchor{368}@anchor{gnat_rm/the_gnat_library gnat-formatted-string-g-forstr-ads}@anchor{369} +@anchor{gnat_rm/the_gnat_library id80}@anchor{36c}@anchor{gnat_rm/the_gnat_library gnat-formatted-string-g-forstr-ads}@anchor{36d} @section @code{GNAT.Formatted_String} (@code{g-forstr.ads}) @@ -24155,7 +24326,7 @@ derived from Integer, Float or enumerations as values for the formatted string. @node GNAT Heap_Sort g-heasor ads,GNAT Heap_Sort_A g-hesora ads,GNAT Formatted_String g-forstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-heasor-ads}@anchor{36a}@anchor{gnat_rm/the_gnat_library id81}@anchor{36b} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-heasor-ads}@anchor{36e}@anchor{gnat_rm/the_gnat_library id81}@anchor{36f} @section @code{GNAT.Heap_Sort} (@code{g-heasor.ads}) @@ -24169,7 +24340,7 @@ access-to-procedure values. The algorithm used is a modified heap sort that performs approximately N*log(N) comparisons in the worst case. @node GNAT Heap_Sort_A g-hesora ads,GNAT Heap_Sort_G g-hesorg ads,GNAT Heap_Sort g-heasor ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id82}@anchor{36c}@anchor{gnat_rm/the_gnat_library gnat-heap-sort-a-g-hesora-ads}@anchor{36d} +@anchor{gnat_rm/the_gnat_library id82}@anchor{370}@anchor{gnat_rm/the_gnat_library gnat-heap-sort-a-g-hesora-ads}@anchor{371} @section @code{GNAT.Heap_Sort_A} (@code{g-hesora.ads}) @@ -24185,7 +24356,7 @@ This differs from @code{GNAT.Heap_Sort} in having a less convenient interface, but may be slightly more efficient. @node GNAT Heap_Sort_G g-hesorg ads,GNAT HTable g-htable ads,GNAT Heap_Sort_A g-hesora ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id83}@anchor{36e}@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-g-hesorg-ads}@anchor{36f} +@anchor{gnat_rm/the_gnat_library id83}@anchor{372}@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-g-hesorg-ads}@anchor{373} @section @code{GNAT.Heap_Sort_G} (@code{g-hesorg.ads}) @@ -24199,7 +24370,7 @@ if the procedures can be inlined, at the expense of duplicating code for multiple instantiations. @node GNAT HTable g-htable ads,GNAT IO g-io ads,GNAT Heap_Sort_G g-hesorg ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id84}@anchor{370}@anchor{gnat_rm/the_gnat_library gnat-htable-g-htable-ads}@anchor{371} +@anchor{gnat_rm/the_gnat_library id84}@anchor{374}@anchor{gnat_rm/the_gnat_library gnat-htable-g-htable-ads}@anchor{375} @section @code{GNAT.HTable} (@code{g-htable.ads}) @@ -24212,7 +24383,7 @@ data. Provides two approaches, one a simple static approach, and the other allowing arbitrary dynamic hash tables. @node GNAT IO g-io ads,GNAT IO_Aux g-io_aux ads,GNAT HTable g-htable ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id85}@anchor{372}@anchor{gnat_rm/the_gnat_library gnat-io-g-io-ads}@anchor{373} +@anchor{gnat_rm/the_gnat_library id85}@anchor{376}@anchor{gnat_rm/the_gnat_library gnat-io-g-io-ads}@anchor{377} @section @code{GNAT.IO} (@code{g-io.ads}) @@ -24228,7 +24399,7 @@ Standard_Input, and writing characters, strings and integers to either Standard_Output or Standard_Error. @node GNAT IO_Aux g-io_aux ads,GNAT Lock_Files g-locfil ads,GNAT IO g-io ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-io-aux-g-io-aux-ads}@anchor{374}@anchor{gnat_rm/the_gnat_library id86}@anchor{375} +@anchor{gnat_rm/the_gnat_library gnat-io-aux-g-io-aux-ads}@anchor{378}@anchor{gnat_rm/the_gnat_library id86}@anchor{379} @section @code{GNAT.IO_Aux} (@code{g-io_aux.ads}) @@ -24242,7 +24413,7 @@ Provides some auxiliary functions for use with Text_IO, including a test for whether a file exists, and functions for reading a line of text. @node GNAT Lock_Files g-locfil ads,GNAT MBBS_Discrete_Random g-mbdira ads,GNAT IO_Aux g-io_aux ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id87}@anchor{376}@anchor{gnat_rm/the_gnat_library gnat-lock-files-g-locfil-ads}@anchor{377} +@anchor{gnat_rm/the_gnat_library id87}@anchor{37a}@anchor{gnat_rm/the_gnat_library gnat-lock-files-g-locfil-ads}@anchor{37b} @section @code{GNAT.Lock_Files} (@code{g-locfil.ads}) @@ -24256,7 +24427,7 @@ Provides a general interface for using files as locks. Can be used for providing program level synchronization. @node GNAT MBBS_Discrete_Random g-mbdira ads,GNAT MBBS_Float_Random g-mbflra ads,GNAT Lock_Files g-locfil ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id88}@anchor{378}@anchor{gnat_rm/the_gnat_library gnat-mbbs-discrete-random-g-mbdira-ads}@anchor{379} +@anchor{gnat_rm/the_gnat_library id88}@anchor{37c}@anchor{gnat_rm/the_gnat_library gnat-mbbs-discrete-random-g-mbdira-ads}@anchor{37d} @section @code{GNAT.MBBS_Discrete_Random} (@code{g-mbdira.ads}) @@ -24268,7 +24439,7 @@ The original implementation of @code{Ada.Numerics.Discrete_Random}. Uses a modified version of the Blum-Blum-Shub generator. @node GNAT MBBS_Float_Random g-mbflra ads,GNAT MD5 g-md5 ads,GNAT MBBS_Discrete_Random g-mbdira ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id89}@anchor{37a}@anchor{gnat_rm/the_gnat_library gnat-mbbs-float-random-g-mbflra-ads}@anchor{37b} +@anchor{gnat_rm/the_gnat_library id89}@anchor{37e}@anchor{gnat_rm/the_gnat_library gnat-mbbs-float-random-g-mbflra-ads}@anchor{37f} @section @code{GNAT.MBBS_Float_Random} (@code{g-mbflra.ads}) @@ -24280,7 +24451,7 @@ The original implementation of @code{Ada.Numerics.Float_Random}. Uses a modified version of the Blum-Blum-Shub generator. @node GNAT MD5 g-md5 ads,GNAT Memory_Dump g-memdum ads,GNAT MBBS_Float_Random g-mbflra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id90}@anchor{37c}@anchor{gnat_rm/the_gnat_library gnat-md5-g-md5-ads}@anchor{37d} +@anchor{gnat_rm/the_gnat_library id90}@anchor{380}@anchor{gnat_rm/the_gnat_library gnat-md5-g-md5-ads}@anchor{381} @section @code{GNAT.MD5} (@code{g-md5.ads}) @@ -24293,7 +24464,7 @@ the HMAC-MD5 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT Memory_Dump g-memdum ads,GNAT Most_Recent_Exception g-moreex ads,GNAT MD5 g-md5 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id91}@anchor{37e}@anchor{gnat_rm/the_gnat_library gnat-memory-dump-g-memdum-ads}@anchor{37f} +@anchor{gnat_rm/the_gnat_library id91}@anchor{382}@anchor{gnat_rm/the_gnat_library gnat-memory-dump-g-memdum-ads}@anchor{383} @section @code{GNAT.Memory_Dump} (@code{g-memdum.ads}) @@ -24306,7 +24477,7 @@ standard output or standard error files. Uses GNAT.IO for actual output. @node GNAT Most_Recent_Exception g-moreex ads,GNAT OS_Lib g-os_lib ads,GNAT Memory_Dump g-memdum ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id92}@anchor{380}@anchor{gnat_rm/the_gnat_library gnat-most-recent-exception-g-moreex-ads}@anchor{381} +@anchor{gnat_rm/the_gnat_library id92}@anchor{384}@anchor{gnat_rm/the_gnat_library gnat-most-recent-exception-g-moreex-ads}@anchor{385} @section @code{GNAT.Most_Recent_Exception} (@code{g-moreex.ads}) @@ -24320,7 +24491,7 @@ various logging purposes, including duplicating functionality of some Ada 83 implementation dependent extensions. @node GNAT OS_Lib g-os_lib ads,GNAT Perfect_Hash_Generators g-pehage ads,GNAT Most_Recent_Exception g-moreex ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-os-lib-g-os-lib-ads}@anchor{382}@anchor{gnat_rm/the_gnat_library id93}@anchor{383} +@anchor{gnat_rm/the_gnat_library gnat-os-lib-g-os-lib-ads}@anchor{386}@anchor{gnat_rm/the_gnat_library id93}@anchor{387} @section @code{GNAT.OS_Lib} (@code{g-os_lib.ads}) @@ -24336,7 +24507,7 @@ including a portable spawn procedure, and access to environment variables and error return codes. @node GNAT Perfect_Hash_Generators g-pehage ads,GNAT Random_Numbers g-rannum ads,GNAT OS_Lib g-os_lib ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-perfect-hash-generators-g-pehage-ads}@anchor{384}@anchor{gnat_rm/the_gnat_library id94}@anchor{385} +@anchor{gnat_rm/the_gnat_library gnat-perfect-hash-generators-g-pehage-ads}@anchor{388}@anchor{gnat_rm/the_gnat_library id94}@anchor{389} @section @code{GNAT.Perfect_Hash_Generators} (@code{g-pehage.ads}) @@ -24354,7 +24525,7 @@ hashcode are in the same order. These hashing functions are very convenient for use with realtime applications. @node GNAT Random_Numbers g-rannum ads,GNAT Regexp g-regexp ads,GNAT Perfect_Hash_Generators g-pehage ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-random-numbers-g-rannum-ads}@anchor{386}@anchor{gnat_rm/the_gnat_library id95}@anchor{387} +@anchor{gnat_rm/the_gnat_library gnat-random-numbers-g-rannum-ads}@anchor{38a}@anchor{gnat_rm/the_gnat_library id95}@anchor{38b} @section @code{GNAT.Random_Numbers} (@code{g-rannum.ads}) @@ -24366,7 +24537,7 @@ Provides random number capabilities which extend those available in the standard Ada library and are more convenient to use. @node GNAT Regexp g-regexp ads,GNAT Registry g-regist ads,GNAT Random_Numbers g-rannum ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{251}@anchor{gnat_rm/the_gnat_library id96}@anchor{388} +@anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{255}@anchor{gnat_rm/the_gnat_library id96}@anchor{38c} @section @code{GNAT.Regexp} (@code{g-regexp.ads}) @@ -24382,7 +24553,7 @@ simplest of the three pattern matching packages provided, and is particularly suitable for 'file globbing' applications. @node GNAT Registry g-regist ads,GNAT Regpat g-regpat ads,GNAT Regexp g-regexp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-registry-g-regist-ads}@anchor{389}@anchor{gnat_rm/the_gnat_library id97}@anchor{38a} +@anchor{gnat_rm/the_gnat_library gnat-registry-g-regist-ads}@anchor{38d}@anchor{gnat_rm/the_gnat_library id97}@anchor{38e} @section @code{GNAT.Registry} (@code{g-regist.ads}) @@ -24396,7 +24567,7 @@ registry API, but at a lower level of abstraction, refer to the Win32.Winreg package provided with the Win32Ada binding @node GNAT Regpat g-regpat ads,GNAT Rewrite_Data g-rewdat ads,GNAT Registry g-regist ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id98}@anchor{38b}@anchor{gnat_rm/the_gnat_library gnat-regpat-g-regpat-ads}@anchor{38c} +@anchor{gnat_rm/the_gnat_library id98}@anchor{38f}@anchor{gnat_rm/the_gnat_library gnat-regpat-g-regpat-ads}@anchor{390} @section @code{GNAT.Regpat} (@code{g-regpat.ads}) @@ -24411,7 +24582,7 @@ from the original V7 style regular expression library written in C by Henry Spencer (and binary compatible with this C library). @node GNAT Rewrite_Data g-rewdat ads,GNAT Secondary_Stack_Info g-sestin ads,GNAT Regpat g-regpat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id99}@anchor{38d}@anchor{gnat_rm/the_gnat_library gnat-rewrite-data-g-rewdat-ads}@anchor{38e} +@anchor{gnat_rm/the_gnat_library id99}@anchor{391}@anchor{gnat_rm/the_gnat_library gnat-rewrite-data-g-rewdat-ads}@anchor{392} @section @code{GNAT.Rewrite_Data} (@code{g-rewdat.ads}) @@ -24425,7 +24596,7 @@ full content to be processed is not loaded into memory all at once. This makes this interface usable for large files or socket streams. @node GNAT Secondary_Stack_Info g-sestin ads,GNAT Semaphores g-semaph ads,GNAT Rewrite_Data g-rewdat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id100}@anchor{38f}@anchor{gnat_rm/the_gnat_library gnat-secondary-stack-info-g-sestin-ads}@anchor{390} +@anchor{gnat_rm/the_gnat_library id100}@anchor{393}@anchor{gnat_rm/the_gnat_library gnat-secondary-stack-info-g-sestin-ads}@anchor{394} @section @code{GNAT.Secondary_Stack_Info} (@code{g-sestin.ads}) @@ -24437,7 +24608,7 @@ Provide the capability to query the high water mark of the current task's secondary stack. @node GNAT Semaphores g-semaph ads,GNAT Serial_Communications g-sercom ads,GNAT Secondary_Stack_Info g-sestin ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id101}@anchor{391}@anchor{gnat_rm/the_gnat_library gnat-semaphores-g-semaph-ads}@anchor{392} +@anchor{gnat_rm/the_gnat_library id101}@anchor{395}@anchor{gnat_rm/the_gnat_library gnat-semaphores-g-semaph-ads}@anchor{396} @section @code{GNAT.Semaphores} (@code{g-semaph.ads}) @@ -24448,7 +24619,7 @@ secondary stack. Provides classic counting and binary semaphores using protected types. @node GNAT Serial_Communications g-sercom ads,GNAT SHA1 g-sha1 ads,GNAT Semaphores g-semaph ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-serial-communications-g-sercom-ads}@anchor{393}@anchor{gnat_rm/the_gnat_library id102}@anchor{394} +@anchor{gnat_rm/the_gnat_library gnat-serial-communications-g-sercom-ads}@anchor{397}@anchor{gnat_rm/the_gnat_library id102}@anchor{398} @section @code{GNAT.Serial_Communications} (@code{g-sercom.ads}) @@ -24460,7 +24631,7 @@ Provides a simple interface to send and receive data over a serial port. This is only supported on GNU/Linux and Windows. @node GNAT SHA1 g-sha1 ads,GNAT SHA224 g-sha224 ads,GNAT Serial_Communications g-sercom ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha1-g-sha1-ads}@anchor{395}@anchor{gnat_rm/the_gnat_library id103}@anchor{396} +@anchor{gnat_rm/the_gnat_library gnat-sha1-g-sha1-ads}@anchor{399}@anchor{gnat_rm/the_gnat_library id103}@anchor{39a} @section @code{GNAT.SHA1} (@code{g-sha1.ads}) @@ -24473,7 +24644,7 @@ and RFC 3174, and the HMAC-SHA1 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA224 g-sha224 ads,GNAT SHA256 g-sha256 ads,GNAT SHA1 g-sha1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha224-g-sha224-ads}@anchor{397}@anchor{gnat_rm/the_gnat_library id104}@anchor{398} +@anchor{gnat_rm/the_gnat_library gnat-sha224-g-sha224-ads}@anchor{39b}@anchor{gnat_rm/the_gnat_library id104}@anchor{39c} @section @code{GNAT.SHA224} (@code{g-sha224.ads}) @@ -24486,7 +24657,7 @@ and the HMAC-SHA224 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA256 g-sha256 ads,GNAT SHA384 g-sha384 ads,GNAT SHA224 g-sha224 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id105}@anchor{399}@anchor{gnat_rm/the_gnat_library gnat-sha256-g-sha256-ads}@anchor{39a} +@anchor{gnat_rm/the_gnat_library id105}@anchor{39d}@anchor{gnat_rm/the_gnat_library gnat-sha256-g-sha256-ads}@anchor{39e} @section @code{GNAT.SHA256} (@code{g-sha256.ads}) @@ -24499,7 +24670,7 @@ and the HMAC-SHA256 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA384 g-sha384 ads,GNAT SHA512 g-sha512 ads,GNAT SHA256 g-sha256 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha384-g-sha384-ads}@anchor{39b}@anchor{gnat_rm/the_gnat_library id106}@anchor{39c} +@anchor{gnat_rm/the_gnat_library gnat-sha384-g-sha384-ads}@anchor{39f}@anchor{gnat_rm/the_gnat_library id106}@anchor{3a0} @section @code{GNAT.SHA384} (@code{g-sha384.ads}) @@ -24512,7 +24683,7 @@ and the HMAC-SHA384 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA512 g-sha512 ads,GNAT Signals g-signal ads,GNAT SHA384 g-sha384 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha512-g-sha512-ads}@anchor{39d}@anchor{gnat_rm/the_gnat_library id107}@anchor{39e} +@anchor{gnat_rm/the_gnat_library gnat-sha512-g-sha512-ads}@anchor{3a1}@anchor{gnat_rm/the_gnat_library id107}@anchor{3a2} @section @code{GNAT.SHA512} (@code{g-sha512.ads}) @@ -24525,7 +24696,7 @@ and the HMAC-SHA512 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT Signals g-signal ads,GNAT Sockets g-socket ads,GNAT SHA512 g-sha512 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-signals-g-signal-ads}@anchor{39f}@anchor{gnat_rm/the_gnat_library id108}@anchor{3a0} +@anchor{gnat_rm/the_gnat_library gnat-signals-g-signal-ads}@anchor{3a3}@anchor{gnat_rm/the_gnat_library id108}@anchor{3a4} @section @code{GNAT.Signals} (@code{g-signal.ads}) @@ -24537,7 +24708,7 @@ Provides the ability to manipulate the blocked status of signals on supported targets. @node GNAT Sockets g-socket ads,GNAT Source_Info g-souinf ads,GNAT Signals g-signal ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id109}@anchor{3a1}@anchor{gnat_rm/the_gnat_library gnat-sockets-g-socket-ads}@anchor{3a2} +@anchor{gnat_rm/the_gnat_library id109}@anchor{3a5}@anchor{gnat_rm/the_gnat_library gnat-sockets-g-socket-ads}@anchor{3a6} @section @code{GNAT.Sockets} (@code{g-socket.ads}) @@ -24552,7 +24723,7 @@ on all native GNAT ports and on VxWorks cross prots. It is not implemented for the LynxOS cross port. @node GNAT Source_Info g-souinf ads,GNAT Spelling_Checker g-speche ads,GNAT Sockets g-socket ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-source-info-g-souinf-ads}@anchor{3a3}@anchor{gnat_rm/the_gnat_library id110}@anchor{3a4} +@anchor{gnat_rm/the_gnat_library gnat-source-info-g-souinf-ads}@anchor{3a7}@anchor{gnat_rm/the_gnat_library id110}@anchor{3a8} @section @code{GNAT.Source_Info} (@code{g-souinf.ads}) @@ -24566,7 +24737,7 @@ subprograms yielding the date and time of the current compilation (like the C macros @code{__DATE__} and @code{__TIME__}) @node GNAT Spelling_Checker g-speche ads,GNAT Spelling_Checker_Generic g-spchge ads,GNAT Source_Info g-souinf ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-g-speche-ads}@anchor{3a5}@anchor{gnat_rm/the_gnat_library id111}@anchor{3a6} +@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-g-speche-ads}@anchor{3a9}@anchor{gnat_rm/the_gnat_library id111}@anchor{3aa} @section @code{GNAT.Spelling_Checker} (@code{g-speche.ads}) @@ -24578,7 +24749,7 @@ Provides a function for determining whether one string is a plausible near misspelling of another string. @node GNAT Spelling_Checker_Generic g-spchge ads,GNAT Spitbol Patterns g-spipat ads,GNAT Spelling_Checker g-speche ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id112}@anchor{3a7}@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-generic-g-spchge-ads}@anchor{3a8} +@anchor{gnat_rm/the_gnat_library id112}@anchor{3ab}@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-generic-g-spchge-ads}@anchor{3ac} @section @code{GNAT.Spelling_Checker_Generic} (@code{g-spchge.ads}) @@ -24591,7 +24762,7 @@ determining whether one string is a plausible near misspelling of another string. @node GNAT Spitbol Patterns g-spipat ads,GNAT Spitbol g-spitbo ads,GNAT Spelling_Checker_Generic g-spchge ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id113}@anchor{3a9}@anchor{gnat_rm/the_gnat_library gnat-spitbol-patterns-g-spipat-ads}@anchor{3aa} +@anchor{gnat_rm/the_gnat_library id113}@anchor{3ad}@anchor{gnat_rm/the_gnat_library gnat-spitbol-patterns-g-spipat-ads}@anchor{3ae} @section @code{GNAT.Spitbol.Patterns} (@code{g-spipat.ads}) @@ -24607,7 +24778,7 @@ the SNOBOL4 dynamic pattern construction and matching capabilities, using the efficient algorithm developed by Robert Dewar for the SPITBOL system. @node GNAT Spitbol g-spitbo ads,GNAT Spitbol Table_Boolean g-sptabo ads,GNAT Spitbol Patterns g-spipat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-g-spitbo-ads}@anchor{3ab}@anchor{gnat_rm/the_gnat_library id114}@anchor{3ac} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-g-spitbo-ads}@anchor{3af}@anchor{gnat_rm/the_gnat_library id114}@anchor{3b0} @section @code{GNAT.Spitbol} (@code{g-spitbo.ads}) @@ -24622,7 +24793,7 @@ useful for constructing arbitrary mappings from strings in the style of the SNOBOL4 TABLE function. @node GNAT Spitbol Table_Boolean g-sptabo ads,GNAT Spitbol Table_Integer g-sptain ads,GNAT Spitbol g-spitbo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-boolean-g-sptabo-ads}@anchor{3ad}@anchor{gnat_rm/the_gnat_library id115}@anchor{3ae} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-boolean-g-sptabo-ads}@anchor{3b1}@anchor{gnat_rm/the_gnat_library id115}@anchor{3b2} @section @code{GNAT.Spitbol.Table_Boolean} (@code{g-sptabo.ads}) @@ -24637,7 +24808,7 @@ for type @code{Standard.Boolean}, giving an implementation of sets of string values. @node GNAT Spitbol Table_Integer g-sptain ads,GNAT Spitbol Table_VString g-sptavs ads,GNAT Spitbol Table_Boolean g-sptabo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-integer-g-sptain-ads}@anchor{3af}@anchor{gnat_rm/the_gnat_library id116}@anchor{3b0} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-integer-g-sptain-ads}@anchor{3b3}@anchor{gnat_rm/the_gnat_library id116}@anchor{3b4} @section @code{GNAT.Spitbol.Table_Integer} (@code{g-sptain.ads}) @@ -24654,7 +24825,7 @@ for type @code{Standard.Integer}, giving an implementation of maps from string to integer values. @node GNAT Spitbol Table_VString g-sptavs ads,GNAT SSE g-sse ads,GNAT Spitbol Table_Integer g-sptain ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id117}@anchor{3b1}@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-vstring-g-sptavs-ads}@anchor{3b2} +@anchor{gnat_rm/the_gnat_library id117}@anchor{3b5}@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-vstring-g-sptavs-ads}@anchor{3b6} @section @code{GNAT.Spitbol.Table_VString} (@code{g-sptavs.ads}) @@ -24671,7 +24842,7 @@ a variable length string type, giving an implementation of general maps from strings to strings. @node GNAT SSE g-sse ads,GNAT SSE Vector_Types g-ssvety ads,GNAT Spitbol Table_VString g-sptavs ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id118}@anchor{3b3}@anchor{gnat_rm/the_gnat_library gnat-sse-g-sse-ads}@anchor{3b4} +@anchor{gnat_rm/the_gnat_library id118}@anchor{3b7}@anchor{gnat_rm/the_gnat_library gnat-sse-g-sse-ads}@anchor{3b8} @section @code{GNAT.SSE} (@code{g-sse.ads}) @@ -24683,7 +24854,7 @@ targets. It exposes vector component types together with a general introduction to the binding contents and use. @node GNAT SSE Vector_Types g-ssvety ads,GNAT String_Hash g-strhas ads,GNAT SSE g-sse ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sse-vector-types-g-ssvety-ads}@anchor{3b5}@anchor{gnat_rm/the_gnat_library id119}@anchor{3b6} +@anchor{gnat_rm/the_gnat_library gnat-sse-vector-types-g-ssvety-ads}@anchor{3b9}@anchor{gnat_rm/the_gnat_library id119}@anchor{3ba} @section @code{GNAT.SSE.Vector_Types} (@code{g-ssvety.ads}) @@ -24692,7 +24863,7 @@ introduction to the binding contents and use. SSE vector types for use with SSE related intrinsics. @node GNAT String_Hash g-strhas ads,GNAT Strings g-string ads,GNAT SSE Vector_Types g-ssvety ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-string-hash-g-strhas-ads}@anchor{3b7}@anchor{gnat_rm/the_gnat_library id120}@anchor{3b8} +@anchor{gnat_rm/the_gnat_library gnat-string-hash-g-strhas-ads}@anchor{3bb}@anchor{gnat_rm/the_gnat_library id120}@anchor{3bc} @section @code{GNAT.String_Hash} (@code{g-strhas.ads}) @@ -24704,7 +24875,7 @@ Provides a generic hash function working on arrays of scalars. Both the scalar type and the hash result type are parameters. @node GNAT Strings g-string ads,GNAT String_Split g-strspl ads,GNAT String_Hash g-strhas ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-strings-g-string-ads}@anchor{3b9}@anchor{gnat_rm/the_gnat_library id121}@anchor{3ba} +@anchor{gnat_rm/the_gnat_library gnat-strings-g-string-ads}@anchor{3bd}@anchor{gnat_rm/the_gnat_library id121}@anchor{3be} @section @code{GNAT.Strings} (@code{g-string.ads}) @@ -24714,7 +24885,7 @@ Common String access types and related subprograms. Basically it defines a string access and an array of string access types. @node GNAT String_Split g-strspl ads,GNAT Table g-table ads,GNAT Strings g-string ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-string-split-g-strspl-ads}@anchor{3bb}@anchor{gnat_rm/the_gnat_library id122}@anchor{3bc} +@anchor{gnat_rm/the_gnat_library gnat-string-split-g-strspl-ads}@anchor{3bf}@anchor{gnat_rm/the_gnat_library id122}@anchor{3c0} @section @code{GNAT.String_Split} (@code{g-strspl.ads}) @@ -24728,7 +24899,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node GNAT Table g-table ads,GNAT Task_Lock g-tasloc ads,GNAT String_Split g-strspl ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-table-g-table-ads}@anchor{3bd}@anchor{gnat_rm/the_gnat_library id123}@anchor{3be} +@anchor{gnat_rm/the_gnat_library gnat-table-g-table-ads}@anchor{3c1}@anchor{gnat_rm/the_gnat_library id123}@anchor{3c2} @section @code{GNAT.Table} (@code{g-table.ads}) @@ -24748,7 +24919,7 @@ while an instantiation of @code{GNAT.Dynamic_Tables} creates a type that can be used to define dynamic instances of the table. @node GNAT Task_Lock g-tasloc ads,GNAT Time_Stamp g-timsta ads,GNAT Table g-table ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id124}@anchor{3bf}@anchor{gnat_rm/the_gnat_library gnat-task-lock-g-tasloc-ads}@anchor{3c0} +@anchor{gnat_rm/the_gnat_library id124}@anchor{3c3}@anchor{gnat_rm/the_gnat_library gnat-task-lock-g-tasloc-ads}@anchor{3c4} @section @code{GNAT.Task_Lock} (@code{g-tasloc.ads}) @@ -24765,7 +24936,7 @@ single global task lock. Appropriate for use in situations where contention between tasks is very rarely expected. @node GNAT Time_Stamp g-timsta ads,GNAT Threads g-thread ads,GNAT Task_Lock g-tasloc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id125}@anchor{3c1}@anchor{gnat_rm/the_gnat_library gnat-time-stamp-g-timsta-ads}@anchor{3c2} +@anchor{gnat_rm/the_gnat_library id125}@anchor{3c5}@anchor{gnat_rm/the_gnat_library gnat-time-stamp-g-timsta-ads}@anchor{3c6} @section @code{GNAT.Time_Stamp} (@code{g-timsta.ads}) @@ -24780,7 +24951,7 @@ represents the current date and time in ISO 8601 format. This is a very simple routine with minimal code and there are no dependencies on any other unit. @node GNAT Threads g-thread ads,GNAT Traceback g-traceb ads,GNAT Time_Stamp g-timsta ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-threads-g-thread-ads}@anchor{3c3}@anchor{gnat_rm/the_gnat_library id126}@anchor{3c4} +@anchor{gnat_rm/the_gnat_library gnat-threads-g-thread-ads}@anchor{3c7}@anchor{gnat_rm/the_gnat_library id126}@anchor{3c8} @section @code{GNAT.Threads} (@code{g-thread.ads}) @@ -24797,7 +24968,7 @@ further details if your program has threads that are created by a non-Ada environment which then accesses Ada code. @node GNAT Traceback g-traceb ads,GNAT Traceback Symbolic g-trasym ads,GNAT Threads g-thread ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id127}@anchor{3c5}@anchor{gnat_rm/the_gnat_library gnat-traceback-g-traceb-ads}@anchor{3c6} +@anchor{gnat_rm/the_gnat_library id127}@anchor{3c9}@anchor{gnat_rm/the_gnat_library gnat-traceback-g-traceb-ads}@anchor{3ca} @section @code{GNAT.Traceback} (@code{g-traceb.ads}) @@ -24809,7 +24980,7 @@ Provides a facility for obtaining non-symbolic traceback information, useful in various debugging situations. @node GNAT Traceback Symbolic g-trasym ads,GNAT UTF_32 g-table ads,GNAT Traceback g-traceb ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-traceback-symbolic-g-trasym-ads}@anchor{3c7}@anchor{gnat_rm/the_gnat_library id128}@anchor{3c8} +@anchor{gnat_rm/the_gnat_library gnat-traceback-symbolic-g-trasym-ads}@anchor{3cb}@anchor{gnat_rm/the_gnat_library id128}@anchor{3cc} @section @code{GNAT.Traceback.Symbolic} (@code{g-trasym.ads}) @@ -24818,7 +24989,7 @@ in various debugging situations. @geindex Trace back facilities @node GNAT UTF_32 g-table ads,GNAT Wide_Spelling_Checker g-u3spch ads,GNAT Traceback Symbolic g-trasym ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id129}@anchor{3c9}@anchor{gnat_rm/the_gnat_library gnat-utf-32-g-table-ads}@anchor{3ca} +@anchor{gnat_rm/the_gnat_library id129}@anchor{3cd}@anchor{gnat_rm/the_gnat_library gnat-utf-32-g-table-ads}@anchor{3ce} @section @code{GNAT.UTF_32} (@code{g-table.ads}) @@ -24837,7 +25008,7 @@ lower case to upper case fold routine corresponding to the Ada 2005 rules for identifier equivalence. @node GNAT Wide_Spelling_Checker g-u3spch ads,GNAT Wide_Spelling_Checker g-wispch ads,GNAT UTF_32 g-table ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-u3spch-ads}@anchor{3cb}@anchor{gnat_rm/the_gnat_library id130}@anchor{3cc} +@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-u3spch-ads}@anchor{3cf}@anchor{gnat_rm/the_gnat_library id130}@anchor{3d0} @section @code{GNAT.Wide_Spelling_Checker} (@code{g-u3spch.ads}) @@ -24850,7 +25021,7 @@ near misspelling of another wide wide string, where the strings are represented using the UTF_32_String type defined in System.Wch_Cnv. @node GNAT Wide_Spelling_Checker g-wispch ads,GNAT Wide_String_Split g-wistsp ads,GNAT Wide_Spelling_Checker g-u3spch ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-wispch-ads}@anchor{3cd}@anchor{gnat_rm/the_gnat_library id131}@anchor{3ce} +@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-wispch-ads}@anchor{3d1}@anchor{gnat_rm/the_gnat_library id131}@anchor{3d2} @section @code{GNAT.Wide_Spelling_Checker} (@code{g-wispch.ads}) @@ -24862,7 +25033,7 @@ Provides a function for determining whether one wide string is a plausible near misspelling of another wide string. @node GNAT Wide_String_Split g-wistsp ads,GNAT Wide_Wide_Spelling_Checker g-zspche ads,GNAT Wide_Spelling_Checker g-wispch ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id132}@anchor{3cf}@anchor{gnat_rm/the_gnat_library gnat-wide-string-split-g-wistsp-ads}@anchor{3d0} +@anchor{gnat_rm/the_gnat_library id132}@anchor{3d3}@anchor{gnat_rm/the_gnat_library gnat-wide-string-split-g-wistsp-ads}@anchor{3d4} @section @code{GNAT.Wide_String_Split} (@code{g-wistsp.ads}) @@ -24876,7 +25047,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node GNAT Wide_Wide_Spelling_Checker g-zspche ads,GNAT Wide_Wide_String_Split g-zistsp ads,GNAT Wide_String_Split g-wistsp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-wide-spelling-checker-g-zspche-ads}@anchor{3d1}@anchor{gnat_rm/the_gnat_library id133}@anchor{3d2} +@anchor{gnat_rm/the_gnat_library gnat-wide-wide-spelling-checker-g-zspche-ads}@anchor{3d5}@anchor{gnat_rm/the_gnat_library id133}@anchor{3d6} @section @code{GNAT.Wide_Wide_Spelling_Checker} (@code{g-zspche.ads}) @@ -24888,7 +25059,7 @@ Provides a function for determining whether one wide wide string is a plausible near misspelling of another wide wide string. @node GNAT Wide_Wide_String_Split g-zistsp ads,Interfaces C Extensions i-cexten ads,GNAT Wide_Wide_Spelling_Checker g-zspche ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-wide-string-split-g-zistsp-ads}@anchor{3d3}@anchor{gnat_rm/the_gnat_library id134}@anchor{3d4} +@anchor{gnat_rm/the_gnat_library gnat-wide-wide-string-split-g-zistsp-ads}@anchor{3d7}@anchor{gnat_rm/the_gnat_library id134}@anchor{3d8} @section @code{GNAT.Wide_Wide_String_Split} (@code{g-zistsp.ads}) @@ -24902,7 +25073,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node Interfaces C Extensions i-cexten ads,Interfaces C Streams i-cstrea ads,GNAT Wide_Wide_String_Split g-zistsp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library interfaces-c-extensions-i-cexten-ads}@anchor{3d5}@anchor{gnat_rm/the_gnat_library id135}@anchor{3d6} +@anchor{gnat_rm/the_gnat_library interfaces-c-extensions-i-cexten-ads}@anchor{3d9}@anchor{gnat_rm/the_gnat_library id135}@anchor{3da} @section @code{Interfaces.C.Extensions} (@code{i-cexten.ads}) @@ -24913,7 +25084,7 @@ for use with either manually or automatically generated bindings to C libraries. @node Interfaces C Streams i-cstrea ads,Interfaces Packed_Decimal i-pacdec ads,Interfaces C Extensions i-cexten ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library interfaces-c-streams-i-cstrea-ads}@anchor{3d7}@anchor{gnat_rm/the_gnat_library id136}@anchor{3d8} +@anchor{gnat_rm/the_gnat_library interfaces-c-streams-i-cstrea-ads}@anchor{3db}@anchor{gnat_rm/the_gnat_library id136}@anchor{3dc} @section @code{Interfaces.C.Streams} (@code{i-cstrea.ads}) @@ -24926,7 +25097,7 @@ This package is a binding for the most commonly used operations on C streams. @node Interfaces Packed_Decimal i-pacdec ads,Interfaces VxWorks i-vxwork ads,Interfaces C Streams i-cstrea ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library interfaces-packed-decimal-i-pacdec-ads}@anchor{3d9}@anchor{gnat_rm/the_gnat_library id137}@anchor{3da} +@anchor{gnat_rm/the_gnat_library interfaces-packed-decimal-i-pacdec-ads}@anchor{3dd}@anchor{gnat_rm/the_gnat_library id137}@anchor{3de} @section @code{Interfaces.Packed_Decimal} (@code{i-pacdec.ads}) @@ -24941,7 +25112,7 @@ from a packed decimal format compatible with that used on IBM mainframes. @node Interfaces VxWorks i-vxwork ads,Interfaces VxWorks Int_Connection i-vxinco ads,Interfaces Packed_Decimal i-pacdec ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id138}@anchor{3db}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-i-vxwork-ads}@anchor{3dc} +@anchor{gnat_rm/the_gnat_library id138}@anchor{3df}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-i-vxwork-ads}@anchor{3e0} @section @code{Interfaces.VxWorks} (@code{i-vxwork.ads}) @@ -24957,7 +25128,7 @@ In particular, it interfaces with the VxWorks hardware interrupt facilities. @node Interfaces VxWorks Int_Connection i-vxinco ads,Interfaces VxWorks IO i-vxwoio ads,Interfaces VxWorks i-vxwork ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library interfaces-vxworks-int-connection-i-vxinco-ads}@anchor{3dd}@anchor{gnat_rm/the_gnat_library id139}@anchor{3de} +@anchor{gnat_rm/the_gnat_library interfaces-vxworks-int-connection-i-vxinco-ads}@anchor{3e1}@anchor{gnat_rm/the_gnat_library id139}@anchor{3e2} @section @code{Interfaces.VxWorks.Int_Connection} (@code{i-vxinco.ads}) @@ -24973,7 +25144,7 @@ intConnect() with a custom routine for installing interrupt handlers. @node Interfaces VxWorks IO i-vxwoio ads,System Address_Image s-addima ads,Interfaces VxWorks Int_Connection i-vxinco ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library interfaces-vxworks-io-i-vxwoio-ads}@anchor{3df}@anchor{gnat_rm/the_gnat_library id140}@anchor{3e0} +@anchor{gnat_rm/the_gnat_library interfaces-vxworks-io-i-vxwoio-ads}@anchor{3e3}@anchor{gnat_rm/the_gnat_library id140}@anchor{3e4} @section @code{Interfaces.VxWorks.IO} (@code{i-vxwoio.ads}) @@ -24996,7 +25167,7 @@ function codes. A particular use of this package is to enable the use of Get_Immediate under VxWorks. @node System Address_Image s-addima ads,System Assertions s-assert ads,Interfaces VxWorks IO i-vxwoio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id141}@anchor{3e1}@anchor{gnat_rm/the_gnat_library system-address-image-s-addima-ads}@anchor{3e2} +@anchor{gnat_rm/the_gnat_library id141}@anchor{3e5}@anchor{gnat_rm/the_gnat_library system-address-image-s-addima-ads}@anchor{3e6} @section @code{System.Address_Image} (@code{s-addima.ads}) @@ -25012,7 +25183,7 @@ function that gives an (implementation dependent) string which identifies an address. @node System Assertions s-assert ads,System Atomic_Counters s-atocou ads,System Address_Image s-addima ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-assertions-s-assert-ads}@anchor{3e3}@anchor{gnat_rm/the_gnat_library id142}@anchor{3e4} +@anchor{gnat_rm/the_gnat_library system-assertions-s-assert-ads}@anchor{3e7}@anchor{gnat_rm/the_gnat_library id142}@anchor{3e8} @section @code{System.Assertions} (@code{s-assert.ads}) @@ -25028,7 +25199,7 @@ by an run-time assertion failure, as well as the routine that is used internally to raise this assertion. @node System Atomic_Counters s-atocou ads,System Memory s-memory ads,System Assertions s-assert ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id143}@anchor{3e5}@anchor{gnat_rm/the_gnat_library system-atomic-counters-s-atocou-ads}@anchor{3e6} +@anchor{gnat_rm/the_gnat_library id143}@anchor{3e9}@anchor{gnat_rm/the_gnat_library system-atomic-counters-s-atocou-ads}@anchor{3ea} @section @code{System.Atomic_Counters} (@code{s-atocou.ads}) @@ -25042,7 +25213,7 @@ on most targets, including all Alpha, ia64, PowerPC, SPARC V9, x86, and x86_64 platforms. @node System Memory s-memory ads,System Multiprocessors s-multip ads,System Atomic_Counters s-atocou ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-memory-s-memory-ads}@anchor{3e7}@anchor{gnat_rm/the_gnat_library id144}@anchor{3e8} +@anchor{gnat_rm/the_gnat_library system-memory-s-memory-ads}@anchor{3eb}@anchor{gnat_rm/the_gnat_library id144}@anchor{3ec} @section @code{System.Memory} (@code{s-memory.ads}) @@ -25060,7 +25231,7 @@ calls to this unit may be made for low level allocation uses (for example see the body of @code{GNAT.Tables}). @node System Multiprocessors s-multip ads,System Multiprocessors Dispatching_Domains s-mudido ads,System Memory s-memory ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id145}@anchor{3e9}@anchor{gnat_rm/the_gnat_library system-multiprocessors-s-multip-ads}@anchor{3ea} +@anchor{gnat_rm/the_gnat_library id145}@anchor{3ed}@anchor{gnat_rm/the_gnat_library system-multiprocessors-s-multip-ads}@anchor{3ee} @section @code{System.Multiprocessors} (@code{s-multip.ads}) @@ -25073,7 +25244,7 @@ in GNAT we also make it available in Ada 95 and Ada 2005 (where it is technically an implementation-defined addition). @node System Multiprocessors Dispatching_Domains s-mudido ads,System Partition_Interface s-parint ads,System Multiprocessors s-multip ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-multiprocessors-dispatching-domains-s-mudido-ads}@anchor{3eb}@anchor{gnat_rm/the_gnat_library id146}@anchor{3ec} +@anchor{gnat_rm/the_gnat_library system-multiprocessors-dispatching-domains-s-mudido-ads}@anchor{3ef}@anchor{gnat_rm/the_gnat_library id146}@anchor{3f0} @section @code{System.Multiprocessors.Dispatching_Domains} (@code{s-mudido.ads}) @@ -25086,7 +25257,7 @@ in GNAT we also make it available in Ada 95 and Ada 2005 (where it is technically an implementation-defined addition). @node System Partition_Interface s-parint ads,System Pool_Global s-pooglo ads,System Multiprocessors Dispatching_Domains s-mudido ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id147}@anchor{3ed}@anchor{gnat_rm/the_gnat_library system-partition-interface-s-parint-ads}@anchor{3ee} +@anchor{gnat_rm/the_gnat_library id147}@anchor{3f1}@anchor{gnat_rm/the_gnat_library system-partition-interface-s-parint-ads}@anchor{3f2} @section @code{System.Partition_Interface} (@code{s-parint.ads}) @@ -25099,7 +25270,7 @@ is used primarily in a distribution context when using Annex E with @code{GLADE}. @node System Pool_Global s-pooglo ads,System Pool_Local s-pooloc ads,System Partition_Interface s-parint ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id148}@anchor{3ef}@anchor{gnat_rm/the_gnat_library system-pool-global-s-pooglo-ads}@anchor{3f0} +@anchor{gnat_rm/the_gnat_library id148}@anchor{3f3}@anchor{gnat_rm/the_gnat_library system-pool-global-s-pooglo-ads}@anchor{3f4} @section @code{System.Pool_Global} (@code{s-pooglo.ads}) @@ -25116,7 +25287,7 @@ declared. It uses malloc/free to allocate/free and does not attempt to do any automatic reclamation. @node System Pool_Local s-pooloc ads,System Restrictions s-restri ads,System Pool_Global s-pooglo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-pool-local-s-pooloc-ads}@anchor{3f1}@anchor{gnat_rm/the_gnat_library id149}@anchor{3f2} +@anchor{gnat_rm/the_gnat_library system-pool-local-s-pooloc-ads}@anchor{3f5}@anchor{gnat_rm/the_gnat_library id149}@anchor{3f6} @section @code{System.Pool_Local} (@code{s-pooloc.ads}) @@ -25133,7 +25304,7 @@ a list of allocated blocks, so that all storage allocated for the pool can be freed automatically when the pool is finalized. @node System Restrictions s-restri ads,System Rident s-rident ads,System Pool_Local s-pooloc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id150}@anchor{3f3}@anchor{gnat_rm/the_gnat_library system-restrictions-s-restri-ads}@anchor{3f4} +@anchor{gnat_rm/the_gnat_library id150}@anchor{3f7}@anchor{gnat_rm/the_gnat_library system-restrictions-s-restri-ads}@anchor{3f8} @section @code{System.Restrictions} (@code{s-restri.ads}) @@ -25149,7 +25320,7 @@ compiler determined information on which restrictions are violated by one or more packages in the partition. @node System Rident s-rident ads,System Strings Stream_Ops s-ststop ads,System Restrictions s-restri ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-rident-s-rident-ads}@anchor{3f5}@anchor{gnat_rm/the_gnat_library id151}@anchor{3f6} +@anchor{gnat_rm/the_gnat_library system-rident-s-rident-ads}@anchor{3f9}@anchor{gnat_rm/the_gnat_library id151}@anchor{3fa} @section @code{System.Rident} (@code{s-rident.ads}) @@ -25165,7 +25336,7 @@ since the necessary instantiation is included in package System.Restrictions. @node System Strings Stream_Ops s-ststop ads,System Unsigned_Types s-unstyp ads,System Rident s-rident ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id152}@anchor{3f7}@anchor{gnat_rm/the_gnat_library system-strings-stream-ops-s-ststop-ads}@anchor{3f8} +@anchor{gnat_rm/the_gnat_library id152}@anchor{3fb}@anchor{gnat_rm/the_gnat_library system-strings-stream-ops-s-ststop-ads}@anchor{3fc} @section @code{System.Strings.Stream_Ops} (@code{s-ststop.ads}) @@ -25181,7 +25352,7 @@ stream attributes are applied to string types, but the subprograms in this package can be used directly by application programs. @node System Unsigned_Types s-unstyp ads,System Wch_Cnv s-wchcnv ads,System Strings Stream_Ops s-ststop ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-unsigned-types-s-unstyp-ads}@anchor{3f9}@anchor{gnat_rm/the_gnat_library id153}@anchor{3fa} +@anchor{gnat_rm/the_gnat_library system-unsigned-types-s-unstyp-ads}@anchor{3fd}@anchor{gnat_rm/the_gnat_library id153}@anchor{3fe} @section @code{System.Unsigned_Types} (@code{s-unstyp.ads}) @@ -25194,7 +25365,7 @@ also contains some related definitions for other specialized types used by the compiler in connection with packed array types. @node System Wch_Cnv s-wchcnv ads,System Wch_Con s-wchcon ads,System Unsigned_Types s-unstyp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-wch-cnv-s-wchcnv-ads}@anchor{3fb}@anchor{gnat_rm/the_gnat_library id154}@anchor{3fc} +@anchor{gnat_rm/the_gnat_library system-wch-cnv-s-wchcnv-ads}@anchor{3ff}@anchor{gnat_rm/the_gnat_library id154}@anchor{400} @section @code{System.Wch_Cnv} (@code{s-wchcnv.ads}) @@ -25215,7 +25386,7 @@ encoding method. It uses definitions in package @code{System.Wch_Con}. @node System Wch_Con s-wchcon ads,,System Wch_Cnv s-wchcnv ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library system-wch-con-s-wchcon-ads}@anchor{3fd}@anchor{gnat_rm/the_gnat_library id155}@anchor{3fe} +@anchor{gnat_rm/the_gnat_library system-wch-con-s-wchcon-ads}@anchor{401}@anchor{gnat_rm/the_gnat_library id155}@anchor{402} @section @code{System.Wch_Con} (@code{s-wchcon.ads}) @@ -25227,7 +25398,7 @@ in ordinary strings. These definitions are used by the package @code{System.Wch_Cnv}. @node Interfacing to Other Languages,Specialized Needs Annexes,The GNAT Library,Top -@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-other-languages}@anchor{11}@anchor{gnat_rm/interfacing_to_other_languages doc}@anchor{3ff}@anchor{gnat_rm/interfacing_to_other_languages id1}@anchor{400} +@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-other-languages}@anchor{11}@anchor{gnat_rm/interfacing_to_other_languages doc}@anchor{403}@anchor{gnat_rm/interfacing_to_other_languages id1}@anchor{404} @chapter Interfacing to Other Languages @@ -25245,7 +25416,7 @@ provided. @end menu @node Interfacing to C,Interfacing to C++,,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-c}@anchor{401}@anchor{gnat_rm/interfacing_to_other_languages id2}@anchor{402} +@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-c}@anchor{405}@anchor{gnat_rm/interfacing_to_other_languages id2}@anchor{406} @section Interfacing to C @@ -25383,7 +25554,7 @@ of the length corresponding to the @code{type'Size} value in Ada. @end itemize @node Interfacing to C++,Interfacing to COBOL,Interfacing to C,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id4}@anchor{403}@anchor{gnat_rm/interfacing_to_other_languages id3}@anchor{45} +@anchor{gnat_rm/interfacing_to_other_languages id4}@anchor{407}@anchor{gnat_rm/interfacing_to_other_languages id3}@anchor{49} @section Interfacing to C++ @@ -25440,7 +25611,7 @@ The @code{External_Name} is the name of the C++ RTTI symbol. You can then cover a specific C++ exception in an exception handler. @node Interfacing to COBOL,Interfacing to Fortran,Interfacing to C++,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id5}@anchor{404}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-cobol}@anchor{405} +@anchor{gnat_rm/interfacing_to_other_languages id5}@anchor{408}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-cobol}@anchor{409} @section Interfacing to COBOL @@ -25448,7 +25619,7 @@ Interfacing to COBOL is achieved as described in section B.4 of the Ada Reference Manual. @node Interfacing to Fortran,Interfacing to non-GNAT Ada code,Interfacing to COBOL,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id6}@anchor{406}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-fortran}@anchor{407} +@anchor{gnat_rm/interfacing_to_other_languages id6}@anchor{40a}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-fortran}@anchor{40b} @section Interfacing to Fortran @@ -25458,7 +25629,7 @@ multi-dimensional array causes the array to be stored in column-major order as required for convenient interface to Fortran. @node Interfacing to non-GNAT Ada code,,Interfacing to Fortran,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-non-gnat-ada-code}@anchor{408}@anchor{gnat_rm/interfacing_to_other_languages id7}@anchor{409} +@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-non-gnat-ada-code}@anchor{40c}@anchor{gnat_rm/interfacing_to_other_languages id7}@anchor{40d} @section Interfacing to non-GNAT Ada code @@ -25482,7 +25653,7 @@ values or simple record types without variants, or simple array types with fixed bounds. @node Specialized Needs Annexes,Implementation of Specific Ada Features,Interfacing to Other Languages,Top -@anchor{gnat_rm/specialized_needs_annexes specialized-needs-annexes}@anchor{12}@anchor{gnat_rm/specialized_needs_annexes doc}@anchor{40a}@anchor{gnat_rm/specialized_needs_annexes id1}@anchor{40b} +@anchor{gnat_rm/specialized_needs_annexes specialized-needs-annexes}@anchor{12}@anchor{gnat_rm/specialized_needs_annexes doc}@anchor{40e}@anchor{gnat_rm/specialized_needs_annexes id1}@anchor{40f} @chapter Specialized Needs Annexes @@ -25523,7 +25694,7 @@ in Ada 2005) is fully implemented. @end table @node Implementation of Specific Ada Features,Implementation of Ada 2012 Features,Specialized Needs Annexes,Top -@anchor{gnat_rm/implementation_of_specific_ada_features implementation-of-specific-ada-features}@anchor{13}@anchor{gnat_rm/implementation_of_specific_ada_features doc}@anchor{40c}@anchor{gnat_rm/implementation_of_specific_ada_features id1}@anchor{40d} +@anchor{gnat_rm/implementation_of_specific_ada_features implementation-of-specific-ada-features}@anchor{13}@anchor{gnat_rm/implementation_of_specific_ada_features doc}@anchor{410}@anchor{gnat_rm/implementation_of_specific_ada_features id1}@anchor{411} @chapter Implementation of Specific Ada Features @@ -25541,7 +25712,7 @@ facilities. @end menu @node Machine Code Insertions,GNAT Implementation of Tasking,,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features machine-code-insertions}@anchor{164}@anchor{gnat_rm/implementation_of_specific_ada_features id2}@anchor{40e} +@anchor{gnat_rm/implementation_of_specific_ada_features machine-code-insertions}@anchor{168}@anchor{gnat_rm/implementation_of_specific_ada_features id2}@anchor{412} @section Machine Code Insertions @@ -25709,7 +25880,7 @@ according to normal visibility rules. In particular if there is no qualification is required. @node GNAT Implementation of Tasking,GNAT Implementation of Shared Passive Packages,Machine Code Insertions,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id3}@anchor{40f}@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-tasking}@anchor{410} +@anchor{gnat_rm/implementation_of_specific_ada_features id3}@anchor{413}@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-tasking}@anchor{414} @section GNAT Implementation of Tasking @@ -25725,7 +25896,7 @@ to compliance with the Real-Time Systems Annex. @end menu @node Mapping Ada Tasks onto the Underlying Kernel Threads,Ensuring Compliance with the Real-Time Annex,,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features mapping-ada-tasks-onto-the-underlying-kernel-threads}@anchor{411}@anchor{gnat_rm/implementation_of_specific_ada_features id4}@anchor{412} +@anchor{gnat_rm/implementation_of_specific_ada_features mapping-ada-tasks-onto-the-underlying-kernel-threads}@anchor{415}@anchor{gnat_rm/implementation_of_specific_ada_features id4}@anchor{416} @subsection Mapping Ada Tasks onto the Underlying Kernel Threads @@ -25794,7 +25965,7 @@ support this functionality when the parent contains more than one task. @geindex Forking a new process @node Ensuring Compliance with the Real-Time Annex,Support for Locking Policies,Mapping Ada Tasks onto the Underlying Kernel Threads,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features id5}@anchor{413}@anchor{gnat_rm/implementation_of_specific_ada_features ensuring-compliance-with-the-real-time-annex}@anchor{414} +@anchor{gnat_rm/implementation_of_specific_ada_features id5}@anchor{417}@anchor{gnat_rm/implementation_of_specific_ada_features ensuring-compliance-with-the-real-time-annex}@anchor{418} @subsection Ensuring Compliance with the Real-Time Annex @@ -25845,7 +26016,7 @@ placed at the end. @c Support_for_Locking_Policies @node Support for Locking Policies,,Ensuring Compliance with the Real-Time Annex,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features support-for-locking-policies}@anchor{415} +@anchor{gnat_rm/implementation_of_specific_ada_features support-for-locking-policies}@anchor{419} @subsection Support for Locking Policies @@ -25879,7 +26050,7 @@ then ceiling locking is used. Otherwise, the @code{Ceiling_Locking} policy is ignored. @node GNAT Implementation of Shared Passive Packages,Code Generation for Array Aggregates,GNAT Implementation of Tasking,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id6}@anchor{416}@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-shared-passive-packages}@anchor{417} +@anchor{gnat_rm/implementation_of_specific_ada_features id6}@anchor{41a}@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-shared-passive-packages}@anchor{41b} @section GNAT Implementation of Shared Passive Packages @@ -25980,7 +26151,7 @@ GNAT supports shared passive packages on all platforms except for OpenVMS. @node Code Generation for Array Aggregates,The Size of Discriminated Records with Default Discriminants,GNAT Implementation of Shared Passive Packages,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features code-generation-for-array-aggregates}@anchor{418}@anchor{gnat_rm/implementation_of_specific_ada_features id7}@anchor{419} +@anchor{gnat_rm/implementation_of_specific_ada_features code-generation-for-array-aggregates}@anchor{41c}@anchor{gnat_rm/implementation_of_specific_ada_features id7}@anchor{41d} @section Code Generation for Array Aggregates @@ -26011,7 +26182,7 @@ component values and static subtypes also lead to simpler code. @end menu @node Static constant aggregates with static bounds,Constant aggregates with unconstrained nominal types,,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features static-constant-aggregates-with-static-bounds}@anchor{41a}@anchor{gnat_rm/implementation_of_specific_ada_features id8}@anchor{41b} +@anchor{gnat_rm/implementation_of_specific_ada_features static-constant-aggregates-with-static-bounds}@anchor{41e}@anchor{gnat_rm/implementation_of_specific_ada_features id8}@anchor{41f} @subsection Static constant aggregates with static bounds @@ -26058,7 +26229,7 @@ Zero2: constant two_dim := (others => (others => 0)); @end example @node Constant aggregates with unconstrained nominal types,Aggregates with static bounds,Static constant aggregates with static bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features constant-aggregates-with-unconstrained-nominal-types}@anchor{41c}@anchor{gnat_rm/implementation_of_specific_ada_features id9}@anchor{41d} +@anchor{gnat_rm/implementation_of_specific_ada_features constant-aggregates-with-unconstrained-nominal-types}@anchor{420}@anchor{gnat_rm/implementation_of_specific_ada_features id9}@anchor{421} @subsection Constant aggregates with unconstrained nominal types @@ -26073,7 +26244,7 @@ Cr_Unc : constant One_Unc := (12,24,36); @end example @node Aggregates with static bounds,Aggregates with nonstatic bounds,Constant aggregates with unconstrained nominal types,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features id10}@anchor{41e}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-static-bounds}@anchor{41f} +@anchor{gnat_rm/implementation_of_specific_ada_features id10}@anchor{422}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-static-bounds}@anchor{423} @subsection Aggregates with static bounds @@ -26101,7 +26272,7 @@ end loop; @end example @node Aggregates with nonstatic bounds,Aggregates in assignment statements,Aggregates with static bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features id11}@anchor{420}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-nonstatic-bounds}@anchor{421} +@anchor{gnat_rm/implementation_of_specific_ada_features id11}@anchor{424}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-nonstatic-bounds}@anchor{425} @subsection Aggregates with nonstatic bounds @@ -26112,7 +26283,7 @@ have to be applied to sub-arrays individually, if they do not have statically compatible subtypes. @node Aggregates in assignment statements,,Aggregates with nonstatic bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features id12}@anchor{422}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-in-assignment-statements}@anchor{423} +@anchor{gnat_rm/implementation_of_specific_ada_features id12}@anchor{426}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-in-assignment-statements}@anchor{427} @subsection Aggregates in assignment statements @@ -26154,7 +26325,7 @@ a temporary (created either by the front-end or the code generator) and then that temporary will be copied onto the target. @node The Size of Discriminated Records with Default Discriminants,Strict Conformance to the Ada Reference Manual,Code Generation for Array Aggregates,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id13}@anchor{424}@anchor{gnat_rm/implementation_of_specific_ada_features the-size-of-discriminated-records-with-default-discriminants}@anchor{425} +@anchor{gnat_rm/implementation_of_specific_ada_features id13}@anchor{428}@anchor{gnat_rm/implementation_of_specific_ada_features the-size-of-discriminated-records-with-default-discriminants}@anchor{429} @section The Size of Discriminated Records with Default Discriminants @@ -26234,7 +26405,7 @@ say) must be consistent, so it is imperative that the object, once created, remain invariant. @node Strict Conformance to the Ada Reference Manual,,The Size of Discriminated Records with Default Discriminants,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features strict-conformance-to-the-ada-reference-manual}@anchor{426}@anchor{gnat_rm/implementation_of_specific_ada_features id14}@anchor{427} +@anchor{gnat_rm/implementation_of_specific_ada_features strict-conformance-to-the-ada-reference-manual}@anchor{42a}@anchor{gnat_rm/implementation_of_specific_ada_features id14}@anchor{42b} @section Strict Conformance to the Ada Reference Manual @@ -26261,7 +26432,7 @@ behavior (although at the cost of a significant performance penalty), so infinite and NaN values are properly generated. @node Implementation of Ada 2012 Features,Obsolescent Features,Implementation of Specific Ada Features,Top -@anchor{gnat_rm/implementation_of_ada_2012_features doc}@anchor{428}@anchor{gnat_rm/implementation_of_ada_2012_features implementation-of-ada-2012-features}@anchor{14}@anchor{gnat_rm/implementation_of_ada_2012_features id1}@anchor{429} +@anchor{gnat_rm/implementation_of_ada_2012_features doc}@anchor{42c}@anchor{gnat_rm/implementation_of_ada_2012_features implementation-of-ada-2012-features}@anchor{14}@anchor{gnat_rm/implementation_of_ada_2012_features id1}@anchor{42d} @chapter Implementation of Ada 2012 Features @@ -28427,7 +28598,7 @@ RM References: H.04 (8/1) @end itemize @node Obsolescent Features,Compatibility and Porting Guide,Implementation of Ada 2012 Features,Top -@anchor{gnat_rm/obsolescent_features id1}@anchor{42a}@anchor{gnat_rm/obsolescent_features doc}@anchor{42b}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{15} +@anchor{gnat_rm/obsolescent_features id1}@anchor{42e}@anchor{gnat_rm/obsolescent_features doc}@anchor{42f}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{15} @chapter Obsolescent Features @@ -28446,7 +28617,7 @@ compatibility purposes. @end menu @node pragma No_Run_Time,pragma Ravenscar,,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id2}@anchor{42c}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{42d} +@anchor{gnat_rm/obsolescent_features id2}@anchor{430}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{431} @section pragma No_Run_Time @@ -28459,7 +28630,7 @@ preferred usage is to use an appropriately configured run-time that includes just those features that are to be made accessible. @node pragma Ravenscar,pragma Restricted_Run_Time,pragma No_Run_Time,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id3}@anchor{42e}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{42f} +@anchor{gnat_rm/obsolescent_features id3}@anchor{432}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{433} @section pragma Ravenscar @@ -28468,7 +28639,7 @@ The pragma @code{Ravenscar} has exactly the same effect as pragma is part of the new Ada 2005 standard. @node pragma Restricted_Run_Time,pragma Task_Info,pragma Ravenscar,Obsolescent Features -@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{430}@anchor{gnat_rm/obsolescent_features id4}@anchor{431} +@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{434}@anchor{gnat_rm/obsolescent_features id4}@anchor{435} @section pragma Restricted_Run_Time @@ -28478,7 +28649,7 @@ preferred since the Ada 2005 pragma @code{Profile} is intended for this kind of implementation dependent addition. @node pragma Task_Info,package System Task_Info s-tasinf ads,pragma Restricted_Run_Time,Obsolescent Features -@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{432}@anchor{gnat_rm/obsolescent_features id5}@anchor{433} +@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{436}@anchor{gnat_rm/obsolescent_features id5}@anchor{437} @section pragma Task_Info @@ -28504,7 +28675,7 @@ in the spec of package System.Task_Info in the runtime library. @node package System Task_Info s-tasinf ads,,pragma Task_Info,Obsolescent Features -@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{434}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{435} +@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{438}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{439} @section package System.Task_Info (@code{s-tasinf.ads}) @@ -28514,7 +28685,7 @@ to support the @code{Task_Info} pragma. The predefined Ada package standard replacement for GNAT's @code{Task_Info} functionality. @node Compatibility and Porting Guide,GNU Free Documentation License,Obsolescent Features,Top -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{16}@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{436}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{437} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{16}@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{43a}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{43b} @chapter Compatibility and Porting Guide @@ -28536,7 +28707,7 @@ applications developed in other Ada environments. @end menu @node Writing Portable Fixed-Point Declarations,Compatibility with Ada 83,,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{438}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{439} +@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{43c}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{43d} @section Writing Portable Fixed-Point Declarations @@ -28658,7 +28829,7 @@ If you follow this scheme you will be guaranteed that your fixed-point types will be portable. @node Compatibility with Ada 83,Compatibility between Ada 95 and Ada 2005,Writing Portable Fixed-Point Declarations,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{43a}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{43b} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{43e}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{43f} @section Compatibility with Ada 83 @@ -28686,7 +28857,7 @@ following subsections treat the most likely issues to be encountered. @end menu @node Legal Ada 83 programs that are illegal in Ada 95,More deterministic semantics,,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{43c}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{43d} +@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{440}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{441} @subsection Legal Ada 83 programs that are illegal in Ada 95 @@ -28786,7 +28957,7 @@ the fix is usually simply to add the @code{(<>)} to the generic declaration. @end itemize @node More deterministic semantics,Changed semantics,Legal Ada 83 programs that are illegal in Ada 95,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{43e}@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{43f} +@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{442}@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{443} @subsection More deterministic semantics @@ -28814,7 +28985,7 @@ which open select branches are executed. @end itemize @node Changed semantics,Other language compatibility issues,More deterministic semantics,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{440}@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{441} +@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{444}@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{445} @subsection Changed semantics @@ -28856,7 +29027,7 @@ covers only the restricted range. @end itemize @node Other language compatibility issues,,Changed semantics,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{442}@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{443} +@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{446}@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{447} @subsection Other language compatibility issues @@ -28889,7 +29060,7 @@ include @code{pragma Interface} and the floating point type attributes @end itemize @node Compatibility between Ada 95 and Ada 2005,Implementation-dependent characteristics,Compatibility with Ada 83,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{444}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{445} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{448}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{449} @section Compatibility between Ada 95 and Ada 2005 @@ -28961,7 +29132,7 @@ can declare a function returning a value from an anonymous access type. @end itemize @node Implementation-dependent characteristics,Compatibility with Other Ada Systems,Compatibility between Ada 95 and Ada 2005,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{446}@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{447} +@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{44a}@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{44b} @section Implementation-dependent characteristics @@ -28984,7 +29155,7 @@ transition from certain Ada 83 compilers. @end menu @node Implementation-defined pragmas,Implementation-defined attributes,,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{448}@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{449} +@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{44c}@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{44d} @subsection Implementation-defined pragmas @@ -29006,7 +29177,7 @@ avoiding compiler rejection of units that contain such pragmas; they are not relevant in a GNAT context and hence are not otherwise implemented. @node Implementation-defined attributes,Libraries,Implementation-defined pragmas,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{44a}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{44b} +@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{44e}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{44f} @subsection Implementation-defined attributes @@ -29020,7 +29191,7 @@ Ada 83, GNAT supplies the attributes @code{Bit}, @code{Machine_Size} and @code{Type_Class}. @node Libraries,Elaboration order,Implementation-defined attributes,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{44c}@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{44d} +@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{450}@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{451} @subsection Libraries @@ -29049,7 +29220,7 @@ be preferable to retrofit the application using modular types. @end itemize @node Elaboration order,Target-specific aspects,Libraries,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{44e}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{44f} +@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{452}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{453} @subsection Elaboration order @@ -29085,7 +29256,7 @@ pragmas either globally (as an effect of the @emph{-gnatE} switch) or locally @end itemize @node Target-specific aspects,,Elaboration order,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{450}@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{451} +@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{454}@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{455} @subsection Target-specific aspects @@ -29098,10 +29269,10 @@ on the robustness of the original design. Moreover, Ada 95 (and thus Ada 2005 and Ada 2012) are sometimes incompatible with typical Ada 83 compiler practices regarding implicit packing, the meaning of the Size attribute, and the size of access values. -GNAT's approach to these issues is described in @ref{452,,Representation Clauses}. +GNAT's approach to these issues is described in @ref{456,,Representation Clauses}. @node Compatibility with Other Ada Systems,Representation Clauses,Implementation-dependent characteristics,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{453}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{454} +@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{457}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{458} @section Compatibility with Other Ada Systems @@ -29144,7 +29315,7 @@ far beyond this minimal set, as described in the next section. @end itemize @node Representation Clauses,Compatibility with HP Ada 83,Compatibility with Other Ada Systems,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{452}@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{455} +@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{456}@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{459} @section Representation Clauses @@ -29237,7 +29408,7 @@ with thin pointers. @end itemize @node Compatibility with HP Ada 83,,Representation Clauses,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{456}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{457} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{45a}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{45b} @section Compatibility with HP Ada 83 @@ -29267,7 +29438,7 @@ extension of package System. @end itemize @node GNU Free Documentation License,Index,Compatibility and Porting Guide,Top -@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license doc}@anchor{458}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{459} +@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license doc}@anchor{45c}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{45d} @chapter GNU Free Documentation License diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index fd45984..ca5dc61 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -2335,6 +2335,15 @@ package Opt is -- The only special comment sequence allowed is --! + ------------- + -- OpenAcc -- + ------------- + + OpenAcc_Enabled : Boolean := False; + -- GNAT + -- Indicates whether OpenAcc pragmas should be taken into account. + -- Set True by use of -fopenacc. + -------------------------- -- Private Declarations -- -------------------------- diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb index 8bd091f..f51a838 100644 --- a/gcc/ada/par-prag.adb +++ b/gcc/ada/par-prag.adb @@ -1516,6 +1516,10 @@ begin | Pragma_Warning_As_Error | Pragma_Weak_External | Pragma_Validity_Checks + | Pragma_Acc_Data + | Pragma_Acc_Kernels + | Pragma_Acc_Loop + | Pragma_Acc_Parallel => null; diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 2f44691..6f002f4 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -3361,6 +3361,9 @@ package body Sem_Ch5 is procedure Analyze_Loop_Statement (N : Node_Id) is + function Disable_Constant (N : Node_Id) return Traverse_Result; + -- If N represents an E_Variable entity, set Is_True_Constant To False + function Is_Container_Iterator (Iter : Node_Id) return Boolean; -- Given a loop iteration scheme, determine whether it is an Ada 2012 -- container iteration. @@ -3371,6 +3374,25 @@ package body Sem_Ch5 is -- iterators. Prevents infinite recursion when block is analyzed. -- Routine is a noop if loop is single statement within source block. + ---------------------- + -- Disable_Constant -- + ---------------------- + + function Disable_Constant (N : Node_Id) return Traverse_Result is + begin + if Is_Entity_Name (N) + and then Present (Entity (N)) + and then Ekind (Entity (N)) = E_Variable + then + Set_Is_True_Constant (Entity (N), False); + end if; + return OK; + end Disable_Constant; + + procedure Disable_Constants is new Traverse_Proc (Disable_Constant); + -- Helper for Analyze_Loop_Statement, to unset Is_True_Constant on + -- variables referenced within an OpenACC environment. + --------------------------- -- Is_Container_Iterator -- --------------------------- @@ -3812,6 +3834,15 @@ package body Sem_Ch5 is if No (Iter) and then not Has_Exit (Ent) then Check_Unreachable_Code (Stmt); end if; + + -- Variables referenced within a loop subject to possible OpenACC + -- offloading may be implicitly written to as part of the OpenACC + -- transaction. Clear flags possibly conveying that they are constant, + -- set for example when the code does not explicitly assign them. + + if Is_OpenAcc_Environment (Stmt) then + Disable_Constants (Stmt); + end if; end Analyze_Loop_Statement; ---------------------------- diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index f1f463c2..c409b85 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -3685,6 +3685,12 @@ package body Sem_Prag is -- Local Subprograms -- ----------------------- + function Acc_First (N : Node_Id) return Node_Id; + -- Helper function to iterate over arguments given to OpenAcc pragmas. + + function Acc_Next (N : Node_Id) return Node_Id; + -- Helper function to iterate over arguments given to OpenAcc pragmas. + procedure Acquire_Warning_Match_String (Arg : Node_Id); -- Used by pragma Warnings (Off, string), and Warn_As_Error (string) to -- get the given string argument, and place it in Name_Buffer, adding @@ -4234,6 +4240,85 @@ package body Sem_Prag is -- which is used for error messages on any constructs violating the -- profile. + procedure Validate_Acc_Condition_Clause (Clause : Node_Id); + -- Make sure the argument of a given Acc_If clause is a boolean. + + procedure Validate_Acc_Data_Clause (Clause : Node_Id); + -- Make sure the argument of an OpenAcc data clause (e.g. Copy, Copyin, + -- Copyout...) is an identifier or an aggregate of identifiers. + + procedure Validate_Acc_Int_Expr_Clause (Clause : Node_Id); + -- Make sure the argument of an OpenAcc clause is an Integer expression. + + procedure Validate_Acc_Int_Expr_List_Clause (Clause : Node_Id); + -- Make sure the argument of an OpenAcc clause is an Integer expression + -- or a list of Integer expressions. + + procedure Validate_Acc_Loop_Collapse (Clause : Node_Id); + -- Make sure that the parent loop of the Acc_Loop(Collapse => N) pragma + -- contains at least N-1 nested loops. + + procedure Validate_Acc_Loop_Gang (Clause : Node_Id); + -- Make sure the argument of the Gang clause of a Loop directive is + -- either an integer expression or a (Static => integer expressions) + -- aggregate. + + procedure Validate_Acc_Loop_Vector (Clause : Node_Id); + -- When this procedure is called in a construct offloaded by an + -- Acc_Kernels pragma, makes sure that a Vector_Length clause does + -- not exist on said pragma. + -- In all cases, make sure the argument is an integer expression. + + procedure Validate_Acc_Loop_Worker (Clause : Node_Id); + -- When this procedure is called in a construct offloaded by an + -- Acc_Parallel pragma, makes sure that no argument has been given. + -- When this procedure is called in a construct offloaded by an + -- Acc_Kernels pragma and if Loop_Worker was given an argument, + -- makes sure that the Num_Workers clause does not appear on the + -- Acc_Kernels pragma and that the argument is an integer. + + procedure Validate_Acc_Name_Reduction (Clause : Node_Id); + -- Make sure the reduction clause is an aggregate made of a string + -- representing a supported reduction operation (i.e. "+", "*", "and", + -- "or", "min" or "max") and either an identifier or aggregate of + -- identifiers. + + procedure Validate_Acc_Size_Expressions (Clause : Node_Id); + -- Makes sure that Clause is either an integer expression or an + -- association with a Static as name and a list of integer expressions + -- or "*" strings on the right hand side. + + --------------- + -- Acc_First -- + --------------- + + function Acc_First (N : Node_Id) return Node_Id is + begin + if Nkind (N) = N_Aggregate then + if Present (Expressions (N)) then + return First (Expressions (N)); + elsif Present (Component_Associations (N)) then + return Expression (First (Component_Associations (N))); + end if; + end if; + return N; + end Acc_First; + + -------------- + -- Acc_Next -- + -------------- + + function Acc_Next (N : Node_Id) return Node_Id is + begin + if Nkind (Parent (N)) = N_Component_Association then + return Expression (Next (Parent (N))); + elsif Nkind (Parent (N)) = N_Aggregate then + return Next (N); + else + return Empty; + end if; + end Acc_Next; + ---------------------------------- -- Acquire_Warning_Match_String -- ---------------------------------- @@ -11082,6 +11167,248 @@ package body Sem_Prag is end if; end Set_Ravenscar_Profile; + ----------------------------------- + -- Validate_Acc_Condition_Clause -- + ----------------------------------- + + procedure Validate_Acc_Condition_Clause (Clause : Node_Id) is + begin + Analyze_And_Resolve (Clause); + if not Is_Boolean_Type (Etype (Clause)) then + Error_Pragma ("Expected a boolean"); + end if; + end Validate_Acc_Condition_Clause; + + ------------------------------ + -- Validate_Acc_Data_Clause -- + ------------------------------ + + procedure Validate_Acc_Data_Clause (Clause : Node_Id) is + Expr : Node_Id; + begin + Expr := Acc_First (Clause); + while Present (Expr) loop + if Nkind (Expr) /= N_Identifier then + Error_Pragma ("Expected an Identifer"); + end if; + Analyze_And_Resolve (Expr); + Expr := Acc_Next (Expr); + end loop; + end Validate_Acc_Data_Clause; + + ---------------------------------- + -- Validate_Acc_Int_Expr_Clause -- + ---------------------------------- + + procedure Validate_Acc_Int_Expr_Clause (Clause : Node_Id) is + begin + Analyze_And_Resolve (Clause); + if not Is_Integer_Type (Etype (Clause)) then + Error_Pragma_Arg ("Expected an integer", Clause); + end if; + end Validate_Acc_Int_Expr_Clause; + + --------------------------------------- + -- Validate_Acc_Int_Expr_List_Clause -- + --------------------------------------- + + procedure Validate_Acc_Int_Expr_List_Clause (Clause : Node_Id) is + Expr : Node_Id; + begin + Expr := Acc_First (Clause); + while Present (Expr) loop + Analyze_And_Resolve (Expr); + if not Is_Integer_Type (Etype (Expr)) then + Error_Pragma ("Expected an Integer"); + end if; + Expr := Acc_Next (Expr); + end loop; + end Validate_Acc_Int_Expr_List_Clause; + + -------------------------------- + -- Validate_Acc_Loop_Collapse -- + -------------------------------- + + procedure Validate_Acc_Loop_Collapse (Clause : Node_Id) is + Count : Uint; + Parent_Loop : Node_Id; + Current_Statement : Node_Id; + begin + -- Make sure the argument is a positive integer. + Analyze_And_Resolve (Clause); + Count := Static_Integer (Clause); + if Count = No_Uint or else Count < 1 then + Error_Pragma_Arg ("Expected a positive integer", Clause); + end if; + + -- Then, make sure we have at least Count-1 tightly-nested loops + -- (i.e. loops with no statements in between). + + Parent_Loop := Parent (Parent (Parent (Clause))); + Current_Statement := First (Statements (Parent_Loop)); + -- Skip first pragmas in the parent loop + while Present (Current_Statement) + and then Nkind (Current_Statement) = N_Pragma loop + Current_Statement := Next (Current_Statement); + end loop; + + if not Present (Next (Current_Statement)) then + While_Loop : + while Nkind (Current_Statement) = N_Loop_Statement + and Count > 1 loop + Current_Statement := First (Statements (Current_Statement)); + exit While_Loop when Present (Next (Current_Statement)); + Count := Count - 1; + end loop While_Loop; + end if; + + if Count > 1 then + Error_Pragma_Arg ("Collapse argument too high or loops not " & + "tightly nested.", Clause); + end if; + end Validate_Acc_Loop_Collapse; + + ---------------------------- + -- Validate_Acc_Loop_Gang -- + ---------------------------- + + procedure Validate_Acc_Loop_Gang (Clause : Node_Id) is + begin + Error_Pragma_Arg ("Loop_Gang not implemented", Clause); + end Validate_Acc_Loop_Gang; + + ------------------------------ + -- Validate_Acc_Loop_Vector -- + ------------------------------ + + procedure Validate_Acc_Loop_Vector (Clause : Node_Id) is + begin + Error_Pragma_Arg ("Loop_Vector not implemented", Clause); + end Validate_Acc_Loop_Vector; + + ------------------------------- + -- Validate_Acc_Loop_Worker -- + ------------------------------- + + procedure Validate_Acc_Loop_Worker (Clause : Node_Id) is + begin + Error_Pragma_Arg ("Loop_Worker not implemented", Clause); + end Validate_Acc_Loop_Worker; + + --------------------------------- + -- Validate_Acc_Name_Reduction -- + --------------------------------- + + procedure Validate_Acc_Name_Reduction (Clause : Node_Id) is + -- ??? On top of the following operations, the OpenAcc spec adds the + -- "bitwise and", "bitwise or" and modulo for C and ".eqv" and + -- ".neqv" for Fortran. Can we, should we and how do we support them + -- in Ada? + type Reduction_Op is (Add_Op, Mul_Op, Max_Op, + Min_Op, And_Op, Or_Op); + function To_Reduction_Op (Op : String) return Reduction_Op; + function To_Reduction_Op (Op : String) return Reduction_Op is + begin + if Op = "+" then + return Add_Op; + elsif Op = "*" then + return Mul_Op; + elsif Op = "max" then + return Max_Op; + elsif Op = "min" then + return Min_Op; + elsif Op = "and" then + return And_Op; + elsif Op = "or" then + return Or_Op; + else + Error_Pragma ("Unsuported reduction operation"); + end if; + end To_Reduction_Op; + Expr : Node_Id; + Reduc_Op : Node_Id; + Reduc_Var : Node_Id; + Seen_Entities : Elist_Id; + begin + -- Reduction operations look like this: + -- ("+" => (a, b), "*" => c) + Seen_Entities := New_Elmt_List; + Expr := First (Component_Associations (Clause)); + while Present (Expr) loop + Reduc_Op := First (Choices (Expr)); + String_To_Name_Buffer (Strval (Reduc_Op)); + case To_Reduction_Op (Name_Buffer (1 .. Name_Len)) is + + when Add_Op | Mul_Op | Max_Op | Min_Op => + Reduc_Var := Acc_First (Expression (Expr)); + while Present (Reduc_Var) loop + Analyze_And_Resolve (Reduc_Var); + if Contains (Seen_Entities, Entity (Reduc_Var)) then + Error_Pragma ("Variable used in multiple reductions"); + else + if (Nkind (Reduc_Var) /= N_Identifier) + or not Is_Numeric_Type (Etype (Reduc_Var)) + then + Error_Pragma + ("Expected an identifier for a Numeric"); + end if; + Append_Elmt (Entity (Reduc_Var), Seen_Entities); + end if; + Reduc_Var := Acc_Next (Reduc_Var); + end loop; + + when And_Op | Or_Op => + Reduc_Var := Acc_First (Expression (Expr)); + while Present (Reduc_Var) loop + Analyze_And_Resolve (Reduc_Var); + if Contains (Seen_Entities, Entity (Reduc_Var)) then + Error_Pragma ("Variable used in multiple " & + "reductions"); + else + if Nkind (Reduc_Var) /= N_Identifier or not + Is_Boolean_Type (Etype (Reduc_Var)) + then + Error_Pragma ("Expected a variable of type " & + "Boolean"); + end if; + Append_Elmt (Entity (Reduc_Var), Seen_Entities); + end if; + Reduc_Var := Acc_Next (Reduc_Var); + end loop; + end case; + Expr := Next (Expr); + end loop; + end Validate_Acc_Name_Reduction; + + ----------------------------------- + -- Validate_Acc_Size_Expressions -- + ----------------------------------- + + procedure Validate_Acc_Size_Expressions (Clause : Node_Id) is + + -- A size expr is either an integer expression or "*" + function Validate_Size_Expr (Expr : Node_Id) return Boolean; + function Validate_Size_Expr (Expr : Node_Id) return Boolean is + begin + if Nkind (Expr) = N_Operator_Symbol then + return Get_String_Char (Strval (Expr), 1) = Get_Char_Code ('*'); + end if; + Analyze_And_Resolve (Expr); + return Is_Integer_Type (Etype (Expr)); + end Validate_Size_Expr; + + Expr : Node_Id; + begin + Expr := Acc_First (Clause); + while Present (Expr) loop + if not Validate_Size_Expr (Expr) then + Error_Pragma ("Size expressions should be either integers " & + "or '*'"); + end if; + Expr := Acc_Next (Expr); + end loop; + end Validate_Acc_Size_Expressions; + -- Start of processing for Analyze_Pragma begin @@ -12025,6 +12352,256 @@ package body Sem_Prag is Analyze_If_Present (Pragma_Initial_Condition); end Abstract_State; + -------------- + -- Acc_Data -- + -------------- + + when Pragma_Acc_Data => Acc_Data : declare + Clause_Names : constant Name_List := ( + Name_Attach, + Name_Copy, + Name_Copy_In, + Name_Copy_Out, + Name_Create, + Name_Delete, + Name_Detach, + Name_Device_Ptr, + Name_No_Create, + Name_Present + ); + Clauses : Args_List (Clause_Names'Range); + Clause : Node_Id; + + begin + if not OpenAcc_Enabled then + return; + end if; + GNAT_Pragma; + if Nkind (Parent (N)) /= N_Loop_Statement + then + Error_Pragma ("Acc_Data pragma should be placed in loop or " + & "block statements."); + end if; + Gather_Associations (Clause_Names, Clauses); + for Id in Clause_Names'First .. Clause_Names'Last loop + Clause := Clauses (Id); + if Present (Clause) then + case Clause_Names (Id) is + when Name_Copy + | Name_Copy_In + | Name_Copy_Out + | Name_Create + | Name_Device_Ptr + | Name_Present => + Validate_Acc_Data_Clause (Clause); + when Name_Attach + | Name_Detach + | Name_Delete + | Name_No_Create => + Error_Pragma ("Unsupported pragma clause."); + when others => raise Program_Error; + end case; + end if; + end loop; + + Set_Is_OpenAcc_Environment (Parent (N)); + + end Acc_Data; + + -------------- + -- Acc_Loop -- + -------------- + + when Pragma_Acc_Loop => Acc_Loop : declare + + Clause_Names : constant Name_List := ( + Name_Auto, + Name_Collapse, + Name_Gang, + Name_Independent, + Name_Acc_Private, + Name_Reduction, + Name_Seq, + Name_Tile, + Name_Vector, + Name_Worker + ); + Clauses : Args_List (Clause_Names'Range); + Clause : Node_Id; + Parent_Node : Node_Id; + + begin + if not OpenAcc_Enabled then + return; + end if; + GNAT_Pragma; + + -- Make sure the pragma is in an openacc construct + Check_Loop_Pragma_Placement; + Parent_Node := Parent (N); + while Present (Parent_Node) and then + (Nkind (Parent_Node) /= N_Loop_Statement or else + not Is_OpenAcc_Environment (Parent_Node)) loop + Parent_Node := Parent (Parent_Node); + end loop; + if not Is_OpenAcc_Environment (Parent_Node) then + Error_Pragma ("Acc_Loop directive must be associated with an " & + "OpenAcc construct region"); + end if; + + Gather_Associations (Clause_Names, Clauses); + for Id in Clause_Names'First .. Clause_Names'Last loop + Clause := Clauses (Id); + if Present (Clause) then + case Clause_Names (Id) is + when Name_Auto | Name_Independent | Name_Seq => null; + when Name_Collapse => + Validate_Acc_Loop_Collapse (Clause); + when Name_Gang => Validate_Acc_Loop_Gang (Clause); + when Name_Acc_Private => + Validate_Acc_Data_Clause (Clause); + when Name_Reduction => + Validate_Acc_Name_Reduction (Clause); + when Name_Tile => Validate_Acc_Size_Expressions (Clause); + when Name_Vector => Validate_Acc_Loop_Vector (Clause); + when Name_Worker => Validate_Acc_Loop_Worker (Clause); + when others => raise Program_Error; + end case; + end if; + end loop; + Set_Is_OpenAcc_Loop (Parent (N)); + end Acc_Loop; + + ---------------------------------- + -- Acc_Parallel and Acc_Kernels -- + ---------------------------------- + + when Pragma_Acc_Parallel | Pragma_Acc_Kernels => + Acc_Kernels_Or_Parallel : + declare + + Clause_Names : constant Name_List := ( + Name_Acc_If, + Name_Async, + Name_Copy, + Name_Copy_In, + Name_Copy_Out, + Name_Create, + Name_Default, + Name_Device_Ptr, + Name_Device_Type, + Name_Num_Gangs, + Name_Num_Workers, + Name_Present, + Name_Vector_Length, + Name_Wait, + -- Parallel only + Name_Acc_Private, + Name_First_Private, + Name_Reduction, + -- Kernels only + Name_Attach, + Name_No_Create + ); + Clauses : Args_List (Clause_Names'Range); + Clause : Node_Id; + + begin + if not OpenAcc_Enabled then + return; + end if; + GNAT_Pragma; + Check_Loop_Pragma_Placement; + + if Nkind (Parent (N)) /= N_Loop_Statement then + Error_Pragma ("Pragma should be placed in loop or block " + & "statements."); + end if; + + Gather_Associations (Clause_Names, Clauses); + for Id in Clause_Names'First .. Clause_Names'Last loop + Clause := Clauses (Id); + if Present (Clause) then + if Chars (Parent (Clause)) = No_Name then + Error_Pragma ("All arguments should be associations"); + else + case Clause_Names (Id) is + -- Note: According to the OpenAcc Standard v2.6, + -- Async's argument should be optional. Because + -- this complicates parsing the clause, the + -- argument is made mandatory. The standard defines + -- two negative values, acc_async_noval and + -- acc_async_sync. When given acc_async_noval as + -- value, the clause should behave as if no + -- argument was given. According to the standard, + -- acc_async_noval is defined in header files for C + -- and Fortran, thus this value should probably be + -- defined in the OpenAcc Ada library once it is + -- implemented. + when Name_Async + | Name_Num_Gangs + | Name_Num_Workers + | Name_Vector_Length => + Validate_Acc_Int_Expr_Clause (Clause); + + when Name_Acc_If => + Validate_Acc_Condition_Clause (Clause); + + -- Unsupported by GCC + when Name_Attach + | Name_No_Create => + Error_Pragma ("Unsupported clause."); + + when Name_First_Private + | Name_Acc_Private => + if Prag_Id /= Pragma_Acc_Parallel then + Error_Pragma ("Argument is only available for" & + " 'Parallel' construct."); + else + Validate_Acc_Data_Clause (Clause); + end if; + + when Name_Copy + | Name_Copy_In + | Name_Copy_Out + | Name_Present + | Name_Create + | Name_Device_Ptr => + Validate_Acc_Data_Clause (Clause); + + when Name_Reduction => + if Prag_Id /= Pragma_Acc_Parallel then + Error_Pragma ("Argument is only available for" & + " 'Parallel' construct."); + else + Validate_Acc_Name_Reduction (Clause); + end if; + + when Name_Default => + if Chars (Clause) /= Name_None then + Error_Pragma ("Expected None"); + end if; + + when Name_Device_Type => + Error_Pragma ("Unsupported pragma clause"); + + -- Same as for Name_Async, Name_Wait's arguments + -- should be optional. However, this can be + -- simulated using acc_async_noval, hence, we do + -- not bother making the argument optional for now. + when Name_Wait => + Validate_Acc_Int_Expr_List_Clause (Clause); + + when others => raise Program_Error; + end case; + end if; + end if; + end loop; + + Set_Is_OpenAcc_Environment (Parent (N)); + + end Acc_Kernels_Or_Parallel; + ------------ -- Ada_83 -- ------------ @@ -30117,6 +30694,10 @@ package body Sem_Prag is Sig_Flags : constant array (Pragma_Id) of Int := (Pragma_Abort_Defer => -1, Pragma_Abstract_State => -1, + Pragma_Acc_Data => 0, + Pragma_Acc_Kernels => 0, + Pragma_Acc_Loop => 0, + Pragma_Acc_Parallel => 0, Pragma_Ada_83 => -1, Pragma_Ada_95 => -1, Pragma_Ada_05 => -1, diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb index e6ff0e7..5444441 100644 --- a/gcc/ada/sinfo.adb +++ b/gcc/ada/sinfo.adb @@ -2069,6 +2069,22 @@ package body Sinfo is return Flag16 (N); end Is_Null_Loop; + function Is_OpenAcc_Environment + (N : Node_Id) return Boolean is + begin + pragma Assert (False + or else NT (N).Nkind = N_Loop_Statement); + return Flag13 (N); + end Is_OpenAcc_Environment; + + function Is_OpenAcc_Loop + (N : Node_Id) return Boolean is + begin + pragma Assert (False + or else NT (N).Nkind = N_Loop_Statement); + return Flag14 (N); + end Is_OpenAcc_Loop; + function Is_Overloaded (N : Node_Id) return Boolean is begin @@ -5527,6 +5543,22 @@ package body Sinfo is Set_Flag16 (N, Val); end Set_Is_Null_Loop; + procedure Set_Is_OpenAcc_Environment + (N : Node_Id; Val : Boolean := True) is + begin + pragma Assert (False + or else NT (N).Nkind = N_Loop_Statement); + Set_Flag13 (N, Val); + end Set_Is_OpenAcc_Environment; + + procedure Set_Is_OpenAcc_Loop + (N : Node_Id; Val : Boolean := True) is + begin + pragma Assert (False + or else NT (N).Nkind = N_Loop_Statement); + Set_Flag14 (N, Val); + end Set_Is_OpenAcc_Loop; + procedure Set_Is_Overloaded (N : Node_Id; Val : Boolean := True) is begin diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 1359c94..bed8b32 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -1896,6 +1896,14 @@ package Sinfo is -- can be determined to be null at compile time. This is used to remove -- the loop entirely at expansion time. + -- Is_OpenAcc_Environment (Flag13-Sem) + -- This flag is set in an N_Loop_Statement node if it contains an + -- Acc_Data, Acc_Parallel or Add_Kernels pragma. + + -- Is_OpenAcc_Loop (Flag14-Sem) + -- This flag is set in an N_Loop_Statement node if it contains an + -- OpenAcc_Loop pragma. + -- Is_Overloaded (Flag5-Sem) -- A flag present in all expression nodes. Used temporarily during -- overloading determination. The setting of this flag is not relevant @@ -5129,6 +5137,8 @@ package Sinfo is -- Has_Created_Identifier (Flag15) -- Is_Null_Loop (Flag16) -- Suppress_Loop_Warnings (Flag17) + -- Is_OpenAcc_Environment (Flag13-Sem) + -- Is_OpenAcc_Loop (Flag14-Sem) -- Note: the parser fills in the Identifier field if there is an -- explicit loop identifier. Otherwise the parser leaves this field @@ -9847,6 +9857,12 @@ package Sinfo is function Is_Null_Loop (N : Node_Id) return Boolean; -- Flag16 + function Is_OpenAcc_Environment + (N : Node_Id) return Boolean; -- Flag13 + + function Is_OpenAcc_Loop + (N : Node_Id) return Boolean; -- Flag14 + function Is_Overloaded (N : Node_Id) return Boolean; -- Flag5 @@ -10945,6 +10961,12 @@ package Sinfo is procedure Set_Is_Null_Loop (N : Node_Id; Val : Boolean := True); -- Flag16 + procedure Set_Is_OpenAcc_Environment + (N : Node_Id; Val : Boolean := True); -- Flag13 + + procedure Set_Is_OpenAcc_Loop + (N : Node_Id; Val : Boolean := True); -- Flag14 + procedure Set_Is_Overloaded (N : Node_Id; Val : Boolean := True); -- Flag5 @@ -13450,6 +13472,8 @@ package Sinfo is pragma Inline (Is_Known_Guaranteed_ABE); pragma Inline (Is_Machine_Number); pragma Inline (Is_Null_Loop); + pragma Inline (Is_OpenAcc_Environment); + pragma Inline (Is_OpenAcc_Loop); pragma Inline (Is_Overloaded); pragma Inline (Is_Power_Of_2_For_Shift); pragma Inline (Is_Prefixed_Call); @@ -13812,6 +13836,8 @@ package Sinfo is pragma Inline (Set_Is_Known_Guaranteed_ABE); pragma Inline (Set_Is_Machine_Number); pragma Inline (Set_Is_Null_Loop); + pragma Inline (Set_Is_OpenAcc_Environment); + pragma Inline (Set_Is_OpenAcc_Loop); pragma Inline (Set_Is_Overloaded); pragma Inline (Set_Is_Power_Of_2_For_Shift); pragma Inline (Set_Is_Prefixed_Call); diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index baa4101..0b9e531 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -480,6 +480,10 @@ package Snames is Name_Abort_Defer : constant Name_Id := N + $; -- GNAT Name_Abstract_State : constant Name_Id := N + $; -- GNAT + Name_Acc_Data : constant Name_Id := N + $; + Name_Acc_Kernels : constant Name_Id := N + $; + Name_Acc_Loop : constant Name_Id := N + $; + Name_Acc_Parallel : constant Name_Id := N + $; Name_All_Calls_Remote : constant Name_Id := N + $; Name_Assert : constant Name_Id := N + $; -- Ada 05 Name_Assert_And_Cut : constant Name_Id := N + $; -- GNAT @@ -860,6 +864,34 @@ package Snames is Name_Warn : constant Name_Id := N + $; Name_Working_Storage : constant Name_Id := N + $; + -- OpenAcc-specific clause names + -- Parallel, Kernels, Data + Name_Acc_If : constant Name_Id := N + $; + Name_Acc_Private : constant Name_Id := N + $; + Name_Attach : constant Name_Id := N + $; + Name_Copy_In : constant Name_Id := N + $; + Name_Copy_Out : constant Name_Id := N + $; + Name_Create : constant Name_Id := N + $; + Name_Delete : constant Name_Id := N + $; + Name_Detach : constant Name_Id := N + $; + Name_Device_Ptr : constant Name_Id := N + $; + Name_Device_Type : constant Name_Id := N + $; + Name_First_Private : constant Name_Id := N + $; + Name_No_Create : constant Name_Id := N + $; + Name_Num_Gangs : constant Name_Id := N + $; + Name_Num_Workers : constant Name_Id := N + $; + Name_Present : constant Name_Id := N + $; + Name_Reduction : constant Name_Id := N + $; + Name_Vector_Length : constant Name_Id := N + $; + Name_Wait : constant Name_Id := N + $; + -- Loop + Name_Collapse : constant Name_Id := N + $; + Name_Gang : constant Name_Id := N + $; + Name_Worker : constant Name_Id := N + $; + Name_Seq : constant Name_Id := N + $; + Name_Auto : constant Name_Id := N + $; + Name_Tile : constant Name_Id := N + $; + -- Names of recognized attributes. The entries with the comment "Ada 83" -- are attributes that are defined in Ada 83, but not in Ada 95. These -- attributes are implemented in all Ada modes in GNAT. @@ -1310,172 +1342,172 @@ package Snames is -- Names with a -- GB annotation are only used in gprbuild or gprclean - Name_Active : constant Name_Id := N + $; - Name_Aggregate : constant Name_Id := N + $; - Name_Archive_Builder : constant Name_Id := N + $; - Name_Archive_Builder_Append_Option : constant Name_Id := N + $; - Name_Archive_Indexer : constant Name_Id := N + $; - Name_Archive_Suffix : constant Name_Id := N + $; - Name_Artifacts : constant Name_Id := N + $; - Name_Artifacts_In_Exec_Dir : constant Name_Id := N + $; -- GB - Name_Artifacts_In_Object_Dir : constant Name_Id := N + $; -- GB - Name_Binder : constant Name_Id := N + $; - Name_Body_Suffix : constant Name_Id := N + $; - Name_Builder : constant Name_Id := N + $; - Name_Clean : constant Name_Id := N + $; - Name_Compiler : constant Name_Id := N + $; - Name_Compiler_Command : constant Name_Id := N + $; -- GB - Name_Config_Body_File_Name : constant Name_Id := N + $; - Name_Config_Body_File_Name_Index : constant Name_Id := N + $; - Name_Config_Body_File_Name_Pattern : constant Name_Id := N + $; - Name_Config_File_Switches : constant Name_Id := N + $; - Name_Config_File_Unique : constant Name_Id := N + $; - Name_Config_Spec_File_Name : constant Name_Id := N + $; - Name_Config_Spec_File_Name_Index : constant Name_Id := N + $; - Name_Config_Spec_File_Name_Pattern : constant Name_Id := N + $; - Name_Configuration : constant Name_Id := N + $; - Name_Cross_Reference : constant Name_Id := N + $; - Name_Default_Language : constant Name_Id := N + $; - Name_Default_Switches : constant Name_Id := N + $; - Name_Dependency_Driver : constant Name_Id := N + $; - Name_Dependency_Kind : constant Name_Id := N + $; - Name_Dependency_Switches : constant Name_Id := N + $; - Name_Driver : constant Name_Id := N + $; - Name_Excluded_Source_Dirs : constant Name_Id := N + $; - Name_Excluded_Source_Files : constant Name_Id := N + $; - Name_Excluded_Source_List_File : constant Name_Id := N + $; - Name_Exec_Dir : constant Name_Id := N + $; - Name_Exec_Subdir : constant Name_Id := N + $; - Name_Excluded_Patterns : constant Name_Id := N + $; - Name_Executable : constant Name_Id := N + $; - Name_Executable_Suffix : constant Name_Id := N + $; - Name_Extends : constant Name_Id := N + $; - Name_External_As_List : constant Name_Id := N + $; - Name_Externally_Built : constant Name_Id := N + $; - Name_Finder : constant Name_Id := N + $; - Name_Global_Compilation_Switches : constant Name_Id := N + $; - Name_Global_Configuration_Pragmas : constant Name_Id := N + $; - Name_Global_Config_File : constant Name_Id := N + $; -- GB - Name_Gnatls : constant Name_Id := N + $; - Name_Gnatstub : constant Name_Id := N + $; - Name_Gnu : constant Name_Id := N + $; - Name_Ide : constant Name_Id := N + $; - Name_Ignore_Source_Sub_Dirs : constant Name_Id := N + $; - Name_Implementation : constant Name_Id := N + $; - Name_Implementation_Exceptions : constant Name_Id := N + $; - Name_Implementation_Suffix : constant Name_Id := N + $; - Name_Included_Artifact_Patterns : constant Name_Id := N + $; - Name_Included_Patterns : constant Name_Id := N + $; - Name_Include_Switches : constant Name_Id := N + $; - Name_Include_Path : constant Name_Id := N + $; - Name_Include_Path_File : constant Name_Id := N + $; - Name_Inherit_Source_Path : constant Name_Id := N + $; - Name_Install : constant Name_Id := N + $; - Name_Install_Name : constant Name_Id := N + $; - Name_Languages : constant Name_Id := N + $; - Name_Language_Kind : constant Name_Id := N + $; - Name_Leading_Library_Options : constant Name_Id := N + $; - Name_Leading_Required_Switches : constant Name_Id := N + $; - Name_Leading_Switches : constant Name_Id := N + $; - Name_Lib_Subdir : constant Name_Id := N + $; - Name_Link_Lib_Subdir : constant Name_Id := N + $; - Name_Library : constant Name_Id := N + $; - Name_Library_Ali_Dir : constant Name_Id := N + $; - Name_Library_Auto_Init : constant Name_Id := N + $; - Name_Library_Auto_Init_Supported : constant Name_Id := N + $; - Name_Library_Builder : constant Name_Id := N + $; - Name_Library_Dir : constant Name_Id := N + $; - Name_Library_GCC : constant Name_Id := N + $; - Name_Library_Install_Name_Option : constant Name_Id := N + $; - Name_Library_Interface : constant Name_Id := N + $; - Name_Library_Kind : constant Name_Id := N + $; - Name_Library_Name : constant Name_Id := N + $; - Name_Library_Major_Minor_Id_Supported : constant Name_Id := N + $; - Name_Library_Options : constant Name_Id := N + $; - Name_Library_Partial_Linker : constant Name_Id := N + $; - Name_Library_Reference_Symbol_File : constant Name_Id := N + $; - Name_Library_Rpath_Options : constant Name_Id := N + $; -- GB - Name_Library_Standalone : constant Name_Id := N + $; - Name_Library_Encapsulated_Options : constant Name_Id := N + $; -- GB - Name_Library_Encapsulated_Supported : constant Name_Id := N + $; -- GB - Name_Library_Src_Dir : constant Name_Id := N + $; - Name_Library_Support : constant Name_Id := N + $; - Name_Library_Symbol_File : constant Name_Id := N + $; - Name_Library_Symbol_Policy : constant Name_Id := N + $; - Name_Library_Version : constant Name_Id := N + $; - Name_Library_Version_Switches : constant Name_Id := N + $; - Name_Linker : constant Name_Id := N + $; - Name_Linker_Executable_Option : constant Name_Id := N + $; - Name_Linker_Lib_Dir_Option : constant Name_Id := N + $; - Name_Linker_Lib_Name_Option : constant Name_Id := N + $; - Name_Local_Config_File : constant Name_Id := N + $; -- GB - Name_Local_Configuration_Pragmas : constant Name_Id := N + $; - Name_Locally_Removed_Files : constant Name_Id := N + $; - Name_Map_File_Option : constant Name_Id := N + $; - Name_Mapping_File_Switches : constant Name_Id := N + $; - Name_Mapping_Spec_Suffix : constant Name_Id := N + $; - Name_Mapping_Body_Suffix : constant Name_Id := N + $; - Name_Max_Command_Line_Length : constant Name_Id := N + $; - Name_Metrics : constant Name_Id := N + $; - Name_Multi_Unit_Object_Separator : constant Name_Id := N + $; - Name_Multi_Unit_Switches : constant Name_Id := N + $; - Name_Naming : constant Name_Id := N + $; - Name_None : constant Name_Id := N + $; - Name_Object_Artifact_Extensions : constant Name_Id := N + $; - Name_Object_File_Suffix : constant Name_Id := N + $; - Name_Object_File_Switches : constant Name_Id := N + $; - Name_Object_Generated : constant Name_Id := N + $; - Name_Object_List : constant Name_Id := N + $; - Name_Object_Path_Switches : constant Name_Id := N + $; - Name_Objects_Linked : constant Name_Id := N + $; - Name_Objects_Path : constant Name_Id := N + $; - Name_Objects_Path_File : constant Name_Id := N + $; - Name_Object_Dir : constant Name_Id := N + $; - Name_Option_List : constant Name_Id := N + $; - Name_Path_Syntax : constant Name_Id := N + $; - Name_Pic_Option : constant Name_Id := N + $; - Name_Pretty_Printer : constant Name_Id := N + $; - Name_Prefix : constant Name_Id := N + $; - Name_Project : constant Name_Id := N + $; - Name_Project_Dir : constant Name_Id := N + $; - Name_Project_Files : constant Name_Id := N + $; - Name_Project_Path : constant Name_Id := N + $; - Name_Project_Subdir : constant Name_Id := N + $; - Name_Remote : constant Name_Id := N + $; - Name_Required_Artifacts : constant Name_Id := N + $; - Name_Response_File_Format : constant Name_Id := N + $; - Name_Response_File_Switches : constant Name_Id := N + $; - Name_Root_Dir : constant Name_Id := N + $; - Name_Roots : constant Name_Id := N + $; -- GB - Name_Required_Switches : constant Name_Id := N + $; - Name_Run_Path_Option : constant Name_Id := N + $; - Name_Run_Path_Origin : constant Name_Id := N + $; - Name_Separate_Run_Path_Options : constant Name_Id := N + $; - Name_Shared_Library_Minimum_Switches : constant Name_Id := N + $; - Name_Shared_Library_Prefix : constant Name_Id := N + $; - Name_Shared_Library_Suffix : constant Name_Id := N + $; - Name_Separate_Suffix : constant Name_Id := N + $; - Name_Source_Artifact_Extensions : constant Name_Id := N + $; - Name_Source_Dirs : constant Name_Id := N + $; - Name_Source_File_Switches : constant Name_Id := N + $; - Name_Source_Files : constant Name_Id := N + $; - Name_Source_List_File : constant Name_Id := N + $; - Name_Sources_Subdir : constant Name_Id := N + $; - Name_Spec : constant Name_Id := N + $; - Name_Spec_Suffix : constant Name_Id := N + $; - Name_Specification : constant Name_Id := N + $; - Name_Specification_Exceptions : constant Name_Id := N + $; - Name_Specification_Suffix : constant Name_Id := N + $; - Name_Stack : constant Name_Id := N + $; - Name_Switches : constant Name_Id := N + $; - Name_Symbolic_Link_Supported : constant Name_Id := N + $; - Name_Synchronize : constant Name_Id := N + $; - Name_Toolchain_Description : constant Name_Id := N + $; - Name_Toolchain_Version : constant Name_Id := N + $; - Name_Trailing_Required_Switches : constant Name_Id := N + $; - Name_Trailing_Switches : constant Name_Id := N + $; - Name_Runtime_Library_Dir : constant Name_Id := N + $; - Name_Runtime_Source_Dir : constant Name_Id := N + $; + Name_Active : constant Name_Id := N + $; + Name_Aggregate : constant Name_Id := N + $; + Name_Archive_Builder : constant Name_Id := N + $; + Name_Archive_Builder_Append_Option : constant Name_Id := N + $; + Name_Archive_Indexer : constant Name_Id := N + $; + Name_Archive_Suffix : constant Name_Id := N + $; + Name_Artifacts : constant Name_Id := N + $; + Name_Artifacts_In_Exec_Dir : constant Name_Id := N + $; -- GB + Name_Artifacts_In_Object_Dir : constant Name_Id := N + $; -- GB + Name_Binder : constant Name_Id := N + $; + Name_Body_Suffix : constant Name_Id := N + $; + Name_Builder : constant Name_Id := N + $; + Name_Clean : constant Name_Id := N + $; + Name_Compiler : constant Name_Id := N + $; + Name_Compiler_Command : constant Name_Id := N + $; -- GB + Name_Config_Body_File_Name : constant Name_Id := N + $; + Name_Config_Body_File_Name_Index : constant Name_Id := N + $; + Name_Config_Body_File_Name_Pattern : constant Name_Id := N + $; + Name_Config_File_Switches : constant Name_Id := N + $; + Name_Config_File_Unique : constant Name_Id := N + $; + Name_Config_Spec_File_Name : constant Name_Id := N + $; + Name_Config_Spec_File_Name_Index : constant Name_Id := N + $; + Name_Config_Spec_File_Name_Pattern : constant Name_Id := N + $; + Name_Configuration : constant Name_Id := N + $; + Name_Cross_Reference : constant Name_Id := N + $; + Name_Default_Language : constant Name_Id := N + $; + Name_Default_Switches : constant Name_Id := N + $; + Name_Dependency_Driver : constant Name_Id := N + $; + Name_Dependency_Kind : constant Name_Id := N + $; + Name_Dependency_Switches : constant Name_Id := N + $; + Name_Driver : constant Name_Id := N + $; + Name_Excluded_Source_Dirs : constant Name_Id := N + $; + Name_Excluded_Source_Files : constant Name_Id := N + $; + Name_Excluded_Source_List_File : constant Name_Id := N + $; + Name_Exec_Dir : constant Name_Id := N + $; + Name_Exec_Subdir : constant Name_Id := N + $; + Name_Excluded_Patterns : constant Name_Id := N + $; + Name_Executable : constant Name_Id := N + $; + Name_Executable_Suffix : constant Name_Id := N + $; + Name_Extends : constant Name_Id := N + $; + Name_External_As_List : constant Name_Id := N + $; + Name_Externally_Built : constant Name_Id := N + $; + Name_Finder : constant Name_Id := N + $; + Name_Global_Compilation_Switches : constant Name_Id := N + $; + Name_Global_Configuration_Pragmas : constant Name_Id := N + $; + Name_Global_Config_File : constant Name_Id := N + $; -- GB + Name_Gnatls : constant Name_Id := N + $; + Name_Gnatstub : constant Name_Id := N + $; + Name_Gnu : constant Name_Id := N + $; + Name_Ide : constant Name_Id := N + $; + Name_Ignore_Source_Sub_Dirs : constant Name_Id := N + $; + Name_Implementation : constant Name_Id := N + $; + Name_Implementation_Exceptions : constant Name_Id := N + $; + Name_Implementation_Suffix : constant Name_Id := N + $; + Name_Included_Artifact_Patterns : constant Name_Id := N + $; + Name_Included_Patterns : constant Name_Id := N + $; + Name_Include_Switches : constant Name_Id := N + $; + Name_Include_Path : constant Name_Id := N + $; + Name_Include_Path_File : constant Name_Id := N + $; + Name_Inherit_Source_Path : constant Name_Id := N + $; + Name_Install : constant Name_Id := N + $; + Name_Install_Name : constant Name_Id := N + $; + Name_Languages : constant Name_Id := N + $; + Name_Language_Kind : constant Name_Id := N + $; + Name_Leading_Library_Options : constant Name_Id := N + $; + Name_Leading_Required_Switches : constant Name_Id := N + $; + Name_Leading_Switches : constant Name_Id := N + $; + Name_Lib_Subdir : constant Name_Id := N + $; + Name_Link_Lib_Subdir : constant Name_Id := N + $; + Name_Library : constant Name_Id := N + $; + Name_Library_Ali_Dir : constant Name_Id := N + $; + Name_Library_Auto_Init : constant Name_Id := N + $; + Name_Library_Auto_Init_Supported : constant Name_Id := N + $; + Name_Library_Builder : constant Name_Id := N + $; + Name_Library_Dir : constant Name_Id := N + $; + Name_Library_GCC : constant Name_Id := N + $; + Name_Library_Install_Name_Option : constant Name_Id := N + $; + Name_Library_Interface : constant Name_Id := N + $; + Name_Library_Kind : constant Name_Id := N + $; + Name_Library_Name : constant Name_Id := N + $; + Name_Library_Major_Minor_Id_Supported : constant Name_Id := N + $; + Name_Library_Options : constant Name_Id := N + $; + Name_Library_Partial_Linker : constant Name_Id := N + $; + Name_Library_Reference_Symbol_File : constant Name_Id := N + $; + Name_Library_Rpath_Options : constant Name_Id := N + $; -- GB + Name_Library_Standalone : constant Name_Id := N + $; + Name_Library_Encapsulated_Options : constant Name_Id := N + $; -- GB + Name_Library_Encapsulated_Supported : constant Name_Id := N + $; -- GB + Name_Library_Src_Dir : constant Name_Id := N + $; + Name_Library_Support : constant Name_Id := N + $; + Name_Library_Symbol_File : constant Name_Id := N + $; + Name_Library_Symbol_Policy : constant Name_Id := N + $; + Name_Library_Version : constant Name_Id := N + $; + Name_Library_Version_Switches : constant Name_Id := N + $; + Name_Linker : constant Name_Id := N + $; + Name_Linker_Executable_Option : constant Name_Id := N + $; + Name_Linker_Lib_Dir_Option : constant Name_Id := N + $; + Name_Linker_Lib_Name_Option : constant Name_Id := N + $; + Name_Local_Config_File : constant Name_Id := N + $; -- GB + Name_Local_Configuration_Pragmas : constant Name_Id := N + $; + Name_Locally_Removed_Files : constant Name_Id := N + $; + Name_Map_File_Option : constant Name_Id := N + $; + Name_Mapping_File_Switches : constant Name_Id := N + $; + Name_Mapping_Spec_Suffix : constant Name_Id := N + $; + Name_Mapping_Body_Suffix : constant Name_Id := N + $; + Name_Max_Command_Line_Length : constant Name_Id := N + $; + Name_Metrics : constant Name_Id := N + $; + Name_Multi_Unit_Object_Separator : constant Name_Id := N + $; + Name_Multi_Unit_Switches : constant Name_Id := N + $; + Name_Naming : constant Name_Id := N + $; + Name_None : constant Name_Id := N + $; + Name_Object_Artifact_Extensions : constant Name_Id := N + $; + Name_Object_File_Suffix : constant Name_Id := N + $; + Name_Object_File_Switches : constant Name_Id := N + $; + Name_Object_Generated : constant Name_Id := N + $; + Name_Object_List : constant Name_Id := N + $; + Name_Object_Path_Switches : constant Name_Id := N + $; + Name_Objects_Linked : constant Name_Id := N + $; + Name_Objects_Path : constant Name_Id := N + $; + Name_Objects_Path_File : constant Name_Id := N + $; + Name_Object_Dir : constant Name_Id := N + $; + Name_Option_List : constant Name_Id := N + $; + Name_Path_Syntax : constant Name_Id := N + $; + Name_Pic_Option : constant Name_Id := N + $; + Name_Pretty_Printer : constant Name_Id := N + $; + Name_Prefix : constant Name_Id := N + $; + Name_Project : constant Name_Id := N + $; + Name_Project_Dir : constant Name_Id := N + $; + Name_Project_Files : constant Name_Id := N + $; + Name_Project_Path : constant Name_Id := N + $; + Name_Project_Subdir : constant Name_Id := N + $; + Name_Remote : constant Name_Id := N + $; + Name_Required_Artifacts : constant Name_Id := N + $; + Name_Response_File_Format : constant Name_Id := N + $; + Name_Response_File_Switches : constant Name_Id := N + $; + Name_Root_Dir : constant Name_Id := N + $; + Name_Roots : constant Name_Id := N + $; -- GB + Name_Required_Switches : constant Name_Id := N + $; + Name_Run_Path_Option : constant Name_Id := N + $; + Name_Run_Path_Origin : constant Name_Id := N + $; + Name_Separate_Run_Path_Options : constant Name_Id := N + $; + Name_Shared_Library_Minimum_Switches : constant Name_Id := N + $; + Name_Shared_Library_Prefix : constant Name_Id := N + $; + Name_Shared_Library_Suffix : constant Name_Id := N + $; + Name_Separate_Suffix : constant Name_Id := N + $; + Name_Source_Artifact_Extensions : constant Name_Id := N + $; + Name_Source_Dirs : constant Name_Id := N + $; + Name_Source_File_Switches : constant Name_Id := N + $; + Name_Source_Files : constant Name_Id := N + $; + Name_Source_List_File : constant Name_Id := N + $; + Name_Sources_Subdir : constant Name_Id := N + $; + Name_Spec : constant Name_Id := N + $; + Name_Spec_Suffix : constant Name_Id := N + $; + Name_Specification : constant Name_Id := N + $; + Name_Specification_Exceptions : constant Name_Id := N + $; + Name_Specification_Suffix : constant Name_Id := N + $; + Name_Stack : constant Name_Id := N + $; + Name_Switches : constant Name_Id := N + $; + Name_Symbolic_Link_Supported : constant Name_Id := N + $; + Name_Synchronize : constant Name_Id := N + $; + Name_Toolchain_Description : constant Name_Id := N + $; + Name_Toolchain_Version : constant Name_Id := N + $; + Name_Trailing_Required_Switches : constant Name_Id := N + $; + Name_Trailing_Switches : constant Name_Id := N + $; + Name_Runtime_Library_Dir : constant Name_Id := N + $; + Name_Runtime_Source_Dir : constant Name_Id := N + $; -- Other miscellaneous names used in front end @@ -1885,6 +1917,10 @@ package Snames is Pragma_Abort_Defer, Pragma_Abstract_State, + Pragma_Acc_Data, + Pragma_Acc_Kernels, + Pragma_Acc_Loop, + Pragma_Acc_Parallel, Pragma_All_Calls_Remote, Pragma_Assert, Pragma_Assert_And_Cut, -- cgit v1.1 From 7fea7b5747859e8a741917c22fb4acce15c2bf5b Mon Sep 17 00:00:00 2001 From: Gary Dismukes Date: Wed, 26 Sep 2018 09:17:51 +0000 Subject: [Ada] Illegal formal objects associated with anonymous acc-to-subp args The compiler was incorrectly accepting generic instantiations with formal objects of named access-to-subprogram types associated with an actual of an anonymous access-to-subprogram type. Analyze_Object_Declaration tests for objects initialized anonymous access-to-subprogram values, and wraps a conversion around the argument, which normally will result in error checks during resolution in Valid_Conversion, but the conversion was only created when the initialization expression Comes_From_Source, which prevented the conversion wrapping from happening for constant declarations resulting from generic expansion. The test for Comes_From_Source was removed. The following test must report the error output given further below for the three constructs marked as errors when compiled with this command: gcc -c -gnatj70 bad_anon_access_instance.adb procedure Bad_Anon_Access_Instance (Anon_Acc : access procedure) is type Ref is access procedure; Ref_1 : Ref := Anon_Acc; -- ERROR (flagged by GNAT) Ref_2 : constant Ref := Anon_Acc; -- ERROR (flagged by GNAT) generic Formal_Ref : Ref; package Gen is end Gen; package Inst is new Gen (Formal_Ref => Anon_Acc); -- ERROR (but not flagged by GNAT) begin null; end Bad_Anon_Access_Instance; ------------- Error output: ------------- bad_anon_access_instance.adb:4:19: illegal attempt to store anonymous access to subprogram, value has deeper accessibility than any master (RM 3.10.2 (13)), use named access type for "Anon_Acc" instead of access parameter bad_anon_access_instance.adb:6:28: illegal attempt to store anonymous access to subprogram, value has deeper accessibility than any master (RM 3.10.2 (13)), use named access type for "Anon_Acc" instead of access parameter bad_anon_access_instance.adb:14:32: illegal attempt to store anonymous access to subprogram, value has deeper accessibility than any master (RM 3.10.2 (13)), use named access type for "Anon_Acc" instead of access parameter 2018-09-26 Gary Dismukes gcc/ada/ * sem_ch3.adb (Analyze_Object_Declaration): Remove test for Comes_From_Source, which prevented implicit conversions from being applied to anonymous access-to-subprogram formals in constant declartions that arise from instance associations for generic formal objects. Add RM and AARM references to comment. From-SVN: r264618 --- gcc/ada/ChangeLog | 8 ++++++++ gcc/ada/sem_ch3.adb | 9 ++++----- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 825722a..e4ab23d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2018-09-26 Gary Dismukes + + * sem_ch3.adb (Analyze_Object_Declaration): Remove test for + Comes_From_Source, which prevented implicit conversions from + being applied to anonymous access-to-subprogram formals in + constant declartions that arise from instance associations for + generic formal objects. Add RM and AARM references to comment. + 2018-09-26 Olivier Hainque * opt.ads (OpenAcc_Enabled): New flag. False by default. True diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 8b13cd0..cf45ccc 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -4286,12 +4286,11 @@ package body Sem_Ch3 is else -- If the expression is a formal that is a "subprogram pointer" - -- this is illegal in accessibility terms. Add an explicit - -- conversion to force the corresponding check, as is done for - -- assignments. + -- this is illegal in accessibility terms (see RM 3.10.2 (13.1/2) + -- and AARM 3.10.2 (13.b/2)). Add an explicit conversion to force + -- the corresponding check, as is done for assignments. - if Comes_From_Source (N) - and then Is_Entity_Name (E) + if Is_Entity_Name (E) and then Present (Entity (E)) and then Is_Formal (Entity (E)) and then -- cgit v1.1 From fcf1dd74bc00a857879ef9a34ad719cdf7053295 Mon Sep 17 00:00:00 2001 From: Javier Miranda Date: Wed, 26 Sep 2018 09:17:56 +0000 Subject: [Ada] ICE on mix of tagged and limited interfaces 2018-09-26 Javier Miranda gcc/ada/ * checks.adb (Install_Null_Excluding_Check): Do not add null-excluding checks when the tree may not be fully decorated. This patch cascade errors. From-SVN: r264619 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/checks.adb | 7 +++++++ 2 files changed, 13 insertions(+) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e4ab23d..2f015af 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Javier Miranda + + * checks.adb (Install_Null_Excluding_Check): Do not add + null-excluding checks when the tree may not be fully decorated. + This patch cascade errors. + 2018-09-26 Gary Dismukes * sem_ch3.adb (Analyze_Object_Declaration): Remove test for diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 1704a2f..2e61e51 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -7755,6 +7755,13 @@ package body Checks is -- Start of processing for Install_Null_Excluding_Check begin + -- No need to add null-excluding checks when the tree may not be fully + -- decorated. + + if Serious_Errors_Detected > 0 then + return; + end if; + pragma Assert (Is_Access_Type (Typ)); -- No check inside a generic, check will be emitted in instance -- cgit v1.1 From f8bc3bcb5fee9140c876d89ae2bf298914c01077 Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Wed, 26 Sep 2018 09:18:02 +0000 Subject: [Ada] New unit GNAT.Sets This patch implements unit GNAT.Sets which currently offers a general purpose membership set. The patch also streamlines GNAT.Dynamic_HTables and GNAT.Lists to use parts of the same API, types, and exceptions as those used by GNAT.Sets. 2018-09-26 Hristian Kirtchev gcc/ada/ * gcc-interface/Make-lang.in: Add unit GNAT.Sets to the list of front end sources. * impunit.adb: Add unit GNAT.Sets to the list of predefined units. * Makefile.rtl: Add unit GNAT.Sets to the list of non-tasking units. * libgnat/g-sets.adb: New unit. * libgnat/g-sets.ads: New unit. * libgnat/g-dynhta.adb (Minimum_Size): Decrease to 8 in order to allow for small sets. Update all occurrences of Table_Locked to Iterated. (Ensure_Unlocked): Query the number of iterators. (Find_Node): Use the supplied equality. (Is_Empty): New routine. (Lock): Update the number of iterators. (Prepend_Or_Replace): Use the supplied equality. (Size): Update the return type. (Unlock): Update the number of iterators. * libgnat/g-dynhta.ads: Update all occurrences of Table_Locked to Iterated. Rename formal subprogram Equivalent_Keys to "=". (Bucket_Range_Type, Pair_Count_Type): Remove types. (Not_Created, Table_Locked, Iterator_Exhausted): Remove exceptions. (Hash_Table): Update to store the number of iterators rather than locks. (Is_Empty): New routine. (Size): Update the return type. * libgnat/g-lists.adb: Update all occurrences of List_Locked to Iterated. (Ensure_Unlocked): Query the number of iterators. (Length): Remove. (Lock): Update the number of iterators. (Size): New routine. (Unlock): Update the number of iterators. * libgnat/g-lists.ads: Update all occurrences of List_Locked to Iterated. (Element_Count_Type): Remove type. (Not_Created, Table_Locked, Iterator_Exhausted): Remove exceptions. (Linked_List): Update type to store the number of iterators rather than locks. (Length): Remove. (Size): New routine. * libgnat/gnat.ads (Bucket_Range_Type): New type. (Iterated, Iterator_Exhausted, and Not_Created): New exceptions. gcc/testsuite/ * gnat.dg/sets1.adb: New testcase. * gnat.dg/dynhash.adb, gnat.dg/linkedlist.adb: Update testcases to new API. From-SVN: r264620 --- gcc/ada/ChangeLog | 48 +++ gcc/ada/Makefile.rtl | 1 + gcc/ada/gcc-interface/Make-lang.in | 1 + gcc/ada/impunit.adb | 1 + gcc/ada/libgnat/g-dynhta.adb | 42 ++- gcc/ada/libgnat/g-dynhta.ads | 55 +-- gcc/ada/libgnat/g-lists.adb | 37 +- gcc/ada/libgnat/g-lists.ads | 55 ++- gcc/ada/libgnat/g-sets.adb | 131 ++++++++ gcc/ada/libgnat/g-sets.ads | 161 +++++++++ gcc/ada/libgnat/gnat.ads | 20 ++ gcc/testsuite/ChangeLog | 6 + gcc/testsuite/gnat.dg/dynhash.adb | 61 ++-- gcc/testsuite/gnat.dg/linkedlist.adb | 131 ++++---- gcc/testsuite/gnat.dg/sets1.adb | 634 +++++++++++++++++++++++++++++++++++ 15 files changed, 1176 insertions(+), 208 deletions(-) create mode 100644 gcc/ada/libgnat/g-sets.adb create mode 100644 gcc/ada/libgnat/g-sets.ads create mode 100644 gcc/testsuite/gnat.dg/sets1.adb (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 2f015af..92009ff 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,51 @@ +2018-09-26 Hristian Kirtchev + + * gcc-interface/Make-lang.in: Add unit GNAT.Sets to the list of + front end sources. + * impunit.adb: Add unit GNAT.Sets to the list of predefined + units. + * Makefile.rtl: Add unit GNAT.Sets to the list of non-tasking + units. + * libgnat/g-sets.adb: New unit. + * libgnat/g-sets.ads: New unit. + * libgnat/g-dynhta.adb (Minimum_Size): Decrease to 8 in order to + allow for small sets. Update all occurrences of Table_Locked to + Iterated. + (Ensure_Unlocked): Query the number of iterators. + (Find_Node): Use the supplied equality. + (Is_Empty): New routine. + (Lock): Update the number of iterators. + (Prepend_Or_Replace): Use the supplied equality. + (Size): Update the return type. + (Unlock): Update the number of iterators. + * libgnat/g-dynhta.ads: Update all occurrences of Table_Locked + to Iterated. Rename formal subprogram Equivalent_Keys to "=". + (Bucket_Range_Type, Pair_Count_Type): Remove types. + (Not_Created, Table_Locked, Iterator_Exhausted): Remove + exceptions. + (Hash_Table): Update to store the number of iterators rather + than locks. + (Is_Empty): New routine. + (Size): Update the return type. + * libgnat/g-lists.adb: Update all occurrences of List_Locked to + Iterated. + (Ensure_Unlocked): Query the number of iterators. + (Length): Remove. + (Lock): Update the number of iterators. + (Size): New routine. + (Unlock): Update the number of iterators. + * libgnat/g-lists.ads: Update all occurrences of List_Locked to + Iterated. + (Element_Count_Type): Remove type. + (Not_Created, Table_Locked, Iterator_Exhausted): Remove + exceptions. + (Linked_List): Update type to store the number of iterators + rather than locks. + (Length): Remove. + (Size): New routine. + * libgnat/gnat.ads (Bucket_Range_Type): New type. + (Iterated, Iterator_Exhausted, and Not_Created): New exceptions. + 2018-09-26 Javier Miranda * checks.adb (Install_Null_Excluding_Check): Do not add diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl index 936a16d..e1b26de 100644 --- a/gcc/ada/Makefile.rtl +++ b/gcc/ada/Makefile.rtl @@ -445,6 +445,7 @@ GNATRTL_NONTASKING_OBJS= \ g-sehash$(objext) \ g-sercom$(objext) \ g-sestin$(objext) \ + g-sets$(objext) \ g-sha1$(objext) \ g-sha224$(objext) \ g-sha256$(objext) \ diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in index d8dac73..4866c2a 100644 --- a/gcc/ada/gcc-interface/Make-lang.in +++ b/gcc/ada/gcc-interface/Make-lang.in @@ -320,6 +320,7 @@ GNAT_ADA_OBJS = \ ada/libgnat/g-hesora.o \ ada/libgnat/g-htable.o \ ada/libgnat/g-lists.o \ + ada/libgnat/g-sets.o \ ada/libgnat/g-spchge.o \ ada/libgnat/g-speche.o \ ada/libgnat/g-u3spch.o \ diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb index 3e5fbe0..8f68b55 100644 --- a/gcc/ada/impunit.adb +++ b/gcc/ada/impunit.adb @@ -298,6 +298,7 @@ package body Impunit is ("g-semaph", F), -- GNAT.Semaphores ("g-sercom", F), -- GNAT.Serial_Communications ("g-sestin", F), -- GNAT.Secondary_Stack_Info + ("g-sets ", F), -- GNAT.Sets ("g-sha1 ", F), -- GNAT.SHA1 ("g-sha224", F), -- GNAT.SHA224 ("g-sha256", F), -- GNAT.SHA256 diff --git a/gcc/ada/libgnat/g-dynhta.adb b/gcc/ada/libgnat/g-dynhta.adb index b093e79..004c276 100644 --- a/gcc/ada/libgnat/g-dynhta.adb +++ b/gcc/ada/libgnat/g-dynhta.adb @@ -369,7 +369,7 @@ package body GNAT.Dynamic_HTables is -------------------- package body Dynamic_HTable is - Minimum_Size : constant Bucket_Range_Type := 32; + Minimum_Size : constant Bucket_Range_Type := 8; -- Minimum size of the buckets Safe_Compression_Size : constant Bucket_Range_Type := @@ -401,8 +401,8 @@ package body GNAT.Dynamic_HTables is procedure Ensure_Unlocked (T : Instance); pragma Inline (Ensure_Unlocked); - -- Verify that hash table T is unlocked. Raise Table_Locked if this is - -- not the case. + -- Verify that hash table T is unlocked. Raise Iterated if this is not + -- the case. function Find_Bucket (Bkts : Bucket_Table_Ptr; @@ -472,9 +472,10 @@ package body GNAT.Dynamic_HTables is -- Create -- ------------ - function Create (Initial_Size : Bucket_Range_Type) return Instance is + function Create (Initial_Size : Positive) return Instance is Size : constant Bucket_Range_Type := - Bucket_Range_Type'Max (Initial_Size, Minimum_Size); + Bucket_Range_Type'Max + (Bucket_Range_Type (Initial_Size), Minimum_Size); -- Ensure that the buckets meet a minimum size T : constant Instance := new Hash_Table; @@ -661,8 +662,8 @@ package body GNAT.Dynamic_HTables is -- The hash table has at least one outstanding iterator - if T.Locked > 0 then - raise Table_Locked; + if T.Iterators > 0 then + raise Iterated; end if; end Ensure_Unlocked; @@ -697,7 +698,7 @@ package body GNAT.Dynamic_HTables is Nod := Head.Next; while Is_Valid (Nod, Head) loop - if Equivalent_Keys (Nod.Key, Key) then + if Nod.Key = Key then return Nod; end if; @@ -798,6 +799,17 @@ package body GNAT.Dynamic_HTables is end Has_Next; -------------- + -- Is_Empty -- + -------------- + + function Is_Empty (T : Instance) return Boolean is + begin + Ensure_Created (T); + + return T.Pairs = 0; + end Is_Empty; + + -------------- -- Is_Valid -- -------------- @@ -880,7 +892,7 @@ package body GNAT.Dynamic_HTables is -- The hash table may be locked multiple times if multiple iterators -- are operating over it. - T.Locked := T.Locked + 1; + T.Iterators := T.Iterators + 1; end Lock; ----------------------- @@ -1046,11 +1058,7 @@ package body GNAT.Dynamic_HTables is -- Put -- --------- - procedure Put - (T : Instance; - Key : Key_Type; - Value : Value_Type) - is + procedure Put (T : Instance; Key : Key_Type; Value : Value_Type) is procedure Expand; pragma Inline (Expand); -- Determine whether hash table T requires expansion, and if so, @@ -1099,7 +1107,7 @@ package body GNAT.Dynamic_HTables is Nod := Head.Next; while Is_Valid (Nod, Head) loop - if Equivalent_Keys (Nod.Key, Key) then + if Nod.Key = Key then Nod.Value := Value; return; end if; @@ -1172,7 +1180,7 @@ package body GNAT.Dynamic_HTables is -- Size -- ---------- - function Size (T : Instance) return Pair_Count_Type is + function Size (T : Instance) return Natural is begin Ensure_Created (T); @@ -1188,7 +1196,7 @@ package body GNAT.Dynamic_HTables is -- The hash table may be locked multiple times if multiple iterators -- are operating over it. - T.Locked := T.Locked - 1; + T.Iterators := T.Iterators - 1; end Unlock; end Dynamic_HTable; diff --git a/gcc/ada/libgnat/g-dynhta.ads b/gcc/ada/libgnat/g-dynhta.ads index 41574fd..b8fb6a6 100644 --- a/gcc/ada/libgnat/g-dynhta.ads +++ b/gcc/ada/libgnat/g-dynhta.ads @@ -283,21 +283,11 @@ package GNAT.Dynamic_HTables is -- -- The destruction of the table reclaims all storage occupied by it. - -- The following type denotes the underlying range of the hash table - -- buckets. - - type Bucket_Range_Type is mod 2 ** 32; - -- The following type denotes the multiplicative factor used in expansion -- and compression of the hash table. subtype Factor_Type is Bucket_Range_Type range 2 .. 100; - -- The following type denotes the number of key-value pairs stored in the - -- hash table. - - type Pair_Count_Type is range 0 .. 2 ** 31 - 1; - -- The following type denotes the threshold range used in expansion and -- compression of the hash table. @@ -333,10 +323,9 @@ package GNAT.Dynamic_HTables is -- that the size of the buckets will be halved once the load factor -- drops below 0.5. - with function Equivalent_Keys + with function "=" (Left : Key_Type; Right : Key_Type) return Boolean; - -- Determine whether two keys are equivalent with function Hash (Key : Key_Type) return Bucket_Range_Type; -- Map an arbitrary key into the range of buckets @@ -353,52 +342,44 @@ package GNAT.Dynamic_HTables is type Instance is private; Nil : constant Instance; - Not_Created : exception; - -- This exception is raised when the hash table has not been created by - -- routine Create, and an attempt is made to read or mutate its state. - - Table_Locked : exception; - -- This exception is raised when the hash table is being iterated on, - -- and an attempt is made to mutate its state. - - function Create (Initial_Size : Bucket_Range_Type) return Instance; + function Create (Initial_Size : Positive) return Instance; -- Create a new table with bucket capacity Initial_Size. This routine -- must be called at the start of a hash table's lifetime. procedure Delete (T : Instance; Key : Key_Type); -- Delete the value which corresponds to key Key from hash table T. The -- routine has no effect if the value is not present in the hash table. - -- This action will raise Table_Locked if the hash table has outstanding + -- This action will raise Iterated if the hash table has outstanding -- iterators. If the load factor drops below Compression_Threshold, the -- size of the buckets is decreased by Copression_Factor. procedure Destroy (T : in out Instance); -- Destroy the contents of hash table T, rendering it unusable. This -- routine must be called at the end of a hash table's lifetime. This - -- action will raise Table_Locked if the hash table has outstanding + -- action will raise Iterated if the hash table has outstanding -- iterators. function Get (T : Instance; Key : Key_Type) return Value_Type; -- Obtain the value which corresponds to key Key from hash table T. If -- the value does not exist, return No_Value. - procedure Put - (T : Instance; - Key : Key_Type; - Value : Value_Type); + function Is_Empty (T : Instance) return Boolean; + -- Determine whether hash table T is empty + + procedure Put (T : Instance; Key : Key_Type; Value : Value_Type); -- Associate value Value with key Key in hash table T. If the table -- already contains a mapping of the same key to a previous value, the - -- previous value is overwritten. This action will raise Table_Locked - -- if the hash table has outstanding iterators. If the load factor goes + -- previous value is overwritten. This action will raise Iterated if + -- the hash table has outstanding iterators. If the load factor goes -- over Expansion_Threshold, the size of the buckets is increased by -- Expansion_Factor. procedure Reset (T : Instance); -- Destroy the contents of hash table T, and reset it to its initial - -- created state. This action will raise Table_Locked if the hash table + -- created state. This action will raise Iterated if the hash table -- has outstanding iterators. - function Size (T : Instance) return Pair_Count_Type; + function Size (T : Instance) return Natural; -- Obtain the number of key-value pairs in hash table T ------------------------- @@ -420,10 +401,6 @@ package GNAT.Dynamic_HTables is type Iterator is private; - Iterator_Exhausted : exception; - -- This exception is raised when an iterator is exhausted and further - -- attempts to advance it are made by calling routine Next. - function Iterate (T : Instance) return Iterator; -- Obtain an iterator over the keys of hash table T. This action locks -- all mutation functionality of the associated hash table. @@ -433,9 +410,7 @@ package GNAT.Dynamic_HTables is -- iterator has been exhausted, restore all mutation functionality of -- the associated hash table. - procedure Next - (Iter : in out Iterator; - Key : out Key_Type); + procedure Next (Iter : in out Iterator; Key : out Key_Type); -- Return the current key referenced by iterator Iter and advance to -- the next available key. If the iterator has been exhausted and -- further attempts are made to advance it, this routine restores @@ -487,10 +462,10 @@ package GNAT.Dynamic_HTables is Initial_Size : Bucket_Range_Type := 0; -- The initial size of the buckets as specified at creation time - Locked : Natural := 0; + Iterators : Natural := 0; -- Number of outstanding iterators - Pairs : Pair_Count_Type := 0; + Pairs : Natural := 0; -- Number of key-value pairs in the buckets end record; diff --git a/gcc/ada/libgnat/g-lists.adb b/gcc/ada/libgnat/g-lists.adb index a058f33..ca39a4c 100644 --- a/gcc/ada/libgnat/g-lists.adb +++ b/gcc/ada/libgnat/g-lists.adb @@ -54,7 +54,7 @@ package body GNAT.Lists is procedure Ensure_Unlocked (L : Instance); pragma Inline (Ensure_Unlocked); - -- Verify that list L is unlocked. Raise List_Locked if this is not the + -- Verify that list L is unlocked. Raise Iterated if this is not the -- case. function Find_Node @@ -306,8 +306,8 @@ package body GNAT.Lists is -- The list has at least one outstanding iterator - if L.Locked > 0 then - raise List_Locked; + if L.Iterators > 0 then + raise Iterated; end if; end Ensure_Unlocked; @@ -514,17 +514,6 @@ package body GNAT.Lists is return L.Nodes.Prev.Elem; end Last; - ------------ - -- Length -- - ------------ - - function Length (L : Instance) return Element_Count_Type is - begin - Ensure_Created (L); - - return L.Elements; - end Length; - ---------- -- Lock -- ---------- @@ -536,17 +525,14 @@ package body GNAT.Lists is -- The list may be locked multiple times if multiple iterators are -- operating over it. - L.Locked := L.Locked + 1; + L.Iterators := L.Iterators + 1; end Lock; ---------- -- Next -- ---------- - procedure Next - (Iter : in out Iterator; - Elem : out Element_Type) - is + procedure Next (Iter : in out Iterator; Elem : out Element_Type) is Is_OK : constant Boolean := Is_Valid (Iter); Saved : constant Node_Ptr := Iter.Nod; @@ -617,6 +603,17 @@ package body GNAT.Lists is end if; end Replace; + ---------- + -- Size -- + ---------- + + function Size (L : Instance) return Natural is + begin + Ensure_Created (L); + + return L.Elements; + end Size; + ------------ -- Unlock -- ------------ @@ -628,7 +625,7 @@ package body GNAT.Lists is -- The list may be locked multiple times if multiple iterators are -- operating over it. - L.Locked := L.Locked - 1; + L.Iterators := L.Iterators - 1; end Unlock; end Doubly_Linked_List; diff --git a/gcc/ada/libgnat/g-lists.ads b/gcc/ada/libgnat/g-lists.ads index 777b4f6..bf7795a 100644 --- a/gcc/ada/libgnat/g-lists.ads +++ b/gcc/ada/libgnat/g-lists.ads @@ -49,14 +49,10 @@ package GNAT.Lists is -- -- -- - -- Destroy (List) + -- Destroy (List); -- -- The destruction of the list reclaims all storage occupied by it. - -- The following type denotes the number of elements stored in a list - - type Element_Count_Type is range 0 .. 2 ** 31 - 1; - generic type Element_Type is private; @@ -73,21 +69,14 @@ package GNAT.Lists is type Instance is private; Nil : constant Instance; - List_Empty : exception; - -- This exception is raised when the list is empty, and an attempt is - -- made to delete an element from it. + -- The following exception is raised when the list is empty, and an + -- attempt is made to delete an element from it. - List_Locked : exception; - -- This exception is raised when the list is being iterated on, and an - -- attempt is made to mutate its state. - - Not_Created : exception; - -- This exception is raised when the list has not been created by - -- routine Create, and an attempt is made to read or mutate its state. + List_Empty : exception; procedure Append (L : Instance; Elem : Element_Type); -- Insert element Elem at the end of list L. This action will raise - -- List_Locked if the list has outstanding iterators. + -- Iterated if the list has outstanding iterators. function Contains (L : Instance; Elem : Element_Type) return Boolean; -- Determine whether list L contains element Elem @@ -100,23 +89,23 @@ package GNAT.Lists is -- not present. This action will raise -- -- * List_Empty if the list is empty. - -- * List_Locked if the list has outstanding iterators. + -- * Iterated if the list has outstanding iterators. procedure Delete_First (L : Instance); -- Delete an element from the start of list L. This action will raise -- -- * List_Empty if the list is empty. - -- * List_Locked if the list has outstanding iterators. + -- * Iterated if the list has outstanding iterators. procedure Delete_Last (L : Instance); -- Delete an element from the end of list L. This action will raise -- -- * List_Empty if the list is empty. - -- * List_Locked if the list has outstanding iterators. + -- * Iterated if the list has outstanding iterators. procedure Destroy (L : in out Instance); -- Destroy the contents of list L. This routine must be called at the - -- end of a list's lifetime. This action will raise List_Locked if the + -- end of a list's lifetime. This action will raise Iterated if the -- list has outstanding iterators. function First (L : Instance) return Element_Type; @@ -129,7 +118,7 @@ package GNAT.Lists is Elem : Element_Type); -- Insert new element Elem after element After in list L. The routine -- has no effect if After is not present. This action will raise - -- List_Locked if the list has outstanding iterators. + -- Iterated if the list has outstanding iterators. procedure Insert_Before (L : Instance; @@ -137,7 +126,7 @@ package GNAT.Lists is Elem : Element_Type); -- Insert new element Elem before element Before in list L. The routine -- has no effect if After is not present. This action will raise - -- List_Locked if the list has outstanding iterators. + -- Iterated if the list has outstanding iterators. function Is_Empty (L : Instance) return Boolean; -- Determine whether list L is empty @@ -146,12 +135,9 @@ package GNAT.Lists is -- Obtain an element from the end of list L. This action will raise -- List_Empty if the list is empty. - function Length (L : Instance) return Element_Count_Type; - -- Obtain the number of elements in list L - procedure Prepend (L : Instance; Elem : Element_Type); -- Insert element Elem at the start of list L. This action will raise - -- List_Locked if the list has outstanding iterators. + -- Iterated if the list has outstanding iterators. procedure Replace (L : Instance; @@ -159,7 +145,10 @@ package GNAT.Lists is New_Elem : Element_Type); -- Replace old element Old_Elem with new element New_Elem in list L. The -- routine has no effect if Old_Elem is not present. This action will - -- raise List_Locked if the list has outstanding iterators. + -- raise Iterated if the list has outstanding iterators. + + function Size (L : Instance) return Natural; + -- Obtain the number of elements in list L ------------------------- -- Iterator operations -- @@ -179,10 +168,6 @@ package GNAT.Lists is type Iterator is private; - Iterator_Exhausted : exception; - -- This exception is raised when an iterator is exhausted and further - -- attempts to advance it are made by calling routine Next. - function Iterate (L : Instance) return Iterator; -- Obtain an iterator over the elements of list L. This action locks all -- mutation functionality of the associated list. @@ -192,9 +177,7 @@ package GNAT.Lists is -- iterator has been exhausted, restore all mutation functionality of -- the associated list. - procedure Next - (Iter : in out Iterator; - Elem : out Element_Type); + procedure Next (Iter : in out Iterator; Elem : out Element_Type); -- Return the current element referenced by iterator Iter and advance -- to the next available element. If the iterator has been exhausted -- and further attempts are made to advance it, this routine restores @@ -216,10 +199,10 @@ package GNAT.Lists is -- The following type represents a list type Linked_List is record - Elements : Element_Count_Type := 0; + Elements : Natural := 0; -- The number of elements in the list - Locked : Natural := 0; + Iterators : Natural := 0; -- Number of outstanding iterators Nodes : aliased Node; diff --git a/gcc/ada/libgnat/g-sets.adb b/gcc/ada/libgnat/g-sets.adb new file mode 100644 index 0000000..90a5810 --- /dev/null +++ b/gcc/ada/libgnat/g-sets.adb @@ -0,0 +1,131 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- G N A T . S E T S -- +-- -- +-- B o d y -- +-- -- +-- Copyright (C) 2018, AdaCore -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. -- +-- -- +-- As a special exception under Section 7 of GPL version 3, you are granted -- +-- additional permissions described in the GCC Runtime Library Exception, -- +-- version 3.1, as published by the Free Software Foundation. -- +-- -- +-- You should have received a copy of the GNU General Public License and -- +-- a copy of the GCC Runtime Library Exception along with this program; -- +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- +-- . -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +package body GNAT.Sets is + + -------------------- + -- Membership_Set -- + -------------------- + + package body Membership_Set is + + -------------- + -- Contains -- + -------------- + + function Contains (S : Instance; Elem : Element_Type) return Boolean is + begin + return Hashed_Set.Get (Hashed_Set.Instance (S), Elem); + end Contains; + + ------------ + -- Create -- + ------------ + + function Create (Initial_Size : Positive) return Instance is + begin + return Instance (Hashed_Set.Create (Initial_Size)); + end Create; + + ------------ + -- Delete -- + ------------ + + procedure Delete (S : Instance; Elem : Element_Type) is + begin + Hashed_Set.Delete (Hashed_Set.Instance (S), Elem); + end Delete; + + ------------- + -- Destroy -- + ------------- + + procedure Destroy (S : in out Instance) is + begin + Hashed_Set.Destroy (Hashed_Set.Instance (S)); + end Destroy; + + -------------- + -- Has_Next -- + -------------- + + function Has_Next (Iter : Iterator) return Boolean is + begin + return Hashed_Set.Has_Next (Hashed_Set.Iterator (Iter)); + end Has_Next; + + ------------ + -- Insert -- + ------------ + + procedure Insert (S : Instance; Elem : Element_Type) is + begin + Hashed_Set.Put (Hashed_Set.Instance (S), Elem, True); + end Insert; + + -------------- + -- Is_Empty -- + -------------- + + function Is_Empty (S : Instance) return Boolean is + begin + return Hashed_Set.Is_Empty (Hashed_Set.Instance (S)); + end Is_Empty; + + ------------- + -- Iterate -- + ------------- + + function Iterate (S : Instance) return Iterator is + begin + return Iterator (Hashed_Set.Iterate (Hashed_Set.Instance (S))); + end Iterate; + + ---------- + -- Next -- + ---------- + + procedure Next (Iter : in out Iterator; Elem : out Element_Type) is + begin + Hashed_Set.Next (Hashed_Set.Iterator (Iter), Elem); + end Next; + + ---------- + -- Size -- + ---------- + + function Size (S : Instance) return Natural is + begin + return Hashed_Set.Size (Hashed_Set.Instance (S)); + end Size; + end Membership_Set; + +end GNAT.Sets; diff --git a/gcc/ada/libgnat/g-sets.ads b/gcc/ada/libgnat/g-sets.ads new file mode 100644 index 0000000..59e413b --- /dev/null +++ b/gcc/ada/libgnat/g-sets.ads @@ -0,0 +1,161 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- G N A T . S E T S -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2018, AdaCore -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. -- +-- -- +-- As a special exception under Section 7 of GPL version 3, you are granted -- +-- additional permissions described in the GCC Runtime Library Exception, -- +-- version 3.1, as published by the Free Software Foundation. -- +-- -- +-- You should have received a copy of the GNU General Public License and -- +-- a copy of the GCC Runtime Library Exception along with this program; -- +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- +-- . -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +pragma Compiler_Unit_Warning; + +with GNAT.Dynamic_HTables; use GNAT.Dynamic_HTables; + +package GNAT.Sets is + + -------------------- + -- Membership_Set -- + -------------------- + + -- The following package offers a membership set abstraction with the + -- following characteristics: + -- + -- * Creation of multiple instances, of different sizes. + -- * Iterable elements. + -- + -- The following use pattern must be employed with this set: + -- + -- Set : Instance := Create (); + -- + -- + -- + -- Destroy (Set); + -- + -- The destruction of the set reclaims all storage occupied by it. + + generic + type Element_Type is private; + + with function "=" + (Left : Element_Type; + Right : Element_Type) return Boolean; + + with function Hash (Key : Element_Type) return Bucket_Range_Type; + -- Map an arbitrary key into the range of buckets + + package Membership_Set is + + -------------------- + -- Set operations -- + -------------------- + + -- The following type denotes a membership set handle. Each instance + -- must be created using routine Create. + + type Instance is private; + Nil : constant Instance; + + function Contains (S : Instance; Elem : Element_Type) return Boolean; + -- Determine whether membership set S contains element Elem + + function Create (Initial_Size : Positive) return Instance; + -- Create a new membership set with bucket capacity Initial_Size. This + -- routine must be called at the start of the membership set's lifetime. + + procedure Delete (S : Instance; Elem : Element_Type); + -- Delete element Elem from membership set S. The routine has no effect + -- if the element is not present in the membership set. This action will + -- raise Iterated if the membership set has outstanding iterators. + + procedure Destroy (S : in out Instance); + -- Destroy the contents of membership set S, rendering it unusable. This + -- routine must be called at the end of the membership set's lifetime. + -- This action will raise Iterated if the hash table has outstanding + -- iterators. + + procedure Insert (S : Instance; Elem : Element_Type); + -- Insert element Elem in membership set S. The routine has no effect + -- if the element is already present in the membership set. This action + -- will raise Iterated if the membership set has outstanding iterators. + + function Is_Empty (S : Instance) return Boolean; + -- Determine whether set S is empty + + function Size (S : Instance) return Natural; + -- Obtain the number of elements in membership set S + + ------------------------- + -- Iterator operations -- + ------------------------- + + -- The following type represents an element iterator. An iterator locks + -- all mutation operations, and unlocks them once it is exhausted. The + -- iterator must be used with the following pattern: + -- + -- Iter := Iterate (My_Set); + -- while Has_Next (Iter) loop + -- Next (Iter, Element); + -- end loop; + -- + -- It is possible to advance the iterator by using Next only, however + -- this risks raising Iterator_Exhausted. + + type Iterator is private; + + function Iterate (S : Instance) return Iterator; + -- Obtain an iterator over the elements of membership set S. This action + -- locks all mutation functionality of the associated membership set. + + function Has_Next (Iter : Iterator) return Boolean; + -- Determine whether iterator Iter has more keys to examine. If the + -- iterator has been exhausted, restore all mutation functionality of + -- the associated membership set. + + procedure Next (Iter : in out Iterator; Elem : out Element_Type); + -- Return the current element referenced by iterator Iter and advance + -- to the next available element. If the iterator has been exhausted + -- and further attempts are made to advance it, this routine restores + -- mutation functionality of the associated membership set, and then + -- raises Iterator_Exhausted. + + private + package Hashed_Set is new Dynamic_HTable + (Key_Type => Element_Type, + Value_Type => Boolean, + No_Value => False, + Expansion_Threshold => 1.5, + Expansion_Factor => 2, + Compression_Threshold => 0.3, + Compression_Factor => 2, + "=" => "=", + Hash => Hash); + + type Instance is new Hashed_Set.Instance; + Nil : constant Instance := Instance (Hashed_Set.Nil); + + type Iterator is new Hashed_Set.Iterator; + end Membership_Set; + +end GNAT.Sets; diff --git a/gcc/ada/libgnat/gnat.ads b/gcc/ada/libgnat/gnat.ads index fb160a5..faec6c5 100644 --- a/gcc/ada/libgnat/gnat.ads +++ b/gcc/ada/libgnat/gnat.ads @@ -34,4 +34,24 @@ package GNAT is pragma Pure; + -- The following type denotes the range of buckets for various hashed + -- data structures in the GNAT unit hierarchy. + + type Bucket_Range_Type is mod 2 ** 32; + + -- The following exception is raised whenever an attempt is made to mutate + -- the state of a data structure that is being iterated on. + + Iterated : exception; + + -- The following exception is raised when an iterator is exhausted and + -- further attempts are made to advance it. + + Iterator_Exhausted : exception; + + -- The following exception is raised whenever an attempt is made to mutate + -- the state of a data structure that has not been created yet. + + Not_Created : exception; + end GNAT; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5e7a15d..459563f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Hristian Kirtchev + + * gnat.dg/sets1.adb: New testcase. + * gnat.dg/dynhash.adb, gnat.dg/linkedlist.adb: Update testcases + to new API. + 2018-09-26 Thomas Quinot * gnat.dg/sso12.adb: New testcase. diff --git a/gcc/testsuite/gnat.dg/dynhash.adb b/gcc/testsuite/gnat.dg/dynhash.adb index 79e1b98..c51e6e2 100644 --- a/gcc/testsuite/gnat.dg/dynhash.adb +++ b/gcc/testsuite/gnat.dg/dynhash.adb @@ -1,6 +1,7 @@ -- { dg-do run } with Ada.Text_IO; use Ada.Text_IO; +with GNAT; use GNAT; with GNAT.Dynamic_HTables; use GNAT.Dynamic_HTables; procedure Dynhash is @@ -14,14 +15,14 @@ procedure Dynhash is Expansion_Factor => 2, Compression_Threshold => 0.3, Compression_Factor => 2, - Equivalent_Keys => "=", + "=" => "=", Hash => Hash); use DHT; function Create_And_Populate (Low_Key : Integer; High_Key : Integer; - Init_Size : Bucket_Range_Type) return Instance; + Init_Size : Positive) return Instance; -- Create a hash table with initial size Init_Size and populate it with -- key-value pairs where both keys and values are in the range Low_Key -- .. High_Key. @@ -50,19 +51,19 @@ procedure Dynhash is procedure Check_Size (Caller : String; T : Instance; - Exp_Count : Pair_Count_Type); + Exp_Count : Natural); -- Ensure that the count of key-value pairs of hash table T matches -- expected count Exp_Count. Emit an error if this is not the case. - procedure Test_Create (Init_Size : Bucket_Range_Type); + procedure Test_Create (Init_Size : Positive); -- Verify that all dynamic hash table operations fail on a non-created -- table of size Init_Size. procedure Test_Delete_Get_Put_Size (Low_Key : Integer; High_Key : Integer; - Exp_Count : Pair_Count_Type; - Init_Size : Bucket_Range_Type); + Exp_Count : Natural; + Init_Size : Positive); -- Verify that -- -- * Put properly inserts values in the hash table. @@ -78,7 +79,7 @@ procedure Dynhash is procedure Test_Iterate (Low_Key : Integer; High_Key : Integer; - Init_Size : Bucket_Range_Type); + Init_Size : Positive); -- Verify that iterators -- -- * Properly visit each key exactly once. @@ -88,7 +89,7 @@ procedure Dynhash is -- Low_Key and High_Key denote the range of keys to be inserted, retrieved, -- and deleted. Init_Size denotes the initial size of the table. - procedure Test_Iterate_Empty (Init_Size : Bucket_Range_Type); + procedure Test_Iterate_Empty (Init_Size : Positive); -- Verify that an iterator over an empty hash table -- -- * Does not visit any key @@ -100,7 +101,7 @@ procedure Dynhash is procedure Test_Iterate_Forced (Low_Key : Integer; High_Key : Integer; - Init_Size : Bucket_Range_Type); + Init_Size : Positive); -- Verify that an iterator that is forcefully advanced by just Next -- -- * Properly visit each key exactly once. @@ -113,7 +114,7 @@ procedure Dynhash is procedure Test_Replace (Low_Val : Integer; High_Val : Integer; - Init_Size : Bucket_Range_Type); + Init_Size : Positive); -- Verify that Put properly updates the value of a particular key. Low_Val -- and High_Val denote the range of values to be updated. Init_Size denotes -- the initial size of the table. @@ -121,7 +122,7 @@ procedure Dynhash is procedure Test_Reset (Low_Key : Integer; High_Key : Integer; - Init_Size : Bucket_Range_Type); + Init_Size : Positive); -- Verify that Reset properly destroy and recreats a hash table. Low_Key -- and High_Key denote the range of keys to be inserted in the hash table. -- Init_Size denotes the initial size of the table. @@ -133,7 +134,7 @@ procedure Dynhash is function Create_And_Populate (Low_Key : Integer; High_Key : Integer; - Init_Size : Bucket_Range_Type) return Instance + Init_Size : Positive) return Instance is T : Instance; @@ -232,7 +233,7 @@ procedure Dynhash is Delete (T, 1); Put_Line ("ERROR: " & Caller & ": Delete: no exception raised"); exception - when Table_Locked => + when Iterated => null; when others => Put_Line ("ERROR: " & Caller & ": Delete: unexpected exception"); @@ -242,7 +243,7 @@ procedure Dynhash is Destroy (T); Put_Line ("ERROR: " & Caller & ": Destroy: no exception raised"); exception - when Table_Locked => + when Iterated => null; when others => Put_Line ("ERROR: " & Caller & ": Destroy: unexpected exception"); @@ -252,7 +253,7 @@ procedure Dynhash is Put (T, 1, 1); Put_Line ("ERROR: " & Caller & ": Put: no exception raised"); exception - when Table_Locked => + when Iterated => null; when others => Put_Line ("ERROR: " & Caller & ": Put: unexpected exception"); @@ -262,7 +263,7 @@ procedure Dynhash is Reset (T); Put_Line ("ERROR: " & Caller & ": Reset: no exception raised"); exception - when Table_Locked => + when Iterated => null; when others => Put_Line ("ERROR: " & Caller & ": Reset: unexpected exception"); @@ -273,12 +274,12 @@ procedure Dynhash is -- Check_Size -- ---------------- - procedure Check_Size + procedure Check_Size (Caller : String; T : Instance; - Exp_Count : Pair_Count_Type) + Exp_Count : Natural) is - Count : constant Pair_Count_Type := Size (T); + Count : constant Natural := Size (T); begin if Count /= Exp_Count then @@ -301,8 +302,8 @@ procedure Dynhash is -- Test_Create -- ----------------- - procedure Test_Create (Init_Size : Bucket_Range_Type) is - Count : Pair_Count_Type; + procedure Test_Create (Init_Size : Positive) is + Count : Natural; Iter : Iterator; T : Instance; Val : Integer; @@ -397,8 +398,8 @@ procedure Dynhash is procedure Test_Delete_Get_Put_Size (Low_Key : Integer; High_Key : Integer; - Exp_Count : Pair_Count_Type; - Init_Size : Bucket_Range_Type) + Exp_Count : Natural; + Init_Size : Positive) is Exp_Val : Integer; T : Instance; @@ -478,7 +479,7 @@ procedure Dynhash is procedure Test_Iterate (Low_Key : Integer; High_Key : Integer; - Init_Size : Bucket_Range_Type) + Init_Size : Positive) is Iter_1 : Iterator; Iter_2 : Iterator; @@ -527,7 +528,7 @@ procedure Dynhash is -- operations of the hash table because all outstanding iterators have -- been exhausted. - Check_Keys + Check_Keys (Caller => "Test_Iterate", Iter => Iter_2, Low_Key => Low_Key, @@ -548,7 +549,7 @@ procedure Dynhash is -- Test_Iterate_Empty -- ------------------------ - procedure Test_Iterate_Empty (Init_Size : Bucket_Range_Type) is + procedure Test_Iterate_Empty (Init_Size : Positive) is Iter : Iterator; Key : Integer; T : Instance; @@ -594,7 +595,7 @@ procedure Dynhash is procedure Test_Iterate_Forced (Low_Key : Integer; High_Key : Integer; - Init_Size : Bucket_Range_Type) + Init_Size : Positive) is Iter : Iterator; Key : Integer; @@ -649,7 +650,7 @@ procedure Dynhash is procedure Test_Replace (Low_Val : Integer; High_Val : Integer; - Init_Size : Bucket_Range_Type) + Init_Size : Positive) is Key : constant Integer := 1; T : Instance; @@ -681,10 +682,10 @@ procedure Dynhash is -- Test_Reset -- ---------------- - procedure Test_Reset + procedure Test_Reset (Low_Key : Integer; High_Key : Integer; - Init_Size : Bucket_Range_Type) + Init_Size : Positive) is T : Instance; diff --git a/gcc/testsuite/gnat.dg/linkedlist.adb b/gcc/testsuite/gnat.dg/linkedlist.adb index 53a272f..b608fe1 100644 --- a/gcc/testsuite/gnat.dg/linkedlist.adb +++ b/gcc/testsuite/gnat.dg/linkedlist.adb @@ -1,6 +1,7 @@ -- { dg-do run } with Ada.Text_IO; use Ada.Text_IO; +with GNAT; use GNAT; with GNAT.Lists; use GNAT.Lists; procedure Linkedlist is @@ -97,15 +98,15 @@ procedure Linkedlist is procedure Test_Last; -- Verify that Last properly returns the tail of a list - procedure Test_Length; - -- Verify that Length returns the correct length of a list - procedure Test_Prepend; -- Verify that Prepend properly inserts at the head of a list procedure Test_Replace; -- Verify that Replace properly substitutes old elements with new ones + procedure Test_Size; + -- Verify that Size returns the correct size of a list + ----------------- -- Check_Empty -- ----------------- @@ -116,7 +117,7 @@ procedure Linkedlist is Low_Elem : Integer; High_Elem : Integer) is - Len : constant Element_Count_Type := Length (L); + Len : constant Natural := Size (L); begin for Elem in Low_Elem .. High_Elem loop @@ -142,7 +143,7 @@ procedure Linkedlist is Append (L, 1); Put_Line ("ERROR: " & Caller & ": Append: no exception raised"); exception - when List_Locked => + when Iterated => null; when others => Put_Line ("ERROR: " & Caller & ": Append: unexpected exception"); @@ -154,7 +155,7 @@ procedure Linkedlist is exception when List_Empty => null; - when List_Locked => + when Iterated => null; when others => Put_Line ("ERROR: " & Caller & ": Delete: unexpected exception"); @@ -166,7 +167,7 @@ procedure Linkedlist is exception when List_Empty => null; - when List_Locked => + when Iterated => null; when others => Put_Line @@ -179,10 +180,10 @@ procedure Linkedlist is exception when List_Empty => null; - when List_Locked => + when Iterated => null; when others => - Put_Line + Put_Line ("ERROR: " & Caller & ": Delete_Last: unexpected exception"); end; @@ -190,7 +191,7 @@ procedure Linkedlist is Destroy (L); Put_Line ("ERROR: " & Caller & ": Destroy: no exception raised"); exception - when List_Locked => + when Iterated => null; when others => Put_Line ("ERROR: " & Caller & ": Destroy: unexpected exception"); @@ -200,10 +201,10 @@ procedure Linkedlist is Insert_After (L, 1, 2); Put_Line ("ERROR: " & Caller & ": Insert_After: no exception raised"); exception - when List_Locked => + when Iterated => null; when others => - Put_Line + Put_Line ("ERROR: " & Caller & ": Insert_After: unexpected exception"); end; @@ -212,7 +213,7 @@ procedure Linkedlist is Put_Line ("ERROR: " & Caller & ": Insert_Before: no exception raised"); exception - when List_Locked => + when Iterated => null; when others => Put_Line @@ -223,7 +224,7 @@ procedure Linkedlist is Prepend (L, 1); Put_Line ("ERROR: " & Caller & ": Prepend: no exception raised"); exception - when List_Locked => + when Iterated => null; when others => Put_Line ("ERROR: " & Caller & ": Prepend: unexpected exception"); @@ -233,7 +234,7 @@ procedure Linkedlist is Replace (L, 1, 2); Put_Line ("ERROR: " & Caller & ": Replace: no exception raised"); exception - when List_Locked => + when Iterated => null; when others => Put_Line ("ERROR: " & Caller & ": Replace: unexpected exception"); @@ -384,7 +385,7 @@ procedure Linkedlist is ----------------- procedure Test_Create is - Count : Element_Count_Type; + Count : Natural; Flag : Boolean; Iter : Iterator; L : Instance; @@ -508,33 +509,33 @@ procedure Linkedlist is end; begin - Count := Length (L); - Put_Line ("ERROR: Test_Create: Length: no exception raised"); + Prepend (L, 1); + Put_Line ("ERROR: Test_Create: Prepend: no exception raised"); exception when Not_Created => null; when others => - Put_Line ("ERROR: Test_Create: Length: unexpected exception"); + Put_Line ("ERROR: Test_Create: Prepend: unexpected exception"); end; begin - Prepend (L, 1); - Put_Line ("ERROR: Test_Create: Prepend: no exception raised"); + Replace (L, 1, 2); + Put_Line ("ERROR: Test_Create: Replace: no exception raised"); exception when Not_Created => null; when others => - Put_Line ("ERROR: Test_Create: Prepend: unexpected exception"); + Put_Line ("ERROR: Test_Create: Replace: unexpected exception"); end; begin - Replace (L, 1, 2); - Put_Line ("ERROR: Test_Create: Replace: no exception raised"); + Count := Size (L); + Put_Line ("ERROR: Test_Create: Size: no exception raised"); exception when Not_Created => null; when others => - Put_Line ("ERROR: Test_Create: Replace: unexpected exception"); + Put_Line ("ERROR: Test_Create: Size: unexpected exception"); end; end Test_Create; @@ -654,7 +655,7 @@ procedure Linkedlist is -- At this point the list should be completely empty - Check_Empty + Check_Empty (Caller => "Test_Delete_First", L => L, Low_Elem => Low_Elem, @@ -1055,44 +1056,6 @@ procedure Linkedlist is Destroy (L); end Test_Last; - ----------------- - -- Test_Length -- - ----------------- - - procedure Test_Length is - L : Instance := Create; - Len : Element_Count_Type; - - begin - Len := Length (L); - - if Len /= 0 then - Put_Line ("ERROR: Test_Length: wrong length"); - Put_Line ("expected: 0"); - Put_Line ("got :" & Len'Img); - end if; - - Populate_With_Append (L, 1, 2); - Len := Length (L); - - if Len /= 2 then - Put_Line ("ERROR: Test_Length: wrong length"); - Put_Line ("expected: 2"); - Put_Line ("got :" & Len'Img); - end if; - - Populate_With_Append (L, 3, 6); - Len := Length (L); - - if Len /= 6 then - Put_Line ("ERROR: Test_Length: wrong length"); - Put_Line ("expected: 6"); - Put_Line ("got :" & Len'Img); - end if; - - Destroy (L); - end Test_Length; - ------------------ -- Test_Prepend -- ------------------ @@ -1143,6 +1106,44 @@ procedure Linkedlist is Destroy (L); end Test_Replace; + --------------- + -- Test_Size -- + --------------- + + procedure Test_Size is + L : Instance := Create; + S : Natural; + + begin + S := Size (L); + + if S /= 0 then + Put_Line ("ERROR: Test_Size: wrong size"); + Put_Line ("expected: 0"); + Put_Line ("got :" & S'Img); + end if; + + Populate_With_Append (L, 1, 2); + S := Size (L); + + if S /= 2 then + Put_Line ("ERROR: Test_Size: wrong size"); + Put_Line ("expected: 2"); + Put_Line ("got :" & S'Img); + end if; + + Populate_With_Append (L, 3, 6); + S := Size (L); + + if S /= 6 then + Put_Line ("ERROR: Test_Size: wrong size"); + Put_Line ("expected: 6"); + Put_Line ("got :" & S'Img); + end if; + + Destroy (L); + end Test_Size; + -- Start of processing for Operations begin @@ -1178,7 +1179,7 @@ begin High_Elem => 5); Test_Last; - Test_Length; Test_Prepend; Test_Replace; + Test_Size; end Linkedlist; diff --git a/gcc/testsuite/gnat.dg/sets1.adb b/gcc/testsuite/gnat.dg/sets1.adb new file mode 100644 index 0000000..54a4983 --- /dev/null +++ b/gcc/testsuite/gnat.dg/sets1.adb @@ -0,0 +1,634 @@ +-- { dg-do run } + +with Ada.Text_IO; use Ada.Text_IO; +with GNAT; use GNAT; +with GNAT.Sets; use GNAT.Sets; + +procedure Sets1 is + function Hash (Key : Integer) return Bucket_Range_Type; + + package Integer_Sets is new Membership_Set + (Element_Type => Integer, + "=" => "=", + Hash => Hash); + use Integer_Sets; + + procedure Check_Empty + (Caller : String; + S : Instance; + Low_Elem : Integer; + High_Elem : Integer); + -- Ensure that none of the elements in the range Low_Elem .. High_Elem are + -- present in set S, and that the set's length is 0. + + procedure Check_Locked_Mutations (Caller : String; S : in out Instance); + -- Ensure that all mutation operations of set S are locked + + procedure Check_Present + (Caller : String; + S : Instance; + Low_Elem : Integer; + High_Elem : Integer); + -- Ensure that all elements in the range Low_Elem .. High_Elem are present + -- in set S. + + procedure Check_Unlocked_Mutations (Caller : String; S : in out Instance); + -- Ensure that all mutation operations of set S are unlocked + + procedure Populate + (S : Instance; + Low_Elem : Integer; + High_Elem : Integer); + -- Add elements in the range Low_Elem .. High_Elem in set S + + procedure Test_Contains + (Low_Elem : Integer; + High_Elem : Integer; + Init_Size : Positive); + -- Verify that Contains properly identifies that elements in the range + -- Low_Elem .. High_Elem are within a set. Init_Size denotes the initial + -- size of the set. + + procedure Test_Create; + -- Verify that all set operations fail on a non-created set + + procedure Test_Delete + (Low_Elem : Integer; + High_Elem : Integer; + Init_Size : Positive); + -- Verify that Delete properly removes elements in the range Low_Elem .. + -- High_Elem from a set. Init_Size denotes the initial size of the set. + + procedure Test_Is_Empty; + -- Verify that Is_Empty properly returns this status of a set + + procedure Test_Iterate; + -- Verify that iterators properly manipulate mutation operations + + procedure Test_Iterate_Empty; + -- Verify that iterators properly manipulate mutation operations of an + -- empty set. + + procedure Test_Iterate_Forced + (Low_Elem : Integer; + High_Elem : Integer; + Init_Size : Positive); + -- Verify that an iterator that is forcefully advanced by Next properly + -- unlocks the mutation operations of a set. Init_Size denotes the initial + -- size of the set. + + procedure Test_Size; + -- Verify that Size returns the correct size of a set + + ----------------- + -- Check_Empty -- + ----------------- + + procedure Check_Empty + (Caller : String; + S : Instance; + Low_Elem : Integer; + High_Elem : Integer) + is + Siz : constant Natural := Size (S); + + begin + for Elem in Low_Elem .. High_Elem loop + if Contains (S, Elem) then + Put_Line ("ERROR: " & Caller & ": extra element" & Elem'Img); + end if; + end loop; + + if Siz /= 0 then + Put_Line ("ERROR: " & Caller & ": wrong size"); + Put_Line ("expected: 0"); + Put_Line ("got :" & Siz'Img); + end if; + end Check_Empty; + + ---------------------------- + -- Check_Locked_Mutations -- + ---------------------------- + + procedure Check_Locked_Mutations (Caller : String; S : in out Instance) is + begin + begin + Delete (S, 1); + Put_Line ("ERROR: " & Caller & ": Delete: no exception raised"); + exception + when Iterated => + null; + when others => + Put_Line ("ERROR: " & Caller & ": Delete: unexpected exception"); + end; + + begin + Destroy (S); + Put_Line ("ERROR: " & Caller & ": Destroy: no exception raised"); + exception + when Iterated => + null; + when others => + Put_Line ("ERROR: " & Caller & ": Destroy: unexpected exception"); + end; + + begin + Insert (S, 1); + Put_Line ("ERROR: " & Caller & ": Insert: no exception raised"); + exception + when Iterated => + null; + when others => + Put_Line ("ERROR: " & Caller & ": Insert: unexpected exception"); + end; + end Check_Locked_Mutations; + + ------------------- + -- Check_Present -- + ------------------- + + procedure Check_Present + (Caller : String; + S : Instance; + Low_Elem : Integer; + High_Elem : Integer) + is + Elem : Integer; + Iter : Iterator; + + begin + Iter := Iterate (S); + for Exp_Elem in Low_Elem .. High_Elem loop + Next (Iter, Elem); + + if Elem /= Exp_Elem then + Put_Line ("ERROR: " & Caller & ": Check_Present: wrong element"); + Put_Line ("expected:" & Exp_Elem'Img); + Put_Line ("got :" & Elem'Img); + end if; + end loop; + + -- At this point all elements should have been accounted for. Check for + -- extra elements. + + while Has_Next (Iter) loop + Next (Iter, Elem); + Put_Line + ("ERROR: " & Caller & ": Check_Present: extra element" & Elem'Img); + end loop; + + exception + when Iterator_Exhausted => + Put_Line + ("ERROR: " + & Caller + & "Check_Present: incorrect number of elements"); + end Check_Present; + + ------------------------------ + -- Check_Unlocked_Mutations -- + ------------------------------ + + procedure Check_Unlocked_Mutations (Caller : String; S : in out Instance) is + begin + Delete (S, 1); + Insert (S, 1); + end Check_Unlocked_Mutations; + + ---------- + -- Hash -- + ---------- + + function Hash (Key : Integer) return Bucket_Range_Type is + begin + return Bucket_Range_Type (Key); + end Hash; + + -------------- + -- Populate -- + -------------- + + procedure Populate + (S : Instance; + Low_Elem : Integer; + High_Elem : Integer) + is + begin + for Elem in Low_Elem .. High_Elem loop + Insert (S, Elem); + end loop; + end Populate; + + ------------------- + -- Test_Contains -- + ------------------- + + procedure Test_Contains + (Low_Elem : Integer; + High_Elem : Integer; + Init_Size : Positive) + is + Low_Bogus : constant Integer := Low_Elem - 1; + High_Bogus : constant Integer := High_Elem + 1; + + S : Instance := Create (Init_Size); + + begin + Populate (S, Low_Elem, High_Elem); + + -- Ensure that the elements are contained in the set + + for Elem in Low_Elem .. High_Elem loop + if not Contains (S, Elem) then + Put_Line + ("ERROR: Test_Contains: element" & Elem'Img & " not in set"); + end if; + end loop; + + -- Ensure that arbitrary elements which were not inserted in the set are + -- not contained in the set. + + if Contains (S, Low_Bogus) then + Put_Line + ("ERROR: Test_Contains: element" & Low_Bogus'Img & " in set"); + end if; + + if Contains (S, High_Bogus) then + Put_Line + ("ERROR: Test_Contains: element" & High_Bogus'Img & " in set"); + end if; + + Destroy (S); + end Test_Contains; + + ----------------- + -- Test_Create -- + ----------------- + + procedure Test_Create is + Count : Natural; + Flag : Boolean; + Iter : Iterator; + S : Instance; + + begin + -- Ensure that every routine defined in the API fails on a set which + -- has not been created yet. + + begin + Flag := Contains (S, 1); + Put_Line ("ERROR: Test_Create: Contains: no exception raised"); + exception + when Not_Created => + null; + when others => + Put_Line ("ERROR: Test_Create: Contains: unexpected exception"); + end; + + begin + Delete (S, 1); + Put_Line ("ERROR: Test_Create: Delete: no exception raised"); + exception + when Not_Created => + null; + when others => + Put_Line ("ERROR: Test_Create: Delete: unexpected exception"); + end; + + begin + Insert (S, 1); + Put_Line ("ERROR: Test_Create: Insert: no exception raised"); + exception + when Not_Created => + null; + when others => + Put_Line ("ERROR: Test_Create: Insert: unexpected exception"); + end; + + begin + Flag := Is_Empty (S); + Put_Line ("ERROR: Test_Create: Is_Empty: no exception raised"); + exception + when Not_Created => + null; + when others => + Put_Line ("ERROR: Test_Create: Is_Empty: unexpected exception"); + end; + + begin + Iter := Iterate (S); + Put_Line ("ERROR: Test_Create: Iterate: no exception raised"); + exception + when Not_Created => + null; + when others => + Put_Line ("ERROR: Test_Create: Iterate: unexpected exception"); + end; + + begin + Count := Size (S); + Put_Line ("ERROR: Test_Create: Size: no exception raised"); + exception + when Not_Created => + null; + when others => + Put_Line ("ERROR: Test_Create: Size: unexpected exception"); + end; + end Test_Create; + + ----------------- + -- Test_Delete -- + ----------------- + + procedure Test_Delete + (Low_Elem : Integer; + High_Elem : Integer; + Init_Size : Positive) + is + Iter : Iterator; + S : Instance := Create (Init_Size); + + begin + Populate (S, Low_Elem, High_Elem); + + -- Delete all even elements + + for Elem in Low_Elem .. High_Elem loop + if Elem mod 2 = 0 then + Delete (S, Elem); + end if; + end loop; + + -- Ensure that all remaining odd elements are present in the set + + for Elem in Low_Elem .. High_Elem loop + if Elem mod 2 /= 0 and then not Contains (S, Elem) then + Put_Line ("ERROR: Test_Delete: missing element" & Elem'Img); + end if; + end loop; + + -- Delete all odd elements + + for Elem in Low_Elem .. High_Elem loop + if Elem mod 2 /= 0 then + Delete (S, Elem); + end if; + end loop; + + -- At this point the set should be completely empty + + Check_Empty + (Caller => "Test_Delete", + S => S, + Low_Elem => Low_Elem, + High_Elem => High_Elem); + + Destroy (S); + end Test_Delete; + + ------------------- + -- Test_Is_Empty -- + ------------------- + + procedure Test_Is_Empty is + S : Instance := Create (8); + + begin + if not Is_Empty (S) then + Put_Line ("ERROR: Test_Is_Empty: set is not empty"); + end if; + + Insert (S, 1); + + if Is_Empty (S) then + Put_Line ("ERROR: Test_Is_Empty: set is empty"); + end if; + + Delete (S, 1); + + if not Is_Empty (S) then + Put_Line ("ERROR: Test_Is_Empty: set is not empty"); + end if; + + Destroy (S); + end Test_Is_Empty; + + ------------------ + -- Test_Iterate -- + ------------------ + + procedure Test_Iterate is + Elem : Integer; + Iter_1 : Iterator; + Iter_2 : Iterator; + S : Instance := Create (5); + + begin + Populate (S, 1, 5); + + -- Obtain an iterator. This action must lock all mutation operations of + -- the set. + + Iter_1 := Iterate (S); + + -- Ensure that every mutation routine defined in the API fails on a set + -- with at least one outstanding iterator. + + Check_Locked_Mutations + (Caller => "Test_Iterate", + S => S); + + -- Obtain another iterator + + Iter_2 := Iterate (S); + + -- Ensure that every mutation is still locked + + Check_Locked_Mutations + (Caller => "Test_Iterate", + S => S); + + -- Exhaust the first itertor + + while Has_Next (Iter_1) loop + Next (Iter_1, Elem); + end loop; + + -- Ensure that every mutation is still locked + + Check_Locked_Mutations + (Caller => "Test_Iterate", + S => S); + + -- Exhaust the second itertor + + while Has_Next (Iter_2) loop + Next (Iter_2, Elem); + end loop; + + -- Ensure that all mutation operations are once again callable + + Check_Unlocked_Mutations + (Caller => "Test_Iterate", + S => S); + + Destroy (S); + end Test_Iterate; + + ------------------------ + -- Test_Iterate_Empty -- + ------------------------ + + procedure Test_Iterate_Empty is + Elem : Integer; + Iter : Iterator; + S : Instance := Create (5); + + begin + -- Obtain an iterator. This action must lock all mutation operations of + -- the set. + + Iter := Iterate (S); + + -- Ensure that every mutation routine defined in the API fails on a set + -- with at least one outstanding iterator. + + Check_Locked_Mutations + (Caller => "Test_Iterate_Empty", + S => S); + + -- Attempt to iterate over the elements + + while Has_Next (Iter) loop + Next (Iter, Elem); + + Put_Line + ("ERROR: Test_Iterate_Empty: element" & Elem'Img & " exists"); + end loop; + + -- Ensure that all mutation operations are once again callable + + Check_Unlocked_Mutations + (Caller => "Test_Iterate_Empty", + S => S); + + Destroy (S); + end Test_Iterate_Empty; + + ------------------------- + -- Test_Iterate_Forced -- + ------------------------- + + procedure Test_Iterate_Forced + (Low_Elem : Integer; + High_Elem : Integer; + Init_Size : Positive) + is + Elem : Integer; + Iter : Iterator; + S : Instance := Create (Init_Size); + + begin + Populate (S, Low_Elem, High_Elem); + + -- Obtain an iterator. This action must lock all mutation operations of + -- the set. + + Iter := Iterate (S); + + -- Ensure that every mutation routine defined in the API fails on a set + -- with at least one outstanding iterator. + + Check_Locked_Mutations + (Caller => "Test_Iterate_Forced", + S => S); + + -- Forcibly advance the iterator until it raises an exception + + begin + for Guard in Low_Elem .. High_Elem + 1 loop + Next (Iter, Elem); + end loop; + + Put_Line + ("ERROR: Test_Iterate_Forced: Iterator_Exhausted not raised"); + exception + when Iterator_Exhausted => + null; + when others => + Put_Line ("ERROR: Test_Iterate_Forced: unexpected exception"); + end; + + -- Ensure that all mutation operations are once again callable + + Check_Unlocked_Mutations + (Caller => "Test_Iterate_Forced", + S => S); + + Destroy (S); + end Test_Iterate_Forced; + + --------------- + -- Test_Size -- + --------------- + + procedure Test_Size is + S : Instance := Create (6); + Siz : Natural; + + begin + Siz := Size (S); + + if Siz /= 0 then + Put_Line ("ERROR: Test_Size: wrong size"); + Put_Line ("expected: 0"); + Put_Line ("got :" & Siz'Img); + end if; + + Populate (S, 1, 2); + Siz := Size (S); + + if Siz /= 2 then + Put_Line ("ERROR: Test_Size: wrong size"); + Put_Line ("expected: 2"); + Put_Line ("got :" & Siz'Img); + end if; + + Populate (S, 3, 6); + Siz := Size (S); + + if Siz /= 6 then + Put_Line ("ERROR: Test_Size: wrong size"); + Put_Line ("expected: 6"); + Put_Line ("got :" & Siz'Img); + end if; + + Destroy (S); + end Test_Size; + +-- Start of processing for Operations + +begin + Test_Contains + (Low_Elem => 1, + High_Elem => 5, + Init_Size => 5); + + Test_Create; + + Test_Delete + (Low_Elem => 1, + High_Elem => 10, + Init_Size => 10); + + Test_Is_Empty; + Test_Iterate; + Test_Iterate_Empty; + + Test_Iterate_Forced + (Low_Elem => 1, + High_Elem => 5, + Init_Size => 5); + + Test_Size; +end Sets1; -- cgit v1.1 From dd81163fe8ff6611261475f97c08f8ef688dd4d1 Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Wed, 26 Sep 2018 09:18:09 +0000 Subject: [Ada] Minor reformattings 2018-09-26 Hristian Kirtchev gcc/ada/ * contracts.adb, exp_unst.adb, exp_util.adb, gnat1drv.adb, opt.ads, par-prag.adb, sem_ch3.adb, sem_ch5.adb, sem_prag.adb, sinfo.ads, snames.ads-tmpl: Minor reformatting. From-SVN: r264621 --- gcc/ada/ChangeLog | 6 + gcc/ada/contracts.adb | 30 ++-- gcc/ada/exp_unst.adb | 30 ++-- gcc/ada/exp_util.adb | 8 +- gcc/ada/gnat1drv.adb | 2 +- gcc/ada/opt.ads | 15 +- gcc/ada/par-prag.adb | 12 +- gcc/ada/sem_ch3.adb | 8 +- gcc/ada/sem_ch5.adb | 3 +- gcc/ada/sem_prag.adb | 392 +++++++++++++++++++++++++++++++----------------- gcc/ada/sinfo.ads | 4 +- gcc/ada/snames.ads-tmpl | 10 +- 12 files changed, 318 insertions(+), 202 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 92009ff..ba3c363 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,11 @@ 2018-09-26 Hristian Kirtchev + * contracts.adb, exp_unst.adb, exp_util.adb, gnat1drv.adb, + opt.ads, par-prag.adb, sem_ch3.adb, sem_ch5.adb, sem_prag.adb, + sinfo.ads, snames.ads-tmpl: Minor reformatting. + +2018-09-26 Hristian Kirtchev + * gcc-interface/Make-lang.in: Add unit GNAT.Sets to the list of front end sources. * impunit.adb: Add unit GNAT.Sets to the list of predefined diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index 8b18c39..760c06b 100644 --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -2858,13 +2858,11 @@ package body Contracts is ------------------------------- procedure Process_Preconditions_For (Subp_Id : Entity_Id) is - Items : constant Node_Id := Contract (Subp_Id); - - Bod : constant Node_Id := Unit_Declaration_Node (Body_Id); + Items : constant Node_Id := Contract (Subp_Id); + Subp_Decl : constant Node_Id := Unit_Declaration_Node (Subp_Id); Decl : Node_Id; Freeze_T : Boolean; Prag : Node_Id; - Subp_Decl : Node_Id; begin -- Process the contract. If the body is an expression function @@ -2873,12 +2871,13 @@ package body Contracts is -- its completion by an expression function appear in distinct -- declarative lists of the same unit (visible and private). - Freeze_T := Was_Expression_Function (Bod) - and then Sloc (Body_Id) /= Sloc (Subp_Id) - and then In_Same_Source_Unit (Body_Id, Subp_Id) - and then List_Containing (Bod) /= - List_Containing (Unit_Declaration_Node (Subp_Id)) - and then not In_Instance; + Freeze_T := + Was_Expression_Function (Body_Decl) + and then Sloc (Body_Id) /= Sloc (Subp_Id) + and then In_Same_Source_Unit (Body_Id, Subp_Id) + and then List_Containing (Body_Decl) /= + List_Containing (Subp_Decl) + and then not In_Instance; if Present (Items) then Prag := Pre_Post_Conditions (Items); @@ -2887,10 +2886,13 @@ package body Contracts is and then Is_Checked (Prag) then if Freeze_T - and then Present (Corresponding_Aspect (Prag)) + and then Present (Corresponding_Aspect (Prag)) then - Freeze_Expr_Types (Subp_Id, Standard_Boolean, - Expression (Corresponding_Aspect (Prag)), Bod); + Freeze_Expr_Types + (Def_Id => Subp_Id, + Typ => Standard_Boolean, + Expr => Expression (Corresponding_Aspect (Prag)), + N => Body_Decl); end if; Prepend_To_Decls_Or_Save (Prag); @@ -2905,8 +2907,6 @@ package body Contracts is -- it must be taken into account. The pragma appears after the -- stub. - Subp_Decl := Unit_Declaration_Node (Subp_Id); - if Nkind (Subp_Decl) = N_Subprogram_Body_Stub then -- Inspect the declarations following the body stub diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index e31d84a..de4ea1a 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -260,8 +260,8 @@ package body Exp_Unst is E := Ultimate_Alias (E); -- The body of a protected operation has a different name and - -- has been scanned at this point, and thus has an entry in - -- the subprogram table. + -- has been scanned at this point, and thus has an entry in the + -- subprogram table. if E = Sub and then Convention (E) = Convention_Protected then E := Protected_Body_Subprogram (E); @@ -541,19 +541,17 @@ package body Exp_Unst is if Nkind (N) = N_Attribute_Reference then declare Attr : constant Attribute_Id := - Get_Attribute_Id (Attribute_Name (N)); + Get_Attribute_Id (Attribute_Name (N)); + DT : Boolean := False; + begin if (Attr = Attribute_First or else Attr = Attribute_Last or else Attr = Attribute_Length) and then Is_Constrained (Etype (Prefix (N))) then - declare - DT : Boolean := False; - begin - Check_Static_Type - (Etype (Prefix (N)), Empty, DT); - end; + Check_Static_Type + (Etype (Prefix (N)), Empty, DT); end if; end; end if; @@ -2022,21 +2020,23 @@ package body Exp_Unst is -- N_Loop_Parameter_Specification or to -- an N_Iterator_Specification. - if Nkind_In (Ins, N_Iterator_Specification, - N_Loop_Parameter_Specification) + if Nkind_In + (Ins, N_Iterator_Specification, + N_Loop_Parameter_Specification) then - -- Quantified expression are rewrittne - -- as loops during expansion. + -- Quantified expression are rewritten as + -- loops during expansion. if Nkind (Parent (Ins)) = - N_Quantified_Expression + N_Quantified_Expression then null; else Ins := First - (Statements (Parent (Parent (Ins)))); + (Statements + (Parent (Parent (Ins)))); Insert_Before (Ins, Asn); end if; diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 183797c..ec681af 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -9151,10 +9151,10 @@ package body Exp_Util is Aliased_Present => False, Subtype_Indication => New_Occurrence_Of (Constr_Root, Loc)))); - Set_Reverse_Storage_Order (Equiv_Type, - Reverse_Storage_Order (Base_Type (Root_Utyp))); - Set_Reverse_Bit_Order (Equiv_Type, - Reverse_Bit_Order (Base_Type (Root_Utyp))); + Set_Reverse_Storage_Order + (Equiv_Type, Reverse_Storage_Order (Base_Type (Root_Utyp))); + Set_Reverse_Bit_Order + (Equiv_Type, Reverse_Bit_Order (Base_Type (Root_Utyp))); end if; Append_To (Comp_List, diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb index a3d905b..eab2fda 100644 --- a/gcc/ada/gnat1drv.adb +++ b/gcc/ada/gnat1drv.adb @@ -161,7 +161,7 @@ procedure Gnat1drv is Modify_Tree_For_C := True; end if; - -- -gnatd_A disables generation of ALI files. + -- -gnatd_A disables generation of ALI files if Debug_Flag_Underscore_AA then Disable_ALI_File := True; diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index ca5dc61..2614303 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -1216,6 +1216,11 @@ package Opt is -- cannot be simultaneous compilations with the object files in the same -- object directory, if project files are used. + OpenAcc_Enabled : Boolean := False; + -- GNAT + -- Indicates whether OpenAcc pragmas should be taken into account. Set to + -- True by the use of -fopenacc. + type Operating_Mode_Type is (Check_Syntax, Check_Semantics, Generate_Code); pragma Ordered (Operating_Mode_Type); Operating_Mode : Operating_Mode_Type := Generate_Code; @@ -2335,21 +2340,11 @@ package Opt is -- The only special comment sequence allowed is --! - ------------- - -- OpenAcc -- - ------------- - - OpenAcc_Enabled : Boolean := False; - -- GNAT - -- Indicates whether OpenAcc pragmas should be taken into account. - -- Set True by use of -fopenacc. - -------------------------- -- Private Declarations -- -------------------------- private - -- The following type is used to save and restore settings of switches in -- Opt that represent the configuration (i.e. result of config pragmas). diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb index f51a838..a8b3997 100644 --- a/gcc/ada/par-prag.adb +++ b/gcc/ada/par-prag.adb @@ -1295,11 +1295,15 @@ begin -- All Other Pragmas -- ----------------------- - -- For all other pragmas, checking and processing is handled - -- entirely in Sem_Prag, and no further checking is done by Par. + -- For all other pragmas, checking and processing is handled entirely in + -- Sem_Prag, and no further checking is done by Par. when Pragma_Abort_Defer | Pragma_Abstract_State + | Pragma_Acc_Data + | Pragma_Acc_Kernels + | Pragma_Acc_Loop + | Pragma_Acc_Parallel | Pragma_Async_Readers | Pragma_Async_Writers | Pragma_Assertion_Policy @@ -1516,10 +1520,6 @@ begin | Pragma_Warning_As_Error | Pragma_Weak_External | Pragma_Validity_Checks - | Pragma_Acc_Data - | Pragma_Acc_Kernels - | Pragma_Acc_Loop - | Pragma_Acc_Parallel => null; diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index cf45ccc..32797d8 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -1919,8 +1919,8 @@ package body Sem_Ch3 is if Is_Limited_Record (Typ) then return True; - -- If the root type is limited (and not a limited interface) - -- so is the current type + -- If the root type is limited (and not a limited interface) so is + -- the current type. elsif Is_Limited_Record (R) and then (not Is_Interface (R) or else not Is_Limited_Interface (R)) @@ -1931,8 +1931,8 @@ package body Sem_Ch3 is -- limited record parent that is not an interface. elsif R /= P - and then Is_Limited_Record (P) - and then not Is_Interface (P) + and then Is_Limited_Record (P) + and then not Is_Interface (P) then return True; diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 6f002f4..95b5660 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -2210,8 +2210,7 @@ package body Sem_Ch5 is if Nkind (Iter_Name) = N_Function_Call and then Is_Entity_Name (Name (Iter_Name)) and then Full_Analysis - and then (In_Assertion_Expr = 0 - or else Assertions_Enabled) + and then (In_Assertion_Expr = 0 or else Assertions_Enabled) then Freeze_Before (N, Entity (Name (Iter_Name))); end if; diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index c409b85..bc91411 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -3686,10 +3686,10 @@ package body Sem_Prag is ----------------------- function Acc_First (N : Node_Id) return Node_Id; - -- Helper function to iterate over arguments given to OpenAcc pragmas. + -- Helper function to iterate over arguments given to OpenAcc pragmas function Acc_Next (N : Node_Id) return Node_Id; - -- Helper function to iterate over arguments given to OpenAcc pragmas. + -- Helper function to iterate over arguments given to OpenAcc pragmas procedure Acquire_Warning_Match_String (Arg : Node_Id); -- Used by pragma Warnings (Off, string), and Warn_As_Error (string) to @@ -4241,14 +4241,14 @@ package body Sem_Prag is -- profile. procedure Validate_Acc_Condition_Clause (Clause : Node_Id); - -- Make sure the argument of a given Acc_If clause is a boolean. + -- Make sure the argument of a given Acc_If clause is a Boolean procedure Validate_Acc_Data_Clause (Clause : Node_Id); -- Make sure the argument of an OpenAcc data clause (e.g. Copy, Copyin, -- Copyout...) is an identifier or an aggregate of identifiers. procedure Validate_Acc_Int_Expr_Clause (Clause : Node_Id); - -- Make sure the argument of an OpenAcc clause is an Integer expression. + -- Make sure the argument of an OpenAcc clause is an Integer expression procedure Validate_Acc_Int_Expr_List_Clause (Clause : Node_Id); -- Make sure the argument of an OpenAcc clause is an Integer expression @@ -4266,8 +4266,8 @@ package body Sem_Prag is procedure Validate_Acc_Loop_Vector (Clause : Node_Id); -- When this procedure is called in a construct offloaded by an -- Acc_Kernels pragma, makes sure that a Vector_Length clause does - -- not exist on said pragma. - -- In all cases, make sure the argument is an integer expression. + -- not exist on said pragma. In all cases, make sure the argument + -- is an Integer expression. procedure Validate_Acc_Loop_Worker (Clause : Node_Id); -- When this procedure is called in a construct offloaded by an @@ -4297,10 +4297,12 @@ package body Sem_Prag is if Nkind (N) = N_Aggregate then if Present (Expressions (N)) then return First (Expressions (N)); + elsif Present (Component_Associations (N)) then return Expression (First (Component_Associations (N))); end if; end if; + return N; end Acc_First; @@ -4312,8 +4314,10 @@ package body Sem_Prag is begin if Nkind (Parent (N)) = N_Component_Association then return Expression (Next (Parent (N))); + elsif Nkind (Parent (N)) = N_Aggregate then return Next (N); + else return Empty; end if; @@ -11174,8 +11178,9 @@ package body Sem_Prag is procedure Validate_Acc_Condition_Clause (Clause : Node_Id) is begin Analyze_And_Resolve (Clause); + if not Is_Boolean_Type (Etype (Clause)) then - Error_Pragma ("Expected a boolean"); + Error_Pragma ("expected a boolean"); end if; end Validate_Acc_Condition_Clause; @@ -11185,13 +11190,16 @@ package body Sem_Prag is procedure Validate_Acc_Data_Clause (Clause : Node_Id) is Expr : Node_Id; + begin Expr := Acc_First (Clause); while Present (Expr) loop if Nkind (Expr) /= N_Identifier then - Error_Pragma ("Expected an Identifer"); + Error_Pragma ("expected an identifer"); end if; + Analyze_And_Resolve (Expr); + Expr := Acc_Next (Expr); end loop; end Validate_Acc_Data_Clause; @@ -11203,8 +11211,9 @@ package body Sem_Prag is procedure Validate_Acc_Int_Expr_Clause (Clause : Node_Id) is begin Analyze_And_Resolve (Clause); + if not Is_Integer_Type (Etype (Clause)) then - Error_Pragma_Arg ("Expected an integer", Clause); + Error_Pragma_Arg ("expected an integer", Clause); end if; end Validate_Acc_Int_Expr_Clause; @@ -11214,13 +11223,16 @@ package body Sem_Prag is procedure Validate_Acc_Int_Expr_List_Clause (Clause : Node_Id) is Expr : Node_Id; + begin Expr := Acc_First (Clause); while Present (Expr) loop Analyze_And_Resolve (Expr); + if not Is_Integer_Type (Etype (Expr)) then - Error_Pragma ("Expected an Integer"); + Error_Pragma ("expected an integer"); end if; + Expr := Acc_Next (Expr); end loop; end Validate_Acc_Int_Expr_List_Clause; @@ -11230,41 +11242,45 @@ package body Sem_Prag is -------------------------------- procedure Validate_Acc_Loop_Collapse (Clause : Node_Id) is - Count : Uint; - Parent_Loop : Node_Id; - Current_Statement : Node_Id; + Count : Uint; + Par_Loop : Node_Id; + Stmt : Node_Id; + begin - -- Make sure the argument is a positive integer. + -- Make sure the argument is a positive integer + Analyze_And_Resolve (Clause); + Count := Static_Integer (Clause); if Count = No_Uint or else Count < 1 then - Error_Pragma_Arg ("Expected a positive integer", Clause); + Error_Pragma_Arg ("expected a positive integer", Clause); end if; -- Then, make sure we have at least Count-1 tightly-nested loops -- (i.e. loops with no statements in between). - Parent_Loop := Parent (Parent (Parent (Clause))); - Current_Statement := First (Statements (Parent_Loop)); + Par_Loop := Parent (Parent (Parent (Clause))); + Stmt := First (Statements (Par_Loop)); + -- Skip first pragmas in the parent loop - while Present (Current_Statement) - and then Nkind (Current_Statement) = N_Pragma loop - Current_Statement := Next (Current_Statement); + + while Present (Stmt) and then Nkind (Stmt) = N_Pragma loop + Next (Stmt); end loop; - if not Present (Next (Current_Statement)) then - While_Loop : - while Nkind (Current_Statement) = N_Loop_Statement - and Count > 1 loop - Current_Statement := First (Statements (Current_Statement)); - exit While_Loop when Present (Next (Current_Statement)); + if not Present (Next (Stmt)) then + while Nkind (Stmt) = N_Loop_Statement and Count > 1 loop + Stmt := First (Statements (Stmt)); + exit when Present (Next (Stmt)); + Count := Count - 1; - end loop While_Loop; + end loop; end if; if Count > 1 then - Error_Pragma_Arg ("Collapse argument too high or loops not " & - "tightly nested.", Clause); + Error_Pragma_Arg + ("Collapse argument too high or loops not tightly nested", + Clause); end if; end Validate_Acc_Loop_Collapse; @@ -11300,83 +11316,119 @@ package body Sem_Prag is --------------------------------- procedure Validate_Acc_Name_Reduction (Clause : Node_Id) is + -- ??? On top of the following operations, the OpenAcc spec adds the -- "bitwise and", "bitwise or" and modulo for C and ".eqv" and -- ".neqv" for Fortran. Can we, should we and how do we support them -- in Ada? - type Reduction_Op is (Add_Op, Mul_Op, Max_Op, - Min_Op, And_Op, Or_Op); + + type Reduction_Op is (Add_Op, Mul_Op, Max_Op, Min_Op, And_Op, Or_Op); + function To_Reduction_Op (Op : String) return Reduction_Op; + -- Convert operator Op described by a String into its corresponding + -- enumeration value. + + --------------------- + -- To_Reduction_Op -- + --------------------- + function To_Reduction_Op (Op : String) return Reduction_Op is begin if Op = "+" then return Add_Op; + elsif Op = "*" then return Mul_Op; + elsif Op = "max" then return Max_Op; + elsif Op = "min" then return Min_Op; + elsif Op = "and" then return And_Op; + elsif Op = "or" then return Or_Op; + else - Error_Pragma ("Unsuported reduction operation"); + Error_Pragma ("unsuported reduction operation"); end if; end To_Reduction_Op; - Expr : Node_Id; - Reduc_Op : Node_Id; + + -- Local variables + + Seen : constant Elist_Id := New_Elmt_List; + + Expr : Node_Id; + Reduc_Op : Node_Id; Reduc_Var : Node_Id; - Seen_Entities : Elist_Id; + + -- Start of processing for Validate_Acc_Name_Reduction + begin - -- Reduction operations look like this: - -- ("+" => (a, b), "*" => c) - Seen_Entities := New_Elmt_List; + -- Reduction operations appear in the following form: + -- ("+" => (a, b), "*" => c) + Expr := First (Component_Associations (Clause)); while Present (Expr) loop Reduc_Op := First (Choices (Expr)); String_To_Name_Buffer (Strval (Reduc_Op)); - case To_Reduction_Op (Name_Buffer (1 .. Name_Len)) is - when Add_Op | Mul_Op | Max_Op | Min_Op => + case To_Reduction_Op (Name_Buffer (1 .. Name_Len)) is + when Add_Op + | Mul_Op + | Max_Op + | Min_Op + => Reduc_Var := Acc_First (Expression (Expr)); while Present (Reduc_Var) loop Analyze_And_Resolve (Reduc_Var); - if Contains (Seen_Entities, Entity (Reduc_Var)) then - Error_Pragma ("Variable used in multiple reductions"); + + if Contains (Seen, Entity (Reduc_Var)) then + Error_Pragma ("variable used in multiple reductions"); + else - if (Nkind (Reduc_Var) /= N_Identifier) - or not Is_Numeric_Type (Etype (Reduc_Var)) + if Nkind (Reduc_Var) /= N_Identifier + or not Is_Numeric_Type (Etype (Reduc_Var)) then Error_Pragma - ("Expected an identifier for a Numeric"); + ("expected an identifier for a Numeric"); end if; - Append_Elmt (Entity (Reduc_Var), Seen_Entities); + + Append_Elmt (Entity (Reduc_Var), Seen); end if; + Reduc_Var := Acc_Next (Reduc_Var); end loop; - when And_Op | Or_Op => + when And_Op + | Or_Op + => Reduc_Var := Acc_First (Expression (Expr)); while Present (Reduc_Var) loop Analyze_And_Resolve (Reduc_Var); - if Contains (Seen_Entities, Entity (Reduc_Var)) then - Error_Pragma ("Variable used in multiple " & - "reductions"); + + if Contains (Seen, Entity (Reduc_Var)) then + Error_Pragma ("variable used in multiple reductions"); + else - if Nkind (Reduc_Var) /= N_Identifier or not - Is_Boolean_Type (Etype (Reduc_Var)) + if Nkind (Reduc_Var) /= N_Identifier + or not Is_Boolean_Type (Etype (Reduc_Var)) then - Error_Pragma ("Expected a variable of type " & - "Boolean"); + Error_Pragma + ("expected a variable of type boolean"); end if; - Append_Elmt (Entity (Reduc_Var), Seen_Entities); + + Append_Elmt (Entity (Reduc_Var), Seen); end if; + Reduc_Var := Acc_Next (Reduc_Var); end loop; end case; - Expr := Next (Expr); + + Next (Expr); end loop; end Validate_Acc_Name_Reduction; @@ -11385,26 +11437,38 @@ package body Sem_Prag is ----------------------------------- procedure Validate_Acc_Size_Expressions (Clause : Node_Id) is - - -- A size expr is either an integer expression or "*" function Validate_Size_Expr (Expr : Node_Id) return Boolean; + -- A size expr is either an integer expression or "*" + + ------------------------ + -- Validate_Size_Expr -- + ------------------------ + function Validate_Size_Expr (Expr : Node_Id) return Boolean is begin if Nkind (Expr) = N_Operator_Symbol then return Get_String_Char (Strval (Expr), 1) = Get_Char_Code ('*'); end if; + Analyze_And_Resolve (Expr); + return Is_Integer_Type (Etype (Expr)); end Validate_Size_Expr; + -- Local variables + Expr : Node_Id; + + -- Start of processing for Validate_Acc_Size_Expressions + begin Expr := Acc_First (Clause); while Present (Expr) loop if not Validate_Size_Expr (Expr) then - Error_Pragma ("Size expressions should be either integers " & - "or '*'"); + Error_Pragma + ("Size expressions should be either integers or '*'"); end if; + Expr := Acc_Next (Expr); end loop; end Validate_Acc_Size_Expressions; @@ -12357,8 +12421,8 @@ package body Sem_Prag is -------------- when Pragma_Acc_Data => Acc_Data : declare - Clause_Names : constant Name_List := ( - Name_Attach, + Clause_Names : constant Name_List := + (Name_Attach, Name_Copy, Name_Copy_In, Name_Copy_Out, @@ -12367,24 +12431,29 @@ package body Sem_Prag is Name_Detach, Name_Device_Ptr, Name_No_Create, - Name_Present - ); + Name_Present); + + Clause : Node_Id; Clauses : Args_List (Clause_Names'Range); - Clause : Node_Id; begin if not OpenAcc_Enabled then return; end if; + GNAT_Pragma; - if Nkind (Parent (N)) /= N_Loop_Statement - then - Error_Pragma ("Acc_Data pragma should be placed in loop or " - & "block statements."); + + if Nkind (Parent (N)) /= N_Loop_Statement then + Error_Pragma + ("Acc_Data pragma should be placed in loop or block " + & "statements"); end if; + Gather_Associations (Clause_Names, Clauses); + for Id in Clause_Names'First .. Clause_Names'Last loop Clause := Clauses (Id); + if Present (Clause) then case Clause_Names (Id) is when Name_Copy @@ -12392,20 +12461,24 @@ package body Sem_Prag is | Name_Copy_Out | Name_Create | Name_Device_Ptr - | Name_Present => + | Name_Present + => Validate_Acc_Data_Clause (Clause); + when Name_Attach | Name_Detach | Name_Delete - | Name_No_Create => - Error_Pragma ("Unsupported pragma clause."); - when others => raise Program_Error; + | Name_No_Create + => + Error_Pragma ("unsupported pragma clause"); + + when others => + raise Program_Error; end case; end if; end loop; Set_Is_OpenAcc_Environment (Parent (N)); - end Acc_Data; -------------- @@ -12413,9 +12486,8 @@ package body Sem_Prag is -------------- when Pragma_Acc_Loop => Acc_Loop : declare - - Clause_Names : constant Name_List := ( - Name_Auto, + Clause_Names : constant Name_List := + (Name_Auto, Name_Collapse, Name_Gang, Name_Independent, @@ -12424,51 +12496,77 @@ package body Sem_Prag is Name_Seq, Name_Tile, Name_Vector, - Name_Worker - ); + Name_Worker); + + Clause : Node_Id; Clauses : Args_List (Clause_Names'Range); - Clause : Node_Id; - Parent_Node : Node_Id; + Par : Node_Id; begin if not OpenAcc_Enabled then return; end if; + GNAT_Pragma; -- Make sure the pragma is in an openacc construct + Check_Loop_Pragma_Placement; - Parent_Node := Parent (N); - while Present (Parent_Node) and then - (Nkind (Parent_Node) /= N_Loop_Statement or else - not Is_OpenAcc_Environment (Parent_Node)) loop - Parent_Node := Parent (Parent_Node); + + Par := Parent (N); + while Present (Par) + and then (Nkind (Par) /= N_Loop_Statement + or else not Is_OpenAcc_Environment (Par)) + loop + Par := Parent (Par); end loop; - if not Is_OpenAcc_Environment (Parent_Node) then - Error_Pragma ("Acc_Loop directive must be associated with an " & - "OpenAcc construct region"); + + if not Is_OpenAcc_Environment (Par) then + Error_Pragma + ("Acc_Loop directive must be associated with an OpenAcc " + & "construct region"); end if; Gather_Associations (Clause_Names, Clauses); + for Id in Clause_Names'First .. Clause_Names'Last loop Clause := Clauses (Id); + if Present (Clause) then case Clause_Names (Id) is - when Name_Auto | Name_Independent | Name_Seq => null; + when Name_Auto + | Name_Independent + | Name_Seq + => + null; + when Name_Collapse => Validate_Acc_Loop_Collapse (Clause); - when Name_Gang => Validate_Acc_Loop_Gang (Clause); + + when Name_Gang => + Validate_Acc_Loop_Gang (Clause); + when Name_Acc_Private => Validate_Acc_Data_Clause (Clause); + when Name_Reduction => Validate_Acc_Name_Reduction (Clause); - when Name_Tile => Validate_Acc_Size_Expressions (Clause); - when Name_Vector => Validate_Acc_Loop_Vector (Clause); - when Name_Worker => Validate_Acc_Loop_Worker (Clause); - when others => raise Program_Error; + + when Name_Tile => + Validate_Acc_Size_Expressions (Clause); + + when Name_Vector => + Validate_Acc_Loop_Vector (Clause); + + when Name_Worker => + Validate_Acc_Loop_Worker (Clause); + + when others => + raise Program_Error; end case; end if; end loop; + Set_Is_OpenAcc_Loop (Parent (N)); end Acc_Loop; @@ -12476,12 +12574,12 @@ package body Sem_Prag is -- Acc_Parallel and Acc_Kernels -- ---------------------------------- - when Pragma_Acc_Parallel | Pragma_Acc_Kernels => - Acc_Kernels_Or_Parallel : - declare - - Clause_Names : constant Name_List := ( - Name_Acc_If, + when Pragma_Acc_Parallel + | Pragma_Acc_Kernels + => + Acc_Kernels_Or_Parallel : declare + Clause_Names : constant Name_List := + (Name_Acc_If, Name_Async, Name_Copy, Name_Copy_In, @@ -12495,68 +12593,81 @@ package body Sem_Prag is Name_Present, Name_Vector_Length, Name_Wait, + -- Parallel only + Name_Acc_Private, Name_First_Private, Name_Reduction, + -- Kernels only + Name_Attach, - Name_No_Create - ); + Name_No_Create); + + Clause : Node_Id; Clauses : Args_List (Clause_Names'Range); - Clause : Node_Id; begin if not OpenAcc_Enabled then return; end if; + GNAT_Pragma; Check_Loop_Pragma_Placement; if Nkind (Parent (N)) /= N_Loop_Statement then - Error_Pragma ("Pragma should be placed in loop or block " - & "statements."); + Error_Pragma + ("pragma should be placed in loop or block statements"); end if; Gather_Associations (Clause_Names, Clauses); + for Id in Clause_Names'First .. Clause_Names'Last loop Clause := Clauses (Id); + if Present (Clause) then if Chars (Parent (Clause)) = No_Name then - Error_Pragma ("All arguments should be associations"); + Error_Pragma ("all arguments should be associations"); else case Clause_Names (Id) is - -- Note: According to the OpenAcc Standard v2.6, - -- Async's argument should be optional. Because - -- this complicates parsing the clause, the - -- argument is made mandatory. The standard defines - -- two negative values, acc_async_noval and - -- acc_async_sync. When given acc_async_noval as - -- value, the clause should behave as if no - -- argument was given. According to the standard, - -- acc_async_noval is defined in header files for C - -- and Fortran, thus this value should probably be - -- defined in the OpenAcc Ada library once it is - -- implemented. + + -- Note: According to the OpenAcc Standard v2.6, + -- Async's argument should be optional. Because this + -- complicates parsing the clause, the argument is + -- made mandatory. The standard defines two negative + -- values, acc_async_noval and acc_async_sync. When + -- given acc_async_noval as value, the clause should + -- behave as if no argument was given. According to + -- the standard, acc_async_noval is defined in header + -- files for C and Fortran, thus this value should + -- probably be defined in the OpenAcc Ada library once + -- it is implemented. + when Name_Async | Name_Num_Gangs | Name_Num_Workers - | Name_Vector_Length => + | Name_Vector_Length + => Validate_Acc_Int_Expr_Clause (Clause); when Name_Acc_If => Validate_Acc_Condition_Clause (Clause); - -- Unsupported by GCC + -- Unsupported by GCC + when Name_Attach - | Name_No_Create => - Error_Pragma ("Unsupported clause."); + | Name_No_Create + => + Error_Pragma ("unsupported clause"); - when Name_First_Private - | Name_Acc_Private => + when Name_Acc_Private + | Name_First_Private + => if Prag_Id /= Pragma_Acc_Parallel then - Error_Pragma ("Argument is only available for" & - " 'Parallel' construct."); + Error_Pragma + ("argument is only available for 'Parallel' " + & "construct"); else Validate_Acc_Data_Clause (Clause); end if; @@ -12564,42 +12675,45 @@ package body Sem_Prag is when Name_Copy | Name_Copy_In | Name_Copy_Out - | Name_Present | Name_Create - | Name_Device_Ptr => + | Name_Device_Ptr + | Name_Present + => Validate_Acc_Data_Clause (Clause); when Name_Reduction => if Prag_Id /= Pragma_Acc_Parallel then - Error_Pragma ("Argument is only available for" & - " 'Parallel' construct."); + Error_Pragma + ("argument is only available for 'Parallel' " + & "construct"); else Validate_Acc_Name_Reduction (Clause); end if; when Name_Default => if Chars (Clause) /= Name_None then - Error_Pragma ("Expected None"); + Error_Pragma ("expected none"); end if; when Name_Device_Type => - Error_Pragma ("Unsupported pragma clause"); + Error_Pragma ("unsupported pragma clause"); + + -- Similar to Name_Async, Name_Wait's arguments should + -- be optional. However, this can be simulated using + -- acc_async_noval, hence, we do not bother making the + -- argument optional for now. - -- Same as for Name_Async, Name_Wait's arguments - -- should be optional. However, this can be - -- simulated using acc_async_noval, hence, we do - -- not bother making the argument optional for now. when Name_Wait => Validate_Acc_Int_Expr_List_Clause (Clause); - when others => raise Program_Error; + when others => + raise Program_Error; end case; end if; end if; end loop; Set_Is_OpenAcc_Environment (Parent (N)); - end Acc_Kernels_Or_Parallel; ------------ diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index bed8b32..fcf99a8 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -5134,11 +5134,11 @@ package Sinfo is -- Iteration_Scheme (Node2) (set to Empty if no iteration scheme) -- Statements (List3) -- End_Label (Node4) + -- Is_OpenAcc_Environment (Flag13-Sem) + -- Is_OpenAcc_Loop (Flag14-Sem) -- Has_Created_Identifier (Flag15) -- Is_Null_Loop (Flag16) -- Suppress_Loop_Warnings (Flag17) - -- Is_OpenAcc_Environment (Flag13-Sem) - -- Is_OpenAcc_Loop (Flag14-Sem) -- Note: the parser fills in the Identifier field if there is an -- explicit loop identifier. Otherwise the parser leaves this field diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index 0b9e531..21cc0f4 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -864,8 +864,8 @@ package Snames is Name_Warn : constant Name_Id := N + $; Name_Working_Storage : constant Name_Id := N + $; - -- OpenAcc-specific clause names - -- Parallel, Kernels, Data + -- OpenAcc-specific clause names for Parallel, Kernels, Data + Name_Acc_If : constant Name_Id := N + $; Name_Acc_Private : constant Name_Id := N + $; Name_Attach : constant Name_Id := N + $; @@ -884,13 +884,15 @@ package Snames is Name_Reduction : constant Name_Id := N + $; Name_Vector_Length : constant Name_Id := N + $; Name_Wait : constant Name_Id := N + $; + -- Loop + + Name_Auto : constant Name_Id := N + $; Name_Collapse : constant Name_Id := N + $; Name_Gang : constant Name_Id := N + $; - Name_Worker : constant Name_Id := N + $; Name_Seq : constant Name_Id := N + $; - Name_Auto : constant Name_Id := N + $; Name_Tile : constant Name_Id := N + $; + Name_Worker : constant Name_Id := N + $; -- Names of recognized attributes. The entries with the comment "Ada 83" -- are attributes that are defined in Ada 83, but not in Ada 95. These -- cgit v1.1 From 3e4ade66c6749652de644017de696f9c1e60f3ae Mon Sep 17 00:00:00 2001 From: Sergey Rybin Date: Wed, 26 Sep 2018 09:18:16 +0000 Subject: [Ada] Add notes about processing of aggregate projects 2018-09-26 Sergey Rybin gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Add note about processing of aggregate projects in gnatmetric and gnatstub. From-SVN: r264622 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ba3c363..a93f5df 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-09-26 Sergey Rybin + + * doc/gnat_ugn/gnat_utility_programs.rst: Add note about + processing of aggregate projects in gnatmetric and gnatstub. + 2018-09-26 Hristian Kirtchev * contracts.adb, exp_unst.adb, exp_util.adb, gnat1drv.adb, diff --git a/gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst b/gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst index 7f1184b..b6f50b3 100644 --- a/gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst +++ b/gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst @@ -2710,7 +2710,8 @@ Alternatively, you may run the script using the following command line: :switch:`-P {file}` Indicates the name of the project file that describes the set of sources to be processed. The exact set of argument sources depends on other options - specified, see below. + specified, see below. An aggregate project is allowed as the file parameter + only if it has exactly one non-aggregate project being aggregated. .. index:: -U (gnatmetric) @@ -4151,7 +4152,8 @@ Alternatively, you may run the script using the following command line: :switch:`-P {file}` Indicates the name of the project file that describes the set of sources - to be processed. + to be processed. An aggregate project is allowed as the file parameter only + if it has exactly one non-aggregate project being aggregated. .. index:: -X (gnatstub) -- cgit v1.1 From 4f95defaa9c9e60f3e07f629bde8189fb6af19cf Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Wed, 26 Sep 2018 09:18:23 +0000 Subject: [Ada] Pair miscount in Dynamic_HTable.Put This patch corrects the logic of GNAT.Dynamic_HTables.Dynamic_HTable.Put to update the number of key-value pairs in the hash table only when the put is adding a new pair, rather than updating the value of an existing pair. 2018-09-26 Hristian Kirtchev gcc/ada/ * libgnat/g-dynhta.adb (Prepend_Or_Replace): Update the number of key-value pairs in the hash table only when adding a brand new pair. gcc/testsuite/ * gnat.dg/dynhash1.adb: New testcase. From-SVN: r264623 --- gcc/ada/ChangeLog | 6 +++++ gcc/ada/libgnat/g-dynhta.adb | 10 +++++-- gcc/testsuite/ChangeLog | 4 +++ gcc/testsuite/gnat.dg/dynhash1.adb | 53 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gnat.dg/dynhash1.adb (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a93f5df..b9187b6 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Hristian Kirtchev + + * libgnat/g-dynhta.adb (Prepend_Or_Replace): Update the number + of key-value pairs in the hash table only when adding a brand + new pair. + 2018-09-26 Sergey Rybin * doc/gnat_ugn/gnat_utility_programs.rst: Add note about diff --git a/gcc/ada/libgnat/g-dynhta.adb b/gcc/ada/libgnat/g-dynhta.adb index 004c276..e442514 100644 --- a/gcc/ada/libgnat/g-dynhta.adb +++ b/gcc/ada/libgnat/g-dynhta.adb @@ -544,6 +544,9 @@ package body GNAT.Dynamic_HTables is Detach (Nod); Free (Nod); + -- The number of key-value pairs is updated when the hash table + -- contains a valid node which represents the pair. + T.Pairs := T.Pairs - 1; -- Compress the hash table if the load factor drops below @@ -1121,6 +1124,11 @@ package body GNAT.Dynamic_HTables is Nod := new Node'(Key, Value, null, null); Prepend (Nod, Head); + + -- The number of key-value pairs must be updated for a prepend, + -- never for a replace. + + T.Pairs := T.Pairs + 1; end Prepend_Or_Replace; -- Local variables @@ -1148,8 +1156,6 @@ package body GNAT.Dynamic_HTables is Prepend_Or_Replace (Head); - T.Pairs := T.Pairs + 1; - -- Expand the hash table if the ratio of pairs to buckets goes over -- Expansion_Threshold. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 459563f..6cb08cd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2018-09-26 Hristian Kirtchev + * gnat.dg/dynhash1.adb: New testcase. + +2018-09-26 Hristian Kirtchev + * gnat.dg/sets1.adb: New testcase. * gnat.dg/dynhash.adb, gnat.dg/linkedlist.adb: Update testcases to new API. diff --git a/gcc/testsuite/gnat.dg/dynhash1.adb b/gcc/testsuite/gnat.dg/dynhash1.adb new file mode 100644 index 0000000..cbe241a --- /dev/null +++ b/gcc/testsuite/gnat.dg/dynhash1.adb @@ -0,0 +1,53 @@ +with Ada.Text_IO; use Ada.Text_IO; +with GNAT; use GNAT; +with GNAT.Dynamic_HTables; use GNAT.Dynamic_HTables; + +procedure Dynhash1 is + function Hash (Key : Integer) return Bucket_Range_Type is + begin + return Bucket_Range_Type (Key); + end Hash; + + package Integer_Hash_Tables is new Dynamic_HTable + (Key_Type => Integer, + Value_Type => Integer, + No_Value => 0, + Expansion_Threshold => 1.3, + Expansion_Factor => 2, + Compression_Threshold => 0.3, + Compression_Factor => 2, + "=" => "=", + Hash => Hash); + use Integer_Hash_Tables; + + Siz : Natural; + T : Instance; + +begin + T := Create (8); + + Put (T, 1, 1); + Put (T, 1, 2); + Put (T, 1, 3); + + Siz := Size (T); + + if Siz /= 1 then + Put_Line ("ERROR: Put: wrong size"); + Put_Line ("expected: 1"); + Put_Line ("got :" & Siz'Img); + end if; + + Delete (T, 1); + Delete (T, 1); + + Siz := Size (T); + + if Siz /= 0 then + Put_Line ("ERROR: Delete: wrong size"); + Put_Line ("expected: 0"); + Put_Line ("got :" & Siz'Img); + end if; + + Destroy (T); +end Dynhash1; -- cgit v1.1 From c886a946134d08a3ae3ad2dacbcee8d6b981db1d Mon Sep 17 00:00:00 2001 From: Javier Miranda Date: Wed, 26 Sep 2018 09:18:29 +0000 Subject: [Ada] Mimic the C++ ABI when passing class-wide conversion actuals This patch does not affect the behavior of Ada-only code but improves consistency with the code generated by the C++ compiler. 2018-09-26 Javier Miranda gcc/ada/ * sem_res.adb (Resolve_Actuals): If the formal is a class-wide type conversion then do not skip resolving and expanding the conversion; required to displace the pointer to the object and reference the dispatch table associated with the target interface type. From-SVN: r264624 --- gcc/ada/ChangeLog | 8 ++++++++ gcc/ada/sem_res.adb | 1 + 2 files changed, 9 insertions(+) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index b9187b6..5996edc 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2018-09-26 Javier Miranda + + * sem_res.adb (Resolve_Actuals): If the formal is a class-wide + type conversion then do not skip resolving and expanding the + conversion; required to displace the pointer to the object and + reference the dispatch table associated with the target + interface type. + 2018-09-26 Hristian Kirtchev * libgnat/g-dynhta.adb (Prepend_Or_Replace): Update the number diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 5354d81..6a3dfb7 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -3809,6 +3809,7 @@ package body Sem_Res is if Ekind (F) /= E_In_Parameter and then Nkind (A) = N_Type_Conversion and then not Is_Class_Wide_Type (Etype (Expression (A))) + and then not Is_Interface (Etype (A)) then if Ekind (F) = E_In_Out_Parameter and then Is_Array_Type (Etype (F)) -- cgit v1.1 From abbfd69841b2357d242d47abda8d0430269ab829 Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Wed, 26 Sep 2018 09:18:35 +0000 Subject: [Ada] Spurious dependency on secondary stack This patch reimplements the handling of the secondary stack when the iteration scheme of a loop statement requires this support. Prior to this modification, an iterator loop over a container was assumed to require unconditional secondary stack management. This is however not always true because of user-defined iterator types, where routines First and Next return an iterator that does require the secondary stack. ------------ -- Source -- ------------ -- gnat.adc pragma Restrictions (No_Secondary_Stack); -- test.ads package Test is type Test_Type is private with Default_Initial_Condition, Iterable => (First => First_Element, Next => Next_Element, Has_Element => Has_Element, Element => Element); type Cursor_Type is private; function First_Element (T : Test_Type) return Cursor_Type; function Next_Element (T : Test_Type; C : Cursor_Type) return Cursor_Type; function Has_Element (T : Test_Type; C : Cursor_Type) return Boolean; function Element (T : Test_Type; C : Cursor_Type) return Natural; private type Cursor_Type is new Natural; type Test_Type is record null; end record; function First_Element (T : Test_Type) return Cursor_Type is (0); function Next_Element (T : Test_Type; C : Cursor_Type) return Cursor_Type is (0); function Has_Element (T : Test_Type; C : Cursor_Type) return Boolean is (False); function Element (T : Test_Type; C : Cursor_Type) return Natural is (0); end Test; -- main.adb with Test; use Test; procedure Main is F : Boolean; M : Test_Type; begin for Elem of M loop null; end loop; F := (for all C of M => C = 1); F := (for all C in M => True); end Main; ----------------- -- Compilation -- ----------------- $ gnatmake -q --RTS=zfp -nostdlib main.adb 2018-09-26 Hristian Kirtchev gcc/ada/ * exp_ch4.adb (Expand_N_Allocator): Ensure that the use of the secondary stack does not clash with restriction No_Secondary_Stack. * exp_ch6.adb (Expand_N_Extended_Return_Statement): Ensure that the use of the secondary stack does not clash with restriction No_Secondary_Stack. * sem_ch5.adb (Analyze_Loop_Statement): Wrap the loop in a block prior to analysis in order to either provide a local scope for an iterator, or ensure that the secondary stack is properly managed. (Check_Call): Account for the case where the tree may be unanalyzed or contain prior errors. (Has_Call_Using_Secondary_Stack): Renamed to Has_Sec_Stack_Call. Update all uses of the subprogram. (Prepare_Loop_Statement): New routine. From-SVN: r264625 --- gcc/ada/ChangeLog | 18 ++ gcc/ada/exp_ch4.adb | 1 + gcc/ada/exp_ch6.adb | 3 +- gcc/ada/sem_ch5.adb | 535 +++++++++++++++++++++++++++++++++------------------- 4 files changed, 362 insertions(+), 195 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5996edc..d549a87 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,21 @@ +2018-09-26 Hristian Kirtchev + + * exp_ch4.adb (Expand_N_Allocator): Ensure that the use of the + secondary stack does not clash with restriction + No_Secondary_Stack. + * exp_ch6.adb (Expand_N_Extended_Return_Statement): Ensure that + the use of the secondary stack does not clash with restriction + No_Secondary_Stack. + * sem_ch5.adb (Analyze_Loop_Statement): Wrap the loop in a block + prior to analysis in order to either provide a local scope for + an iterator, or ensure that the secondary stack is properly + managed. + (Check_Call): Account for the case where the tree may be + unanalyzed or contain prior errors. + (Has_Call_Using_Secondary_Stack): Renamed to Has_Sec_Stack_Call. + Update all uses of the subprogram. + (Prepare_Loop_Statement): New routine. + 2018-09-26 Javier Miranda * sem_res.adb (Resolve_Actuals): If the formal is a class-wide diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index b08cf37..09a6cd0 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -4417,6 +4417,7 @@ package body Exp_Ch4 is Set_Storage_Pool (N, Pool); if Is_RTE (Pool, RE_SS_Pool) then + Check_Restriction (No_Secondary_Stack, N); Set_Procedure_To_Call (N, RTE (RE_SS_Allocate)); -- In the case of an allocator for a simple storage pool, locate diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index e08b748..96ee696 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -5267,8 +5267,9 @@ package body Exp_Ch6 is Set_Comes_From_Source (Pool_Allocator, True); end if; - -- The allocator is returned on the secondary stack. + -- The allocator is returned on the secondary stack + Check_Restriction (No_Secondary_Stack, N); Set_Storage_Pool (SS_Allocator, RTE (RE_SS_Pool)); Set_Procedure_To_Call (SS_Allocator, RTE (RE_SS_Allocate)); diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 95b5660..8c1f949 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -83,7 +83,7 @@ package body Sem_Ch5 is -- messages. This variable is recursively saved on entry to processing the -- construct, and restored on exit. - function Has_Call_Using_Secondary_Stack (N : Node_Id) return Boolean; + function Has_Sec_Stack_Call (N : Node_Id) return Boolean; -- N is the node for an arbitrary construct. This function searches the -- construct N to see if any expressions within it contain function -- calls that use the secondary stack, returning True if any such call @@ -2850,7 +2850,7 @@ package body Sem_Ch5 is -- proper trace of the value, useful in optimizations that get rid -- of junk range checks. - if not Has_Call_Using_Secondary_Stack (Analyzed_Bound) then + if not Has_Sec_Stack_Call (Analyzed_Bound) then Analyze_And_Resolve (Original_Bound, Typ); -- Ensure that the bound is valid. This check should not be @@ -3360,18 +3360,23 @@ package body Sem_Ch5 is procedure Analyze_Loop_Statement (N : Node_Id) is + -- The following exception is raised by routine Prepare_Loop_Statement + -- to avoid further analysis of a transformed loop. + + Skip_Analysis : exception; + function Disable_Constant (N : Node_Id) return Traverse_Result; -- If N represents an E_Variable entity, set Is_True_Constant To False - function Is_Container_Iterator (Iter : Node_Id) return Boolean; - -- Given a loop iteration scheme, determine whether it is an Ada 2012 - -- container iteration. + procedure Disable_Constants is new Traverse_Proc (Disable_Constant); + -- Helper for Analyze_Loop_Statement, to unset Is_True_Constant on + -- variables referenced within an OpenACC construct. - function Is_Wrapped_In_Block (N : Node_Id) return Boolean; - -- Determine whether loop statement N has been wrapped in a block to - -- capture finalization actions that may be generated for container - -- iterators. Prevents infinite recursion when block is analyzed. - -- Routine is a noop if loop is single statement within source block. + procedure Prepare_Loop_Statement (Iter : Node_Id); + -- Determine whether loop statement N with iteration scheme Iter must be + -- transformed prior to analysis, and if so, perform it. The routine + -- raises Skip_Analysis to prevent further analysis of the transformed + -- loop. ---------------------- -- Disable_Constant -- @@ -3385,104 +3390,328 @@ package body Sem_Ch5 is then Set_Is_True_Constant (Entity (N), False); end if; + return OK; end Disable_Constant; - procedure Disable_Constants is new Traverse_Proc (Disable_Constant); - -- Helper for Analyze_Loop_Statement, to unset Is_True_Constant on - -- variables referenced within an OpenACC environment. + ---------------------------- + -- Prepare_Loop_Statement -- + ---------------------------- + + procedure Prepare_Loop_Statement (Iter : Node_Id) is + function Has_Sec_Stack_Default_Iterator + (Cont_Typ : Entity_Id) return Boolean; + pragma Inline (Has_Sec_Stack_Default_Iterator); + -- Determine whether container type Cont_Typ has a default iterator + -- that requires secondary stack management. + + function Is_Sec_Stack_Iteration_Primitive + (Cont_Typ : Entity_Id; + Iter_Prim_Nam : Name_Id) return Boolean; + pragma Inline (Is_Sec_Stack_Iteration_Primitive); + -- Determine whether container type Cont_Typ has an iteration routine + -- described by its name Iter_Prim_Nam that requires secondary stack + -- management. + + function Is_Wrapped_In_Block (Stmt : Node_Id) return Boolean; + pragma Inline (Is_Wrapped_In_Block); + -- Determine whether arbitrary statement Stmt is the sole statement + -- wrapped within some block, excluding pragmas. + + procedure Prepare_Iterator_Loop (Iter_Spec : Node_Id); + pragma Inline (Prepare_Iterator_Loop); + -- Prepare an iterator loop with iteration specification Iter_Spec + -- for transformation if needed. + + procedure Prepare_Param_Spec_Loop (Param_Spec : Node_Id); + pragma Inline (Prepare_Param_Spec_Loop); + -- Prepare a discrete loop with parameter specification Param_Spec + -- for transformation if needed. + + procedure Wrap_Loop_Statement (Manage_Sec_Stack : Boolean); + pragma Inline (Wrap_Loop_Statement); + -- Wrap loop statement N within a block. Flag Manage_Sec_Stack must + -- be set when the block must mark and release the secondary stack. + + ------------------------------------ + -- Has_Sec_Stack_Default_Iterator -- + ------------------------------------ + + function Has_Sec_Stack_Default_Iterator + (Cont_Typ : Entity_Id) return Boolean + is + Def_Iter : constant Node_Id := + Find_Value_Of_Aspect + (Cont_Typ, Aspect_Default_Iterator); + begin + return + Present (Def_Iter) + and then Requires_Transient_Scope (Etype (Def_Iter)); + end Has_Sec_Stack_Default_Iterator; + + -------------------------------------- + -- Is_Sec_Stack_Iteration_Primitive -- + -------------------------------------- + + function Is_Sec_Stack_Iteration_Primitive + (Cont_Typ : Entity_Id; + Iter_Prim_Nam : Name_Id) return Boolean + is + Iter_Prim : constant Entity_Id := + Get_Iterable_Type_Primitive + (Cont_Typ, Iter_Prim_Nam); + begin + return + Present (Iter_Prim) + and then Requires_Transient_Scope (Etype (Iter_Prim)); + end Is_Sec_Stack_Iteration_Primitive; - --------------------------- - -- Is_Container_Iterator -- - --------------------------- + ------------------------- + -- Is_Wrapped_In_Block -- + ------------------------- - function Is_Container_Iterator (Iter : Node_Id) return Boolean is - begin - -- Infinite loop + function Is_Wrapped_In_Block (Stmt : Node_Id) return Boolean is + Blk_HSS : Node_Id; + Blk_Id : Entity_Id; + Blk_Stmt : Node_Id; - if No (Iter) then - return False; + begin + Blk_Id := Current_Scope; - -- While loop + -- The current context is a block. Inspect the statements of the + -- block to determine whether it wraps Stmt. + + if Ekind (Blk_Id) = E_Block + and then Present (Block_Node (Blk_Id)) + then + Blk_HSS := + Handled_Statement_Sequence (Parent (Block_Node (Blk_Id))); + + -- Skip leading pragmas introduced for invariant and predicate + -- checks. + + Blk_Stmt := First (Statements (Blk_HSS)); + while Present (Blk_Stmt) + and then Nkind (Blk_Stmt) = N_Pragma + loop + Next (Blk_Stmt); + end loop; + + return Blk_Stmt = Stmt and then No (Next (Blk_Stmt)); + end if; - elsif Present (Condition (Iter)) then return False; + end Is_Wrapped_In_Block; - -- for Def_Id in [reverse] Name loop - -- for Def_Id [: Subtype_Indication] of [reverse] Name loop + --------------------------- + -- Prepare_Iterator_Loop -- + --------------------------- - elsif Present (Iterator_Specification (Iter)) then - declare - Nam : constant Node_Id := Name (Iterator_Specification (Iter)); - Nam_Copy : Node_Id; + procedure Prepare_Iterator_Loop (Iter_Spec : Node_Id) is + Cont_Typ : Entity_Id; + Nam : Node_Id; + Nam_Copy : Node_Id; - begin + begin + -- The iterator specification has syntactic errors. Transform the + -- loop into an infinite loop in order to safely perform at least + -- some minor analysis. This check must come first. + + if Error_Posted (Iter_Spec) then + Set_Iteration_Scheme (N, Empty); + Analyze (N); + + raise Skip_Analysis; + + -- Nothing to do when the loop is already wrapped in a block + + elsif Is_Wrapped_In_Block (N) then + null; + + -- Otherwise the iterator loop traverses an array or a container + -- and appears in the form + -- + -- for Def_Id in [reverse] Iterator_Name loop + -- for Def_Id [: Subtyp_Indic] of [reverse] Iterable_Name loop + + else + -- Prepare a copy of the iterated name for preanalysis. The + -- copy is semi inserted into the tree by setting its Parent + -- pointer. + + Nam := Name (Iter_Spec); Nam_Copy := New_Copy_Tree (Nam); Set_Parent (Nam_Copy, Parent (Nam)); + + -- Determine what the loop is iterating on + Preanalyze_Range (Nam_Copy); + Cont_Typ := Etype (Nam_Copy); - -- The only two options here are iteration over a container or - -- an array. + -- The iterator loop is traversing an array. This case does not + -- require any transformation. - return not Is_Array_Type (Etype (Nam_Copy)); - end; + if Is_Array_Type (Cont_Typ) then + null; - -- for Def_Id in [reverse] Discrete_Subtype_Definition loop + -- Otherwise unconditionally wrap the loop statement within + -- a block. The expansion of iterator loops may relocate the + -- iterator outside the loop, thus "leaking" its entity into + -- the enclosing scope. Wrapping the loop statement allows + -- for multiple iterator loops using the same iterator name + -- to coexist within the same scope. + -- + -- The block must manage the secondary stack when the iterator + -- loop is traversing a container using either + -- + -- * A default iterator obtained on the secondary stack + -- + -- * Call to Iterate where the iterator is returned on the + -- secondary stack. + -- + -- * Combination of First, Next, and Has_Element where the + -- first two return a cursor on the secondary stack. - else - declare - LP : constant Node_Id := Loop_Parameter_Specification (Iter); - DS : constant Node_Id := Discrete_Subtype_Definition (LP); - DS_Copy : Node_Id; + else + Wrap_Loop_Statement + (Manage_Sec_Stack => + Has_Sec_Stack_Default_Iterator (Cont_Typ) + or else Has_Sec_Stack_Call (Nam_Copy) + or else Is_Sec_Stack_Iteration_Primitive + (Cont_Typ, Name_First) + or else Is_Sec_Stack_Iteration_Primitive + (Cont_Typ, Name_Next)); + end if; + end if; + end Prepare_Iterator_Loop; - begin - DS_Copy := New_Copy_Tree (DS); - Set_Parent (DS_Copy, Parent (DS)); - Preanalyze_Range (DS_Copy); + ----------------------------- + -- Prepare_Param_Spec_Loop -- + ----------------------------- - -- Check for a call to Iterate () or an expression with - -- an iterator type. + procedure Prepare_Param_Spec_Loop (Param_Spec : Node_Id) is + High : Node_Id; + Low : Node_Id; + Rng : Node_Id; + Rng_Copy : Node_Id; + Rng_Typ : Entity_Id; - return - (Nkind (DS_Copy) = N_Function_Call - and then Needs_Finalization (Etype (DS_Copy))) - or else Is_Iterator (Etype (DS_Copy)); - end; - end if; - end Is_Container_Iterator; + begin + Rng := Discrete_Subtype_Definition (Param_Spec); - ------------------------- - -- Is_Wrapped_In_Block -- - ------------------------- + -- Nothing to do when the loop is already wrapped in a block - function Is_Wrapped_In_Block (N : Node_Id) return Boolean is - HSS : Node_Id; - Stat : Node_Id; + if Is_Wrapped_In_Block (N) then + null; - begin + -- The parameter specification appears in the form + -- + -- for Def_Id in Subtype_Mark Constraint loop - -- Check if current scope is a block that is not a transient block. + elsif Nkind (Rng) = N_Subtype_Indication + and then Nkind (Range_Expression (Constraint (Rng))) = N_Range + then + Rng := Range_Expression (Constraint (Rng)); - if Ekind (Current_Scope) /= E_Block - or else No (Block_Node (Current_Scope)) - then - return False; + -- Preanalyze the bounds of the range constraint - else - HSS := - Handled_Statement_Sequence (Parent (Block_Node (Current_Scope))); + Low := New_Copy_Tree (Low_Bound (Rng)); + High := New_Copy_Tree (High_Bound (Rng)); - -- Skip leading pragmas that may be introduced for invariant and - -- predicate checks. + Preanalyze (Low); + Preanalyze (High); - Stat := First (Statements (HSS)); - while Present (Stat) and then Nkind (Stat) = N_Pragma loop - Stat := Next (Stat); - end loop; + -- The bounds contain at least one function call that returns + -- on the secondary stack. Note that the loop must be wrapped + -- only when such a call exists. + + if Has_Sec_Stack_Call (Low) + or else + Has_Sec_Stack_Call (High) + then + Wrap_Loop_Statement (Manage_Sec_Stack => True); + end if; + + -- Otherwise the parameter specification appears in the form + -- + -- for Def_Id in Range loop + + else + -- Prepare a copy of the discrete range for preanalysis. The + -- copy is semi inserted into the tree by setting its Parent + -- pointer. + + Rng_Copy := New_Copy_Tree (Rng); + Set_Parent (Rng_Copy, Parent (Rng)); + + -- Determine what the loop is iterating on + + Preanalyze_Range (Rng_Copy); + Rng_Typ := Etype (Rng_Copy); + + -- Wrap the loop statement within a block in order to manage + -- the secondary stack when the discrete range is + -- + -- * Either a Forward_Iterator or a Reverse_Iterator + -- + -- * Function call whose return type requires finalization + -- actions. + + -- ??? it is unclear why using Has_Sec_Stack_Call directly on + -- the discrete range causes the freeze node of an itype to be + -- in the wrong scope in complex assertion expressions. + + if Is_Iterator (Rng_Typ) + or else (Nkind (Rng_Copy) = N_Function_Call + and then Needs_Finalization (Rng_Typ)) + then + Wrap_Loop_Statement (Manage_Sec_Stack => True); + end if; + end if; + end Prepare_Param_Spec_Loop; + + ------------------------- + -- Wrap_Loop_Statement -- + ------------------------- - return Stat = N and then No (Next (Stat)); + procedure Wrap_Loop_Statement (Manage_Sec_Stack : Boolean) is + Loc : constant Source_Ptr := Sloc (N); + + Blk : Node_Id; + Blk_Id : Entity_Id; + + begin + Blk := + Make_Block_Statement (Loc, + Declarations => New_List, + Handled_Statement_Sequence => + Make_Handled_Sequence_Of_Statements (Loc, + Statements => New_List (Relocate_Node (N)))); + + Add_Block_Identifier (Blk, Blk_Id); + Set_Uses_Sec_Stack (Blk_Id, Manage_Sec_Stack); + + Rewrite (N, Blk); + Analyze (N); + + raise Skip_Analysis; + end Wrap_Loop_Statement; + + -- Local variables + + Iter_Spec : constant Node_Id := Iterator_Specification (Iter); + Param_Spec : constant Node_Id := Loop_Parameter_Specification (Iter); + + -- Start of processing for Prepare_Loop_Statement + + begin + if Present (Iter_Spec) then + Prepare_Iterator_Loop (Iter_Spec); + + elsif Present (Param_Spec) then + Prepare_Param_Spec_Loop (Param_Spec); end if; - end Is_Wrapped_In_Block; + end Prepare_Loop_Statement; -- Local declarations @@ -3561,114 +3790,25 @@ package body Sem_Ch5 is Set_Has_Created_Identifier (N); end if; - -- If the iterator specification has a syntactic error, transform - -- construct into an infinite loop to prevent a crash and perform - -- some analysis. - - if Present (Iter) - and then Present (Iterator_Specification (Iter)) - and then Error_Posted (Iterator_Specification (Iter)) - then - Set_Iteration_Scheme (N, Empty); - Analyze (N); - return; - end if; - - -- Iteration over a container in Ada 2012 involves the creation of a - -- controlled iterator object. Wrap the loop in a block to ensure the - -- timely finalization of the iterator and release of container locks. - -- The same applies to the use of secondary stack when obtaining an - -- iterator. - - if Ada_Version >= Ada_2012 - and then Is_Container_Iterator (Iter) - and then not Is_Wrapped_In_Block (N) - then - declare - Block_Nod : Node_Id; - Block_Id : Entity_Id; - - begin - Block_Nod := - Make_Block_Statement (Loc, - Declarations => New_List, - Handled_Statement_Sequence => - Make_Handled_Sequence_Of_Statements (Loc, - Statements => New_List (Relocate_Node (N)))); - - Add_Block_Identifier (Block_Nod, Block_Id); - - -- The expansion of iterator loops generates an iterator in order - -- to traverse the elements of a container: - - -- Iter : := Iterate (Container)'reference; - - -- The iterator is controlled and returned on the secondary stack. - -- The analysis of the call to Iterate establishes a transient - -- scope to deal with the secondary stack management, but never - -- really creates a physical block as this would kill the iterator - -- too early (see Wrap_Transient_Declaration). To address this - -- case, mark the generated block as needing secondary stack - -- management. - - Set_Uses_Sec_Stack (Block_Id); - - Rewrite (N, Block_Nod); - Analyze (N); - return; - end; - end if; - - -- Wrap the loop in a block when the evaluation of the loop iterator - -- relies on the secondary stack. Required to ensure releasing the - -- secondary stack as soon as the loop completes. - - if Present (Iter) - and then Present (Loop_Parameter_Specification (Iter)) - and then not Is_Wrapped_In_Block (N) - then - declare - LPS : constant Node_Id := Loop_Parameter_Specification (Iter); - DSD : constant Node_Id := - Original_Node (Discrete_Subtype_Definition (LPS)); - - Block_Id : Entity_Id; - Block_Nod : Node_Id; - HB : Node_Id; - LB : Node_Id; + -- Determine whether the loop statement must be transformed prior to + -- analysis, and if so, perform it. This early modification is needed + -- when: + -- + -- * The loop has an erroneous iteration scheme. In this case the + -- loop is converted into an infinite loop in order to perform + -- minor analysis. + -- + -- * The loop is an Ada 2012 iterator loop. In this case the loop is + -- wrapped within a block to provide a local scope for the iterator. + -- If the iterator specification requires the secondary stack in any + -- way, the block is marked in order to manage it. + -- + -- * The loop is using a parameter specification where the discrete + -- range requires the secondary stack. In this case the loop is + -- wrapped within a block in order to manage the secondary stack. - begin - if Nkind (DSD) = N_Subtype_Indication - and then Nkind (Range_Expression (Constraint (DSD))) = N_Range - then - LB := - New_Copy_Tree - (Low_Bound (Range_Expression (Constraint (DSD)))); - HB := - New_Copy_Tree - (High_Bound (Range_Expression (Constraint (DSD)))); - - Preanalyze (LB); - Preanalyze (HB); - - if Has_Call_Using_Secondary_Stack (LB) - or else Has_Call_Using_Secondary_Stack (HB) - then - Block_Nod := - Make_Block_Statement (Loc, - Declarations => New_List, - Handled_Statement_Sequence => - Make_Handled_Sequence_Of_Statements (Loc, - Statements => New_List (Relocate_Node (N)))); - - Add_Block_Identifier (Block_Nod, Block_Id); - Set_Uses_Sec_Stack (Block_Id); - Rewrite (N, Block_Nod); - Analyze (N); - return; - end if; - end if; - end; + if Present (Iter) then + Prepare_Loop_Statement (Iter); end if; -- Kill current values on entry to loop, since statements in the body of @@ -3842,6 +3982,10 @@ package body Sem_Ch5 is if Is_OpenAcc_Environment (Stmt) then Disable_Constants (Stmt); end if; + + exception + when Skip_Analysis => + null; end Analyze_Loop_Statement; ---------------------------- @@ -4108,11 +4252,11 @@ package body Sem_Ch5 is end if; end Check_Unreachable_Code; - ------------------------------------ - -- Has_Call_Using_Secondary_Stack -- - ------------------------------------ + ------------------------ + -- Has_Sec_Stack_Call -- + ------------------------ - function Has_Call_Using_Secondary_Stack (N : Node_Id) return Boolean is + function Has_Sec_Stack_Call (N : Node_Id) return Boolean is function Check_Call (N : Node_Id) return Traverse_Result; -- Check if N is a function call which uses the secondary stack @@ -4144,13 +4288,16 @@ package body Sem_Ch5 is end loop; Subp := Entity (Nam); - Typ := Etype (Subp); - if Requires_Transient_Scope (Typ) then - return Abandon; + if Present (Subp) then + Typ := Etype (Subp); - elsif Sec_Stack_Needed_For_Return (Subp) then - return Abandon; + if Requires_Transient_Scope (Typ) then + return Abandon; + + elsif Sec_Stack_Needed_For_Return (Subp) then + return Abandon; + end if; end if; end if; @@ -4161,11 +4308,11 @@ package body Sem_Ch5 is function Check_Calls is new Traverse_Func (Check_Call); - -- Start of processing for Has_Call_Using_Secondary_Stack + -- Start of processing for Has_Sec_Stack_Call begin return Check_Calls (N) = Abandon; - end Has_Call_Using_Secondary_Stack; + end Has_Sec_Stack_Call; ---------------------- -- Preanalyze_Range -- -- cgit v1.1 From 6cd1ee98eaf775b062c90cb1ef0dc777c086afc2 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Wed, 26 Sep 2018 09:18:52 +0000 Subject: [Ada] Spurious error on private extension with predicate This patch fixes a spurious error involving a private extension whose full view includes a dynamic predicate, when the parent type is itself private at the point of the predicate check. The conversion is known to be legal so no extra conversion checks are required. 2018-09-26 Ed Schonberg gcc/ada/ * exp_util.adb (Make_Predicate_Call): Use OK_Convert_To when applying a predicate check to prevent spurious errors when private ancestors are involved. gcc/testsuite/ * gnat.dg/predicate2-containers.ads, gnat.dg/predicate2-project-name_values.ads, gnat.dg/predicate2-project-registry-attribute.ads, gnat.dg/predicate2-project-registry.ads, gnat.dg/predicate2-project-typ-set.ads, gnat.dg/predicate2-project-typ.ads, gnat.dg/predicate2-project.ads, gnat.dg/predicate2-source_reference.ads, gnat.dg/predicate2.ads, gnat.dg/predicate2_main.adb: New testcase. From-SVN: r264626 --- gcc/ada/ChangeLog | 6 ++++ gcc/ada/exp_util.adb | 6 ++-- gcc/testsuite/ChangeLog | 12 +++++++ gcc/testsuite/gnat.dg/predicate2-containers.ads | 13 ++++++++ .../gnat.dg/predicate2-project-name_values.ads | 37 ++++++++++++++++++++++ .../predicate2-project-registry-attribute.ads | 7 ++++ .../gnat.dg/predicate2-project-registry.ads | 3 ++ .../gnat.dg/predicate2-project-typ-set.ads | 13 ++++++++ gcc/testsuite/gnat.dg/predicate2-project-typ.ads | 24 ++++++++++++++ gcc/testsuite/gnat.dg/predicate2-project.ads | 4 +++ .../gnat.dg/predicate2-source_reference.ads | 33 +++++++++++++++++++ gcc/testsuite/gnat.dg/predicate2.ads | 14 ++++++++ gcc/testsuite/gnat.dg/predicate2_main.adb | 10 ++++++ 13 files changed, 180 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gnat.dg/predicate2-containers.ads create mode 100644 gcc/testsuite/gnat.dg/predicate2-project-name_values.ads create mode 100644 gcc/testsuite/gnat.dg/predicate2-project-registry-attribute.ads create mode 100644 gcc/testsuite/gnat.dg/predicate2-project-registry.ads create mode 100644 gcc/testsuite/gnat.dg/predicate2-project-typ-set.ads create mode 100644 gcc/testsuite/gnat.dg/predicate2-project-typ.ads create mode 100644 gcc/testsuite/gnat.dg/predicate2-project.ads create mode 100644 gcc/testsuite/gnat.dg/predicate2-source_reference.ads create mode 100644 gcc/testsuite/gnat.dg/predicate2.ads create mode 100644 gcc/testsuite/gnat.dg/predicate2_main.adb (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d549a87..9731513 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Ed Schonberg + + * exp_util.adb (Make_Predicate_Call): Use OK_Convert_To when + applying a predicate check to prevent spurious errors when + private ancestors are involved. + 2018-09-26 Hristian Kirtchev * exp_ch4.adb (Expand_N_Allocator): Ensure that the use of the diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index ec681af..cf277c1 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -9313,14 +9313,16 @@ package body Exp_Util is -- If the type is tagged, the expression may be class-wide, in which -- case it has to be converted to its root type, given that the - -- generated predicate function is not dispatching. + -- generated predicate function is not dispatching. The conversion + -- is type-safe and does not need validation, which matters when + -- private extensions are involved. if Is_Tagged_Type (Typ) then Call := Make_Function_Call (Loc, Name => New_Occurrence_Of (Func_Id, Loc), Parameter_Associations => - New_List (Convert_To (Typ, Relocate_Node (Expr)))); + New_List (OK_Convert_To (Typ, Relocate_Node (Expr)))); else Call := Make_Function_Call (Loc, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6cb08cd..e285be6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2018-09-26 Ed Schonberg + + * gnat.dg/predicate2-containers.ads, + gnat.dg/predicate2-project-name_values.ads, + gnat.dg/predicate2-project-registry-attribute.ads, + gnat.dg/predicate2-project-registry.ads, + gnat.dg/predicate2-project-typ-set.ads, + gnat.dg/predicate2-project-typ.ads, + gnat.dg/predicate2-project.ads, + gnat.dg/predicate2-source_reference.ads, gnat.dg/predicate2.ads, + gnat.dg/predicate2_main.adb: New testcase. + 2018-09-26 Hristian Kirtchev * gnat.dg/dynhash1.adb: New testcase. diff --git a/gcc/testsuite/gnat.dg/predicate2-containers.ads b/gcc/testsuite/gnat.dg/predicate2-containers.ads new file mode 100644 index 0000000..d02cfe3 --- /dev/null +++ b/gcc/testsuite/gnat.dg/predicate2-containers.ads @@ -0,0 +1,13 @@ +---- +with Ada.Containers.Indefinite_Vectors; + +package Predicate2.Containers is + + subtype Count_Type is Ada.Containers.Count_Type; + + package Value_Type_List is + new Ada.Containers.Indefinite_Vectors (Positive, Value_Type); + + subtype Value_List is Value_Type_List.Vector; + +end Predicate2.Containers; diff --git a/gcc/testsuite/gnat.dg/predicate2-project-name_values.ads b/gcc/testsuite/gnat.dg/predicate2-project-name_values.ads new file mode 100644 index 0000000..a68fa0e --- /dev/null +++ b/gcc/testsuite/gnat.dg/predicate2-project-name_values.ads @@ -0,0 +1,37 @@ + +---- +with Predicate2.Containers; +with Predicate2.Project.Registry.Attribute; +with Predicate2.Source_Reference; + +private with Ada.Strings.Unbounded; + +package Predicate2.Project.Name_Values is + + use type Containers.Count_Type; + use all type Registry.Attribute.Value_Kind; + + type Object is new Source_Reference.Object with private; + + Undefined : constant Object; + + subtype Value_Kind is Registry.Attribute.Value_Kind; + + function Kind (Self : Object'Class) return Registry.Attribute.Value_Kind + with Pre => Object (Self) /= Undefined; + -- Returns the Kind for the Name/Values pair object + +private + + use Ada.Strings.Unbounded; + + type Object is new Source_Reference.Object with record + Kind : Registry.Attribute.Value_Kind := List; + Name : Unbounded_String; + Values : Containers.Value_List; + end record; + + Undefined : constant Object := + Object'(Source_Reference.Object with others => <>); + +end Predicate2.Project.Name_Values; diff --git a/gcc/testsuite/gnat.dg/predicate2-project-registry-attribute.ads b/gcc/testsuite/gnat.dg/predicate2-project-registry-attribute.ads new file mode 100644 index 0000000..b0d671e --- /dev/null +++ b/gcc/testsuite/gnat.dg/predicate2-project-registry-attribute.ads @@ -0,0 +1,7 @@ + +---- +package Predicate2.Project.Registry.Attribute is + + type Value_Kind is (Single, List); + +end Predicate2.Project.Registry.Attribute; diff --git a/gcc/testsuite/gnat.dg/predicate2-project-registry.ads b/gcc/testsuite/gnat.dg/predicate2-project-registry.ads new file mode 100644 index 0000000..680cb9f --- /dev/null +++ b/gcc/testsuite/gnat.dg/predicate2-project-registry.ads @@ -0,0 +1,3 @@ +---- +package Predicate2.Project.Registry is +end Predicate2.Project.Registry; diff --git a/gcc/testsuite/gnat.dg/predicate2-project-typ-set.ads b/gcc/testsuite/gnat.dg/predicate2-project-typ-set.ads new file mode 100644 index 0000000..1ba0580 --- /dev/null +++ b/gcc/testsuite/gnat.dg/predicate2-project-typ-set.ads @@ -0,0 +1,13 @@ +---- +with Ada.Containers.Indefinite_Ordered_Maps; + +package Predicate2.Project.Typ.Set is + + -- The type names must not be case-sensitive + + package Set is new Ada.Containers.Indefinite_Ordered_Maps + (Name_Type, Object, "<"); + + subtype Object is Set.Map; + +end Predicate2.Project.Typ.Set; diff --git a/gcc/testsuite/gnat.dg/predicate2-project-typ.ads b/gcc/testsuite/gnat.dg/predicate2-project-typ.ads new file mode 100644 index 0000000..353833b --- /dev/null +++ b/gcc/testsuite/gnat.dg/predicate2-project-typ.ads @@ -0,0 +1,24 @@ +---- +with Predicate2.Project.Name_Values; + +private with Predicate2.Project.Registry.Attribute; + +package Predicate2.Project.Typ is + + type Object is new Name_Values.Object with private; + + Undefined : constant Object; + +private + + use all type Predicate2.Project.Registry.Attribute.Value_Kind; + + -- ???? BUG HERE: removing the Dynamic_Predicate below will allow + -- compilation of the unit. + + type Object is new Name_Values.Object with null record + with Dynamic_Predicate => Object.Kind = List; + + Undefined : constant Object := (Name_Values.Undefined with null record); + +end Predicate2.Project.Typ; diff --git a/gcc/testsuite/gnat.dg/predicate2-project.ads b/gcc/testsuite/gnat.dg/predicate2-project.ads new file mode 100644 index 0000000..4036ff3 --- /dev/null +++ b/gcc/testsuite/gnat.dg/predicate2-project.ads @@ -0,0 +1,4 @@ +---- +package Predicate2.Project is + +end Predicate2.Project; diff --git a/gcc/testsuite/gnat.dg/predicate2-source_reference.ads b/gcc/testsuite/gnat.dg/predicate2-source_reference.ads new file mode 100644 index 0000000..1ad4c3f --- /dev/null +++ b/gcc/testsuite/gnat.dg/predicate2-source_reference.ads @@ -0,0 +1,33 @@ + +private with Ada.Strings.Unbounded; + +package Predicate2.Source_Reference is + + type Object is tagged private; + + subtype Source_Reference is Object; + + function "<" (Left, Right : Object) return Boolean; + + Undefined : constant Object; + +private + + use Ada.Strings.Unbounded; + + type Object is tagged record + Line : Natural; + Column : Natural; + Filename : Unbounded_String; + end record + with Dynamic_Predicate => Filename /= Null_Unbounded_String; + + function "<" (Left, Right : Object) return Boolean is + (Left.Filename < Right.Filename + or else + (Left.Filename = Right.Filename and then Left.Line < Right.Line)); + + Undefined : constant Object := + (0, 0, To_Unbounded_String ("@")); + +end Predicate2.Source_Reference; diff --git a/gcc/testsuite/gnat.dg/predicate2.ads b/gcc/testsuite/gnat.dg/predicate2.ads new file mode 100644 index 0000000..4e918f9 --- /dev/null +++ b/gcc/testsuite/gnat.dg/predicate2.ads @@ -0,0 +1,14 @@ +package Predicate2 is + + type Optional_Name_Type is new String; + + subtype Name_Type is Optional_Name_Type + with Dynamic_Predicate => Name_Type'Length > 0; + -- A non case sensitive name + + subtype Value_Type is String; + + overriding function "=" (Left, Right : Optional_Name_Type) return Boolean; + overriding function "<" (Left, Right : Optional_Name_Type) return Boolean; + +end Predicate2; diff --git a/gcc/testsuite/gnat.dg/predicate2_main.adb b/gcc/testsuite/gnat.dg/predicate2_main.adb new file mode 100644 index 0000000..3dc9528 --- /dev/null +++ b/gcc/testsuite/gnat.dg/predicate2_main.adb @@ -0,0 +1,10 @@ +-- { dg-do compile } + +with Predicate2.Project.Typ.Set; + +procedure Predicate2_Main is + Type_Def : Predicate2.Project.Typ.Object := Predicate2.Project.Typ.Undefined; + Types : Predicate2.Project.Typ.Set.Object; +begin + Type_Def := Types ("toto"); +end Predicate2_Main; -- cgit v1.1 From 9d9518668b8b908825b28697bf5e2a866ae00e8e Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Wed, 26 Sep 2018 09:18:58 +0000 Subject: [Ada] Add a No_Return annotation to ease static analysis 2018-09-26 Hristian Kirtchev gcc/ada/ * sem_ch5.adb (Wrap_Loop_Statement): Annotate as No_Return. From-SVN: r264627 --- gcc/ada/ChangeLog | 4 ++++ gcc/ada/sem_ch5.adb | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9731513..d6ce784 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2018-09-26 Hristian Kirtchev + + * sem_ch5.adb (Wrap_Loop_Statement): Annotate as No_Return. + 2018-09-26 Ed Schonberg * exp_util.adb (Make_Predicate_Call): Use OK_Convert_To when diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 8c1f949..1e325ec 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -3429,7 +3429,8 @@ package body Sem_Ch5 is -- for transformation if needed. procedure Wrap_Loop_Statement (Manage_Sec_Stack : Boolean); - pragma Inline (Wrap_Loop_Statement); + pragma Inline (Wrap_Loop_Statement); + pragma No_Return (Wrap_Loop_Statement); -- Wrap loop statement N within a block. Flag Manage_Sec_Stack must -- be set when the block must mark and release the secondary stack. -- cgit v1.1 From 2d9c4206c9d18b39f4d1c87ddbbda75238b7bf19 Mon Sep 17 00:00:00 2001 From: Javier Miranda Date: Wed, 26 Sep 2018 09:19:04 +0000 Subject: [Ada] Spurious error on interface conversion under ZFP The frontend reports an error under ZFP when performing the type conversion of a tagged object to one of its covered interface types. 2018-09-26 Javier Miranda gcc/ada/ * exp_disp.adb (Expand_Interface_Conversion): No displacement of the pointer needed when the type of the operand is an interface type that maches the target type and we are compiling under configurable runtime. Adding also documentation explaining why this cannot be done when compiling with the full runtime. * exp_intr.adb: Update comment. gcc/testsuite/ * gnat.dg/interface8.adb, gnat.dg/interface8.ads: New testcase. From-SVN: r264628 --- gcc/ada/ChangeLog | 9 +++++++++ gcc/ada/exp_disp.adb | 28 ++++++++++++++++++++++++++++ gcc/ada/exp_intr.adb | 5 ++++- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gnat.dg/interface8.adb | 9 +++++++++ gcc/testsuite/gnat.dg/interface8.ads | 11 +++++++++++ 6 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gnat.dg/interface8.adb create mode 100644 gcc/testsuite/gnat.dg/interface8.ads (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d6ce784..16855a7 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,12 @@ +2018-09-26 Javier Miranda + + * exp_disp.adb (Expand_Interface_Conversion): No displacement of + the pointer needed when the type of the operand is an interface + type that maches the target type and we are compiling under + configurable runtime. Adding also documentation explaining why + this cannot be done when compiling with the full runtime. + * exp_intr.adb: Update comment. + 2018-09-26 Hristian Kirtchev * sem_ch5.adb (Wrap_Loop_Statement): Annotate as No_Return. diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index cf7ce49..2169b67 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -1339,11 +1339,39 @@ package body Exp_Disp is Opnd := Designated_Type (Opnd); end if; + Opnd := Underlying_Record_Type (Opnd); + if not Is_Interface (Opnd) and then Is_Ancestor (Iface_Typ, Opnd, Use_Full_View => True) then return; end if; + + -- When the type of the operand and the target interface type match, + -- it is generally safe to skip generating code to displace the + -- pointer to the object to reference the secondary dispatch table + -- associated with the target interface type. The exception to this + -- general rule is when the underlying object of the type conversion + -- is an object built by means of a dispatching constructor (since in + -- such case the expansion of the constructor call is a direct call + -- to an object primitive, i.e. without thunks, and the expansion of + -- the constructor call adds an explicit conversion to the target + -- interface type to force the displacement of the pointer to the + -- object to reference the corresponding secondary dispatch table + -- (cf. Make_DT and Expand_Dispatching_Constructor_Call)). + + -- At this stage we cannot identify whether the underlying object is + -- a BIP object and hence we cannot skip generating the code to try + -- displacing the pointer to the object. However, under configurable + -- runtime it is safe to skip generating code to displace the pointer + -- to the object, because generic dispatching constructors are not + -- supported. + + if Opnd = Iface_Typ + and then not RTE_Available (RE_Displace) + then + return; + end if; end; -- Evaluate if we can statically displace the pointer to the object diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb index 73981fa..4f4584b 100644 --- a/gcc/ada/exp_intr.adb +++ b/gcc/ada/exp_intr.adb @@ -402,7 +402,10 @@ package body Exp_Intr is end if; -- Rewrite and analyze the call to the instance as a class-wide - -- conversion of the call to the actual constructor. + -- conversion of the call to the actual constructor. When the result + -- type is a class-wide interface type this conversion is required to + -- force the displacement of the pointer to the object to reference the + -- corresponding dispatch table. Rewrite (N, Convert_To (Result_Typ, Cnstr_Call)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e285be6..ccebb8a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-09-26 Javier Miranda + + * gnat.dg/interface8.adb, gnat.dg/interface8.ads: New testcase. + 2018-09-26 Ed Schonberg * gnat.dg/predicate2-containers.ads, diff --git a/gcc/testsuite/gnat.dg/interface8.adb b/gcc/testsuite/gnat.dg/interface8.adb new file mode 100644 index 0000000..5537ddb --- /dev/null +++ b/gcc/testsuite/gnat.dg/interface8.adb @@ -0,0 +1,9 @@ +-- { dg-do compile } + +package body Interface8 is + function Get_Iface (This : Child) return not null access Iface'Class + is + begin + return This.Interface_1; + end; +end; diff --git a/gcc/testsuite/gnat.dg/interface8.ads b/gcc/testsuite/gnat.dg/interface8.ads new file mode 100644 index 0000000..d67b375 --- /dev/null +++ b/gcc/testsuite/gnat.dg/interface8.ads @@ -0,0 +1,11 @@ +package Interface8 is + type Iface is interface; + + type Root is abstract tagged null record; + + type Child is new Root and Iface with record + Interface_1 : access Iface'Class; + end record; + + function Get_Iface (This : Child) return not null access Iface'Class; +end; -- cgit v1.1 From a30a69c1229cbf5270d2048299da5b9ae171e226 Mon Sep 17 00:00:00 2001 From: Yannick Moy Date: Wed, 26 Sep 2018 09:19:12 +0000 Subject: [Ada] Do not issue by default info messages for inlining in GNATprove Info messages about lack of inlining for analysis in GNATprove may be confusing to users. They are now only issued when GNATprove is called with switch --info, which it passes on to gnat2why with switch -gnatd_f. There is no effect on compilation. 2018-09-26 Yannick Moy gcc/ada/ * debug.adb: Add use for -gnatd_f switch. * inline.adb (Cannot_Inline): Only issue info message for failure to inline in GNATprove mode when switch -gnatd_f is used. From-SVN: r264629 --- gcc/ada/ChangeLog | 7 +++++++ gcc/ada/debug.adb | 7 ++++++- gcc/ada/inline.adb | 21 ++++++++++++++------- 3 files changed, 27 insertions(+), 8 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 16855a7..0ba717d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2018-09-26 Yannick Moy + + * debug.adb: Add use for -gnatd_f switch. + * inline.adb (Cannot_Inline): Only issue info message for + failure to inline in GNATprove mode when switch -gnatd_f is + used. + 2018-09-26 Javier Miranda * exp_disp.adb (Expand_Interface_Conversion): No displacement of diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index 95efede..65451a2 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -150,7 +150,7 @@ package body Debug is -- d_c -- d_d -- d_e Ignore entry calls and requeue statements for elaboration - -- d_f + -- d_f Issue info messages related to GNATprove usage -- d_g -- d_h -- d_i Ignore activations and calls to instances for elaboration @@ -831,6 +831,11 @@ package body Debug is -- control, conditional entry calls, timed entry calls, and requeue -- statements in both the static and dynamic elaboration models. + -- d_f Issue info messages related to GNATprove usage to help users + -- understand analysis results. By default these are not issued as + -- beginners find them confusing. Set automatically by GNATprove when + -- switch --info is used. + -- d_i The compiler ignores calls and task activations when they target a -- subprogram or task type defined in an external instance for both -- the static and dynamic elaboration models. diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 8f0b75d..72991fa 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -1607,13 +1607,16 @@ package body Inline is then null; - -- In GNATprove mode, issue a warning, and indicate that the - -- subprogram is not always inlined by setting flag Is_Inlined_Always - -- to False. + -- In GNATprove mode, issue a warning when -gnatd_f is set, and + -- indicate that the subprogram is not always inlined by setting + -- flag Is_Inlined_Always to False. elsif GNATprove_Mode then Set_Is_Inlined_Always (Subp, False); - Error_Msg_NE (Msg & "p?", N, Subp); + + if Debug_Flag_Underscore_F then + Error_Msg_NE (Msg & "p?", N, Subp); + end if; elsif Has_Pragma_Inline_Always (Subp) then @@ -1634,12 +1637,16 @@ package body Inline is Error_Msg_NE (Msg (Msg'First .. Msg'Last - 1), N, Subp); - -- In GNATprove mode, issue a warning, and indicate that the subprogram - -- is not always inlined by setting flag Is_Inlined_Always to False. + -- In GNATprove mode, issue a warning when -gnatd_f is set, and + -- indicate that the subprogram is not always inlined by setting + -- flag Is_Inlined_Always to False. elsif GNATprove_Mode then Set_Is_Inlined_Always (Subp, False); - Error_Msg_NE (Msg & "p?", N, Subp); + + if Debug_Flag_Underscore_F then + Error_Msg_NE (Msg & "p?", N, Subp); + end if; else -- cgit v1.1 From 1a409f80df7452dbcab228390a2de483bed5b875 Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Wed, 26 Sep 2018 09:19:28 +0000 Subject: [Ada] Spurious elaboration issue due to inlining This patch ensures that the full compilation context is captured prior to package or subprogram instantiation/inlining and restored after the action takes place. 2018-09-26 Hristian Kirtchev gcc/ada/ * sem_ch12.adb (Instantiate_Package_Body): Capture and restore the full compilation context. (Instantiate_Subprogram_Body): Capture and restore the full compilation context. gcc/testsuite/ * gnat.dg/elab7.adb, gnat.dg/elab7_pkg1.adb, gnat.dg/elab7_pkg1.ads, gnat.dg/elab7_pkg2.adb, gnat.dg/elab7_pkg2.ads: New testcase. From-SVN: r264630 --- gcc/ada/ChangeLog | 7 ++ gcc/ada/sem_ch12.adb | 133 +++++++++++++++++++++-------------- gcc/testsuite/ChangeLog | 6 ++ gcc/testsuite/gnat.dg/elab7.adb | 9 +++ gcc/testsuite/gnat.dg/elab7_pkg1.adb | 8 +++ gcc/testsuite/gnat.dg/elab7_pkg1.ads | 3 + gcc/testsuite/gnat.dg/elab7_pkg2.adb | 15 ++++ gcc/testsuite/gnat.dg/elab7_pkg2.ads | 5 ++ 8 files changed, 132 insertions(+), 54 deletions(-) create mode 100644 gcc/testsuite/gnat.dg/elab7.adb create mode 100644 gcc/testsuite/gnat.dg/elab7_pkg1.adb create mode 100644 gcc/testsuite/gnat.dg/elab7_pkg1.ads create mode 100644 gcc/testsuite/gnat.dg/elab7_pkg2.adb create mode 100644 gcc/testsuite/gnat.dg/elab7_pkg2.ads (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 0ba717d..80d119d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2018-09-26 Hristian Kirtchev + + * sem_ch12.adb (Instantiate_Package_Body): Capture and restore + the full compilation context. + (Instantiate_Subprogram_Body): Capture and restore the full + compilation context. + 2018-09-26 Yannick Moy * debug.adb: Add use for -gnatd_f switch. diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 391d1e3..5e04895 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -11202,10 +11202,6 @@ package body Sem_Ch12 is Gen_Decl : constant Node_Id := Unit_Declaration_Node (Gen_Unit); Loc : constant Source_Ptr := Sloc (Inst_Node); - Saved_ISMP : constant Boolean := - Ignore_SPARK_Mode_Pragmas_In_Instance; - Saved_Style_Check : constant Boolean := Style_Check; - procedure Check_Initialized_Types; -- In a generic package body, an entity of a generic private type may -- appear uninitialized. This is suspicious, unless the actual is a @@ -11276,20 +11272,30 @@ package body Sem_Ch12 is -- Local variables - Saved_GM : constant Ghost_Mode_Type := Ghost_Mode; - Saved_IGR : constant Node_Id := Ignored_Ghost_Region; - Saved_SM : constant SPARK_Mode_Type := SPARK_Mode; - Saved_SMP : constant Node_Id := SPARK_Mode_Pragma; - -- Save the Ghost and SPARK mode-related data to restore on exit + -- The following constants capture the context prior to instantiating + -- the package body. - Act_Body : Node_Id; - Act_Body_Id : Entity_Id; - Act_Body_Name : Node_Id; - Gen_Body : Node_Id; - Gen_Body_Id : Node_Id; - Par_Ent : Entity_Id := Empty; - Par_Vis : Boolean := False; - Parent_Installed : Boolean := False; + Saved_CS : constant Config_Switches_Type := Save_Config_Switches; + Saved_GM : constant Ghost_Mode_Type := Ghost_Mode; + Saved_IGR : constant Node_Id := Ignored_Ghost_Region; + Saved_ISMP : constant Boolean := + Ignore_SPARK_Mode_Pragmas_In_Instance; + Saved_LSST : constant Suppress_Stack_Entry_Ptr := + Local_Suppress_Stack_Top; + Saved_SC : constant Boolean := Style_Check; + Saved_SM : constant SPARK_Mode_Type := SPARK_Mode; + Saved_SMP : constant Node_Id := SPARK_Mode_Pragma; + Saved_SS : constant Suppress_Record := Scope_Suppress; + Saved_Warn : constant Warning_Record := Save_Warnings; + + Act_Body : Node_Id; + Act_Body_Id : Entity_Id; + Act_Body_Name : Node_Id; + Gen_Body : Node_Id; + Gen_Body_Id : Node_Id; + Par_Ent : Entity_Id := Empty; + Par_Installed : Boolean := False; + Par_Vis : Boolean := False; Vis_Prims_List : Elist_Id := No_Elist; -- List of primitives made temporarily visible in the instantiation @@ -11452,13 +11458,13 @@ package body Sem_Ch12 is Par_Ent := Entity (Prefix (Gen_Id)); Par_Vis := Is_Immediately_Visible (Par_Ent); Install_Parent (Par_Ent, In_Body => True); - Parent_Installed := True; + Par_Installed := True; elsif Is_Child_Unit (Gen_Unit) then Par_Ent := Scope (Gen_Unit); Par_Vis := Is_Immediately_Visible (Par_Ent); Install_Parent (Par_Ent, In_Body => True); - Parent_Installed := True; + Par_Installed := True; end if; -- If the instantiation is a library unit, and this is the main unit, @@ -11527,7 +11533,7 @@ package body Sem_Ch12 is -- Remove the parent instances if they have been placed on the scope -- stack to compile the body. - if Parent_Installed then + if Par_Installed then Remove_Parent (In_Body => True); -- Restore the previous visibility of the parent @@ -11599,13 +11605,21 @@ package body Sem_Ch12 is end if; end if; - Expander_Mode_Restore; - <> + + -- Restore the context that was in effect prior to instantiating the + -- package body. + Ignore_SPARK_Mode_Pragmas_In_Instance := Saved_ISMP; - Restore_Ghost_Region (Saved_GM, Saved_IGR); - Restore_SPARK_Mode (Saved_SM, Saved_SMP); - Style_Check := Saved_Style_Check; + Local_Suppress_Stack_Top := Saved_LSST; + Scope_Suppress := Saved_SS; + Style_Check := Saved_SC; + + Expander_Mode_Restore; + Restore_Config_Switches (Saved_CS); + Restore_Ghost_Region (Saved_GM, Saved_IGR); + Restore_SPARK_Mode (Saved_SM, Saved_SMP); + Restore_Warnings (Saved_Warn); end Instantiate_Package_Body; --------------------------------- @@ -11630,27 +11644,31 @@ package body Sem_Ch12 is Pack_Id : constant Entity_Id := Defining_Unit_Name (Parent (Act_Decl)); - Saved_GM : constant Ghost_Mode_Type := Ghost_Mode; - Saved_IGR : constant Node_Id := Ignored_Ghost_Region; - Saved_ISMP : constant Boolean := - Ignore_SPARK_Mode_Pragmas_In_Instance; - Saved_SM : constant SPARK_Mode_Type := SPARK_Mode; - Saved_SMP : constant Node_Id := SPARK_Mode_Pragma; - -- Save the Ghost and SPARK mode-related data to restore on exit - - Saved_Style_Check : constant Boolean := Style_Check; - Saved_Warnings : constant Warning_Record := Save_Warnings; + -- The following constants capture the context prior to instantiating + -- the subprogram body. - Act_Body : Node_Id; - Act_Body_Id : Entity_Id; - Gen_Body : Node_Id; - Gen_Body_Id : Node_Id; - Pack_Body : Node_Id; - Par_Ent : Entity_Id := Empty; - Par_Vis : Boolean := False; - Ret_Expr : Node_Id; - - Parent_Installed : Boolean := False; + Saved_CS : constant Config_Switches_Type := Save_Config_Switches; + Saved_GM : constant Ghost_Mode_Type := Ghost_Mode; + Saved_IGR : constant Node_Id := Ignored_Ghost_Region; + Saved_ISMP : constant Boolean := + Ignore_SPARK_Mode_Pragmas_In_Instance; + Saved_LSST : constant Suppress_Stack_Entry_Ptr := + Local_Suppress_Stack_Top; + Saved_SC : constant Boolean := Style_Check; + Saved_SM : constant SPARK_Mode_Type := SPARK_Mode; + Saved_SMP : constant Node_Id := SPARK_Mode_Pragma; + Saved_SS : constant Suppress_Record := Scope_Suppress; + Saved_Warn : constant Warning_Record := Save_Warnings; + + Act_Body : Node_Id; + Act_Body_Id : Entity_Id; + Gen_Body : Node_Id; + Gen_Body_Id : Node_Id; + Pack_Body : Node_Id; + Par_Ent : Entity_Id := Empty; + Par_Installed : Boolean := False; + Par_Vis : Boolean := False; + Ret_Expr : Node_Id; begin Gen_Body_Id := Corresponding_Body (Gen_Decl); @@ -11792,13 +11810,13 @@ package body Sem_Ch12 is Par_Ent := Entity (Prefix (Gen_Id)); Par_Vis := Is_Immediately_Visible (Par_Ent); Install_Parent (Par_Ent, In_Body => True); - Parent_Installed := True; + Par_Installed := True; elsif Is_Child_Unit (Gen_Unit) then Par_Ent := Scope (Gen_Unit); Par_Vis := Is_Immediately_Visible (Par_Ent); Install_Parent (Par_Ent, In_Body => True); - Parent_Installed := True; + Par_Installed := True; end if; -- Subprogram body is placed in the body of wrapper package, @@ -11843,7 +11861,7 @@ package body Sem_Ch12 is Restore_Private_Views (Pack_Id, False); - if Parent_Installed then + if Par_Installed then Remove_Parent (In_Body => True); -- Restore the previous visibility of the parent @@ -11852,7 +11870,6 @@ package body Sem_Ch12 is end if; Restore_Env; - Restore_Warnings (Saved_Warnings); -- Body not found. Error was emitted already. If there were no previous -- errors, this may be an instance whose scope is a premature instance. @@ -11923,13 +11940,21 @@ package body Sem_Ch12 is Analyze (Pack_Body); end if; - Expander_Mode_Restore; - <> + + -- Restore the context that was in effect prior to instantiating the + -- subprogram body. + Ignore_SPARK_Mode_Pragmas_In_Instance := Saved_ISMP; - Restore_Ghost_Region (Saved_GM, Saved_IGR); - Restore_SPARK_Mode (Saved_SM, Saved_SMP); - Style_Check := Saved_Style_Check; + Local_Suppress_Stack_Top := Saved_LSST; + Scope_Suppress := Saved_SS; + Style_Check := Saved_SC; + + Expander_Mode_Restore; + Restore_Config_Switches (Saved_CS); + Restore_Ghost_Region (Saved_GM, Saved_IGR); + Restore_SPARK_Mode (Saved_SM, Saved_SMP); + Restore_Warnings (Saved_Warn); end Instantiate_Subprogram_Body; ---------------------- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ccebb8a..cf904eb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Hristian Kirtchev + + * gnat.dg/elab7.adb, gnat.dg/elab7_pkg1.adb, + gnat.dg/elab7_pkg1.ads, gnat.dg/elab7_pkg2.adb, + gnat.dg/elab7_pkg2.ads: New testcase. + 2018-09-26 Javier Miranda * gnat.dg/interface8.adb, gnat.dg/interface8.ads: New testcase. diff --git a/gcc/testsuite/gnat.dg/elab7.adb b/gcc/testsuite/gnat.dg/elab7.adb new file mode 100644 index 0000000..b5b52f1 --- /dev/null +++ b/gcc/testsuite/gnat.dg/elab7.adb @@ -0,0 +1,9 @@ +-- { dg-do run } +-- { dg-options "-gnatE -gnatn" } + +with Elab7_Pkg1; + +procedure Elab7 is +begin + null; +end Elab7; diff --git a/gcc/testsuite/gnat.dg/elab7_pkg1.adb b/gcc/testsuite/gnat.dg/elab7_pkg1.adb new file mode 100644 index 0000000..e9af99f --- /dev/null +++ b/gcc/testsuite/gnat.dg/elab7_pkg1.adb @@ -0,0 +1,8 @@ +with Elab7_Pkg2; + +package body Elab7_Pkg1 is + procedure A is + begin + Elab7_Pkg2.A; + end A; +end Elab7_Pkg1; diff --git a/gcc/testsuite/gnat.dg/elab7_pkg1.ads b/gcc/testsuite/gnat.dg/elab7_pkg1.ads new file mode 100644 index 0000000..bb1db2c --- /dev/null +++ b/gcc/testsuite/gnat.dg/elab7_pkg1.ads @@ -0,0 +1,3 @@ +package Elab7_Pkg1 is + procedure A; +end Elab7_Pkg1; diff --git a/gcc/testsuite/gnat.dg/elab7_pkg2.adb b/gcc/testsuite/gnat.dg/elab7_pkg2.adb new file mode 100644 index 0000000..97a9ba6 --- /dev/null +++ b/gcc/testsuite/gnat.dg/elab7_pkg2.adb @@ -0,0 +1,15 @@ +with Elab7_Pkg1; + +package body Elab7_Pkg2 is + procedure From_Timerep is + Lf1 : Long_Float := 1.0; + Lf2 : Long_Float := Long_Float'Floor(Lf1); + begin + null; + end From_Timerep; + + procedure A is + begin + Elab7_Pkg1.A; + end A; +end Elab7_Pkg2; diff --git a/gcc/testsuite/gnat.dg/elab7_pkg2.ads b/gcc/testsuite/gnat.dg/elab7_pkg2.ads new file mode 100644 index 0000000..8eceb2c --- /dev/null +++ b/gcc/testsuite/gnat.dg/elab7_pkg2.ads @@ -0,0 +1,5 @@ +package Elab7_Pkg2 is + pragma Elaborate_Body; + + procedure A; +end Elab7_Pkg2; -- cgit v1.1 From 2d9a8c0ba10d03608aa2add8cf9f33053ab8c421 Mon Sep 17 00:00:00 2001 From: Maroua Maalej Date: Wed, 26 Sep 2018 09:19:33 +0000 Subject: [Ada] SPARK: fix a bug related to loop exit environment 2018-09-26 Maroua Maalej gcc/ada/ * sem_spark.adb (Check_Loop_Statement): Fix a bug related to loop exit environment. (Check_Statement): fixing a bug when comparing the source and target in an assignment statement. From-SVN: r264631 --- gcc/ada/ChangeLog | 7 +++++ gcc/ada/sem_spark.adb | 74 +++++++++++++++++++++++++++++++++++---------------- 2 files changed, 58 insertions(+), 23 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 80d119d..c8145cf 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2018-09-26 Maroua Maalej + + * sem_spark.adb (Check_Loop_Statement): Fix a bug related to + loop exit environment. + (Check_Statement): fixing a bug when comparing the source and + target in an assignment statement. + 2018-09-26 Hristian Kirtchev * sem_ch12.adb (Instantiate_Package_Body): Capture and restore diff --git a/gcc/ada/sem_spark.adb b/gcc/ada/sem_spark.adb index 920c3ff..9a22092 100644 --- a/gcc/ada/sem_spark.adb +++ b/gcc/ada/sem_spark.adb @@ -866,8 +866,17 @@ package body Sem_SPARK is Target_Ent : constant Entity_Id := Defining_Identifier (Decl); Target_Typ : Node_Id renames Etype (Target_Ent); - Check : Boolean := True; + + Target_View_Typ : Entity_Id; + + Check : Boolean := True; begin + if Present (Full_View (Target_Typ)) then + Target_View_Typ := Full_View (Target_Typ); + else + Target_View_Typ := Target_Typ; + end if; + case N_Declaration'(Nkind (Decl)) is when N_Full_Type_Declaration => if not Has_Ownership_Aspect_True (Target_Ent, "type declaration") @@ -878,7 +887,7 @@ package body Sem_SPARK is -- ??? What about component declarations with defaults. when N_Object_Declaration => - if (Is_Access_Type (Target_Typ) + if (Is_Access_Type (Target_View_Typ) or else Is_Deep (Target_Typ)) and then not Has_Ownership_Aspect_True (Target_Ent, "Object declaration ") @@ -886,7 +895,7 @@ package body Sem_SPARK is Check := False; end if; - if Is_Anonymous_Access_Type (Target_Typ) + if Is_Anonymous_Access_Type (Target_View_Typ) and then not Present (Expression (Decl)) then @@ -905,7 +914,7 @@ package body Sem_SPARK is -- Initializing object, access type - if Is_Access_Type (Target_Typ) then + if Is_Access_Type (Target_View_Typ) then -- Initializing object, constant access type @@ -913,7 +922,7 @@ package body Sem_SPARK is -- Initializing object, constant access to variable type - if not Is_Access_Constant (Target_Typ) then + if not Is_Access_Constant (Target_View_Typ) then Current_Checking_Mode := Borrow; -- Initializing object, constant access to constant type @@ -921,7 +930,7 @@ package body Sem_SPARK is -- Initializing object, -- constant access to constant anonymous type. - elsif Is_Anonymous_Access_Type (Target_Typ) then + elsif Is_Anonymous_Access_Type (Target_View_Typ) then -- This is an object declaration so the target -- of the assignement is a stand-alone object. @@ -943,12 +952,12 @@ package body Sem_SPARK is else -- Initializing object, variable access to variable type - if not Is_Access_Constant (Target_Typ) then + if not Is_Access_Constant (Target_View_Typ) then -- Initializing object, variable named access to -- variable type. - if not Is_Anonymous_Access_Type (Target_Typ) then + if not Is_Anonymous_Access_Type (Target_View_Typ) then Current_Checking_Mode := Move; -- Initializing object, variable anonymous access to @@ -968,7 +977,7 @@ package body Sem_SPARK is -- Initializing object, -- variable named access to constant type. - if not Is_Anonymous_Access_Type (Target_Typ) then + if not Is_Anonymous_Access_Type (Target_View_Typ) then Error_Msg_N ("assignment not allowed, Ownership " & "Aspect False (Anonymous Access " & "Object)", Decl); @@ -1201,6 +1210,7 @@ package body Sem_SPARK is Check_Node (Right_Opnd (Expr)); -- Forbid all deep expressions for Attribute ??? + -- What about generics? (formal parameters). when N_Attribute_Reference => case Attribute_Name (Expr) is @@ -1690,12 +1700,12 @@ package body Sem_SPARK is if Exit_Env /= null then Copy_Env (From => Exit_Env.all, To => Current_Perm_Env); + Free_Env (Loop_Env.all); + Free_Env (Exit_Env.all); else Copy_Env (From => Loop_Env.all, To => Current_Perm_Env); + Free_Env (Loop_Env.all); end if; - - Free_Env (Loop_Env.all); - Free_Env (Exit_Env.all); end; end Check_Loop_Statement; @@ -2247,7 +2257,8 @@ package body Sem_SPARK is -- Target /= source root if Nkind_In (Expression (Stmt), N_Allocator, N_Null) - or else St_Name /= Get_Root (Expression (Stmt)) + or else Entity (St_Name) /= + Entity (Get_Root (Expression (Stmt))) then Error_Msg_N ("assignment not allowed, anonymous " & "access Object with Different Root", @@ -2307,7 +2318,10 @@ package body Sem_SPARK is -- Assigning to composite (deep) type. elsif Is_Deep (Ty_St_Name) then - if Ekind (Ty_St_Name) = E_Record_Type then + if Ekind_In (Ty_St_Name, + E_Record_Type, + E_Record_Subtype) + then declare Elmt : Entity_Id := First_Component_Or_Discriminant (Ty_St_Name); @@ -2333,6 +2347,13 @@ package body Sem_SPARK is if Check then Current_Checking_Mode := Move; end if; + + elsif Ekind_In (Ty_St_Name, + E_Array_Type, + E_Array_Subtype) + and then Check + then + Current_Checking_Mode := Move; end if; -- Now handle legality rules of using a borrowed, observed, @@ -3399,7 +3420,7 @@ package body Sem_SPARK is if State_N = Moved then Error_Msg_N ("?the source or one of its extensions has" - & " already been moved", N); + & " already been moved", N); end if; declare @@ -4451,9 +4472,16 @@ package body Sem_SPARK is Mode : Formal_Kind; Global_Var : Boolean) is - Elem : Perm_Tree_Access; + Elem : Perm_Tree_Access; + View_Typ : Entity_Id; begin + if Present (Full_View (Etype (Id))) then + View_Typ := Full_View (Etype (Id)); + else + View_Typ := Etype (Id); + end if; + Elem := new Perm_Tree_Wrapper' (Tree => (Kind => Entire_Object, @@ -4481,16 +4509,16 @@ package body Sem_SPARK is -- a function, and a borrow operation for a procedure. if not Global_Var then - if (Is_Access_Type (Etype (Id)) - and then Is_Access_Constant (Etype (Id)) - and then Is_Anonymous_Access_Type (Etype (Id))) + if (Is_Access_Type (View_Typ) + and then Is_Access_Constant (View_Typ) + and then Is_Anonymous_Access_Type (View_Typ)) or else - (Is_Access_Type (Etype (Id)) + (Is_Access_Type (View_Typ) and then Ekind (Scope (Id)) = E_Function) or else - (not Is_Access_Type (Etype (Id)) - and then Is_Deep (Etype (Id)) - and then not Is_Anonymous_Access_Type (Etype (Id))) + (not Is_Access_Type (View_Typ) + and then Is_Deep (View_Typ) + and then not Is_Anonymous_Access_Type (View_Typ)) then Elem.all.Tree.Permission := Observed; Elem.all.Tree.Children_Permission := Observed; -- cgit v1.1 From 241848fd7ac69fd1ff0a17203d824c305a384137 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Wed, 26 Sep 2018 09:19:38 +0000 Subject: [Ada] Missing front-end code for constraint checks on fixed point exprs This patch ensures that the front-end generates constraint checks for some operations that previously depended on gigi for the corresponding check. The patch also resets the Do_Range_Check flag so that it never appears in the tree presented to gigi. 2018-09-26 Ed Schonberg gcc/ada/ * checks.adb (Apply_Type_Conversion_Checks): Do not generate a range check on the expression of the conversion if it involves a fixed-point type, as such conversions are handled specially during expansion. * exp_ch4.adb (Expand_N_Type_Conversion): In a conversion from Fixed to Integer, use the base type of the expression to ensure that the caller will generate the proper constraint check when needed. From-SVN: r264632 --- gcc/ada/ChangeLog | 11 +++++++++++ gcc/ada/checks.adb | 17 +++++++++++++++-- gcc/ada/exp_ch4.adb | 5 +++++ 3 files changed, 31 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c8145cf..8a9d9e1 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2018-09-26 Ed Schonberg + + * checks.adb (Apply_Type_Conversion_Checks): Do not generate a + range check on the expression of the conversion if it involves a + fixed-point type, as such conversions are handled specially + during expansion. + * exp_ch4.adb (Expand_N_Type_Conversion): In a conversion from + Fixed to Integer, use the base type of the expression to ensure + that the caller will generate the proper constraint check when + needed. + 2018-09-26 Maroua Maalej * sem_spark.adb (Check_Loop_Statement): Fix a bug related to diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 2e61e51..5cefbbd 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -3550,8 +3550,21 @@ package body Checks is Apply_Float_Conversion_Check (Expr, Target_Type); else - Apply_Scalar_Range_Check - (Expr, Target_Type, Fixed_Int => Conv_OK); + -- Conversions involving fixed-point types are expanded + -- separately, and do not need a Range_Check flag, except + -- in SPARK_Mode, where the explicit constraint check will + -- not be generated. + + if SPARK_Mode = On + or else (not Is_Fixed_Point_Type (Expr_Type) + and then not Is_Fixed_Point_Type (Target_Type)) + then + Apply_Scalar_Range_Check + (Expr, Target_Type, Fixed_Int => Conv_OK); + + else + Set_Do_Range_Check (Expression (N), False); + end if; -- If the target type has predicates, we need to indicate -- the need for a check, even if Determine_Range finds that diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 09a6cd0..a7aee9f 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -11694,6 +11694,11 @@ package body Exp_Ch4 is elsif Is_Integer_Type (Etype (N)) then Expand_Convert_Fixed_To_Integer (N); + -- The result of the conversion might need a range check, + -- so do not assume that the result is in bounds. + + Set_Etype (N, Base_Type (Target_Type)); + else pragma Assert (Is_Floating_Point_Type (Etype (N))); Expand_Convert_Fixed_To_Float (N); -- cgit v1.1 From 940cf4955f1dbe6ff07677967bfd7f6d00cba6db Mon Sep 17 00:00:00 2001 From: Yannick Moy Date: Wed, 26 Sep 2018 09:19:43 +0000 Subject: [Ada] Issue info message on inlined subprograms in GNATprove mode Issue a positive message that inlining was performed in GNATprove mode, when corresponding debug switch -gnatd_f is set. 2018-09-26 Yannick Moy gcc/ada/ * errout.ads: Update comment for insertion character '?'. * inline.adb: Use simple insertion character '?' for GNATprove info messages. * sem_res.adb (Resolve_Call): Issue an info message on inlining in GNATprove mode. From-SVN: r264633 --- gcc/ada/ChangeLog | 8 ++++++++ gcc/ada/errout.ads | 4 +++- gcc/ada/inline.adb | 4 ++-- gcc/ada/sem_res.adb | 8 +++++++- 4 files changed, 20 insertions(+), 4 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8a9d9e1..f8281bd 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2018-09-26 Yannick Moy + + * errout.ads: Update comment for insertion character '?'. + * inline.adb: Use simple insertion character '?' for GNATprove + info messages. + * sem_res.adb (Resolve_Call): Issue an info message on inlining + in GNATprove mode. + 2018-09-26 Ed Schonberg * checks.adb (Apply_Type_Conversion_Checks): Do not generate a diff --git a/gcc/ada/errout.ads b/gcc/ada/errout.ads index f7807a1..e052504 100644 --- a/gcc/ada/errout.ads +++ b/gcc/ada/errout.ads @@ -305,7 +305,9 @@ package Errout is -- Note: this usage is obsolete, use ?? ?*? ?$? ?x? ?X? to specify -- the string to be added when Warn_Doc_Switch is set to True. If this -- switch is True, then for simple ? messages it has no effect. This - -- simple form is to ease transition and will be removed later. + -- simple form is to ease transition and may be removed later except + -- for GNATprove-specific messages (info and warnings) which are not + -- subject to the same GNAT warning switches. -- Insertion character ?? (Two question marks: default warning) -- Like ?, but if the flag Warn_Doc_Switch is True, adds the string diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 72991fa..9dbc8ab 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -1615,7 +1615,7 @@ package body Inline is Set_Is_Inlined_Always (Subp, False); if Debug_Flag_Underscore_F then - Error_Msg_NE (Msg & "p?", N, Subp); + Error_Msg_NE (Msg, N, Subp); end if; elsif Has_Pragma_Inline_Always (Subp) then @@ -1645,7 +1645,7 @@ package body Inline is Set_Is_Inlined_Always (Subp, False); if Debug_Flag_Underscore_F then - Error_Msg_NE (Msg & "p?", N, Subp); + Error_Msg_NE (Msg, N, Subp); end if; else diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 6a3dfb7..800bf69 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -6842,9 +6842,15 @@ package body Sem_Res is ("cannot inline & (possible check on input parameters)?", N, Nam_UA); - -- Otherwise, inline the call + -- Otherwise, inline the call, issuing an info message when + -- -gnatd_f is set. else + if Debug_Flag_Underscore_F then + Error_Msg_NE + ("info: analyzing call to & in context?", N, Nam_UA); + end if; + Expand_Inlined_Call (N, Nam_UA, Nam); end if; end if; -- cgit v1.1 From cec0185c7e02aa52ffceddbf46a16a66ed47459c Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 26 Sep 2018 09:19:47 +0000 Subject: [Ada] Store -G xxx switches 2018-09-26 Arnaud Charlet gcc/ada/ * back_end.adb (Scan_Compiler_Arguments): Store -G xxx switches. From-SVN: r264634 --- gcc/ada/ChangeLog | 4 ++++ gcc/ada/back_end.adb | 25 ++++++++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f8281bd..5e0adf4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2018-09-26 Arnaud Charlet + + * back_end.adb (Scan_Compiler_Arguments): Store -G xxx switches. + 2018-09-26 Yannick Moy * errout.ads: Update comment for insertion character '?'. diff --git a/gcc/ada/back_end.adb b/gcc/ada/back_end.adb index 520a8b2..61ab718 100644 --- a/gcc/ada/back_end.adb +++ b/gcc/ada/back_end.adb @@ -210,6 +210,9 @@ package body Back_End is Next_Arg : Positive; -- Next argument to be scanned + Arg_Count : constant Natural := Natural (save_argc - 1); + Args : Argument_List (1 .. Arg_Count); + Output_File_Name_Seen : Boolean := False; -- Set to True after having scanned file_name for switch "-gnatO file" @@ -234,14 +237,27 @@ package body Back_End is Last : constant Natural := Switch_Last (Switch_Chars); begin - -- Skip -o, -G or internal GCC switches together with their argument. + -- Skip -o or internal GCC switches together with their argument. if Switch_Chars (First .. Last) = "o" - or else Switch_Chars (First .. Last) = "G" or else Is_Internal_GCC_Switch (Switch_Chars) then Next_Arg := Next_Arg + 1; + -- Store -G xxx as -Gxxx and go directly to the next argument. + + elsif Switch_Chars (First .. Last) = "G" then + Next_Arg := Next_Arg + 1; + + -- Should never get there with -G not followed by an argument, + -- but use defensive code nonetheless. + -- Store as -Gxxx to avoid storing parameters in ALI files that + -- might create confusion. + + if Next_Arg <= Args'Last then + Store_Compilation_Switch (Switch_Chars & Args (Next_Arg).all); + end if; + -- Do not record -quiet switch elsif Switch_Chars (First .. Last) = "quiet" then @@ -294,11 +310,6 @@ package body Back_End is end if; end Scan_Back_End_Switches; - -- Local variables - - Arg_Count : constant Natural := Natural (save_argc - 1); - Args : Argument_List (1 .. Arg_Count); - -- Start of processing for Scan_Compiler_Arguments begin -- cgit v1.1 From 0ebf09ed046391377af708ab2471403d3affdddd Mon Sep 17 00:00:00 2001 From: Justin Squirek Date: Wed, 26 Sep 2018 09:19:53 +0000 Subject: [Ada] Spurious ineffective use_clause warning This patch fixes an issue whereby user-defined subprograms used as generic actuals with corresponding formals containing other formal types led to spurious ineffective use_clause warnings. 2018-09-26 Justin Squirek gcc/ada/ * sem_ch8.adb (Analyze_Subprogram_Renaming): Add extra condition to check for unmarked subprogram references coming from renamings. gcc/testsuite/ * gnat.dg/warn16.adb: New testcase. From-SVN: r264635 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/sem_ch8.adb | 10 +++++++++- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gnat.dg/warn16.adb | 38 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gnat.dg/warn16.adb (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5e0adf4..f460963 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Justin Squirek + + * sem_ch8.adb (Analyze_Subprogram_Renaming): Add extra condition + to check for unmarked subprogram references coming from + renamings. + 2018-09-26 Arnaud Charlet * back_end.adb (Scan_Compiler_Arguments): Store -G xxx switches. diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index f538144..fb4dcb5 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -3692,8 +3692,16 @@ package body Sem_Ch8 is -- and mark any use_package_clauses that affect the visibility of the -- implicit generic actual. + -- Also, we may be looking at an internal renaming of a user-defined + -- subprogram created for a generic formal subprogram association, + -- which will also have to be marked here. This can occur when the + -- corresponding formal subprogram contains references to other generic + -- formals. + if Is_Generic_Actual_Subprogram (New_S) - and then (Is_Intrinsic_Subprogram (New_S) or else From_Default (N)) + and then (Is_Intrinsic_Subprogram (New_S) + or else From_Default (N) + or else Nkind (N) = N_Subprogram_Renaming_Declaration) then Mark_Use_Clauses (New_S); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cf904eb..be0c2c3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-09-26 Justin Squirek + + * gnat.dg/warn16.adb: New testcase. + 2018-09-26 Hristian Kirtchev * gnat.dg/elab7.adb, gnat.dg/elab7_pkg1.adb, diff --git a/gcc/testsuite/gnat.dg/warn16.adb b/gcc/testsuite/gnat.dg/warn16.adb new file mode 100644 index 0000000..cee84dd --- /dev/null +++ b/gcc/testsuite/gnat.dg/warn16.adb @@ -0,0 +1,38 @@ +-- { dg-do compile } +-- { dg-options "-gnatwa" } + +procedure Warn16 is + + package Define is + type Key_Type is record + Value : Integer := 0; + end record; + + function "=" (Left : in Key_Type; + Right : in Key_Type) + return Boolean; + end; + package body Define is + function "=" (Left : in Key_Type; + Right : in Key_Type) + return Boolean is + begin + return Left.Value = Right.Value; + end; + end; + + generic + type Key_Type is private; + with function "=" (Left : in Key_Type; + Right : in Key_Type) + return Boolean; + package Oper is end; + + use type Define.Key_Type; -- !!! + + package Inst is new Oper (Key_Type => Define.Key_Type, + "=" => "="); + pragma Unreferenced (Inst); +begin + null; +end; -- cgit v1.1 From def15641da84fb82adfeb946c6d714683148e6e3 Mon Sep 17 00:00:00 2001 From: Thomas Quinot Date: Wed, 26 Sep 2018 09:20:05 +0000 Subject: [Ada] Fix inheritance of representation items defined as aspects When a representation item is defined by a pragma or attribute definition clause, the entity it applies to is that of the Name of the representation item. But when it is defined by an aspect definition, the entity is directly denoted by the Entity attribute of the represenation item. The circuitry that inherits representation items for derived types or subtypes must account for these two possible cases. 2018-09-26 Thomas Quinot gcc/ada/ * sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): For a representation item that is an N_Aspect_Definition, retrieve the entity it applies to using the Entity attribute. gcc/testsuite/ * gnat.dg/sso13.adb: New testcase. From-SVN: r264636 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/sem_ch13.adb | 24 ++++++++++++++++++++++-- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gnat.dg/sso13.adb | 24 ++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gnat.dg/sso13.adb (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f460963..38354ec 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Thomas Quinot + + * sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): For a + representation item that is an N_Aspect_Definition, retrieve the + entity it applies to using the Entity attribute. + 2018-09-26 Justin Squirek * sem_ch8.adb (Analyze_Subprogram_Renaming): Add extra condition diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 00854c9..b999be6 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -11446,6 +11446,26 @@ package body Sem_Ch13 is -- specification node whose correponding pragma (if any) is present in -- the Rep Item chain of the entity it has been specified to. + function Rep_Item_Entity (Rep_Item : Node_Id) return Entity_Id; + -- Return the entity for which Rep_Item is specified + + --------------------- + -- Rep_Item_Entity -- + --------------------- + + function Rep_Item_Entity (Rep_Item : Node_Id) return Entity_Id is + begin + if Nkind (Rep_Item) = N_Aspect_Specification then + return Entity (Rep_Item); + + else + pragma Assert (Nkind_In (Rep_Item, + N_Pragma, + N_Attribute_Definition_Clause)); + return Entity (Name (Rep_Item)); + end if; + end Rep_Item_Entity; + -------------------------------------------------- -- Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item -- -------------------------------------------------- @@ -11650,8 +11670,8 @@ package body Sem_Ch13 is and then Has_Rep_Item (Typ, Name_Bit_Order) then Set_Reverse_Bit_Order (Bas_Typ, - Reverse_Bit_Order (Entity (Name - (Get_Rep_Item (Typ, Name_Bit_Order))))); + Reverse_Bit_Order (Rep_Item_Entity + (Get_Rep_Item (Typ, Name_Bit_Order)))); end if; end if; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index be0c2c3..c96126c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-09-26 Thomas Quinot + + * gnat.dg/sso13.adb: New testcase. + 2018-09-26 Justin Squirek * gnat.dg/warn16.adb: New testcase. diff --git a/gcc/testsuite/gnat.dg/sso13.adb b/gcc/testsuite/gnat.dg/sso13.adb new file mode 100644 index 0000000..26ef762 --- /dev/null +++ b/gcc/testsuite/gnat.dg/sso13.adb @@ -0,0 +1,24 @@ +-- { dg-do compile } + +with System; + +procedure SSO13 is + type Pulse_Buffer_Type is abstract tagged null record + with Bit_Order => System.High_Order_First, + Scalar_Storage_order =>System.High_order_First; -- { dg-warning "scalar storage order specified but no component clause" } + type Pulse_Train_Type is abstract new Pulse_Buffer_Type with null record; + type WO_Pulse_Train_Type is new Pulse_Train_Type with null record; + type WO_Confirmation_Pulse_Train_Type is new WO_Pulse_Train_Type with record + null; + end record; + + type Update_Dwell_Type is abstract tagged null record + with Bit_Order => System.High_Order_First, + Scalar_Storage_order =>System.High_order_First; -- { dg-warning "scalar storage order specified but no component clause" } + type Confirmation_Dwell_Type is new Update_Dwell_Type with + record + Pulses : aliased WO_Pulse_Train_Type; -- (Location of Error #1) + end record; +begin + null; +end; -- cgit v1.1 From 1899cb68445dfc4726b17f3db81df0f2a41cb916 Mon Sep 17 00:00:00 2001 From: Elisa Barboni Date: Wed, 26 Sep 2018 09:20:10 +0000 Subject: [Ada] SPARK: minor error message enhancement 2018-09-26 Elisa Barboni gcc/ada/ * sem_prag.adb (Check_Refined_Global_Item): Improve error message. From-SVN: r264637 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/sem_prag.adb | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 38354ec..a45e0b8 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-09-26 Elisa Barboni + + * sem_prag.adb (Check_Refined_Global_Item): Improve error + message. + 2018-09-26 Thomas Quinot * sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): For a diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index bc91411..7a71f53 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -27730,7 +27730,10 @@ package body Sem_Prag is -- it must be an extra (SPARK RM 7.2.4(3)). else - SPARK_Msg_NE ("extra global item &", Item, Item_Id); + pragma Assert (Present (Global)); + Error_Msg_Sloc := Sloc (Global); + SPARK_Msg_NE ("extra global item & does not refine or " & + "repeat any global item #", Item, Item_Id); end if; end if; end Check_Refined_Global_Item; -- cgit v1.1 From 3c010a2410189572541118dfa6d2c8ecb38d743e Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 26 Sep 2018 09:23:00 +0000 Subject: re PR c++/67655 ([concepts] expression constraints and variadic expansions) 2018-09-26 Paolo Carlini PR c++/67655 * g++.dg/concepts/pr67655.C: New. From-SVN: r264638 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/concepts/pr67655.C | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 gcc/testsuite/g++.dg/concepts/pr67655.C (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c96126c..903b8c7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-26 Paolo Carlini + + PR c++/67655 + * g++.dg/concepts/pr67655.C: New. + 2018-09-26 Thomas Quinot * gnat.dg/sso13.adb: New testcase. diff --git a/gcc/testsuite/g++.dg/concepts/pr67655.C b/gcc/testsuite/g++.dg/concepts/pr67655.C new file mode 100644 index 0000000..b155421 --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/pr67655.C @@ -0,0 +1,20 @@ +// { dg-do compile { target c++11 } } +// { dg-additional-options "-fconcepts" } + +template +void consume(Xs&&...) {} + +template + struct A { + template + requires requires(Ys... ys) { + consume(Xs{ys}...); + } + A(Ys&&... ys) { + } + A(int) {} +}; + +int main() { + A a(55); +} -- cgit v1.1 From 6fe0c58b9fe04b112586fe0ffecc18a24b313c50 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 26 Sep 2018 09:59:56 +0000 Subject: re PR c++/71131 ([concepts] Ill-formed code declaring a variable with a template concept not rejected) 2018-09-26 Paolo Carlini PR c++/71131 * g++.dg/concepts/pr71131.C: New. 2018-09-26 Paolo Carlini PR c++/71127 * g++.dg/concepts/pr71127.C: New. From-SVN: r264639 --- gcc/testsuite/ChangeLog | 10 ++++++++++ gcc/testsuite/g++.dg/concepts/pr71127.C | 6 ++++++ gcc/testsuite/g++.dg/concepts/pr71131.C | 6 ++++++ 3 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/g++.dg/concepts/pr71127.C create mode 100644 gcc/testsuite/g++.dg/concepts/pr71131.C (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 903b8c7..2533259 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,15 @@ 2018-09-26 Paolo Carlini + PR c++/71131 + * g++.dg/concepts/pr71131.C: New. + +2018-09-26 Paolo Carlini + + PR c++/71127 + * g++.dg/concepts/pr71127.C: New. + +2018-09-26 Paolo Carlini + PR c++/67655 * g++.dg/concepts/pr67655.C: New. diff --git a/gcc/testsuite/g++.dg/concepts/pr71127.C b/gcc/testsuite/g++.dg/concepts/pr71127.C new file mode 100644 index 0000000..3ec6514 --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/pr71127.C @@ -0,0 +1,6 @@ +// { dg-do compile { target c++14 } } +// { dg-additional-options "-fconcepts" } + +template class T> +concept bool C = T::value; +C c = 1; // { dg-error "invalid reference to concept" } diff --git a/gcc/testsuite/g++.dg/concepts/pr71131.C b/gcc/testsuite/g++.dg/concepts/pr71131.C new file mode 100644 index 0000000..02f1999 --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/pr71131.C @@ -0,0 +1,6 @@ +// { dg-do compile { target c++14 } } +// { dg-additional-options "-fconcepts" } + +template class T> +concept bool C = true; +C c = 1; // { dg-error "invalid reference to concept" } -- cgit v1.1 From ce6f08888905bb217b9a4cff8a0704e240ec5c46 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Wed, 26 Sep 2018 13:58:18 +0200 Subject: [PR 87347] Prevent segfaults if TYPE_ARG_TYPES is NULL 2018-09-26 Martin Jambor PR c/87347 c/ * c-parser.c (warn_for_abs): Bail out if TYPE_ARG_TYPES is NULL. Fix comment. testsuite/ * gcc.dg/pr87347.c: New test. From-SVN: r264640 --- gcc/c/ChangeLog | 6 ++++++ gcc/c/c-parser.c | 7 +++++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr87347.c | 6 ++++++ 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr87347.c (limited to 'gcc') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 6fd76cf..1ea87b9 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Martin Jambor + + PR c/87347 + * c-parser.c (warn_for_abs): Bail out if TYPE_ARG_TYPES is NULL. Fix + comment. + 2018-09-17 David Malcolm * c-objc-common.c (range_label_for_type_mismatch::get_text): diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 1766a25..1f173fc 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -9102,8 +9102,8 @@ sizeof_ptr_memacc_comptypes (tree type1, tree type2) } /* Warn for patterns where abs-like function appears to be used incorrectly, - gracely ignore any non-abs-like function. The warning location should be - LOC. FNDECL is the declaration of called function, it must be a + gracefully ignore any non-abs-like function. The warning location should + be LOC. FNDECL is the declaration of called function, it must be a BUILT_IN_NORMAL function. ARG is the first and only argument of the call. */ @@ -9223,6 +9223,9 @@ warn_for_abs (location_t loc, tree fndecl, tree arg) return; } + if (!TYPE_ARG_TYPES (TREE_TYPE (fndecl))) + return; + tree ftype = TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (fndecl))); if (TREE_CODE (atype) == COMPLEX_TYPE) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2533259..49df3a1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-26 Martin Jambor + + PR c/87347 + * gcc.dg/pr87347.c: New test. + 2018-09-26 Paolo Carlini PR c++/71131 diff --git a/gcc/testsuite/gcc.dg/pr87347.c b/gcc/testsuite/gcc.dg/pr87347.c new file mode 100644 index 0000000..d0bdf2a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr87347.c @@ -0,0 +1,6 @@ +/* {dg-do compile} */ +/* { dg-options "-Wabsolute-value" } */ + +int a; +int abs(); +void b() { abs(a); } -- cgit v1.1 From 9b4e3b9a661e6316b0fe2a966347fc8e9c39d552 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 26 Sep 2018 14:09:03 +0000 Subject: graphite.h: Include and ... * graphite.h: Include and ; these headers are no longer pulled in by . From-SVN: r264642 --- gcc/ChangeLog | 5 +++++ gcc/graphite.h | 2 ++ 2 files changed, 7 insertions(+) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2eeacef..1531c39 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-09-26 Alexey Neyman + + * graphite.h: Include and ; these + headers are no longer pulled in by . + 2018-09-26 Matthew Malcomson * config/arm/arm.c (arm_split_compare_and_swap, arm_split_atomic_op): diff --git a/gcc/graphite.h b/gcc/graphite.h index be0a22b..8db5700 100644 --- a/gcc/graphite.h +++ b/gcc/graphite.h @@ -26,6 +26,8 @@ along with GCC; see the file COPYING3. If not see #include #include #include +#include +#include #include #include #include -- cgit v1.1 From 39aae6036286c24bdb1d7dd49ccd588f93e8cb8f Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 26 Sep 2018 14:35:48 +0000 Subject: re PR debug/87443 (GCC mixes abstract and concrete instances in abstract origins for inlines) 2018-09-26 Richard Biener PR debug/87443 * dwarf2out.c (gen_lexical_block_die): Do not equate inline or concrete instance DIE to the tree. Create abstract origin attributes also for concrete instances. * gcc.dg/debug/dwarf2/inline5.c: New testcase. From-SVN: r264643 --- gcc/ChangeLog | 7 +++++++ gcc/dwarf2out.c | 14 ++++++-------- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c | 26 ++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1531c39..a9e2769 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-09-26 Richard Biener + + PR debug/87443 + * dwarf2out.c (gen_lexical_block_die): Do not equate inline + or concrete instance DIE to the tree. Create abstract origin + attributes also for concrete instances. + 2018-09-26 Alexey Neyman * graphite.h: Include and ; these diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 3c10ec8..b0c5c4f 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -24091,18 +24091,16 @@ gen_lexical_block_die (tree stmt, dw_die_ref context_die) } else if (BLOCK_ABSTRACT_ORIGIN (stmt)) { - /* If this is an inlined instance, create a new lexical die for - anything below to attach DW_AT_abstract_origin to. */ + /* If this is an inlined or conrecte instance, create a new lexical + die for anything below to attach DW_AT_abstract_origin to. */ if (old_die) - { - stmt_die = new_die (DW_TAG_lexical_block, context_die, stmt); - equate_block_to_die (stmt, stmt_die); - old_die = NULL; - } + stmt_die = new_die (DW_TAG_lexical_block, context_die, stmt); tree origin = block_ultimate_origin (stmt); - if (origin != NULL_TREE && origin != stmt) + if (origin != NULL_TREE && (origin != stmt || old_die)) add_abstract_origin_attribute (stmt_die, origin); + + old_die = NULL; } if (old_die) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 49df3a1..aa005e7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-26 Richard Biener + + PR debug/87443 + * gcc.dg/debug/dwarf2/inline5.c: New testcase. + 2018-09-26 Martin Jambor PR c/87347 diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c b/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c new file mode 100644 index 0000000..4f4463b --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c @@ -0,0 +1,26 @@ +/* Verify that the concrete instance DW_TAG_lexical_block has an abstract + origin. Verify that the inline instance has the abstract instance as + abstract origin rather than the concrete one. */ +/* { dg-options "-O -gdwarf -dA" } */ +/* { dg-do compile } */ +/* { dg-final { scan-assembler-times "DW_TAG_inlined_subroutine" 2 } } */ +/* { dg-final { scan-assembler-times "DW_TAG_lexical_block\\)\[^#\]*# DW_AT_abstract_origin" 2 } } */ +/* { dg-final { scan-assembler-times "DW_TAG_lexical_block\\)\[^#\]*# \\(DIE \\(0x\[0-9a-f\]*\\) DW_TAG_variable" 1 } } */ +/* We do not know which is output first so look for both invalid abstract + origins on the lexical blocks (knowing that the abstract instance has + no attribute following the DW_TAG_lexical_block. */ +/* { dg-final { scan-assembler-not "\\(DIE \\(0x(\[0-9a-f\]*)\\) DW_TAG_lexical_block\\)\[^#\]*# \[^(\].*DW_TAG_lexical_block\\)\[^#x\]*x\\1\[^#\]*# DW_AT_abstract_origin" } } */ +/* { dg-final { scan-assembler-not "DW_TAG_lexical_block\\)\[^#x\]*x(\[0-9a-f\]*)\[^#\]*# DW_AT_abstract_origin.*\\(DIE \\(0x\\1\\) DW_TAG_lexical_block\\)\[^#\]*# DW_AT" } } */ + +int foo (int i) +{ + { + volatile int j = i + 3; + return j - 2; + } +} +int main() +{ + volatile int z = foo (-1); + return z; +} -- cgit v1.1 From 8caf8f777ce3af591cc4c8b1c759456c47a21a75 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 26 Sep 2018 08:50:03 -0600 Subject: Revert 2018-09-26 Alexey Neyman * graphite.h: Include and ; these headers are no longer pulled in by . From-SVN: r264644 --- gcc/ChangeLog | 8 ++++++++ gcc/graphite.h | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a9e2769..cef86bc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-09-26 Jeff Law + + Revert + 2018-09-26 Alexey Neyman + + * graphite.h: Include and ; these + headers are no longer pulled in by . + 2018-09-26 Richard Biener PR debug/87443 diff --git a/gcc/graphite.h b/gcc/graphite.h index 8db5700..be0a22b 100644 --- a/gcc/graphite.h +++ b/gcc/graphite.h @@ -26,8 +26,6 @@ along with GCC; see the file COPYING3. If not see #include #include #include -#include -#include #include #include #include -- cgit v1.1 From 8c097065b4e0f67b65cbddb4add8f143ac10517f Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 26 Sep 2018 16:55:59 +0200 Subject: re PR target/87439 (ICE in ix86_mode_needed, at config/i386/i386.c:18907) PR target/87439 * config/i386/i386.h (NUM_MODES_FOR_MODE_SWITCHING): Update for removed I387_MASK_PM entity. From-SVN: r264645 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cef86bc..2f17a0a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Uros Bizjak + + PR target/87439 + * config/i386/i386.h (NUM_MODES_FOR_MODE_SWITCHING): Update + for removed I387_MASK_PM entity. + 2018-09-26 Jeff Law Revert diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index b68fc80..f96f864 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2499,7 +2499,7 @@ enum avx_u128_state #define NUM_MODES_FOR_MODE_SWITCHING \ { X86_DIRFLAG_ANY, AVX_U128_ANY, \ - I387_CW_ANY, I387_CW_ANY, I387_CW_ANY, I387_CW_ANY } + I387_CW_ANY, I387_CW_ANY, I387_CW_ANY } /* Avoid renaming of stack registers, as doing so in combination with -- cgit v1.1 From 6693898454936b07c7e003de872149b4201e940c Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 26 Sep 2018 17:00:00 +0200 Subject: * ChangeLog: Add missing PR number. From-SVN: r264646 --- gcc/ChangeLog | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2f17a0a..42efc42 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -116,6 +116,7 @@ 2018-09-25 Uros Bizjak + PR target/71278 * config/i386/i386.md (frndintxf2_mask_pm): Remove. (frndintxf2_mask_pm_i387): Ditto. (nearbyintxf2): Rewrite expander pattern to match rintxf2. -- cgit v1.1 From dd554b787d0280566e891dba9e19dd718e68d42a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 26 Sep 2018 15:17:30 +0000 Subject: syscall: don't assume we have a GETEUID system call On Alpha GNU/Linux there is no geteuid system call, there is only getresuid. The raw geteuid system call is only used for testing, so just skip the test if it's not available. Reviewed-on: https://go-review.googlesource.com/137655 From-SVN: r264647 --- gcc/go/gofrontend/MERGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index c306628..8cb370f 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -e7b98cf0a380eb45791cd5c52897224a686dcdec +944784a93cf89d3a238e5607c993ea5f18f99c12 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. -- cgit v1.1 From 2202b162bbb3f0e300db716c67f67e8c2e4a92c0 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 26 Sep 2018 17:17:32 +0200 Subject: i386.h (enum reg_class): Remove FP_TOP_SSE_REGS and FP_SECOND_SSE_REGS. * config/i386/i386.h (enum reg_class): Remove FP_TOP_SSE_REGS and FP_SECOND_SSE_REGS. (REG_CLASS_NAMES): Ditto. (REG_CLASS_CONTENTS): Ditto. * config/i386/i386.c (ix86_preferred_reload_class) Do not handle FP_TOP_SSE_REGS and FP_SECOND_SSE_REGS classes. (ix86_preferred_output_reload_class): Ditto. * config/i386/i386.md (fix_trunc_i387_fisttp): Change "=&1f" clobber constraint to "=&f". (fix_truncdi_i387): Ditto. (lrintxfdi2): Ditto. (fistdi2_): Ditto. (fpremxf4_i387): Change "=u" constraint to "=f". (fprem1xf4_i387): Ditto. (sincosxf3): Ditto. (fptanxf4_i387): Ditto. (fxtractxf3_i387): Ditto. (fscalexf4_i387): Ditto. (atan2xf3): Change "u" constraint to "f". (fyl2xxf3_i387): Ditto. (fyl2xp1xf3_i387): Ditto. From-SVN: r264648 --- gcc/ChangeLog | 24 ++++++++++++++++++++++++ gcc/config/i386/i386.c | 13 +------------ gcc/config/i386/i386.h | 6 ------ gcc/config/i386/i386.md | 26 +++++++++++++------------- 4 files changed, 38 insertions(+), 31 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 42efc42..134362e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,29 @@ 2018-09-26 Uros Bizjak + * config/i386/i386.h (enum reg_class): Remove FP_TOP_SSE_REGS + and FP_SECOND_SSE_REGS. + (REG_CLASS_NAMES): Ditto. + (REG_CLASS_CONTENTS): Ditto. + * config/i386/i386.c (ix86_preferred_reload_class) Do not handle + FP_TOP_SSE_REGS and FP_SECOND_SSE_REGS classes. + (ix86_preferred_output_reload_class): Ditto. + * config/i386/i386.md (fix_trunc_i387_fisttp): Change "=&1f" + clobber constraint to "=&f". + (fix_truncdi_i387): Ditto. + (lrintxfdi2): Ditto. + (fistdi2_): Ditto. + (fpremxf4_i387): Change "=u" constraint to "=f". + (fprem1xf4_i387): Ditto. + (sincosxf3): Ditto. + (fptanxf4_i387): Ditto. + (fxtractxf3_i387): Ditto. + (fscalexf4_i387): Ditto. + (atan2xf3): Change "u" constraint to "f". + (fyl2xxf3_i387): Ditto. + (fyl2xp1xf3_i387): Ditto. + +2018-09-26 Uros Bizjak + PR target/87439 * config/i386/i386.h (NUM_MODES_FOR_MODE_SWITCHING): Update for removed I387_MASK_PM entity. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 6c7da3d..a79cfb5 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -39043,10 +39043,6 @@ ix86_preferred_reload_class (rtx x, reg_class_t regclass) /* Limit class to FP regs. */ if (FLOAT_CLASS_P (regclass)) return FLOAT_REGS; - else if (regclass == FP_TOP_SSE_REGS) - return FP_TOP_REG; - else if (regclass == FP_SECOND_SSE_REGS) - return FP_SECOND_REG; } return NO_REGS; @@ -39092,14 +39088,7 @@ ix86_preferred_output_reload_class (rtx x, reg_class_t regclass) return MAYBE_SSE_CLASS_P (regclass) ? ALL_SSE_REGS : NO_REGS; if (IS_STACK_MODE (mode)) - { - if (regclass == FP_TOP_SSE_REGS) - return FP_TOP_REG; - else if (regclass == FP_SECOND_SSE_REGS) - return FP_SECOND_REG; - else - return FLOAT_CLASS_P (regclass) ? regclass : NO_REGS; - } + return FLOAT_CLASS_P (regclass) ? regclass : NO_REGS; return regclass; } diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index f96f864..6445ee5 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1337,8 +1337,6 @@ enum reg_class SSE_REGS, ALL_SSE_REGS, MMX_REGS, - FP_TOP_SSE_REGS, - FP_SECOND_SSE_REGS, FLOAT_SSE_REGS, FLOAT_INT_REGS, INT_SSE_REGS, @@ -1398,8 +1396,6 @@ enum reg_class "SSE_REGS", \ "ALL_SSE_REGS", \ "MMX_REGS", \ - "FP_TOP_SSE_REGS", \ - "FP_SECOND_SSE_REGS", \ "FLOAT_SSE_REGS", \ "FLOAT_INT_REGS", \ "INT_SSE_REGS", \ @@ -1438,8 +1434,6 @@ enum reg_class { 0x1fe00000, 0x1fe000, 0x0 }, /* SSE_REGS */ \ { 0x1fe00000, 0xffffe000, 0x1f }, /* ALL_SSE_REGS */ \ { 0xe0000000, 0x1f, 0x0 }, /* MMX_REGS */ \ -{ 0x1fe00100, 0xffffe000, 0x1f }, /* FP_TOP_SSE_REG */ \ -{ 0x1fe00200, 0xffffe000, 0x1f }, /* FP_SECOND_SSE_REG */ \ { 0x1fe0ff00, 0xffffe000, 0x1f }, /* FLOAT_SSE_REGS */ \ { 0x11ffff, 0x1fe0, 0x0 }, /* FLOAT_INT_REGS */ \ { 0x1ff100ff, 0xffffffe0, 0x1f }, /* INT_SSE_REGS */ \ diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index fc5cfd0..86f2c03 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -4973,7 +4973,7 @@ (define_insn "fix_trunc_i387_fisttp" [(set (match_operand:SWI248x 0 "nonimmediate_operand" "=m") (fix:SWI248x (match_operand 1 "register_operand" "f"))) - (clobber (match_scratch:XF 2 "=&1f"))] + (clobber (match_scratch:XF 2 "=&f"))] "X87_FLOAT_MODE_P (GET_MODE (operands[1])) && TARGET_FISTTP && !((SSE_FLOAT_MODE_P (GET_MODE (operands[1])) @@ -5019,7 +5019,7 @@ (fix:DI (match_operand 1 "register_operand" "f"))) (use (match_operand:HI 2 "memory_operand" "m")) (use (match_operand:HI 3 "memory_operand" "m")) - (clobber (match_scratch:XF 4 "=&1f"))] + (clobber (match_scratch:XF 4 "=&f"))] "X87_FLOAT_MODE_P (GET_MODE (operands[1])) && !TARGET_FISTTP && !(TARGET_64BIT && SSE_FLOAT_MODE_P (GET_MODE (operands[1])))" @@ -15178,7 +15178,7 @@ (unspec:XF [(match_operand:XF 2 "register_operand" "0") (match_operand:XF 3 "register_operand" "1")] UNSPEC_FPREM_F)) - (set (match_operand:XF 1 "register_operand" "=u") + (set (match_operand:XF 1 "register_operand" "=f") (unspec:XF [(match_dup 2) (match_dup 3)] UNSPEC_FPREM_U)) (set (reg:CCFP FPSR_REG) @@ -15253,7 +15253,7 @@ (unspec:XF [(match_operand:XF 2 "register_operand" "0") (match_operand:XF 3 "register_operand" "1")] UNSPEC_FPREM1_F)) - (set (match_operand:XF 1 "register_operand" "=u") + (set (match_operand:XF 1 "register_operand" "=f") (unspec:XF [(match_dup 2) (match_dup 3)] UNSPEC_FPREM1_U)) (set (reg:CCFP FPSR_REG) @@ -15365,7 +15365,7 @@ [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 2 "register_operand" "0")] UNSPEC_SINCOS_COS)) - (set (match_operand:XF 1 "register_operand" "=u") + (set (match_operand:XF 1 "register_operand" "=f") (unspec:XF [(match_dup 2)] UNSPEC_SINCOS_SIN))] "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" @@ -15397,7 +15397,7 @@ (define_insn "fptanxf4_i387" [(set (match_operand:SF 0 "register_operand" "=f") (match_operand:SF 3 "const1_operand")) - (set (match_operand:XF 1 "register_operand" "=u") + (set (match_operand:XF 1 "register_operand" "=f") (unspec:XF [(match_operand:XF 2 "register_operand" "0")] UNSPEC_TAN))] "TARGET_USE_FANCY_MATH_387 @@ -15439,7 +15439,7 @@ (define_insn "atan2xf3" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 1 "register_operand" "0") - (match_operand:XF 2 "register_operand" "u")] + (match_operand:XF 2 "register_operand" "f")] UNSPEC_FPATAN)) (clobber (match_scratch:XF 3 "=2"))] "TARGET_USE_FANCY_MATH_387 @@ -15576,7 +15576,7 @@ (define_insn "fyl2xxf3_i387" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 1 "register_operand" "0") - (match_operand:XF 2 "register_operand" "u")] + (match_operand:XF 2 "register_operand" "f")] UNSPEC_FYL2X)) (clobber (match_scratch:XF 3 "=2"))] "TARGET_USE_FANCY_MATH_387 @@ -15673,7 +15673,7 @@ (define_insn "fyl2xp1xf3_i387" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 1 "register_operand" "0") - (match_operand:XF 2 "register_operand" "u")] + (match_operand:XF 2 "register_operand" "f")] UNSPEC_FYL2XP1)) (clobber (match_scratch:XF 3 "=2"))] "TARGET_USE_FANCY_MATH_387 @@ -15714,7 +15714,7 @@ [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 2 "register_operand" "0")] UNSPEC_XTRACT_FRACT)) - (set (match_operand:XF 1 "register_operand" "=u") + (set (match_operand:XF 1 "register_operand" "=f") (unspec:XF [(match_dup 2)] UNSPEC_XTRACT_EXP))] "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" @@ -15808,7 +15808,7 @@ (unspec:XF [(match_operand:XF 2 "register_operand" "0") (match_operand:XF 3 "register_operand" "1")] UNSPEC_FSCALE_FRACT)) - (set (match_operand:XF 1 "register_operand" "=u") + (set (match_operand:XF 1 "register_operand" "=f") (unspec:XF [(match_dup 2) (match_dup 3)] UNSPEC_FSCALE_EXP))] "TARGET_USE_FANCY_MATH_387 @@ -16193,7 +16193,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=m") (unspec:DI [(match_operand:XF 1 "register_operand" "f")] UNSPEC_FIST)) - (clobber (match_scratch:XF 2 "=&1f"))] + (clobber (match_scratch:XF 2 "=&f"))] "TARGET_USE_FANCY_MATH_387" "* return output_fix_trunc (insn, operands, false);" [(set_attr "type" "fpspc") @@ -16404,7 +16404,7 @@ FIST_ROUNDING)) (use (match_operand:HI 2 "memory_operand" "m")) (use (match_operand:HI 3 "memory_operand" "m")) - (clobber (match_scratch:XF 4 "=&1f"))] + (clobber (match_scratch:XF 4 "=&f"))] "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" "* return output_fix_trunc (insn, operands, false);" -- cgit v1.1 From 1413a4190f3cd17225841f1c0e2bb7842dd6c507 Mon Sep 17 00:00:00 2001 From: Andrew Stubbs Date: Wed, 26 Sep 2018 15:59:13 +0000 Subject: Fix AArch64 ILP32 ICE. Ensure that the address really is the correct mode for an address. 2018-09-25 Andrew Stubbs gcc/ * builtins.c (get_builtin_sync_mem): Force address mode conversion. From-SVN: r264650 --- gcc/ChangeLog | 4 ++++ gcc/builtins.c | 1 + 2 files changed, 5 insertions(+) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 134362e..c775327 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2018-09-25 Andrew Stubbs + + * builtins.c (get_builtin_sync_mem): Force address mode conversion. + 2018-09-26 Uros Bizjak * config/i386/i386.h (enum reg_class): Remove FP_TOP_SSE_REGS diff --git a/gcc/builtins.c b/gcc/builtins.c index 5f00208..e655623 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -5850,6 +5850,7 @@ get_builtin_sync_mem (tree loc, machine_mode mode) scalar_int_mode addr_mode = targetm.addr_space.address_mode (addr_space); addr = expand_expr (loc, NULL_RTX, addr_mode, EXPAND_SUM); + addr = convert_memory_address (addr_mode, addr); /* Note that we explicitly do not want any alias information for this memory, so that we kill all other live memories. Otherwise we don't -- cgit v1.1 From 0974b794c104f403c335a7e6b2376b487ab17659 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 26 Sep 2018 19:00:49 +0200 Subject: re PR target/87414 (-mindirect-branch=thunk produces thunk with incorrect CFI on x86_64) PR target/87414 * config/i386/i386.c: Include debug.h and dwarf2out.h. (output_indirect_thunk): Emit DW_CFA_def_cfa_offset after the call. From-SVN: r264651 --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/i386.c | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c775327..e134f91 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-09-26 Jakub Jelinek + + PR target/87414 + * config/i386/i386.c: Include debug.h and dwarf2out.h. + (output_indirect_thunk): Emit DW_CFA_def_cfa_offset after the + call. + 2018-09-25 Andrew Stubbs * builtins.c (get_builtin_sync_mem): Force address mode conversion. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a79cfb5..ef72219 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -89,6 +89,8 @@ along with GCC; see the file COPYING3. If not see #include "ipa-fnsummary.h" #include "wide-int-bitmask.h" #include "tree-vector-builder.h" +#include "debug.h" +#include "dwarf2out.h" /* This file should be included last. */ #include "target-def.h" @@ -10470,6 +10472,23 @@ output_indirect_thunk (unsigned int regno) ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, indirectlabel2); + /* The above call insn pushed a word to stack. Adjust CFI info. */ + if (flag_asynchronous_unwind_tables && dwarf2out_do_frame ()) + { + if (! dwarf2out_do_cfi_asm ()) + { + dw_cfi_ref xcfi = ggc_cleared_alloc (); + xcfi->dw_cfi_opc = DW_CFA_advance_loc4; + xcfi->dw_cfi_oprnd1.dw_cfi_addr = ggc_strdup (indirectlabel2); + vec_safe_push (cfun->fde->dw_fde_cfi, xcfi); + } + dw_cfi_ref xcfi = ggc_cleared_alloc (); + xcfi->dw_cfi_opc = DW_CFA_def_cfa_offset; + xcfi->dw_cfi_oprnd1.dw_cfi_offset = 2 * UNITS_PER_WORD; + vec_safe_push (cfun->fde->dw_fde_cfi, xcfi); + dwarf2out_emit_cfi (xcfi); + } + if (regno != INVALID_REGNUM) { /* MOV. */ -- cgit v1.1 From 1fb157ccb58a56edae02542d2bb3f1f30e5f63d1 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Wed, 26 Sep 2018 18:42:19 +0000 Subject: RISC-V: Delete obsolete MIPS comment. gcc/ * config/riscv/riscv.h (FUNCTION_ARG_REGNO_P): Fix comment. From-SVN: r264652 --- gcc/ChangeLog | 4 ++++ gcc/config/riscv/riscv.h | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e134f91..49ff24c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2018-09-26 Jim Wilson + + * config/riscv/riscv.h (FUNCTION_ARG_REGNO_P): Fix comment. + 2018-09-26 Jakub Jelinek PR target/87414 diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h index 4bbb491..3c9f96d 100644 --- a/gcc/config/riscv/riscv.h +++ b/gcc/config/riscv/riscv.h @@ -516,8 +516,7 @@ enum reg_class #define FUNCTION_VALUE_REGNO_P(N) ((N) == GP_RETURN || (N) == FP_RETURN) /* 1 if N is a possible register number for function argument passing. - We have no FP argument registers when soft-float. When FP registers - are 32 bits, we can't directly reference the odd numbered ones. */ + We have no FP argument registers when soft-float. */ /* Accept arguments in a0-a7, and in fa0-fa7 if permitted by the ABI. */ #define FUNCTION_ARG_REGNO_P(N) \ -- cgit v1.1 From d89fde46d7368b070e9cde3ca6a88f67b5643af9 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Wed, 26 Sep 2018 19:03:26 +0000 Subject: tree.c (zerop): Change return type to bool. gcc/ChangeLog: * tree.c (zerop): Change return type to bool. (integer_zerop, integer_onep, integer_each_onep): Same. (integer_all_onesp, integer_minus_onep, integer_pow2p): Same. (integer_nonzerop, integer_truep, tree_ctz, real_zerop): Same. (real_onep, real_minus_onep, chain_index): Same. (print_type_hash_statistics, type_list_equal): Same. * tree.h (zerop): Same. (zerop, integer_zerop, integer_onep, integer_each_onep): Same. (integer_all_onesp, integer_minus_onep, integer_pow2p): Same. (integer_nonzerop, integer_truep, tree_ctz, real_zerop): Same. (real_onep, real_minus_onep, chain_index): Same. (print_type_hash_statistics, type_list_equal): Same. From-SVN: r264653 --- gcc/ChangeLog | 15 +++++++++++++++ gcc/tree.c | 46 +++++++++++++++++++++++----------------------- gcc/tree.h | 34 +++++++++++++++++----------------- 3 files changed, 55 insertions(+), 40 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 49ff24c..69c754d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2018-09-26 Martin Sebor + + * tree.c (zerop): Change return type to bool. + (integer_zerop, integer_onep, integer_each_onep): Same. + (integer_all_onesp, integer_minus_onep, integer_pow2p): Same. + (integer_nonzerop, integer_truep, tree_ctz, real_zerop): Same. + (real_onep, real_minus_onep, chain_index): Same. + (print_type_hash_statistics, type_list_equal): Same. + * tree.h (zerop): Same. + (zerop, integer_zerop, integer_onep, integer_each_onep): Same. + (integer_all_onesp, integer_minus_onep, integer_pow2p): Same. + (integer_nonzerop, integer_truep, tree_ctz, real_zerop): Same. + (real_onep, real_minus_onep, chain_index): Same. + (print_type_hash_statistics, type_list_equal): Same. + 2018-09-26 Jim Wilson * config/riscv/riscv.h (FUNCTION_ARG_REGNO_P): Fix comment. diff --git a/gcc/tree.c b/gcc/tree.c index c3ac8f3..64d9e0b 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -2475,7 +2475,7 @@ grow_tree_vec (tree v, int len MEM_STAT_DECL) /* Return 1 if EXPR is the constant zero, whether it is integral, float or fixed, and scalar, complex or vector. */ -int +bool zerop (const_tree expr) { return (integer_zerop (expr) @@ -2486,7 +2486,7 @@ zerop (const_tree expr) /* Return 1 if EXPR is the integer constant zero or a complex constant of zero. */ -int +bool integer_zerop (const_tree expr) { switch (TREE_CODE (expr)) @@ -2508,7 +2508,7 @@ integer_zerop (const_tree expr) /* Return 1 if EXPR is the integer constant one or the corresponding complex constant. */ -int +bool integer_onep (const_tree expr) { switch (TREE_CODE (expr)) @@ -2530,7 +2530,7 @@ integer_onep (const_tree expr) /* Return 1 if EXPR is the integer constant one. For complex and vector, return 1 if every piece is the integer constant one. */ -int +bool integer_each_onep (const_tree expr) { if (TREE_CODE (expr) == COMPLEX_CST) @@ -2543,13 +2543,13 @@ integer_each_onep (const_tree expr) /* Return 1 if EXPR is an integer containing all 1's in as much precision as it contains, or a complex or vector whose subparts are such integers. */ -int +bool integer_all_onesp (const_tree expr) { if (TREE_CODE (expr) == COMPLEX_CST && integer_all_onesp (TREE_REALPART (expr)) && integer_all_onesp (TREE_IMAGPART (expr))) - return 1; + return true; else if (TREE_CODE (expr) == VECTOR_CST) return (VECTOR_CST_NPATTERNS (expr) == 1 @@ -2557,7 +2557,7 @@ integer_all_onesp (const_tree expr) && integer_all_onesp (VECTOR_CST_ENCODED_ELT (expr, 0))); else if (TREE_CODE (expr) != INTEGER_CST) - return 0; + return false; return (wi::max_value (TYPE_PRECISION (TREE_TYPE (expr)), UNSIGNED) == wi::to_wide (expr)); @@ -2565,7 +2565,7 @@ integer_all_onesp (const_tree expr) /* Return 1 if EXPR is the integer constant minus one. */ -int +bool integer_minus_onep (const_tree expr) { if (TREE_CODE (expr) == COMPLEX_CST) @@ -2578,16 +2578,16 @@ integer_minus_onep (const_tree expr) /* Return 1 if EXPR is an integer constant that is a power of 2 (i.e., has only one bit on). */ -int +bool integer_pow2p (const_tree expr) { if (TREE_CODE (expr) == COMPLEX_CST && integer_pow2p (TREE_REALPART (expr)) && integer_zerop (TREE_IMAGPART (expr))) - return 1; + return true; if (TREE_CODE (expr) != INTEGER_CST) - return 0; + return false; return wi::popcount (wi::to_wide (expr)) == 1; } @@ -2595,7 +2595,7 @@ integer_pow2p (const_tree expr) /* Return 1 if EXPR is an integer constant other than zero or a complex constant other than zero. */ -int +bool integer_nonzerop (const_tree expr) { return ((TREE_CODE (expr) == INTEGER_CST @@ -2609,7 +2609,7 @@ integer_nonzerop (const_tree expr) return 1 if every piece is the integer constant minus one (representing the value TRUE). */ -int +bool integer_truep (const_tree expr) { if (TREE_CODE (expr) == VECTOR_CST) @@ -2619,7 +2619,7 @@ integer_truep (const_tree expr) /* Return 1 if EXPR is the fixed-point constant zero. */ -int +bool fixed_zerop (const_tree expr) { return (TREE_CODE (expr) == FIXED_CST @@ -2764,7 +2764,7 @@ tree_ctz (const_tree expr) /* Return 1 if EXPR is the real constant zero. Trailing zeroes matter for decimal float constants, so don't return 1 for them. */ -int +bool real_zerop (const_tree expr) { switch (TREE_CODE (expr)) @@ -2794,7 +2794,7 @@ real_zerop (const_tree expr) Trailing zeroes matter for decimal float constants, so don't return 1 for them. */ -int +bool real_onep (const_tree expr) { switch (TREE_CODE (expr)) @@ -2817,7 +2817,7 @@ real_onep (const_tree expr) /* Return 1 if EXPR is the real constant minus one. Trailing zeroes matter for decimal float constants, so don't return 1 for them. */ -int +bool real_minus_onep (const_tree expr) { switch (TREE_CODE (expr)) @@ -2839,7 +2839,7 @@ real_minus_onep (const_tree expr) /* Nonzero if EXP is a constant or a cast of a constant. */ -int +bool really_constant_p (const_tree exp) { /* This is not quite the same as STRIP_NOPS. It does more. */ @@ -2954,17 +2954,17 @@ chain_index (int idx, tree chain) /* Return nonzero if ELEM is part of the chain CHAIN. */ -int +bool chain_member (const_tree elem, const_tree chain) { while (chain) { if (elem == chain) - return 1; + return true; chain = DECL_CHAIN (chain); } - return 0; + return false; } /* Return the length of a chain of nodes chained through TREE_CHAIN. @@ -6712,7 +6712,7 @@ print_type_hash_statistics (void) return 1 if the lists contain the same types in the same order. Also, the TREE_PURPOSEs must match. */ -int +bool type_list_equal (const_tree l1, const_tree l2) { const_tree t1, t2; @@ -6723,7 +6723,7 @@ type_list_equal (const_tree l1, const_tree l2) && ! (1 == simple_cst_equal (TREE_PURPOSE (t1), TREE_PURPOSE (t2)) && (TREE_TYPE (TREE_PURPOSE (t1)) == TREE_TYPE (TREE_PURPOSE (t2)))))) - return 0; + return false; return t1 == t2; } diff --git a/gcc/tree.h b/gcc/tree.h index 4f415b7a..33fcbcd 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -4450,45 +4450,45 @@ extern vec *ctor_to_vec (tree); /* zerop (tree x) is nonzero if X is a constant of value 0. */ -extern int zerop (const_tree); +extern bool zerop (const_tree); /* integer_zerop (tree x) is nonzero if X is an integer constant of value 0. */ -extern int integer_zerop (const_tree); +extern bool integer_zerop (const_tree); /* integer_onep (tree x) is nonzero if X is an integer constant of value 1. */ -extern int integer_onep (const_tree); +extern bool integer_onep (const_tree); /* integer_onep (tree x) is nonzero if X is an integer constant of value 1, or a vector or complex where each part is 1. */ -extern int integer_each_onep (const_tree); +extern bool integer_each_onep (const_tree); /* integer_all_onesp (tree x) is nonzero if X is an integer constant all of whose significant bits are 1. */ -extern int integer_all_onesp (const_tree); +extern bool integer_all_onesp (const_tree); /* integer_minus_onep (tree x) is nonzero if X is an integer constant of value -1. */ -extern int integer_minus_onep (const_tree); +extern bool integer_minus_onep (const_tree); /* integer_pow2p (tree x) is nonzero is X is an integer constant with exactly one bit 1. */ -extern int integer_pow2p (const_tree); +extern bool integer_pow2p (const_tree); /* integer_nonzerop (tree x) is nonzero if X is an integer constant with a nonzero value. */ -extern int integer_nonzerop (const_tree); +extern bool integer_nonzerop (const_tree); /* integer_truep (tree x) is nonzero if X is an integer constant of value 1 or a vector where each element is an integer constant of value -1. */ -extern int integer_truep (const_tree); +extern bool integer_truep (const_tree); extern bool cst_and_fits_in_hwi (const_tree); extern tree num_ending_zeros (const_tree); @@ -4496,7 +4496,7 @@ extern tree num_ending_zeros (const_tree); /* fixed_zerop (tree x) is nonzero if X is a fixed-point constant of value 0. */ -extern int fixed_zerop (const_tree); +extern bool fixed_zerop (const_tree); /* staticp (tree x) is nonzero if X is a reference to data allocated at a fixed address in memory. Returns the outermost data. */ @@ -4707,8 +4707,8 @@ extern tree decl_function_context (const_tree); this _DECL with its context, or zero if none. */ extern tree decl_type_context (const_tree); -/* Return 1 if EXPR is the real constant zero. */ -extern int real_zerop (const_tree); +/* Return true if EXPR is the real constant zero. */ +extern bool real_zerop (const_tree); /* Initialize the iterator I with arguments from function FNDECL */ @@ -4889,7 +4889,7 @@ bit_field_offset (const_tree t) } extern tree strip_float_extensions (tree); -extern int really_constant_p (const_tree); +extern bool really_constant_p (const_tree); extern bool ptrdiff_tree_p (const_tree, poly_int64_pod *); extern bool decl_address_invariant_p (const_tree); extern bool decl_address_ip_invariant_p (const_tree); @@ -4920,14 +4920,14 @@ static inline hashval_t iterative_hash_expr(const_tree tree, hashval_t seed) } extern int compare_tree_int (const_tree, unsigned HOST_WIDE_INT); -extern int type_list_equal (const_tree, const_tree); -extern int chain_member (const_tree, const_tree); +extern bool type_list_equal (const_tree, const_tree); +extern bool chain_member (const_tree, const_tree); extern void dump_tree_statistics (void); extern void recompute_tree_invariant_for_addr_expr (tree); extern bool needs_to_live_in_memory (const_tree); extern tree reconstruct_complex_type (tree, tree); -extern int real_onep (const_tree); -extern int real_minus_onep (const_tree); +extern bool real_onep (const_tree); +extern bool real_minus_onep (const_tree); extern void init_ttree (void); extern void build_common_tree_nodes (bool); extern void build_common_builtin_nodes (void); -- cgit v1.1 From 01414d53cf3c062ca821de9ae48ba4c3db7d8ad7 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Wed, 26 Sep 2018 21:06:01 +0000 Subject: RISC-V: Add missing negate patterns. gcc/ * config/riscv/riscv.md (subsi3_extended2): Add J constraint. (negdi2, negsi2, negsi2_extended, negsi2_extended2): New. From-SVN: r264655 --- gcc/ChangeLog | 5 +++++ gcc/config/riscv/riscv.md | 41 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 43 insertions(+), 3 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 69c754d..b13aaa8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-09-26 Jim Wilson + + * config/riscv/riscv.md (subsi3_extended2): Add J constraint. + (negdi2, negsi2, negsi2_extended, negsi2_extended2): New. + 2018-09-26 Martin Sebor * tree.c (zerop): Change return type to bool. diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md index 95fbb28..4162dc5 100644 --- a/gcc/config/riscv/riscv.md +++ b/gcc/config/riscv/riscv.md @@ -514,16 +514,51 @@ (set_attr "mode" "SI")]) (define_insn "*subsi3_extended2" - [(set (match_operand:DI 0 "register_operand" "=r") + [(set (match_operand:DI 0 "register_operand" "= r") (sign_extend:DI - (subreg:SI (minus:DI (match_operand:DI 1 "reg_or_0_operand" " r") - (match_operand:DI 2 "register_operand" " r")) + (subreg:SI (minus:DI (match_operand:DI 1 "reg_or_0_operand" " rJ") + (match_operand:DI 2 "register_operand" " r")) 0)))] "TARGET_64BIT" "subw\t%0,%z1,%2" [(set_attr "type" "arith") (set_attr "mode" "SI")]) +(define_insn "negdi2" + [(set (match_operand:DI 0 "register_operand" "=r") + (neg:DI (match_operand:DI 1 "register_operand" " r")))] + "TARGET_64BIT" + "neg\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "DI")]) + +(define_insn "negsi2" + [(set (match_operand:SI 0 "register_operand" "=r") + (neg:SI (match_operand:SI 1 "register_operand" " r")))] + "" + { return TARGET_64BIT ? "negw\t%0,%1" : "neg\t%0,%1"; } + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "*negsi2_extended" + [(set (match_operand:DI 0 "register_operand" "=r") + (sign_extend:DI + (neg:SI (match_operand:SI 1 "register_operand" " r"))))] + "TARGET_64BIT" + "negw\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "*negsi2_extended2" + [(set (match_operand:DI 0 "register_operand" "=r") + (sign_extend:DI + (subreg:SI (neg:DI (match_operand:DI 1 "register_operand" " r")) + 0)))] + "TARGET_64BIT" + "negw\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + ;; ;; .................... ;; -- cgit v1.1 From 8313a7643a2cf5f0037e08f4e6a6d7002aeef8a0 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 26 Sep 2018 22:14:16 +0100 Subject: Support excess precision for integer / floating-point comparisons (PR c/87390). In C11, implicit conversions from integer to floating-point types produce results with the range and precision of the corresponding evaluation format rather than only those of the type implicitly converted to. This patch implements that case of C11 excess precision semantics in the case of a comparison between integer and floating-point types, previously missed when implementing other cases of excess precision for such implicit conversions. As with other such fixes, this patch conservatively follows the reading of C99 where conversions from integer to floating-point do not produce results with excess precision and so the change is made for C11 mode only. Bootstrapped with no regressions on x86_64-pc-linux-gnu. gcc/c: PR c/87390 * c-typeck.c (build_binary_op): Use excess precision for comparisons of integers and floating-point for C11 and later. gcc/testsuite: PR c/87390 * gcc.target/i386/excess-precision-9.c, gcc.target/i386/excess-precision-10.c: New tests. From-SVN: r264656 --- gcc/c/ChangeLog | 6 +++ gcc/c/c-typeck.c | 14 ++++++ gcc/testsuite/ChangeLog | 6 +++ .../gcc.target/i386/excess-precision-10.c | 52 ++++++++++++++++++++++ gcc/testsuite/gcc.target/i386/excess-precision-9.c | 52 ++++++++++++++++++++++ 5 files changed, 130 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/excess-precision-10.c create mode 100644 gcc/testsuite/gcc.target/i386/excess-precision-9.c (limited to 'gcc') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 1ea87b9..a8e235c 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Joseph Myers + + PR c/87390 + * c-typeck.c (build_binary_op): Use excess precision for + comparisons of integers and floating-point for C11 and later. + 2018-09-26 Martin Jambor PR c/87347 diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index a5a7da0..9d09b8d 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -11249,6 +11249,20 @@ build_binary_op (location_t location, enum tree_code code, case EXACT_DIV_EXPR: may_need_excess_precision = true; break; + + case EQ_EXPR: + case NE_EXPR: + case LE_EXPR: + case GE_EXPR: + case LT_EXPR: + case GT_EXPR: + /* Excess precision for implicit conversions of integers to + floating point in C11 and later. */ + may_need_excess_precision = (flag_isoc11 + && (ANY_INTEGRAL_TYPE_P (type0) + || ANY_INTEGRAL_TYPE_P (type1))); + break; + default: may_need_excess_precision = false; break; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aa005e7..16407e5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Joseph Myers + + PR c/87390 + * gcc.target/i386/excess-precision-9.c, + gcc.target/i386/excess-precision-10.c: New tests. + 2018-09-26 Richard Biener PR debug/87443 diff --git a/gcc/testsuite/gcc.target/i386/excess-precision-10.c b/gcc/testsuite/gcc.target/i386/excess-precision-10.c new file mode 100644 index 0000000..f1b9b7e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/excess-precision-10.c @@ -0,0 +1,52 @@ +/* Excess precision tests. Test implicit conversions in comparisons: + excess precision in C11 mode. */ +/* { dg-do run } */ +/* { dg-options "-std=c11 -mfpmath=387 -fexcess-precision=standard" } */ + +extern void abort (void); +extern void exit (int); + +int +main (void) +{ + float f = 0x1p63f; + unsigned long long int u = (1ULL << 63) + 1; + + if ((f == u) != 0) + abort (); + + if ((u == f) != 0) + abort (); + + if ((f != u) != 1) + abort (); + + if ((u != f) != 1) + abort (); + + if ((f < u) != 1) + abort (); + + if ((u < f) != 0) + abort (); + + if ((f <= u) != 1) + abort (); + + if ((u <= f) != 0) + abort (); + + if ((f > u) != 0) + abort (); + + if ((u > f) != 1) + abort (); + + if ((f >= u) != 0) + abort (); + + if ((u >= f) != 1) + abort (); + + exit (0); +} diff --git a/gcc/testsuite/gcc.target/i386/excess-precision-9.c b/gcc/testsuite/gcc.target/i386/excess-precision-9.c new file mode 100644 index 0000000..61e5fc1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/excess-precision-9.c @@ -0,0 +1,52 @@ +/* Excess precision tests. Test implicit conversions in comparisons: + no excess precision in C99 mode. */ +/* { dg-do run } */ +/* { dg-options "-std=c99 -mfpmath=387 -fexcess-precision=standard" } */ + +extern void abort (void); +extern void exit (int); + +int +main (void) +{ + float f = 0x1p63f; + unsigned long long int u = (1ULL << 63) + 1; + + if ((f == u) != 1) + abort (); + + if ((u == f) != 1) + abort (); + + if ((f != u) != 0) + abort (); + + if ((u != f) != 0) + abort (); + + if ((f < u) != 0) + abort (); + + if ((u < f) != 0) + abort (); + + if ((f <= u) != 1) + abort (); + + if ((u <= f) != 1) + abort (); + + if ((f > u) != 0) + abort (); + + if ((u > f) != 0) + abort (); + + if ((f >= u) != 1) + abort (); + + if ((u >= f) != 1) + abort (); + + exit (0); +} -- cgit v1.1 From bc162b0e6f9af9b03441e0e2b85ba0a98e4e5314 Mon Sep 17 00:00:00 2001 From: Indu Bhagat Date: Wed, 26 Sep 2018 22:29:54 +0000 Subject: re PR gcov-profile/86957 (gcc should warn about missing profiles for a compilation unit or a new function with -fprofile-use) 2018-09-26 Indu Bhagat PR gcov-profile/86957 * common.opt: New warning option -Wmissing-profile. * coverage.c (get_coverage_counts): Add warning for missing .gcda file. * doc/invoke.texi: Document -Wmissing-profile. From-SVN: r264657 --- gcc/ChangeLog | 7 ++++++ gcc/common.opt | 4 ++++ gcc/coverage.c | 38 ++++++++++++++++++++++----------- gcc/doc/invoke.texi | 28 +++++++++++++++++++----- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/Wmissing-profile.c | 5 +++++ 6 files changed, 70 insertions(+), 17 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/Wmissing-profile.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b13aaa8..54eb0b8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-09-26 Indu Bhagat + + PR gcov-profile/86957 + * common.opt: New warning option -Wmissing-profile. + * coverage.c (get_coverage_counts): Add warning for missing .gcda file. + * doc/invoke.texi: Document -Wmissing-profile. + 2018-09-26 Jim Wilson * config/riscv/riscv.md (subsi3_extended2): Add J constraint. diff --git a/gcc/common.opt b/gcc/common.opt index ef6a630..53aac19 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -811,6 +811,10 @@ Wcoverage-mismatch Common Var(warn_coverage_mismatch) Init(1) Warning Warn in case profiles in -fprofile-use do not match. +Wmissing-profile +Common Var(warn_missing_profile) Init(1) Warning +Warn in case profiles in -fprofile-use do not exist. + Wvector-operation-performance Common Var(warn_vector_operation_performance) Warning Warn when a vector operation is compiled outside the SIMD. diff --git a/gcc/coverage.c b/gcc/coverage.c index 8f12778..19c696c 100644 --- a/gcc/coverage.c +++ b/gcc/coverage.c @@ -304,16 +304,23 @@ get_coverage_counts (unsigned counter, unsigned cfg_checksum, { static int warned = 0; - if (!warned++ && dump_enabled_p ()) + if (!warned++) { - dump_user_location_t loc - = dump_user_location_t::from_location_t (input_location); - dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc, + warning (OPT_Wmissing_profile, + "%qs profile count data file not found", + da_file_name); + if (dump_enabled_p ()) + { + dump_user_location_t loc + = dump_user_location_t::from_location_t (input_location); + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc, + "file %s not found\n", + da_file_name); + dump_printf (MSG_OPTIMIZED_LOCATIONS, (flag_guess_branch_prob - ? "file %s not found, execution counts estimated\n" - : "file %s not found, execution counts assumed to " - "be zero\n"), - da_file_name); + ? "execution counts estimated\n" + : "execution counts assumed to be zero\n")); + } } return NULL; } @@ -327,10 +334,17 @@ get_coverage_counts (unsigned counter, unsigned cfg_checksum, elt.ctr = counter; entry = counts_hash->find (&elt); if (!entry) - /* The function was not emitted, or is weak and not chosen in the - final executable. Silently fail, because there's nothing we - can do about it. */ - return NULL; + { + if (counter == GCOV_COUNTER_ARCS) + warning_at (DECL_SOURCE_LOCATION (current_function_decl), + OPT_Wmissing_profile, + "profile for function %qD not found in profile data", + current_function_decl); + /* The function was not emitted, or is weak and not chosen in the + final executable. Silently fail, because there's nothing we + can do about it. */ + return NULL; + } if (entry->cfg_checksum != cfg_checksum) { diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 7ef4e7a..5c95f67 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -315,7 +315,7 @@ Objective-C and Objective-C++ Dialects}. -Wlogical-op -Wlogical-not-parentheses -Wlong-long @gol -Wmain -Wmaybe-uninitialized -Wmemset-elt-size -Wmemset-transposed-args @gol -Wmisleading-indentation -Wmissing-attributes -Wmissing-braces @gol --Wmissing-field-initializers -Wmissing-include-dirs @gol +-Wmissing-field-initializers -Wmissing-include-dirs -Wmissing-profile @gol -Wno-multichar -Wmultistatement-macros -Wnonnull -Wnonnull-compare @gol -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol -Wnull-dereference -Wodr -Wno-overflow -Wopenmp-simd @gol @@ -4215,8 +4215,8 @@ Warn about an invalid memory access that is found by Pointer Bounds Checker @opindex Wcoverage-mismatch Warn if feedback profiles do not match when using the @option{-fprofile-use} option. -If a source file is changed between compiling with @option{-fprofile-gen} and -with @option{-fprofile-use}, the files with the profile feedback can fail +If a source file is changed between compiling with @option{-fprofile-generate} +and with @option{-fprofile-use}, the files with the profile feedback can fail to match the source file and GCC cannot use the profile feedback information. By default, this warning is enabled and is treated as an error. @option{-Wno-coverage-mismatch} can be used to disable the @@ -4820,6 +4820,23 @@ This warning is enabled by @option{-Wall}. @opindex Wno-missing-include-dirs Warn if a user-supplied include directory does not exist. +@item -Wmissing-profile +@opindex Wmissing-profile +@opindex Wno-missing-profile +Warn if feedback profiles are missing when using the +@option{-fprofile-use} option. +This option diagnoses those cases where a new function or a new file is added +to the user code between compiling with @option{-fprofile-generate} and with +@option{-fprofile-use}, without regenerating the profiles. In these cases, the +profile feedback data files do not contain any profile feedback information for +the newly added function or file respectively. Also, in the case when profile +count data (.gcda) files are removed, GCC cannot use any profile feedback +information. In all these cases, warnings are issued to inform the user that a +profile generation step is due. @option{-Wno-missing-profile} can be used to +disable the warning. Ignoring the warning can result in poorly optimized code. +Completely disabling the warning is not recommended and should be done only +when non-existent profile data is justified. + @item -Wmultistatement-macros @opindex Wmultistatement-macros @opindex Wno-multistatement-macros @@ -9917,8 +9934,9 @@ Before you can use this option, you must first generate profiling information. By default, GCC emits an error message if the feedback profiles do not match the source code. This error can be turned into a warning by using -@option{-Wcoverage-mismatch}. Note this may result in poorly optimized -code. +@option{-Wno-error=coverage-mismatch}. Note this may result in poorly +optimized code. Additionally, by default, GCC also emits a warning message if +the feedback profiles do not exist (See @option{-Wmissing-profile}). If @var{path} is specified, GCC looks at the @var{path} to find the profile feedback data files. See @option{-fprofile-dir}. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 16407e5..b7dd673 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-26 Indu Bhagat + + PR gcov-profile/86957 + * gcc.dg/Wmissing-profile.c: New test. + 2018-09-26 Joseph Myers PR c/87390 diff --git a/gcc/testsuite/gcc.dg/Wmissing-profile.c b/gcc/testsuite/gcc.dg/Wmissing-profile.c new file mode 100644 index 0000000..6ef1ac1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wmissing-profile.c @@ -0,0 +1,5 @@ +/* PR gcov-profile/86957 */ +/* { dg-do compile } */ +/* { dg-options "-fprofile-use" } */ + +void foo () { } /* { dg-warning "profile count data file not found" } */ -- cgit v1.1 From 461553e6ed2579e447bac5bf3093c40f9545f71e Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Thu, 27 Sep 2018 00:16:55 +0000 Subject: Daily bump. From-SVN: r264661 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index c0bfb9b..750ff19 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20180926 +20180927 -- cgit v1.1 From 291a9e980ef059c46476212e4b3e88fb07e11b00 Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Thu, 27 Sep 2018 08:03:42 +0000 Subject: S/390: Implement speculation barrier gcc/ChangeLog: 2018-09-27 Andreas Krebbel * config/s390/s390.md (PPA_TX_ABORT, PPA_OOO_BARRIER): New constant definitions. ("tx_assist"): Replace magic number with PPA_TX_ABORT. ("*ppa"): Enable pattern also for -march=zEC12 -mno-htm. ("speculation_barrier"): New expander definition. From-SVN: r264663 --- gcc/ChangeLog | 8 ++++++++ gcc/config/s390/s390.md | 21 +++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 54eb0b8..8691d52 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-09-27 Andreas Krebbel + + * config/s390/s390.md (PPA_TX_ABORT, PPA_OOO_BARRIER): New + constant definitions. + ("tx_assist"): Replace magic number with PPA_TX_ABORT. + ("*ppa"): Enable pattern also for -march=zEC12 -mno-htm. + ("speculation_barrier"): New expander definition. + 2018-09-26 Indu Bhagat PR gcov-profile/86957 diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 537ed35..1286d2c 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -410,6 +410,15 @@ (PFPO_RND_MODE_BFP 1) ]) +;; PPA constants + +; Immediate values which can be used as the third operand to the +; perform processor assist instruction + +(define_constants + [(PPA_TX_ABORT 1) + (PPA_OOO_BARRIER 15)]) + ; Immediate operands for tbegin and tbeginc (define_constants [(TBEGIN_MASK 65292)]) ; 0xff0c (define_constants [(TBEGINC_MASK 65288)]) ; 0xff08 @@ -11415,7 +11424,7 @@ (define_expand "tx_assist" [(unspec_volatile [(match_operand:SI 0 "register_operand" "") (reg:SI GPR0_REGNUM) - (const_int 1)] + (const_int PPA_TX_ABORT)] UNSPECV_PPA)] "TARGET_HTM" "") @@ -11425,7 +11434,7 @@ (match_operand:SI 1 "register_operand" "d") (match_operand 2 "const_int_operand" "I")] UNSPECV_PPA)] - "TARGET_HTM && INTVAL (operands[2]) < 16" + "(TARGET_ZEC12 || TARGET_HTM) && INTVAL (operands[2]) < 16" "ppa\t%0,%1,%2" [(set_attr "op_type" "RRF")]) @@ -11592,3 +11601,11 @@ "" "bcr\t7,%%r0" [(set_attr "op_type" "RR")]) + +(define_expand "speculation_barrier" + [(unspec_volatile [(reg:SI GPR0_REGNUM) + (reg:SI GPR0_REGNUM) + (const_int PPA_OOO_BARRIER)] + UNSPECV_PPA)] + "TARGET_ZEC12" + "") -- cgit v1.1 From 0798984a5a59e9162596db04cbf9eacc8541da7f Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 27 Sep 2018 08:33:41 +0000 Subject: re PR c++/84940 (internal compiler error: in build_value_init_noctor, at cp/init.c:465) /cp 2018-09-27 Paolo Carlini PR c++/84940 * semantics.c (finish_unary_op_expr): Check return value of build_x_unary_op for error_mark_node. /testsuite 2018-09-27 Paolo Carlini PR c++/84940 * g++.dg/expr/unary4.C: New. From-SVN: r264664 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/semantics.c | 7 ++++--- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/expr/unary4.C | 8 ++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/g++.dg/expr/unary4.C (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 672626c..a28b615 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-09-27 Paolo Carlini + + PR c++/84940 + * semantics.c (finish_unary_op_expr): Check return value of + build_x_unary_op for error_mark_node. + 2018-09-25 Jakub Jelinek PR c++/87398 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index bf3c63a..c7f53d1 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2727,13 +2727,14 @@ finish_unary_op_expr (location_t op_loc, enum tree_code code, cp_expr expr, /* TODO: build_x_unary_op doesn't always honor the location. */ result.set_location (combined_loc); - tree result_ovl, expr_ovl; + if (result == error_mark_node) + return result; if (!(complain & tf_warning)) return result; - result_ovl = result; - expr_ovl = expr; + tree result_ovl = result; + tree expr_ovl = expr; if (!processing_template_decl) expr_ovl = cp_fully_fold (expr_ovl); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b7dd673..4bca408 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-27 Paolo Carlini + + PR c++/84940 + * g++.dg/expr/unary4.C: New. + 2018-09-26 Indu Bhagat PR gcov-profile/86957 diff --git a/gcc/testsuite/g++.dg/expr/unary4.C b/gcc/testsuite/g++.dg/expr/unary4.C new file mode 100644 index 0000000..2b58a8d --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/unary4.C @@ -0,0 +1,8 @@ +// PR c++/84940 +// { dg-additional-options -Wno-vla } + +void +foo (int x) +{ + struct {} a[1][x](-a[0]); // { dg-error "wrong type argument to unary minus" } +} -- cgit v1.1 From 90e79377a542e63b5cded9c72064b11e7833cce4 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 27 Sep 2018 09:53:08 +0000 Subject: re PR c++/67544 (ICE: SIGSEGV in tree_check3 (tree.h:2896) with -fconcepts) 2018-09-27 Paolo Carlini PR c++/67544 * g++.dg/concepts/pr67544.C: New. From-SVN: r264665 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/concepts/pr67544.C | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 gcc/testsuite/g++.dg/concepts/pr67544.C (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4bca408..d723ef4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2018-09-27 Paolo Carlini + PR c++/67544 + * g++.dg/concepts/pr67544.C: New. + +2018-09-27 Paolo Carlini + PR c++/84940 * g++.dg/expr/unary4.C: New. diff --git a/gcc/testsuite/g++.dg/concepts/pr67544.C b/gcc/testsuite/g++.dg/concepts/pr67544.C new file mode 100644 index 0000000..af4f677 --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/pr67544.C @@ -0,0 +1,11 @@ +// { dg-additional-options "-fconcepts" } + +template struct A +{ + struct B; +}; + +struct C +{ + template friend struct A::B; +}; -- cgit v1.1 From 19ef5a8fd5710a197ddeaafc2c69ff77217fece5 Mon Sep 17 00:00:00 2001 From: Andrew Stubbs Date: Thu, 27 Sep 2018 11:15:48 +0000 Subject: [pr82089] Don't sign-extend SFV 1 in BImode This is an update of the patch posted to PR82089 long ago. We ran into the same bug on GCN, so we need this fixed as part of this series. 2018-09-27 Andrew Stubbs Tom de Vries PR 82089 gcc/ * expmed.c (emit_cstore): Fix handling of result_mode == BImode and STORE_FLAG_VALUE == 1. Co-Authored-By: Tom de Vries From-SVN: r264666 --- gcc/ChangeLog | 8 ++++++++ gcc/expmed.c | 11 +++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8691d52..4606d9d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-09-27 Andrew Stubbs + Tom de Vries + + PR 82089 + + * expmed.c (emit_cstore): Fix handling of result_mode == BImode and + STORE_FLAG_VALUE == 1. + 2018-09-27 Andreas Krebbel * config/s390/s390.md (PPA_TX_ABORT, PPA_OOO_BARRIER): New diff --git a/gcc/expmed.c b/gcc/expmed.c index 29ce10b..444d6a8 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -5464,11 +5464,14 @@ emit_cstore (rtx target, enum insn_code icode, enum rtx_code code, If STORE_FLAG_VALUE does not have the sign bit set when interpreted in MODE, we can do this conversion as unsigned, which is usually more efficient. */ - if (GET_MODE_SIZE (int_target_mode) > GET_MODE_SIZE (result_mode)) + if (GET_MODE_PRECISION (int_target_mode) > GET_MODE_PRECISION (result_mode)) { - convert_move (target, subtarget, - val_signbit_known_clear_p (result_mode, - STORE_FLAG_VALUE)); + gcc_assert (GET_MODE_PRECISION (result_mode) != 1 + || STORE_FLAG_VALUE == 1 || STORE_FLAG_VALUE == -1); + + bool unsignedp = (STORE_FLAG_VALUE >= 0); + convert_move (target, subtarget, unsignedp); + op0 = target; result_mode = int_target_mode; } -- cgit v1.1 From ac02e5b75451cc3c6ae9028338183bcdcb056ea2 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 27 Sep 2018 14:10:45 +0000 Subject: re PR debug/37801 (DWARF output for inlined functions doesn't always use DW_TAG_inlined_subroutine) 2018-09-27 Richard Biener PR debug/37801 PR debug/87440 * dwarf2out.c (set_block_origin_self): Do not mark outermost block as we do not output that. (gen_inlined_subroutine_die): Elide the originally outermost block, matching what we do for concrete instances. (decls_for_scope): Add parameter specifying whether to recurse to subblocks. * gcc.dg/debug/dwarf2/inline2.c: Adjust. * gcc.dg/debug/dwarf2/inline4.c: New testcase. From-SVN: r264667 --- gcc/ChangeLog | 11 ++++++++++ gcc/dwarf2out.c | 31 ++++++++++++++++++++++------- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gcc.dg/debug/dwarf2/inline2.c | 10 ++++------ gcc/testsuite/gcc.dg/debug/dwarf2/inline4.c | 17 ++++++++++++++++ 5 files changed, 63 insertions(+), 13 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/debug/dwarf2/inline4.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4606d9d..4255d26 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2018-09-27 Richard Biener + + PR debug/37801 + PR debug/87440 + * dwarf2out.c (set_block_origin_self): Do not mark outermost + block as we do not output that. + (gen_inlined_subroutine_die): Elide the originally outermost + block, matching what we do for concrete instances. + (decls_for_scope): Add parameter specifying whether to recurse + to subblocks. + 2018-09-27 Andrew Stubbs Tom de Vries diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index b0c5c4f..a63a645 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -3867,7 +3867,7 @@ static void gen_subroutine_type_die (tree, dw_die_ref); static void gen_typedef_die (tree, dw_die_ref); static void gen_type_die (tree, dw_die_ref); static void gen_block_die (tree, dw_die_ref); -static void decls_for_scope (tree, dw_die_ref); +static void decls_for_scope (tree, dw_die_ref, bool = true); static bool is_naming_typedef_decl (const_tree); static inline dw_die_ref get_context_die (tree); static void gen_namespace_die (tree, dw_die_ref); @@ -24147,7 +24147,23 @@ gen_inlined_subroutine_die (tree stmt, dw_die_ref context_die) add_high_low_attributes (stmt, subr_die); add_call_src_coords_attributes (stmt, subr_die); - decls_for_scope (stmt, subr_die); + /* The inliner creates an extra BLOCK for the parameter setup, + we want to merge that with the actual outermost BLOCK of the + inlined function to avoid duplicate locals in consumers. + Do that by doing the recursion to subblocks on the single subblock + of STMT. */ + bool unwrap_one = false; + if (BLOCK_SUBBLOCKS (stmt) && !BLOCK_CHAIN (BLOCK_SUBBLOCKS (stmt))) + { + tree origin = block_ultimate_origin (BLOCK_SUBBLOCKS (stmt)); + if (origin + && TREE_CODE (origin) == BLOCK + && BLOCK_SUPERCONTEXT (origin) == decl) + unwrap_one = true; + } + decls_for_scope (stmt, subr_die, !unwrap_one); + if (unwrap_one) + decls_for_scope (BLOCK_SUBBLOCKS (stmt), subr_die); } } @@ -25775,7 +25791,7 @@ process_scope_var (tree stmt, tree decl, tree origin, dw_die_ref context_die) all of its sub-blocks. */ static void -decls_for_scope (tree stmt, dw_die_ref context_die) +decls_for_scope (tree stmt, dw_die_ref context_die, bool recurse) { tree decl; unsigned int i; @@ -25818,10 +25834,11 @@ decls_for_scope (tree stmt, dw_die_ref context_die) /* Output the DIEs to represent all sub-blocks (and the items declared therein) of this block. */ - for (subblocks = BLOCK_SUBBLOCKS (stmt); - subblocks != NULL; - subblocks = BLOCK_CHAIN (subblocks)) - gen_block_die (subblocks, context_die); + if (recurse) + for (subblocks = BLOCK_SUBBLOCKS (stmt); + subblocks != NULL; + subblocks = BLOCK_CHAIN (subblocks)) + gen_block_die (subblocks, context_die); } /* Is this a typedef we can avoid emitting? */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d723ef4..712e2be 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-09-27 Richard Biener + + PR debug/37801 + PR debug/87440 + * gcc.dg/debug/dwarf2/inline2.c: Adjust. + * gcc.dg/debug/dwarf2/inline4.c: New testcase. + 2018-09-27 Paolo Carlini PR c++/67544 diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/inline2.c b/gcc/testsuite/gcc.dg/debug/dwarf2/inline2.c index b2ae111..7e019a6 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/inline2.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/inline2.c @@ -23,12 +23,10 @@ of third, second and first. */ /* { dg-final { scan-assembler-times "\\(DIE \\(\[^\n\]*\\) DW_TAG_inlined_subroutine" 6 } } */ -/* Likewise we should have 6 DW_TAG_lexical_block DIEs: - - One for each subroutine inlined into main, so that's 3. - - One for each subroutine inlined in the out of line instances - of third, second and first, that's 3. -*/ -/* { dg-final { scan-assembler-times "\\(DIE \\(\[^\n\]*\\) DW_TAG_lexical_block" 6 } } */ +/* We should have no DW_TAG_lexical_block DIEs, all inline instances + should have the first subblock elided to match the abstract instance + layout. */ +/* { dg-final { scan-assembler-times "\\(DIE \\(\[^\n\]*\\) DW_TAG_lexical_block" 0 } } */ /* There are 3 DW_AT_inline attributes: one per abstract inline instance. diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/inline4.c b/gcc/testsuite/gcc.dg/debug/dwarf2/inline4.c new file mode 100644 index 0000000..2faef6e --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/inline4.c @@ -0,0 +1,17 @@ +/* Verify that the inline instance has no extra DW_TAG_lexical_block between + the DW_TAG_inlined_subroutine and the DW_TAG_variable for the local. */ +/* { dg-options "-O -gdwarf -dA" } */ +/* { dg-do compile } */ +/* { dg-final { scan-assembler "DW_TAG_inlined_subroutine\[^\\(\]*\\(\[^\\)\]*\\)\[^\\(\]*\\(DIE \\(0x\[0-9a-f\]*\\) DW_TAG_formal_parameter\[^\\(\]*\\(DIE \\(0x\[0-9a-f\]*\\) DW_TAG_variable" } } */ +/* { dg-final { scan-assembler-times "DW_TAG_inlined_subroutine" 2 } } */ + +static int foo (int i) +{ + volatile int j = i + 3; + return j - 2; +} +int main() +{ + volatile int z = foo (-1); + return z; +} -- cgit v1.1 From b88da9bbd8ddec81f32bbff66c86c79c2decf546 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 27 Sep 2018 14:17:52 +0000 Subject: re PR debug/87451 (FAIL: gcc.dg/debug/dwarf2/inline5.c) 2018-09-27 Richard Biener PR testsuite/87451 * gcc.dg/debug/dwarf2/inline5.c: Deal with different comment characters. From-SVN: r264668 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 712e2be..19f4eaf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2018-09-27 Richard Biener + PR testsuite/87451 + * gcc.dg/debug/dwarf2/inline5.c: Deal with different comment characters. + +2018-09-27 Richard Biener + PR debug/37801 PR debug/87440 * gcc.dg/debug/dwarf2/inline2.c: Adjust. diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c b/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c index 4f4463b..d70087b 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c @@ -4,13 +4,13 @@ /* { dg-options "-O -gdwarf -dA" } */ /* { dg-do compile } */ /* { dg-final { scan-assembler-times "DW_TAG_inlined_subroutine" 2 } } */ -/* { dg-final { scan-assembler-times "DW_TAG_lexical_block\\)\[^#\]*# DW_AT_abstract_origin" 2 } } */ -/* { dg-final { scan-assembler-times "DW_TAG_lexical_block\\)\[^#\]*# \\(DIE \\(0x\[0-9a-f\]*\\) DW_TAG_variable" 1 } } */ +/* { dg-final { scan-assembler-times "DW_TAG_lexical_block\\)\[^#/!\]*\[#/!\] DW_AT_abstract_origin" 2 } } */ +/* { dg-final { scan-assembler-times "DW_TAG_lexical_block\\)\[^#/!\]*\[#/!\] \\(DIE \\(0x\[0-9a-f\]*\\) DW_TAG_variable" 1 } } */ /* We do not know which is output first so look for both invalid abstract origins on the lexical blocks (knowing that the abstract instance has no attribute following the DW_TAG_lexical_block. */ -/* { dg-final { scan-assembler-not "\\(DIE \\(0x(\[0-9a-f\]*)\\) DW_TAG_lexical_block\\)\[^#\]*# \[^(\].*DW_TAG_lexical_block\\)\[^#x\]*x\\1\[^#\]*# DW_AT_abstract_origin" } } */ -/* { dg-final { scan-assembler-not "DW_TAG_lexical_block\\)\[^#x\]*x(\[0-9a-f\]*)\[^#\]*# DW_AT_abstract_origin.*\\(DIE \\(0x\\1\\) DW_TAG_lexical_block\\)\[^#\]*# DW_AT" } } */ +/* { dg-final { scan-assembler-not "\\(DIE \\(0x(\[0-9a-f\]*)\\) DW_TAG_lexical_block\\)\[^#/!\]*\[#/!\] \[^(\].*DW_TAG_lexical_block\\)\[^#/!x\]*x\\1\[^#/!\]*\[#/!\] DW_AT_abstract_origin" } } */ +/* { dg-final { scan-assembler-not "DW_TAG_lexical_block\\)\[^#/!x\]*x(\[0-9a-f\]*)\[^#/!\]*\[#/!\] DW_AT_abstract_origin.*\\(DIE \\(0x\\1\\) DW_TAG_lexical_block\\)\[^#/!\]*\[#/!\] DW_AT" } } */ int foo (int i) { -- cgit v1.1 From 88307040642311b32de4fb051a64ae2796e0f1dc Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 27 Sep 2018 16:53:35 +0200 Subject: coverage.c (get_coverage_counts): Revert the formatting of missing profile opt info. 2018-09-27 Martin Liska * coverage.c (get_coverage_counts): Revert the formatting of missing profile opt info. * g++.dg/pr60518.C: Add -Wno-missing-profile. * g++.dg/torture/pr59265.C: Likewise. * g++.dg/tree-prof/morefunc.C: Likewise. * g++.dg/tree-ssa/dom-invalid.C: Likewise. * gcc.dg/pr26570.c: Likewise. * gcc.dg/pr32773.c: Likewise. * gcc.dg/pr40209.c: Likewise. * gcc.dg/pr51957-1.c: Likewise. * gcc.dg/pr80747.c: Likewise. * gcc.target/aarch64/pr62262.c: Likewise. From-SVN: r264669 --- gcc/ChangeLog | 5 +++++ gcc/coverage.c | 10 ++++------ gcc/testsuite/ChangeLog | 13 +++++++++++++ gcc/testsuite/g++.dg/pr60518.C | 2 +- gcc/testsuite/g++.dg/torture/pr59265.C | 2 +- gcc/testsuite/g++.dg/tree-prof/morefunc.C | 2 +- gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C | 2 +- gcc/testsuite/gcc.dg/pr26570.c | 2 +- gcc/testsuite/gcc.dg/pr32773.c | 4 ++-- gcc/testsuite/gcc.dg/pr40209.c | 2 +- gcc/testsuite/gcc.dg/pr51957-1.c | 2 +- gcc/testsuite/gcc.dg/pr80747.c | 2 +- gcc/testsuite/gcc.target/aarch64/pr62262.c | 2 +- 13 files changed, 33 insertions(+), 17 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4255d26..4cd9f8c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-09-27 Martin Liska + + * coverage.c (get_coverage_counts): Revert the formatting + of missing profile opt info. + 2018-09-27 Richard Biener PR debug/37801 diff --git a/gcc/coverage.c b/gcc/coverage.c index 19c696c..6b45ce9 100644 --- a/gcc/coverage.c +++ b/gcc/coverage.c @@ -314,12 +314,10 @@ get_coverage_counts (unsigned counter, unsigned cfg_checksum, dump_user_location_t loc = dump_user_location_t::from_location_t (input_location); dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc, - "file %s not found\n", - da_file_name); - dump_printf (MSG_OPTIMIZED_LOCATIONS, - (flag_guess_branch_prob - ? "execution counts estimated\n" - : "execution counts assumed to be zero\n")); + "file %s not found, %s\n", da_file_name, + (flag_guess_branch_prob + ? "execution counts estimated" + : "execution counts assumed to be zero")); } } return NULL; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 19f4eaf..834b9b0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2018-09-27 Martin Liska + + * g++.dg/pr60518.C: Add -Wno-missing-profile. + * g++.dg/torture/pr59265.C: Likewise. + * g++.dg/tree-prof/morefunc.C: Likewise. + * g++.dg/tree-ssa/dom-invalid.C: Likewise. + * gcc.dg/pr26570.c: Likewise. + * gcc.dg/pr32773.c: Likewise. + * gcc.dg/pr40209.c: Likewise. + * gcc.dg/pr51957-1.c: Likewise. + * gcc.dg/pr80747.c: Likewise. + * gcc.target/aarch64/pr62262.c: Likewise. + 2018-09-27 Richard Biener PR testsuite/87451 diff --git a/gcc/testsuite/g++.dg/pr60518.C b/gcc/testsuite/g++.dg/pr60518.C index e3da48a..e4a80da 100644 --- a/gcc/testsuite/g++.dg/pr60518.C +++ b/gcc/testsuite/g++.dg/pr60518.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-options "-Os -fprofile-use" } +// { dg-options "-Os -fprofile-use -Wno-missing-profile" } int a; int fn1 () { return a == ',' || a == ';'; } diff --git a/gcc/testsuite/g++.dg/torture/pr59265.C b/gcc/testsuite/g++.dg/torture/pr59265.C index d48efe5..f3dceb9 100644 --- a/gcc/testsuite/g++.dg/torture/pr59265.C +++ b/gcc/testsuite/g++.dg/torture/pr59265.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-options "-fprofile-use -std=gnu++11 -Wno-return-type" } +// { dg-options "-fprofile-use -std=gnu++11 -Wno-return-type -Wno-missing-profile" } class A { int m_fn1() const; diff --git a/gcc/testsuite/g++.dg/tree-prof/morefunc.C b/gcc/testsuite/g++.dg/tree-prof/morefunc.C index 2e3fc11..a9bdc16 100644 --- a/gcc/testsuite/g++.dg/tree-prof/morefunc.C +++ b/gcc/testsuite/g++.dg/tree-prof/morefunc.C @@ -1,4 +1,4 @@ -/* { dg-options "-O2 -fno-devirtualize --param=profile-func-internal-id=0 -fdump-ipa-profile -fdump-ipa-afdo -Wno-attributes -Wno-coverage-mismatch" } */ +/* { dg-options "-O2 -fno-devirtualize --param=profile-func-internal-id=0 -fdump-ipa-profile -fdump-ipa-afdo -Wno-attributes -Wno-coverage-mismatch -Wno-missing-profile" } */ #include "reorder_class1.h" #include "reorder_class2.h" diff --git a/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C b/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C index 41343ee..3c01383 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C +++ b/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C @@ -1,7 +1,7 @@ // PR tree-optimization/39557 // invalid post-dom info leads to infinite loop // { dg-do run } -// { dg-options "-Wall -fno-exceptions -O2 -fprofile-use -fopt-info -fno-rtti" } +// { dg-options "-Wall -fno-exceptions -O2 -fprofile-use -fopt-info -fno-rtti -Wno-missing-profile" } struct C { diff --git a/gcc/testsuite/gcc.dg/pr26570.c b/gcc/testsuite/gcc.dg/pr26570.c index 8ce8a44..007076f 100644 --- a/gcc/testsuite/gcc.dg/pr26570.c +++ b/gcc/testsuite/gcc.dg/pr26570.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fprofile-generate -fprofile-use -fopt-info" } */ +/* { dg-options "-O2 -fprofile-generate -fprofile-use -fopt-info -Wno-missing-profile" } */ /* { dg-require-profiling "-fprofile-generate" } */ unsigned test (unsigned a, unsigned b) diff --git a/gcc/testsuite/gcc.dg/pr32773.c b/gcc/testsuite/gcc.dg/pr32773.c index 19a9019..fe046d9 100644 --- a/gcc/testsuite/gcc.dg/pr32773.c +++ b/gcc/testsuite/gcc.dg/pr32773.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O -fprofile-use -fopt-info" } */ -/* { dg-options "-O -m4 -fprofile-use -fopt-info" { target sh-*-* } } */ +/* { dg-options "-O -fprofile-use -fopt-info -Wno-missing-profile" } */ +/* { dg-options "-O -m4 -fprofile-use -fopt-info -Wno-missing-profile" { target sh-*-* } } */ void foo (int *p) { diff --git a/gcc/testsuite/gcc.dg/pr40209.c b/gcc/testsuite/gcc.dg/pr40209.c index afe131f..4e77df5 100644 --- a/gcc/testsuite/gcc.dg/pr40209.c +++ b/gcc/testsuite/gcc.dg/pr40209.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fprofile-use -fopt-info" } */ +/* { dg-options "-O2 -fprofile-use -fopt-info -Wno-missing-profile" } */ void process(const char *s); diff --git a/gcc/testsuite/gcc.dg/pr51957-1.c b/gcc/testsuite/gcc.dg/pr51957-1.c index d899771..d6712b5 100644 --- a/gcc/testsuite/gcc.dg/pr51957-1.c +++ b/gcc/testsuite/gcc.dg/pr51957-1.c @@ -1,6 +1,6 @@ /* PR target/51957 */ /* { dg-do link } */ -/* { dg-options "-O2 -g -fprofile-use" } */ +/* { dg-options "-O2 -g -fprofile-use -Wno-missing-profile" } */ /* { dg-additional-sources "pr51957-2.c" } */ int v[128]; diff --git a/gcc/testsuite/gcc.dg/pr80747.c b/gcc/testsuite/gcc.dg/pr80747.c index ea9dd3c..8befab2 100644 --- a/gcc/testsuite/gcc.dg/pr80747.c +++ b/gcc/testsuite/gcc.dg/pr80747.c @@ -1,6 +1,6 @@ /* PR rtl-optimization/80747 */ /* { dg-do compile } */ -/* { dg-options "-fprofile-use -freorder-blocks-and-partition -O1 -foptimize-sibling-calls" } */ +/* { dg-options "-fprofile-use -freorder-blocks-and-partition -O1 -foptimize-sibling-calls -Wno-missing-profile" } */ int foo (int a) diff --git a/gcc/testsuite/gcc.target/aarch64/pr62262.c b/gcc/testsuite/gcc.target/aarch64/pr62262.c index 5bf90bf..6edb3c7 100644 --- a/gcc/testsuite/gcc.target/aarch64/pr62262.c +++ b/gcc/testsuite/gcc.target/aarch64/pr62262.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fprofile-use" } */ +/* { dg-options "-O2 -fprofile-use -Wno-missing-profile" } */ static inline int CLZ(int mask) { return mask ? __builtin_clz(mask) : 32; -- cgit v1.1 From 24676f1215413e6934132bfc6a25f1c02c9eecca Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Thu, 27 Sep 2018 21:54:09 +0200 Subject: rs6000: Delete many HAVE_AS_* (PR87149) This deletes most HAVE_AS_* that determine if the assembler supports some ISA level (and also HAVE_AS_MFPGPR and HAVE_AS_DFP). These are not useful: we will only generate an instruction that requires some newer ISA if the user specifically asked for it (with -mcpu=, say). If the assembler cannot handle that, it is fine if it gives an error. They also hurt: it increases the number of possible situations that all need handling and all need testing. We do not handle all cases, and obviously do not test all either. This patch removes: HAVE_AS_POPCNTB (power5, 2.02) HAVE_AS_FPRND (power5+, 2.04) HAVE_AS_CMPB (power6, 2.05) HAVE_AS_POPCNTD (power7, 2.06) HAVE_AS_POWER8 (power8, 2.07) HAVE_AS_POWER9 (power9, 3.0) HAVE_AS_DFP (power6, 2.05, server) HAVE_AS_MFPGPR (power6x but not later, not arch) PR target/87149 * config.in (HAVE_AS_CMPB, HAVE_AS_DFP, HAVE_AS_FPRND, HAVE_AS_MFPGPR, HAVE_AS_POPCNTB, HAVE_AS_POPCNTD, HAVE_AS_POWER8, HAVE_AS_POWER9): Delete, always treat as true. * config/powerpcspe/powerpcspe.c (rs6000_option_override_internal): Ditto. Simplify remaining code. * config/powerpcspe/powerpcspe.h: Ditto. * config/rs6000/rs6000.c (rs6000_option_override_internal): Ditto. Simplify remaining code. (rs6000_expand_builtin): Ditto. * config/rs6000/rs6000.h: Ditto. * configure.ac: Ditto. * configure: Regenerate. From-SVN: r264675 --- gcc/ChangeLog | 16 ++ gcc/config.in | 48 ----- gcc/config/powerpcspe/powerpcspe.c | 61 ------- gcc/config/powerpcspe/powerpcspe.h | 108 ----------- gcc/config/rs6000/rs6000.c | 44 ----- gcc/config/rs6000/rs6000.h | 104 ----------- gcc/configure | 356 ------------------------------------- gcc/configure.ac | 116 ------------ 8 files changed, 16 insertions(+), 837 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4cd9f8c..9520258 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2018-09-27 Segher Boessenkool + + PR target/87149 + * config.in (HAVE_AS_CMPB, HAVE_AS_DFP, HAVE_AS_FPRND, HAVE_AS_MFPGPR, + HAVE_AS_POPCNTB, HAVE_AS_POPCNTD, HAVE_AS_POWER8, HAVE_AS_POWER9): + Delete, always treat as true. + * config/powerpcspe/powerpcspe.c (rs6000_option_override_internal): + Ditto. Simplify remaining code. + * config/powerpcspe/powerpcspe.h: Ditto. + * config/rs6000/rs6000.c (rs6000_option_override_internal): Ditto. + Simplify remaining code. + (rs6000_expand_builtin): Ditto. + * config/rs6000/rs6000.h: Ditto. + * configure.ac: Ditto. + * configure: Regenerate. + 2018-09-27 Martin Liska * coverage.c (get_coverage_counts): Revert the formatting diff --git a/gcc/config.in b/gcc/config.in index 775536e..48dfd23 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -302,12 +302,6 @@ #endif -/* Define if your assembler supports cmpb. */ -#ifndef USED_FOR_TARGET -#undef HAVE_AS_CMPB -#endif - - /* Define to the level of your assembler's compressed debug section support. */ #ifndef USED_FOR_TARGET @@ -327,12 +321,6 @@ #endif -/* Define if your assembler supports DFP instructions. */ -#ifndef USED_FOR_TARGET -#undef HAVE_AS_DFP -#endif - - /* Define if your assembler supports .module. */ #ifndef USED_FOR_TARGET #undef HAVE_AS_DOT_MODULE @@ -382,12 +370,6 @@ #endif -/* Define if your assembler supports fprnd. */ -#ifndef USED_FOR_TARGET -#undef HAVE_AS_FPRND -#endif - - /* Define if your assembler supports the --gdwarf2 option. */ #ifndef USED_FOR_TARGET #undef HAVE_AS_GDWARF2_DEBUG_FLAG @@ -570,12 +552,6 @@ #endif -/* Define if your assembler supports mffgpr and mftgpr. */ -#ifndef USED_FOR_TARGET -#undef HAVE_AS_MFPGPR -#endif - - /* Define if your Mac OS X assembler supports the -mmacos-version-min option. */ #ifndef USED_FOR_TARGET @@ -607,30 +583,6 @@ #endif -/* Define if your assembler supports popcntb field. */ -#ifndef USED_FOR_TARGET -#undef HAVE_AS_POPCNTB -#endif - - -/* Define if your assembler supports POPCNTD instructions. */ -#ifndef USED_FOR_TARGET -#undef HAVE_AS_POPCNTD -#endif - - -/* Define if your assembler supports POWER8 instructions. */ -#ifndef USED_FOR_TARGET -#undef HAVE_AS_POWER8 -#endif - - -/* Define if your assembler supports POWER9 instructions. */ -#ifndef USED_FOR_TARGET -#undef HAVE_AS_POWER9 -#endif - - /* Define if your assembler supports .ref */ #ifndef USED_FOR_TARGET #undef HAVE_AS_REF diff --git a/gcc/config/powerpcspe/powerpcspe.c b/gcc/config/powerpcspe/powerpcspe.c index 325b6ad..90170c3 100644 --- a/gcc/config/powerpcspe/powerpcspe.c +++ b/gcc/config/powerpcspe/powerpcspe.c @@ -4196,67 +4196,6 @@ rs6000_option_override_internal (bool global_init_p) gcc_assert (cpu_index >= 0); - if (have_cpu) - { -#ifndef HAVE_AS_POWER9 - if (processor_target_table[rs6000_cpu_index].processor - == PROCESSOR_POWER9) - { - have_cpu = false; - warning (0, "will not generate power9 instructions because " - "assembler lacks power9 support"); - } -#endif -#ifndef HAVE_AS_POWER8 - if (processor_target_table[rs6000_cpu_index].processor - == PROCESSOR_POWER8) - { - have_cpu = false; - warning (0, "will not generate power8 instructions because " - "assembler lacks power8 support"); - } -#endif -#ifndef HAVE_AS_POPCNTD - if (processor_target_table[rs6000_cpu_index].processor - == PROCESSOR_POWER7) - { - have_cpu = false; - warning (0, "will not generate power7 instructions because " - "assembler lacks power7 support"); - } -#endif -#ifndef HAVE_AS_DFP - if (processor_target_table[rs6000_cpu_index].processor - == PROCESSOR_POWER6) - { - have_cpu = false; - warning (0, "will not generate power6 instructions because " - "assembler lacks power6 support"); - } -#endif -#ifndef HAVE_AS_POPCNTB - if (processor_target_table[rs6000_cpu_index].processor - == PROCESSOR_POWER5) - { - have_cpu = false; - warning (0, "will not generate power5 instructions because " - "assembler lacks power5 support"); - } -#endif - - if (!have_cpu) - { - /* PowerPC 64-bit LE requires at least ISA 2.07. */ - const char *default_cpu = (!TARGET_POWERPC64 - ? "powerpc" - : (BYTES_BIG_ENDIAN - ? "powerpc64" - : "powerpc64le")); - - rs6000_cpu_index = cpu_index = rs6000_cpu_name_lookup (default_cpu); - } - } - /* If we have a cpu, either through an explicit -mcpu= or if the compiler was configured with --with-cpu=, replace all of the ISA bits with those from the cpu, except for options that were explicitly set. If diff --git a/gcc/config/powerpcspe/powerpcspe.h b/gcc/config/powerpcspe/powerpcspe.h index 8f9ef5b..a30fe34 100644 --- a/gcc/config/powerpcspe/powerpcspe.h +++ b/gcc/config/powerpcspe/powerpcspe.h @@ -71,35 +71,11 @@ #define TARGET_PAIRED_FLOAT 0 #endif -#ifdef HAVE_AS_POPCNTB #define ASM_CPU_POWER5_SPEC "-mpower5" -#else -#define ASM_CPU_POWER5_SPEC "-mpower4" -#endif - -#ifdef HAVE_AS_DFP #define ASM_CPU_POWER6_SPEC "-mpower6 -maltivec" -#else -#define ASM_CPU_POWER6_SPEC "-mpower4 -maltivec" -#endif - -#ifdef HAVE_AS_POPCNTD #define ASM_CPU_POWER7_SPEC "-mpower7" -#else -#define ASM_CPU_POWER7_SPEC "-mpower4 -maltivec" -#endif - -#ifdef HAVE_AS_POWER8 #define ASM_CPU_POWER8_SPEC "-mpower8" -#else -#define ASM_CPU_POWER8_SPEC ASM_CPU_POWER7_SPEC -#endif - -#ifdef HAVE_AS_POWER9 #define ASM_CPU_POWER9_SPEC "-mpower9" -#else -#define ASM_CPU_POWER9_SPEC ASM_CPU_POWER8_SPEC -#endif #ifdef HAVE_AS_DCI #define ASM_CPU_476_SPEC "-m476" @@ -240,90 +216,6 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define TARGET_MFCRF 0 #endif -/* Define TARGET_POPCNTB if the target assembler does not support the - popcount byte instruction. */ - -#ifndef HAVE_AS_POPCNTB -#undef TARGET_POPCNTB -#define TARGET_POPCNTB 0 -#endif - -/* Define TARGET_FPRND if the target assembler does not support the - fp rounding instructions. */ - -#ifndef HAVE_AS_FPRND -#undef TARGET_FPRND -#define TARGET_FPRND 0 -#endif - -/* Define TARGET_CMPB if the target assembler does not support the - cmpb instruction. */ - -#ifndef HAVE_AS_CMPB -#undef TARGET_CMPB -#define TARGET_CMPB 0 -#endif - -/* Define TARGET_MFPGPR if the target assembler does not support the - mffpr and mftgpr instructions. */ - -#ifndef HAVE_AS_MFPGPR -#undef TARGET_MFPGPR -#define TARGET_MFPGPR 0 -#endif - -/* Define TARGET_DFP if the target assembler does not support decimal - floating point instructions. */ -#ifndef HAVE_AS_DFP -#undef TARGET_DFP -#define TARGET_DFP 0 -#endif - -/* Define TARGET_POPCNTD if the target assembler does not support the - popcount word and double word instructions. */ - -#ifndef HAVE_AS_POPCNTD -#undef TARGET_POPCNTD -#define TARGET_POPCNTD 0 -#endif - -/* Define the ISA 2.07 flags as 0 if the target assembler does not support the - waitasecond instruction. Allow -mpower8-fusion, since it does not add new - instructions. */ - -#ifndef HAVE_AS_POWER8 -#undef TARGET_DIRECT_MOVE -#undef TARGET_CRYPTO -#undef TARGET_HTM -#undef TARGET_P8_VECTOR -#define TARGET_DIRECT_MOVE 0 -#define TARGET_CRYPTO 0 -#define TARGET_HTM 0 -#define TARGET_P8_VECTOR 0 -#endif - -/* Define the ISA 3.0 flags as 0 if the target assembler does not support - Power9 instructions. Allow -mpower9-fusion, since it does not add new - instructions. Allow -misel, since it predates ISA 3.0 and does - not require any Power9 features. */ - -#ifndef HAVE_AS_POWER9 -#undef TARGET_FLOAT128_HW -#undef TARGET_MODULO -#undef TARGET_P9_VECTOR -#undef TARGET_P9_MINMAX -#undef TARGET_P9_DFORM_SCALAR -#undef TARGET_P9_DFORM_VECTOR -#undef TARGET_P9_MISC -#define TARGET_FLOAT128_HW 0 -#define TARGET_MODULO 0 -#define TARGET_P9_VECTOR 0 -#define TARGET_P9_MINMAX 0 -#define TARGET_P9_DFORM_SCALAR 0 -#define TARGET_P9_DFORM_VECTOR 0 -#define TARGET_P9_MISC 0 -#endif - /* Define TARGET_LWSYNC_INSTRUCTION if the assembler knows about lwsync. If not, generate the lwsync code as an integer constant. */ #ifdef HAVE_AS_LWSYNC diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index baa5851..e99d3db 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3871,48 +3871,6 @@ rs6000_option_override_internal (bool global_init_p) else if (OPTION_TARGET_CPU_DEFAULT) cpu_index = rs6000_cpu_name_lookup (OPTION_TARGET_CPU_DEFAULT); - if (cpu_index >= 0) - { - const char *unavailable_cpu = NULL; - switch (processor_target_table[cpu_index].processor) - { -#ifndef HAVE_AS_POWER9 - case PROCESSOR_POWER9: - unavailable_cpu = "power9"; - break; -#endif -#ifndef HAVE_AS_POWER8 - case PROCESSOR_POWER8: - unavailable_cpu = "power8"; - break; -#endif -#ifndef HAVE_AS_POPCNTD - case PROCESSOR_POWER7: - unavailable_cpu = "power7"; - break; -#endif -#ifndef HAVE_AS_DFP - case PROCESSOR_POWER6: - unavailable_cpu = "power6"; - break; -#endif -#ifndef HAVE_AS_POPCNTB - case PROCESSOR_POWER5: - unavailable_cpu = "power5"; - break; -#endif - default: - break; - } - if (unavailable_cpu) - { - cpu_index = -1; - warning (0, "will not generate %qs instructions because " - "assembler lacks %qs support", unavailable_cpu, - unavailable_cpu); - } - } - /* If we have a cpu, either through an explicit -mcpu= or if the compiler was configured with --with-cpu=, replace all of the ISA bits with those from the cpu, except for options that were explicitly set. If @@ -16018,7 +15976,6 @@ rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, overload table in rs6000-c.c to switch between the two. If we don't have the proper assembler, don't do this switch because CODE_FOR_*kf* and CODE_FOR_*tf* will be CODE_FOR_nothing. */ -#ifdef HAVE_AS_POWER9 if (FLOAT128_IEEE_P (TFmode)) switch (icode) { @@ -16039,7 +15996,6 @@ rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, case CODE_FOR_xsiexpqpf_kf: icode = CODE_FOR_xsiexpqpf_tf; break; case CODE_FOR_xststdcqp_kf: icode = CODE_FOR_xststdcqp_tf; break; } -#endif if (TARGET_DEBUG_BUILTIN) { diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 9ea5959..232d442 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -72,35 +72,11 @@ #define PPC405_ERRATUM77 0 #endif -#ifdef HAVE_AS_POPCNTB #define ASM_CPU_POWER5_SPEC "-mpower5" -#else -#define ASM_CPU_POWER5_SPEC "-mpower4" -#endif - -#ifdef HAVE_AS_DFP #define ASM_CPU_POWER6_SPEC "-mpower6 -maltivec" -#else -#define ASM_CPU_POWER6_SPEC "-mpower4 -maltivec" -#endif - -#ifdef HAVE_AS_POPCNTD #define ASM_CPU_POWER7_SPEC "-mpower7" -#else -#define ASM_CPU_POWER7_SPEC "-mpower4 -maltivec" -#endif - -#ifdef HAVE_AS_POWER8 #define ASM_CPU_POWER8_SPEC "-mpower8" -#else -#define ASM_CPU_POWER8_SPEC ASM_CPU_POWER7_SPEC -#endif - -#ifdef HAVE_AS_POWER9 #define ASM_CPU_POWER9_SPEC "-mpower9" -#else -#define ASM_CPU_POWER9_SPEC ASM_CPU_POWER8_SPEC -#endif #ifdef HAVE_AS_DCI #define ASM_CPU_476_SPEC "-m476" @@ -243,86 +219,6 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define TARGET_MFCRF 0 #endif -/* Define TARGET_POPCNTB if the target assembler does not support the - popcount byte instruction. */ - -#ifndef HAVE_AS_POPCNTB -#undef TARGET_POPCNTB -#define TARGET_POPCNTB 0 -#endif - -/* Define TARGET_FPRND if the target assembler does not support the - fp rounding instructions. */ - -#ifndef HAVE_AS_FPRND -#undef TARGET_FPRND -#define TARGET_FPRND 0 -#endif - -/* Define TARGET_CMPB if the target assembler does not support the - cmpb instruction. */ - -#ifndef HAVE_AS_CMPB -#undef TARGET_CMPB -#define TARGET_CMPB 0 -#endif - -/* Define TARGET_MFPGPR if the target assembler does not support the - mffpr and mftgpr instructions. */ - -#ifndef HAVE_AS_MFPGPR -#undef TARGET_MFPGPR -#define TARGET_MFPGPR 0 -#endif - -/* Define TARGET_DFP if the target assembler does not support decimal - floating point instructions. */ -#ifndef HAVE_AS_DFP -#undef TARGET_DFP -#define TARGET_DFP 0 -#endif - -/* Define TARGET_POPCNTD if the target assembler does not support the - popcount word and double word instructions. */ - -#ifndef HAVE_AS_POPCNTD -#undef TARGET_POPCNTD -#define TARGET_POPCNTD 0 -#endif - -/* Define the ISA 2.07 flags as 0 if the target assembler does not support the - waitasecond instruction. Allow -mpower8-fusion, since it does not add new - instructions. */ - -#ifndef HAVE_AS_POWER8 -#undef TARGET_DIRECT_MOVE -#undef TARGET_CRYPTO -#undef TARGET_HTM -#undef TARGET_P8_VECTOR -#define TARGET_DIRECT_MOVE 0 -#define TARGET_CRYPTO 0 -#define TARGET_HTM 0 -#define TARGET_P8_VECTOR 0 -#endif - -/* Define the ISA 3.0 flags as 0 if the target assembler does not support - Power9 instructions. Allow -mpower9-fusion, since it does not add new - instructions. Allow -misel, since it predates ISA 3.0 and does - not require any Power9 features. */ - -#ifndef HAVE_AS_POWER9 -#undef TARGET_FLOAT128_HW -#undef TARGET_MODULO -#undef TARGET_P9_VECTOR -#undef TARGET_P9_MINMAX -#undef TARGET_P9_MISC -#define TARGET_FLOAT128_HW 0 -#define TARGET_MODULO 0 -#define TARGET_P9_VECTOR 0 -#define TARGET_P9_MINMAX 0 -#define TARGET_P9_MISC 0 -#endif - /* Define TARGET_LWSYNC_INSTRUCTION if the assembler knows about lwsync. If not, generate the lwsync code as an integer constant. */ #ifdef HAVE_AS_LWSYNC diff --git a/gcc/configure b/gcc/configure index b3205ad..f2d5a6f 100755 --- a/gcc/configure +++ b/gcc/configure @@ -26629,141 +26629,6 @@ fi case $target in - *-*-aix*) conftest_s=' .machine "pwr5" - .csect .text[PR] - popcntb 3,3';; - *) conftest_s=' .machine power5 - .text - popcntb 3,3';; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for popcntb support" >&5 -$as_echo_n "checking assembler for popcntb support... " >&6; } -if test "${gcc_cv_as_powerpc_popcntb+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - gcc_cv_as_powerpc_popcntb=no - if test $in_tree_gas = yes; then - if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 17 \) \* 1000 + 0` - then gcc_cv_as_powerpc_popcntb=yes -fi - elif test x$gcc_cv_as != x; then - $as_echo "$conftest_s" > conftest.s - if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } - then - gcc_cv_as_powerpc_popcntb=yes - else - echo "configure: failed program was" >&5 - cat conftest.s >&5 - fi - rm -f conftest.o conftest.s - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_powerpc_popcntb" >&5 -$as_echo "$gcc_cv_as_powerpc_popcntb" >&6; } -if test $gcc_cv_as_powerpc_popcntb = yes; then - -$as_echo "#define HAVE_AS_POPCNTB 1" >>confdefs.h - -fi - - - case $target in - *-*-aix*) conftest_s=' .machine "pwr5x" - .csect .text[PR] - frin 1,1';; - *) conftest_s=' .machine power5 - .text - frin 1,1';; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for fp round support" >&5 -$as_echo_n "checking assembler for fp round support... " >&6; } -if test "${gcc_cv_as_powerpc_fprnd+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - gcc_cv_as_powerpc_fprnd=no - if test $in_tree_gas = yes; then - if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 17 \) \* 1000 + 0` - then gcc_cv_as_powerpc_fprnd=yes -fi - elif test x$gcc_cv_as != x; then - $as_echo "$conftest_s" > conftest.s - if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } - then - gcc_cv_as_powerpc_fprnd=yes - else - echo "configure: failed program was" >&5 - cat conftest.s >&5 - fi - rm -f conftest.o conftest.s - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_powerpc_fprnd" >&5 -$as_echo "$gcc_cv_as_powerpc_fprnd" >&6; } -if test $gcc_cv_as_powerpc_fprnd = yes; then - -$as_echo "#define HAVE_AS_FPRND 1" >>confdefs.h - -fi - - - case $target in - *-*-aix*) conftest_s=' .machine "pwr6" - .csect .text[PR] - mffgpr 1,3';; - *) conftest_s=' .machine power6 - .text - mffgpr 1,3';; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for move fp gpr support" >&5 -$as_echo_n "checking assembler for move fp gpr support... " >&6; } -if test "${gcc_cv_as_powerpc_mfpgpr+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - gcc_cv_as_powerpc_mfpgpr=no - if test $in_tree_gas = yes; then - if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2` - then gcc_cv_as_powerpc_mfpgpr=yes -fi - elif test x$gcc_cv_as != x; then - $as_echo "$conftest_s" > conftest.s - if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } - then - gcc_cv_as_powerpc_mfpgpr=yes - else - echo "configure: failed program was" >&5 - cat conftest.s >&5 - fi - rm -f conftest.o conftest.s - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_powerpc_mfpgpr" >&5 -$as_echo "$gcc_cv_as_powerpc_mfpgpr" >&6; } -if test $gcc_cv_as_powerpc_mfpgpr = yes; then - -$as_echo "#define HAVE_AS_MFPGPR 1" >>confdefs.h - -fi - - - case $target in *-*-aix*) conftest_s=' .csect .text[PR] LCF..0: addis 11,30,_GLOBAL_OFFSET_TABLE_-LCF..0@ha';; @@ -26813,96 +26678,6 @@ fi case $target in - *-*-aix*) conftest_s=' .machine "pwr6" - .csect .text[PR] - cmpb 3,4,5';; - *) conftest_s=' .machine power6 - .text - cmpb 3,4,5';; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for compare bytes support" >&5 -$as_echo_n "checking assembler for compare bytes support... " >&6; } -if test "${gcc_cv_as_powerpc_cmpb+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - gcc_cv_as_powerpc_cmpb=no - if test $in_tree_gas = yes; then - if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2` - then gcc_cv_as_powerpc_cmpb=yes -fi - elif test x$gcc_cv_as != x; then - $as_echo "$conftest_s" > conftest.s - if { ac_try='$gcc_cv_as $gcc_cv_as_flags -a32 -o conftest.o conftest.s >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } - then - gcc_cv_as_powerpc_cmpb=yes - else - echo "configure: failed program was" >&5 - cat conftest.s >&5 - fi - rm -f conftest.o conftest.s - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_powerpc_cmpb" >&5 -$as_echo "$gcc_cv_as_powerpc_cmpb" >&6; } -if test $gcc_cv_as_powerpc_cmpb = yes; then - -$as_echo "#define HAVE_AS_CMPB 1" >>confdefs.h - -fi - - - case $target in - *-*-aix*) conftest_s=' .machine "pwr6" - .csect .text[PR] - dadd 1,2,3';; - *) conftest_s=' .machine power6 - .text - dadd 1,2,3';; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for decimal float support" >&5 -$as_echo_n "checking assembler for decimal float support... " >&6; } -if test "${gcc_cv_as_powerpc_dfp+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - gcc_cv_as_powerpc_dfp=no - if test $in_tree_gas = yes; then - if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2` - then gcc_cv_as_powerpc_dfp=yes -fi - elif test x$gcc_cv_as != x; then - $as_echo "$conftest_s" > conftest.s - if { ac_try='$gcc_cv_as $gcc_cv_as_flags -a32 -o conftest.o conftest.s >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } - then - gcc_cv_as_powerpc_dfp=yes - else - echo "configure: failed program was" >&5 - cat conftest.s >&5 - fi - rm -f conftest.o conftest.s - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_powerpc_dfp" >&5 -$as_echo "$gcc_cv_as_powerpc_dfp" >&6; } -if test $gcc_cv_as_powerpc_dfp = yes; then - -$as_echo "#define HAVE_AS_DFP 1" >>confdefs.h - -fi - - - case $target in *-*-aix*) conftest_s=' .machine "pwr7" .csect .text[PR] lxvd2x 1,2,3';; @@ -26948,137 +26723,6 @@ fi case $target in - *-*-aix*) conftest_s=' .machine "pwr7" - .csect .text[PR] - popcntd 3,3';; - *) conftest_s=' .machine power7 - .text - popcntd 3,3';; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for popcntd support" >&5 -$as_echo_n "checking assembler for popcntd support... " >&6; } -if test "${gcc_cv_as_powerpc_popcntd+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - gcc_cv_as_powerpc_popcntd=no - if test $in_tree_gas = yes; then - if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2` - then gcc_cv_as_powerpc_popcntd=yes -fi - elif test x$gcc_cv_as != x; then - $as_echo "$conftest_s" > conftest.s - if { ac_try='$gcc_cv_as $gcc_cv_as_flags -a32 -o conftest.o conftest.s >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } - then - gcc_cv_as_powerpc_popcntd=yes - else - echo "configure: failed program was" >&5 - cat conftest.s >&5 - fi - rm -f conftest.o conftest.s - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_powerpc_popcntd" >&5 -$as_echo "$gcc_cv_as_powerpc_popcntd" >&6; } -if test $gcc_cv_as_powerpc_popcntd = yes; then - -$as_echo "#define HAVE_AS_POPCNTD 1" >>confdefs.h - -fi - - - case $target in - *-*-aix*) conftest_s=' .machine "pwr8" - .csect .text[PR]';; - *) conftest_s=' .machine power8 - .text';; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for power8 support" >&5 -$as_echo_n "checking assembler for power8 support... " >&6; } -if test "${gcc_cv_as_powerpc_power8+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - gcc_cv_as_powerpc_power8=no - if test $in_tree_gas = yes; then - if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2` - then gcc_cv_as_powerpc_power8=yes -fi - elif test x$gcc_cv_as != x; then - $as_echo "$conftest_s" > conftest.s - if { ac_try='$gcc_cv_as $gcc_cv_as_flags -a32 -o conftest.o conftest.s >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } - then - gcc_cv_as_powerpc_power8=yes - else - echo "configure: failed program was" >&5 - cat conftest.s >&5 - fi - rm -f conftest.o conftest.s - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_powerpc_power8" >&5 -$as_echo "$gcc_cv_as_powerpc_power8" >&6; } -if test $gcc_cv_as_powerpc_power8 = yes; then - -$as_echo "#define HAVE_AS_POWER8 1" >>confdefs.h - -fi - - - case $target in - *-*-aix*) conftest_s=' .machine "pwr9" - .csect .text[PR]';; - *) conftest_s=' .machine power9 - .text';; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for power9 support" >&5 -$as_echo_n "checking assembler for power9 support... " >&6; } -if test "${gcc_cv_as_powerpc_power9+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - gcc_cv_as_powerpc_power9=no - if test $in_tree_gas = yes; then - if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2` - then gcc_cv_as_powerpc_power9=yes -fi - elif test x$gcc_cv_as != x; then - $as_echo "$conftest_s" > conftest.s - if { ac_try='$gcc_cv_as $gcc_cv_as_flags -a32 -o conftest.o conftest.s >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } - then - gcc_cv_as_powerpc_power9=yes - else - echo "configure: failed program was" >&5 - cat conftest.s >&5 - fi - rm -f conftest.o conftest.s - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_powerpc_power9" >&5 -$as_echo "$gcc_cv_as_powerpc_power9" >&6; } -if test $gcc_cv_as_powerpc_power9 = yes; then - -$as_echo "#define HAVE_AS_POWER9 1" >>confdefs.h - -fi - - - case $target in *-*-aix*) conftest_s=' .csect .text[PR] lwsync';; *) conftest_s=' .text diff --git a/gcc/configure.ac b/gcc/configure.ac index 92cecbd..470fde6 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -4524,51 +4524,6 @@ gd: [Define if your assembler supports mfcr field.])]) case $target in - *-*-aix*) conftest_s=' .machine "pwr5" - .csect .text[[PR]] - popcntb 3,3';; - *) conftest_s=' .machine power5 - .text - popcntb 3,3';; - esac - - gcc_GAS_CHECK_FEATURE([popcntb support], - gcc_cv_as_powerpc_popcntb, [2,17,0],, - [$conftest_s],, - [AC_DEFINE(HAVE_AS_POPCNTB, 1, - [Define if your assembler supports popcntb field.])]) - - case $target in - *-*-aix*) conftest_s=' .machine "pwr5x" - .csect .text[[PR]] - frin 1,1';; - *) conftest_s=' .machine power5 - .text - frin 1,1';; - esac - - gcc_GAS_CHECK_FEATURE([fp round support], - gcc_cv_as_powerpc_fprnd, [2,17,0],, - [$conftest_s],, - [AC_DEFINE(HAVE_AS_FPRND, 1, - [Define if your assembler supports fprnd.])]) - - case $target in - *-*-aix*) conftest_s=' .machine "pwr6" - .csect .text[[PR]] - mffgpr 1,3';; - *) conftest_s=' .machine power6 - .text - mffgpr 1,3';; - esac - - gcc_GAS_CHECK_FEATURE([move fp gpr support], - gcc_cv_as_powerpc_mfpgpr, [2,19,2],, - [$conftest_s],, - [AC_DEFINE(HAVE_AS_MFPGPR, 1, - [Define if your assembler supports mffgpr and mftgpr.])]) - - case $target in *-*-aix*) conftest_s=' .csect .text[[PR]] LCF..0: addis 11,30,_GLOBAL_OFFSET_TABLE_-LCF..0@ha';; @@ -4588,36 +4543,6 @@ LCF0: [Define if your assembler supports R_PPC_REL16 relocs.])]) case $target in - *-*-aix*) conftest_s=' .machine "pwr6" - .csect .text[[PR]] - cmpb 3,4,5';; - *) conftest_s=' .machine power6 - .text - cmpb 3,4,5';; - esac - - gcc_GAS_CHECK_FEATURE([compare bytes support], - gcc_cv_as_powerpc_cmpb, [2,19,2], -a32, - [$conftest_s],, - [AC_DEFINE(HAVE_AS_CMPB, 1, - [Define if your assembler supports cmpb.])]) - - case $target in - *-*-aix*) conftest_s=' .machine "pwr6" - .csect .text[[PR]] - dadd 1,2,3';; - *) conftest_s=' .machine power6 - .text - dadd 1,2,3';; - esac - - gcc_GAS_CHECK_FEATURE([decimal float support], - gcc_cv_as_powerpc_dfp, [2,19,2], -a32, - [$conftest_s],, - [AC_DEFINE(HAVE_AS_DFP, 1, - [Define if your assembler supports DFP instructions.])]) - - case $target in *-*-aix*) conftest_s=' .machine "pwr7" .csect .text[[PR]] lxvd2x 1,2,3';; @@ -4633,47 +4558,6 @@ LCF0: [Define if your assembler supports VSX instructions.])]) case $target in - *-*-aix*) conftest_s=' .machine "pwr7" - .csect .text[[PR]] - popcntd 3,3';; - *) conftest_s=' .machine power7 - .text - popcntd 3,3';; - esac - - gcc_GAS_CHECK_FEATURE([popcntd support], - gcc_cv_as_powerpc_popcntd, [2,19,2], -a32, - [$conftest_s],, - [AC_DEFINE(HAVE_AS_POPCNTD, 1, - [Define if your assembler supports POPCNTD instructions.])]) - - case $target in - *-*-aix*) conftest_s=' .machine "pwr8" - .csect .text[[PR]]';; - *) conftest_s=' .machine power8 - .text';; - esac - - gcc_GAS_CHECK_FEATURE([power8 support], - gcc_cv_as_powerpc_power8, [2,19,2], -a32, - [$conftest_s],, - [AC_DEFINE(HAVE_AS_POWER8, 1, - [Define if your assembler supports POWER8 instructions.])]) - - case $target in - *-*-aix*) conftest_s=' .machine "pwr9" - .csect .text[[PR]]';; - *) conftest_s=' .machine power9 - .text';; - esac - - gcc_GAS_CHECK_FEATURE([power9 support], - gcc_cv_as_powerpc_power9, [2,19,2], -a32, - [$conftest_s],, - [AC_DEFINE(HAVE_AS_POWER9, 1, - [Define if your assembler supports POWER9 instructions.])]) - - case $target in *-*-aix*) conftest_s=' .csect .text[[PR]] lwsync';; *) conftest_s=' .text -- cgit v1.1 From eaa17c21bac19e2abbcec9470e1537412a179909 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 27 Sep 2018 22:04:15 +0200 Subject: i386.md (FPSR_REG): Remove. * config/i386/i386.md (FPSR_REG): Remove. (x86_fnstcw_1): Use (const_int 0) instead of FPCR_REG. (x86_fldcw_1): Remove insn pattern. (fnstenv): Do not clobber FPCR_REG. (fldenv): Ditto. * config/i386/i386.h (FIXED_REGISTERS) Remove fpsr register. (CALL_USED_REGISTERS): Ditto. (REG_ALLOC_ORDER): Ditto. (REG_CLASS_CONTENTS): Ditto. (HI_REGISTER_NAMES): Ditto. (ADDITIONAL_REGISTER_NAMES): Use defines instead of numerical constants. * config/i386/i386.c (regclass_map): Remove fpsr register. (dbx_register_map): Ditto. (dbx64_register_map): Ditto. (svr4_dbx_register_map): Ditto. (print_reg): Do not handle FPCR_REG. testsuite/ChangeLog: * gcc.dg/rtl/x86_64/dfinit.c: Update scan-rtl-dump string. * gcc.dg/rtl/x86_64/times-two.c.before-df.c: Ditto. * gcc.target/i386/pr79804.c (foo): Use register "19", not "20". From-SVN: r264676 --- gcc/ChangeLog | 20 +++ gcc/config/i386/i386.c | 15 +-- gcc/config/i386/i386.h | 132 ++++++++++---------- gcc/config/i386/i386.md | 134 +++++++++------------ gcc/testsuite/ChangeLog | 6 + gcc/testsuite/gcc.dg/rtl/x86_64/dfinit.c | 2 +- .../gcc.dg/rtl/x86_64/times-two.c.before-df.c | 2 +- gcc/testsuite/gcc.target/i386/pr79804.c | 4 +- 8 files changed, 162 insertions(+), 153 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9520258..a53b9a8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,23 @@ +2018-09-27 Uros Bizjak + + * config/i386/i386.md (FPSR_REG): Remove. + (x86_fnstcw_1): Use (const_int 0) instead of FPCR_REG. + (x86_fldcw_1): Remove insn pattern. + (fnstenv): Do not clobber FPCR_REG. + (fldenv): Ditto. + * config/i386/i386.h (FIXED_REGISTERS) Remove fpsr register. + (CALL_USED_REGISTERS): Ditto. + (REG_ALLOC_ORDER): Ditto. + (REG_CLASS_CONTENTS): Ditto. + (HI_REGISTER_NAMES): Ditto. + (ADDITIONAL_REGISTER_NAMES): Use defines instead + of numerical constants. + * config/i386/i386.c (regclass_map): Remove fpsr register. + (dbx_register_map): Ditto. + (dbx64_register_map): Ditto. + (svr4_dbx_register_map): Ditto. + (print_reg): Do not handle FPCR_REG. + 2018-09-27 Segher Boessenkool PR target/87149 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index ef72219..4f64e67 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -241,10 +241,8 @@ enum reg_class const regclass_map[FIRST_PSEUDO_REGISTER] = /* FP registers */ FP_TOP_REG, FP_SECOND_REG, FLOAT_REGS, FLOAT_REGS, FLOAT_REGS, FLOAT_REGS, FLOAT_REGS, FLOAT_REGS, - /* arg pointer */ - NON_Q_REGS, - /* flags, fpsr, fpcr, frame */ - NO_REGS, NO_REGS, NO_REGS, NON_Q_REGS, + /* arg pointer, flags, fpsr, frame */ + NON_Q_REGS, NO_REGS, NO_REGS, NON_Q_REGS, /* SSE registers */ SSE_FIRST_REG, SSE_REGS, SSE_REGS, SSE_REGS, SSE_REGS, SSE_REGS, SSE_REGS, SSE_REGS, @@ -273,7 +271,7 @@ int const dbx_register_map[FIRST_PSEUDO_REGISTER] = { 0, 2, 1, 3, 6, 7, 4, 5, /* general regs */ 12, 13, 14, 15, 16, 17, 18, 19, /* fp regs */ - -1, -1, -1, -1, -1, /* arg, flags, fpsr, fpcr, frame */ + -1, -1, -1, -1, /* arg, flags, fpsr, frame */ 21, 22, 23, 24, 25, 26, 27, 28, /* SSE */ 29, 30, 31, 32, 33, 34, 35, 36, /* MMX */ -1, -1, -1, -1, -1, -1, -1, -1, /* extended integer registers */ @@ -289,7 +287,7 @@ int const dbx64_register_map[FIRST_PSEUDO_REGISTER] = { 0, 1, 2, 3, 4, 5, 6, 7, /* general regs */ 33, 34, 35, 36, 37, 38, 39, 40, /* fp regs */ - -1, -1, -1, -1, -1, /* arg, flags, fpsr, fpcr, frame */ + -1, -1, -1, -1, /* arg, flags, fpsr, frame */ 17, 18, 19, 20, 21, 22, 23, 24, /* SSE */ 41, 42, 43, 44, 45, 46, 47, 48, /* MMX */ 8,9,10,11,12,13,14,15, /* extended integer registers */ @@ -357,7 +355,7 @@ int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER] = { 0, 2, 1, 3, 6, 7, 5, 4, /* general regs */ 11, 12, 13, 14, 15, 16, 17, 18, /* fp regs */ - -1, 9, -1, -1, -1, /* arg, flags, fpsr, fpcr, frame */ + -1, 9, -1, -1, /* arg, flags, fpsr, frame */ 21, 22, 23, 24, 25, 26, 27, 28, /* SSE registers */ 29, 30, 31, 32, 33, 34, 35, 36, /* MMX registers */ -1, -1, -1, -1, -1, -1, -1, -1, /* extended integer registers */ @@ -17372,8 +17370,7 @@ print_reg (rtx x, int code, FILE *file) if (regno == ARG_POINTER_REGNUM || regno == FRAME_POINTER_REGNUM - || regno == FPSR_REG - || regno == FPCR_REG) + || regno == FPSR_REG) { output_operand_lossage ("invalid use of register '%s'", reg_names[regno]); diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 6445ee5..0b0e2ed 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1026,8 +1026,8 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define FIXED_REGISTERS \ /*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7*/ \ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, \ -/*arg,flags,fpsr,fpcr,frame*/ \ - 1, 1, 1, 1, 1, \ +/*arg,flags,fpsr,frame*/ \ + 1, 1, 1, 1, \ /*xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7*/ \ 0, 0, 0, 0, 0, 0, 0, 0, \ /* mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7*/ \ @@ -1063,8 +1063,8 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define CALL_USED_REGISTERS \ /*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7*/ \ { 1, 1, 1, 0, 4, 4, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ -/*arg,flags,fpsr,fpcr,frame*/ \ - 1, 1, 1, 1, 1, \ +/*arg,flags,fpsr,frame*/ \ + 1, 1, 1, 1, \ /*xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7*/ \ 1, 1, 1, 1, 1, 1, 6, 6, \ /* mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7*/ \ @@ -1089,12 +1089,12 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); The ADJUST_REG_ALLOC_ORDER actually overwrite the order, so this is just empty initializer for array. */ -#define REG_ALLOC_ORDER \ -{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,\ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, \ - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, \ - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, \ - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76 } +#define REG_ALLOC_ORDER \ +{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, \ + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, \ + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, \ + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, \ + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75 } /* ADJUST_REG_ALLOC_ORDER is a macro which permits reg_alloc_order to be rearranged based on a particular function. When using sse math, @@ -1315,7 +1315,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); For any two classes, it is very desirable that there be another class that represents their union. - The flags, fpsr and fpcr registers are in no class. */ + The flags and fpsr registers are in no class. */ enum reg_class { @@ -1411,36 +1411,36 @@ enum reg_class TARGET_CONDITIONAL_REGISTER_USAGE. */ #define REG_CLASS_CONTENTS \ -{ { 0x0, 0x0, 0x0 }, /* NO_REGS */ \ - { 0x01, 0x0, 0x0 }, /* AREG */ \ - { 0x02, 0x0, 0x0 }, /* DREG */ \ - { 0x04, 0x0, 0x0 }, /* CREG */ \ - { 0x08, 0x0, 0x0 }, /* BREG */ \ - { 0x10, 0x0, 0x0 }, /* SIREG */ \ - { 0x20, 0x0, 0x0 }, /* DIREG */ \ - { 0x03, 0x0, 0x0 }, /* AD_REGS */ \ - { 0x07, 0x0, 0x0 }, /* CLOBBERED_REGS */ \ - { 0x0f, 0x0, 0x0 }, /* Q_REGS */ \ - { 0x1100f0, 0x0, 0x0 }, /* NON_Q_REGS */ \ - { 0x7e, 0x1fe0, 0x0 }, /* TLS_GOTBASE_REGS */ \ - { 0x7f, 0x1fe0, 0x0 }, /* INDEX_REGS */ \ - { 0x1100ff, 0x0, 0x0 }, /* LEGACY_REGS */ \ - { 0x1100ff, 0x1fe0, 0x0 }, /* GENERAL_REGS */ \ - { 0x100, 0x0, 0x0 }, /* FP_TOP_REG */ \ - { 0x0200, 0x0, 0x0 }, /* FP_SECOND_REG */ \ - { 0xff00, 0x0, 0x0 }, /* FLOAT_REGS */ \ - { 0x200000, 0x0, 0x0 }, /* SSE_FIRST_REG */ \ -{ 0x1fe00000, 0x0, 0x0 }, /* NO_REX_SSE_REGS */ \ -{ 0x1fe00000, 0x1fe000, 0x0 }, /* SSE_REGS */ \ -{ 0x1fe00000, 0xffffe000, 0x1f }, /* ALL_SSE_REGS */ \ -{ 0xe0000000, 0x1f, 0x0 }, /* MMX_REGS */ \ -{ 0x1fe0ff00, 0xffffe000, 0x1f }, /* FLOAT_SSE_REGS */ \ -{ 0x11ffff, 0x1fe0, 0x0 }, /* FLOAT_INT_REGS */ \ -{ 0x1ff100ff, 0xffffffe0, 0x1f }, /* INT_SSE_REGS */ \ -{ 0x1ff1ffff, 0xffffffe0, 0x1f }, /* FLOAT_INT_SSE_REGS */ \ - { 0x0, 0x0, 0x1fc0 }, /* MASK_REGS */ \ - { 0x0, 0x0, 0x1fe0 }, /* ALL_MASK_REGS */ \ -{ 0xffffffff, 0xffffffff, 0x1fff } /* ALL_REGS */ \ +{ { 0x0, 0x0, 0x0 }, /* NO_REGS */ \ + { 0x01, 0x0, 0x0 }, /* AREG */ \ + { 0x02, 0x0, 0x0 }, /* DREG */ \ + { 0x04, 0x0, 0x0 }, /* CREG */ \ + { 0x08, 0x0, 0x0 }, /* BREG */ \ + { 0x10, 0x0, 0x0 }, /* SIREG */ \ + { 0x20, 0x0, 0x0 }, /* DIREG */ \ + { 0x03, 0x0, 0x0 }, /* AD_REGS */ \ + { 0x07, 0x0, 0x0 }, /* CLOBBERED_REGS */ \ + { 0x0f, 0x0, 0x0 }, /* Q_REGS */ \ + { 0x900f0, 0x0, 0x0 }, /* NON_Q_REGS */ \ + { 0x7e, 0xff0, 0x0 }, /* TLS_GOTBASE_REGS */ \ + { 0x7f, 0xff0, 0x0 }, /* INDEX_REGS */ \ + { 0x900ff, 0x0, 0x0 }, /* LEGACY_REGS */ \ + { 0x900ff, 0xff0, 0x0 }, /* GENERAL_REGS */ \ + { 0x100, 0x0, 0x0 }, /* FP_TOP_REG */ \ + { 0x200, 0x0, 0x0 }, /* FP_SECOND_REG */ \ + { 0xff00, 0x0, 0x0 }, /* FLOAT_REGS */ \ + { 0x100000, 0x0, 0x0 }, /* SSE_FIRST_REG */ \ + { 0xff00000, 0x0, 0x0 }, /* NO_REX_SSE_REGS */ \ + { 0xff00000, 0xff000, 0x0 }, /* SSE_REGS */ \ + { 0xff00000, 0xfffff000, 0xf }, /* ALL_SSE_REGS */ \ +{ 0xf0000000, 0xf, 0x0 }, /* MMX_REGS */ \ + { 0xff0ff00, 0xfffff000, 0xf }, /* FLOAT_SSE_REGS */ \ + { 0x9ffff, 0xff0, 0x0 }, /* FLOAT_INT_REGS */ \ + { 0xff900ff, 0xfffffff0, 0xf }, /* INT_SSE_REGS */ \ + { 0xff9ffff, 0xfffffff0, 0xf }, /* FLOAT_INT_SSE_REGS */ \ + { 0x0, 0x0, 0xfe0 }, /* MASK_REGS */ \ + { 0x0, 0x0, 0xff0 }, /* ALL_MASK_REGS */ \ +{ 0xffffffff, 0xffffffff, 0xfff } /* ALL_REGS */ \ } /* The same information, inverted: @@ -2022,7 +2022,7 @@ do { \ #define HI_REGISTER_NAMES \ {"ax","dx","cx","bx","si","di","bp","sp", \ "st","st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)", \ - "argp", "flags", "fpsr", "fpcr", "frame", \ + "argp", "flags", "fpsr", "frame", \ "xmm0","xmm1","xmm2","xmm3","xmm4","xmm5","xmm6","xmm7", \ "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7", \ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \ @@ -2037,29 +2037,31 @@ do { \ /* Table of additional register names to use in user input. */ -#define ADDITIONAL_REGISTER_NAMES \ -{ { "eax", 0 }, { "edx", 1 }, { "ecx", 2 }, { "ebx", 3 }, \ - { "esi", 4 }, { "edi", 5 }, { "ebp", 6 }, { "esp", 7 }, \ - { "rax", 0 }, { "rdx", 1 }, { "rcx", 2 }, { "rbx", 3 }, \ - { "rsi", 4 }, { "rdi", 5 }, { "rbp", 6 }, { "rsp", 7 }, \ - { "al", 0 }, { "dl", 1 }, { "cl", 2 }, { "bl", 3 }, \ - { "ah", 0 }, { "dh", 1 }, { "ch", 2 }, { "bh", 3 }, \ - { "ymm0", 21}, { "ymm1", 22}, { "ymm2", 23}, { "ymm3", 24}, \ - { "ymm4", 25}, { "ymm5", 26}, { "ymm6", 27}, { "ymm7", 28}, \ - { "ymm8", 45}, { "ymm9", 46}, { "ymm10", 47}, { "ymm11", 48}, \ - { "ymm12", 49}, { "ymm13", 50}, { "ymm14", 51}, { "ymm15", 52}, \ - { "ymm16", 53}, { "ymm17", 54}, { "ymm18", 55}, { "ymm19", 56}, \ - { "ymm20", 57}, { "ymm21", 58}, { "ymm22", 59}, { "ymm23", 60}, \ - { "ymm24", 61}, { "ymm25", 62}, { "ymm26", 63}, { "ymm27", 64}, \ - { "ymm28", 65}, { "ymm29", 66}, { "ymm30", 67}, { "ymm31", 68}, \ - { "zmm0", 21}, { "zmm1", 22}, { "zmm2", 23}, { "zmm3", 24}, \ - { "zmm4", 25}, { "zmm5", 26}, { "zmm6", 27}, { "zmm7", 28}, \ - { "zmm8", 45}, { "zmm9", 46}, { "zmm10", 47}, { "zmm11", 48}, \ - { "zmm12", 49}, { "zmm13", 50}, { "zmm14", 51}, { "zmm15", 52}, \ - { "zmm16", 53}, { "zmm17", 54}, { "zmm18", 55}, { "zmm19", 56}, \ - { "zmm20", 57}, { "zmm21", 58}, { "zmm22", 59}, { "zmm23", 60}, \ - { "zmm24", 61}, { "zmm25", 62}, { "zmm26", 63}, { "zmm27", 64}, \ - { "zmm28", 65}, { "zmm29", 66}, { "zmm30", 67}, { "zmm31", 68} } +#define ADDITIONAL_REGISTER_NAMES \ +{ \ + { "eax", AX_REG }, { "edx", DX_REG }, { "ecx", CX_REG }, { "ebx", BX_REG }, \ + { "esi", SI_REG }, { "edi", DI_REG }, { "ebp", BP_REG }, { "esp", SP_REG }, \ + { "rax", AX_REG }, { "rdx", DX_REG }, { "rcx", CX_REG }, { "rbx", BX_REG }, \ + { "rsi", SI_REG }, { "rdi", DI_REG }, { "rbp", BP_REG }, { "rsp", SP_REG }, \ + { "al", AX_REG }, { "dl", DX_REG }, { "cl", CX_REG }, { "bl", BX_REG }, \ + { "ah", AX_REG }, { "dh", DX_REG }, { "ch", CX_REG }, { "bh", BX_REG }, \ + { "ymm0", XMM0_REG }, { "ymm1", XMM1_REG }, { "ymm2", XMM2_REG }, { "ymm3", XMM3_REG }, \ + { "ymm4", XMM4_REG }, { "ymm5", XMM5_REG }, { "ymm6", XMM6_REG }, { "ymm7", XMM7_REG }, \ + { "ymm8", XMM8_REG }, { "ymm9", XMM9_REG }, { "ymm10", XMM10_REG }, { "ymm11", XMM11_REG }, \ + { "ymm12", XMM12_REG }, { "ymm13", XMM13_REG }, { "ymm14", XMM14_REG }, { "ymm15", XMM15_REG }, \ + { "ymm16", XMM16_REG }, { "ymm17", XMM17_REG }, { "ymm18", XMM18_REG }, { "ymm19", XMM19_REG }, \ + { "ymm20", XMM20_REG }, { "ymm21", XMM21_REG }, { "ymm22", XMM22_REG }, { "ymm23", XMM23_REG }, \ + { "ymm24", XMM24_REG }, { "ymm25", XMM25_REG }, { "ymm26", XMM26_REG }, { "ymm27", XMM27_REG }, \ + { "ymm28", XMM28_REG }, { "ymm29", XMM29_REG }, { "ymm30", XMM30_REG }, { "ymm31", XMM31_REG }, \ + { "zmm0", XMM0_REG }, { "zmm1", XMM1_REG }, { "zmm2", XMM2_REG }, { "zmm3", XMM3_REG }, \ + { "zmm4", XMM4_REG }, { "zmm5", XMM5_REG }, { "zmm6", XMM6_REG }, { "zmm7", XMM7_REG }, \ + { "zmm8", XMM8_REG }, { "zmm9", XMM9_REG }, { "zmm10", XMM10_REG }, { "zmm11", XMM11_REG }, \ + { "zmm12", XMM12_REG }, { "zmm13", XMM13_REG }, { "zmm14", XMM14_REG }, { "zmm15", XMM15_REG }, \ + { "zmm16", XMM16_REG }, { "zmm17", XMM17_REG }, { "zmm18", XMM18_REG }, { "zmm19", XMM19_REG }, \ + { "zmm20", XMM20_REG }, { "zmm21", XMM21_REG }, { "zmm22", XMM22_REG }, { "zmm23", XMM23_REG }, \ + { "zmm24", XMM24_REG }, { "zmm25", XMM25_REG }, { "zmm26", XMM26_REG }, { "zmm27", XMM27_REG }, \ + { "zmm28", XMM28_REG }, { "zmm29", XMM29_REG }, { "zmm30", XMM30_REG }, { "zmm31", XMM31_REG } \ +} /* Note we are omitting these since currently I don't know how to get gcc to use these, since they want the same but different diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 86f2c03..e85bfc0 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -359,65 +359,64 @@ (ARGP_REG 16) (FLAGS_REG 17) (FPSR_REG 18) - (FPCR_REG 19) - (FRAME_REG 20) - (XMM0_REG 21) - (XMM1_REG 22) - (XMM2_REG 23) - (XMM3_REG 24) - (XMM4_REG 25) - (XMM5_REG 26) - (XMM6_REG 27) - (XMM7_REG 28) - (MM0_REG 29) - (MM1_REG 30) - (MM2_REG 31) - (MM3_REG 32) - (MM4_REG 33) - (MM5_REG 34) - (MM6_REG 35) - (MM7_REG 36) - (R8_REG 37) - (R9_REG 38) - (R10_REG 39) - (R11_REG 40) - (R12_REG 41) - (R13_REG 42) - (R14_REG 43) - (R15_REG 44) - (XMM8_REG 45) - (XMM9_REG 46) - (XMM10_REG 47) - (XMM11_REG 48) - (XMM12_REG 49) - (XMM13_REG 50) - (XMM14_REG 51) - (XMM15_REG 52) - (XMM16_REG 53) - (XMM17_REG 54) - (XMM18_REG 55) - (XMM19_REG 56) - (XMM20_REG 57) - (XMM21_REG 58) - (XMM22_REG 59) - (XMM23_REG 60) - (XMM24_REG 61) - (XMM25_REG 62) - (XMM26_REG 63) - (XMM27_REG 64) - (XMM28_REG 65) - (XMM29_REG 66) - (XMM30_REG 67) - (XMM31_REG 68) - (MASK0_REG 69) - (MASK1_REG 70) - (MASK2_REG 71) - (MASK3_REG 72) - (MASK4_REG 73) - (MASK5_REG 74) - (MASK6_REG 75) - (MASK7_REG 76) - (FIRST_PSEUDO_REG 77) + (FRAME_REG 19) + (XMM0_REG 20) + (XMM1_REG 21) + (XMM2_REG 22) + (XMM3_REG 23) + (XMM4_REG 24) + (XMM5_REG 25) + (XMM6_REG 26) + (XMM7_REG 27) + (MM0_REG 28) + (MM1_REG 29) + (MM2_REG 30) + (MM3_REG 31) + (MM4_REG 32) + (MM5_REG 33) + (MM6_REG 34) + (MM7_REG 35) + (R8_REG 36) + (R9_REG 37) + (R10_REG 38) + (R11_REG 39) + (R12_REG 40) + (R13_REG 41) + (R14_REG 42) + (R15_REG 43) + (XMM8_REG 44) + (XMM9_REG 45) + (XMM10_REG 46) + (XMM11_REG 47) + (XMM12_REG 48) + (XMM13_REG 49) + (XMM14_REG 50) + (XMM15_REG 51) + (XMM16_REG 52) + (XMM17_REG 53) + (XMM18_REG 54) + (XMM19_REG 55) + (XMM20_REG 56) + (XMM21_REG 57) + (XMM22_REG 58) + (XMM23_REG 59) + (XMM24_REG 60) + (XMM25_REG 61) + (XMM26_REG 62) + (XMM27_REG 63) + (XMM28_REG 64) + (XMM29_REG 65) + (XMM30_REG 66) + (XMM31_REG 67) + (MASK0_REG 68) + (MASK1_REG 69) + (MASK2_REG 70) + (MASK3_REG 71) + (MASK4_REG 72) + (MASK5_REG 73) + (MASK6_REG 74) + (MASK7_REG 75) + (FIRST_PSEUDO_REG 76) ]) ;; Insns whose names begin with "x86_" are emitted by gen_FOO calls @@ -5043,7 +5042,7 @@ (define_insn "x86_fnstcw_1" [(set (match_operand:HI 0 "memory_operand" "=m") - (unspec:HI [(reg:HI FPCR_REG)] UNSPEC_FSTCW))] + (unspec:HI [(const_int 0)] UNSPEC_FSTCW))] "TARGET_80387" "fnstcw\t%0" [(set (attr "length") @@ -5051,19 +5050,6 @@ (set_attr "mode" "HI") (set_attr "unit" "i387") (set_attr "bdver1_decode" "vector")]) - -(define_insn "x86_fldcw_1" - [(set (reg:HI FPCR_REG) - (unspec:HI [(match_operand:HI 0 "memory_operand" "m")] UNSPEC_FLDCW))] - "TARGET_80387" - "fldcw\t%0" - [(set (attr "length") - (symbol_ref "ix86_attr_length_address_default (insn) + 2")) - (set_attr "mode" "HI") - (set_attr "unit" "i387") - (set_attr "athlon_decode" "vector") - (set_attr "amdfam10_decode" "vector") - (set_attr "bdver1_decode" "vector")]) ;; Conversion between fixed point and floating point. @@ -19603,7 +19589,6 @@ (define_insn "fnstenv" [(set (match_operand:BLK 0 "memory_operand" "=m") (unspec_volatile:BLK [(const_int 0)] UNSPECV_FNSTENV)) - (clobber (reg:HI FPCR_REG)) (clobber (reg:XF ST0_REG)) (clobber (reg:XF ST1_REG)) (clobber (reg:XF ST2_REG)) @@ -19623,7 +19608,6 @@ [(unspec_volatile [(match_operand:BLK 0 "memory_operand" "m")] UNSPECV_FLDENV) (clobber (reg:CCFP FPSR_REG)) - (clobber (reg:HI FPCR_REG)) (clobber (reg:XF ST0_REG)) (clobber (reg:XF ST1_REG)) (clobber (reg:XF ST2_REG)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 834b9b0..7f46bc8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-09-27 Uros Bizjak + + * gcc.dg/rtl/x86_64/dfinit.c: Update scan-rtl-dump string. + * gcc.dg/rtl/x86_64/times-two.c.before-df.c: Ditto. + * gcc.target/i386/pr79804.c (foo): Use register "19", not "20". + 2018-09-27 Martin Liska * g++.dg/pr60518.C: Add -Wno-missing-profile. diff --git a/gcc/testsuite/gcc.dg/rtl/x86_64/dfinit.c b/gcc/testsuite/gcc.dg/rtl/x86_64/dfinit.c index 242d8fa..81d3faa 100644 --- a/gcc/testsuite/gcc.dg/rtl/x86_64/dfinit.c +++ b/gcc/testsuite/gcc.dg/rtl/x86_64/dfinit.c @@ -112,5 +112,5 @@ int __RTL (startwith ("no-opt dfinit")) test_1 (int i, int j, int k) frontend, the exit block use of reg 0 (ax) wasn't picked up on, due to not setting up crtl->return_rtx based on DECL_RESULT (fndecl). */ -/* { dg-final { scan-rtl-dump ";; exit block uses.*0 .ax. 6 .bp. 7 .sp. 20 .frame." "dfinit" } } */ +/* { dg-final { scan-rtl-dump ";; exit block uses.*0 .ax. 6 .bp. 7 .sp. 19 .frame." "dfinit" } } */ /* { dg-final { scan-rtl-dump ";; regs ever live.*0 .ax. 1 .dx. 4 .si. 5 .di. 17 .flags." "dfinit" } } */ diff --git a/gcc/testsuite/gcc.dg/rtl/x86_64/times-two.c.before-df.c b/gcc/testsuite/gcc.dg/rtl/x86_64/times-two.c.before-df.c index 84fd2c6..687ae63 100644 --- a/gcc/testsuite/gcc.dg/rtl/x86_64/times-two.c.before-df.c +++ b/gcc/testsuite/gcc.dg/rtl/x86_64/times-two.c.before-df.c @@ -49,6 +49,6 @@ int __RTL (startwith ("rtl-dfinit")) times_two (int i) on, due to not setting up crtl->return_rtx based on DECL_RESULT (fndecl). */ -/* { dg-final { scan-rtl-dump ";; exit block uses.*0 .ax. 6 .bp. 7 .sp. 20 .frame." "dfinit" } } */ +/* { dg-final { scan-rtl-dump ";; exit block uses.*0 .ax. 6 .bp. 7 .sp. 19 .frame." "dfinit" } } */ /* { dg-final { scan-rtl-dump ";; regs ever live.*0 .ax. 5 .di. 17 .flags." "dfinit" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr79804.c b/gcc/testsuite/gcc.target/i386/pr79804.c index c7dda69..10adb44 100644 --- a/gcc/testsuite/gcc.target/i386/pr79804.c +++ b/gcc/testsuite/gcc.target/i386/pr79804.c @@ -4,7 +4,7 @@ void foo (void) { - register int r20 asm ("20"); + register int r19 asm ("19"); - asm volatile ("# %0" : "=r"(r20)); /* { dg-error "invalid use of register" } */ + asm volatile ("# %0" : "=r"(r19)); /* { dg-error "invalid use of register" } */ } /* { dg-error "cannot be used in asm here" } */ -- cgit v1.1 From f3f518f2d86c2fe15887b35882f5ae74eb0e1693 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 27 Sep 2018 22:21:06 +0200 Subject: i386.md (UNSPEC_FLDCW): Remove. * config/i386/i386.md (UNSPEC_FLDCW): Remove. From-SVN: r264677 --- gcc/ChangeLog | 3 ++- gcc/config/i386/i386.md | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a53b9a8..f0b82bc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,7 @@ 2018-09-27 Uros Bizjak - * config/i386/i386.md (FPSR_REG): Remove. + * config/i386/i386.md (FPCR_REG): Remove. + (UNSPEC_FLDCW): Remove. (x86_fnstcw_1): Use (const_int 0) instead of FPCR_REG. (x86_fldcw_1): Remove insn pattern. (fnstenv): Do not clobber FPCR_REG. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index e85bfc0..2b189c8b 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -102,7 +102,6 @@ UNSPEC_NOTRAP UNSPEC_PARITY UNSPEC_FSTCW - UNSPEC_FLDCW UNSPEC_REP UNSPEC_LD_MPIC ; load_macho_picbase UNSPEC_TRUNC_NOOP -- cgit v1.1 From f20ac63787f7f4801c7190b4b74062d2bd481872 Mon Sep 17 00:00:00 2001 From: Jinsong Ji Date: Thu, 27 Sep 2018 20:48:53 +0000 Subject: mmintrin.h (_mm_unpackhi_pi8): Change __int128_t to __int128. 2018-09-27 Jinsong Ji Bill Schmidt * config/rs6000/mmintrin.h (_mm_unpackhi_pi8): Change __int128_t to __int128. (_mm_unpacklo_pi8): Likewise. (_mm_add_pi8): Likewise. (_mm_add_pi16): Likewise. (_mm_add_pi32): Likewise. (_mm_sub_pi8): Likewise. (_mm_sub_pi16): Likewise. (_mm_sub_pi32): Likewise. (_mm_cmpgt_pi8): Likewise. (_mm_cmpeq_pi16): Likewise. (_mm_cmpgt_pi16): Likewise. (_mm_cmpeq_pi32): Likewise. (_mm_cmpgt_pi32): Likewise. (_mm_adds_pi8): Likewise. (_mm_adds_pi16): Likewise. (_mm_adds_pu8): Likewise. (_mm_adds_pu16): Likewise. (_mm_subs_pi8): Likewise. (_mm_subs_pi16): Likewise. (_mm_subs_pu8): Likewise. (_mm_subs_pu16): Likewise. (_mm_madd_pi16): Likewise. (_mm_mulhi_pi16): Likewise. (_mm_mullo_pi16): Likewise. (_mm_sll_pi16): Likewise. (_mm_sra_pi16): Likewise. (_mm_srl_pi16): Likewise. (_mm_set1_pi16): Likewise. (_mm_set1_pi8): Likewise. * config/rs6000/xmmintrin.h (_mm_max_pi16): Likewise. (_mm_max_pu8): Likewise. (_mm_min_pi16): Likewise. (_mm_min_pu8): Likewise. From-SVN: r264678 --- gcc/config/rs6000/mmintrin.h | 58 +++++++++++++++++++++---------------------- gcc/config/rs6000/xmmintrin.h | 8 +++--- 2 files changed, 33 insertions(+), 33 deletions(-) (limited to 'gcc') diff --git a/gcc/config/rs6000/mmintrin.h b/gcc/config/rs6000/mmintrin.h index b15dd9b..78b7cae 100644 --- a/gcc/config/rs6000/mmintrin.h +++ b/gcc/config/rs6000/mmintrin.h @@ -236,7 +236,7 @@ _mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) a = (__vector unsigned char)vec_splats (__m1); b = (__vector unsigned char)vec_splats (__m2); c = vec_mergel (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -317,7 +317,7 @@ _mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) a = (__vector unsigned char)vec_splats (__m1); b = (__vector unsigned char)vec_splats (__m2); c = vec_mergel (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 1)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 1)); #else __m64_union m1, m2, res; @@ -398,7 +398,7 @@ _mm_add_pi8 (__m64 __m1, __m64 __m2) a = (__vector signed char)vec_splats (__m1); b = (__vector signed char)vec_splats (__m2); c = vec_add (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -434,7 +434,7 @@ _mm_add_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = vec_add (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -466,7 +466,7 @@ _mm_add_pi32 (__m64 __m1, __m64 __m2) a = (__vector signed int)vec_splats (__m1); b = (__vector signed int)vec_splats (__m2); c = vec_add (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -496,7 +496,7 @@ _mm_sub_pi8 (__m64 __m1, __m64 __m2) a = (__vector signed char)vec_splats (__m1); b = (__vector signed char)vec_splats (__m2); c = vec_sub (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -532,7 +532,7 @@ _mm_sub_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = vec_sub (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -564,7 +564,7 @@ _mm_sub_pi32 (__m64 __m1, __m64 __m2) a = (__vector signed int)vec_splats (__m1); b = (__vector signed int)vec_splats (__m2); c = vec_sub (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -754,7 +754,7 @@ _mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) a = (__vector signed char)vec_splats (__m1); b = (__vector signed char)vec_splats (__m2); c = (__vector signed char)vec_cmpgt (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -791,7 +791,7 @@ _mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = (__vector signed short)vec_cmpeq (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -822,7 +822,7 @@ _mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = (__vector signed short)vec_cmpgt (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -855,7 +855,7 @@ _mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) a = (__vector signed int)vec_splats (__m1); b = (__vector signed int)vec_splats (__m2); c = (__vector signed int)vec_cmpeq (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -884,7 +884,7 @@ _mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) a = (__vector signed int)vec_splats (__m1); b = (__vector signed int)vec_splats (__m2); c = (__vector signed int)vec_cmpgt (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); #else __m64_union m1, m2, res; @@ -915,7 +915,7 @@ _mm_adds_pi8 (__m64 __m1, __m64 __m2) a = (__vector signed char)vec_splats (__m1); b = (__vector signed char)vec_splats (__m2); c = vec_adds (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -933,7 +933,7 @@ _mm_adds_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = vec_adds (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -951,7 +951,7 @@ _mm_adds_pu8 (__m64 __m1, __m64 __m2) a = (__vector unsigned char)vec_splats (__m1); b = (__vector unsigned char)vec_splats (__m2); c = vec_adds (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -970,7 +970,7 @@ _mm_adds_pu16 (__m64 __m1, __m64 __m2) a = (__vector unsigned short)vec_splats (__m1); b = (__vector unsigned short)vec_splats (__m2); c = vec_adds (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -989,7 +989,7 @@ _mm_subs_pi8 (__m64 __m1, __m64 __m2) a = (__vector signed char)vec_splats (__m1); b = (__vector signed char)vec_splats (__m2); c = vec_subs (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1008,7 +1008,7 @@ _mm_subs_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = vec_subs (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1027,7 +1027,7 @@ _mm_subs_pu8 (__m64 __m1, __m64 __m2) a = (__vector unsigned char)vec_splats (__m1); b = (__vector unsigned char)vec_splats (__m2); c = vec_subs (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1046,7 +1046,7 @@ _mm_subs_pu16 (__m64 __m1, __m64 __m2) a = (__vector unsigned short)vec_splats (__m1); b = (__vector unsigned short)vec_splats (__m2); c = vec_subs (a, b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1068,7 +1068,7 @@ _mm_madd_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = vec_vmsumshm (a, b, zero); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1096,7 +1096,7 @@ _mm_mulhi_pi16 (__m64 __m1, __m64 __m2) w1 = vec_vmulosh (a, b); c = (__vector signed short)vec_perm (w0, w1, xform1); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1115,7 +1115,7 @@ _mm_mullo_pi16 (__m64 __m1, __m64 __m2) a = (__vector signed short)vec_splats (__m1); b = (__vector signed short)vec_splats (__m2); c = a * b; - return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0)); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1136,7 +1136,7 @@ _mm_sll_pi16 (__m64 __m, __m64 __count) m = (__vector signed short)vec_splats (__m); c = (__vector unsigned short)vec_splats ((unsigned short)__count); r = vec_sl (m, (__vector unsigned short)c); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0)); } else return (0); @@ -1205,7 +1205,7 @@ _mm_sra_pi16 (__m64 __m, __m64 __count) m = (__vector signed short)vec_splats (__m); c = (__vector unsigned short)vec_splats ((unsigned short)__count); r = vec_sra (m, (__vector unsigned short)c); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0)); } else return (0); @@ -1274,7 +1274,7 @@ _mm_srl_pi16 (__m64 __m, __m64 __count) m = (__vector unsigned short)vec_splats (__m); c = (__vector unsigned short)vec_splats ((unsigned short)__count); r = vec_sr (m, (__vector unsigned short)c); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0)); } else return (0); @@ -1417,7 +1417,7 @@ _mm_set1_pi16 (short __w) __vector signed short w; w = (__vector signed short)vec_splats (__w); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)w, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)w, 0)); #else __m64_union res; @@ -1437,7 +1437,7 @@ _mm_set1_pi8 (signed char __b) __vector signed char b; b = (__vector signed char)vec_splats (__b); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)b, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)b, 0)); #else __m64_union res; diff --git a/gcc/config/rs6000/xmmintrin.h b/gcc/config/rs6000/xmmintrin.h index 11ecbd8..ed6f121 100644 --- a/gcc/config/rs6000/xmmintrin.h +++ b/gcc/config/rs6000/xmmintrin.h @@ -1421,7 +1421,7 @@ _mm_max_pi16 (__m64 __A, __m64 __B) b = (__vector signed short)vec_splats (__B); c = (__vector __bool short)vec_cmpgt (a, b); r = vec_sel (b, a, c); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0)); #else __m64_union m1, m2, res; @@ -1459,7 +1459,7 @@ _mm_max_pu8 (__m64 __A, __m64 __B) b = (__vector unsigned char)vec_splats (__B); c = (__vector __bool char)vec_cmpgt (a, b); r = vec_sel (b, a, c); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0)); #else __m64_union m1, m2, res; long i; @@ -1495,7 +1495,7 @@ _mm_min_pi16 (__m64 __A, __m64 __B) b = (__vector signed short)vec_splats (__B); c = (__vector __bool short)vec_cmplt (a, b); r = vec_sel (b, a, c); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0)); #else __m64_union m1, m2, res; @@ -1533,7 +1533,7 @@ _mm_min_pu8 (__m64 __A, __m64 __B) b = (__vector unsigned char)vec_splats (__B); c = (__vector __bool char)vec_cmplt (a, b); r = vec_sel (b, a, c); - return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0)); + return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0)); #else __m64_union m1, m2, res; long i; -- cgit v1.1 From 73ca9fb5dfa98119d9eb02f58f2ac26982ade042 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Thu, 27 Sep 2018 22:55:23 +0000 Subject: tree.h (tree_to_shwi): Add attribute nonnull and pure. gcc/ChangeLog: * tree.h (tree_to_shwi): Add attribute nonnull and pure. (tree_to_poly_int64, tree_to_uhwi, tree_to_poly_uint64): Same. (int_fits_type_p): Same. gcc/ada/ChangeLog: * gcc-interface/utils.c (make_packable_type): Introduce a temporary to avoid -Wnonnull. (unchecked_convert): Same. From-SVN: r264680 --- gcc/ChangeLog | 6 ++++++ gcc/ada/ChangeLog | 6 ++++++ gcc/ada/gcc-interface/utils.c | 16 +++++++++------- gcc/tree.h | 18 +++++++++++++----- 4 files changed, 34 insertions(+), 12 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f0b82bc..367c4c4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-09-27 Martin Sebor + + * tree.h (tree_to_shwi): Add attribute nonnull and pure. + (tree_to_poly_int64, tree_to_uhwi, tree_to_poly_uint64): Same. + (int_fits_type_p): Same. + 2018-09-27 Uros Bizjak * config/i386/i386.md (FPCR_REG): Remove. diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a45e0b8..ce20db3 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2018-09-27 Martin Sebor + + * gcc-interface/utils.c (make_packable_type): Introduce a temporary + to avoid -Wnonnull. + (unchecked_convert): Same. + 2018-09-26 Elisa Barboni * sem_prag.adb (Check_Refined_Global_Item): Improve error diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 73ab562b..9530165 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -990,15 +990,16 @@ make_packable_type (tree type, bool in_record, unsigned int max_align) } else { + tree type_size = TYPE_ADA_SIZE (type); /* Do not try to shrink the size if the RM size is not constant. */ if (TYPE_CONTAINS_TEMPLATE_P (type) - || !tree_fits_uhwi_p (TYPE_ADA_SIZE (type))) + || !tree_fits_uhwi_p (type_size)) return type; /* Round the RM size up to a unit boundary to get the minimal size for a BLKmode record. Give up if it's already the size and we don't need to lower the alignment. */ - new_size = tree_to_uhwi (TYPE_ADA_SIZE (type)); + new_size = tree_to_uhwi (type_size); new_size = (new_size + BITS_PER_UNIT - 1) & -BITS_PER_UNIT; if (new_size == size && (max_align == 0 || align <= max_align)) return type; @@ -5307,20 +5308,21 @@ unchecked_convert (tree type, tree expr, bool notrunc_p) to its size, sign- or zero-extend the result. But we need not do this if the input is also an integral type and both are unsigned or both are signed and have the same precision. */ + tree type_rm_size; if (!notrunc_p && INTEGRAL_TYPE_P (type) && !(code == INTEGER_TYPE && TYPE_BIASED_REPRESENTATION_P (type)) - && TYPE_RM_SIZE (type) - && tree_int_cst_compare (TYPE_RM_SIZE (type), TYPE_SIZE (type)) < 0 + && (type_rm_size = TYPE_RM_SIZE (type)) + && tree_int_cst_compare (type_rm_size, TYPE_SIZE (type)) < 0 && !(INTEGRAL_TYPE_P (etype) && type_unsigned_for_rm (type) == type_unsigned_for_rm (etype) && (type_unsigned_for_rm (type) - || tree_int_cst_compare (TYPE_RM_SIZE (type), + || tree_int_cst_compare (type_rm_size, TYPE_RM_SIZE (etype) ? TYPE_RM_SIZE (etype) : TYPE_SIZE (etype)) == 0))) { - if (integer_zerop (TYPE_RM_SIZE (type))) + if (integer_zerop (type_rm_size)) expr = build_int_cst (type, 0); else { @@ -5330,7 +5332,7 @@ unchecked_convert (tree type, tree expr, bool notrunc_p) tree shift_expr = convert (base_type, size_binop (MINUS_EXPR, - TYPE_SIZE (type), TYPE_RM_SIZE (type))); + TYPE_SIZE (type), type_rm_size)); expr = convert (type, build_binary_op (RSHIFT_EXPR, base_type, diff --git a/gcc/tree.h b/gcc/tree.h index 33fcbcd..dcf8253 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -4231,16 +4231,23 @@ extern tree purpose_member (const_tree, tree); extern bool vec_member (const_tree, vec *); extern tree chain_index (int, tree); +/* Arguments may be null. */ extern int tree_int_cst_equal (const_tree, const_tree); +/* The following predicates are safe to call with a null argument. */ extern bool tree_fits_shwi_p (const_tree) ATTRIBUTE_PURE; extern bool tree_fits_poly_int64_p (const_tree) ATTRIBUTE_PURE; extern bool tree_fits_uhwi_p (const_tree) ATTRIBUTE_PURE; extern bool tree_fits_poly_uint64_p (const_tree) ATTRIBUTE_PURE; -extern HOST_WIDE_INT tree_to_shwi (const_tree); -extern poly_int64 tree_to_poly_int64 (const_tree); -extern unsigned HOST_WIDE_INT tree_to_uhwi (const_tree); -extern poly_uint64 tree_to_poly_uint64 (const_tree); + +extern HOST_WIDE_INT tree_to_shwi (const_tree) + ATTRIBUTE_NONNULL (1) ATTRIBUTE_PURE; +extern poly_int64 tree_to_poly_int64 (const_tree) + ATTRIBUTE_NONNULL (1) ATTRIBUTE_PURE; +extern unsigned HOST_WIDE_INT tree_to_uhwi (const_tree) + ATTRIBUTE_NONNULL (1) ATTRIBUTE_PURE; +extern poly_uint64 tree_to_poly_uint64 (const_tree) + ATTRIBUTE_NONNULL (1) ATTRIBUTE_PURE; #if !defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 4003) extern inline __attribute__ ((__gnu_inline__)) HOST_WIDE_INT tree_to_shwi (const_tree t) @@ -4893,7 +4900,8 @@ extern bool really_constant_p (const_tree); extern bool ptrdiff_tree_p (const_tree, poly_int64_pod *); extern bool decl_address_invariant_p (const_tree); extern bool decl_address_ip_invariant_p (const_tree); -extern bool int_fits_type_p (const_tree, const_tree); +extern bool int_fits_type_p (const_tree, const_tree) + ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2) ATTRIBUTE_PURE; #ifndef GENERATOR_FILE extern void get_type_static_bounds (const_tree, mpz_t, mpz_t); #endif -- cgit v1.1 From c057b53a37fbe94ce11d006c6445bed80987b66b Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Fri, 28 Sep 2018 00:56:37 +0200 Subject: rs6000: Fix one more vec_splat case This fixes the one remaining case where the stricter vec_splat checking complains in the testsuite. * g++.dg/ext/altivec-6.C: Change the vec_splat second argument to a valid value, in the "vector bool int" case. From-SVN: r264681 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/ext/altivec-6.C | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7f46bc8..8f6f72e3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-27 Segher Boessenkool + + * g++.dg/ext/altivec-6.C: Change the vec_splat second argument to a + valid value, in the "vector bool int" case. + 2018-09-27 Uros Bizjak * gcc.dg/rtl/x86_64/dfinit.c: Update scan-rtl-dump string. diff --git a/gcc/testsuite/g++.dg/ext/altivec-6.C b/gcc/testsuite/g++.dg/ext/altivec-6.C index 4c863ef..d17fd90 100644 --- a/gcc/testsuite/g++.dg/ext/altivec-6.C +++ b/gcc/testsuite/g++.dg/ext/altivec-6.C @@ -26,5 +26,5 @@ void foo(void) { elements in the referenced vector. */ vbs = vec_splat(vbs, 4); vp = vec_splat(vp, 1); - vbi = vec_splat(vbi, 15); + vbi = vec_splat(vbi, 3); } -- cgit v1.1 From 7847bfcbb8f5ee155f13a46af600f83892423c52 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Fri, 28 Sep 2018 00:16:43 +0000 Subject: Daily bump. From-SVN: r264685 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 750ff19..473a00d 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20180927 +20180928 -- cgit v1.1 From 227efe870043c9e8b4c58a702e90698b2970ff75 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 28 Sep 2018 08:47:20 +0000 Subject: sparc-protos.h (sparc_branch_cost): Declare. * config/sparc/sparc-protos.h (sparc_branch_cost): Declare. * config/sparc/sparc.h (BRANCH_COST): Call sparc_branch_cost. * config/sparc/sparc.c (struct processor_costs): Add branch_cost field. (cypress_costs): Set it. (supersparc_costs): Likewise. (hypersparc_costs): Likewise. (leon_cost): Likewise. (leon3_costs): Likewise. (sparclet_costs): Likewise. (ultrasparc_costs): Likewise. (ultrasparc_costs): Likewise. (niagara_costs): Likewise. (niagara2_costs): Likewise. (niagara3_costs): Likewise. (niagara4_costs): Likewise. (niagara7_costs): Likewise. (m8_costs): Likewise. (TARGET_CAN_FOLLOW_JUMP): Define. (pass_work_around_errata::gate): Minor tweak. (sparc_option_override): Remove MASK_FSMULD mask for V7 processors. Do not set both MASK_VIS4 and MASK_VIS4B for M8 processor. Automaitcally clear MASK_FSMULD mask for V7 processors. (sparc_can_follow_jump): New static function. (output_ubranch): Deal with CROSSING_JUMP_P. (sparc_use_sched_lookahead): Rewrite using switch statement. (sparc_issue_rate): Reorder. (sparc_branch_cost): New function. From-SVN: r264687 --- gcc/ChangeLog | 30 ++++++ gcc/config/sparc/sparc-protos.h | 1 + gcc/config/sparc/sparc.c | 155 ++++++++++++++++++++-------- gcc/config/sparc/sparc.h | 39 +------ gcc/testsuite/ChangeLog | 11 ++ gcc/testsuite/gcc.target/sparc/20160229-1.c | 2 +- gcc/testsuite/gcc.target/sparc/cbcond-2.c | 2 +- gcc/testsuite/gcc.target/sparc/movcc-1.c | 2 +- gcc/testsuite/gcc.target/sparc/movcc-2.c | 2 +- gcc/testsuite/gcc.target/sparc/overflow-3.c | 2 +- gcc/testsuite/gcc.target/sparc/overflow-4.c | 2 +- gcc/testsuite/gcc.target/sparc/overflow-5.c | 2 +- gcc/testsuite/gcc.target/sparc/setcc-4.c | 2 +- 13 files changed, 168 insertions(+), 84 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 367c4c4..33001bb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,33 @@ +2018-09-28 Eric Botcazou + + * config/sparc/sparc-protos.h (sparc_branch_cost): Declare. + * config/sparc/sparc.h (BRANCH_COST): Call sparc_branch_cost. + * config/sparc/sparc.c (struct processor_costs): Add branch_cost field. + (cypress_costs): Set it. + (supersparc_costs): Likewise. + (hypersparc_costs): Likewise. + (leon_cost): Likewise. + (leon3_costs): Likewise. + (sparclet_costs): Likewise. + (ultrasparc_costs): Likewise. + (ultrasparc_costs): Likewise. + (niagara_costs): Likewise. + (niagara2_costs): Likewise. + (niagara3_costs): Likewise. + (niagara4_costs): Likewise. + (niagara7_costs): Likewise. + (m8_costs): Likewise. + (TARGET_CAN_FOLLOW_JUMP): Define. + (pass_work_around_errata::gate): Minor tweak. + (sparc_option_override): Remove MASK_FSMULD mask for V7 processors. + Do not set both MASK_VIS4 and MASK_VIS4B for M8 processor. + Automaitcally clear MASK_FSMULD mask for V7 processors. + (sparc_can_follow_jump): New static function. + (output_ubranch): Deal with CROSSING_JUMP_P. + (sparc_use_sched_lookahead): Rewrite using switch statement. + (sparc_issue_rate): Reorder. + (sparc_branch_cost): New function. + 2018-09-27 Martin Sebor * tree.h (tree_to_shwi): Add attribute nonnull and pure. diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h index 4fb0ead..12613db 100644 --- a/gcc/config/sparc/sparc-protos.h +++ b/gcc/config/sparc/sparc-protos.h @@ -43,6 +43,7 @@ extern void sparc_override_options (void); extern void sparc_output_scratch_registers (FILE *); extern void sparc_target_macros (void); extern void sparc_emit_membar_for_model (enum memmodel, int, int); +extern int sparc_branch_cost (bool, bool); #ifdef RTX_CODE extern machine_mode select_cc_mode (enum rtx_code, rtx, rtx); diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 42acabb..23e356c 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -139,6 +139,9 @@ struct processor_costs { /* penalty for shifts, due to scheduling rules etc. */ const int shift_penalty; + + /* cost of a (predictable) branch. */ + const int branch_cost; }; static const @@ -163,6 +166,7 @@ struct processor_costs cypress_costs = { COSTS_N_INSNS (1), /* idivX */ COSTS_N_INSNS (1), /* movcc/movr */ 0, /* shift penalty */ + 3 /* branch cost */ }; static const @@ -187,6 +191,7 @@ struct processor_costs supersparc_costs = { COSTS_N_INSNS (4), /* idivX */ COSTS_N_INSNS (1), /* movcc/movr */ 1, /* shift penalty */ + 3 /* branch cost */ }; static const @@ -211,6 +216,7 @@ struct processor_costs hypersparc_costs = { COSTS_N_INSNS (17), /* idivX */ COSTS_N_INSNS (1), /* movcc/movr */ 0, /* shift penalty */ + 3 /* branch cost */ }; static const @@ -235,6 +241,7 @@ struct processor_costs leon_costs = { COSTS_N_INSNS (5), /* idivX */ COSTS_N_INSNS (1), /* movcc/movr */ 0, /* shift penalty */ + 3 /* branch cost */ }; static const @@ -259,6 +266,7 @@ struct processor_costs leon3_costs = { COSTS_N_INSNS (35), /* idivX */ COSTS_N_INSNS (1), /* movcc/movr */ 0, /* shift penalty */ + 3 /* branch cost */ }; static const @@ -283,6 +291,7 @@ struct processor_costs sparclet_costs = { COSTS_N_INSNS (5), /* idivX */ COSTS_N_INSNS (1), /* movcc/movr */ 0, /* shift penalty */ + 3 /* branch cost */ }; static const @@ -307,6 +316,7 @@ struct processor_costs ultrasparc_costs = { COSTS_N_INSNS (68), /* idivX */ COSTS_N_INSNS (2), /* movcc/movr */ 2, /* shift penalty */ + 2 /* branch cost */ }; static const @@ -331,6 +341,7 @@ struct processor_costs ultrasparc3_costs = { COSTS_N_INSNS (71), /* idivX */ COSTS_N_INSNS (2), /* movcc/movr */ 0, /* shift penalty */ + 2 /* branch cost */ }; static const @@ -355,6 +366,7 @@ struct processor_costs niagara_costs = { COSTS_N_INSNS (72), /* idivX */ COSTS_N_INSNS (1), /* movcc/movr */ 0, /* shift penalty */ + 4 /* branch cost */ }; static const @@ -379,6 +391,7 @@ struct processor_costs niagara2_costs = { COSTS_N_INSNS (26), /* idivX, average of 12 - 41 cycle range */ COSTS_N_INSNS (1), /* movcc/movr */ 0, /* shift penalty */ + 5 /* branch cost */ }; static const @@ -403,6 +416,7 @@ struct processor_costs niagara3_costs = { COSTS_N_INSNS (30), /* idivX, average of 16 - 44 cycle range */ COSTS_N_INSNS (1), /* movcc/movr */ 0, /* shift penalty */ + 5 /* branch cost */ }; static const @@ -427,6 +441,7 @@ struct processor_costs niagara4_costs = { COSTS_N_INSNS (35), /* idivX, average of 26 - 44 cycle range */ COSTS_N_INSNS (1), /* movcc/movr */ 0, /* shift penalty */ + 2 /* branch cost */ }; static const @@ -451,6 +466,7 @@ struct processor_costs niagara7_costs = { COSTS_N_INSNS (35), /* idivX, average of 26 - 44 cycle range */ COSTS_N_INSNS (1), /* movcc/movr */ 0, /* shift penalty */ + 1 /* branch cost */ }; static const @@ -475,6 +491,7 @@ struct processor_costs m8_costs = { COSTS_N_INSNS (30), /* udivx/sdivx */ COSTS_N_INSNS (1), /* movcc/movr */ 0, /* shift penalty */ + 1 /* branch cost */ }; static const struct processor_costs *sparc_costs = &cypress_costs; @@ -693,6 +710,7 @@ static bool sparc_can_change_mode_class (machine_mode, machine_mode, static HOST_WIDE_INT sparc_constant_alignment (const_tree, HOST_WIDE_INT); static bool sparc_vectorize_vec_perm_const (machine_mode, rtx, rtx, rtx, const vec_perm_indices &); +static bool sparc_can_follow_jump (const rtx_insn *, const rtx_insn *); #ifdef SUBTARGET_ATTRIBUTE_TABLE /* Table of valid machine attributes. */ @@ -946,6 +964,9 @@ char sparc_hard_reg_printed[8]; #undef TARGET_VECTORIZE_VEC_PERM_CONST #define TARGET_VECTORIZE_VEC_PERM_CONST sparc_vectorize_vec_perm_const +#undef TARGET_CAN_FOLLOW_JUMP +#define TARGET_CAN_FOLLOW_JUMP sparc_can_follow_jump + struct gcc_target targetm = TARGET_INITIALIZER; /* Return the memory reference contained in X if any, zero otherwise. */ @@ -1523,8 +1544,9 @@ public: /* opt_pass methods: */ virtual bool gate (function *) { - return sparc_fix_at697f || sparc_fix_ut699 || sparc_fix_b2bst - || sparc_fix_gr712rc || sparc_fix_ut700 || sparc_fix_lost_divsqrt; + return sparc_fix_at697f + || sparc_fix_ut699 || sparc_fix_ut700 || sparc_fix_gr712rc + || sparc_fix_b2bst || sparc_fix_lost_divsqrt; } virtual unsigned int execute (function *) @@ -1657,24 +1679,24 @@ sparc_option_override (void) const int disable; const int enable; } const cpu_table[] = { - { "v7", MASK_ISA|MASK_FSMULD, 0 }, - { "cypress", MASK_ISA|MASK_FSMULD, 0 }, + { "v7", MASK_ISA, 0 }, + { "cypress", MASK_ISA, 0 }, { "v8", MASK_ISA, MASK_V8 }, /* TI TMS390Z55 supersparc */ { "supersparc", MASK_ISA, MASK_V8 }, { "hypersparc", MASK_ISA, MASK_V8 }, { "leon", MASK_ISA|MASK_FSMULD, MASK_V8|MASK_LEON }, { "leon3", MASK_ISA, MASK_V8|MASK_LEON3 }, - { "leon3v7", MASK_ISA|MASK_FSMULD, MASK_LEON3 }, - { "sparclite", MASK_ISA|MASK_FSMULD, MASK_SPARCLITE }, + { "leon3v7", MASK_ISA, MASK_LEON3 }, + { "sparclite", MASK_ISA, MASK_SPARCLITE }, /* The Fujitsu MB86930 is the original sparclite chip, with no FPU. */ { "f930", MASK_ISA|MASK_FPU, MASK_SPARCLITE }, /* The Fujitsu MB86934 is the recent sparclite chip, with an FPU. */ - { "f934", MASK_ISA|MASK_FSMULD, MASK_SPARCLITE }, + { "f934", MASK_ISA, MASK_SPARCLITE }, { "sparclite86x", MASK_ISA|MASK_FPU, MASK_SPARCLITE }, - { "sparclet", MASK_ISA|MASK_FSMULD, MASK_SPARCLET }, + { "sparclet", MASK_ISA, MASK_SPARCLET }, /* TEMIC sparclet */ - { "tsc701", MASK_ISA|MASK_FSMULD, MASK_SPARCLET }, + { "tsc701", MASK_ISA, MASK_SPARCLET }, { "v9", MASK_ISA, MASK_V9 }, /* UltraSPARC I, II, IIi */ { "ultrasparc", MASK_ISA, @@ -1701,7 +1723,7 @@ sparc_option_override (void) MASK_V9|MASK_POPC|MASK_VIS4|MASK_FMAF|MASK_CBCOND|MASK_SUBXC }, /* UltraSPARC M8 */ { "m8", MASK_ISA, - MASK_V9|MASK_POPC|MASK_VIS4|MASK_FMAF|MASK_CBCOND|MASK_SUBXC|MASK_VIS4B } + MASK_V9|MASK_POPC|MASK_VIS4B|MASK_FMAF|MASK_CBCOND|MASK_SUBXC } }; const struct cpu_table *cpu; unsigned int i; @@ -1844,6 +1866,10 @@ sparc_option_override (void) & ~(target_flags_explicit & MASK_FEATURES) ); + /* FsMULd is a V8 instruction. */ + if (!TARGET_V8 && !TARGET_V9) + target_flags &= ~MASK_FSMULD; + /* -mvis2 implies -mvis. */ if (TARGET_VIS2) target_flags |= MASK_VIS; @@ -1897,8 +1923,8 @@ sparc_option_override (void) /* Enable applicable errata workarounds for LEON3FT. */ if (sparc_fix_ut699 || sparc_fix_ut700 || sparc_fix_gr712rc) { - sparc_fix_b2bst = 1; - sparc_fix_lost_divsqrt = 1; + sparc_fix_b2bst = 1; + sparc_fix_lost_divsqrt = 1; } /* Disable FsMULd for the UT699 since it doesn't work correctly. */ @@ -8003,6 +8029,19 @@ sparc_preferred_simd_mode (scalar_mode mode) return word_mode; } + /* Implement TARGET_CAN_FOLLOW_JUMP. */ + +static bool +sparc_can_follow_jump (const rtx_insn *follower, const rtx_insn *followee) +{ + /* Do not fold unconditional jumps that have been created for crossing + partition boundaries. */ + if (CROSSING_JUMP_P (followee) && !CROSSING_JUMP_P (follower)) + return false; + + return true; +} + /* Return the string to output an unconditional branch to LABEL, which is the operand number of the label. @@ -8018,9 +8057,8 @@ output_ubranch (rtx dest, rtx_insn *insn) /* Even if we are trying to use cbcond for this, evaluate whether we can use V9 branches as our backup plan. */ - delta = 5000000; - if (INSN_ADDRESSES_SET_P ()) + if (!CROSSING_JUMP_P (insn) && INSN_ADDRESSES_SET_P ()) delta = (INSN_ADDRESSES (INSN_UID (dest)) - INSN_ADDRESSES (INSN_UID (insn))); @@ -10158,22 +10196,25 @@ sparc_sched_init (FILE *dump ATTRIBUTE_UNUSED, static int sparc_use_sched_lookahead (void) { - if (sparc_cpu == PROCESSOR_NIAGARA - || sparc_cpu == PROCESSOR_NIAGARA2 - || sparc_cpu == PROCESSOR_NIAGARA3) - return 0; - if (sparc_cpu == PROCESSOR_NIAGARA4 - || sparc_cpu == PROCESSOR_NIAGARA7 - || sparc_cpu == PROCESSOR_M8) - return 2; - if (sparc_cpu == PROCESSOR_ULTRASPARC - || sparc_cpu == PROCESSOR_ULTRASPARC3) - return 4; - if ((1 << sparc_cpu) & - ((1 << PROCESSOR_SUPERSPARC) | (1 << PROCESSOR_HYPERSPARC) | - (1 << PROCESSOR_SPARCLITE86X))) - return 3; - return 0; + switch (sparc_cpu) + { + case PROCESSOR_ULTRASPARC: + case PROCESSOR_ULTRASPARC3: + return 4; + case PROCESSOR_SUPERSPARC: + case PROCESSOR_HYPERSPARC: + case PROCESSOR_SPARCLITE86X: + return 3; + case PROCESSOR_NIAGARA4: + case PROCESSOR_NIAGARA7: + case PROCESSOR_M8: + return 2; + case PROCESSOR_NIAGARA: + case PROCESSOR_NIAGARA2: + case PROCESSOR_NIAGARA3: + default: + return 0; + } } static int @@ -10181,28 +10222,60 @@ sparc_issue_rate (void) { switch (sparc_cpu) { + case PROCESSOR_ULTRASPARC: + case PROCESSOR_ULTRASPARC3: + case PROCESSOR_M8: + return 4; + case PROCESSOR_SUPERSPARC: + return 3; + case PROCESSOR_HYPERSPARC: + case PROCESSOR_SPARCLITE86X: + case PROCESSOR_V9: + /* Assume V9 processors are capable of at least dual-issue. */ + case PROCESSOR_NIAGARA4: + case PROCESSOR_NIAGARA7: + return 2; case PROCESSOR_NIAGARA: case PROCESSOR_NIAGARA2: case PROCESSOR_NIAGARA3: default: return 1; - case PROCESSOR_NIAGARA4: - case PROCESSOR_NIAGARA7: + } +} + +int +sparc_branch_cost (bool speed_p, bool predictable_p) +{ + if (!speed_p) + return 2; + + /* For pre-V9 processors we use a single value (usually 3) to take into + account the potential annulling of the delay slot (which ends up being + a bubble in the pipeline slot) plus a cycle to take into consideration + the instruction cache effects. + + On V9 and later processors, which have branch prediction facilities, + we take into account whether the branch is (easily) predictable. */ + const int cost = sparc_costs->branch_cost; + + switch (sparc_cpu) + { case PROCESSOR_V9: - /* Assume V9 processors are capable of at least dual-issue. */ - return 2; - case PROCESSOR_SUPERSPARC: - return 3; - case PROCESSOR_HYPERSPARC: - case PROCESSOR_SPARCLITE86X: - return 2; case PROCESSOR_ULTRASPARC: case PROCESSOR_ULTRASPARC3: + case PROCESSOR_NIAGARA: + case PROCESSOR_NIAGARA2: + case PROCESSOR_NIAGARA3: + case PROCESSOR_NIAGARA4: + case PROCESSOR_NIAGARA7: case PROCESSOR_M8: - return 4; + return cost + (predictable_p ? 0 : 2); + + default: + return cost; } } - + static int set_extends (rtx_insn *insn) { diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 87358c7..520a6b3 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -1496,41 +1496,10 @@ do { \ #define DITF_CONVERSION_LIBFUNCS 0 #define SUN_INTEGER_MULTIPLY_64 0 -/* Provide the cost of a branch. For pre-v9 processors we use - a value of 3 to take into account the potential annulling of - the delay slot (which ends up being a bubble in the pipeline slot) - plus a cycle to take into consideration the instruction cache - effects. - - On v9 and later, which have branch prediction facilities, we set - it to the depth of the pipeline as that is the cost of a - mispredicted branch. - - On Niagara, normal branches insert 3 bubbles into the pipe - and annulled branches insert 4 bubbles. - - On Niagara-2 and Niagara-3, a not-taken branch costs 1 cycle whereas - a taken branch costs 6 cycles. - - The T4 Supplement specifies the branch latency at 2 cycles. - The M7 Supplement specifies the branch latency at 1 cycle. */ - -#define BRANCH_COST(speed_p, predictable_p) \ - ((sparc_cpu == PROCESSOR_V9 \ - || sparc_cpu == PROCESSOR_ULTRASPARC) \ - ? 7 \ - : (sparc_cpu == PROCESSOR_ULTRASPARC3 \ - ? 9 \ - : (sparc_cpu == PROCESSOR_NIAGARA \ - ? 4 \ - : ((sparc_cpu == PROCESSOR_NIAGARA2 \ - || sparc_cpu == PROCESSOR_NIAGARA3) \ - ? 5 \ - : (sparc_cpu == PROCESSOR_NIAGARA4 \ - ? 2 \ - : (sparc_cpu == PROCESSOR_NIAGARA7 \ - ? 1 \ - : 3)))))) +/* A C expression for the cost of a branch instruction. A value of 1 + is the default; other values are interpreted relative to that. */ +#define BRANCH_COST(SPEED_P, PREDICTABLE_P) \ + (sparc_branch_cost (SPEED_P, PREDICTABLE_P)) /* Control the assembler format that we output. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8f6f72e3..25f6df6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2018-09-28 Eric Botcazou + + * gcc.target/sparc/20160229-1.c: Minor tweak. + * gcc.target/sparc/cbcond-2.c: Likewise. + * gcc.target/sparc/movcc-1.c: Add -mcpu=v9 option. + * gcc.target/sparc/movcc-2.c: Minor tweak. + * gcc.target/sparc/overflow-3.c: Likewise. + * gcc.target/sparc/overflow-4.c: Add -mno-vis4 option. + * gcc.target/sparc/overflow-5.c: Minor tweak. + * gcc.target/sparc/setcc-4.c: Add -mno-vis4 option. + 2018-09-27 Segher Boessenkool * g++.dg/ext/altivec-6.C: Change the vec_splat second argument to a diff --git a/gcc/testsuite/gcc.target/sparc/20160229-1.c b/gcc/testsuite/gcc.target/sparc/20160229-1.c index c64b7a8..1a57070 100644 --- a/gcc/testsuite/gcc.target/sparc/20160229-1.c +++ b/gcc/testsuite/gcc.target/sparc/20160229-1.c @@ -2,8 +2,8 @@ /* Reported by John Paul Adrian Glaubitz */ /* { dg-do run } */ -/* { dg-options "-std=gnu99" } /* { dg-require-effective-target lp64 } */ +/* { dg-options "-std=gnu99" } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.target/sparc/cbcond-2.c b/gcc/testsuite/gcc.target/sparc/cbcond-2.c index 3c03d44..da6c617 100644 --- a/gcc/testsuite/gcc.target/sparc/cbcond-2.c +++ b/gcc/testsuite/gcc.target/sparc/cbcond-2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O -mcbcond" } */ /* { dg-require-effective-target lp64 } */ +/* { dg-options "-O -mcbcond" } */ extern void foo (void); extern void bar (void); diff --git a/gcc/testsuite/gcc.target/sparc/movcc-1.c b/gcc/testsuite/gcc.target/sparc/movcc-1.c index 57ba0f9..8580816 100644 --- a/gcc/testsuite/gcc.target/sparc/movcc-1.c +++ b/gcc/testsuite/gcc.target/sparc/movcc-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2" } */ +/* { dg-options "-O2 -mcpu=v9" } */ int foo1 (int a) { diff --git a/gcc/testsuite/gcc.target/sparc/movcc-2.c b/gcc/testsuite/gcc.target/sparc/movcc-2.c index 3af7876..38c742a 100644 --- a/gcc/testsuite/gcc.target/sparc/movcc-2.c +++ b/gcc/testsuite/gcc.target/sparc/movcc-2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2" } */ /* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2" } */ long foo1 (long a) { diff --git a/gcc/testsuite/gcc.target/sparc/overflow-3.c b/gcc/testsuite/gcc.target/sparc/overflow-3.c index 8cb24f5..86dddfb 100644 --- a/gcc/testsuite/gcc.target/sparc/overflow-3.c +++ b/gcc/testsuite/gcc.target/sparc/overflow-3.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O" } */ /* { dg-require-effective-target lp64 } */ +/* { dg-options "-O" } */ #include #include diff --git a/gcc/testsuite/gcc.target/sparc/overflow-4.c b/gcc/testsuite/gcc.target/sparc/overflow-4.c index 868edea..019feee 100644 --- a/gcc/testsuite/gcc.target/sparc/overflow-4.c +++ b/gcc/testsuite/gcc.target/sparc/overflow-4.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O -mno-vis3" } */ /* { dg-require-effective-target lp64 } */ +/* { dg-options "-O -mno-vis3 -mno-vis4" } */ #include #include diff --git a/gcc/testsuite/gcc.target/sparc/overflow-5.c b/gcc/testsuite/gcc.target/sparc/overflow-5.c index 501ce04..67d4ac3 100644 --- a/gcc/testsuite/gcc.target/sparc/overflow-5.c +++ b/gcc/testsuite/gcc.target/sparc/overflow-5.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O -mvis3" } */ /* { dg-require-effective-target lp64 } */ +/* { dg-options "-O -mvis3" } */ #include #include diff --git a/gcc/testsuite/gcc.target/sparc/setcc-4.c b/gcc/testsuite/gcc.target/sparc/setcc-4.c index ffa4ee0..6afa8a7 100644 --- a/gcc/testsuite/gcc.target/sparc/setcc-4.c +++ b/gcc/testsuite/gcc.target/sparc/setcc-4.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target lp64 } */ -/* { dg-options "-O1 -mno-vis3" } */ +/* { dg-options "-O1 -mno-vis3 -mno-vis4" } */ long neq (long a, long b) { -- cgit v1.1 From 2bd4ca7ad508ec9b94f8c3442a6e39d5276d7915 Mon Sep 17 00:00:00 2001 From: Andrew Stubbs Date: Fri, 28 Sep 2018 10:54:34 +0000 Subject: Simplify vec_merge according to the mask. This patch was part of the original patch we acquired from Honza and Martin. It simplifies nested vec_merge operations using the same mask. Self-tests are included. 2018-09-28 Andrew Stubbs Jan Hubicka Martin Jambor * simplify-rtx.c (simplify_merge_mask): New function. (simplify_ternary_operation): Use it, also see if VEC_MERGEs with the same masks are used in op1 or op2. (test_vec_merge): New function. (test_vector_ops): Call test_vec_merge. Co-Authored-By: Jan Hubicka Co-Authored-By: Martin Jambor From-SVN: r264688 --- gcc/ChangeLog | 10 ++++ gcc/simplify-rtx.c | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 33001bb..5b685e4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2018-09-28 Andrew Stubbs + Jan Hubicka + Martin Jambor + + * simplify-rtx.c (simplify_merge_mask): New function. + (simplify_ternary_operation): Use it, also see if VEC_MERGEs with the + same masks are used in op1 or op2. + (test_vec_merge): New function. + (test_vector_ops): Call test_vec_merge. + 2018-09-28 Eric Botcazou * config/sparc/sparc-protos.h (sparc_branch_cost): Declare. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index b4c6883..9bc5386 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -5578,6 +5578,68 @@ simplify_cond_clz_ctz (rtx x, rtx_code cmp_code, rtx true_val, rtx false_val) return NULL_RTX; } +/* Try to simplify X given that it appears within operand OP of a + VEC_MERGE operation whose mask is MASK. X need not use the same + vector mode as the VEC_MERGE, but it must have the same number of + elements. + + Return the simplified X on success, otherwise return NULL_RTX. */ + +rtx +simplify_merge_mask (rtx x, rtx mask, int op) +{ + gcc_assert (VECTOR_MODE_P (GET_MODE (x))); + poly_uint64 nunits = GET_MODE_NUNITS (GET_MODE (x)); + if (GET_CODE (x) == VEC_MERGE && rtx_equal_p (XEXP (x, 2), mask)) + { + if (side_effects_p (XEXP (x, 1 - op))) + return NULL_RTX; + + return XEXP (x, op); + } + if (UNARY_P (x) + && VECTOR_MODE_P (GET_MODE (XEXP (x, 0))) + && known_eq (GET_MODE_NUNITS (GET_MODE (XEXP (x, 0))), nunits)) + { + rtx top0 = simplify_merge_mask (XEXP (x, 0), mask, op); + if (top0) + return simplify_gen_unary (GET_CODE (x), GET_MODE (x), top0, + GET_MODE (XEXP (x, 0))); + } + if (BINARY_P (x) + && VECTOR_MODE_P (GET_MODE (XEXP (x, 0))) + && known_eq (GET_MODE_NUNITS (GET_MODE (XEXP (x, 0))), nunits) + && VECTOR_MODE_P (GET_MODE (XEXP (x, 1))) + && known_eq (GET_MODE_NUNITS (GET_MODE (XEXP (x, 1))), nunits)) + { + rtx top0 = simplify_merge_mask (XEXP (x, 0), mask, op); + rtx top1 = simplify_merge_mask (XEXP (x, 1), mask, op); + if (top0 || top1) + return simplify_gen_binary (GET_CODE (x), GET_MODE (x), + top0 ? top0 : XEXP (x, 0), + top1 ? top1 : XEXP (x, 1)); + } + if (GET_RTX_CLASS (GET_CODE (x)) == RTX_TERNARY + && VECTOR_MODE_P (GET_MODE (XEXP (x, 0))) + && known_eq (GET_MODE_NUNITS (GET_MODE (XEXP (x, 0))), nunits) + && VECTOR_MODE_P (GET_MODE (XEXP (x, 1))) + && known_eq (GET_MODE_NUNITS (GET_MODE (XEXP (x, 1))), nunits) + && VECTOR_MODE_P (GET_MODE (XEXP (x, 2))) + && known_eq (GET_MODE_NUNITS (GET_MODE (XEXP (x, 2))), nunits)) + { + rtx top0 = simplify_merge_mask (XEXP (x, 0), mask, op); + rtx top1 = simplify_merge_mask (XEXP (x, 1), mask, op); + rtx top2 = simplify_merge_mask (XEXP (x, 2), mask, op); + if (top0 || top1 || top2) + return simplify_gen_ternary (GET_CODE (x), GET_MODE (x), + GET_MODE (XEXP (x, 0)), + top0 ? top0 : XEXP (x, 0), + top1 ? top1 : XEXP (x, 1), + top2 ? top2 : XEXP (x, 2)); + } + return NULL_RTX; +} + /* Simplify CODE, an operation with result mode MODE and three operands, OP0, OP1, and OP2. OP0_MODE was the mode of OP0 before it became @@ -5967,6 +6029,16 @@ simplify_ternary_operation (enum rtx_code code, machine_mode mode, && !side_effects_p (op2) && !side_effects_p (op1)) return op0; + if (!side_effects_p (op2)) + { + rtx top0 = simplify_merge_mask (op0, op2, 0); + rtx top1 = simplify_merge_mask (op1, op2, 1); + if (top0 || top1) + return simplify_gen_ternary (code, mode, mode, + top0 ? top0 : op0, + top1 ? top1 : op1, op2); + } + break; default: @@ -6856,6 +6928,69 @@ test_vector_ops_series (machine_mode mode, rtx scalar_reg) constm1_rtx)); } +/* Verify simplify_merge_mask works correctly. */ + +static void +test_vec_merge (machine_mode mode) +{ + rtx op0 = make_test_reg (mode); + rtx op1 = make_test_reg (mode); + rtx op2 = make_test_reg (mode); + rtx op3 = make_test_reg (mode); + rtx op4 = make_test_reg (mode); + rtx op5 = make_test_reg (mode); + rtx mask1 = make_test_reg (SImode); + rtx mask2 = make_test_reg (SImode); + rtx vm1 = gen_rtx_VEC_MERGE (mode, op0, op1, mask1); + rtx vm2 = gen_rtx_VEC_MERGE (mode, op2, op3, mask1); + rtx vm3 = gen_rtx_VEC_MERGE (mode, op4, op5, mask1); + + /* Simple vec_merge. */ + ASSERT_EQ (op0, simplify_merge_mask (vm1, mask1, 0)); + ASSERT_EQ (op1, simplify_merge_mask (vm1, mask1, 1)); + ASSERT_EQ (NULL_RTX, simplify_merge_mask (vm1, mask2, 0)); + ASSERT_EQ (NULL_RTX, simplify_merge_mask (vm1, mask2, 1)); + + /* Nested vec_merge. + It's tempting to make this simplify right down to opN, but we don't + because all the simplify_* functions assume that the operands have + already been simplified. */ + rtx nvm = gen_rtx_VEC_MERGE (mode, vm1, vm2, mask1); + ASSERT_EQ (vm1, simplify_merge_mask (nvm, mask1, 0)); + ASSERT_EQ (vm2, simplify_merge_mask (nvm, mask1, 1)); + + /* Intermediate unary op. */ + rtx unop = gen_rtx_NOT (mode, vm1); + ASSERT_RTX_EQ (gen_rtx_NOT (mode, op0), + simplify_merge_mask (unop, mask1, 0)); + ASSERT_RTX_EQ (gen_rtx_NOT (mode, op1), + simplify_merge_mask (unop, mask1, 1)); + + /* Intermediate binary op. */ + rtx binop = gen_rtx_PLUS (mode, vm1, vm2); + ASSERT_RTX_EQ (gen_rtx_PLUS (mode, op0, op2), + simplify_merge_mask (binop, mask1, 0)); + ASSERT_RTX_EQ (gen_rtx_PLUS (mode, op1, op3), + simplify_merge_mask (binop, mask1, 1)); + + /* Intermediate ternary op. */ + rtx tenop = gen_rtx_FMA (mode, vm1, vm2, vm3); + ASSERT_RTX_EQ (gen_rtx_FMA (mode, op0, op2, op4), + simplify_merge_mask (tenop, mask1, 0)); + ASSERT_RTX_EQ (gen_rtx_FMA (mode, op1, op3, op5), + simplify_merge_mask (tenop, mask1, 1)); + + /* Side effects. */ + rtx badop0 = gen_rtx_PRE_INC (mode, op0); + rtx badvm = gen_rtx_VEC_MERGE (mode, badop0, op1, mask1); + ASSERT_EQ (badop0, simplify_merge_mask (badvm, mask1, 0)); + ASSERT_EQ (NULL_RTX, simplify_merge_mask (badvm, mask1, 1)); + + /* Called indirectly. */ + ASSERT_RTX_EQ (gen_rtx_VEC_MERGE (mode, op0, op3, mask1), + simplify_rtx (nvm)); +} + /* Verify some simplifications involving vectors. */ static void @@ -6871,6 +7006,7 @@ test_vector_ops () if (GET_MODE_CLASS (mode) == MODE_VECTOR_INT && maybe_gt (GET_MODE_NUNITS (mode), 2)) test_vector_ops_series (mode, scalar_reg); + test_vec_merge (mode); } } } -- cgit v1.1 From dc16b00717f72aae2d93865a8007ff220b6f022f Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 28 Sep 2018 11:33:29 +0000 Subject: tree.h (BLOCK_ORIGIN): New. 2018-09-28 Richard Biener * tree.h (BLOCK_ORIGIN): New. * omp-expand.c (grid_expand_target_grid_body): Assign BLOCK_ORIGIN to BLOCK_ABSTRACT_ORIGIN. * tree-inline.c (remap_block): Likewise. * auto-profile.c (get_function_decl_from_block): Simplify by eliding the BLOCK_ABSTRACT_ORIGIN chasing. * langhooks.c (lhd_print_error_function): Likewise. * optinfo-emit-json.cc (optrecord_json_writer::inlining_chain_to): Likewise. * tree-ssa-live.c (remove_unused_scope_block_p): Likewise. * tree.c (block_nonartificial_location): Likewise. (block_ultimate_origin): Likewise. * tree-pretty-print.c (percent_K_format): Likewise. Remove no longer needed LTO case. cp/ * error.c (cp_print_error_function): Simplify by eliding the BLOCK_ABSTRACT_ORIGIN chasing. From-SVN: r264689 --- gcc/ChangeLog | 17 +++++++++++++++++ gcc/auto-profile.c | 11 ++--------- gcc/cp/ChangeLog | 5 +++++ gcc/cp/error.c | 10 ---------- gcc/langhooks.c | 10 ---------- gcc/omp-expand.c | 2 +- gcc/optinfo-emit-json.cc | 6 ------ gcc/tree-inline.c | 2 +- gcc/tree-pretty-print.c | 24 ------------------------ gcc/tree-ssa-live.c | 7 +------ gcc/tree.c | 17 +---------------- gcc/tree.h | 2 ++ 12 files changed, 30 insertions(+), 83 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5b685e4..7c5e78b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2018-09-28 Richard Biener + + * tree.h (BLOCK_ORIGIN): New. + * omp-expand.c (grid_expand_target_grid_body): Assign + BLOCK_ORIGIN to BLOCK_ABSTRACT_ORIGIN. + * tree-inline.c (remap_block): Likewise. + * auto-profile.c (get_function_decl_from_block): Simplify + by eliding the BLOCK_ABSTRACT_ORIGIN chasing. + * langhooks.c (lhd_print_error_function): Likewise. + * optinfo-emit-json.cc (optrecord_json_writer::inlining_chain_to): + Likewise. + * tree-ssa-live.c (remove_unused_scope_block_p): Likewise. + * tree.c (block_nonartificial_location): Likewise. + (block_ultimate_origin): Likewise. + * tree-pretty-print.c (percent_K_format): Likewise. Remove + no longer needed LTO case. + 2018-09-28 Andrew Stubbs Jan Hubicka Martin Jambor diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c index 68abe32..f7ba32c 100644 --- a/gcc/auto-profile.c +++ b/gcc/auto-profile.c @@ -354,17 +354,10 @@ get_combined_location (location_t loc, tree decl) static tree get_function_decl_from_block (tree block) { - tree decl; - - if (LOCATION_LOCUS (BLOCK_SOURCE_LOCATION (block)) == UNKNOWN_LOCATION) + if (!inlined_function_outer_scope_p (block)) return NULL_TREE; - for (decl = BLOCK_ABSTRACT_ORIGIN (block); - decl && (TREE_CODE (decl) == BLOCK); - decl = BLOCK_ABSTRACT_ORIGIN (decl)) - if (TREE_CODE (decl) == FUNCTION_DECL) - break; - return decl; + return BLOCK_ABSTRACT_ORIGIN (block); } /* Store inline stack for STMT in STACK. */ diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a28b615..f5d602d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-09-28 Richard Biener + + * error.c (cp_print_error_function): Simplify by eliding + the BLOCK_ABSTRACT_ORIGIN chasing. + 2018-09-27 Paolo Carlini PR c++/84940 diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 601f6d2..0b14dcc 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -3339,10 +3339,6 @@ cp_print_error_function (diagnostic_context *context, if (abstract_origin) { ao = BLOCK_ABSTRACT_ORIGIN (abstract_origin); - while (TREE_CODE (ao) == BLOCK - && BLOCK_ABSTRACT_ORIGIN (ao) - && BLOCK_ABSTRACT_ORIGIN (ao) != ao) - ao = BLOCK_ABSTRACT_ORIGIN (ao); gcc_assert (TREE_CODE (ao) == FUNCTION_DECL); fndecl = ao; } @@ -3364,12 +3360,6 @@ cp_print_error_function (diagnostic_context *context, && BLOCK_ABSTRACT_ORIGIN (block)) { ao = BLOCK_ABSTRACT_ORIGIN (block); - - while (TREE_CODE (ao) == BLOCK - && BLOCK_ABSTRACT_ORIGIN (ao) - && BLOCK_ABSTRACT_ORIGIN (ao) != ao) - ao = BLOCK_ABSTRACT_ORIGIN (ao); - if (TREE_CODE (ao) == FUNCTION_DECL) { fndecl = ao; diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 4e6179f..9d7c2d3 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -385,10 +385,6 @@ lhd_print_error_function (diagnostic_context *context, const char *file, if (abstract_origin) { ao = BLOCK_ABSTRACT_ORIGIN (abstract_origin); - while (TREE_CODE (ao) == BLOCK - && BLOCK_ABSTRACT_ORIGIN (ao) - && BLOCK_ABSTRACT_ORIGIN (ao) != ao) - ao = BLOCK_ABSTRACT_ORIGIN (ao); gcc_assert (TREE_CODE (ao) == FUNCTION_DECL); fndecl = ao; } @@ -416,12 +412,6 @@ lhd_print_error_function (diagnostic_context *context, const char *file, && BLOCK_ABSTRACT_ORIGIN (block)) { ao = BLOCK_ABSTRACT_ORIGIN (block); - - while (TREE_CODE (ao) == BLOCK - && BLOCK_ABSTRACT_ORIGIN (ao) - && BLOCK_ABSTRACT_ORIGIN (ao) != ao) - ao = BLOCK_ABSTRACT_ORIGIN (ao); - if (TREE_CODE (ao) == FUNCTION_DECL) { fndecl = ao; diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c index d2a77c0..e8abde4 100644 --- a/gcc/omp-expand.c +++ b/gcc/omp-expand.c @@ -7629,7 +7629,7 @@ grid_expand_target_grid_body (struct omp_region *target) SET_DECL_ASSEMBLER_NAME (kern_fndecl, DECL_NAME (kern_fndecl)); tree tgtblock = gimple_block (tgt_stmt); tree fniniblock = make_node (BLOCK); - BLOCK_ABSTRACT_ORIGIN (fniniblock) = tgtblock; + BLOCK_ABSTRACT_ORIGIN (fniniblock) = BLOCK_ORIGIN (tgtblock); BLOCK_SOURCE_LOCATION (fniniblock) = BLOCK_SOURCE_LOCATION (tgtblock); BLOCK_SOURCE_END_LOCATION (fniniblock) = BLOCK_SOURCE_END_LOCATION (tgtblock); BLOCK_SUPERCONTEXT (fniniblock) = kern_fndecl; diff --git a/gcc/optinfo-emit-json.cc b/gcc/optinfo-emit-json.cc index 992960e..efdbdb3 100644 --- a/gcc/optinfo-emit-json.cc +++ b/gcc/optinfo-emit-json.cc @@ -299,12 +299,6 @@ optrecord_json_writer::inlining_chain_to_json (location_t loc) && BLOCK_ABSTRACT_ORIGIN (block)) { tree ao = BLOCK_ABSTRACT_ORIGIN (block); - - while (TREE_CODE (ao) == BLOCK - && BLOCK_ABSTRACT_ORIGIN (ao) - && BLOCK_ABSTRACT_ORIGIN (ao) != ao) - ao = BLOCK_ABSTRACT_ORIGIN (ao); - if (TREE_CODE (ao) == FUNCTION_DECL) { fndecl = ao; diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index b2cddc2..42c33d2 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -704,7 +704,7 @@ remap_block (tree *block, copy_body_data *id) old_block = *block; new_block = make_node (BLOCK); TREE_USED (new_block) = TREE_USED (old_block); - BLOCK_ABSTRACT_ORIGIN (new_block) = old_block; + BLOCK_ABSTRACT_ORIGIN (new_block) = BLOCK_ORIGIN (old_block); BLOCK_SOURCE_LOCATION (new_block) = BLOCK_SOURCE_LOCATION (old_block); BLOCK_NONLOCALIZED_VARS (new_block) = vec_safe_copy (BLOCK_NONLOCALIZED_VARS (old_block)); diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index 2c089b1..75b939a 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -3976,35 +3976,11 @@ percent_K_format (text_info *text, location_t loc, tree block) gcc_assert (pp_ti_abstract_origin (text) != NULL); *pp_ti_abstract_origin (text) = NULL; - if (in_lto_p) - { - /* ??? LTO drops all BLOCK_ABSTRACT_ORIGINs apart from those - representing the outermost block of an inlined function. - So walk the BLOCK tree until we hit such a scope. */ - while (block - && TREE_CODE (block) == BLOCK) - { - if (inlined_function_outer_scope_p (block)) - { - *pp_ti_abstract_origin (text) = block; - break; - } - block = BLOCK_SUPERCONTEXT (block); - } - return; - } - while (block && TREE_CODE (block) == BLOCK && BLOCK_ABSTRACT_ORIGIN (block)) { tree ao = BLOCK_ABSTRACT_ORIGIN (block); - - while (TREE_CODE (ao) == BLOCK - && BLOCK_ABSTRACT_ORIGIN (ao) - && BLOCK_ABSTRACT_ORIGIN (ao) != ao) - ao = BLOCK_ABSTRACT_ORIGIN (ao); - if (TREE_CODE (ao) == FUNCTION_DECL) { *pp_ti_abstract_origin (text) = block; diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c index 2623d9b..eee21a6 100644 --- a/gcc/tree-ssa-live.c +++ b/gcc/tree-ssa-live.c @@ -561,12 +561,7 @@ remove_unused_scope_block_p (tree scope, bool in_ctor_dtor_block) will not be emitted properly. */ if (inlined_function_outer_scope_p (scope)) { - tree ao = scope; - - while (ao - && TREE_CODE (ao) == BLOCK - && BLOCK_ABSTRACT_ORIGIN (ao) != ao) - ao = BLOCK_ABSTRACT_ORIGIN (ao); + tree ao = BLOCK_ORIGIN (scope); if (ao && TREE_CODE (ao) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (ao) diff --git a/gcc/tree.c b/gcc/tree.c index 64d9e0b..2bd209b 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -11964,12 +11964,6 @@ block_nonartificial_location (tree block) && BLOCK_ABSTRACT_ORIGIN (block)) { tree ao = BLOCK_ABSTRACT_ORIGIN (block); - - while (TREE_CODE (ao) == BLOCK - && BLOCK_ABSTRACT_ORIGIN (ao) - && BLOCK_ABSTRACT_ORIGIN (ao) != ao) - ao = BLOCK_ABSTRACT_ORIGIN (ao); - if (TREE_CODE (ao) == FUNCTION_DECL) { /* If AO is an artificial inline, point RET to the @@ -12150,16 +12144,7 @@ block_ultimate_origin (const_tree block) return NULL_TREE; else { - tree ret_val; - tree lookahead = immediate_origin; - - do - { - ret_val = lookahead; - lookahead = (TREE_CODE (ret_val) == BLOCK - ? BLOCK_ABSTRACT_ORIGIN (ret_val) : NULL); - } - while (lookahead != NULL && lookahead != ret_val); + tree ret_val = immediate_origin; /* The block's abstract origin chain may not be the *ultimate* origin of the block. It could lead to a DECL that has an abstract origin set. diff --git a/gcc/tree.h b/gcc/tree.h index dcf8253..35536f3 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -1789,6 +1789,8 @@ extern tree maybe_wrap_with_location (tree, location_t); #define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext) #define BLOCK_CHAIN(NODE) (BLOCK_CHECK (NODE)->block.chain) #define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin) +#define BLOCK_ORIGIN(NODE) \ + (BLOCK_ABSTRACT_ORIGIN(NODE) ? BLOCK_ABSTRACT_ORIGIN(NODE) : (NODE)) #define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag) #define BLOCK_DIE(NODE) (BLOCK_CHECK (NODE)->block.die) -- cgit v1.1 From 20a73a194737adc71e93846271132f1153fa8e76 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 28 Sep 2018 13:50:44 +0000 Subject: compiler: fix parsing issue with non-ASCII first package char Fix a bug in the parser code that decides whether a given name should be considered exported or not. The function Lex::is_exported_name (which assumes that its input is a mangled name) was being called on non-mangled (raw utf-8) names in various places. For the bug in question this caused an imported package to be registered under the wrong name. To fix the issue, rename 'Lex::is_exported_name' to 'Lex::is_exported_mangled_name', and add a new 'Lex::is_exported_name' that works on utf-8 strings. Fixes golang/go#27836. Reviewed-on: https://go-review.googlesource.com/137736 From-SVN: r264690 --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/import.cc | 2 -- gcc/go/gofrontend/lex.cc | 14 +++++++++++++- gcc/go/gofrontend/lex.h | 5 +++++ 4 files changed, 19 insertions(+), 4 deletions(-) (limited to 'gcc') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 8cb370f..590d2eb 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -944784a93cf89d3a238e5607c993ea5f18f99c12 +f4a224ec481957ca4f14d0e8cc4fe59cc95b3a49 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/import.cc b/gcc/go/gofrontend/import.cc index 7e06a3c..f9586ac 100644 --- a/gcc/go/gofrontend/import.cc +++ b/gcc/go/gofrontend/import.cc @@ -983,8 +983,6 @@ Import::read_name() std::string ret = this->read_identifier(); if (ret == "?") ret.clear(); - else if (!Lex::is_exported_name(ret)) - ret = '.' + this->package_->pkgpath() + '.' + ret; return ret; } diff --git a/gcc/go/gofrontend/lex.cc b/gcc/go/gofrontend/lex.cc index 3965f30..e641b7e 100644 --- a/gcc/go/gofrontend/lex.cc +++ b/gcc/go/gofrontend/lex.cc @@ -2764,7 +2764,7 @@ Lex::is_unicode_uppercase(unsigned int c) // mangled name which includes only ASCII characters. bool -Lex::is_exported_name(const std::string& name) +Lex::is_exported_mangled_name(const std::string& name) { unsigned char c = name[0]; if (c != '.') @@ -2791,6 +2791,18 @@ Lex::is_exported_name(const std::string& name) } } +// Return whether the identifier NAME should be exported. NAME is a +// an unmangled utf-8 string and may contain non-ASCII characters. + +bool +Lex::is_exported_name(const std::string& name) +{ + unsigned int uchar; + if (Lex::fetch_char(name.c_str(), &uchar) != 0) + return Lex::is_unicode_letter(uchar) && Lex::is_unicode_uppercase(uchar); + return false; +} + // Return whether the identifier NAME contains an invalid character. // This is based on how we handle invalid characters in // gather_identifier. diff --git a/gcc/go/gofrontend/lex.h b/gcc/go/gofrontend/lex.h index 70f752b..cf3de8d 100644 --- a/gcc/go/gofrontend/lex.h +++ b/gcc/go/gofrontend/lex.h @@ -408,6 +408,11 @@ class Lex // Return whether the identifier NAME should be exported. NAME is a // mangled name which includes only ASCII characters. static bool + is_exported_mangled_name(const std::string& name); + + // Return whether the identifier NAME should be exported. NAME is + // an unmangled utf-8 string and may contain non-ASCII characters. + static bool is_exported_name(const std::string& name); // Return whether the identifier NAME is invalid. When we see an -- cgit v1.1 From 259cd78a20e28382e2a5f08daee1acc2a74c6c2d Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Fri, 28 Sep 2018 14:41:45 +0000 Subject: re PR testsuite/87433 (gcc.dg/zero_bits_compound-1.c and gcc.target/aarch64/ashltidisi.c tests fail after combine two to two instruction patch on aarch64) 2018-09-28 Steve Ellcey PR testsuite/87433 * gcc.dg/zero_bits_compound-1.c: Do not run on aarch64*-*-*. From-SVN: r264691 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/zero_bits_compound-1.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 25f6df6..c62b37c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-28 Steve Ellcey + + PR testsuite/87433 + * gcc.dg/zero_bits_compound-1.c: Do not run on aarch64*-*-*. + 2018-09-28 Eric Botcazou * gcc.target/sparc/20160229-1.c: Minor tweak. diff --git a/gcc/testsuite/gcc.dg/zero_bits_compound-1.c b/gcc/testsuite/gcc.dg/zero_bits_compound-1.c index 63b8ac1..e715949 100644 --- a/gcc/testsuite/gcc.dg/zero_bits_compound-1.c +++ b/gcc/testsuite/gcc.dg/zero_bits_compound-1.c @@ -4,7 +4,7 @@ /* Note: This test requires that char, int and long have different sizes and the target has a way to do 32 -> 64 bit zero extension other than AND. */ -/* { dg-do compile { target i?86-*-* x86_64-*-* s390*-*-* aarch64*-*-* } } */ +/* { dg-do compile { target i?86-*-* x86_64-*-* s390*-*-* } } */ /* { dg-require-effective-target lp64 } */ /* { dg-options "-O3 -dP" } */ -- cgit v1.1 From a8b4e6c45a352785320e573c2dc4afe6ce8e40b8 Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Fri, 28 Sep 2018 14:44:15 +0000 Subject: re PR testsuite/87433 (gcc.dg/zero_bits_compound-1.c and gcc.target/aarch64/ashltidisi.c tests fail after combine two to two instruction patch on aarch64) 2018-09-28 Steve Ellcey PR testsuite/87433 * gcc.target/aarch64/ashltidisi.c: Expect 3 asr instructions instead of 4. From-SVN: r264692 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.target/aarch64/ashltidisi.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c62b37c..fae9137 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-09-26 Steve Ellcey + + PR testsuite/87433 + * gcc.target/aarch64/ashltidisi.c: Expect 3 asr instructions + instead of 4. + 2018-09-28 Steve Ellcey PR testsuite/87433 diff --git a/gcc/testsuite/gcc.target/aarch64/ashltidisi.c b/gcc/testsuite/gcc.target/aarch64/ashltidisi.c index 293a0f2..e2a0997 100644 --- a/gcc/testsuite/gcc.target/aarch64/ashltidisi.c +++ b/gcc/testsuite/gcc.target/aarch64/ashltidisi.c @@ -45,5 +45,5 @@ main (int argc, char **argv) return 0; } -/* { dg-final { scan-assembler-times "asr" 4 } } */ +/* { dg-final { scan-assembler-times "asr" 3 } } */ /* { dg-final { scan-assembler-not "extr\t" } } */ -- cgit v1.1 From 713e9ce2c7a9a2561f559ef4b3d169ff37afe9cc Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Fri, 28 Sep 2018 14:46:21 +0000 Subject: Fix date in ChangeLog file. From-SVN: r264693 --- gcc/testsuite/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fae9137..7e67962 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,4 @@ -2018-09-26 Steve Ellcey +2018-09-28 Steve Ellcey PR testsuite/87433 * gcc.target/aarch64/ashltidisi.c: Expect 3 asr instructions -- cgit v1.1 From adb67ffba8c1527fefebc77af9018dffd235eea6 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Fri, 28 Sep 2018 17:15:57 +0200 Subject: i386.h (CC_REGNO): Remove FPSR_REGS. * config/i386/i386.h (CC_REGNO): Remove FPSR_REGS. * config/i386/i386.c (ix86_fixed_condition_code_regs): Use INVALID_REGNUM instead of FPSR_REG. (ix86_md_asm_adjust): Do not clobber FPSR_REG. * config/i386/i386.md: Update comment of FP compares. (fldenv): Do not clobber FPSR_REG. From-SVN: r264694 --- gcc/ChangeLog | 9 +++++++++ gcc/config/i386/i386.c | 5 +---- gcc/config/i386/i386.h | 2 +- gcc/config/i386/i386.md | 32 ++++++++++++++------------------ 4 files changed, 25 insertions(+), 23 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7c5e78b..58a30d0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2018-09-28 Uros Bizjak + + * config/i386/i386.h (CC_REGNO): Remove FPSR_REGS. + * config/i386/i386.c (ix86_fixed_condition_code_regs): Use + INVALID_REGNUM instead of FPSR_REG. + (ix86_md_asm_adjust): Do not clobber FPSR_REG. + * config/i386/i386.md: Update comment of FP compares. + (fldenv): Do not clobber FPSR_REG. + 2018-09-28 Richard Biener * tree.h (BLOCK_ORIGIN): New. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 4f64e67..8018f31 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -21969,7 +21969,7 @@ static bool ix86_fixed_condition_code_regs (unsigned int *p1, unsigned int *p2) { *p1 = FLAGS_REG; - *p2 = FPSR_REG; + *p2 = INVALID_REGNUM; return true; } @@ -43656,9 +43656,6 @@ ix86_md_asm_adjust (vec &outputs, vec &/*inputs*/, vec &constraints, vec &clobbers, HARD_REG_SET &clobbered_regs) { - clobbers.safe_push (gen_rtx_REG (CCFPmode, FPSR_REG)); - SET_HARD_REG_BIT (clobbered_regs, FPSR_REG); - bool saw_asm_flag = false; start_sequence (); diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 0b0e2ed..6feb671 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1501,7 +1501,7 @@ enum reg_class #define MMX_REGNO_P(N) IN_RANGE ((N), FIRST_MMX_REG, LAST_MMX_REG) #define CC_REG_P(X) (REG_P (X) && CC_REGNO_P (REGNO (X))) -#define CC_REGNO_P(X) ((X) == FLAGS_REG || (X) == FPSR_REG) +#define CC_REGNO_P(X) ((X) == FLAGS_REG) #define MOD4_SSE_REG_P(X) (REG_P (X) && MOD4_SSE_REGNO_P (REGNO (X))) #define MOD4_SSE_REGNO_P(N) ((N) == XMM0_REG \ diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 2b189c8b..9194751 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -1463,10 +1463,10 @@ ;; FP compares, step 1: -;; Set the FP condition codes. +;; Set the FP condition codes and move fpsr to ax. -;; We may not use "#" to split and emit these, since the REG_DEAD notes -;; used to manage the reg stack popping would not be preserved. +;; We may not use "#" to split and emit these +;; due to reg-stack pops killing fpsr. (define_insn "*cmp_0_i387" [(set (match_operand:HI 0 "register_operand" "=a") @@ -1649,19 +1649,7 @@ (set_attr "fp_int_src" "true") (set_attr "mode" "")]) -;; FP compares, step 2 -;; Move the fpsw to ax. - -(define_insn "x86_fnstsw_1" - [(set (match_operand:HI 0 "register_operand" "=a") - (unspec:HI [(reg:CCFP FPSR_REG)] UNSPEC_FNSTSW))] - "TARGET_80387" - "fnstsw\t%0" - [(set_attr "length" "2") - (set_attr "mode" "SI") - (set_attr "unit" "i387")]) - -;; FP compares, step 3 +;; FP compares, step 2: ;; Get ax into flags, general case. (define_insn "x86_sahf_1" @@ -1683,7 +1671,7 @@ (set_attr "bdver1_decode" "direct") (set_attr "mode" "SI")]) -;; Pentium Pro can do steps 1 through 3 in one go. +;; Pentium Pro can do both steps in one go. ;; (these instructions set flags directly) (define_subst_attr "unord" "unord_subst" "" "u") @@ -15158,6 +15146,15 @@ } }) +(define_insn "x86_fnstsw_1" + [(set (match_operand:HI 0 "register_operand" "=a") + (unspec:HI [(reg:CCFP FPSR_REG)] UNSPEC_FNSTSW))] + "TARGET_80387" + "fnstsw\t%0" + [(set_attr "length" "2") + (set_attr "mode" "SI") + (set_attr "unit" "i387")]) + (define_insn "fpremxf4_i387" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 2 "register_operand" "0") @@ -19606,7 +19603,6 @@ (define_insn "fldenv" [(unspec_volatile [(match_operand:BLK 0 "memory_operand" "m")] UNSPECV_FLDENV) - (clobber (reg:CCFP FPSR_REG)) (clobber (reg:XF ST0_REG)) (clobber (reg:XF ST1_REG)) (clobber (reg:XF ST2_REG)) -- cgit v1.1 From 02469d3a1d3bdd234ec3832c4a26853586c75f2a Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Fri, 28 Sep 2018 17:30:46 +0200 Subject: i386.h (SSE_REGNO): Fix check for FIRST_REX_SSE_REG. * config/i386/i386.h (SSE_REGNO): Fix check for FIRST_REX_SSE_REG. (GET_SSE_REGNO): Rename from SSE_REGNO. Update all uses for rename. From-SVN: r264695 --- gcc/ChangeLog | 7 ++++++- gcc/config/i386/i386.c | 16 ++++++++-------- gcc/config/i386/i386.h | 8 ++++---- gcc/config/i386/predicates.md | 2 +- gcc/config/i386/sse.md | 2 +- 5 files changed, 20 insertions(+), 15 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 58a30d0..6a68c18 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,11 @@ 2018-09-28 Uros Bizjak - * config/i386/i386.h (CC_REGNO): Remove FPSR_REGS. + * config/i386/i386.h (SSE_REGNO): Fix check for FIRST_REX_SSE_REG. + (GET_SSE_REGNO): Rename from SSE_REGNO. Update all uses for rename. + +2018-09-28 Uros Bizjak + + * config/i386/i386.h (CC_REGNO): Remove FPSR_REG. * config/i386/i386.c (ix86_fixed_condition_code_regs): Use INVALID_REGNUM instead of FPSR_REG. (ix86_md_asm_adjust): Do not clobber FPSR_REG. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 8018f31..176cce5 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -7869,7 +7869,7 @@ construct_container (machine_mode mode, machine_mode orig_mode, case X86_64_SSEDF_CLASS: if (mode != BLKmode) return gen_reg_or_parallel (mode, orig_mode, - SSE_REGNO (sse_regno)); + GET_SSE_REGNO (sse_regno)); break; case X86_64_X87_CLASS: case X86_64_COMPLEX_X87_CLASS: @@ -7885,7 +7885,7 @@ construct_container (machine_mode mode, machine_mode orig_mode, && regclass[1] == X86_64_SSEUP_CLASS && mode != BLKmode) return gen_reg_or_parallel (mode, orig_mode, - SSE_REGNO (sse_regno)); + GET_SSE_REGNO (sse_regno)); if (n == 4 && regclass[0] == X86_64_SSE_CLASS && regclass[1] == X86_64_SSEUP_CLASS @@ -7893,7 +7893,7 @@ construct_container (machine_mode mode, machine_mode orig_mode, && regclass[3] == X86_64_SSEUP_CLASS && mode != BLKmode) return gen_reg_or_parallel (mode, orig_mode, - SSE_REGNO (sse_regno)); + GET_SSE_REGNO (sse_regno)); if (n == 8 && regclass[0] == X86_64_SSE_CLASS && regclass[1] == X86_64_SSEUP_CLASS @@ -7905,7 +7905,7 @@ construct_container (machine_mode mode, machine_mode orig_mode, && regclass[7] == X86_64_SSEUP_CLASS && mode != BLKmode) return gen_reg_or_parallel (mode, orig_mode, - SSE_REGNO (sse_regno)); + GET_SSE_REGNO (sse_regno)); if (n == 2 && regclass[0] == X86_64_X87_CLASS && regclass[1] == X86_64_X87UP_CLASS) @@ -7952,7 +7952,7 @@ construct_container (machine_mode mode, machine_mode orig_mode, exp [nexps++] = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_REG (SFmode, - SSE_REGNO (sse_regno)), + GET_SSE_REGNO (sse_regno)), GEN_INT (i*8)); sse_regno++; break; @@ -7960,7 +7960,7 @@ construct_container (machine_mode mode, machine_mode orig_mode, exp [nexps++] = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_REG (DFmode, - SSE_REGNO (sse_regno)), + GET_SSE_REGNO (sse_regno)), GEN_INT (i*8)); sse_regno++; break; @@ -8006,7 +8006,7 @@ construct_container (machine_mode mode, machine_mode orig_mode, exp [nexps++] = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_REG (tmpmode, - SSE_REGNO (sse_regno)), + GET_SSE_REGNO (sse_regno)), GEN_INT (pos*8)); sse_regno++; break; @@ -9322,7 +9322,7 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum) set_mem_alias_set (mem, set); set_mem_align (mem, GET_MODE_ALIGNMENT (smode)); - emit_move_insn (mem, gen_rtx_REG (smode, SSE_REGNO (i))); + emit_move_insn (mem, gen_rtx_REG (smode, GET_SSE_REGNO (i))); } emit_label (label); diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 6feb671..b0d2f24 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1517,10 +1517,10 @@ enum reg_class #define FIRST_FLOAT_REG FIRST_STACK_REG #define STACK_TOP_P(X) (REG_P (X) && REGNO (X) == FIRST_FLOAT_REG) -#define SSE_REGNO(N) \ - ((N) < 8 ? FIRST_SSE_REG + (N) \ - : (N) <= LAST_REX_SSE_REG ? (FIRST_REX_SSE_REG + (N) - 8) \ - : (FIRST_EXT_REX_SSE_REG + (N) - 16)) +#define GET_SSE_REGNO(N) \ + ((N) < 8 ? FIRST_SSE_REG + (N) \ + : (N) < 16 ? FIRST_REX_SSE_REG + (N) - 8 \ + : FIRST_EXT_REX_SSE_REG + (N) - 16) /* The class value for index registers, and the one for base regs. */ diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index ed3bc7c..de77308 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -1452,7 +1452,7 @@ if (GET_CODE (elt) != SET || GET_CODE (SET_DEST (elt)) != REG || GET_MODE (SET_DEST (elt)) != V8SImode - || REGNO (SET_DEST (elt)) != SSE_REGNO (i) + || REGNO (SET_DEST (elt)) != GET_SSE_REGNO (i) || SET_SRC (elt) != CONST0_RTX (V8SImode)) return false; } diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 1e260c0..0b65572 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -17499,7 +17499,7 @@ for (regno = 0; regno < nregs; regno++) XVECEXP (operands[0], 0, regno + 1) - = gen_rtx_SET (gen_rtx_REG (V8SImode, SSE_REGNO (regno)), + = gen_rtx_SET (gen_rtx_REG (V8SImode, GET_SSE_REGNO (regno)), CONST0_RTX (V8SImode)); }) -- cgit v1.1 From 5718d9d95fd9457c9f6cf49526ef52f974d9419c Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 28 Sep 2018 16:45:51 +0100 Subject: Fix gcc.dg/torture/fp-int-convert.h for excess precision after PR c/87390. As reported in , some fp-int-convert tests fail after my fix for PR c/87390, in Arm / AArch64 configurations where _Float16 uses excess precision by default. The issue is comparisons of the results of a conversion by assignment (compile-time or run-time) from integer to floating-point with the original integer value; previously this would compare against an implicit compile-time conversion to the target type, but now, for C11 and later, it compares against an implicit compile-time conversion to a possibly wider evaluation format. This is fixed by adding casts to the test so that the comparison is with a value converted explicitly to the target type at compile time, without any use of a wider evaluation format. PR c/87390 * gcc.dg/torture/fp-int-convert.h (TEST_I_F_VAL): Convert integer values explicitly to target type for comparison. From-SVN: r264696 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/torture/fp-int-convert.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7e67962..ff242d8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-09-28 Joseph Myers + + PR c/87390 + * gcc.dg/torture/fp-int-convert.h (TEST_I_F_VAL): Convert integer + values explicitly to target type for comparison. + 2018-09-28 Steve Ellcey PR testsuite/87433 diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert.h b/gcc/testsuite/gcc.dg/torture/fp-int-convert.h index 2b904b6..f0b3f39 100644 --- a/gcc/testsuite/gcc.dg/torture/fp-int-convert.h +++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert.h @@ -90,6 +90,7 @@ do { \ if (ivin != (VAL) \ || ((PREC_OK) && ivout != ivin) \ || ((PREC_OK) && ivout != (VAL)) \ - || fv1 != (VAL) || fv2 != (VAL) || fv1 != fv2) \ + || fv1 != (FT) (VAL) || fv2 != (FT) (VAL) \ + || fv1 != fv2) \ abort (); \ } while (0) -- cgit v1.1 From ed2d9d3720adef3a260b8a55e17e744352a901fc Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 28 Sep 2018 17:40:04 +0000 Subject: dumpfile.c: use prefixes other than 'note: ' for MSG_{OPTIMIZED_LOCATIONS|MISSED_OPTIMIZATION} As noted at Cauldron, dumpfile.c currently emits "note: " for all kinds of dump message, so that (after filtering) there's no distinction between MSG_OPTIMIZED_LOCATIONS vs MSG_NOTE vs MSG_MISSED_OPTIMIZATION in the textual output. This patch changes dumpfile.c so that the "note: " varies to show which MSG_* was used, with the string prefix matching that used for filtering in -fopt-info, hence e.g. directive_unroll_3.f90:24:0: optimized: loop unrolled 7 times and: pr19210-1.c:24:3: missed: missed loop optimization: niters analysis ends up with assumptions. The patch adds "dg-optimized" and "dg-missed" directives for use in the testsuite for matching these (with -fopt-info on stderr; they don't help for dumpfile output). The patch also converts the various problem-reporting dump messages in coverage.c:get_coverage_counts to use MSG_MISSED_OPTIMIZATION rather than MSG_OPTIMIZED_LOCATIONS, as the docs call out "optimized" as "information when an optimization is successfully applied", whereas "missed" is for "information about missed optimizations", and problems with profile data seem to me to fall much more into the latter category than the former. Doing so requires converting a few tests from using "-fopt-info" (which is implicitly "-fopt-info-optimized-optall") to getting the "missed" optimizations. Changing them to "-fopt-info-missed" added lots of noise from the vectorizer, so I changed these tests to use "-fopt-info-missed-ipa". gcc/ChangeLog: * coverage.c (get_coverage_counts): Convert problem-reporting dump messages from MSG_OPTIMIZED_LOCATIONS to MSG_MISSED_OPTIMIZATION. * dumpfile.c (kind_as_string): New function. (dump_loc): Rather than a hardcoded prefix of "note: ", use kind_as_string to vary the prefix based on dump_kind. (selftest::test_capture_of_dump_calls): Update for above. gcc/testsuite/ChangeLog: * c-c++-common/unroll-1.c: Update expected output from "note" to "optimized". * c-c++-common/unroll-2.c: Likewise. * c-c++-common/unroll-3.c: Likewise. * g++.dg/tree-ssa/dom-invalid.C: Update expected output from dg-message to dg-missed. Convert param from -fopt-info to -fopt-info-missed-ipa. * g++.dg/tree-ssa/pr81408.C: Update expected output from dg-message to dg-missed. * g++.dg/vect/slp-pr56812.cc: Update expected output from dg-message to dg-optimized. * gcc.dg/pr26570.c: Update expected output from dg-message to dg-missed. Convert param from -fopt-info to -fopt-info-missed-ipa. * gcc.dg/pr32773.c: Likewise. * gcc.dg/tree-ssa/pr19210-1.c: Update expected output from dg-message to dg-missed. * gcc.dg/unroll-2.c: Update expected output from dg-message to dg-optimized. * gcc.dg/vect/nodump-vect-opt-info-1.c: Likewise. Convert param from -fopt-info to -fopt-info-vec. * gfortran.dg/directive_unroll_1.f90: Update expected output from "note" to "optimized". * gfortran.dg/directive_unroll_2.f90: Likewise. * gfortran.dg/directive_unroll_3.f90: Likewise. * gnat.dg/unroll4.adb: Likewise. * lib/gcc-dg.exp (dg-optimized): New procedure. (dg-missed): New procedure. From-SVN: r264697 --- gcc/ChangeLog | 9 ++++++ gcc/coverage.c | 10 +++---- gcc/dumpfile.c | 33 ++++++++++++++++++---- gcc/testsuite/ChangeLog | 31 ++++++++++++++++++++ gcc/testsuite/c-c++-common/unroll-1.c | 8 +++--- gcc/testsuite/c-c++-common/unroll-2.c | 8 +++--- gcc/testsuite/c-c++-common/unroll-3.c | 12 ++++---- gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C | 4 +-- gcc/testsuite/g++.dg/tree-ssa/pr81408.C | 2 +- gcc/testsuite/g++.dg/vect/slp-pr56812.cc | 2 +- gcc/testsuite/gcc.dg/pr26570.c | 4 +-- gcc/testsuite/gcc.dg/pr32773.c | 6 ++-- gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c | 8 +++--- gcc/testsuite/gcc.dg/unroll-2.c | 4 +-- gcc/testsuite/gcc.dg/vect/nodump-vect-opt-info-1.c | 6 ++-- gcc/testsuite/gfortran.dg/directive_unroll_1.f90 | 6 ++-- gcc/testsuite/gfortran.dg/directive_unroll_2.f90 | 6 ++-- gcc/testsuite/gfortran.dg/directive_unroll_3.f90 | 8 +++--- gcc/testsuite/gnat.dg/unroll4.adb | 2 +- gcc/testsuite/lib/gcc-dg.exp | 20 +++++++++++++ 20 files changed, 136 insertions(+), 53 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a68c18..856a72e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2018-09-28 David Malcolm + + * coverage.c (get_coverage_counts): Convert problem-reporting dump + messages from MSG_OPTIMIZED_LOCATIONS to MSG_MISSED_OPTIMIZATION. + * dumpfile.c (kind_as_string): New function. + (dump_loc): Rather than a hardcoded prefix of "note: ", use + kind_as_string to vary the prefix based on dump_kind. + (selftest::test_capture_of_dump_calls): Update for above. + 2018-09-28 Uros Bizjak * config/i386/i386.h (SSE_REGNO): Fix check for FIRST_REX_SSE_REG. diff --git a/gcc/coverage.c b/gcc/coverage.c index 6b45ce9..701460c 100644 --- a/gcc/coverage.c +++ b/gcc/coverage.c @@ -313,7 +313,7 @@ get_coverage_counts (unsigned counter, unsigned cfg_checksum, { dump_user_location_t loc = dump_user_location_t::from_location_t (input_location); - dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc, + dump_printf_loc (MSG_MISSED_OPTIMIZATION, loc, "file %s not found, %s\n", da_file_name, (flag_guess_branch_prob ? "execution counts estimated" @@ -359,7 +359,7 @@ get_coverage_counts (unsigned counter, unsigned cfg_checksum, { dump_user_location_t loc = dump_user_location_t::from_location_t (input_location); - dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc, + dump_printf_loc (MSG_MISSED_OPTIMIZATION, loc, "use -Wno-error=coverage-mismatch to tolerate " "the mismatch but performance may drop if the " "function is hot\n"); @@ -367,14 +367,14 @@ get_coverage_counts (unsigned counter, unsigned cfg_checksum, if (!seen_error () && !warned++) { - dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc, + dump_printf_loc (MSG_MISSED_OPTIMIZATION, loc, "coverage mismatch ignored\n"); - dump_printf (MSG_OPTIMIZED_LOCATIONS, + dump_printf (MSG_MISSED_OPTIMIZATION, flag_guess_branch_prob ? G_("execution counts estimated\n") : G_("execution counts assumed to be zero\n")); if (!flag_guess_branch_prob) - dump_printf (MSG_OPTIMIZED_LOCATIONS, + dump_printf (MSG_MISSED_OPTIMIZATION, "this can result in poorly optimized code\n"); } } diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c index b4faeaa..d430ea3 100644 --- a/gcc/dumpfile.c +++ b/gcc/dumpfile.c @@ -437,6 +437,27 @@ dump_user_location_t::from_function_decl (tree fndecl) DECL_SOURCE_LOCATION (fndecl)); } +/* Extract the MSG_* component from DUMP_KIND and return a string for use + as a prefix to dump messages. + These match the strings in optinfo_verbosity_options and thus the + "OPTIONS" within "-fopt-info-OPTIONS". */ + +static const char * +kind_as_string (dump_flags_t dump_kind) +{ + switch (dump_kind & MSG_ALL) + { + default: + gcc_unreachable (); + case MSG_OPTIMIZED_LOCATIONS: + return "optimized"; + case MSG_MISSED_OPTIMIZATION: + return "missed"; + case MSG_NOTE: + return "note"; + } +} + /* Print source location on DFILE if enabled. */ static void @@ -445,13 +466,14 @@ dump_loc (dump_flags_t dump_kind, FILE *dfile, source_location loc) if (dump_kind) { if (LOCATION_LOCUS (loc) > BUILTINS_LOCATION) - fprintf (dfile, "%s:%d:%d: note: ", LOCATION_FILE (loc), + fprintf (dfile, "%s:%d:%d: ", LOCATION_FILE (loc), LOCATION_LINE (loc), LOCATION_COLUMN (loc)); else if (current_function_decl) - fprintf (dfile, "%s:%d:%d: note: ", + fprintf (dfile, "%s:%d:%d: ", DECL_SOURCE_FILE (current_function_decl), DECL_SOURCE_LINE (current_function_decl), DECL_SOURCE_COLUMN (current_function_decl)); + fprintf (dfile, "%s: ", kind_as_string (dump_kind)); /* Indentation based on scope depth. */ fprintf (dfile, "%*s", get_dump_scope_depth (), ""); } @@ -465,13 +487,14 @@ dump_loc (dump_flags_t dump_kind, pretty_printer *pp, source_location loc) if (dump_kind) { if (LOCATION_LOCUS (loc) > BUILTINS_LOCATION) - pp_printf (pp, "%s:%d:%d: note: ", LOCATION_FILE (loc), + pp_printf (pp, "%s:%d:%d: ", LOCATION_FILE (loc), LOCATION_LINE (loc), LOCATION_COLUMN (loc)); else if (current_function_decl) - pp_printf (pp, "%s:%d:%d: note: ", + pp_printf (pp, "%s:%d:%d: ", DECL_SOURCE_FILE (current_function_decl), DECL_SOURCE_LINE (current_function_decl), DECL_SOURCE_COLUMN (current_function_decl)); + pp_printf (pp, "%s: ", kind_as_string (dump_kind)); /* Indentation based on scope depth. */ for (unsigned i = 0; i < get_dump_scope_depth (); i++) pp_character (pp, ' '); @@ -2325,7 +2348,7 @@ test_capture_of_dump_calls (const line_table_case &case_) } dump_printf_loc (MSG_NOTE, stmt, "msg 7\n"); - ASSERT_DUMPED_TEXT_EQ (tmp, "test.txt:5:10: note: msg 4\n"); + ASSERT_DUMPED_TEXT_EQ (tmp, "test.txt:5:10: optimized: msg 4\n"); } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ff242d8..2a81011 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,34 @@ +2018-09-28 David Malcolm + + * c-c++-common/unroll-1.c: Update expected output from "note" to + "optimized". + * c-c++-common/unroll-2.c: Likewise. + * c-c++-common/unroll-3.c: Likewise. + * g++.dg/tree-ssa/dom-invalid.C: Update expected output from + dg-message to dg-missed. Convert param from -fopt-info to + -fopt-info-missed-ipa. + * g++.dg/tree-ssa/pr81408.C: Update expected output from + dg-message to dg-missed. + * g++.dg/vect/slp-pr56812.cc: Update expected output from + dg-message to dg-optimized. + * gcc.dg/pr26570.c: Update expected output from dg-message to + dg-missed. Convert param from -fopt-info to + -fopt-info-missed-ipa. + * gcc.dg/pr32773.c: Likewise. + * gcc.dg/tree-ssa/pr19210-1.c: Update expected output from + dg-message to dg-missed. + * gcc.dg/unroll-2.c: Update expected output from dg-message to + dg-optimized. + * gcc.dg/vect/nodump-vect-opt-info-1.c: Likewise. Convert param + from -fopt-info to -fopt-info-vec. + * gfortran.dg/directive_unroll_1.f90: Update expected output from + "note" to "optimized". + * gfortran.dg/directive_unroll_2.f90: Likewise. + * gfortran.dg/directive_unroll_3.f90: Likewise. + * gnat.dg/unroll4.adb: Likewise. + * lib/gcc-dg.exp (dg-optimized): New procedure. + (dg-missed): New procedure. + 2018-09-28 Joseph Myers PR c/87390 diff --git a/gcc/testsuite/c-c++-common/unroll-1.c b/gcc/testsuite/c-c++-common/unroll-1.c index 105a82c6..fe7f4f3 100644 --- a/gcc/testsuite/c-c++-common/unroll-1.c +++ b/gcc/testsuite/c-c++-common/unroll-1.c @@ -20,22 +20,22 @@ void test (void) #pragma GCC unroll 8 for (unsigned long i = 1; i <= 15; ++i) bar(i); - /* { dg-final { scan-rtl-dump "21:.*: note: loop unrolled 7 times" "loop2_unroll" } } */ + /* { dg-final { scan-rtl-dump "21:.*: optimized: loop unrolled 7 times" "loop2_unroll" } } */ #pragma GCC unroll 8 for (unsigned long i = 1; i <= j; ++i) bar(i); - /* { dg-final { scan-rtl-dump "26:.*: note: loop unrolled 7 times" "loop2_unroll" } } */ + /* { dg-final { scan-rtl-dump "26:.*: optimized: loop unrolled 7 times" "loop2_unroll" } } */ #pragma GCC unroll 7 for (unsigned long i = 1; i <= j; ++i) bar(i); - /* { dg-final { scan-rtl-dump "31:.*: note: loop unrolled 3 times" "loop2_unroll" } } */ + /* { dg-final { scan-rtl-dump "31:.*: optimized: loop unrolled 3 times" "loop2_unroll" } } */ unsigned long i = 0; #pragma GCC unroll 3 do { bar(i); } while (++i < 9); - /* { dg-final { scan-rtl-dump "3\[79\]:.*: note: loop unrolled 2 times" "loop2_unroll" } } */ + /* { dg-final { scan-rtl-dump "3\[79\]:.*: optimized: loop unrolled 2 times" "loop2_unroll" } } */ } diff --git a/gcc/testsuite/c-c++-common/unroll-2.c b/gcc/testsuite/c-c++-common/unroll-2.c index a67a1d7..0bb4bbb 100644 --- a/gcc/testsuite/c-c++-common/unroll-2.c +++ b/gcc/testsuite/c-c++-common/unroll-2.c @@ -20,22 +20,22 @@ void test (void) #pragma GCC unroll 8 for (unsigned long i = 1; i <= 15; ++i) bar(i); - /* { dg-final { scan-rtl-dump "21:.*: note: loop unrolled 7 times" "loop2_unroll" } } */ + /* { dg-final { scan-rtl-dump "21:.*: optimized: loop unrolled 7 times" "loop2_unroll" } } */ #pragma GCC unroll 8 for (unsigned long i = 1; i <= j; ++i) bar(i); - /* { dg-final { scan-rtl-dump "26:.*: note: loop unrolled 7 times" "loop2_unroll" } } */ + /* { dg-final { scan-rtl-dump "26:.*: optimized: loop unrolled 7 times" "loop2_unroll" } } */ #pragma GCC unroll 7 for (unsigned long i = 1; i <= j; ++i) bar(i); - /* { dg-final { scan-rtl-dump "31:.*: note: loop unrolled 3 times" "loop2_unroll" } } */ + /* { dg-final { scan-rtl-dump "31:.*: optimized: loop unrolled 3 times" "loop2_unroll" } } */ unsigned long i = 0; #pragma GCC unroll 3 do { bar(i); } while (++i < 9); - /* { dg-final { scan-rtl-dump "3\[79\]:.*: note: loop unrolled 2 times" "loop2_unroll" } } */ + /* { dg-final { scan-rtl-dump "3\[79\]:.*: optimized: loop unrolled 2 times" "loop2_unroll" } } */ } diff --git a/gcc/testsuite/c-c++-common/unroll-3.c b/gcc/testsuite/c-c++-common/unroll-3.c index 6cefa75..541accb 100644 --- a/gcc/testsuite/c-c++-common/unroll-3.c +++ b/gcc/testsuite/c-c++-common/unroll-3.c @@ -10,32 +10,32 @@ void test (void) #pragma GCC unroll 8 for (unsigned long i = 1; i <= 8; ++i) bar(i); - /* { dg-final { scan-rtl-dump-not "11:.*: note: loop unrolled" "loop2_unroll" } } */ + /* { dg-final { scan-rtl-dump-not "11:.*: optimized: loop unrolled" "loop2_unroll" } } */ #pragma GCC unroll 8 for (unsigned long i = 1; i <= 7; ++i) bar(i); - /* { dg-final { scan-rtl-dump-not "16:.*: note: loop unrolled" "loop2_unroll" } } */ + /* { dg-final { scan-rtl-dump-not "16:.*: optimized: loop unrolled" "loop2_unroll" } } */ #pragma GCC unroll 8 for (unsigned long i = 1; i <= 15; ++i) bar(i); - /* { dg-final { scan-rtl-dump "21:.*: note: loop unrolled 7 times" "loop2_unroll" } } */ + /* { dg-final { scan-rtl-dump "21:.*: optimized: loop unrolled 7 times" "loop2_unroll" } } */ #pragma GCC unroll 8 for (unsigned long i = 1; i <= j; ++i) bar(i); - /* { dg-final { scan-rtl-dump "26:.*: note: loop unrolled 7 times" "loop2_unroll" } } */ + /* { dg-final { scan-rtl-dump "26:.*: optimized: loop unrolled 7 times" "loop2_unroll" } } */ #pragma GCC unroll 7 for (unsigned long i = 1; i <= j; ++i) bar(i); - /* { dg-final { scan-rtl-dump "31:.*: note: loop unrolled 3 times" "loop2_unroll" } } */ + /* { dg-final { scan-rtl-dump "31:.*: optimized: loop unrolled 3 times" "loop2_unroll" } } */ unsigned long i = 0; #pragma GCC unroll 3 do { bar(i); } while (++i < 9); - /* { dg-final { scan-rtl-dump "3\[79\]:.*: note: loop unrolled 2 times" "loop2_unroll" } } */ + /* { dg-final { scan-rtl-dump "3\[79\]:.*: optimized: loop unrolled 2 times" "loop2_unroll" } } */ } diff --git a/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C b/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C index 3c01383..9aed74a 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C +++ b/gcc/testsuite/g++.dg/tree-ssa/dom-invalid.C @@ -1,7 +1,7 @@ // PR tree-optimization/39557 // invalid post-dom info leads to infinite loop // { dg-do run } -// { dg-options "-Wall -fno-exceptions -O2 -fprofile-use -fopt-info -fno-rtti -Wno-missing-profile" } +// { dg-options "-Wall -fno-exceptions -O2 -fprofile-use -fopt-info-missed-ipa -fno-rtti -Wno-missing-profile" } struct C { @@ -49,4 +49,4 @@ main () { E e; e.bar (); -} // { dg-message "note: file" } +} // { dg-missed "file .* not found" } diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C index 89d6e55..39e32fd 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr81408.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr81408.C @@ -86,7 +86,7 @@ a::H t; void ShowHelpListCommands () { - for (auto c : t) /* { dg-message "note: missed loop optimization: niters analysis .*" } */ + for (auto c : t) /* { dg-missed "missed loop optimization: niters analysis .*" } */ a::ax << c.ay << a::av; } diff --git a/gcc/testsuite/g++.dg/vect/slp-pr56812.cc b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc index 08b0981..3e7a495 100644 --- a/gcc/testsuite/g++.dg/vect/slp-pr56812.cc +++ b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc @@ -14,6 +14,6 @@ public: void mydata::Set (float x) { /* We want to vectorize this either as loop or basic-block. */ - for (int i=0; i= n;k--) /* { dg-message "note: missed loop optimization: niters analysis .*" } */ + for(k = 15;k >= n;k--) /* { dg-missed "missed loop optimization: niters analysis .*" } */ g(); } diff --git a/gcc/testsuite/gcc.dg/unroll-2.c b/gcc/testsuite/gcc.dg/unroll-2.c index 46126c3..8baceaa 100644 --- a/gcc/testsuite/gcc.dg/unroll-2.c +++ b/gcc/testsuite/gcc.dg/unroll-2.c @@ -15,7 +15,7 @@ int foo(void) { int i; bar(); - for (i = 0; i < 2; i++) /* { dg-message "note: loop with 2 iterations completely unrolled" } */ + for (i = 0; i < 2; i++) /* { dg-optimized "loop with 2 iterations completely unrolled" } */ { a[i]= b[i] + 1; } @@ -25,7 +25,7 @@ int foo(void) int foo2(void) { int i; - for (i = 0; i < 2; i++) /* { dg-message "note: loop with 2 iterations completely unrolled" } */ + for (i = 0; i < 2; i++) /* { dg-optimized "loop with 2 iterations completely unrolled" } */ { a[i]= b[i] + 1; } diff --git a/gcc/testsuite/gcc.dg/vect/nodump-vect-opt-info-1.c b/gcc/testsuite/gcc.dg/vect/nodump-vect-opt-info-1.c index 0b14b8e..258e378 100644 --- a/gcc/testsuite/gcc.dg/vect/nodump-vect-opt-info-1.c +++ b/gcc/testsuite/gcc.dg/vect/nodump-vect-opt-info-1.c @@ -1,11 +1,11 @@ /* { dg-do compile { target vect_int } } */ -/* { dg-additional-options "-std=c99 -fopt-info -O3" } */ +/* { dg-additional-options "-std=c99 -fopt-info-vec -O3" } */ void vadd (int *dst, int *op1, int *op2, int count) { -/* { dg-message "loop vectorized" "" { target *-*-* } .+2 } */ -/* { dg-message "loop versioned for vectorization because of possible aliasing" "" { target *-*-* } .+1 } */ +/* { dg-optimized "loop vectorized" "" { target *-*-* } .+2 } */ +/* { dg-optimized "loop versioned for vectorization because of possible aliasing" "" { target *-*-* } .+1 } */ for (int i = 0; i < count; ++i) dst[i] = op1[i] + op2[i]; } diff --git a/gcc/testsuite/gfortran.dg/directive_unroll_1.f90 b/gcc/testsuite/gfortran.dg/directive_unroll_1.f90 index 85b3671..d758ad7 100644 --- a/gcc/testsuite/gfortran.dg/directive_unroll_1.f90 +++ b/gcc/testsuite/gfortran.dg/directive_unroll_1.f90 @@ -24,7 +24,7 @@ subroutine test2(a, n) DO i=1, n, 1 call dummy(a(i)) ENDDO -! { dg-final { scan-rtl-dump "24:.: note: loop unrolled 7 times" "loop2_unroll" } } +! { dg-final { scan-rtl-dump "24:.: optimized: loop unrolled 7 times" "loop2_unroll" } } end subroutine test2 subroutine test3(a, n) @@ -36,7 +36,7 @@ subroutine test3(a, n) DO i=n, 1, -1 call dummy(a(i)) ENDDO -! { dg-final { scan-rtl-dump "36:.: note: loop unrolled 7 times" "loop2_unroll" } } +! { dg-final { scan-rtl-dump "36:.: optimized: loop unrolled 7 times" "loop2_unroll" } } end subroutine test3 subroutine test4(a, n) @@ -48,5 +48,5 @@ subroutine test4(a, n) DO i=1, n, 2 call dummy(a(i)) ENDDO -! { dg-final { scan-rtl-dump "48:.: note: loop unrolled 7 times" "loop2_unroll" } } +! { dg-final { scan-rtl-dump "48:.: optimized: loop unrolled 7 times" "loop2_unroll" } } end subroutine test4 diff --git a/gcc/testsuite/gfortran.dg/directive_unroll_2.f90 b/gcc/testsuite/gfortran.dg/directive_unroll_2.f90 index 6dff8fa..c726227 100644 --- a/gcc/testsuite/gfortran.dg/directive_unroll_2.f90 +++ b/gcc/testsuite/gfortran.dg/directive_unroll_2.f90 @@ -24,7 +24,7 @@ subroutine test2(a, n) DO i=1, n, 1 call dummy(a(i)) ENDDO -! { dg-final { scan-rtl-dump "24:.: note: loop unrolled 7 times" "loop2_unroll" } } +! { dg-final { scan-rtl-dump "24:.: optimized: loop unrolled 7 times" "loop2_unroll" } } end subroutine test2 subroutine test3(a, n) @@ -36,7 +36,7 @@ subroutine test3(a, n) DO i=n, 1, -1 call dummy(a(i)) ENDDO -! { dg-final { scan-rtl-dump "36:.: note: loop unrolled 7 times" "loop2_unroll" } } +! { dg-final { scan-rtl-dump "36:.: optimized: loop unrolled 7 times" "loop2_unroll" } } end subroutine test3 subroutine test4(a, n) @@ -48,5 +48,5 @@ subroutine test4(a, n) DO i=1, n, 2 call dummy(a(i)) ENDDO -! { dg-final { scan-rtl-dump "48:.: note: loop unrolled 7 times" "loop2_unroll" } } +! { dg-final { scan-rtl-dump "48:.: optimized: loop unrolled 7 times" "loop2_unroll" } } end subroutine test4 diff --git a/gcc/testsuite/gfortran.dg/directive_unroll_3.f90 b/gcc/testsuite/gfortran.dg/directive_unroll_3.f90 index 4e3ec09..59a8e02 100644 --- a/gcc/testsuite/gfortran.dg/directive_unroll_3.f90 +++ b/gcc/testsuite/gfortran.dg/directive_unroll_3.f90 @@ -12,7 +12,7 @@ subroutine test1(a) DO i=1, 8, 1 call dummy(a(i)) ENDDO -! { dg-final { scan-rtl-dump-not "12:.: note: loop unrolled" "loop2_unroll" } } +! { dg-final { scan-rtl-dump-not "12:.: optimized: loop unrolled" "loop2_unroll" } } end subroutine test1 subroutine test2(a, n) @@ -24,7 +24,7 @@ subroutine test2(a, n) DO i=1, n, 1 call dummy(a(i)) ENDDO -! { dg-final { scan-rtl-dump "24:.: note: loop unrolled 7 times" "loop2_unroll" } } +! { dg-final { scan-rtl-dump "24:.: optimized: loop unrolled 7 times" "loop2_unroll" } } end subroutine test2 subroutine test3(a, n) @@ -36,7 +36,7 @@ subroutine test3(a, n) DO i=n, 1, -1 call dummy(a(i)) ENDDO -! { dg-final { scan-rtl-dump "36:.: note: loop unrolled 7 times" "loop2_unroll" } } +! { dg-final { scan-rtl-dump "36:.: optimized: loop unrolled 7 times" "loop2_unroll" } } end subroutine test3 subroutine test4(a, n) @@ -48,5 +48,5 @@ subroutine test4(a, n) DO i=1, n, 2 call dummy(a(i)) ENDDO -! { dg-final { scan-rtl-dump "48:.: note: loop unrolled 7 times" "loop2_unroll" } } +! { dg-final { scan-rtl-dump "48:.: optimized: loop unrolled 7 times" "loop2_unroll" } } end subroutine test4 diff --git a/gcc/testsuite/gnat.dg/unroll4.adb b/gcc/testsuite/gnat.dg/unroll4.adb index d9b763a..0cea4e8 100644 --- a/gcc/testsuite/gnat.dg/unroll4.adb +++ b/gcc/testsuite/gnat.dg/unroll4.adb @@ -23,4 +23,4 @@ package body Unroll4 is end Unroll4; --- { dg-final { scan-rtl-dump-times "note: loop unrolled 7 times" 2 "loop2_unroll" } } +-- { dg-final { scan-rtl-dump-times "optimized: loop unrolled 7 times" 2 "loop2_unroll" } } diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 24d0b00..c33a50c 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -1194,6 +1194,26 @@ proc dg-locus { args } { verbose "process-message:\n${dg-messages}" 2 } +# Handle output from -fopt-info for MSG_OPTIMIZED_LOCATIONS: +# a successful optimization. + +proc dg-optimized { args } { + # Make this variable available here and to the saved proc. + upvar dg-messages dg-messages + + process-message saved-dg-error "optimized: " "$args" +} + +# Handle output from -fopt-info for MSG_MISSED_OPTIMIZATION: +# a missed optimization. + +proc dg-missed { args } { + # Make this variable available here and to the saved proc. + upvar dg-messages dg-messages + + process-message saved-dg-error "missed: " "$args" +} + # Check the existence of a gdb in the path, and return true if there # is one. # -- cgit v1.1 From a0bdbb09bbe5dc8fad9684e12ec22d9a2f5b0d08 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 28 Sep 2018 17:49:48 +0000 Subject: opt-suggestions.c: fix minor memory leak gcc/ChangeLog: * opt-suggestions.c (option_proposer::build_option_suggestions): Release "option_values". From-SVN: r264698 --- gcc/ChangeLog | 5 +++++ gcc/opt-suggestions.c | 1 + 2 files changed, 6 insertions(+) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 856a72e..24afef2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2018-09-28 David Malcolm + * opt-suggestions.c (option_proposer::build_option_suggestions): + Release "option_values". + +2018-09-28 David Malcolm + * coverage.c (get_coverage_counts): Convert problem-reporting dump messages from MSG_OPTIMIZED_LOCATIONS to MSG_MISSED_OPTIMIZATION. * dumpfile.c (kind_as_string): New function. diff --git a/gcc/opt-suggestions.c b/gcc/opt-suggestions.c index c68c9ee..9444a35 100644 --- a/gcc/opt-suggestions.c +++ b/gcc/opt-suggestions.c @@ -152,6 +152,7 @@ option_proposer::build_option_suggestions (const char *prefix) free (with_arg); } } + option_values.release (); } else add_misspelling_candidates (m_option_suggestions, option, -- cgit v1.1 From 44662f681e8be6b3b7eafcec4afa0ecb8cc587cd Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 28 Sep 2018 21:20:53 +0000 Subject: calls.c (expand_call): Try to do a tail call for thunks at -O0 too. * calls.c (expand_call): Try to do a tail call for thunks at -O0 too. * cgraph.h (struct cgraph_thunk_info): Add indirect_offset. (cgraph_node::create_thunk): Add indirect_offset parameter. (thunk_adjust): Likewise. * cgraph.c (cgraph_node::create_thunk): Add indirect_offset parameter and initialize the corresponding field with it. (cgraph_node::dump): Dump indirect_offset field. * cgraphclones.c (duplicate_thunk_for_node): Deal with indirect_offset. * cgraphunit.c (cgraph_node::analyze): Be prepared for external thunks. (thunk_adjust): Add indirect_offset parameter and deal with it. (cgraph_node::expand_thunk): Deal with the indirect_offset field and pass it to thunk_adjust. Do not call the target hook if it's non-zero or if the thunk is external or local. Fix formatting. Do not chain the RESULT_DECL to BLOCK_VARS. Pass the static chain to the target, if any, in the GIMPLE representation. * ipa-icf.c (sem_function::equals_wpa): Deal with indirect_offset. * lto-cgraph.c (lto_output_node): Write indirect_offset field. (input_node): Read indirect_offset field. * tree-inline.c (expand_call_inline): Pass indirect_offset field in the call to thunk_adjust. * tree-nested.c (struct nesting_info): Add thunk_p field. (create_nesting_tree): Set it. (convert_all_function_calls): Copy static chain from targets to thunks. (finalize_nesting_tree_1): Return early for thunks. (unnest_nesting_tree_1): Do not finalize thunks. (gimplify_all_functions): Do not gimplify thunks. cp/ * method.c (use_thunk): Adjust call to cgraph_node::create_thunk. ada/ * gcc-interface/decl.c (is_cplusplus_method): Do not require C++ convention on Interfaces. * gcc-interface/trans.c (Subprogram_Body_to_gnu): Try to create a bona-fide thunk and hand it over to the middle-end. (get_controlling_type): New function. (use_alias_for_thunk_p): Likewise. (thunk_labelno): New static variable. (make_covariant_thunk): New function. (maybe_make_gnu_thunk): Likewise. * gcc-interface/utils.c (finish_subprog_decl): Set DECL_CONTEXT of the result DECL here instead of... (end_subprog_body): ...here. Co-Authored-By: Pierre-Marie de Rodat From-SVN: r264701 --- gcc/ChangeLog | 30 ++++++ gcc/ada/ChangeLog | 16 +++ gcc/ada/gcc-interface/decl.c | 6 +- gcc/ada/gcc-interface/trans.c | 242 ++++++++++++++++++++++++++++++++++++++++++ gcc/ada/gcc-interface/utils.c | 4 +- gcc/calls.c | 3 +- gcc/cgraph.c | 7 +- gcc/cgraph.h | 8 +- gcc/cgraphclones.c | 7 +- gcc/cgraphunit.c | 118 +++++++++++++++----- gcc/cp/ChangeLog | 5 + gcc/cp/method.c | 2 +- gcc/ipa-icf.c | 2 + gcc/lto-cgraph.c | 5 +- gcc/tree-inline.c | 2 +- gcc/tree-nested.c | 33 +++++- 16 files changed, 441 insertions(+), 49 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 24afef2..96baa7d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,33 @@ +2018-09-28 Eric Botcazou + Pierre-Marie de Rodat + + * calls.c (expand_call): Try to do a tail call for thunks at -O0 too. + * cgraph.h (struct cgraph_thunk_info): Add indirect_offset. + (cgraph_node::create_thunk): Add indirect_offset parameter. + (thunk_adjust): Likewise. + * cgraph.c (cgraph_node::create_thunk): Add indirect_offset parameter + and initialize the corresponding field with it. + (cgraph_node::dump): Dump indirect_offset field. + * cgraphclones.c (duplicate_thunk_for_node): Deal with indirect_offset. + * cgraphunit.c (cgraph_node::analyze): Be prepared for external thunks. + (thunk_adjust): Add indirect_offset parameter and deal with it. + (cgraph_node::expand_thunk): Deal with the indirect_offset field and + pass it to thunk_adjust. Do not call the target hook if it's non-zero + or if the thunk is external or local. Fix formatting. Do not chain + the RESULT_DECL to BLOCK_VARS. Pass the static chain to the target, + if any, in the GIMPLE representation. + * ipa-icf.c (sem_function::equals_wpa): Deal with indirect_offset. + * lto-cgraph.c (lto_output_node): Write indirect_offset field. + (input_node): Read indirect_offset field. + * tree-inline.c (expand_call_inline): Pass indirect_offset field in the + call to thunk_adjust. + * tree-nested.c (struct nesting_info): Add thunk_p field. + (create_nesting_tree): Set it. + (convert_all_function_calls): Copy static chain from targets to thunks. + (finalize_nesting_tree_1): Return early for thunks. + (unnest_nesting_tree_1): Do not finalize thunks. + (gimplify_all_functions): Do not gimplify thunks. + 2018-09-28 David Malcolm * opt-suggestions.c (option_proposer::build_option_suggestions): diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ce20db3..c18c4c8 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,19 @@ +2018-09-28 Eric Botcazou + Pierre-Marie de Rodat + + * gcc-interface/decl.c (is_cplusplus_method): Do not require C++ + convention on Interfaces. + * gcc-interface/trans.c (Subprogram_Body_to_gnu): Try to create a + bona-fide thunk and hand it over to the middle-end. + (get_controlling_type): New function. + (use_alias_for_thunk_p): Likewise. + (thunk_labelno): New static variable. + (make_covariant_thunk): New function. + (maybe_make_gnu_thunk): Likewise. + * gcc-interface/utils.c (finish_subprog_decl): Set DECL_CONTEXT of the + result DECL here instead of... + (end_subprog_body): ...here. + 2018-09-27 Martin Sebor * gcc-interface/utils.c (make_packable_type): Introduce a temporary diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 8dd62f7..4a1845a 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -4851,15 +4851,15 @@ is_cplusplus_method (Entity_Id gnat_entity) if (Convention (gnat_entity) != Convention_CPP) return false; - /* And that the type of the first parameter (indirectly) has it too. */ + /* And that the type of the first parameter (indirectly) has it too, but + we make an exception for Interfaces because they need not be imported. */ Entity_Id gnat_first = First_Formal (gnat_entity); if (No (gnat_first)) return false; - Entity_Id gnat_type = Etype (gnat_first); if (Is_Access_Type (gnat_type)) gnat_type = Directly_Designated_Type (gnat_type); - if (Convention (gnat_type) != Convention_CPP) + if (Convention (gnat_type) != Convention_CPP && !Is_Interface (gnat_type)) return false; /* This is the main case: a C++ virtual method imported as a primitive diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 12f6a87..53513e5 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -247,6 +247,7 @@ static bool set_end_locus_from_node (tree, Node_Id); static int lvalue_required_p (Node_Id, tree, bool, bool); static tree build_raise_check (int, enum exception_info_kind); static tree create_init_temporary (const char *, tree, tree *, Node_Id); +static bool maybe_make_gnu_thunk (Entity_Id gnat_thunk, tree gnu_thunk); /* Hooks for debug info back-ends, only supported and used in a restricted set of configurations. */ @@ -3791,6 +3792,11 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) if (Was_Expression_Function (gnat_node)) DECL_DISREGARD_INLINE_LIMITS (gnu_subprog_decl) = 1; + /* Try to create a bona-fide thunk and hand it over to the middle-end. */ + if (Is_Thunk (gnat_subprog_id) + && maybe_make_gnu_thunk (gnat_subprog_id, gnu_subprog_decl)) + return; + /* Initialize the information structure for the function. */ allocate_struct_function (gnu_subprog_decl, false); gnu_subprog_language = ggc_cleared_alloc (); @@ -10333,6 +10339,242 @@ get_elaboration_procedure (void) return gnu_elab_proc_stack->last (); } +/* Return the controlling type of a dispatching subprogram. */ + +static Entity_Id +get_controlling_type (Entity_Id subprog) +{ + /* This is modelled on Expand_Interface_Thunk. */ + Entity_Id controlling_type = Etype (First_Formal (subprog)); + if (Is_Access_Type (controlling_type)) + controlling_type = Directly_Designated_Type (controlling_type); + controlling_type = Underlying_Type (controlling_type); + if (Is_Concurrent_Type (controlling_type)) + controlling_type = Corresponding_Record_Type (controlling_type); + controlling_type = Base_Type (controlling_type); + return controlling_type; +} + +/* Return whether we should use an alias for the TARGET of a thunk + in order to make the call generated in the thunk local. */ + +static bool +use_alias_for_thunk_p (tree target) +{ + /* We cannot generate a local call in this case. */ + if (DECL_EXTERNAL (target)) + return false; + + /* The call is already local in this case. */ + if (TREE_CODE (DECL_CONTEXT (target)) == FUNCTION_DECL) + return false; + + return TARGET_USE_LOCAL_THUNK_ALIAS_P (target); +} + +static GTY(()) unsigned long thunk_labelno = 0; + +/* Create an alias for TARGET to be used as the target of a thunk. */ + +static tree +make_alias_for_thunk (tree target) +{ + char buf[64]; + targetm.asm_out.generate_internal_label (buf, "LTHUNK", thunk_labelno++); + + tree alias = build_decl (DECL_SOURCE_LOCATION (target), TREE_CODE (target), + get_identifier (buf), TREE_TYPE (target)); + + DECL_LANG_SPECIFIC (alias) = DECL_LANG_SPECIFIC (target); + DECL_CONTEXT (alias) = DECL_CONTEXT (target); + TREE_READONLY (alias) = TREE_READONLY (target); + TREE_THIS_VOLATILE (alias) = TREE_THIS_VOLATILE (target); + DECL_ARTIFICIAL (alias) = 1; + DECL_INITIAL (alias) = error_mark_node; + DECL_ARGUMENTS (alias) = copy_list (DECL_ARGUMENTS (target)); + TREE_ADDRESSABLE (alias) = 1; + SET_DECL_ASSEMBLER_NAME (alias, DECL_NAME (alias)); + + cgraph_node *n = cgraph_node::create_same_body_alias (alias, target); + gcc_assert (n); + + return alias; +} + +/* Create the covariant part of the {GNAT,GNU}_THUNK. */ + +static tree +make_covariant_thunk (Entity_Id gnat_thunk, tree gnu_thunk) +{ + tree gnu_name = create_concat_name (gnat_thunk, "CV"); + tree gnu_cv_thunk + = build_decl (DECL_SOURCE_LOCATION (gnu_thunk), TREE_CODE (gnu_thunk), + gnu_name, TREE_TYPE (gnu_thunk)); + + DECL_ARGUMENTS (gnu_cv_thunk) = copy_list (DECL_ARGUMENTS (gnu_thunk)); + DECL_RESULT (gnu_cv_thunk) = copy_node (DECL_RESULT (gnu_thunk)); + DECL_CONTEXT (DECL_RESULT (gnu_cv_thunk)) = gnu_cv_thunk; + + DECL_LANG_SPECIFIC (gnu_cv_thunk) = DECL_LANG_SPECIFIC (gnu_thunk); + DECL_CONTEXT (gnu_cv_thunk) = DECL_CONTEXT (gnu_thunk); + TREE_READONLY (gnu_cv_thunk) = TREE_READONLY (gnu_thunk); + TREE_THIS_VOLATILE (gnu_cv_thunk) = TREE_THIS_VOLATILE (gnu_thunk); + TREE_PUBLIC (gnu_cv_thunk) = TREE_PUBLIC (gnu_thunk); + DECL_ARTIFICIAL (gnu_cv_thunk) = 1; + + return gnu_cv_thunk; +} + +/* Try to create a GNU thunk for {GNAT,GNU}_THUNK and return true on success. + + GNU thunks are more efficient than GNAT thunks because they don't call into + the runtime to retrieve the offset used in the displacement operation, but + they are tailored to C++ and thus too limited to support the full range of + thunks generated in Ada. Here's the complete list of limitations: + + 1. Multi-controlling thunks, i.e thunks with more than one controlling + parameter, are simply not supported. + + 2. Covariant thunks, i.e. thunks for which the result is also controlling, + are split into a pair of (this, covariant-only) thunks. + + 3. Variable-offset thunks, i.e. thunks for which the offset depends on the + object and not only on its type, are supported as 2nd class citizens. + + 4. External thunks, i.e. thunks for which the target is not declared in + the same unit as the thunk, are supported as 2nd class citizens. + + 5. Local thunks, i.e. thunks generated for a local type, are supported as + 2nd class citizens. */ + +static bool +maybe_make_gnu_thunk (Entity_Id gnat_thunk, tree gnu_thunk) +{ + const Entity_Id gnat_target = Thunk_Entity (gnat_thunk); + + /* Check that the first formal of the target is the only controlling one. */ + Entity_Id gnat_formal = First_Formal (gnat_target); + if (!Is_Controlling_Formal (gnat_formal)) + return false; + for (gnat_formal = Next_Formal (gnat_formal); + Present (gnat_formal); + gnat_formal = Next_Formal (gnat_formal)) + if (Is_Controlling_Formal (gnat_formal)) + return false; + + /* Look for the types that control the target and the thunk. */ + const Entity_Id gnat_controlling_type = get_controlling_type (gnat_target); + const Entity_Id gnat_interface_type = get_controlling_type (gnat_thunk); + + /* Now compute whether the former covers the latter. */ + const Entity_Id gnat_interface_tag + = Is_Interface (gnat_interface_type) + ? Find_Interface_Tag (gnat_controlling_type, gnat_interface_type) + : Empty; + tree gnu_interface_tag + = Present (gnat_interface_tag) + ? gnat_to_gnu_field_decl (gnat_interface_tag) + : NULL_TREE; + tree gnu_interface_offset + = gnu_interface_tag ? byte_position (gnu_interface_tag) : NULL_TREE; + + /* There are three ways to retrieve the offset between the interface view + and the base object. Either the controlling type covers the interface + type and the offset of the corresponding tag is fixed, in which case it + can be statically encoded in the thunk (see FIXED_OFFSET below). Or the + controlling type doesn't cover the interface type but is of fixed size, + in which case the offset is stored in the dispatch table, two pointers + above the dispatch table address (see VIRTUAL_VALUE below). Otherwise, + the offset is variable and is stored right after the tag in every object + (see INDIRECT_OFFSET below). See also a-tags.ads for more details. */ + HOST_WIDE_INT fixed_offset, virtual_value, indirect_offset; + tree virtual_offset; + + if (gnu_interface_offset && TREE_CODE (gnu_interface_offset) == INTEGER_CST) + { + fixed_offset = - tree_to_shwi (gnu_interface_offset); + virtual_value = 0; + virtual_offset = NULL_TREE; + indirect_offset = 0; + } + else if (!gnu_interface_offset + && !Is_Variable_Size_Record (gnat_controlling_type)) + { + fixed_offset = 0; + virtual_value = - 2 * (HOST_WIDE_INT) (POINTER_SIZE / BITS_PER_UNIT); + virtual_offset = build_int_cst (integer_type_node, virtual_value); + indirect_offset = 0; + } + else + { + /* Covariant thunks with variable offset are not supported. */ + if (Has_Controlling_Result (gnat_target)) + return false; + + fixed_offset = 0; + virtual_value = 0; + virtual_offset = NULL_TREE; + indirect_offset = (HOST_WIDE_INT) (POINTER_SIZE / BITS_PER_UNIT); + } + + tree gnu_target = gnat_to_gnu_entity (gnat_target, NULL_TREE, false); + + /* Thunk and target must have the same nesting level, if any. */ + gcc_assert (DECL_CONTEXT (gnu_thunk) == DECL_CONTEXT (gnu_target)); + + /* If the target returns by invisible reference and is external, apply the + same transformation as Subprogram_Body_to_gnu here. */ + if (TREE_ADDRESSABLE (TREE_TYPE (gnu_target)) + && DECL_EXTERNAL (gnu_target) + && !POINTER_TYPE_P (TREE_TYPE (DECL_RESULT (gnu_target)))) + { + TREE_TYPE (DECL_RESULT (gnu_target)) + = build_reference_type (TREE_TYPE (DECL_RESULT (gnu_target))); + relayout_decl (DECL_RESULT (gnu_target)); + } + + /* The thunk expander requires the return types of thunk and target to be + compatible, which is not fully the case with the CICO mechanism. */ + if (TYPE_CI_CO_LIST (TREE_TYPE (gnu_thunk))) + { + tree gnu_target_type = TREE_TYPE (gnu_target); + gcc_assert (TYPE_CI_CO_LIST (gnu_target_type)); + TYPE_CANONICAL (TREE_TYPE (TREE_TYPE (gnu_thunk))) + = TYPE_CANONICAL (TREE_TYPE (gnu_target_type)); + } + + cgraph_node *target_node = cgraph_node::get_create (gnu_target); + + /* If the return type of the target is a controlling type, then we need + both an usual this thunk and a covariant thunk in this order: + + this thunk --> covariant thunk --> target + + For covariant thunks, we can only handle a fixed offset. */ + if (Has_Controlling_Result (gnat_target)) + { + gcc_assert (fixed_offset < 0); + tree gnu_cv_thunk = make_covariant_thunk (gnat_thunk, gnu_thunk); + target_node->create_thunk (gnu_cv_thunk, gnu_target, false, + - fixed_offset, 0, 0, + NULL_TREE, gnu_target); + + gnu_target = gnu_cv_thunk; + } + + /* We may also need to create an alias for the target in order to make + the call local, depending on the linkage of the target. */ + tree gnu_alias = use_alias_for_thunk_p (gnu_target) + ? make_alias_for_thunk (gnu_target) + : gnu_target; + + target_node->create_thunk (gnu_thunk, gnu_target, true, + fixed_offset, virtual_value, indirect_offset, + virtual_offset, gnu_alias); + + return true; +} + /* Initialize the table that maps GNAT codes to GCC codes for simple binary and unary operations. */ diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 9530165..1ce2f72 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -3294,6 +3294,7 @@ finish_subprog_decl (tree decl, tree asm_name, tree type) DECL_ARTIFICIAL (result_decl) = 1; DECL_IGNORED_P (result_decl) = 1; + DECL_CONTEXT (result_decl) = decl; DECL_BY_REFERENCE (result_decl) = TREE_ADDRESSABLE (type); DECL_RESULT (decl) = result_decl; @@ -3369,9 +3370,6 @@ end_subprog_body (tree body) DECL_INITIAL (fndecl) = current_binding_level->block; gnat_poplevel (); - /* Mark the RESULT_DECL as being in this subprogram. */ - DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl; - /* The body should be a BIND_EXPR whose BLOCK is the top-level one. */ if (TREE_CODE (body) == BIND_EXPR) { diff --git a/gcc/calls.c b/gcc/calls.c index e9660b6..80af5c3 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -3610,9 +3610,8 @@ expand_call (tree exp, rtx target, int ignore) pushed these optimizations into -O2. Don't try if we're already expanding a call, as that means we're an argument. Don't try if there's cleanups, as we know there's code to follow the call. */ - if (currently_expanding_call++ != 0 - || !flag_optimize_sibling_calls + || (!flag_optimize_sibling_calls && !CALL_FROM_THUNK_P (exp)) || args_size.var || dbg_cnt (tail_call) == false) try_tail_call = 0; diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 148f29e..8a03f3d 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -617,6 +617,7 @@ cgraph_node * cgraph_node::create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, + HOST_WIDE_INT indirect_offset, tree virtual_offset, tree real_alias) { @@ -635,6 +636,7 @@ cgraph_node::create_thunk (tree alias, tree, bool this_adjusting, node->thunk.fixed_offset = fixed_offset; node->thunk.virtual_value = virtual_value; + node->thunk.indirect_offset = indirect_offset; node->thunk.alias = real_alias; node->thunk.this_adjusting = this_adjusting; node->thunk.virtual_offset_p = virtual_offset != NULL; @@ -2099,10 +2101,11 @@ cgraph_node::dump (FILE *f) fprintf (f, " of %s (asm: %s)", lang_hooks.decl_printable_name (thunk.alias, 2), IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk.alias))); - fprintf (f, " fixed offset %i virtual value %i has " - "virtual offset %i)\n", + fprintf (f, " fixed offset %i virtual value %i indirect_offset %i " + "has virtual offset %i\n", (int)thunk.fixed_offset, (int)thunk.virtual_value, + (int)thunk.indirect_offset, (int)thunk.virtual_offset_p); } if (alias && thunk.alias diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 2b00f01..71c5453 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -666,6 +666,10 @@ struct GTY(()) cgraph_thunk_info { VIRTUAL_OFFSET_P is true. */ HOST_WIDE_INT virtual_value; + /* Offset from "this" to get the offset to adjust "this". Zero means: this + offset is to be ignored. */ + HOST_WIDE_INT indirect_offset; + /* Thunk target, i.e. the method that this thunk wraps. Depending on the TARGET_USE_LOCAL_THUNK_ALIAS_P macro, this may have to be a new alias. */ tree alias; @@ -1033,6 +1037,7 @@ public: cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, + HOST_WIDE_INT indirect_offset, tree virtual_offset, tree real_alias); @@ -2373,7 +2378,8 @@ void cgraphunit_c_finalize (void); IN_SSA is true if the gimple is in SSA. */ basic_block init_lowered_empty_function (tree, bool, profile_count); -tree thunk_adjust (gimple_stmt_iterator *, tree, bool, HOST_WIDE_INT, tree); +tree thunk_adjust (gimple_stmt_iterator *, tree, bool, HOST_WIDE_INT, tree, + HOST_WIDE_INT); /* In cgraphclones.c */ tree clone_function_name_1 (const char *, const char *); diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c index 0c0a94b..2af45bd 100644 --- a/gcc/cgraphclones.c +++ b/gcc/cgraphclones.c @@ -274,10 +274,11 @@ duplicate_thunk_for_node (cgraph_node *thunk, cgraph_node *node) cgraph_edge *cs; for (cs = node->callers; cs; cs = cs->next_caller) if (cs->caller->thunk.thunk_p - && cs->caller->thunk.this_adjusting == thunk->thunk.this_adjusting && cs->caller->thunk.fixed_offset == thunk->thunk.fixed_offset - && cs->caller->thunk.virtual_offset_p == thunk->thunk.virtual_offset_p - && cs->caller->thunk.virtual_value == thunk->thunk.virtual_value) + && cs->caller->thunk.virtual_value == thunk->thunk.virtual_value + && cs->caller->thunk.indirect_offset == thunk->thunk.indirect_offset + && cs->caller->thunk.this_adjusting == thunk->thunk.this_adjusting + && cs->caller->thunk.virtual_offset_p == thunk->thunk.virtual_offset_p) return cs->caller; tree new_decl; diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index ec490d7..c0baaea 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -623,20 +623,18 @@ cgraph_node::analyze (void) callees->can_throw_external = !TREE_NOTHROW (t->decl); /* Target code in expand_thunk may need the thunk's target to be analyzed, so recurse here. */ - if (!t->analyzed) + if (!t->analyzed && t->definition) t->analyze (); if (t->alias) { t = t->get_alias_target (); - if (!t->analyzed) + if (!t->analyzed && t->definition) t->analyze (); } - if (!expand_thunk (false, false)) - { - thunk.alias = NULL; - return; - } + bool ret = expand_thunk (false, false); thunk.alias = NULL; + if (!ret) + return; } if (alias) resolve_alias (cgraph_node::get (alias_target), transparent_alias); @@ -1609,15 +1607,16 @@ init_lowered_empty_function (tree decl, bool in_ssa, profile_count count) return bb; } -/* Adjust PTR by the constant FIXED_OFFSET, and by the vtable - offset indicated by VIRTUAL_OFFSET, if that is - non-null. THIS_ADJUSTING is nonzero for a this adjusting thunk and - zero for a result adjusting thunk. */ +/* Adjust PTR by the constant FIXED_OFFSET, by the vtable offset indicated by + VIRTUAL_OFFSET, and by the indirect offset indicated by INDIRECT_OFFSET, if + it is non-null. THIS_ADJUSTING is nonzero for a this adjusting thunk and zero + for a result adjusting thunk. */ tree thunk_adjust (gimple_stmt_iterator * bsi, tree ptr, bool this_adjusting, - HOST_WIDE_INT fixed_offset, tree virtual_offset) + HOST_WIDE_INT fixed_offset, tree virtual_offset, + HOST_WIDE_INT indirect_offset) { gassign *stmt; tree ret; @@ -1632,6 +1631,16 @@ thunk_adjust (gimple_stmt_iterator * bsi, gsi_insert_after (bsi, stmt, GSI_NEW_STMT); } + if (!vtable_entry_type && (virtual_offset || indirect_offset != 0)) + { + tree vfunc_type = make_node (FUNCTION_TYPE); + TREE_TYPE (vfunc_type) = integer_type_node; + TYPE_ARG_TYPES (vfunc_type) = NULL_TREE; + layout_type (vfunc_type); + + vtable_entry_type = build_pointer_type (vfunc_type); + } + /* If there's a virtual offset, look up that value in the vtable and adjust the pointer again. */ if (virtual_offset) @@ -1640,16 +1649,6 @@ thunk_adjust (gimple_stmt_iterator * bsi, tree vtabletmp2; tree vtabletmp3; - if (!vtable_entry_type) - { - tree vfunc_type = make_node (FUNCTION_TYPE); - TREE_TYPE (vfunc_type) = integer_type_node; - TYPE_ARG_TYPES (vfunc_type) = NULL_TREE; - layout_type (vfunc_type); - - vtable_entry_type = build_pointer_type (vfunc_type); - } - vtabletmp = create_tmp_reg (build_pointer_type (build_pointer_type (vtable_entry_type)), "vptr"); @@ -1687,6 +1686,41 @@ thunk_adjust (gimple_stmt_iterator * bsi, GSI_CONTINUE_LINKING); } + /* Likewise for an offset that is stored in the object that contains the + vtable. */ + if (indirect_offset != 0) + { + tree offset_ptr, offset_tree; + + /* Get the address of the offset. */ + offset_ptr + = create_tmp_reg (build_pointer_type + (build_pointer_type (vtable_entry_type)), + "offset_ptr"); + stmt = gimple_build_assign (offset_ptr, + build1 (NOP_EXPR, TREE_TYPE (offset_ptr), + ptr)); + gsi_insert_after (bsi, stmt, GSI_NEW_STMT); + + stmt = gimple_build_assign + (offset_ptr, + fold_build_pointer_plus_hwi_loc (input_location, offset_ptr, + indirect_offset)); + gsi_insert_after (bsi, stmt, GSI_NEW_STMT); + + /* Get the offset itself. */ + offset_tree = create_tmp_reg (TREE_TYPE (TREE_TYPE (offset_ptr)), + "offset"); + stmt = gimple_build_assign (offset_tree, + build_simple_mem_ref (offset_ptr)); + gsi_insert_after (bsi, stmt, GSI_NEW_STMT); + + /* Adjust the `this' pointer. */ + ptr = fold_build_pointer_plus_loc (input_location, ptr, offset_tree); + ptr = force_gimple_operand_gsi (bsi, ptr, true, NULL_TREE, false, + GSI_CONTINUE_LINKING); + } + if (!this_adjusting && fixed_offset != 0) /* Adjust the pointer by the constant. */ @@ -1725,6 +1759,7 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) bool this_adjusting = thunk.this_adjusting; HOST_WIDE_INT fixed_offset = thunk.fixed_offset; HOST_WIDE_INT virtual_value = thunk.virtual_value; + HOST_WIDE_INT indirect_offset = thunk.indirect_offset; tree virtual_offset = NULL; tree alias = callees->callee->decl; tree thunk_fndecl = decl; @@ -1735,7 +1770,11 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) if (thunk.add_pointer_bounds_args) return false; - if (!force_gimple_thunk && this_adjusting + if (!force_gimple_thunk + && this_adjusting + && indirect_offset == 0 + && !DECL_EXTERNAL (alias) + && !DECL_STATIC_CHAIN (alias) && targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset, virtual_value, alias)) { @@ -1838,8 +1877,8 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) resdecl = build_decl (input_location, RESULT_DECL, 0, restype); DECL_ARTIFICIAL (resdecl) = 1; DECL_IGNORED_P (resdecl) = 1; + DECL_CONTEXT (resdecl) = thunk_fndecl; DECL_RESULT (thunk_fndecl) = resdecl; - DECL_CONTEXT (DECL_RESULT (thunk_fndecl)) = thunk_fndecl; } else resdecl = DECL_RESULT (thunk_fndecl); @@ -1876,8 +1915,11 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) restmp = resdecl; if (VAR_P (restmp)) - add_local_decl (cfun, restmp); - BLOCK_VARS (DECL_INITIAL (current_function_decl)) = restmp; + { + add_local_decl (cfun, restmp); + BLOCK_VARS (DECL_INITIAL (current_function_decl)) + = restmp; + } } else restmp = create_tmp_var (restype, "retval"); @@ -1894,7 +1936,7 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) if (this_adjusting) { vargs.quick_push (thunk_adjust (&bsi, a, 1, fixed_offset, - virtual_offset)); + virtual_offset, indirect_offset)); arg = DECL_CHAIN (a); i = 1; } @@ -1919,6 +1961,25 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs); callees->call_stmt = call; gimple_call_set_from_thunk (call, true); + if (DECL_STATIC_CHAIN (alias)) + { + tree p = DECL_STRUCT_FUNCTION (alias)->static_chain_decl; + tree type = TREE_TYPE (p); + tree decl = build_decl (DECL_SOURCE_LOCATION (thunk_fndecl), + PARM_DECL, create_tmp_var_name ("CHAIN"), + type); + DECL_ARTIFICIAL (decl) = 1; + DECL_IGNORED_P (decl) = 1; + TREE_USED (decl) = 1; + DECL_CONTEXT (decl) = thunk_fndecl; + DECL_ARG_TYPE (decl) = type; + TREE_READONLY (decl) = 1; + + struct function *sf = DECL_STRUCT_FUNCTION (thunk_fndecl); + sf->static_chain_decl = decl; + + gimple_call_set_chain (call, decl); + } /* Return slot optimization is always possible and in fact requred to return values with DECL_BY_REFERENCE. */ @@ -1979,7 +2040,8 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) } restmp = thunk_adjust (&bsi, restmp, /*this_adjusting=*/0, - fixed_offset, virtual_offset); + fixed_offset, virtual_offset, + indirect_offset); if (true_label) { gimple *stmt; diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f5d602d..e10ada2d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-09-28 Eric Botcazou + Pierre-Marie de Rodat + + * method.c (use_thunk): Adjust call to cgraph_node::create_thunk. + 2018-09-28 Richard Biener * error.c (cp_print_error_function): Simplify by eliding diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 5379b4d..2de2d10 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -375,7 +375,7 @@ use_thunk (tree thunk_fndecl, bool emit_p) gcc_checking_assert (funcn); thunk_node = funcn->create_thunk (thunk_fndecl, function, this_adjusting, fixed_offset, virtual_value, - virtual_offset, alias); + 0, virtual_offset, alias); if (DECL_ONE_ONLY (function)) thunk_node->add_to_same_comdat_group (funcn); diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 8a6a7a3f..3c54f8d 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -593,6 +593,8 @@ sem_function::equals_wpa (sem_item *item, return return_false_with_msg ("thunk fixed_offset mismatch"); if (cnode->thunk.virtual_value != cnode2->thunk.virtual_value) return return_false_with_msg ("thunk virtual_value mismatch"); + if (cnode->thunk.indirect_offset != cnode2->thunk.indirect_offset) + return return_false_with_msg ("thunk indirect_offset mismatch"); if (cnode->thunk.this_adjusting != cnode2->thunk.this_adjusting) return return_false_with_msg ("thunk this_adjusting mismatch"); if (cnode->thunk.virtual_offset_p != cnode2->thunk.virtual_offset_p) diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index 6d9eea1..99998cc 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -556,6 +556,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, + (node->thunk.add_pointer_bounds_args != 0) * 8); streamer_write_uhwi_stream (ob->main_stream, node->thunk.fixed_offset); streamer_write_uhwi_stream (ob->main_stream, node->thunk.virtual_value); + streamer_write_uhwi_stream (ob->main_stream, node->thunk.indirect_offset); } streamer_write_hwi_stream (ob->main_stream, node->profile_id); if (DECL_STATIC_CONSTRUCTOR (node->decl)) @@ -1271,10 +1272,12 @@ input_node (struct lto_file_decl_data *file_data, int type = streamer_read_uhwi (ib); HOST_WIDE_INT fixed_offset = streamer_read_uhwi (ib); HOST_WIDE_INT virtual_value = streamer_read_uhwi (ib); + HOST_WIDE_INT indirect_offset = streamer_read_uhwi (ib); node->thunk.fixed_offset = fixed_offset; - node->thunk.this_adjusting = (type & 2); node->thunk.virtual_value = virtual_value; + node->thunk.indirect_offset = indirect_offset; + node->thunk.this_adjusting = (type & 2); node->thunk.virtual_offset_p = (type & 4); node->thunk.add_pointer_bounds_args = (type & 8); } diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 42c33d2..2eac7b7 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4473,7 +4473,7 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id) GSI_NEW_STMT); gcc_assert (id->src_node->thunk.this_adjusting); op = thunk_adjust (&iter, op, 1, id->src_node->thunk.fixed_offset, - virtual_offset); + virtual_offset, id->src_node->thunk.indirect_offset); gimple_call_set_arg (stmt, 0, op); gimple_call_set_fndecl (stmt, edge->callee->decl); diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c index 4c8eda9..4579b4c 100644 --- a/gcc/tree-nested.c +++ b/gcc/tree-nested.c @@ -104,6 +104,7 @@ struct nesting_info tree chain_decl; tree nl_goto_field; + bool thunk_p; bool any_parm_remapped; bool any_tramp_created; bool any_descr_created; @@ -834,6 +835,7 @@ create_nesting_tree (struct cgraph_node *cgn) info->mem_refs = new hash_set; info->suppress_expansion = BITMAP_ALLOC (&nesting_info_bitmap_obstack); info->context = cgn->decl; + info->thunk_p = cgn->thunk.thunk_p; for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested) { @@ -2786,6 +2788,8 @@ convert_all_function_calls (struct nesting_info *root) within the debugger. */ FOR_EACH_NEST_INFO (n, root) { + if (n->thunk_p) + continue; tree decl = n->context; if (!optimize) { @@ -2806,6 +2810,14 @@ convert_all_function_calls (struct nesting_info *root) chain_count += DECL_STATIC_CHAIN (decl); } + FOR_EACH_NEST_INFO (n, root) + if (n->thunk_p) + { + tree decl = n->context; + tree alias = cgraph_node::get (decl)->thunk.alias; + DECL_STATIC_CHAIN (decl) = DECL_STATIC_CHAIN (alias); + } + /* Walk the functions and perform transformations. Note that these transformations can induce new uses of the static chain, which in turn require re-examining all users of the decl. */ @@ -2825,12 +2837,22 @@ convert_all_function_calls (struct nesting_info *root) FOR_EACH_NEST_INFO (n, root) { + if (n->thunk_p) + continue; tree decl = n->context; walk_function (convert_tramp_reference_stmt, convert_tramp_reference_op, n); walk_function (convert_gimple_call, NULL, n); chain_count += DECL_STATIC_CHAIN (decl); } + + FOR_EACH_NEST_INFO (n, root) + if (n->thunk_p) + { + tree decl = n->context; + tree alias = cgraph_node::get (decl)->thunk.alias; + DECL_STATIC_CHAIN (decl) = DECL_STATIC_CHAIN (alias); + } } while (chain_count != old_chain_count); @@ -3055,12 +3077,13 @@ build_init_call_stmt (struct nesting_info *info, tree decl, tree field, static void finalize_nesting_tree_1 (struct nesting_info *root) { - gimple_seq stmt_list; + gimple_seq stmt_list = NULL; gimple *stmt; tree context = root->context; struct function *sf; - stmt_list = NULL; + if (root->thunk_p) + return; /* If we created a non-local frame type or decl, we need to lay them out at this time. */ @@ -3340,7 +3363,8 @@ unnest_nesting_tree_1 (struct nesting_info *root) if (node->origin) { node->unnest (); - cgraph_node::finalize_function (root->context, true); + if (!root->thunk_p) + cgraph_node::finalize_function (root->context, true); } } @@ -3380,7 +3404,8 @@ gimplify_all_functions (struct cgraph_node *root) if (!gimple_body (root->decl)) gimplify_function_tree (root->decl); for (iter = root->nested; iter; iter = iter->next_nested) - gimplify_all_functions (iter); + if (!iter->thunk.thunk_p) + gimplify_all_functions (iter); } /* Main entry point for this pass. Process FNDECL and all of its nested -- cgit v1.1 From 2660fecc0c6cd1a0d4c67b6a50abb063f6a4b8d8 Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Fri, 28 Sep 2018 23:50:34 +0200 Subject: rs6000: Delete HAVE_AS_LWSYNC and TARGET_LWSYNC_INSTRUCTION All supported assemblers know lwsync, so we never need to generate this instruction using the .long escape hatch. * config.in (HAVE_AS_LWSYNC): Delete. * config/powerpcspe/powerpcspe.h (TARGET_LWSYNC_INSTRUCTION): Delete. * config/powerpcspe/sync.md (*lwsync): Always generate lwsync, never do it as a .long . * config/rs6000/rs6000.h (TARGET_LWSYNC_INSTRUCTION): Delete. * config/rs6000/sync.md (*lwsync): Always generate lwsync, never do it as a .long . * configure.ac: Delete HAVE_AS_LWSYNC. * configure: Regenerate. From-SVN: r264702 --- gcc/ChangeLog | 12 +++++++++++ gcc/config.in | 6 ------ gcc/config/powerpcspe/powerpcspe.h | 8 ------- gcc/config/powerpcspe/sync.md | 5 +---- gcc/config/rs6000/rs6000.h | 8 ------- gcc/config/rs6000/sync.md | 5 +---- gcc/configure | 43 -------------------------------------- gcc/configure.ac | 13 ------------ 8 files changed, 14 insertions(+), 86 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 96baa7d..cf52864 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2018-09-28 Segher Boessenkool + + * config.in (HAVE_AS_LWSYNC): Delete. + * config/powerpcspe/powerpcspe.h (TARGET_LWSYNC_INSTRUCTION): Delete. + * config/powerpcspe/sync.md (*lwsync): Always generate lwsync, never + do it as a .long . + * config/rs6000/rs6000.h (TARGET_LWSYNC_INSTRUCTION): Delete. + * config/rs6000/sync.md (*lwsync): Always generate lwsync, never do it + as a .long . + * configure.ac: Delete HAVE_AS_LWSYNC. + * configure: Regenerate. + 2018-09-28 Eric Botcazou Pierre-Marie de Rodat diff --git a/gcc/config.in b/gcc/config.in index 48dfd23..1242326 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -528,12 +528,6 @@ #endif -/* Define if your assembler supports LWSYNC instructions. */ -#ifndef USED_FOR_TARGET -#undef HAVE_AS_LWSYNC -#endif - - /* Define if your assembler supports the -mabi option. */ #ifndef USED_FOR_TARGET #undef HAVE_AS_MABI_OPTION diff --git a/gcc/config/powerpcspe/powerpcspe.h b/gcc/config/powerpcspe/powerpcspe.h index a30fe34..2bb32c7 100644 --- a/gcc/config/powerpcspe/powerpcspe.h +++ b/gcc/config/powerpcspe/powerpcspe.h @@ -216,14 +216,6 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define TARGET_MFCRF 0 #endif -/* Define TARGET_LWSYNC_INSTRUCTION if the assembler knows about lwsync. If - not, generate the lwsync code as an integer constant. */ -#ifdef HAVE_AS_LWSYNC -#define TARGET_LWSYNC_INSTRUCTION 1 -#else -#define TARGET_LWSYNC_INSTRUCTION 0 -#endif - /* Define TARGET_TLS_MARKERS if the target assembler does not support arg markers for __tls_get_addr calls. */ #ifndef HAVE_AS_TLS_MARKERS diff --git a/gcc/config/powerpcspe/sync.md b/gcc/config/powerpcspe/sync.md index f4f7bc2..dff3932 100644 --- a/gcc/config/powerpcspe/sync.md +++ b/gcc/config/powerpcspe/sync.md @@ -91,13 +91,10 @@ (unspec:BLK [(match_dup 0)] UNSPEC_LWSYNC))] "" { - /* Some AIX assemblers don't accept lwsync, so we use a .long. */ if (TARGET_NO_LWSYNC) return "sync"; - else if (TARGET_LWSYNC_INSTRUCTION) - return "lwsync"; else - return ".long 0x7c2004ac"; + return "lwsync"; } [(set_attr "type" "sync")]) diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 232d442..d2fe795 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -219,14 +219,6 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define TARGET_MFCRF 0 #endif -/* Define TARGET_LWSYNC_INSTRUCTION if the assembler knows about lwsync. If - not, generate the lwsync code as an integer constant. */ -#ifdef HAVE_AS_LWSYNC -#define TARGET_LWSYNC_INSTRUCTION 1 -#else -#define TARGET_LWSYNC_INSTRUCTION 0 -#endif - /* Define TARGET_TLS_MARKERS if the target assembler does not support arg markers for __tls_get_addr calls. */ #ifndef HAVE_AS_TLS_MARKERS diff --git a/gcc/config/rs6000/sync.md b/gcc/config/rs6000/sync.md index ee98049..f18b6b7 100644 --- a/gcc/config/rs6000/sync.md +++ b/gcc/config/rs6000/sync.md @@ -91,13 +91,10 @@ (unspec:BLK [(match_dup 0)] UNSPEC_LWSYNC))] "" { - /* Some AIX assemblers don't accept lwsync, so we use a .long. */ if (TARGET_NO_LWSYNC) return "sync"; - else if (TARGET_LWSYNC_INSTRUCTION) - return "lwsync"; else - return ".long 0x7c2004ac"; + return "lwsync"; } [(set_attr "type" "sync")]) diff --git a/gcc/configure b/gcc/configure index f2d5a6f..5d2fd18 100755 --- a/gcc/configure +++ b/gcc/configure @@ -26723,49 +26723,6 @@ fi case $target in - *-*-aix*) conftest_s=' .csect .text[PR] - lwsync';; - *) conftest_s=' .text - lwsync';; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for lwsync support" >&5 -$as_echo_n "checking assembler for lwsync support... " >&6; } -if test "${gcc_cv_as_powerpc_lwsync+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - gcc_cv_as_powerpc_lwsync=no - if test $in_tree_gas = yes; then - if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2` - then gcc_cv_as_powerpc_lwsync=yes -fi - elif test x$gcc_cv_as != x; then - $as_echo "$conftest_s" > conftest.s - if { ac_try='$gcc_cv_as $gcc_cv_as_flags -a32 -o conftest.o conftest.s >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } - then - gcc_cv_as_powerpc_lwsync=yes - else - echo "configure: failed program was" >&5 - cat conftest.s >&5 - fi - rm -f conftest.o conftest.s - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_powerpc_lwsync" >&5 -$as_echo "$gcc_cv_as_powerpc_lwsync" >&6; } -if test $gcc_cv_as_powerpc_lwsync = yes; then - -$as_echo "#define HAVE_AS_LWSYNC 1" >>confdefs.h - -fi - - - case $target in *-*-aix*) conftest_s=' .machine "476" .csect .text[PR] dci 0';; diff --git a/gcc/configure.ac b/gcc/configure.ac index 470fde6..3c1e0ad 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -4558,19 +4558,6 @@ LCF0: [Define if your assembler supports VSX instructions.])]) case $target in - *-*-aix*) conftest_s=' .csect .text[[PR]] - lwsync';; - *) conftest_s=' .text - lwsync';; - esac - - gcc_GAS_CHECK_FEATURE([lwsync support], - gcc_cv_as_powerpc_lwsync, [2,19,2], -a32, - [$conftest_s],, - [AC_DEFINE(HAVE_AS_LWSYNC, 1, - [Define if your assembler supports LWSYNC instructions.])]) - - case $target in *-*-aix*) conftest_s=' .machine "476" .csect .text[[PR]] dci 0';; -- cgit v1.1 From f0ca30bf140486165af102ba9823f99b8eb0e558 Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Sat, 29 Sep 2018 00:02:17 +0200 Subject: rs6000: Delete HAVE_AS_DCI Every supported assembler supports these instructions. Committing. * config.in: Delete HAVE_AS_DCI. * config/powerpcspe/powerpcspe.h: Treat HAVE_AS_DCI as always true. * config/rs6000/rs6000.h: Ditto. * configure.ac: Delete HAVE_AS_DCI. * configure: Regenerate. From-SVN: r264703 --- gcc/ChangeLog | 8 +++++++ gcc/config.in | 6 ----- gcc/config/powerpcspe/powerpcspe.h | 4 ---- gcc/config/rs6000/rs6000.h | 4 ---- gcc/configure | 45 -------------------------------------- gcc/configure.ac | 15 ------------- 6 files changed, 8 insertions(+), 74 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cf52864..dd52021 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2018-09-28 Segher Boessenkool + * config.in: Delete HAVE_AS_DCI. + * config/powerpcspe/powerpcspe.h: Treat HAVE_AS_DCI as always true. + * config/rs6000/rs6000.h: Ditto. + * configure.ac: Delete HAVE_AS_DCI. + * configure: Regenerate. + +2018-09-28 Segher Boessenkool + * config.in (HAVE_AS_LWSYNC): Delete. * config/powerpcspe/powerpcspe.h (TARGET_LWSYNC_INSTRUCTION): Delete. * config/powerpcspe/sync.md (*lwsync): Always generate lwsync, never diff --git a/gcc/config.in b/gcc/config.in index 1242326..4db8aa1 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -309,12 +309,6 @@ #endif -/* Define if your assembler supports the DCI/ICI instructions. */ -#ifndef USED_FOR_TARGET -#undef HAVE_AS_DCI -#endif - - /* Define if your assembler supports the --debug-prefix-map option. */ #ifndef USED_FOR_TARGET #undef HAVE_AS_DEBUG_PREFIX_MAP diff --git a/gcc/config/powerpcspe/powerpcspe.h b/gcc/config/powerpcspe/powerpcspe.h index 2bb32c7..df0676a 100644 --- a/gcc/config/powerpcspe/powerpcspe.h +++ b/gcc/config/powerpcspe/powerpcspe.h @@ -77,11 +77,7 @@ #define ASM_CPU_POWER8_SPEC "-mpower8" #define ASM_CPU_POWER9_SPEC "-mpower9" -#ifdef HAVE_AS_DCI #define ASM_CPU_476_SPEC "-m476" -#else -#define ASM_CPU_476_SPEC "-mpower4" -#endif /* Common ASM definitions used by ASM_SPEC among the various targets for handling -mcpu=xxx switches. There is a parallel list in driver-powerpcspe.c to diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index d2fe795..855de7c 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -78,11 +78,7 @@ #define ASM_CPU_POWER8_SPEC "-mpower8" #define ASM_CPU_POWER9_SPEC "-mpower9" -#ifdef HAVE_AS_DCI #define ASM_CPU_476_SPEC "-m476" -#else -#define ASM_CPU_476_SPEC "-mpower4" -#endif /* Common ASM definitions used by ASM_SPEC among the various targets for handling -mcpu=xxx switches. There is a parallel list in driver-rs6000.c to diff --git a/gcc/configure b/gcc/configure index 5d2fd18..9fb0eb5 100755 --- a/gcc/configure +++ b/gcc/configure @@ -26722,51 +26722,6 @@ $as_echo "#define HAVE_AS_VSX 1" >>confdefs.h fi - case $target in - *-*-aix*) conftest_s=' .machine "476" - .csect .text[PR] - dci 0';; - *) conftest_s=' .machine "476" - .text - dci 0';; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for data cache invalidate support" >&5 -$as_echo_n "checking assembler for data cache invalidate support... " >&6; } -if test "${gcc_cv_as_powerpc_dci+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - gcc_cv_as_powerpc_dci=no - if test $in_tree_gas = yes; then - if test $gcc_cv_gas_vers -ge `expr \( \( 9 \* 1000 \) + 99 \) \* 1000 + 0` - then gcc_cv_as_powerpc_dci=yes -fi - elif test x$gcc_cv_as != x; then - $as_echo "$conftest_s" > conftest.s - if { ac_try='$gcc_cv_as $gcc_cv_as_flags -a32 -o conftest.o conftest.s >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } - then - gcc_cv_as_powerpc_dci=yes - else - echo "configure: failed program was" >&5 - cat conftest.s >&5 - fi - rm -f conftest.o conftest.s - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_powerpc_dci" >&5 -$as_echo "$gcc_cv_as_powerpc_dci" >&6; } -if test $gcc_cv_as_powerpc_dci = yes; then - -$as_echo "#define HAVE_AS_DCI 1" >>confdefs.h - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .gnu_attribute support" >&5 $as_echo_n "checking assembler for .gnu_attribute support... " >&6; } if test "${gcc_cv_as_powerpc_gnu_attribute+set}" = set; then : diff --git a/gcc/configure.ac b/gcc/configure.ac index 3c1e0ad..ca51cdf 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -4557,21 +4557,6 @@ LCF0: [AC_DEFINE(HAVE_AS_VSX, 1, [Define if your assembler supports VSX instructions.])]) - case $target in - *-*-aix*) conftest_s=' .machine "476" - .csect .text[[PR]] - dci 0';; - *) conftest_s=' .machine "476" - .text - dci 0';; - esac - - gcc_GAS_CHECK_FEATURE([data cache invalidate support], - gcc_cv_as_powerpc_dci, [9,99,0], -a32, - [$conftest_s],, - [AC_DEFINE(HAVE_AS_DCI, 1, - [Define if your assembler supports the DCI/ICI instructions.])]) - gcc_GAS_CHECK_FEATURE([.gnu_attribute support], gcc_cv_as_powerpc_gnu_attribute, [2,18,0],, [.gnu_attribute 4,1],, -- cgit v1.1 From 68cf2892dff86ff9b39436932d6c1484a120347f Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Sat, 29 Sep 2018 00:30:45 +0200 Subject: rs5000: Delete all specific asm_cpu_* and ASM_CPU_*_SPEC Now that e.g. ASM_CPU_POWER5_SPEC is always "-mpower5" it is clearer and easier to just write that directly. * config/rs6000/driver-rs6000.c (asm_names): Adjust the entries for power5 .. power9 to remove indirection. * config/rs6000/rs6000.h (ASM_CPU_POWER5_SPEC, ASM_CPU_POWER6_SPEC, ASM_CPU_POWER7_SPEC, ASM_CPU_POWER8_SPEC, ASM_CPU_POWER9_SPEC, ASM_CPU_476_SPEC): Delete. (ASM_CPU_SPEC): Adjust. (EXTRA_SPECS): Delete asm_cpu_power5, asm_cpu_power6, asm_cpu_power7, asm_cpu_power8, asm_cpu_power9, asm_cpu_476. From-SVN: r264704 --- gcc/ChangeLog | 11 +++++++++++ gcc/config/rs6000/driver-rs6000.c | 14 +++++++------- gcc/config/rs6000/rs6000.h | 40 +++++++++++++-------------------------- 3 files changed, 31 insertions(+), 34 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dd52021..0f703f5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,16 @@ 2018-09-28 Segher Boessenkool + * config/rs6000/driver-rs6000.c (asm_names): Adjust the entries for + power5 .. power9 to remove indirection. + * config/rs6000/rs6000.h (ASM_CPU_POWER5_SPEC, ASM_CPU_POWER6_SPEC, + ASM_CPU_POWER7_SPEC, ASM_CPU_POWER8_SPEC, ASM_CPU_POWER9_SPEC, + ASM_CPU_476_SPEC): Delete. + (ASM_CPU_SPEC): Adjust. + (EXTRA_SPECS): Delete asm_cpu_power5, asm_cpu_power6, asm_cpu_power7, + asm_cpu_power8, asm_cpu_power9, asm_cpu_476. + +2018-09-28 Segher Boessenkool + * config.in: Delete HAVE_AS_DCI. * config/powerpcspe/powerpcspe.h: Treat HAVE_AS_DCI as always true. * config/rs6000/rs6000.h: Ditto. diff --git a/gcc/config/rs6000/driver-rs6000.c b/gcc/config/rs6000/driver-rs6000.c index 972099a..948888b 100644 --- a/gcc/config/rs6000/driver-rs6000.c +++ b/gcc/config/rs6000/driver-rs6000.c @@ -468,13 +468,13 @@ static const struct asm_name asm_names[] = { { "cell", "-mcell" }, { "power3", "-mppc64" }, { "power4", "-mpower4" }, - { "power5", "%(asm_cpu_power5)" }, - { "power5+", "%(asm_cpu_power5)" }, - { "power6", "%(asm_cpu_power6) -maltivec" }, - { "power6x", "%(asm_cpu_power6) -maltivec" }, - { "power7", "%(asm_cpu_power7)" }, - { "power8", "%(asm_cpu_power8)" }, - { "power9", "%(asm_cpu_power9)" }, + { "power5", "-mpower5" }, + { "power5+", "-mpower5" }, + { "power6", "-mpower6 -maltivec" }, + { "power6x", "-mpower6 -maltivec" }, + { "power7", "-mpower7" }, + { "power8", "-mpower8" }, + { "power9", "-mpower9" }, { "powerpc", "-mppc" }, { "rs64a", "-mppc64" }, { "401", "-mppc" }, diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 855de7c..86a7fb8 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -72,14 +72,6 @@ #define PPC405_ERRATUM77 0 #endif -#define ASM_CPU_POWER5_SPEC "-mpower5" -#define ASM_CPU_POWER6_SPEC "-mpower6 -maltivec" -#define ASM_CPU_POWER7_SPEC "-mpower7" -#define ASM_CPU_POWER8_SPEC "-mpower8" -#define ASM_CPU_POWER9_SPEC "-mpower9" - -#define ASM_CPU_476_SPEC "-m476" - /* Common ASM definitions used by ASM_SPEC among the various targets for handling -mcpu=xxx switches. There is a parallel list in driver-rs6000.c to provide the default assembler options if the user uses -mcpu=native, so if @@ -93,16 +85,16 @@ %{mcpu=cell: -mcell} \ %{mcpu=power3: -mppc64} \ %{mcpu=power4: -mpower4} \ -%{mcpu=power5: %(asm_cpu_power5)} \ -%{mcpu=power5+: %(asm_cpu_power5)} \ -%{mcpu=power6: %(asm_cpu_power6) -maltivec} \ -%{mcpu=power6x: %(asm_cpu_power6) -maltivec} \ -%{mcpu=power7: %(asm_cpu_power7)} \ -%{mcpu=power8: %{!mpower9-vector: %(asm_cpu_power8)}} \ -%{mcpu=power9: %(asm_cpu_power9)} \ +%{mcpu=power5: -mpower5} \ +%{mcpu=power5+: -mpower5} \ +%{mcpu=power6: -mpower6 -maltivec} \ +%{mcpu=power6x: -mpower6 -maltivec} \ +%{mcpu=power7: -mpower7} \ +%{mcpu=power8: %{!mpower9-vector: -mpower8}} \ +%{mcpu=power9: -mpower9} \ %{mcpu=a2: -ma2} \ %{mcpu=powerpc: -mppc} \ -%{mcpu=powerpc64le: %(asm_cpu_power8)} \ +%{mcpu=powerpc64le: -mpower8} \ %{mcpu=rs64a: -mppc64} \ %{mcpu=401: -mppc} \ %{mcpu=403: -m403} \ @@ -112,8 +104,8 @@ %{mcpu=440fp: -m440} \ %{mcpu=464: -m440} \ %{mcpu=464fp: -m440} \ -%{mcpu=476: %(asm_cpu_476)} \ -%{mcpu=476fp: %(asm_cpu_476)} \ +%{mcpu=476: -m476} \ +%{mcpu=476fp: -m476} \ %{mcpu=505: -mppc} \ %{mcpu=601: -m601} \ %{mcpu=602: -mppc} \ @@ -145,9 +137,9 @@ %{mcpu=e5500: -me5500} \ %{mcpu=e6500: -me6500} \ %{maltivec: -maltivec} \ -%{mvsx: -mvsx %{!maltivec: -maltivec} %{!mcpu*: %(asm_cpu_power7)}} \ -%{mpower8-vector|mcrypto|mdirect-move|mhtm: %{!mcpu*: %(asm_cpu_power8)}} \ -%{mpower9-vector: %{!mcpu*|mcpu=power8: %(asm_cpu_power9)}} \ +%{mvsx: -mvsx %{!maltivec: -maltivec} %{!mcpu*: -mpower7}} \ +%{mpower8-vector|mcrypto|mdirect-move|mhtm: %{!mcpu*: -mpower8}} \ +%{mpower9-vector: %{!mcpu*|mcpu=power8: -mpower9}} \ -many" #define CPP_DEFAULT_SPEC "" @@ -172,12 +164,6 @@ { "asm_cpu_native", ASM_CPU_NATIVE_SPEC }, \ { "asm_default", ASM_DEFAULT_SPEC }, \ { "cc1_cpu", CC1_CPU_SPEC }, \ - { "asm_cpu_power5", ASM_CPU_POWER5_SPEC }, \ - { "asm_cpu_power6", ASM_CPU_POWER6_SPEC }, \ - { "asm_cpu_power7", ASM_CPU_POWER7_SPEC }, \ - { "asm_cpu_power8", ASM_CPU_POWER8_SPEC }, \ - { "asm_cpu_power9", ASM_CPU_POWER9_SPEC }, \ - { "asm_cpu_476", ASM_CPU_476_SPEC }, \ SUBTARGET_EXTRA_SPECS /* -mcpu=native handling only makes sense with compiler running on -- cgit v1.1 From 400bc5261ebde7046e2afd1c064109109ba2c0c1 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Fri, 28 Sep 2018 23:13:10 +0000 Subject: match.pd (simple_comparison): Don't optimize if either operand is a function pointer when... * match.pd (simple_comparison): Don't optimize if either operand is a function pointer when target needs function pointer canonicalization. From-SVN: r264705 --- gcc/ChangeLog | 5 +++++ gcc/match.pd | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0f703f5..7be6ceb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-09-28 John David Anglin + + * match.pd (simple_comparison): Don't optimize if either operand is + a function pointer when target needs function pointer canonicalization. + 2018-09-28 Segher Boessenkool * config/rs6000/driver-rs6000.c (asm_names): Adjust the entries for diff --git a/gcc/match.pd b/gcc/match.pd index 74244f3..ae26ec2 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -3558,8 +3558,10 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) /* Disable this optimization if we're casting a function pointer type on targets that require function pointer canonicalization. */ && !(targetm.have_canonicalize_funcptr_for_compare () - && POINTER_TYPE_P (TREE_TYPE (@00)) - && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (@00)))) + && ((POINTER_TYPE_P (TREE_TYPE (@00)) + && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (@00)))) + || (POINTER_TYPE_P (TREE_TYPE (@10)) + && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (@10)))))) && single_use (@0)) (if (TYPE_PRECISION (TREE_TYPE (@00)) == TYPE_PRECISION (TREE_TYPE (@0)) && (TREE_CODE (@10) == INTEGER_CST -- cgit v1.1 From 26b0a30641ab761c30873fc1de831564afc9337d Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sat, 29 Sep 2018 00:16:19 +0000 Subject: Daily bump. From-SVN: r264709 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 473a00d..d0320df 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20180928 +20180929 -- cgit v1.1 From 23bce99cbe7016a04e14c2163ed3fe6a5a64f4e2 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 29 Sep 2018 18:04:09 +0200 Subject: re PR target/87467 (Incorrect function parameter for _mm512_abs_pd in `include/avx512fintrin.h`) PR target/87467 * config/i386/avx512fintrin.h (_mm512_abs_pd, _mm512_mask_abs_pd): Use __m512d type for __A argument rather than __m512. * gcc.target/i386/avx512f-abspd-1.c (SIZE): Divide by two. (CALC): Use double instead of float. (TEST): Adjust to test _mm512_abs_pd and _mm512_mask_abs_pd rather than _mm512_abs_ps and _mm512_mask_abs_ps. From-SVN: r264711 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/avx512fintrin.h | 4 ++-- gcc/testsuite/ChangeLog | 8 ++++++++ gcc/testsuite/gcc.target/i386/avx512f-abspd-1.c | 20 ++++++++++---------- 4 files changed, 26 insertions(+), 12 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7be6ceb..859984c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-09-29 Jakub Jelinek + + PR target/87467 + * config/i386/avx512fintrin.h (_mm512_abs_pd, _mm512_mask_abs_pd): Use + __m512d type for __A argument rather than __m512. + 2018-09-28 John David Anglin * match.pd (simple_comparison): Don't optimize if either operand is diff --git a/gcc/config/i386/avx512fintrin.h b/gcc/config/i386/avx512fintrin.h index 80525f9..4308c71 100644 --- a/gcc/config/i386/avx512fintrin.h +++ b/gcc/config/i386/avx512fintrin.h @@ -7798,7 +7798,7 @@ _mm512_mask_abs_ps (__m512 __W, __mmask16 __U, __m512 __A) extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_abs_pd (__m512 __A) +_mm512_abs_pd (__m512d __A) { return (__m512d) _mm512_and_epi64 ((__m512i) __A, _mm512_set1_epi64 (0x7fffffffffffffffLL)); @@ -7806,7 +7806,7 @@ _mm512_abs_pd (__m512 __A) extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_mask_abs_pd (__m512d __W, __mmask8 __U, __m512 __A) +_mm512_mask_abs_pd (__m512d __W, __mmask8 __U, __m512d __A) { return (__m512d) _mm512_mask_and_epi64 ((__m512i) __W, __U, (__m512i) __A, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2a81011..2ef07c5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2018-09-29 Jakub Jelinek + + PR target/87467 + * gcc.target/i386/avx512f-abspd-1.c (SIZE): Divide by two. + (CALC): Use double instead of float. + (TEST): Adjust to test _mm512_abs_pd and _mm512_mask_abs_pd rather than + _mm512_abs_ps and _mm512_mask_abs_ps. + 2018-09-28 David Malcolm * c-c++-common/unroll-1.c: Update expected output from "note" to diff --git a/gcc/testsuite/gcc.target/i386/avx512f-abspd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-abspd-1.c index 14ed037..1b68721 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-abspd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-abspd-1.c @@ -6,11 +6,11 @@ #include "avx512f-helper.h" -#define SIZE (AVX512F_LEN / 32) +#define SIZE (AVX512F_LEN / 64) #include "avx512f-mask-type.h" static void -CALC (float *i1, float *r) +CALC (double *i1, double *r) { int i; @@ -24,27 +24,27 @@ CALC (float *i1, float *r) void TEST (void) { - float ck[SIZE]; + double ck[SIZE]; int i; - UNION_TYPE (AVX512F_LEN, ) s, d, dm; + UNION_TYPE (AVX512F_LEN, d) s, d, dm; MASK_TYPE mask = MASK_VALUE; for (i = 0; i < SIZE; i++) { - s.a[i] = i * ((i & 1) ? 3.5f : -7.5f); + s.a[i] = i * ((i & 1) ? 3.5 : -7.5); d.a[i] = DEFAULT_VALUE; dm.a[i] = DEFAULT_VALUE; } CALC (s.a, ck); - d.x = INTRINSIC (_abs_ps) (s.x); - dm.x = INTRINSIC (_mask_abs_ps) (dm.x, mask, s.x); + d.x = INTRINSIC (_abs_pd) (s.x); + dm.x = INTRINSIC (_mask_abs_pd) (dm.x, mask, s.x); - if (UNION_CHECK (AVX512F_LEN, ) (d, ck)) + if (UNION_CHECK (AVX512F_LEN, d) (d, ck)) abort (); - MASK_MERGE () (ck, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, ) (dm, ck)) + MASK_MERGE (d) (ck, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, d) (dm, ck)) abort (); } -- cgit v1.1 From 7d583f4259a56c9054c28e883c375f9c57f8755d Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Sat, 29 Sep 2018 10:06:09 -0600 Subject: builtins.c (unterminated_array): Pass in c_strlen_data * to c_strlen rather than just a tree *. * builtins.c (unterminated_array): Pass in c_strlen_data * to c_strlen rather than just a tree *. (c_strlen): Change NONSTR argument to a c_strlen_data pointer. Update recursive calls appropriately. If caller did not provide a suitable data pointer, create a local one. When a non-terminated string is discovered, bubble up information about the string via the c_strlen_data object. * builtins.h (c_strlen): Update prototype. (c_strlen_data): New structure. * gimple-fold.c (get_range_strlen): Update calls to c_strlen. For a type 2 call, if c_strlen indicates a non-terminated string use the length of the non-terminated string. (gimple_fold_builtin_stpcpy): Update calls to c_strlen. From-SVN: r264712 --- gcc/ChangeLog | 18 +++++++++++++- gcc/builtins.c | 70 ++++++++++++++++++++++++++++++++++--------------------- gcc/builtins.h | 9 ++++++- gcc/gimple-fold.c | 31 ++++++++++++++++++------ 4 files changed, 92 insertions(+), 36 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 859984c..29f52fd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2018-09-29 Jeff Law + + * builtins.c (unterminated_array): Pass in c_strlen_data * to + c_strlen rather than just a tree *. + (c_strlen): Change NONSTR argument to a c_strlen_data pointer. + Update recursive calls appropriately. If caller did not provide a + suitable data pointer, create a local one. When a non-terminated + string is discovered, bubble up information about the string via the + c_strlen_data object. + * builtins.h (c_strlen): Update prototype. + (c_strlen_data): New structure. + * gimple-fold.c (get_range_strlen): Update calls to c_strlen. + For a type 2 call, if c_strlen indicates a non-terminated string + use the length of the non-terminated string. + (gimple_fold_builtin_stpcpy): Update calls to c_strlen. + 2018-09-29 Jakub Jelinek PR target/87467 @@ -302,8 +318,8 @@ * config/i386/i386.h (NUM_MODES_FOR_MODE_SWITCHING): Update for removed I387_MASK_PM entity. -2018-09-26 Jeff Law +2018-09-26 Jeff Law Revert 2018-09-26 Alexey Neyman diff --git a/gcc/builtins.c b/gcc/builtins.c index e655623..fe411ef 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -570,9 +570,10 @@ warn_string_no_nul (location_t loc, const char *fn, tree arg, tree decl) tree unterminated_array (tree exp) { - tree nonstr = NULL; - c_strlen (exp, 1, &nonstr); - return nonstr; + c_strlen_data data; + memset (&data, 0, sizeof (c_strlen_data)); + c_strlen (exp, 1, &data); + return data.decl; } /* Compute the length of a null-terminated character string or wide @@ -592,10 +593,12 @@ unterminated_array (tree exp) accesses. Note that this implies the result is not going to be emitted into the instruction stream. - If a not zero-terminated string value is encountered and NONSTR is - non-zero, the declaration of the string value is assigned to *NONSTR. - *NONSTR is accumulating, thus not cleared on success, therefore it has - to be initialized to NULL_TREE by the caller. + Additional information about the string accessed may be recorded + in DATA. For example, if SRC references an unterminated string, + then the declaration will be stored in the DECL field. If the + length of the unterminated string can be determined, it'll be + stored in the LEN field. Note this length could well be different + than what a C strlen call would return. ELTSIZE is 1 for normal single byte character strings, and 2 or 4 for wide characer strings. ELTSIZE is by default 1. @@ -603,8 +606,16 @@ unterminated_array (tree exp) The value returned is of type `ssizetype'. */ tree -c_strlen (tree src, int only_value, tree *nonstr, unsigned eltsize) +c_strlen (tree src, int only_value, c_strlen_data *data, unsigned eltsize) { + /* If we were not passed a DATA pointer, then get one to a local + structure. That avoids having to check DATA for NULL before + each time we want to use it. */ + c_strlen_data local_strlen_data; + memset (&local_strlen_data, 0, sizeof (c_strlen_data)); + if (!data) + data = &local_strlen_data; + gcc_checking_assert (eltsize == 1 || eltsize == 2 || eltsize == 4); STRIP_NOPS (src); if (TREE_CODE (src) == COND_EXPR @@ -612,15 +623,15 @@ c_strlen (tree src, int only_value, tree *nonstr, unsigned eltsize) { tree len1, len2; - len1 = c_strlen (TREE_OPERAND (src, 1), only_value, nonstr, eltsize); - len2 = c_strlen (TREE_OPERAND (src, 2), only_value, nonstr, eltsize); + len1 = c_strlen (TREE_OPERAND (src, 1), only_value, data, eltsize); + len2 = c_strlen (TREE_OPERAND (src, 2), only_value, data, eltsize); if (tree_int_cst_equal (len1, len2)) return len1; } if (TREE_CODE (src) == COMPOUND_EXPR && (only_value || !TREE_SIDE_EFFECTS (TREE_OPERAND (src, 0)))) - return c_strlen (TREE_OPERAND (src, 1), only_value, nonstr, eltsize); + return c_strlen (TREE_OPERAND (src, 1), only_value, data, eltsize); location_t loc = EXPR_LOC_OR_LOC (src, input_location); @@ -666,13 +677,15 @@ c_strlen (tree src, int only_value, tree *nonstr, unsigned eltsize) start searching for it. */ unsigned len = string_length (ptr, eltsize, strelts); - /* Return when an embedded null character is found or none at all. */ + /* Return when an embedded null character is found or none at all. + In the latter case, set the DECL/LEN field in the DATA structure + so that callers may examine them. */ if (len + 1 < strelts) return NULL_TREE; else if (len >= maxelts) { - if (nonstr && decl) - *nonstr = decl; + data->decl = decl; + data->len = ssize_int (len); return NULL_TREE; } @@ -737,11 +750,12 @@ c_strlen (tree src, int only_value, tree *nonstr, unsigned eltsize) strelts - eltoff); /* Don't know what to return if there was no zero termination. - Ideally this would turn into a gcc_checking_assert over time. */ + Ideally this would turn into a gcc_checking_assert over time. + Set DECL/LEN so callers can examine them. */ if (len >= maxelts - eltoff) { - if (nonstr && decl) - *nonstr = decl; + data->decl = decl; + data->len = ssize_int (len); return NULL_TREE; } @@ -3965,13 +3979,14 @@ expand_builtin_stpcpy_1 (tree exp, rtx target, machine_mode mode) compile-time, not an expression containing a string. This is because the latter will potentially produce pessimized code when used to produce the return value. */ - tree nonstr = NULL_TREE; + c_strlen_data data; + memset (&data, 0, sizeof (c_strlen_data)); if (!c_getstr (src, NULL) - || !(len = c_strlen (src, 0, &nonstr, 1))) + || !(len = c_strlen (src, 0, &data, 1))) return expand_movstr (dst, src, target, /*endp=*/2); - if (nonstr && !TREE_NO_WARNING (exp)) - warn_string_no_nul (EXPR_LOCATION (exp), "stpcpy", src, nonstr); + if (data.decl && !TREE_NO_WARNING (exp)) + warn_string_no_nul (EXPR_LOCATION (exp), "stpcpy", src, data.decl); lenp1 = size_binop_loc (loc, PLUS_EXPR, len, ssize_int (1)); ret = expand_builtin_mempcpy_args (dst, src, lenp1, @@ -8444,22 +8459,23 @@ fold_builtin_strlen (location_t loc, tree type, tree arg) return NULL_TREE; else { - tree nonstr = NULL_TREE; - tree len = c_strlen (arg, 0, &nonstr); + c_strlen_data data; + memset (&data, 0, sizeof (c_strlen_data)); + tree len = c_strlen (arg, 0, &data); if (len) return fold_convert_loc (loc, type, len); - if (!nonstr) - c_strlen (arg, 1, &nonstr); + if (!data.decl) + c_strlen (arg, 1, &data); - if (nonstr) + if (data.decl) { if (EXPR_HAS_LOCATION (arg)) loc = EXPR_LOCATION (arg); else if (loc == UNKNOWN_LOCATION) loc = input_location; - warn_string_no_nul (loc, "strlen", arg, nonstr); + warn_string_no_nul (loc, "strlen", arg, data.decl); } return NULL_TREE; diff --git a/gcc/builtins.h b/gcc/builtins.h index 45ad684..3801251 100644 --- a/gcc/builtins.h +++ b/gcc/builtins.h @@ -57,7 +57,14 @@ extern bool get_pointer_alignment_1 (tree, unsigned int *, unsigned HOST_WIDE_INT *); extern unsigned int get_pointer_alignment (tree); extern unsigned string_length (const void*, unsigned, unsigned); -extern tree c_strlen (tree, int, tree * = NULL, unsigned = 1); +struct c_strlen_data +{ + tree decl; + tree len; + tree off; +}; + +extern tree c_strlen (tree, int, c_strlen_data * = NULL, unsigned = 1); extern void expand_builtin_setjmp_setup (rtx, rtx); extern void expand_builtin_setjmp_receiver (rtx); extern void expand_builtin_update_setjmp_buf (rtx); diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index 1e84722..cf04c92 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -1337,7 +1337,23 @@ get_range_strlen (tree arg, tree length[2], bitmap *visited, int type, return false; } else - val = c_strlen (arg, 1, nonstr, eltsize); + { + c_strlen_data data; + memset (&data, 0, sizeof (c_strlen_data)); + val = c_strlen (arg, 1, &data, eltsize); + + /* If we potentially had a non-terminated string, then + bubble that information up to the caller. */ + if (!val) + { + *nonstr = data.decl; + /* If TYPE is asking for a maximum, then use any + length (including the length of an unterminated + string) for VAL. */ + if (type == 2) + val = data.len; + } + } if (!val && fuzzy) { @@ -2812,21 +2828,22 @@ gimple_fold_builtin_stpcpy (gimple_stmt_iterator *gsi) } /* Set to non-null if ARG refers to an unterminated array. */ - tree nonstr = NULL; - tree len = c_strlen (src, 1, &nonstr, 1); + c_strlen_data data; + memset (&data, 0, sizeof (c_strlen_data)); + tree len = c_strlen (src, 1, &data, 1); if (!len || TREE_CODE (len) != INTEGER_CST) { - nonstr = unterminated_array (src); - if (!nonstr) + data.decl = unterminated_array (src); + if (!data.decl) return false; } - if (nonstr) + if (data.decl) { /* Avoid folding calls with unterminated arrays. */ if (!gimple_no_warning_p (stmt)) - warn_string_no_nul (loc, "stpcpy", src, nonstr); + warn_string_no_nul (loc, "stpcpy", src, data.decl); gimple_set_no_warning (stmt, true); return false; } -- cgit v1.1 From 29a94bf97da148775cedb260ca8581be9cc2bacd Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Sat, 29 Sep 2018 17:17:09 +0000 Subject: re PR fortran/65677 (Incomplete assignment on deferred-length character variable) 2018-09-29 Paul Thomas PR fortran/65667 * trans-expr.c (gfc_trans_assignment_1): If there is dependency fix the rse stringlength. 2018-09-29 Paul Thomas PR fortran/65667 * gfortran.dg/dependency_52.f90 : New test. From-SVN: r264715 --- gcc/fortran/ChangeLog | 6 ++++ gcc/fortran/trans-expr.c | 6 +++- gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/gfortran.dg/dependency_52.f90 | 45 +++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/dependency_52.f90 (limited to 'gcc') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 86d0a3e..ffada92 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2018-09-29 Paul Thomas + + PR fortran/65667 + * trans-expr.c (gfc_trans_assignment_1): If there is dependency + fix the rse stringlength. + 2018-09-25 Martin Liska PR fortran/87394 diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 04210a4..9824848 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -10207,7 +10207,11 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, || TREE_CODE (rse.string_length) == INDIRECT_REF)) string_length = gfc_evaluate_now (rse.string_length, &rse.pre); else if (expr2->ts.type == BT_CHARACTER) - string_length = rse.string_length; + { + if (expr1->ts.deferred && gfc_check_dependency (expr1, expr2, false)) + rse.string_length = gfc_evaluate_now (rse.string_length, &rse.pre); + string_length = rse.string_length; + } else string_length = NULL_TREE; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2ef07c5..530e7de 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-29 Paul Thomas + + PR fortran/65667 + * gfortran.dg/dependency_52.f90 : New test. + 2018-09-29 Jakub Jelinek PR target/87467 diff --git a/gcc/testsuite/gfortran.dg/dependency_52.f90 b/gcc/testsuite/gfortran.dg/dependency_52.f90 new file mode 100644 index 0000000..20c97ca --- /dev/null +++ b/gcc/testsuite/gfortran.dg/dependency_52.f90 @@ -0,0 +1,45 @@ +! { dg-do run } +! +! Test the fix for PR65667, in which the dependency was missed and +! the string length of 'text' was decremented twice. The rhs string +! length is now fixed after the function call so that the dependency +! on the length of 'text' is removed for later evaluations. +! +!Contributed by John +! +module mod1 + implicit none +contains + subroutine getKeyword(string, keyword, rest) + character(:), allocatable, intent(IN) :: string + character(:), allocatable, intent(OUT) :: keyword, rest + integer :: idx + character(:), allocatable :: text + + keyword = '' + rest = '' + text = string + text = ADJUSTL(text(2:)) ! Note dependency. + idx = INDEX(text, ' ') + + if (idx == 0) then + keyword = TRIM(text) + else + keyword = text(:idx-1) + rest = TRIM(ADJUSTL(text(idx+1:))) + endif + end subroutine +end module mod1 + + use mod1 + implicit none + + character(:), allocatable :: line, keyword, rest + + line = '@HERE IT IS' + + call getKeyword(line, keyword, rest) + + if (keyword .ne. 'HERE') stop 1 + if (rest .ne. 'IT IS') stop 2 +end -- cgit v1.1 From bdfbaa72c5b25f273a7e40be93eb13583d310911 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sat, 29 Sep 2018 21:59:59 +0000 Subject: i386: Use TImode for BLKmode values in 2 integer registers When passing and returning BLKmode values in 2 integer registers, use 1 TImode register instead of 2 DImode registers. Otherwise, V1TImode may be used to move and store such BLKmode values, which prevent RTL optimizations. gcc/ PR target/87370 * config/i386/i386.c (construct_container): Use TImode for BLKmode values in 2 integer registers. gcc/testsuite/ PR target/87370 * gcc.target/i386/pr87370.c: New test. From-SVN: r264716 --- gcc/ChangeLog | 6 +++++ gcc/config/i386/i386.c | 17 ++++++++++++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr87370.c | 39 +++++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr87370.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 29f52fd..d4add9d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-09-29 H.J. Lu + + PR target/87370 + * config/i386/i386.c (construct_container): Use TImode for + BLKmode values in 2 integer registers. + 2018-09-29 Jeff Law * builtins.c (unterminated_array): Pass in c_strlen_data * to diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 176cce5..5475251 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -7914,9 +7914,22 @@ construct_container (machine_mode mode, machine_mode orig_mode, if (n == 2 && regclass[0] == X86_64_INTEGER_CLASS && regclass[1] == X86_64_INTEGER_CLASS - && (mode == CDImode || mode == TImode) + && (mode == CDImode || mode == TImode || mode == BLKmode) && intreg[0] + 1 == intreg[1]) - return gen_rtx_REG (mode, intreg[0]); + { + if (mode == BLKmode) + { + /* Use TImode for BLKmode values in 2 integer registers. */ + exp[0] = gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (TImode, intreg[0]), + GEN_INT (0)); + ret = gen_rtx_PARALLEL (mode, rtvec_alloc (1)); + XVECEXP (ret, 0, 0) = exp[0]; + return ret; + } + else + return gen_rtx_REG (mode, intreg[0]); + } /* Otherwise figure out the entries of the PARALLEL. */ for (i = 0; i < n; i++) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 530e7de..2f021f7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-29 H.J. Lu + + PR target/87370 + * gcc.target/i386/pr87370.c: New test. + 2018-09-29 Paul Thomas PR fortran/65667 diff --git a/gcc/testsuite/gcc.target/i386/pr87370.c b/gcc/testsuite/gcc.target/i386/pr87370.c new file mode 100644 index 0000000..c7b6295 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr87370.c @@ -0,0 +1,39 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-O2" } */ + +struct A +{ + int b[4]; +}; +struct B +{ + char a[12]; + int b; +}; +struct C +{ + char a[16]; +}; + +struct A +f1 (void) +{ + struct A x = {}; + return x; +} + +struct B +f2 (void) +{ + struct B x = {}; + return x; +} + +struct C +f3 (void) +{ + struct C x = {}; + return x; +} + +/* { dg-final { scan-assembler-not "xmm" } } */ -- cgit v1.1 From 5e8b5d90ca6aa33ac30cbc4a9a99ca7948d29541 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sun, 30 Sep 2018 00:16:20 +0000 Subject: Daily bump. From-SVN: r264720 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index d0320df..9acf467 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20180929 +20180930 -- cgit v1.1 From 8ba60ec4348e1c987d91b76b2e3dec4fef8891f5 Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Sun, 30 Sep 2018 07:02:49 +0000 Subject: re PR fortran/70149 ([F08] Character pointer initialization causes ICE) 2018-09-30 Paul Thomas PR fortran/70149 * trans-decl.c (gfc_get_symbol_decl): A deferred character length pointer that is initialized needs the string length to be initialized as well. 2018-09-30 Paul Thomas PR fortran/70149 * gfortran.dg/deferred_character_24.f90 : New test. From-SVN: r264721 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/trans-decl.c | 12 ++++++++++- gcc/testsuite/ChangeLog | 5 +++++ .../gfortran.dg/deferred_character_24.f90 | 23 ++++++++++++++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/deferred_character_24.f90 (limited to 'gcc') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index ffada92..db17d97 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2018-09-30 Paul Thomas + + PR fortran/70149 + * trans-decl.c (gfc_get_symbol_decl): A deferred character + length pointer that is initialized needs the string length to + be initialized as well. + 2018-09-29 Paul Thomas PR fortran/65667 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 159c3dbb..f7568d5 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -1759,7 +1759,17 @@ gfc_get_symbol_decl (gfc_symbol * sym) && TREE_CODE (sym->ts.u.cl->backend_decl) != INDIRECT_REF) { gfc_finish_var_decl (length, sym); - gcc_assert (!sym->value); + if (!sym->attr.associate_var + && TREE_CODE (length) == VAR_DECL + && sym->value && sym->value->ts.u.cl->length) + { + gfc_expr *len = sym->value->ts.u.cl->length; + DECL_INITIAL (length) = gfc_conv_initializer (len, &len->ts, + TREE_TYPE (length), + false, false, false); + } + else + gcc_assert (!sym->value); } gfc_finish_var_decl (decl, sym); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2f021f7..2257b17 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-30 Paul Thomas + + PR fortran/70149 + * gfortran.dg/deferred_character_24.f90 : New test. + 2018-09-29 H.J. Lu PR target/87370 diff --git a/gcc/testsuite/gfortran.dg/deferred_character_24.f90 b/gcc/testsuite/gfortran.dg/deferred_character_24.f90 new file mode 100644 index 0000000..9f5f7bc --- /dev/null +++ b/gcc/testsuite/gfortran.dg/deferred_character_24.f90 @@ -0,0 +1,23 @@ +! { dg-do run } +! +! Test the fix for PR70149 in which the string length for +! 'number_string' was not initialized. +! +! Contributed by Walter Spector +! +module myptr_mod + implicit none + + integer, target, save :: int_data = 42 + character(16), target, save :: char_data = 'forty two' + + integer, pointer :: number => int_data + character(:), pointer :: number_string => char_data + +end module + + use myptr_mod + if (LEN (number_string) .ne. 16) stop 1 + if (trim (number_string) .ne. 'forty two') stop 2 +end + -- cgit v1.1 From ba08c70a0c73b9fef5b78e2e5706845aa85c4df7 Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Sun, 30 Sep 2018 12:22:07 +0000 Subject: re PR fortran/70752 (Incorrect LEN for ALLOCATABLE CHARACTER) 2018-09-30 Paul Thomas PR fortran/70752 PR fortran/72709 * trans-array.c (gfc_conv_scalarized_array_ref): If this is a deferred type and the info->descriptor is present, use the info->descriptor (gfc_conv_array_ref): Is the se expr is a descriptor type, pass it as 'decl' rather than the symbol backend_decl. (gfc_array_allocate): If the se string_length is a component reference, fix it and use it for the expression string length if the latter is not a variable type. If it is a variable do an assignment. Make use of component ref string lengths to set the descriptor 'span'. (gfc_conv_expr_descriptor): For pointer assignment, do not set the span field if gfc_get_array_span returns zero. * trans.c (get_array_span): If the upper bound a character type is zero, use the descriptor span if available. 2018-09-30 Paul Thomas PR fortran/70752 PR fortran/72709 * gfortran.dg/deferred_character_25.f90 : New test. * gfortran.dg/deferred_character_26.f90 : New test. * gfortran.dg/deferred_character_27.f90 : New test to verify that PR82617 remains fixed. From-SVN: r264724 --- gcc/fortran/ChangeLog | 19 +++++ gcc/fortran/trans-array.c | 48 +++++++++++- gcc/fortran/trans.c | 9 +++ gcc/testsuite/ChangeLog | 9 +++ .../gfortran.dg/deferred_character_25.f90 | 34 +++++++++ .../gfortran.dg/deferred_character_26.f90 | 42 +++++++++++ .../gfortran.dg/deferred_character_27.f90 | 87 ++++++++++++++++++++++ 7 files changed, 244 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/deferred_character_25.f90 create mode 100644 gcc/testsuite/gfortran.dg/deferred_character_26.f90 create mode 100644 gcc/testsuite/gfortran.dg/deferred_character_27.f90 (limited to 'gcc') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index db17d97..318567b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,24 @@ 2018-09-30 Paul Thomas + PR fortran/70752 + PR fortran/72709 + * trans-array.c (gfc_conv_scalarized_array_ref): If this is a + deferred type and the info->descriptor is present, use the + info->descriptor + (gfc_conv_array_ref): Is the se expr is a descriptor type, pass + it as 'decl' rather than the symbol backend_decl. + (gfc_array_allocate): If the se string_length is a component + reference, fix it and use it for the expression string length + if the latter is not a variable type. If it is a variable do + an assignment. Make use of component ref string lengths to set + the descriptor 'span'. + (gfc_conv_expr_descriptor): For pointer assignment, do not set + the span field if gfc_get_array_span returns zero. + * trans.c (get_array_span): If the upper bound a character type + is zero, use the descriptor span if available. + +2018-09-30 Paul Thomas + PR fortran/70149 * trans-decl.c (gfc_get_symbol_decl): A deferred character length pointer that is initialized needs the string length to diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 0d699ed..035257a 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -3423,7 +3423,9 @@ gfc_conv_scalarized_array_ref (gfc_se * se, gfc_array_ref * ar) /* A pointer array component can be detected from its field decl. Fix the descriptor, mark the resulting variable decl and pass it to gfc_build_array_ref. */ - if (is_pointer_array (info->descriptor)) + if (is_pointer_array (info->descriptor) + || (expr && expr->ts.deferred && info->descriptor + && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (info->descriptor)))) { if (TREE_CODE (info->descriptor) == COMPONENT_REF) decl = info->descriptor; @@ -3676,7 +3678,16 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar, gfc_expr *expr, else if (expr->ts.deferred || (sym->ts.type == BT_CHARACTER && sym->attr.select_type_temporary)) - decl = sym->backend_decl; + { + if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (se->expr))) + { + decl = se->expr; + if (TREE_CODE (decl) == INDIRECT_REF) + decl = TREE_OPERAND (decl, 0); + } + else + decl = sym->backend_decl; + } else if (sym->ts.type == BT_CLASS) decl = NULL_TREE; @@ -5761,6 +5772,19 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree status, tree errmsg, overflow = integer_zero_node; + if (expr->ts.type == BT_CHARACTER + && TREE_CODE (se->string_length) == COMPONENT_REF + && expr->ts.u.cl->backend_decl != se->string_length) + { + if (VAR_P (expr->ts.u.cl->backend_decl)) + gfc_add_modify (&se->pre, expr->ts.u.cl->backend_decl, + fold_convert (TREE_TYPE (expr->ts.u.cl->backend_decl), + se->string_length)); + else + expr->ts.u.cl->backend_decl = gfc_evaluate_now (se->string_length, + &se->pre); + } + gfc_init_block (&set_descriptor_block); /* Take the corank only from the actual ref and not from the coref. The later will mislead the generation of the array dimensions for allocatable/ @@ -5850,10 +5874,26 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree status, tree errmsg, /* Pointer arrays need the span field to be set. */ if (is_pointer_array (se->expr) || (expr->ts.type == BT_CLASS - && CLASS_DATA (expr)->attr.class_pointer)) + && CLASS_DATA (expr)->attr.class_pointer) + || (expr->ts.type == BT_CHARACTER + && TREE_CODE (se->string_length) == COMPONENT_REF)) { if (expr3 && expr3_elem_size != NULL_TREE) tmp = expr3_elem_size; + else if (se->string_length + && TREE_CODE (se->string_length) == COMPONENT_REF) + { + if (expr->ts.kind != 1) + { + tmp = build_int_cst (gfc_array_index_type, expr->ts.kind); + tmp = fold_build2_loc (input_location, MULT_EXPR, + gfc_array_index_type, tmp, + fold_convert (gfc_array_index_type, + se->string_length)); + } + else + tmp = se->string_length; + } else tmp = TYPE_SIZE_UNIT (gfc_get_element_type (TREE_TYPE (se->expr))); tmp = fold_convert (gfc_array_index_type, tmp); @@ -7086,7 +7126,7 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr) /* ....and set the span field. */ tmp = gfc_get_array_span (desc, expr); - if (tmp != NULL_TREE) + if (tmp != NULL_TREE && !integer_zerop (tmp)) gfc_conv_descriptor_span_set (&se->pre, se->expr, tmp); } else if (se->want_pointer) diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index 03dc7a2..9297b2f 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -307,6 +307,15 @@ get_array_span (tree type, tree decl) TYPE_SIZE_UNIT (TREE_TYPE (type))), span); } + else if (type && TREE_CODE (type) == ARRAY_TYPE + && TYPE_MAX_VALUE (TYPE_DOMAIN (type)) != NULL_TREE + && integer_zerop (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))) + { + if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))) + span = gfc_conv_descriptor_span_get (decl); + else + span = NULL_TREE; + } /* Likewise for class array or pointer array references. */ else if (TREE_CODE (decl) == FIELD_DECL || VAR_OR_FUNCTION_DECL_P (decl) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2257b17..e06098d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,14 @@ 2018-09-30 Paul Thomas + PR fortran/70752 + PR fortran/72709 + * gfortran.dg/deferred_character_25.f90 : New test. + * gfortran.dg/deferred_character_26.f90 : New test. + * gfortran.dg/deferred_character_27.f90 : New test to verify + that PR82617 remains fixed. + +2018-09-30 Paul Thomas + PR fortran/70149 * gfortran.dg/deferred_character_24.f90 : New test. diff --git a/gcc/testsuite/gfortran.dg/deferred_character_25.f90 b/gcc/testsuite/gfortran.dg/deferred_character_25.f90 new file mode 100644 index 0000000..906df94 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/deferred_character_25.f90 @@ -0,0 +1,34 @@ +! { dg-do run } +! +! Test the fix for PR70752 in which the type of the component 'c' is cast +! as character[1:0], which makes it slightly more difficult than usual to +! obtain the element length. This is one and the same bug as PR72709. +! +! Contributed by Gilbert Scott +! +PROGRAM TEST + IMPLICIT NONE + INTEGER, PARAMETER :: I = 3 + character (len = i), parameter :: str(5) = ['abc','cde','fgh','ijk','lmn'] + + TYPE T + CHARACTER(LEN=:), ALLOCATABLE :: C(:) + END TYPE T + TYPE(T), TARGET :: S + CHARACTER (LEN=I), POINTER :: P(:) + + ALLOCATE ( CHARACTER(LEN=I) :: S%C(5) ) + s%c = str + +! This PR uncovered several problems associated with determining the +! element length and indexing. Test fairly thoroughly! + if (SIZE(S%C, 1) .ne. 5) stop 1 + if (LEN(S%C) .ne. 3) stop 2 + if (any (s%c .ne. str)) stop 3 + if (s%c(3) .ne. str(3)) stop 4 + P => S%C + if (SIZE(p, 1) .ne. 5) stop 5 + if (LEN(p) .ne. 3) stop 6 + if (any (p .ne. str)) stop 7 + if (p(5) .ne. str(5)) stop 8 +END PROGRAM TEST diff --git a/gcc/testsuite/gfortran.dg/deferred_character_26.f90 b/gcc/testsuite/gfortran.dg/deferred_character_26.f90 new file mode 100644 index 0000000..4f335d7 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/deferred_character_26.f90 @@ -0,0 +1,42 @@ +! { dg-do run } +! +! Test the fix for PR72709 in which the type of the component 'header' is cast +! as character[1:0], which makes it slightly more difficult than usual to +! obtain the element length. This is one and the same bug as PR70752. +! +! Contributed by 'zmi' +! +program read_exp_data + implicit none + + type experimental_data_t + integer :: nh = 0 + character(len=:), dimension(:), allocatable :: header + + end type experimental_data_t + + character(*), parameter :: str(3) = ["#Generated by X ", & + "#from file 'Y' ", & + "# Experimental 4 mg/g"] + type(experimental_data_t) :: ex + integer :: nh_len + integer :: i + + + nh_len = 255 + ex % nh = 3 + allocate(character(len=nh_len) :: ex % header(ex % nh)) + + ex % header(1) = str(1) + ex % header(2) = str(2) + ex % header(3) = str(3) + +! Test that the string length is OK + if (len (ex%header) .ne. nh_len) stop 1 + +! Test the array indexing + do i = 1, ex % nh + if (trim (ex%header(i)) .ne. trim (str(i))) stop i + 1 + enddo + +end program read_exp_data diff --git a/gcc/testsuite/gfortran.dg/deferred_character_27.f90 b/gcc/testsuite/gfortran.dg/deferred_character_27.f90 new file mode 100644 index 0000000..7a5e4c6 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/deferred_character_27.f90 @@ -0,0 +1,87 @@ +! { dg-do compile } +! +! Make sure that PR82617 remains fixed. The first attempt at a +! fix for PR70752 cause this to ICE at the point indicated below. +! +! Contributed by Ogmundur Petersson +! +MODULE test + + IMPLICIT NONE + + PRIVATE + PUBLIC str_words + + !> Characters that are considered whitespace. + CHARACTER(len=*), PARAMETER :: strwhitespace = & + char(32)//& ! space + char(10)//& ! new line + char(13)//& ! carriage return + char( 9)//& ! horizontal tab + char(11)//& ! vertical tab + char(12) ! form feed (new page) + + CONTAINS + + ! ------------------------------------------------------------------- + !> Split string into words separated by arbitrary strings of whitespace + !> characters (space, tab, newline, return, formfeed). + FUNCTION str_words(str,white) RESULT(items) + CHARACTER(len=:), DIMENSION(:), ALLOCATABLE :: items + CHARACTER(len=*), INTENT(in) :: str !< String to split. + CHARACTER(len=*), INTENT(in) :: white ! Whitespace characters. + + items = strwords_impl(str,white) + + END FUNCTION str_words + + ! ------------------------------------------------------------------- + !>Implementation of str_words + !> characters (space, tab, newline, return, formfeed). + FUNCTION strwords_impl(str,white) RESULT(items) + CHARACTER(len=:), DIMENSION(:), ALLOCATABLE :: items + CHARACTER(len=*), INTENT(in) :: str !< String to split. + CHARACTER(len=*), INTENT(in) :: white ! Whitespace characters. + + INTEGER :: i0,i1,n + INTEGER :: l_item,i_item,n_item + + n = verify(str,white,.TRUE.) + IF (n>0) THEN + n_item = 0 + l_item = 0 + i1 = 0 + DO + i0 = verify(str(i1+1:n),white)+i1 + i1 = scan(str(i0+1:n),white) + n_item = n_item+1 + IF (i1>0) THEN + l_item = max(l_item,i1) + i1 = i0+i1 + ELSE + l_item = max(l_item,n-i0+1) + EXIT + END IF + END DO + ALLOCATE(CHARACTER(len=l_item)::items(n_item)) + i_item = 0 + i1 = 0 + DO + i0 = verify(str(i1+1:n),white)+i1 + i1 = scan(str(i0+1:n),white) + i_item = i_item+1 + IF (i1>0) THEN + i1 = i0+i1 + items(i_item) = str(i0:i1-1) + ELSE + items(i_item) = str(i0:n) + EXIT + END IF + END DO + ELSE + ALLOCATE(CHARACTER(len=0)::items(0)) + END IF + + END FUNCTION strwords_impl + +END MODULE test -- cgit v1.1 From a086078b8f7ee2580e55afc03026acf63bfb9605 Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Sun, 30 Sep 2018 13:52:55 +0000 Subject: re PR fortran/87359 (pointer being freed was not allocated) 2018-09-30 Paul Thomas PR fortran/87359 * trans-array.c (gfc_is_reallocatable_lhs): Correct the problem introduced by r264358, which prevented components of associate names from being reallocated on assignment. 2018-09-30 Paul Thomas PR fortran/87359 * gfortran.dg/associate_40.f90 : New test. From-SVN: r264725 --- gcc/fortran/ChangeLog | 7 +++ gcc/fortran/trans-array.c | 10 ++-- gcc/testsuite/ChangeLog | 5 ++ gcc/testsuite/gfortran.dg/associate_40.f90 | 96 ++++++++++++++++++++++++++++++ 4 files changed, 114 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/associate_40.f90 (limited to 'gcc') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 318567b..399d6f9 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,12 @@ 2018-09-30 Paul Thomas + PR fortran/87359 + * trans-array.c (gfc_is_reallocatable_lhs): Correct the problem + introduced by r264358, which prevented components of associate + names from being reallocated on assignment. + +2018-09-30 Paul Thomas + PR fortran/70752 PR fortran/72709 * trans-array.c (gfc_conv_scalarized_array_ref): If this is a diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 035257a..1e8f777 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -9574,11 +9574,12 @@ gfc_is_reallocatable_lhs (gfc_expr *expr) sym = expr->symtree->n.sym; - if (sym->attr.associate_var) + if (sym->attr.associate_var && !expr->ref) return false; /* An allocatable class variable with no reference. */ if (sym->ts.type == BT_CLASS + && !sym->attr.associate_var && CLASS_DATA (sym)->attr.allocatable && expr->ref && expr->ref->type == REF_COMPONENT && strcmp (expr->ref->u.c.component->name, "_data") == 0 @@ -9587,9 +9588,10 @@ gfc_is_reallocatable_lhs (gfc_expr *expr) /* An allocatable variable. */ if (sym->attr.allocatable - && expr->ref - && expr->ref->type == REF_ARRAY - && expr->ref->u.ar.type == AR_FULL) + && !sym->attr.associate_var + && expr->ref + && expr->ref->type == REF_ARRAY + && expr->ref->u.ar.type == AR_FULL) return true; /* All that can be left are allocatable components. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e06098d..4dc292a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2018-09-30 Paul Thomas + PR fortran/87359 + * gfortran.dg/associate_40.f90 : New test. + +2018-09-30 Paul Thomas + PR fortran/70752 PR fortran/72709 * gfortran.dg/deferred_character_25.f90 : New test. diff --git a/gcc/testsuite/gfortran.dg/associate_40.f90 b/gcc/testsuite/gfortran.dg/associate_40.f90 new file mode 100644 index 0000000..8ca5ef5 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/associate_40.f90 @@ -0,0 +1,96 @@ +! { dg-do compile } +! { dg-options "-fdump-tree-original" } +! +! Test the fix for the second part of PR87359 in which the reallocation on +! assignment for components of associate names was disallowed by r264358. +! -fcheck-all exposed the mismatch in array shapes. The deallocations at +! the end of the main program are there to make sure that valgrind does +! not report an memory leaks. +! +! Contributed by Juergen Reuter +! +module phs_fks + implicit none + private + public :: phs_identifier_t + public :: phs_fks_t + type :: phs_identifier_t + integer, dimension(:), allocatable :: contributors + contains + procedure :: init => phs_identifier_init + end type phs_identifier_t + + type :: phs_fks_t + type(phs_identifier_t), dimension(:), allocatable :: phs_identifiers + end type phs_fks_t +contains + + subroutine phs_identifier_init & + (phs_id, contributors) + class(phs_identifier_t), intent(out) :: phs_id + integer, intent(in), dimension(:) :: contributors + allocate (phs_id%contributors (size (contributors))) + phs_id%contributors = contributors + end subroutine phs_identifier_init + +end module phs_fks + +!!!!! + +module instances + use phs_fks + implicit none + private + public :: process_instance_t + + type :: nlo_event_deps_t + type(phs_identifier_t), dimension(:), allocatable :: phs_identifiers + end type nlo_event_deps_t + + type :: process_instance_t + type(phs_fks_t), pointer :: phs => null () + type(nlo_event_deps_t) :: event_deps + contains + procedure :: init => process_instance_init + procedure :: setup_real_event_kinematics => pi_setup_real_event_kinematics + end type process_instance_t + +contains + + subroutine process_instance_init (instance) + class(process_instance_t), intent(out), target :: instance + integer :: i + integer :: i_born, i_real + allocate (instance%phs) + end subroutine process_instance_init + + subroutine pi_setup_real_event_kinematics (process_instance) + class(process_instance_t), intent(inout) :: process_instance + integer :: i_real, i + associate (event_deps => process_instance%event_deps) + i_real = 2 + associate (phs => process_instance%phs) + allocate (phs%phs_identifiers (3)) + call phs%phs_identifiers(1)%init ([1]) + call phs%phs_identifiers(2)%init ([1,2]) + call phs%phs_identifiers(3)%init ([1,2,3]) + process_instance%event_deps%phs_identifiers = phs%phs_identifiers ! Error: mismatch in array shapes. + end associate + end associate + end subroutine pi_setup_real_event_kinematics + +end module instances + +!!!!! + +program main + use instances, only: process_instance_t + implicit none + type(process_instance_t), allocatable, target :: process_instance + allocate (process_instance) + call process_instance%init () + call process_instance%setup_real_event_kinematics () + if (associated (process_instance%phs)) deallocate (process_instance%phs) + if (allocated (process_instance)) deallocate (process_instance) +end program main +! { dg-final { scan-tree-dump-times "__builtin_realloc" 2 "original" } } -- cgit v1.1 From 0df92803a9f297fd8af6f23b224f15e1cf12f12a Mon Sep 17 00:00:00 2001 From: Peter Bergner Date: Sun, 30 Sep 2018 20:03:14 +0000 Subject: re PR rtl-optimization/86939 (IRA incorrectly creates an interference between a pseudo register and a hard register) gcc/ PR rtl-optimization/86939 * ira-lives.c (make_hard_regno_born): Rename from this... (make_hard_regno_live): ... to this. Remove update to conflict information. Update function comment. (make_hard_regno_dead): Add conflict information update. Update function comment. (make_object_born): Rename from this... (make_object_live): ... to this. Remove update to conflict information. Update function comment. (make_object_dead): Add conflict information update. Update function comment. (mark_pseudo_regno_live): Call make_object_live. (mark_pseudo_regno_subword_live): Likewise. (mark_hard_reg_dead): Update function comment. (mark_hard_reg_live): Call make_hard_regno_live. (process_bb_node_lives): Likewise. * lra-lives.c (make_hard_regno_born): Rename from this... (make_hard_regno_live): ... to this. Remove update to conflict information. Remove now uneeded check_pic_pseudo_p argument. Update function comment. (make_hard_regno_dead): Add check_pic_pseudo_p argument and add update to conflict information. Update function comment. (mark_pseudo_live): Remove update to conflict information. Update function comment. (mark_pseudo_dead): Add conflict information update. (mark_regno_live): Call make_hard_regno_live. (mark_regno_dead): Call make_hard_regno_dead with new arguement. (process_bb_lives): Call make_hard_regno_live and make_hard_regno_dead. From-SVN: r264726 --- gcc/ChangeLog | 31 ++++++++++++++++++++++++ gcc/ira-lives.c | 58 ++++++++++++++++++++++---------------------- gcc/lra-lives.c | 74 +++++++++++++++++++++++++++++---------------------------- 3 files changed, 97 insertions(+), 66 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d4add9d..f6b8c37 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,34 @@ +2018-09-30 Peter Bergner + + PR rtl-optimization/86939 + * ira-lives.c (make_hard_regno_born): Rename from this... + (make_hard_regno_live): ... to this. Remove update to conflict + information. Update function comment. + (make_hard_regno_dead): Add conflict information update. Update + function comment. + (make_object_born): Rename from this... + (make_object_live): ... to this. Remove update to conflict information. + Update function comment. + (make_object_dead): Add conflict information update. Update function + comment. + (mark_pseudo_regno_live): Call make_object_live. + (mark_pseudo_regno_subword_live): Likewise. + (mark_hard_reg_dead): Update function comment. + (mark_hard_reg_live): Call make_hard_regno_live. + (process_bb_node_lives): Likewise. + * lra-lives.c (make_hard_regno_born): Rename from this... + (make_hard_regno_live): ... to this. Remove update to conflict + information. Remove now uneeded check_pic_pseudo_p argument. + Update function comment. + (make_hard_regno_dead): Add check_pic_pseudo_p argument and add update + to conflict information. Update function comment. + (mark_pseudo_live): Remove update to conflict information. Update + function comment. + (mark_pseudo_dead): Add conflict information update. + (mark_regno_live): Call make_hard_regno_live. + (mark_regno_dead): Call make_hard_regno_dead with new arguement. + (process_bb_lives): Call make_hard_regno_live and make_hard_regno_dead. + 2018-09-29 H.J. Lu PR target/87370 diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c index b38d4a5..ab8ad4a 100644 --- a/gcc/ira-lives.c +++ b/gcc/ira-lives.c @@ -84,14 +84,19 @@ static int *allocno_saved_at_call; supplemental to recog_data. */ static alternative_mask preferred_alternatives; -/* Record the birth of hard register REGNO, updating hard_regs_live and - hard reg conflict information for living allocnos. */ +/* Record hard register REGNO as now being live. */ static void -make_hard_regno_born (int regno) +make_hard_regno_live (int regno) { - unsigned int i; - SET_HARD_REG_BIT (hard_regs_live, regno); +} + +/* Process the definition of hard register REGNO. This updates + hard_regs_live and hard reg conflict information for living allocnos. */ +static void +make_hard_regno_dead (int regno) +{ + unsigned int i; EXECUTE_IF_SET_IN_SPARSESET (objects_live, i) { ira_object_t obj = ira_object_id_map[i]; @@ -99,28 +104,17 @@ make_hard_regno_born (int regno) SET_HARD_REG_BIT (OBJECT_CONFLICT_HARD_REGS (obj), regno); SET_HARD_REG_BIT (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), regno); } -} - -/* Process the death of hard register REGNO. This updates - hard_regs_live. */ -static void -make_hard_regno_dead (int regno) -{ CLEAR_HARD_REG_BIT (hard_regs_live, regno); } -/* Record the birth of object OBJ. Set a bit for it in objects_live, - start a new live range for it if necessary and update hard register - conflicts. */ +/* Record object OBJ as now being live. Set a bit for it in objects_live, + and start a new live range for it if necessary. */ static void -make_object_born (ira_object_t obj) +make_object_live (ira_object_t obj) { - live_range_t lr = OBJECT_LIVE_RANGES (obj); - sparseset_set_bit (objects_live, OBJECT_CONFLICT_ID (obj)); - IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj), hard_regs_live); - IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), hard_regs_live); + live_range_t lr = OBJECT_LIVE_RANGES (obj); if (lr == NULL || (lr->finish != curr_point && lr->finish + 1 != curr_point)) ira_add_live_range_to_object (obj, curr_point, -1); @@ -154,14 +148,18 @@ update_allocno_pressure_excess_length (ira_object_t obj) } } -/* Process the death of object OBJ, which is associated with allocno - A. This finishes the current live range for it. */ +/* Process the definition of object OBJ, which is associated with allocno A. + This finishes the current live range for it. */ static void make_object_dead (ira_object_t obj) { live_range_t lr; sparseset_clear_bit (objects_live, OBJECT_CONFLICT_ID (obj)); + + IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj), hard_regs_live); + IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), hard_regs_live); + lr = OBJECT_LIVE_RANGES (obj); ira_assert (lr != NULL); lr->finish = curr_point; @@ -290,7 +288,7 @@ mark_pseudo_regno_live (int regno) continue; inc_register_pressure (pclass, nregs); - make_object_born (obj); + make_object_live (obj); } } @@ -327,7 +325,7 @@ mark_pseudo_regno_subword_live (int regno, int subword) return; inc_register_pressure (pclass, 1); - make_object_born (obj); + make_object_live (obj); } /* Mark the register REG as live. Store a 1 in hard_regs_live for @@ -351,7 +349,7 @@ mark_hard_reg_live (rtx reg) aclass = ira_hard_regno_allocno_class[regno]; pclass = ira_pressure_class_translate[aclass]; inc_register_pressure (pclass, 1); - make_hard_regno_born (regno); + make_hard_regno_live (regno); } regno++; } @@ -457,8 +455,8 @@ mark_pseudo_regno_subword_dead (int regno, int subword) make_object_dead (obj); } -/* Mark the hard register REG as dead. Store a 0 in hard_regs_live for the - register. */ +/* Process the definition of hard register REG. This updates hard_regs_live + and hard reg conflict information for living allocnos. */ static void mark_hard_reg_dead (rtx reg) { @@ -1298,7 +1296,7 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) unsigned int regno = EH_RETURN_DATA_REGNO (j); if (regno == INVALID_REGNUM) break; - make_hard_regno_born (regno); + make_hard_regno_live (regno); } /* Allocnos can't go in stack regs at the start of a basic block @@ -1317,7 +1315,7 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) ALLOCNO_TOTAL_NO_STACK_REG_P (a) = true; } for (px = FIRST_STACK_REG; px <= LAST_STACK_REG; px++) - make_hard_regno_born (px); + make_hard_regno_live (px); #endif /* No need to record conflicts for call clobbered regs if we have nonlocal labels around, as we don't ever try to @@ -1340,7 +1338,7 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) && REGNO (pic_offset_table_rtx) >= FIRST_PSEUDO_REGISTER) #endif ) - make_hard_regno_born (px); + make_hard_regno_live (px); } EXECUTE_IF_SET_IN_SPARSESET (objects_live, i) diff --git a/gcc/lra-lives.c b/gcc/lra-lives.c index 565c68b..b41df60 100644 --- a/gcc/lra-lives.c +++ b/gcc/lra-lives.c @@ -223,42 +223,41 @@ lra_intersected_live_ranges_p (lra_live_range_t r1, lra_live_range_t r2) /* The corresponding bitmaps of BB currently being processed. */ static bitmap bb_killed_pseudos, bb_gen_pseudos; -/* The function processing birth of hard register REGNO. It updates - living hard regs, START_LIVING, and conflict hard regs for living - pseudos. Conflict hard regs for the pic pseudo is not updated if - REGNO is REAL_PIC_OFFSET_TABLE_REGNUM and CHECK_PIC_PSEUDO_P is - true. */ +/* Record hard register REGNO as now being live. It updates + living hard regs and START_LIVING. */ static void -make_hard_regno_born (int regno, bool check_pic_pseudo_p ATTRIBUTE_UNUSED) +make_hard_regno_live (int regno) { - unsigned int i; - lra_assert (regno < FIRST_PSEUDO_REGISTER); if (TEST_HARD_REG_BIT (hard_regs_live, regno)) return; SET_HARD_REG_BIT (hard_regs_live, regno); sparseset_set_bit (start_living, regno); - EXECUTE_IF_SET_IN_SPARSESET (pseudos_live, i) -#ifdef REAL_PIC_OFFSET_TABLE_REGNUM - if (! check_pic_pseudo_p - || regno != REAL_PIC_OFFSET_TABLE_REGNUM - || pic_offset_table_rtx == NULL - || i != REGNO (pic_offset_table_rtx)) -#endif - SET_HARD_REG_BIT (lra_reg_info[i].conflict_hard_regs, regno); if (fixed_regs[regno] || TEST_HARD_REG_BIT (hard_regs_spilled_into, regno)) bitmap_set_bit (bb_gen_pseudos, regno); } -/* Process the death of hard register REGNO. This updates - hard_regs_live and START_DYING. */ +/* Process the definition of hard register REGNO. This updates + hard_regs_live, START_DYING and conflict hard regs for living + pseudos. Conflict hard regs for the pic pseudo is not updated if + REGNO is REAL_PIC_OFFSET_TABLE_REGNUM and CHECK_PIC_PSEUDO_P is + true. */ static void -make_hard_regno_dead (int regno) +make_hard_regno_dead (int regno, bool check_pic_pseudo_p ATTRIBUTE_UNUSED) { lra_assert (regno < FIRST_PSEUDO_REGISTER); if (! TEST_HARD_REG_BIT (hard_regs_live, regno)) return; sparseset_set_bit (start_dying, regno); + unsigned int i; + EXECUTE_IF_SET_IN_SPARSESET (pseudos_live, i) +#ifdef REAL_PIC_OFFSET_TABLE_REGNUM + if (! check_pic_pseudo_p + || regno != REAL_PIC_OFFSET_TABLE_REGNUM + || pic_offset_table_rtx == NULL + || i != REGNO (pic_offset_table_rtx)) +#endif + SET_HARD_REG_BIT (lra_reg_info[i].conflict_hard_regs, regno); CLEAR_HARD_REG_BIT (hard_regs_live, regno); if (fixed_regs[regno] || TEST_HARD_REG_BIT (hard_regs_spilled_into, regno)) { @@ -267,9 +266,9 @@ make_hard_regno_dead (int regno) } } -/* Mark pseudo REGNO as living at program point POINT, update conflicting - hard registers of the pseudo and START_LIVING, and start a new live - range for the pseudo corresponding to REGNO if it is necessary. */ +/* Mark pseudo REGNO as living at program point POINT, update START_LIVING + and start a new live range for the pseudo corresponding to REGNO if it + is necessary. */ static void mark_pseudo_live (int regno, int point) { @@ -278,7 +277,6 @@ mark_pseudo_live (int regno, int point) lra_assert (regno >= FIRST_PSEUDO_REGISTER); lra_assert (! sparseset_bit_p (pseudos_live, regno)); sparseset_set_bit (pseudos_live, regno); - IOR_HARD_REG_SET (lra_reg_info[regno].conflict_hard_regs, hard_regs_live); if ((complete_info_p || lra_get_regno_hard_regno (regno) < 0) && ((p = lra_reg_info[regno].live_ranges) == NULL @@ -301,6 +299,9 @@ mark_pseudo_dead (int regno, int point) lra_assert (sparseset_bit_p (pseudos_live, regno)); sparseset_clear_bit (pseudos_live, regno); sparseset_set_bit (start_dying, regno); + + IOR_HARD_REG_SET (lra_reg_info[regno].conflict_hard_regs, hard_regs_live); + if (complete_info_p || lra_get_regno_hard_regno (regno) < 0) { p = lra_reg_info[regno].live_ranges; @@ -322,7 +323,7 @@ mark_regno_live (int regno, machine_mode mode, int point) if (regno < FIRST_PSEUDO_REGISTER) { for (last = end_hard_regno (mode, regno); regno < last; regno++) - make_hard_regno_born (regno, false); + make_hard_regno_live (regno); } else { @@ -349,7 +350,7 @@ mark_regno_dead (int regno, machine_mode mode, int point) if (regno < FIRST_PSEUDO_REGISTER) { for (last = end_hard_regno (mode, regno); regno < last; regno++) - make_hard_regno_dead (regno); + make_hard_regno_dead (regno, false); } else { @@ -834,13 +835,13 @@ process_bb_lives (basic_block bb, int &curr_point, bool dead_insn_p) for (reg = curr_static_id->hard_regs; reg != NULL; reg = reg->next) if (reg->type != OP_IN) - make_hard_regno_born (reg->regno, false); + make_hard_regno_live (reg->regno); if (curr_id->arg_hard_regs != NULL) for (i = 0; (regno = curr_id->arg_hard_regs[i]) >= 0; i++) if (regno >= FIRST_PSEUDO_REGISTER) /* It is a clobber. */ - make_hard_regno_born (regno - FIRST_PSEUDO_REGISTER, false); + make_hard_regno_live (regno - FIRST_PSEUDO_REGISTER); sparseset_copy (unused_set, start_living); @@ -857,13 +858,14 @@ process_bb_lives (basic_block bb, int &curr_point, bool dead_insn_p) for (reg = curr_static_id->hard_regs; reg != NULL; reg = reg->next) if (reg->type == OP_OUT && ! reg_early_clobber_p (reg, n_alt) && ! reg->subreg_p) - make_hard_regno_dead (reg->regno); + make_hard_regno_dead (reg->regno, false); if (curr_id->arg_hard_regs != NULL) for (i = 0; (regno = curr_id->arg_hard_regs[i]) >= 0; i++) if (regno >= FIRST_PSEUDO_REGISTER) - /* It is a clobber. */ - make_hard_regno_dead (regno - FIRST_PSEUDO_REGISTER); + /* It is a clobber. Don't create conflict of used + REAL_PIC_OFFSET_TABLE_REGNUM and the pic pseudo. */ + make_hard_regno_dead (regno - FIRST_PSEUDO_REGISTER, true); if (call_p) { @@ -920,14 +922,14 @@ process_bb_lives (basic_block bb, int &curr_point, bool dead_insn_p) for (reg = curr_static_id->hard_regs; reg != NULL; reg = reg->next) if (reg->type == OP_IN) - make_hard_regno_born (reg->regno, false); + make_hard_regno_live (reg->regno); if (curr_id->arg_hard_regs != NULL) /* Make argument hard registers live. Don't create conflict of used REAL_PIC_OFFSET_TABLE_REGNUM and the pic pseudo. */ for (i = 0; (regno = curr_id->arg_hard_regs[i]) >= 0; i++) if (regno < FIRST_PSEUDO_REGISTER) - make_hard_regno_born (regno, true); + make_hard_regno_live (regno); sparseset_and_compl (dead_set, start_living, start_dying); @@ -952,7 +954,7 @@ process_bb_lives (basic_block bb, int &curr_point, bool dead_insn_p) if (reg2->type != OP_OUT && reg2->regno == reg->regno) break; if (reg2 == NULL) - make_hard_regno_dead (reg->regno); + make_hard_regno_dead (reg->regno, false); } if (need_curr_point_incr) @@ -995,7 +997,7 @@ process_bb_lives (basic_block bb, int &curr_point, bool dead_insn_p) if (regno == INVALID_REGNUM) break; - make_hard_regno_born (regno, false); + make_hard_regno_live (regno); } /* Pseudos can't go in stack regs at the start of a basic block that @@ -1009,7 +1011,7 @@ process_bb_lives (basic_block bb, int &curr_point, bool dead_insn_p) EXECUTE_IF_SET_IN_SPARSESET (pseudos_live, px) lra_reg_info[px].no_stack_p = true; for (px = FIRST_STACK_REG; px <= LAST_STACK_REG; px++) - make_hard_regno_born (px, false); + make_hard_regno_live (px); #endif /* No need to record conflicts for call clobbered regs if we have nonlocal labels around, as we don't ever try to @@ -1029,7 +1031,7 @@ process_bb_lives (basic_block bb, int &curr_point, bool dead_insn_p) && REGNO (pic_offset_table_rtx) >= FIRST_PSEUDO_REGISTER) #endif ) - make_hard_regno_born (px, false); + make_hard_regno_live (px); } bool live_change_p = false; -- cgit v1.1 From b38ab29fe979d03b6eeb24308177f20cd028815e Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Mon, 1 Oct 2018 00:13:36 +0200 Subject: mmx.md (EMMS): New int iterator. * config/i386/mmx.md (EMMS): New int iterator. (emms): New int attribute. (mmx_): Macroize insn from *mmx_emms and *mmx_femms using EMMS int iterator. Explicitly declare clobbers. (mmx_emms): Remove expander. (mmx_femms): Ditto. * config/i386/predicates.md (emms_operation): Remove predicate. (vzeroall_pattern): New predicate. (vzeroupper_pattern): Rename from vzeroupper_operation. * config/i386/i386.c (ix86_avx_u128_mode_after): Use vzeroupper_pattern and vzeroall_pattern predicates. From-SVN: r264727 --- gcc/ChangeLog | 34 +++++++++++----- gcc/config/i386/i386.c | 4 +- gcc/config/i386/mmx.md | 90 ++++++++++++++----------------------------- gcc/config/i386/predicates.md | 40 ++++--------------- 4 files changed, 62 insertions(+), 106 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f6b8c37..54f3e9b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2018-09-30 Uros Bizjak + + * config/i386/mmx.md (EMMS): New int iterator. + (emms): New int attribute. + (mmx_): Macroize insn from *mmx_emms and *mmx_femms using + EMMS int iterator. Explicitly declare clobbers. + (mmx_emms): Remove expander. + (mmx_femms): Ditto. + * config/i386/predicates.md (emms_operation): Remove predicate. + (vzeroall_pattern): New predicate. + (vzeroupper_pattern): Rename from vzeroupper_operation. + * config/i386/i386.c (ix86_avx_u128_mode_after): Use + vzeroupper_pattern and vzeroall_pattern predicates. + 2018-09-30 Peter Bergner PR rtl-optimization/86939 @@ -94,7 +108,7 @@ * configure: Regenerate. 2018-09-28 Eric Botcazou - Pierre-Marie de Rodat + Pierre-Marie de Rodat * calls.c (expand_call): Try to do a tail call for thunks at -O0 too. * cgraph.h (struct cgraph_thunk_info): Add indirect_offset. @@ -268,7 +282,7 @@ to subblocks. 2018-09-27 Andrew Stubbs - Tom de Vries + Tom de Vries PR 82089 @@ -428,7 +442,7 @@ 2018-09-25 Bernd Edlinger PR c/87387 - * builtins.c (unterminated_array): Simplify. + * builtins.c (unterminated_array): Simplify. * expr.c (string_constant): Handle SSA_NAME. Add more exceptions where pointer arithmetic is safe. @@ -629,7 +643,7 @@ * genattrtab.c (mk_attr_alt): Use alternative_mask. (attr_rtx_1): Adjust caching to match the new EQ_ATTR_ALT field - types. + types. (check_attr_test): Use alternative_mask. (get_attr_value): Likewise. (compute_alternative_mask): Use alternative_mask and XWINT. @@ -639,11 +653,11 @@ (attr_alt_intersection): Use alternative_mask and XWINT. (attr_alt_union): Likewise. (attr_alt_complement): Use HOST_WIDE_INT and XWINT. - (mk_attr_alt): Use alternative_mask and HOST_WIDE_INT. + (mk_attr_alt): Use alternative_mask and HOST_WIDE_INT. (simplify_test_exp): Use alternative_mask and XWINT. (write_test_expr): Use alternative_mask and XWINT, adjust bit - number calculation to support 64 bits. Generate code that - checks 64-bit masks. + number calculation to support 64 bits. Generate code that + checks 64-bit masks. (main): Use alternative_mask. * rtl.def (EQ_ATTR_ALT): Change field types from ii to ww. @@ -730,7 +744,7 @@ 2018-09-23 Uros Bizjak * config/i386/i386.c (regclass_map): Declare integer REX registers - as GENERAL_REGS. + as GENERAL_REGS. 2018-09-23 Gerald Pfeifer @@ -818,7 +832,7 @@ * config.gcc: Prepend vxworks-dummy.h to tm_file for powerpc* 2018-09-21 Shaokun Zhang - Bo Zhou + Bo Zhou * config/aarch64/aarch64-cores.def (tsv110): New CPU. * config/aarch64/aarch64-tune.md: Regenerated. @@ -1549,7 +1563,7 @@ * cfgexpand.c (expand_gimple_cond): Likewise. 2018-09-09 Cesar Philippidis - Julian Brown + Julian Brown PR middle-end/86336 * gimplify.c (gimplify_scan_omp_clauses): Set diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 5475251..55bf18b 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -18957,8 +18957,8 @@ ix86_avx_u128_mode_after (int mode, rtx_insn *insn) { rtx pat = PATTERN (insn); - if (vzeroupper_operation (pat, VOIDmode) - || vzeroall_operation (pat, VOIDmode)) + if (vzeroupper_pattern (pat, VOIDmode) + || vzeroall_pattern (pat, VOIDmode)) return AVX_U128_CLEAN; /* We know that state is clean after CALL insn if there are no diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index a75807c4..b1496f5 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -1570,68 +1570,34 @@ (set_attr "znver1_decode" "vector") (set_attr "mode" "DI")]) -(define_expand "mmx_emms" - [(match_par_dup 0 [(const_int 0)])] - "TARGET_MMX" -{ - int regno; - - operands[0] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (17)); - - XVECEXP (operands[0], 0, 0) - = gen_rtx_UNSPEC_VOLATILE (VOIDmode, gen_rtvec (1, const0_rtx), - UNSPECV_EMMS); - - for (regno = 0; regno < 8; regno++) - { - XVECEXP (operands[0], 0, regno + 1) - = gen_rtx_CLOBBER (VOIDmode, - gen_rtx_REG (XFmode, FIRST_STACK_REG + regno)); - - XVECEXP (operands[0], 0, regno + 9) - = gen_rtx_CLOBBER (VOIDmode, - gen_rtx_REG (DImode, FIRST_MMX_REG + regno)); - } -}) - -(define_insn "*mmx_emms" - [(match_parallel 0 "emms_operation" - [(unspec_volatile [(const_int 0)] UNSPECV_EMMS)])] - "TARGET_MMX" - "emms" - [(set_attr "type" "mmx") - (set_attr "modrm" "0") - (set_attr "memory" "none")]) - -(define_expand "mmx_femms" - [(match_par_dup 0 [(const_int 0)])] - "TARGET_3DNOW" -{ - int regno; - - operands[0] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (17)); - - XVECEXP (operands[0], 0, 0) - = gen_rtx_UNSPEC_VOLATILE (VOIDmode, gen_rtvec (1, const0_rtx), - UNSPECV_FEMMS); - - for (regno = 0; regno < 8; regno++) - { - XVECEXP (operands[0], 0, regno + 1) - = gen_rtx_CLOBBER (VOIDmode, - gen_rtx_REG (XFmode, FIRST_STACK_REG + regno)); - - XVECEXP (operands[0], 0, regno + 9) - = gen_rtx_CLOBBER (VOIDmode, - gen_rtx_REG (DImode, FIRST_MMX_REG + regno)); - } -}) - -(define_insn "*mmx_femms" - [(match_parallel 0 "emms_operation" - [(unspec_volatile [(const_int 0)] UNSPECV_FEMMS)])] - "TARGET_3DNOW" - "femms" +(define_int_iterator EMMS + [(UNSPECV_EMMS "TARGET_MMX") + (UNSPECV_FEMMS "TARGET_3DNOW")]) + +(define_int_attr emms + [(UNSPECV_EMMS "emms") + (UNSPECV_FEMMS "femms")]) + +(define_insn "mmx_" + [(unspec_volatile [(const_int 0)] EMMS) + (clobber (reg:XF ST0_REG)) + (clobber (reg:XF ST1_REG)) + (clobber (reg:XF ST2_REG)) + (clobber (reg:XF ST3_REG)) + (clobber (reg:XF ST4_REG)) + (clobber (reg:XF ST5_REG)) + (clobber (reg:XF ST6_REG)) + (clobber (reg:XF ST7_REG)) + (clobber (reg:DI MM0_REG)) + (clobber (reg:DI MM1_REG)) + (clobber (reg:DI MM2_REG)) + (clobber (reg:DI MM3_REG)) + (clobber (reg:DI MM4_REG)) + (clobber (reg:DI MM5_REG)) + (clobber (reg:DI MM6_REG)) + (clobber (reg:DI MM7_REG))] + "" + "" [(set_attr "type" "mmx") (set_attr "modrm" "0") (set_attr "memory" "none")]) diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index de77308..221053f 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -1406,36 +1406,6 @@ (and (match_code "mem") (match_test "MEM_ALIGN (op) < GET_MODE_BITSIZE (mode)"))) -;; Return true if OP is a emms operation, known to be a PARALLEL. -(define_predicate "emms_operation" - (match_code "parallel") -{ - unsigned i; - - if (XVECLEN (op, 0) != 17) - return false; - - for (i = 0; i < 8; i++) - { - rtx elt = XVECEXP (op, 0, i+1); - - if (GET_CODE (elt) != CLOBBER - || GET_CODE (SET_DEST (elt)) != REG - || GET_MODE (SET_DEST (elt)) != XFmode - || REGNO (SET_DEST (elt)) != FIRST_STACK_REG + i) - return false; - - elt = XVECEXP (op, 0, i+9); - - if (GET_CODE (elt) != CLOBBER - || GET_CODE (SET_DEST (elt)) != REG - || GET_MODE (SET_DEST (elt)) != DImode - || REGNO (SET_DEST (elt)) != FIRST_MMX_REG + i) - return false; - } - return true; -}) - ;; Return true if OP is a vzeroall operation, known to be a PARALLEL. (define_predicate "vzeroall_operation" (match_code "parallel") @@ -1459,8 +1429,14 @@ return true; }) -;; return true if OP is a vzeroupper operation. -(define_predicate "vzeroupper_operation" +;; return true if OP is a vzeroall pattern. +(define_predicate "vzeroall_pattern" + (and (match_code "parallel") + (match_code "unspec_volatile" "a") + (match_test "XINT (XVECEXP (op, 0, 0), 1) == UNSPECV_VZEROALL"))) + +;; return true if OP is a vzeroupper pattern. +(define_predicate "vzeroupper_pattern" (and (match_code "unspec_volatile") (match_test "XINT (op, 1) == UNSPECV_VZEROUPPER"))) -- cgit v1.1 From f89d27f2c38cba7183fb8fbacbf7790a65187f47 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Mon, 1 Oct 2018 00:16:42 +0000 Subject: Daily bump. From-SVN: r264731 --- gcc/DATESTAMP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 9acf467..9e2ebb6 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20180930 +20181001 -- cgit v1.1 From cb8c960e440d6a342fc8a388eee4be1ce81ae8ce Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 1 Oct 2018 00:27:45 +0000 Subject: [Ada] use -gnatd_A to disable .ali on -fcompare-debug recompile for gcc/ada/ChangeLog * gcc-interface/lang-specs.h (default_compilers): When given fcompare-debug-second, adjust auxbase like cc1, and pass gnatd_A. * gcc-interface/misc.c (flag_compare_debug): Remove variable. (gnat_post_options): Do not set it. * lib-writ.adb (flag_compare_debug): Remove import. (Write_ALI): Do not test it. From-SVN: r264732 --- gcc/ada/ChangeLog | 10 ++++++++++ gcc/ada/gcc-interface/lang-specs.h | 3 ++- gcc/ada/gcc-interface/misc.c | 4 ---- gcc/ada/lib-writ.adb | 8 +------- 4 files changed, 13 insertions(+), 12 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c18c4c8..d63cc5a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2018-09-30 Alexandre Oliva + + * gcc-interface/lang-specs.h (default_compilers): When given + fcompare-debug-second, adjust auxbase like cc1, and pass + gnatd_A. + * gcc-interface/misc.c (flag_compare_debug): Remove variable. + (gnat_post_options): Do not set it. + * lib-writ.adb (flag_compare_debug): Remove import. + (Write_ALI): Do not test it. + 2018-09-28 Eric Botcazou Pierre-Marie de Rodat diff --git a/gcc/ada/gcc-interface/lang-specs.h b/gcc/ada/gcc-interface/lang-specs.h index eece809..c7bf32c 100644 --- a/gcc/ada/gcc-interface/lang-specs.h +++ b/gcc/ada/gcc-interface/lang-specs.h @@ -35,7 +35,8 @@ gnat1 %{I*} %{k8:-gnatk8} %{Wall:-gnatwa} %{w:-gnatws} %{!Q:-quiet}\ %{nostdinc*} %{nostdlib*}\ -dumpbase %{.adb:%b.adb}%{.ads:%b.ads}%{!.adb:%{!.ads:%b.ada}}\ - %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} \ + %{fcompare-debug-second:%:compare-debug-auxbase-opt(%b) -gnatd_A} \ + %{!fcompare-debug-second:%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}}} \ %{O*} %{W*} %{w} %{p} %{pg:-p} %{d*} \ %{coverage:-fprofile-arcs -ftest-coverage} " #if defined(TARGET_VXWORKS_RTP) diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 16a9d2c..98ec277 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -77,9 +77,6 @@ int optimize; #undef optimize_size int optimize_size; -#undef flag_compare_debug -int flag_compare_debug; - #undef flag_short_enums int flag_short_enums; @@ -284,7 +281,6 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED) gnat_encodings = global_options.x_gnat_encodings; optimize = global_options.x_optimize; optimize_size = global_options.x_optimize_size; - flag_compare_debug = global_options.x_flag_compare_debug; flag_stack_check = global_options.x_flag_stack_check; flag_short_enums = global_options.x_flag_short_enums; diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb index f035b45..ce35c9e 100644 --- a/gcc/ada/lib-writ.adb +++ b/gcc/ada/lib-writ.adb @@ -226,10 +226,6 @@ package body Lib.Writ is Num_Sdep : Nat := 0; -- Number of active entries in Sdep_Table - flag_compare_debug : Int; - pragma Import (C, flag_compare_debug); - -- Import from toplev.c - ----------------------- -- Local Subprograms -- ----------------------- @@ -1079,9 +1075,7 @@ package body Lib.Writ is -- We never write an ALI file if the original operating mode was -- syntax-only (-gnats switch used in compiler invocation line) - if Original_Operating_Mode = Check_Syntax - or flag_compare_debug /= 0 - then + if Original_Operating_Mode = Check_Syntax then return; end if; -- cgit v1.1 From 796a2bb27466db5a151c06707b348cb2a705c514 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 1 Oct 2018 07:48:51 +0000 Subject: tree-inline.c (expand_call_inline): Store origin of fn in BLOCK_ABSTRACT_ORIGIN for the inline BLOCK. 2018-10-01 Richard Biener * tree-inline.c (expand_call_inline): Store origin of fn in BLOCK_ABSTRACT_ORIGIN for the inline BLOCK. * tree.c (block_ultimate_origin): Simplify and do some checking. From-SVN: r264734 --- gcc/ChangeLog | 7 +++++++ gcc/tree-inline.c | 2 +- gcc/tree.c | 28 ++++++++-------------------- 3 files changed, 16 insertions(+), 21 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 54f3e9b..7783d09 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-10-01 Richard Biener + + * tree-inline.c (expand_call_inline): Store origin of fn + in BLOCK_ABSTRACT_ORIGIN for the inline BLOCK. + * tree.c (block_ultimate_origin): Simplify and do some + checking. + 2018-09-30 Uros Bizjak * config/i386/mmx.md (EMMS): New int iterator. diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 2eac7b7..6b5ef36 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4535,7 +4535,7 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id) if (loc == UNKNOWN_LOCATION) loc = BUILTINS_LOCATION; id->block = make_node (BLOCK); - BLOCK_ABSTRACT_ORIGIN (id->block) = fn; + BLOCK_ABSTRACT_ORIGIN (id->block) = DECL_ORIGIN (fn); BLOCK_SOURCE_LOCATION (id->block) = loc; prepend_lexical_block (gimple_block (stmt), id->block); } diff --git a/gcc/tree.c b/gcc/tree.c index 2bd209b..d52f877 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -12124,38 +12124,26 @@ prepare_target_option_nodes_for_pch (void) TREE_TARGET_GLOBALS (*iter) = NULL; } -/* Determine the "ultimate origin" of a block. The block may be an inlined - instance of an inlined instance of a block which is local to an inline - function, so we have to trace all of the way back through the origin chain - to find out what sort of node actually served as the original seed for the - given block. */ +/* Determine the "ultimate origin" of a block. */ tree block_ultimate_origin (const_tree block) { - tree immediate_origin = BLOCK_ABSTRACT_ORIGIN (block); + tree origin = BLOCK_ABSTRACT_ORIGIN (block); /* BLOCK_ABSTRACT_ORIGIN can point to itself; ignore that if we're trying to output the abstract instance of this function. */ - if (BLOCK_ABSTRACT (block) && immediate_origin == block) + if (BLOCK_ABSTRACT (block) && origin == block) return NULL_TREE; - if (immediate_origin == NULL_TREE) + if (origin == NULL_TREE) return NULL_TREE; else { - tree ret_val = immediate_origin; - - /* The block's abstract origin chain may not be the *ultimate* origin of - the block. It could lead to a DECL that has an abstract origin set. - If so, we want that DECL's abstract origin (which is what DECL_ORIGIN - will give us if it has one). Note that DECL's abstract origins are - supposed to be the most distant ancestor (or so decl_ultimate_origin - claims), so we don't need to loop following the DECL origins. */ - if (DECL_P (ret_val)) - return DECL_ORIGIN (ret_val); - - return ret_val; + gcc_checking_assert ((DECL_P (origin) + && DECL_ORIGIN (origin) == origin) + || BLOCK_ORIGIN (origin) == origin); + return origin; } } -- cgit v1.1 From 97e1d32c5e6efdfac3a9d6c56e8127b958fff88f Mon Sep 17 00:00:00 2001 From: Claudiu Zissulescu Date: Mon, 1 Oct 2018 11:37:33 +0200 Subject: [ARC] Check for odd-even register when emitting double mac ops. gcc/ Claudiu Zissulescu * config/arc/arc.md (maddsidi4_split): Don't use dmac if the destination register is not odd-even. (umaddsidi4_split): Likewise. gcc/testsuite/ Claudiu Zissulescu * gcc.target/arc/tmac-3.c: New file. From-SVN: r264736 --- gcc/ChangeLog | 6 ++++++ gcc/config/arc/arc.md | 4 ++-- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/arc/tmac-3.c | 17 +++++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/arc/tmac-3.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7783d09..8773039 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-10-01 Claudiu Zissulescu + + * config/arc/arc.md (maddsidi4_split): Don't use dmac if the + destination register is not odd-even. + (umaddsidi4_split): Likewise. + 2018-10-01 Richard Biener * tree-inline.c (expand_call_inline): Store origin of fn diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index 181a738..95cfa45 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -6309,7 +6309,7 @@ archs4x, archs4xd, archs4xd_slow" "{ rtx acc_reg = gen_rtx_REG (DImode, ACC_REG_FIRST); emit_move_insn (acc_reg, operands[3]); - if (TARGET_PLUS_MACD) + if (TARGET_PLUS_MACD && even_register_operand (operands[0], DImode)) emit_insn (gen_macd (operands[0], operands[1], operands[2])); else { @@ -6409,7 +6409,7 @@ archs4x, archs4xd, archs4xd_slow" "{ rtx acc_reg = gen_rtx_REG (DImode, ACC_REG_FIRST); emit_move_insn (acc_reg, operands[3]); - if (TARGET_PLUS_MACD) + if (TARGET_PLUS_MACD && even_register_operand (operands[0], DImode)) emit_insn (gen_macdu (operands[0], operands[1], operands[2])); else { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4dc292a..fe679c6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-10-01 Claudiu Zissulescu + + * gcc.target/arc/tmac-3.c: New file. + 2018-09-30 Paul Thomas PR fortran/87359 diff --git a/gcc/testsuite/gcc.target/arc/tmac-3.c b/gcc/testsuite/gcc.target/arc/tmac-3.c new file mode 100644 index 0000000..23ef173 --- /dev/null +++ b/gcc/testsuite/gcc.target/arc/tmac-3.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-skip-if "" { ! { clmcpu } } } */ +/* { dg-options "-mcpu=hs38 -Os" } */ + +/* The compiler will assign r1r2 as a DI register, but it doesn't fit + the macd operation, hence we need to fall back on the mac + instruction. */ +typedef long long myint64_t; + +extern int d (int, myint64_t); +int b (int c) +{ + int x = (int) d; + d (c, (myint64_t)x * 2 + 1); +} + +/* { dg-final { scan-assembler "mac\\\s+r1" } } */ -- cgit v1.1 From e04108c7274d5066fcc791ec254f843a3ff694aa Mon Sep 17 00:00:00 2001 From: Claudiu Zissulescu Date: Mon, 1 Oct 2018 11:37:46 +0200 Subject: [ARC] Avoid specific constants to end in limm field. Avoid constants to end up in the limm field for particular instructions when compiling for size. gcc/ xxxx-xx-xx Claudiu Zissulescu * config/arc/arc.md (*add_n): Clean up pattern, update instruction constraints. (ashlsi3_insn): Update instruction constraints. (ashrsi3_insn): Likewise. (rotrsi3): Likewise. (add_shift): Likewise. * config/arc/constraints.md (Csz): New 32 bit constraint. It avoids placing in the limm field small constants which, otherwise, could end into a small instruction. testsuite/ xxxx-xx-xx Claudiu Zissulescu * gcc.target/arc/tph_addx.c: New test. From-SVN: r264737 --- gcc/ChangeLog | 12 ++++++++ gcc/config/arc/arc.md | 49 +++++++++++------------------- gcc/config/arc/constraints.md | 6 ++++ gcc/testsuite/ChangeLog | 4 +++ gcc/testsuite/gcc.target/arc/tph_addx.c | 53 +++++++++++++++++++++++++++++++++ 5 files changed, 93 insertions(+), 31 deletions(-) create mode 100644 gcc/testsuite/gcc.target/arc/tph_addx.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8773039..5214064 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,17 @@ 2018-10-01 Claudiu Zissulescu + * config/arc/arc.md (*add_n): Clean up pattern, update instruction + constraints. + (ashlsi3_insn): Update instruction constraints. + (ashrsi3_insn): Likewise. + (rotrsi3): Likewise. + (add_shift): Likewise. + * config/arc/constraints.md (Csz): New 32 bit constraint. It + avoids placing in the limm field small constants which, otherwise, + could end into a small instruction. + +2018-10-01 Claudiu Zissulescu + * config/arc/arc.md (maddsidi4_split): Don't use dmac if the destination register is not odd-even. (umaddsidi4_split): Likewise. diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index 95cfa45..33804d7 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -3173,30 +3173,17 @@ archs4x, archs4xd, archs4xd_slow" (set (match_dup 3) (match_dup 4))]) (define_insn "*add_n" - [(set (match_operand:SI 0 "dest_reg_operand" "=Rcqq,Rcw,W,W,w,w") - (plus:SI (ashift:SI (match_operand:SI 1 "register_operand" "Rcqq,c,c,c,c,c") - (match_operand:SI 2 "_1_2_3_operand" "")) - (match_operand:SI 3 "nonmemory_operand" "0,0,c,?Cal,?c,??Cal")))] - "" - "add%c2%? %0,%3,%1%&" - [(set_attr "type" "shift") - (set_attr "length" "*,4,4,8,4,8") - (set_attr "predicable" "yes,yes,no,no,no,no") - (set_attr "cond" "canuse,canuse,nocond,nocond,nocond,nocond") - (set_attr "iscompact" "maybe,false,false,false,false,false")]) - -(define_insn "*add_n" - [(set (match_operand:SI 0 "dest_reg_operand" "=Rcqq,Rcw,W,W,w,w") - (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "Rcqq,c,c,c,c,c") + [(set (match_operand:SI 0 "dest_reg_operand" "=q,r,r") + (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "q,r,r") (match_operand:SI 2 "_2_4_8_operand" "")) - (match_operand:SI 3 "nonmemory_operand" "0,0,c,?Cal,?c,??Cal")))] + (match_operand:SI 3 "nonmemory_operand" "0,r,Csz")))] "" - "add%z2%? %0,%3,%1%&" + "add%z2%?\\t%0,%3,%1%&" [(set_attr "type" "shift") - (set_attr "length" "*,4,4,8,4,8") - (set_attr "predicable" "yes,yes,no,no,no,no") - (set_attr "cond" "canuse,canuse,nocond,nocond,nocond,nocond") - (set_attr "iscompact" "maybe,false,false,false,false,false")]) + (set_attr "length" "*,4,8") + (set_attr "predicable" "yes,no,no") + (set_attr "cond" "canuse,nocond,nocond") + (set_attr "iscompact" "maybe,false,false")]) ;; N.B. sub[123] has the operands of the MINUS in the opposite order from ;; what synth_mult likes. @@ -3613,7 +3600,7 @@ archs4x, archs4xd, archs4xd_slow" ; provide one alternatice for this, without condexec support. (define_insn "*ashlsi3_insn" [(set (match_operand:SI 0 "dest_reg_operand" "=Rcq,Rcqq,Rcqq,Rcw, w, w") - (ashift:SI (match_operand:SI 1 "nonmemory_operand" "!0,Rcqq, 0, 0, c,cCal") + (ashift:SI (match_operand:SI 1 "nonmemory_operand" "!0,Rcqq, 0, 0, c,cCsz") (match_operand:SI 2 "nonmemory_operand" "K, K,RcqqM, cL,cL,cCal")))] "TARGET_BARREL_SHIFTER && (register_operand (operands[1], SImode) @@ -3626,7 +3613,7 @@ archs4x, archs4xd, archs4xd_slow" (define_insn "*ashrsi3_insn" [(set (match_operand:SI 0 "dest_reg_operand" "=Rcq,Rcqq,Rcqq,Rcw, w, w") - (ashiftrt:SI (match_operand:SI 1 "nonmemory_operand" "!0,Rcqq, 0, 0, c,cCal") + (ashiftrt:SI (match_operand:SI 1 "nonmemory_operand" "!0,Rcqq, 0, 0, c,cCsz") (match_operand:SI 2 "nonmemory_operand" "K, K,RcqqM, cL,cL,cCal")))] "TARGET_BARREL_SHIFTER && (register_operand (operands[1], SImode) @@ -3653,7 +3640,7 @@ archs4x, archs4xd, archs4xd_slow" (define_insn "rotrsi3" [(set (match_operand:SI 0 "dest_reg_operand" "=Rcw, w, w") - (rotatert:SI (match_operand:SI 1 "register_operand" " 0,cL,cCal") + (rotatert:SI (match_operand:SI 1 "register_operand" " 0,cL,cCsz") (match_operand:SI 2 "nonmemory_operand" "cL,cL,cCal")))] "TARGET_BARREL_SHIFTER" "ror%? %0,%1,%2" @@ -4494,16 +4481,16 @@ archs4x, archs4xd, archs4xd_slow" (define_peephole2 [(set (match_operand:SI 0 "dest_reg_operand" "") (ashift:SI (match_operand:SI 1 "register_operand" "") - (match_operand:SI 2 "const_int_operand" ""))) + (match_operand:SI 2 "_1_2_3_operand" ""))) (set (match_operand:SI 3 "dest_reg_operand" "") (plus:SI (match_operand:SI 4 "nonmemory_operand" "") (match_operand:SI 5 "nonmemory_operand" "")))] - "(INTVAL (operands[2]) == 1 - || INTVAL (operands[2]) == 2 - || INTVAL (operands[2]) == 3) - && (true_regnum (operands[4]) == true_regnum (operands[0]) + "(true_regnum (operands[4]) == true_regnum (operands[0]) || true_regnum (operands[5]) == true_regnum (operands[0])) - && (peep2_reg_dead_p (2, operands[0]) || (true_regnum (operands[3]) == true_regnum (operands[0])))" + && (peep2_reg_dead_p (2, operands[0]) + || (true_regnum (operands[3]) == true_regnum (operands[0]))) + && !(optimize_size && satisfies_constraint_I (operands[4])) + && !(optimize_size && satisfies_constraint_I (operands[5]))" ;; the preparation statements take care to put proper operand in operands[4] ;; operands[4] will always contain the correct operand. This is added to satisfy commutativity [(set (match_dup 3) @@ -6560,7 +6547,7 @@ archs4x, archs4xd, archs4xd_slow" [(set (match_operand:SI 0 "register_operand" "=q,r,r") (plus:SI (ashift:SI (match_operand:SI 1 "register_operand" "q,r,r") (match_operand:SI 2 "_1_2_3_operand" "")) - (match_operand:SI 3 "nonmemory_operand" "0,r,Cal")))] + (match_operand:SI 3 "nonmemory_operand" "0,r,Csz")))] "" "add%2%?\\t%0,%3,%1" [(set_attr "length" "*,4,8") diff --git a/gcc/config/arc/constraints.md b/gcc/config/arc/constraints.md index 61b1d3f..cbb3124 100644 --- a/gcc/config/arc/constraints.md +++ b/gcc/config/arc/constraints.md @@ -435,6 +435,12 @@ && !arc_legitimate_pic_addr_p (op) && !satisfies_constraint_I (op)")) +(define_constraint "Csz" + "a 32 bit constant avoided when compiling for size." + (match_test "immediate_operand (op, VOIDmode) + && !arc_legitimate_pic_addr_p (op) + && !(satisfies_constraint_I (op) && optimize_size)")) + ; Note that the 'cryptic' register constraints will not make reload use the ; associated class to reload into, but this will not penalize reloading of any ; other operands, or using an alternate part of the same alternative. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fe679c6..7e73af7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2018-10-01 Claudiu Zissulescu + * gcc.target/arc/tph_addx.c: New test. + +2018-10-01 Claudiu Zissulescu + * gcc.target/arc/tmac-3.c: New file. 2018-09-30 Paul Thomas diff --git a/gcc/testsuite/gcc.target/arc/tph_addx.c b/gcc/testsuite/gcc.target/arc/tph_addx.c new file mode 100644 index 0000000..f942ab1 --- /dev/null +++ b/gcc/testsuite/gcc.target/arc/tph_addx.c @@ -0,0 +1,53 @@ +/* { dg-do compile } */ +/* { dg-options "-Os" } */ + +/* when compiling for size avoid the following peephole +------------------------------------------------------------- +Pattern 1 : r0 = r1 << {i} + r3 = r4/INT + r0 ;;and commutative + || + \/ + add{i} r3,r4/INT,r1 +------------------------------------------------------------- +*/ + +typedef int a; +typedef int b ; +struct c +{ + b d; +}; + +struct e +{ + a f; +}; + +int g(int family) +{ + switch (family) + case 2: + return sizeof(struct e); + return 0; +} + +int h(int family) +{ + return 1 + g(family) - 1 ; +} + +extern void m (void); + +int i(int j) +{ + struct c *hdr; + int k; + int l; + k = h(j); + l = sizeof(struct c) + k * 2; + hdr->d = l ; + if (j) + m(); +} + +/* { dg-final { scan-assembler-not "add\d" } } */ -- cgit v1.1 From 6cc430c19a9c94835d31f171065f32f5b1863183 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 1 Oct 2018 09:39:28 +0000 Subject: c-ada-spec.c (get_underlying_decl): Get to the main type variant. * c-ada-spec.c (get_underlying_decl): Get to the main type variant. (dump_ada_node): Add const keyword. From-SVN: r264738 --- gcc/c-family/ChangeLog | 5 +++++ gcc/c-family/c-ada-spec.c | 19 ++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'gcc') diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 3b3b987..015ca8a 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2018-10-01 Eric Botcazou + + * c-ada-spec.c (get_underlying_decl): Get to the main type variant. + (dump_ada_node): Add const keyword. + 2018-09-25 Martin Liska * c-common.c (c_common_truthvalue_conversion): diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index eae741e..2e1b91e 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -1020,13 +1020,18 @@ get_underlying_decl (tree type) if (DECL_P (type)) return type; - /* type is a typedef. */ - if (TYPE_P (type) && TYPE_NAME (type) && DECL_P (TYPE_NAME (type))) - return TYPE_NAME (type); + if (TYPE_P (type)) + { + type = TYPE_MAIN_VARIANT (type); + + /* type is a typedef. */ + if (TYPE_NAME (type) && DECL_P (TYPE_NAME (type))) + return TYPE_NAME (type); - /* TYPE_STUB_DECL has been set for type. */ - if (TYPE_P (type) && TYPE_STUB_DECL (type)) - return TYPE_STUB_DECL (type); + /* TYPE_STUB_DECL has been set for type. */ + if (TYPE_STUB_DECL (type)) + return TYPE_STUB_DECL (type); + } return NULL_TREE; } @@ -2143,8 +2148,8 @@ dump_ada_node (pretty_printer *buffer, tree node, tree type, int spc, } else { + const unsigned int quals = TYPE_QUALS (TREE_TYPE (node)); bool is_access = false; - unsigned int quals = TYPE_QUALS (TREE_TYPE (node)); if (VOID_TYPE_P (TREE_TYPE (node))) { -- cgit v1.1 From 03cc70b5f1999fe04354c0ba2227fce733308ad4 Mon Sep 17 00:00:00 2001 From: MCC CS Date: Mon, 1 Oct 2018 11:25:45 +0000 Subject: re PR tree-optimization/87261 (Optimize bool expressions) 2018-10-01 MCC CS PR tree-optimization/87261 * match.pd: Remove trailing whitespace. Add (x & y) | ~(x | y) -> ~(x ^ y), (~x | y) ^ (x ^ y) -> x | ~y and (x ^ y) | ~(x | y) -> ~(x & y) * gcc.dg/pr87261.c: New test. From-SVN: r264744 --- gcc/ChangeLog | 7 ++++++ gcc/match.pd | 49 +++++++++++++++++++++++++++++++----------- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr87261.c | 35 ++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 12 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr87261.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5214064..70bfeb6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-10-01 MCC CS + + PR tree-optimization/87261 + * match.pd: Remove trailing whitespace. + Add (x & y) | ~(x | y) -> ~(x ^ y), + (~x | y) ^ (x ^ y) -> x | ~y and (x ^ y) | ~(x | y) -> ~(x & y) + 2018-10-01 Claudiu Zissulescu * config/arc/arc.md (*add_n): Clean up pattern, update instruction diff --git a/gcc/match.pd b/gcc/match.pd index ae26ec2..db0e4a8 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -92,7 +92,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) IFN_FMA IFN_FMS IFN_FNMA IFN_FNMS) (define_operator_list COND_TERNARY IFN_COND_FMA IFN_COND_FMS IFN_COND_FNMA IFN_COND_FNMS) - + /* As opposed to convert?, this still creates a single pattern, so it is not a suitable replacement for convert? in all cases. */ (match (nop_convert @0) @@ -106,7 +106,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) && tree_nop_conversion_p (TREE_TYPE (type), TREE_TYPE (TREE_TYPE (@0)))))) /* This one has to be last, or it shadows the others. */ (match (nop_convert @0) - @0) + @0) /* Transform likes of (char) ABS_EXPR <(int) x> into (char) ABSU_EXPR ABSU_EXPR returns unsigned absolute value of the operand and the operand @@ -285,7 +285,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) And not for _Fract types where we can't build 1. */ (if (!integer_zerop (@0) && !ALL_FRACT_MODE_P (TYPE_MODE (type))) { build_one_cst (type); })) - /* X / abs (X) is X < 0 ? -1 : 1. */ + /* X / abs (X) is X < 0 ? -1 : 1. */ (simplify (div:C @0 (abs @0)) (if (INTEGRAL_TYPE_P (type) @@ -929,6 +929,31 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (bitop:c @0 (bit_not (bitop:cs @0 @1))) (bitop @0 (bit_not @1)))) +/* (~x & y) | ~(x | y) -> ~x */ +(simplify + (bit_ior:c (bit_and:c (bit_not@2 @0) @1) (bit_not (bit_ior:c @0 @1))) + @2) + +/* (x | y) ^ (x | ~y) -> ~x */ +(simplify + (bit_xor:c (bit_ior:c @0 @1) (bit_ior:c @0 (bit_not @1))) + (bit_not @0)) + +/* (x & y) | ~(x | y) -> ~(x ^ y) */ +(simplify + (bit_ior:c (bit_and:s @0 @1) (bit_not:s (bit_ior:s @0 @1))) + (bit_not (bit_xor @0 @1))) + +/* (~x | y) ^ (x ^ y) -> x | ~y */ +(simplify + (bit_xor:c (bit_ior:cs (bit_not @0) @1) (bit_xor:s @0 @1)) + (bit_ior @0 (bit_not @1))) + +/* (x ^ y) | ~(x | y) -> ~(x & y) */ +(simplify + (bit_ior:c (bit_xor:s @0 @1) (bit_not:s (bit_ior:s @0 @1))) + (bit_not (bit_and @0 @1))) + /* (x | y) & ~x -> y & ~x */ /* (x & y) | ~x -> y | ~x */ (for bitop (bit_and bit_ior) @@ -1139,7 +1164,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (if (tree_nop_conversion_p (type, TREE_TYPE (@0)) && tree_nop_conversion_p (type, TREE_TYPE (@1))) (mult (convert @0) (convert (negate @1))))) - + /* -(A + B) -> (-B) - A. */ (simplify (negate (plus:c @0 negate_expr_p@1)) @@ -3099,7 +3124,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (if (tree_int_cst_sgn (@1) < 0) (scmp @0 @2) (cmp @0 @2)))))) - + /* Simplify comparison of something with itself. For IEEE floating-point, we can only do some of these simplifications. */ (for cmp (eq ge le) @@ -3170,11 +3195,11 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) } tree newtype = (TYPE_PRECISION (TREE_TYPE (@0)) > TYPE_PRECISION (type1) - ? TREE_TYPE (@0) : type1); + ? TREE_TYPE (@0) : type1); } (if (TYPE_PRECISION (TREE_TYPE (@2)) > TYPE_PRECISION (newtype)) (cmp (convert:newtype @0) (convert:newtype @1)))))) - + (simplify (cmp @0 REAL_CST@1) /* IEEE doesn't distinguish +0 and -0 in comparisons. */ @@ -3422,7 +3447,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (FTYPE) N == CST -> 0 (FTYPE) N != CST -> 1. */ (if (cmp == EQ_EXPR || cmp == NE_EXPR) - { constant_boolean_node (cmp == NE_EXPR, type); }) + { constant_boolean_node (cmp == NE_EXPR, type); }) /* Otherwise replace with sensible integer constant. */ (with { @@ -3666,7 +3691,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (simplify (cmp (bit_and@2 @0 integer_pow2p@1) @1) (icmp @2 { build_zero_cst (TREE_TYPE (@0)); }))) - + /* If we have (A & C) != 0 ? D : 0 where C and D are powers of 2, convert this into a shift followed by ANDing with D. */ (simplify @@ -3886,7 +3911,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (if (cmp == LE_EXPR) (ge (convert:st @0) { build_zero_cst (st); }) (lt (convert:st @0) { build_zero_cst (st); })))))))))) - + (for cmp (unordered ordered unlt unle ungt unge uneq ltgt) /* If the second operand is NaN, the result is constant. */ (simplify @@ -4540,7 +4565,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (if (wi::to_wide (@1) == -1) (rdiv { build_real (type, dconst1); } @0)))) -/* Narrowing of arithmetic and logical operations. +/* Narrowing of arithmetic and logical operations. These are conceptually similar to the transformations performed for the C/C++ front-ends by shorten_binary_op and shorten_compare. Long @@ -4612,7 +4637,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (convert (bit_and (op (convert:utype @0) (convert:utype @1)) (convert:utype @4)))))))) -/* Transform (@0 < @1 and @0 < @2) to use min, +/* Transform (@0 < @1 and @0 < @2) to use min, (@0 > @1 and @0 > @2) to use max */ (for logic (bit_and bit_and bit_and bit_and bit_ior bit_ior bit_ior bit_ior) op (lt le gt ge lt le gt ge ) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7e73af7..5dbb34e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-10-01 MCC CS + + PR tree-optimization/87261 + * gcc.dg/pr87261.c: New test. + 2018-10-01 Claudiu Zissulescu * gcc.target/arc/tph_addx.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr87261.c b/gcc/testsuite/gcc.dg/pr87261.c new file mode 100644 index 0000000..9b10d03 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr87261.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-original" } */ + +int f1 (int a, int b) +{ + return ~(a|b)|(~a&b); +} + +int f2 (int a, int b) +{ + return (a|b)^(a|~b); +} + +/* { dg-final { scan-tree-dump-times "return \\~a;" 2 "original" } } */ + +int f3 (int a, int b) +{ + return ~(a|b)|(a&b); +} + +/* { dg-final { scan-tree-dump "return \\~\\(a \\^ b\\);" "original" } } */ + +int f4 (int a, int b) +{ + return a^b^(~a|b); +} + +/* { dg-final { scan-tree-dump "return \\~b \\| a;" "original" } } */ + +int f5 (int a, int b) +{ + return (a^b)|~(a|b); +} + +/* { dg-final { scan-tree-dump "return \\~\\(a \\& b\\);" "original" } } */ -- cgit v1.1 From 041bfa6f07787752743e8c32c7a75a47015ba65a Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Mon, 1 Oct 2018 12:34:05 +0000 Subject: Fix caching of tests for multiple variant runs and update existing target-supports tests. Currently some target supports checks such as vect_int cache their results in a manner that would cause them not to be rechecked when running the same tests against a different variant in a multi variant run. This causes tests to be skipped or run when they shouldn't be. there is already an existing caching mechanism in place that does the caching correctly, but presumably these weren't used because some of these tests originally only contained static data. e.g. only checked if the target is aarch64*-*-* etc. This patch changes every function that needs to do any caching at all to use check_cached_effective_target which will cache per variant instead of globally. For those tests that already parameterize over et_index I have created check_cached_effective_target_indexed to handle this common case by creating a list containing the property name and the current value of et_index. These changes result in a much simpler implementation for most tests and a large reduction in lines for target-supports.exp. Regtested on aarch64-none-elf x86_64-pc-linux-gnu powerpc64-unknown-linux-gnu arm-none-eabi and no testsuite errors. Difference would depend on your site.exp. On arm we get about 4500 new testcases and on aarch64 the low 10s. On PowerPC and x86_64 no changes as expected since the default exp for these just test the default configuration. What this means for new target checks is that they should always use either check_cached_effective_target or check_cached_effective_target_indexed if the result of the check is to be cached. As an example the new vect_int looks like proc check_effective_target_vect_int { } { return [check_cached_effective_target_indexed { expr { }}] } The debug information that was once there is now all hidden in check_cached_effective_target, (called from check_cached_effective_target_indexed) and so the only thing you are required to do is give it a unique cache name and a condition. The condition doesn't need to be an if statement so simple boolean expressions are enough here: [istarget i?86-*-*] || [istarget x86_64-*-*] || ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) || ... From-SVN: r264745 --- gcc/testsuite/ChangeLog | 87 ++ gcc/testsuite/lib/target-supports.exp | 1613 +++++++-------------------------- 2 files changed, 421 insertions(+), 1279 deletions(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5dbb34e..20db918 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,90 @@ +2018-10-01 Tamar Christina + + * lib/target-supports.exp (check_cached_effective_target_indexed): New. + (check_cached_effective_target, clear_effective_target_cache): Cleanup. + (check_compile): Support values already Boolean. + (check_alias_available, check_gc_sections_available, + check_profiling_available, check_effective_target_vect_cmdline_needed, + check_effective_target_vect_int, + check_effective_target_vect_intfloat_cvt, + check_effective_target_vect_doubleint_cvt, + check_effective_target_vect_intdouble_cvt, + check_effective_target_vect_uintfloat_cvt, + check_effective_target_vect_floatint_cvt, + check_effective_target_vect_floatuint_cvt, + check_effective_target_vect_peeling_profitable, + check_effective_target_vect_simd_clones, + check_effective_target_vect_peeling_profitable, + check_effective_target_vect_simd_clones, + check_effective_target_vect_shift, + check_effective_target_vect_bswap, + check_effective_target_vect_shift_char, + check_effective_target_vect_float, + check_effective_target_vect_double, + check_effective_target_vect_long_long, + check_effective_target_vect_no_int_min_max, + check_effective_target_vect_no_int_add, + check_effective_target_vect_no_bitwise, + check_effective_target_vect_perm, + check_effective_target_vect_perm_byte, + check_effective_target_vect_perm_short, + check_effective_target_xorsign, + check_effective_target_vect_widen_sum_hi_to_si_pattern, + check_effective_target_vect_widen_sum_hi_to_si, + check_effective_target_vect_widen_sum_qi_to_hi, + check_effective_target_vect_widen_sum_qi_to_si, + check_effective_target_vect_widen_mult_qi_to_hi, + check_effective_target_vect_widen_mult_hi_to_si, + check_effective_target_vect_widen_mult_qi_to_hi_pattern, + check_effective_target_vect_widen_mult_hi_to_si_pattern, + check_effective_target_vect_widen_mult_si_to_di_pattern, + check_effective_target_vect_widen_shift, + check_effective_target_vect_sdot_qi, + check_effective_target_vect_udot_qi, + check_effective_target_vect_sdot_hi, + check_effective_target_vect_udot_hi, + check_effective_target_vect_usad_char, + check_effective_target_vect_pack_trunc, + check_effective_target_vect_unpack, + check_effective_target_unaligned_stack, + check_effective_target_vect_no_align, + check_effective_target_vect_hw_misalign, + check_effective_target_natural_alignment_32, + check_effective_target_natural_alignment_64, + check_effective_target_vect_element_align, + check_effective_target_vect_load_lanes **, + check_effective_target_vect_condition, + check_effective_target_vect_cond_mixed, + check_effective_target_vect_char_mult, + check_effective_target_vect_short_mult, + check_effective_target_vect_int_mult, + check_effective_target_vect_extract_even_odd, + check_effective_target_vect_interleave, + check_effective_target_vect_stridedN, + check_effective_target_vect_call_copysignf, + check_effective_target_sqrt_insn, + check_effective_target_vect_call_sqrtf, + check_effective_target_vect_call_btrunc, + check_effective_target_vect_call_btruncf, + check_effective_target_vect_call_ceil, + check_effective_target_vect_call_ceilf, + check_effective_target_vect_call_floor, + check_effective_target_vect_call_floorf, + check_effective_target_vect_call_lceil, + check_effective_target_vect_call_lfloor, + check_effective_target_vect_call_nearbyint, + check_effective_target_vect_call_nearbyintf, + check_effective_target_vect_call_round, + check_effective_target_vect_call_roundf, + check_effective_target_section_anchors, + check_effective_target_bswap, + check_effective_target_sync_int_long, + check_effective_target_sync_char_short, + check_effective_target_tiny, + check_effective_target_pie_copyreloc, + check_effective_target_got32x_reloc, + check_effective_target_tls_get_addr_via_got): Use new caching. + 2018-10-01 MCC CS PR tree-optimization/87261 diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 57bfe9c..2e2c651 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -37,6 +37,7 @@ # and "// Go" for Go # If the tool is ObjC/ObjC++ then we overide the extension to .m/.mm to # allow for ObjC/ObjC++ specific flags. + proc check_compile {basename type contents args} { global tool verbose "check_compile tool: $tool for $basename" @@ -117,25 +118,35 @@ proc current_target_name { } { proc check_cached_effective_target { prop args } { global et_cache - global et_prop_list set target [current_target_name] - if {![info exists et_cache($prop,target)] - || $et_cache($prop,target) != $target} { + if {![info exists et_cache($prop,$target)]} { verbose "check_cached_effective_target $prop: checking $target" 2 - set et_cache($prop,target) $target - set et_cache($prop,value) [uplevel eval $args] - if {![info exists et_prop_list] - || [lsearch $et_prop_list $prop] < 0} { - lappend et_prop_list $prop + if {[string is true -strict $args] || [string is false -strict $args]} { + error {check_cached_effective_target condition already evaluated; did you pass [...] instead of the expected {...}?} + } else { + set code [catch {uplevel eval $args} result] + if {$code != 0 && $code != 2} { + return -code $code $result + } + set et_cache($prop,$target) $result } - verbose "check_cached_effective_target cached list is now: $et_prop_list" 2 } - set value $et_cache($prop,value) + set value $et_cache($prop,$target) verbose "check_cached_effective_target $prop: returning $value for $target" 2 return $value } +# Implements a version of check_cached_effective_target that also takes et_index +# into account when creating the key for the cache. +proc check_cached_effective_target_indexed { prop args } { + global et_index + set key "$et_index $prop" + verbose "check_cached_effective_target_index $prop: returning $key" 2 + + return [check_cached_effective_target $key [list uplevel eval $args]] +} + # Clear effective-target cache. This is useful after testing # effective-target features and overriding TEST_ALWAYS_FLAGS and/or # ALWAYS_CXXFLAGS. @@ -147,16 +158,7 @@ proc check_cached_effective_target { prop args } { proc clear_effective_target_cache { } { global et_cache - global et_prop_list - - if {[info exists et_prop_list]} { - verbose "clear_effective_target_cache: $et_prop_list" 2 - foreach prop $et_prop_list { - unset et_cache($prop,value) - unset et_cache($prop,target) - } - unset et_prop_list - } + array unset et_cache } # Like check_compile, but delete the output file and return true if the @@ -380,12 +382,9 @@ proc check_visibility_available { what_kind } { # be determined. proc check_alias_available { } { - global alias_available_saved global tool - if [info exists alias_available_saved] { - verbose "check_alias_available returning saved $alias_available_saved" 2 - } else { + return [check_cached_effective_target alias_available { set src alias[pid].c set obj alias[pid].o verbose "check_alias_available compiling testfile $src" 2 @@ -402,7 +401,7 @@ proc check_alias_available { } { if [string match "" $lines] then { # No error messages, everything is OK. - set alias_available_saved 2 + return 2 } else { if [regexp "alias definitions not supported" $lines] { verbose "check_alias_available target does not support aliases" 2 @@ -411,24 +410,20 @@ proc check_alias_available { } { if { $objformat == "elf" } { verbose "check_alias_available but target uses ELF format, so it ought to" 2 - set alias_available_saved -1 + return -1 } else { - set alias_available_saved 0 + return 0 } } else { if [regexp "only weak aliases are supported" $lines] { verbose "check_alias_available target supports only weak aliases" 2 - set alias_available_saved 1 + return 1 } else { - set alias_available_saved -1 + return -1 } } } - - verbose "check_alias_available returning $alias_available_saved" 2 - } - - return $alias_available_saved + }] } # Returns 1 if the target toolchain supports strong aliases, 0 otherwise. @@ -461,15 +456,13 @@ proc check_ifunc_available { } { # Returns true if --gc-sections is supported on the target. proc check_gc_sections_available { } { - global gc_sections_available_saved global tool - if {![info exists gc_sections_available_saved]} { + return [check_cached_effective_target gc_sections_available { # Some targets don't support gc-sections despite whatever's # advertised by ld's options. if { [istarget alpha*-*-*] || [istarget ia64-*-*] } { - set gc_sections_available_saved 0 return 0 } @@ -477,7 +470,6 @@ proc check_gc_sections_available { } { # --gc-sections. if { [board_info target exists ldflags] && [regexp " -elf2flt\[ =\]" " [board_info target ldflags] "] } { - set gc_sections_available_saved 0 return 0 } @@ -485,7 +477,6 @@ proc check_gc_sections_available { } { # while RTP executables are linked with -q (--emit-relocs). # Both of these options are incompatible with --gc-sections. if { [istarget *-*-vxworks*] } { - set gc_sections_available_saved 0 return 0 } @@ -493,12 +484,11 @@ proc check_gc_sections_available { } { set gcc_ld [lindex [${tool}_target_compile "-print-prog-name=ld" "" "none" ""] 0] set ld_output [remote_exec host "$gcc_ld" "--help"] if { [ string first "--gc-sections" $ld_output ] >= 0 } { - set gc_sections_available_saved 1 + return 1 } else { - set gc_sections_available_saved 0 + return 0 } - } - return $gc_sections_available_saved + }] } # Return 1 if according to target_info struct and explicit target list @@ -581,8 +571,6 @@ proc profopt-perf-wrapper { } { # Return true if profiling is supported on the target. proc check_profiling_available { test_what } { - global profiling_available_saved - verbose "Profiling argument is <$test_what>" 1 # These conditions depend on the argument so examine them before @@ -657,7 +645,8 @@ proc check_profiling_available { test_what } { } # Now examine the cache variable. - if {![info exists profiling_available_saved]} { + set profiling_working \ + [check_cached_effective_target profiling_available { # Some targets don't have any implementation of __bb_init_func or are # missing other needed machinery. if {[istarget aarch64*-*-elf] @@ -693,16 +682,15 @@ proc check_profiling_available { test_what } { || [istarget xtensa*-*-elf] || [istarget *-*-rtems*] || [istarget *-*-vxworks*] } { - set profiling_available_saved 0 + return 0 } else { - set profiling_available_saved 1 + return 1 } - } + }] # -pg link test result can't be cached since it may change between # runs. - set profiling_working $profiling_available_saved - if { $profiling_available_saved == 1 + if { $profiling_working == 1 && ![check_no_compiler_messages_nocache profiling executable { int main() { return 0; } } "-pg"] } { set profiling_working 0 @@ -3045,7 +3033,6 @@ proc check_effective_target_ucn { } { # instruction set. proc check_effective_target_vect_cmdline_needed { } { - global et_vect_cmdline_needed_saved global et_vect_cmdline_needed_target_name if { ![info exists et_vect_cmdline_needed_target_name] } { @@ -3063,10 +3050,7 @@ proc check_effective_target_vect_cmdline_needed { } { } } - if [info exists et_vect_cmdline_needed_saved] { - verbose "check_effective_target_vect_cmdline_needed: using cached result" 2 - } else { - set et_vect_cmdline_needed_saved 1 + return [check_cached_effective_target vect_cmdline_needed { if { [istarget alpha*-*-*] || [istarget ia64-*-*] || (([istarget i?86-*-*] || [istarget x86_64-*-*]) @@ -3078,12 +3062,10 @@ proc check_effective_target_vect_cmdline_needed { } { || [istarget spu-*-*] || ([istarget arm*-*-*] && [check_effective_target_arm_neon]) || [istarget aarch64*-*-*] } { - set et_vect_cmdline_needed_saved 0 - } - } - - verbose "check_effective_target_vect_cmdline_needed: returning $et_vect_cmdline_needed_saved" 2 - return $et_vect_cmdline_needed_saved + return 0 + } else { + return 1 + }}] } # Return 1 if the target supports hardware vectors of int, 0 otherwise. @@ -3091,106 +3073,62 @@ proc check_effective_target_vect_cmdline_needed { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_int { } { - global et_vect_int_saved - global et_index - - if [info exists et_vect_int_saved($et_index)] { - verbose "check_effective_target_vect_int: using cached result" 2 - } else { - set et_vect_int_saved($et_index) 0 - if { [istarget i?86-*-*] || [istarget x86_64-*-*] - || ([istarget powerpc*-*-*] - && ![istarget powerpc-*-linux*paired*]) - || [istarget spu-*-*] - || [istarget sparc*-*-*] - || [istarget alpha*-*-*] - || [istarget ia64-*-*] - || [istarget aarch64*-*-*] - || [is-effective-target arm_neon] - || ([istarget mips*-*-*] - && ([et-is-effective-target mips_loongson] - || [et-is-effective-target mips_msa])) - || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_int_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_int:\ - returning $et_vect_int_saved($et_index)" 2 - return $et_vect_int_saved($et_index) + return [check_cached_effective_target_indexed vect_int { + expr { + [istarget i?86-*-*] || [istarget x86_64-*-*] + || ([istarget powerpc*-*-*] + && ![istarget powerpc-*-linux*paired*]) + || [istarget spu-*-*] + || [istarget sparc*-*-*] + || [istarget alpha*-*-*] + || [istarget ia64-*-*] + || [istarget aarch64*-*-*] + || [is-effective-target arm_neon] + || ([istarget mips*-*-*] + && ([et-is-effective-target mips_loongson] + || [et-is-effective-target mips_msa])) + || ([istarget s390*-*-*] + && [check_effective_target_s390_vx]) + }}] } # Return 1 if the target supports signed int->float conversion # proc check_effective_target_vect_intfloat_cvt { } { - global et_vect_intfloat_cvt_saved - global et_index - - if [info exists et_vect_intfloat_cvt_saved($et_index)] { - verbose "check_effective_target_vect_intfloat_cvt:\ - using cached result" 2 - } else { - set et_vect_intfloat_cvt_saved($et_index) 0 - if { [istarget i?86-*-*] || [istarget x86_64-*-*] + return [check_cached_effective_target_indexed vect_intfloat_cvt { + expr { [istarget i?86-*-*] || [istarget x86_64-*-*] || ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) || [is-effective-target arm_neon] || ([istarget mips*-*-*] - && [et-is-effective-target mips_msa]) } { - set et_vect_intfloat_cvt_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_intfloat_cvt:\ - returning $et_vect_intfloat_cvt_saved($et_index)" 2 - return $et_vect_intfloat_cvt_saved($et_index) + && [et-is-effective-target mips_msa]) }}] } # Return 1 if the target supports signed double->int conversion # proc check_effective_target_vect_doubleint_cvt { } { - global et_vect_doubleint_cvt_saved - global et_index - - if [info exists et_vect_doubleint_cvt_saved($et_index)] { - verbose "check_effective_target_vect_doubleint_cvt: using cached result" 2 - } else { - set et_vect_doubleint_cvt_saved($et_index) 0 - if { (([istarget i?86-*-*] || [istarget x86_64-*-*]) - && [check_no_compiler_messages vect_doubleint_cvt assembly { - #ifdef __tune_atom__ - # error No double vectorizer support. - #endif + return [check_cached_effective_target_indexed vect_doubleint_cvt { + expr { (([istarget i?86-*-*] || [istarget x86_64-*-*]) + && [check_no_compiler_messages vect_doubleint_cvt assembly { + #ifdef __tune_atom__ + # error No double vectorizer support. + #endif }]) - || [istarget aarch64*-*-*] - || [istarget spu-*-*] - || ([istarget powerpc*-*-*] && [check_vsx_hw_available]) - || ([istarget mips*-*-*] - && [et-is-effective-target mips_msa]) } { - set et_vect_doubleint_cvt_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_doubleint_cvt:\ - returning $et_vect_doubleint_cvt_saved($et_index)" 2 - return $et_vect_doubleint_cvt_saved($et_index) + || [istarget aarch64*-*-*] + || [istarget spu-*-*] + || ([istarget powerpc*-*-*] && [check_vsx_hw_available]) + || ([istarget mips*-*-*] + && [et-is-effective-target mips_msa]) }}] } # Return 1 if the target supports signed int->double conversion # proc check_effective_target_vect_intdouble_cvt { } { - global et_vect_intdouble_cvt_saved - global et_index - - if [info exists et_vect_intdouble_cvt_saved($et_index)] { - verbose "check_effective_target_vect_intdouble_cvt: using cached result" 2 - } else { - set et_vect_intdouble_cvt_saved($et_index) 0 - if { (([istarget i?86-*-*] || [istarget x86_64-*-*]) + return [check_cached_effective_target_indexed vect_intdouble_cvt { + expr { (([istarget i?86-*-*] || [istarget x86_64-*-*]) && [check_no_compiler_messages vect_intdouble_cvt assembly { #ifdef __tune_atom__ # error No double vectorizer support. @@ -3200,14 +3138,7 @@ proc check_effective_target_vect_intdouble_cvt { } { || [istarget spu-*-*] || ([istarget powerpc*-*-*] && [check_vsx_hw_available]) || ([istarget mips*-*-*] - && [et-is-effective-target mips_msa]) } { - set et_vect_intdouble_cvt_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_intdouble_cvt:\ - returning $et_vect_intdouble_cvt_saved($et_index)" 2 - return $et_vect_intdouble_cvt_saved($et_index) + && [et-is-effective-target mips_msa]) }}] } #Return 1 if we're supporting __int128 for target, 0 otherwise. @@ -3228,28 +3159,14 @@ proc check_effective_target_int128 { } { # proc check_effective_target_vect_uintfloat_cvt { } { - global et_vect_uintfloat_cvt_saved - global et_index - - if [info exists et_vect_uintfloat_cvt_saved($et_index)] { - verbose "check_effective_target_vect_uintfloat_cvt:\ - using cached result" 2 - } else { - set et_vect_uintfloat_cvt_saved($et_index) 0 - if { [istarget i?86-*-*] || [istarget x86_64-*-*] + return [check_cached_effective_target_indexed vect_uintfloat_cvt { + expr { [istarget i?86-*-*] || [istarget x86_64-*-*] || ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) || [istarget aarch64*-*-*] || [is-effective-target arm_neon] || ([istarget mips*-*-*] - && [et-is-effective-target mips_msa]) } { - set et_vect_uintfloat_cvt_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_uintfloat_cvt:\ - returning $et_vect_uintfloat_cvt_saved($et_index)" 2 - return $et_vect_uintfloat_cvt_saved($et_index) + && [et-is-effective-target mips_msa]) }}] } @@ -3257,76 +3174,35 @@ proc check_effective_target_vect_uintfloat_cvt { } { # proc check_effective_target_vect_floatint_cvt { } { - global et_vect_floatint_cvt_saved - global et_index - - if [info exists et_vect_floatint_cvt_saved($et_index)] { - verbose "check_effective_target_vect_floatint_cvt:\ - using cached result" 2 - } else { - set et_vect_floatint_cvt_saved($et_index) 0 - if { [istarget i?86-*-*] || [istarget x86_64-*-*] + return [check_cached_effective_target_indexed vect_floatint_cvt { + expr { [istarget i?86-*-*] || [istarget x86_64-*-*] || ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) || [is-effective-target arm_neon] || ([istarget mips*-*-*] - && [et-is-effective-target mips_msa]) } { - set et_vect_floatint_cvt_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_floatint_cvt:\ - returning $et_vect_floatint_cvt_saved($et_index)" 2 - return $et_vect_floatint_cvt_saved($et_index) + && [et-is-effective-target mips_msa]) }}] } # Return 1 if the target supports unsigned float->int conversion # proc check_effective_target_vect_floatuint_cvt { } { - global et_vect_floatuint_cvt_saved - global et_index - - if [info exists et_vect_floatuint_cvt_saved($et_index)] { - verbose "check_effective_target_vect_floatuint_cvt:\ - using cached result" 2 - } else { - set et_vect_floatuint_cvt_saved($et_index) 0 - if { ([istarget powerpc*-*-*] + return [check_cached_effective_target_indexed vect_floatuint_cvt { + expr { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) || [is-effective-target arm_neon] || ([istarget mips*-*-*] - && [et-is-effective-target mips_msa]) } { - set et_vect_floatuint_cvt_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_floatuint_cvt:\ - returning $et_vect_floatuint_cvt_saved($et_index)" 2 - return $et_vect_floatuint_cvt_saved($et_index) + && [et-is-effective-target mips_msa]) }}] } # Return 1 if peeling for alignment might be profitable on the target # proc check_effective_target_vect_peeling_profitable { } { - global et_vect_peeling_profitable_saved - global et_index - - if [info exists et_vect_peeling_profitable_saved($et_index)] { - verbose "check_effective_target_vect_peeling_profitable: using cached result" 2 - } else { - set et_vect_peeling_profitable_saved($et_index) 1 - if { ([istarget s390*-*-*] + return [check_cached_effective_target_indexed vect_peeling_profitable { + expr { ([istarget s390*-*-*] && [check_effective_target_s390_vx]) - || [check_effective_target_vect_element_align_preferred] } { - set et_vect_peeling_profitable_saved($et_index) 0 - } - } - - verbose "check_effective_target_vect_peeling_profitable:\ - returning $et_vect_peeling_profitable_saved($et_index)" 2 - return $et_vect_peeling_profitable_saved($et_index) + || [check_effective_target_vect_element_align_preferred] }}] } # Return 1 if the target supports #pragma omp declare simd, 0 otherwise. @@ -3334,26 +3210,13 @@ proc check_effective_target_vect_peeling_profitable { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_simd_clones { } { - global et_vect_simd_clones_saved - global et_index - - if [info exists et_vect_simd_clones_saved($et_index)] { - verbose "check_effective_target_vect_simd_clones: using cached result" 2 - } else { - set et_vect_simd_clones_saved($et_index) 0 - # On i?86/x86_64 #pragma omp declare simd builds a sse2, avx, - # avx2 and avx512f clone. Only the right clone for the - # specified arch will be chosen, but still we need to at least - # be able to assemble avx512f. - if { (([istarget i?86-*-*] || [istarget x86_64-*-*]) - && [check_effective_target_avx512f]) } { - set et_vect_simd_clones_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_simd_clones:\ - returning $et_vect_simd_clones_saved($et_index)" 2 - return $et_vect_simd_clones_saved($et_index) + # On i?86/x86_64 #pragma omp declare simd builds a sse2, avx, + # avx2 and avx512f clone. Only the right clone for the + # specified arch will be chosen, but still we need to at least + # be able to assemble avx512f. + return [check_cached_effective_target_indexed vect_simd_clones { + expr { (([istarget i?86-*-*] || [istarget x86_64-*-*]) + && [check_effective_target_avx512f]) }}] } # Return 1 if this is a AArch64 target supporting big endian @@ -5439,14 +5302,8 @@ proc check_effective_target_sparc_vis { } { # Return 1 if the target supports hardware vector shift operation. proc check_effective_target_vect_shift { } { - global et_vect_shift_saved - global et_index - - if [info exists et_vect_shift_saved($et_index)] { - verbose "check_effective_target_vect_shift: using cached result" 2 - } else { - set et_vect_shift_saved($et_index) 0 - if { ([istarget powerpc*-*-*] + return [check_cached_effective_target_indexed vect_shift { + expr {([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) || [istarget ia64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*] @@ -5456,14 +5313,7 @@ proc check_effective_target_vect_shift { } { && ([et-is-effective-target mips_msa] || [et-is-effective-target mips_loongson])) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_shift_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_shift:\ - returning $et_vect_shift_saved($et_index)" 2 - return $et_vect_shift_saved($et_index) + && [check_effective_target_s390_vx]) }}] } proc check_effective_target_whole_vector_shift { } { @@ -5489,49 +5339,21 @@ proc check_effective_target_whole_vector_shift { } { # Return 1 if the target supports vector bswap operations. proc check_effective_target_vect_bswap { } { - global et_vect_bswap_saved - global et_index - - if [info exists et_vect_bswap_saved($et_index)] { - verbose "check_effective_target_vect_bswap: using cached result" 2 - } else { - set et_vect_bswap_saved($et_index) 0 - if { [istarget aarch64*-*-*] - || [is-effective-target arm_neon] - } { - set et_vect_bswap_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_bswap:\ - returning $et_vect_bswap_saved($et_index)" 2 - return $et_vect_bswap_saved($et_index) + return [check_cached_effective_target_indexed vect_bswap { + expr { [istarget aarch64*-*-*] || [is-effective-target arm_neon] }}] } # Return 1 if the target supports hardware vector shift operation for char. proc check_effective_target_vect_shift_char { } { - global et_vect_shift_char_saved - global et_index - - if [info exists et_vect_shift_char_saved($et_index)] { - verbose "check_effective_target_vect_shift_char: using cached result" 2 - } else { - set et_vect_shift_char_saved($et_index) 0 - if { ([istarget powerpc*-*-*] + return [check_cached_effective_target_indexed vect_shift_char { + expr { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) || [is-effective-target arm_neon] || ([istarget mips*-*-*] && [et-is-effective-target mips_msa]) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_shift_char_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_shift_char:\ - returning $et_vect_shift_char_saved($et_index)" 2 - return $et_vect_shift_char_saved($et_index) + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target supports hardware vectors of long, 0 otherwise. @@ -5565,14 +5387,8 @@ proc check_effective_target_vect_long { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_float { } { - global et_vect_float_saved - global et_index - - if [info exists et_vect_float_saved($et_index)] { - verbose "check_effective_target_vect_float: using cached result" 2 - } else { - set et_vect_float_saved($et_index) 0 - if { [istarget i?86-*-*] || [istarget x86_64-*-*] + return [check_cached_effective_target_indexed vect_float { + expr { [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget powerpc*-*-*] || [istarget spu-*-*] || [istarget mips-sde-elf] @@ -5583,14 +5399,7 @@ proc check_effective_target_vect_float { } { && [et-is-effective-target mips_msa]) || [is-effective-target arm_neon] || ([istarget s390*-*-*] - && [check_effective_target_s390_vxe]) } { - set et_vect_float_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_float:\ - returning $et_vect_float_saved($et_index)" 2 - return $et_vect_float_saved($et_index) + && [check_effective_target_s390_vxe]) }}] } # Return 1 if the target supports hardware vectors of float without @@ -5606,33 +5415,20 @@ proc check_effective_target_vect_float_strict { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_double { } { - global et_vect_double_saved - global et_index - - if [info exists et_vect_double_saved($et_index)] { - verbose "check_effective_target_vect_double: using cached result" 2 - } else { - set et_vect_double_saved($et_index) 0 - if { (([istarget i?86-*-*] || [istarget x86_64-*-*]) - && [check_no_compiler_messages vect_double assembly { + return [check_cached_effective_target_indexed vect_double { + expr { (([istarget i?86-*-*] || [istarget x86_64-*-*]) + && [check_no_compiler_messages vect_double assembly { #ifdef __tune_atom__ # error No double vectorizer support. #endif - }]) + }]) || [istarget aarch64*-*-*] || [istarget spu-*-*] || ([istarget powerpc*-*-*] && [check_vsx_hw_available]) || ([istarget mips*-*-*] && [et-is-effective-target mips_msa]) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_double_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_double:\ - returning $et_vect_double_saved($et_index)" 2 - return $et_vect_double_saved($et_index) + && [check_effective_target_s390_vx])} }] } # Return 1 if the target supports conditional addition, subtraction, @@ -5648,25 +5444,12 @@ proc check_effective_target_vect_double_cond_arith { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_long_long { } { - global et_vect_long_long_saved - global et_index - - if [info exists et_vect_long_long_saved($et_index)] { - verbose "check_effective_target_vect_long_long: using cached result" 2 - } else { - set et_vect_long_long_saved($et_index) 0 - if { [istarget i?86-*-*] || [istarget x86_64-*-*] + return [check_cached_effective_target_indexed vect_long_long { + expr { [istarget i?86-*-*] || [istarget x86_64-*-*] || ([istarget mips*-*-*] && [et-is-effective-target mips_msa]) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_long_long_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_long_long:\ - returning $et_vect_long_long_saved($et_index)" 2 - return $et_vect_long_long_saved($et_index) + && [check_effective_target_s390_vx]) }}] } @@ -5676,25 +5459,12 @@ proc check_effective_target_vect_long_long { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_no_int_min_max { } { - global et_vect_no_int_min_max_saved - global et_index - - if [info exists et_vect_no_int_min_max_saved($et_index)] { - verbose "check_effective_target_vect_no_int_min_max:\ - using cached result" 2 - } else { - set et_vect_no_int_min_max_saved($et_index) 0 - if { [istarget sparc*-*-*] + return [check_cached_effective_target_indexed vect_no_int_min_max { + expr { [istarget sparc*-*-*] || [istarget spu-*-*] || [istarget alpha*-*-*] || ([istarget mips*-*-*] - && [et-is-effective-target mips_loongson]) } { - set et_vect_no_int_min_max_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_no_int_min_max:\ - returning $et_vect_no_int_min_max_saved($et_index)" 2 - return $et_vect_no_int_min_max_saved($et_index) + && [et-is-effective-target mips_loongson]) }}] } # Return 1 if the target plus current options does not support a vector @@ -5703,21 +5473,9 @@ proc check_effective_target_vect_no_int_min_max { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_no_int_add { } { - global et_vect_no_int_add_saved - global et_index - - if [info exists et_vect_no_int_add_saved($et_index)] { - verbose "check_effective_target_vect_no_int_add: using cached result" 2 - } else { - set et_vect_no_int_add_saved($et_index) 0 - # Alpha only supports vector add on V8QI and V4HI. - if { [istarget alpha*-*-*] } { - set et_vect_no_int_add_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_no_int_add:\ - returning $et_vect_no_int_add_saved($et_index)" 2 - return $et_vect_no_int_add_saved($et_index) + # Alpha only supports vector add on V8QI and V4HI. + return [check_cached_effective_target_indexed vect_no_int_add { + expr { [istarget alpha*-*-*] }}] } # Return 1 if the target plus current options does not support vector @@ -5726,17 +5484,7 @@ proc check_effective_target_vect_no_int_add { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_no_bitwise { } { - global et_vect_no_bitwise_saved - global et_index - - if [info exists et_vect_no_bitwise_saved($et_index)] { - verbose "check_effective_target_vect_no_bitwise: using cached result" 2 - } else { - set et_vect_no_bitwise_saved($et_index) 0 - } - verbose "check_effective_target_vect_no_bitwise:\ - returning $et_vect_no_bitwise_saved($et_index)" 2 - return $et_vect_no_bitwise_saved($et_index) + return [check_cached_effective_target_indexed vect_no_bitwise { return 0 }] } # Return 1 if the target plus current options supports vector permutation, @@ -5745,14 +5493,8 @@ proc check_effective_target_vect_no_bitwise { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_perm { } { - global et_vect_perm_saved - global et_index - - if [info exists et_vect_perm_saved($et_index)] { - verbose "check_effective_target_vect_perm: using cached result" 2 - } else { - set et_vect_perm_saved($et_index) 0 - if { [is-effective-target arm_neon] + return [check_cached_effective_target_indexed vect_perm { + expr { [is-effective-target arm_neon] || [istarget aarch64*-*-*] || [istarget powerpc*-*-*] || [istarget spu-*-*] @@ -5761,13 +5503,7 @@ proc check_effective_target_vect_perm { } { && ([et-is-effective-target mpaired_single] || [et-is-effective-target mips_msa])) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_perm_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_perm:\ - returning $et_vect_perm_saved($et_index)" 2 - return $et_vect_perm_saved($et_index) + && [check_effective_target_s390_vx]) }}] } # Return 1 if, for some VF: @@ -5850,14 +5586,8 @@ proc check_effective_target_vect_perm3_int { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_perm_byte { } { - global et_vect_perm_byte_saved - global et_index - - if [info exists et_vect_perm_byte_saved($et_index)] { - verbose "check_effective_target_vect_perm_byte: using cached result" 2 - } else { - set et_vect_perm_byte_saved($et_index) 0 - if { ([is-effective-target arm_neon] + return [check_cached_effective_target_indexed vect_perm_byte { + expr { ([is-effective-target arm_neon] && [is-effective-target arm_little_endian]) || ([istarget aarch64*-*-*] && [is-effective-target aarch64_little_endian]) @@ -5866,13 +5596,7 @@ proc check_effective_target_vect_perm_byte { } { || ([istarget mips-*.*] && [et-is-effective-target mips_msa]) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_perm_byte_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_perm_byte:\ - returning $et_vect_perm_byte_saved($et_index)" 2 - return $et_vect_perm_byte_saved($et_index) + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target supports SLP permutation of 3 vectors when each @@ -5889,14 +5613,8 @@ proc check_effective_target_vect_perm3_byte { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_perm_short { } { - global et_vect_perm_short_saved - global et_index - - if [info exists et_vect_perm_short_saved($et_index)] { - verbose "check_effective_target_vect_perm_short: using cached result" 2 - } else { - set et_vect_perm_short_saved($et_index) 0 - if { ([is-effective-target arm_neon] + return [check_cached_effective_target_indexed vect_perm_short { + expr { ([is-effective-target arm_neon] && [is-effective-target arm_little_endian]) || ([istarget aarch64*-*-*] && [is-effective-target aarch64_little_endian]) @@ -5907,13 +5625,7 @@ proc check_effective_target_vect_perm_short { } { || ([istarget mips*-*-*] && [et-is-effective-target mips_msa]) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_perm_short_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_perm_short:\ - returning $et_vect_perm_short_saved($et_index)" 2 - return $et_vect_perm_short_saved($et_index) + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target supports SLP permutation of 3 vectors when each @@ -5930,20 +5642,8 @@ proc check_effective_target_vect_perm3_short { } { # This won't change for different subtargets so cache the result. proc check_effective_target_xorsign { } { - global et_xorsign_saved - global et_index - - if [info exists et_xorsign_saved($et_index)] { - verbose "check_effective_target_xorsign: using cached result" 2 - } else { - set et_xorsign_saved($et_index) 0 - if { [istarget aarch64*-*-*] || [istarget arm*-*-*] } { - set et_xorsign_saved($et_index) 1 - } - } - verbose "check_effective_target_xorsign:\ - returning $et_xorsign_saved($et_index)" 2 - return $et_xorsign_saved($et_index) + return [check_cached_effective_target_indexed xorsign { + expr { [istarget aarch64*-*-*] || [istarget arm*-*-*] }}] } # Return 1 if the target plus current options supports a vector @@ -5952,25 +5652,12 @@ proc check_effective_target_xorsign { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_widen_sum_hi_to_si_pattern { } { - global et_vect_widen_sum_hi_to_si_pattern_saved - global et_index - - if [info exists et_vect_widen_sum_hi_to_si_pattern_saved($et_index)] { - verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern:\ - using cached result" 2 - } else { - set et_vect_widen_sum_hi_to_si_pattern_saved($et_index) 0 - if { [istarget powerpc*-*-*] + return [check_cached_effective_target_indexed vect_widen_sum_hi_to_si_pattern { + expr { [istarget powerpc*-*-*] || ([istarget aarch64*-*-*] && ![check_effective_target_aarch64_sve]) || [is-effective-target arm_neon] - || [istarget ia64-*-*] } { - set et_vect_widen_sum_hi_to_si_pattern_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern:\ - returning $et_vect_widen_sum_hi_to_si_pattern_saved($et_index)" 2 - return $et_vect_widen_sum_hi_to_si_pattern_saved($et_index) + || [istarget ia64-*-*] }}] } # Return 1 if the target plus current options supports a vector @@ -5979,25 +5666,12 @@ proc check_effective_target_vect_widen_sum_hi_to_si_pattern { } { # promotion (unpacking) from shorts to ints. # # This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_widen_sum_hi_to_si { } { - global et_vect_widen_sum_hi_to_si_saved - global et_index - if [info exists et_vect_widen_sum_hi_to_si_saved($et_index)] { - verbose "check_effective_target_vect_widen_sum_hi_to_si:\ - using cached result" 2 - } else { - set et_vect_widen_sum_hi_to_si_saved($et_index) \ - [check_effective_target_vect_unpack] - if { [istarget powerpc*-*-*] - || [istarget ia64-*-*] } { - set et_vect_widen_sum_hi_to_si_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_widen_sum_hi_to_si:\ - returning $et_vect_widen_sum_hi_to_si_saved($et_index)" 2 - return $et_vect_widen_sum_hi_to_si_saved($et_index) +proc check_effective_target_vect_widen_sum_hi_to_si { } { + return [check_cached_effective_target_indexed vect_widen_sum_hi_to_si { + expr { [check_effective_target_vect_unpack] + || [istarget powerpc*-*-*] + || [istarget ia64-*-*] }}] } # Return 1 if the target plus current options supports a vector @@ -6008,23 +5682,10 @@ proc check_effective_target_vect_widen_sum_hi_to_si { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_widen_sum_qi_to_hi { } { - global et_vect_widen_sum_qi_to_hi_saved - global et_index - - if [info exists et_vect_widen_sum_qi_to_hi_saved($et_index)] { - verbose "check_effective_target_vect_widen_sum_qi_to_hi:\ - using cached result" 2 - } else { - set et_vect_widen_sum_qi_to_hi_saved($et_index) 0 - if { [check_effective_target_vect_unpack] + return [check_cached_effective_target_indexed vect_widen_sum_qi_to_hi { + expr { [check_effective_target_vect_unpack] || [is-effective-target arm_neon] - || [istarget ia64-*-*] } { - set et_vect_widen_sum_qi_to_hi_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_widen_sum_qi_to_hi:\ - returning $et_vect_widen_sum_qi_to_hi_saved($et_index)" 2 - return $et_vect_widen_sum_qi_to_hi_saved($et_index) + || [istarget ia64-*-*] }}] } # Return 1 if the target plus current options supports a vector @@ -6033,21 +5694,8 @@ proc check_effective_target_vect_widen_sum_qi_to_hi { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_widen_sum_qi_to_si { } { - global et_vect_widen_sum_qi_to_si_saved - global et_index - - if [info exists et_vect_widen_sum_qi_to_si_saved($et_index)] { - verbose "check_effective_target_vect_widen_sum_qi_to_si:\ - using cached result" 2 - } else { - set et_vect_widen_sum_qi_to_si_saved($et_index) 0 - if { [istarget powerpc*-*-*] } { - set et_vect_widen_sum_qi_to_si_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_widen_sum_qi_to_si:\ - returning $et_vect_widen_sum_qi_to_si_saved($et_index)" 2 - return $et_vect_widen_sum_qi_to_si_saved($et_index) + return [check_cached_effective_target_indexed vect_widen_sum_qi_to_si { + expr { [istarget powerpc*-*-*] }}] } # Return 1 if the target plus current options supports a vector @@ -6060,31 +5708,15 @@ proc check_effective_target_vect_widen_sum_qi_to_si { } { proc check_effective_target_vect_widen_mult_qi_to_hi { } { - global et_vect_widen_mult_qi_to_hi_saved - global et_index - - if [info exists et_vect_widen_mult_qi_to_hi_saved($et_index)] { - verbose "check_effective_target_vect_widen_mult_qi_to_hi:\ - using cached result" 2 - } else { - if { [check_effective_target_vect_unpack] - && [check_effective_target_vect_short_mult] } { - set et_vect_widen_mult_qi_to_hi_saved($et_index) 1 - } else { - set et_vect_widen_mult_qi_to_hi_saved($et_index) 0 - } - if { [istarget powerpc*-*-*] - || ([istarget aarch64*-*-*] - && ![check_effective_target_aarch64_sve]) - || [is-effective-target arm_neon] - || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_widen_mult_qi_to_hi_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_widen_mult_qi_to_hi:\ - returning $et_vect_widen_mult_qi_to_hi_saved($et_index)" 2 - return $et_vect_widen_mult_qi_to_hi_saved($et_index) + return [check_cached_effective_target_indexed vect_widen_mult_qi_to_hi { + expr { ([check_effective_target_vect_unpack] + && [check_effective_target_vect_short_mult]) + || ([istarget powerpc*-*-*] + || ([istarget aarch64*-*-*] + && ![check_effective_target_aarch64_sve]) + || [is-effective-target arm_neon] + || ([istarget s390*-*-*] + && [check_effective_target_s390_vx])) }}] } # Return 1 if the target plus current options supports a vector @@ -6097,34 +5729,18 @@ proc check_effective_target_vect_widen_mult_qi_to_hi { } { proc check_effective_target_vect_widen_mult_hi_to_si { } { - global et_vect_widen_mult_hi_to_si_saved - global et_index - - if [info exists et_vect_widen_mult_hi_to_si_saved($et_index)] { - verbose "check_effective_target_vect_widen_mult_hi_to_si:\ - using cached result" 2 - } else { - if { [check_effective_target_vect_unpack] - && [check_effective_target_vect_int_mult] } { - set et_vect_widen_mult_hi_to_si_saved($et_index) 1 - } else { - set et_vect_widen_mult_hi_to_si_saved($et_index) 0 - } - if { [istarget powerpc*-*-*] - || [istarget spu-*-*] - || [istarget ia64-*-*] - || ([istarget aarch64*-*-*] - && ![check_effective_target_aarch64_sve]) - || [istarget i?86-*-*] || [istarget x86_64-*-*] - || [is-effective-target arm_neon] - || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_widen_mult_hi_to_si_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_widen_mult_hi_to_si:\ - returning $et_vect_widen_mult_hi_to_si_saved($et_index)" 2 - return $et_vect_widen_mult_hi_to_si_saved($et_index) + return [check_cached_effective_target_indexed vect_widen_mult_hi_to_si { + expr { ([check_effective_target_vect_unpack] + && [check_effective_target_vect_int_mult]) + || ([istarget powerpc*-*-*] + || [istarget spu-*-*] + || [istarget ia64-*-*] + || ([istarget aarch64*-*-*] + && ![check_effective_target_aarch64_sve]) + || [istarget i?86-*-*] || [istarget x86_64-*-*] + || [is-effective-target arm_neon] + || ([istarget s390*-*-*] + && [check_effective_target_s390_vx])) }}] } # Return 1 if the target plus current options supports a vector @@ -6133,25 +5749,12 @@ proc check_effective_target_vect_widen_mult_hi_to_si { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_widen_mult_qi_to_hi_pattern { } { - global et_vect_widen_mult_qi_to_hi_pattern_saved - global et_index - - if [info exists et_vect_widen_mult_qi_to_hi_pattern_saved($et_index)] { - verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern:\ - using cached result" 2 - } else { - set et_vect_widen_mult_qi_to_hi_pattern_saved($et_index) 0 - if { [istarget powerpc*-*-*] - || ([is-effective-target arm_neon] - && [check_effective_target_arm_little_endian]) - || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_widen_mult_qi_to_hi_pattern_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern:\ - returning $et_vect_widen_mult_qi_to_hi_pattern_saved($et_index)" 2 - return $et_vect_widen_mult_qi_to_hi_pattern_saved($et_index) + return [check_cached_effective_target_indexed vect_widen_mult_qi_to_hi_pattern { + expr { [istarget powerpc*-*-*] + || ([is-effective-target arm_neon] + && [check_effective_target_arm_little_endian]) + || ([istarget s390*-*-*] + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target plus current options supports a vector @@ -6160,28 +5763,15 @@ proc check_effective_target_vect_widen_mult_qi_to_hi_pattern { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } { - global et_vect_widen_mult_hi_to_si_pattern_saved - global et_index - - if [info exists et_vect_widen_mult_hi_to_si_pattern_saved($et_index)] { - verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern:\ - using cached result" 2 - } else { - set et_vect_widen_mult_hi_to_si_pattern_saved($et_index) 0 - if { [istarget powerpc*-*-*] + return [check_cached_effective_target_indexed vect_widen_mult_hi_to_si_pattern { + expr { [istarget powerpc*-*-*] || [istarget spu-*-*] || [istarget ia64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*] || ([is-effective-target arm_neon] && [check_effective_target_arm_little_endian]) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_widen_mult_hi_to_si_pattern_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern:\ - returning $et_vect_widen_mult_hi_to_si_pattern_saved($et_index)" 2 - return $et_vect_widen_mult_hi_to_si_pattern_saved($et_index) + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target plus current options supports a vector @@ -6190,25 +5780,12 @@ proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_widen_mult_si_to_di_pattern { } { - global et_vect_widen_mult_si_to_di_pattern_saved - global et_index - - if [info exists et_vect_widen_mult_si_to_di_pattern_saved($et_index)] { - verbose "check_effective_target_vect_widen_mult_si_to_di_pattern:\ - using cached result" 2 - } else { - set et_vect_widen_mult_si_to_di_pattern_saved($et_index) 0 - if {[istarget ia64-*-*] - || [istarget i?86-*-*] || [istarget x86_64-*-*] - || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_widen_mult_si_to_di_pattern_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_widen_mult_si_to_di_pattern:\ - returning $et_vect_widen_mult_si_to_di_pattern_saved($et_index)" 2 - return $et_vect_widen_mult_si_to_di_pattern_saved($et_index) -} + return [check_cached_effective_target_indexed vect_widen_mult_si_to_di_pattern { + expr { [istarget ia64-*-*] + || [istarget i?86-*-*] || [istarget x86_64-*-*] + || ([istarget s390*-*-*] + && [check_effective_target_s390_vx]) }}] +} # Return 1 if the target plus current options supports a vector # widening shift, 0 otherwise. @@ -6216,20 +5793,8 @@ proc check_effective_target_vect_widen_mult_si_to_di_pattern { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_widen_shift { } { - global et_vect_widen_shift_saved - global et_index - - if [info exists et_vect_shift_saved($et_index)] { - verbose "check_effective_target_vect_widen_shift: using cached result" 2 - } else { - set et_vect_widen_shift_saved($et_index) 0 - if { [is-effective-target arm_neon] } { - set et_vect_widen_shift_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_widen_shift:\ - returning $et_vect_widen_shift_saved($et_index)" 2 - return $et_vect_widen_shift_saved($et_index) + return [check_cached_effective_target_indexed vect_widen_shift { + expr { [is-effective-target arm_neon] }}] } # Return 1 if the target plus current options supports a vector @@ -6238,24 +5803,12 @@ proc check_effective_target_vect_widen_shift { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_sdot_qi { } { - global et_vect_sdot_qi_saved - global et_index - - if [info exists et_vect_sdot_qi_saved($et_index)] { - verbose "check_effective_target_vect_sdot_qi: using cached result" 2 - } else { - set et_vect_sdot_qi_saved($et_index) 0 - if { [istarget ia64-*-*] + return [check_cached_effective_target_indexed vect_sdot_qi { + expr { [istarget ia64-*-*] || [istarget aarch64*-*-*] || [istarget arm*-*-*] || ([istarget mips*-*-*] - && [et-is-effective-target mips_msa]) } { - set et_vect_udot_qi_saved 1 - } - } - verbose "check_effective_target_vect_sdot_qi:\ - returning $et_vect_sdot_qi_saved($et_index)" 2 - return $et_vect_sdot_qi_saved($et_index) + && [et-is-effective-target mips_msa]) }}] } # Return 1 if the target plus current options supports a vector @@ -6264,25 +5817,13 @@ proc check_effective_target_vect_sdot_qi { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_udot_qi { } { - global et_vect_udot_qi_saved - global et_index - - if [info exists et_vect_udot_qi_saved($et_index)] { - verbose "check_effective_target_vect_udot_qi: using cached result" 2 - } else { - set et_vect_udot_qi_saved($et_index) 0 - if { [istarget powerpc*-*-*] + return [check_cached_effective_target_indexed vect_udot_qi { + expr { [istarget powerpc*-*-*] || [istarget aarch64*-*-*] || [istarget arm*-*-*] || [istarget ia64-*-*] || ([istarget mips*-*-*] - && [et-is-effective-target mips_msa]) } { - set et_vect_udot_qi_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_udot_qi:\ - returning $et_vect_udot_qi_saved($et_index)" 2 - return $et_vect_udot_qi_saved($et_index) + && [et-is-effective-target mips_msa]) }}] } # Return 1 if the target plus current options supports a vector @@ -6291,24 +5832,12 @@ proc check_effective_target_vect_udot_qi { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_sdot_hi { } { - global et_vect_sdot_hi_saved - global et_index - - if [info exists et_vect_sdot_hi_saved($et_index)] { - verbose "check_effective_target_vect_sdot_hi: using cached result" 2 - } else { - set et_vect_sdot_hi_saved($et_index) 0 - if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) + return [check_cached_effective_target_indexed vect_sdot_hi { + expr { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) || [istarget ia64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*] || ([istarget mips*-*-*] - && [et-is-effective-target mips_msa]) } { - set et_vect_sdot_hi_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_sdot_hi:\ - returning $et_vect_sdot_hi_saved($et_index)" 2 - return $et_vect_sdot_hi_saved($et_index) + && [et-is-effective-target mips_msa]) }}] } # Return 1 if the target plus current options supports a vector @@ -6317,22 +5846,10 @@ proc check_effective_target_vect_sdot_hi { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_udot_hi { } { - global et_vect_udot_hi_saved - global et_index - - if [info exists et_vect_udot_hi_saved($et_index)] { - verbose "check_effective_target_vect_udot_hi: using cached result" 2 - } else { - set et_vect_udot_hi_saved($et_index) 0 - if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) + return [check_cached_effective_target_indexed vect_udot_hi { + expr { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) || ([istarget mips*-*-*] - && [et-is-effective-target mips_msa]) } { - set et_vect_udot_hi_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_udot_hi:\ - returning $et_vect_udot_hi_saved($et_index)" 2 - return $et_vect_udot_hi_saved($et_index) + && [et-is-effective-target mips_msa]) }}] } # Return 1 if the target plus current options supports a vector @@ -6341,20 +5858,8 @@ proc check_effective_target_vect_udot_hi { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_usad_char { } { - global et_vect_usad_char_saved - global et_index - - if [info exists et_vect_usad_char_saved($et_index)] { - verbose "check_effective_target_vect_usad_char: using cached result" 2 - } else { - set et_vect_usad_char_saved($et_index) 0 - if { [istarget i?86-*-*] || [istarget x86_64-*-*] } { - set et_vect_usad_char_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_usad_char:\ - returning $et_vect_usad_char_saved($et_index)" 2 - return $et_vect_usad_char_saved($et_index) + return [check_cached_effective_target_indexed vect_usad_char { + expr { [istarget i?86-*-*] || [istarget x86_64-*-*] }}] } # Return 1 if the target plus current options supports both signed @@ -6372,14 +5877,8 @@ proc check_effective_target_vect_avg_qi {} { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_pack_trunc { } { - global et_vect_pack_trunc_saved - global et_index - - if [info exists et_vect_pack_trunc_saved($et_index)] { - verbose "check_effective_target_vect_pack_trunc: using cached result" 2 - } else { - set et_vect_pack_trunc_saved($et_index) 0 - if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) + return [check_cached_effective_target_indexed vect_pack_trunc { + expr { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) || [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget aarch64*-*-*] || [istarget spu-*-*] @@ -6388,13 +5887,7 @@ proc check_effective_target_vect_pack_trunc { } { || ([istarget mips*-*-*] && [et-is-effective-target mips_msa]) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_pack_trunc_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_pack_trunc:\ - returning $et_vect_pack_trunc_saved($et_index)" 2 - return $et_vect_pack_trunc_saved($et_index) + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target plus current options supports a vector @@ -6403,15 +5896,9 @@ proc check_effective_target_vect_pack_trunc { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_unpack { } { - global et_vect_unpack_saved - global et_index - - if [info exists et_vect_unpack_saved($et_index)] { - verbose "check_effective_target_vect_unpack: using cached result" 2 - } else { - set et_vect_unpack_saved($et_index) 0 - if { ([istarget powerpc*-*-*] && ![istarget powerpc-*paired*]) - || [istarget i?86-*-*] || [istarget x86_64-*-*] + return [check_cached_effective_target_indexed vect_unpack { + expr { ([istarget powerpc*-*-*] && ![istarget powerpc-*paired*]) + || [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget spu-*-*] || [istarget ia64-*-*] || [istarget aarch64*-*-*] @@ -6420,13 +5907,7 @@ proc check_effective_target_vect_unpack { } { || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok] && [check_effective_target_arm_little_endian]) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_unpack_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_unpack:\ - returning $et_vect_unpack_saved($et_index)" 2 - return $et_vect_unpack_saved($et_index) + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target plus current options does not guarantee @@ -6435,15 +5916,7 @@ proc check_effective_target_vect_unpack { } { # This won't change for different subtargets so cache the result. proc check_effective_target_unaligned_stack { } { - global et_unaligned_stack_saved - - if [info exists et_unaligned_stack_saved] { - verbose "check_effective_target_unaligned_stack: using cached result" 2 - } else { - set et_unaligned_stack_saved 0 - } - verbose "check_effective_target_unaligned_stack: returning $et_unaligned_stack_saved" 2 - return $et_unaligned_stack_saved + return [check_cached_effective_target_indexed unaligned_stack { expr 0 }] } # Return 1 if the target plus current options does not support a vector @@ -6452,27 +5925,15 @@ proc check_effective_target_unaligned_stack { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_no_align { } { - global et_vect_no_align_saved - global et_index - - if [info exists et_vect_no_align_saved($et_index)] { - verbose "check_effective_target_vect_no_align: using cached result" 2 - } else { - set et_vect_no_align_saved($et_index) 0 - if { [istarget mipsisa64*-*-*] + return [check_cached_effective_target_indexed vect_no_align { + expr { [istarget mipsisa64*-*-*] || [istarget mips-sde-elf] || [istarget sparc*-*-*] || [istarget ia64-*-*] || [check_effective_target_arm_vect_no_misalign] || ([istarget powerpc*-*-*] && [check_p8vector_hw_available]) || ([istarget mips*-*-*] - && [et-is-effective-target mips_loongson]) } { - set et_vect_no_align_saved($et_index) 1 - } - } - verbose "check_effective_target_vect_no_align:\ - returning $et_vect_no_align_saved($et_index)" 2 - return $et_vect_no_align_saved($et_index) + && [et-is-effective-target mips_loongson]) }}] } # Return 1 if the target supports a vector misalign access, 0 otherwise. @@ -6480,28 +5941,21 @@ proc check_effective_target_vect_no_align { } { # This won't change for different subtargets so cache the result. proc check_effective_target_vect_hw_misalign { } { - global et_vect_hw_misalign_saved - global et_index - - if [info exists et_vect_hw_misalign_saved($et_index)] { - verbose "check_effective_target_vect_hw_misalign: using cached result" 2 - } else { - set et_vect_hw_misalign_saved($et_index) 0 + return [check_cached_effective_target_indexed vect_hw_misalign { if { [istarget i?86-*-*] || [istarget x86_64-*-*] || ([istarget powerpc*-*-*] && [check_p8vector_hw_available]) || [istarget aarch64*-*-*] || ([istarget mips*-*-*] && [et-is-effective-target mips_msa]) || ([istarget s390*-*-*] && [check_effective_target_s390_vx]) } { - set et_vect_hw_misalign_saved($et_index) 1 + return 1 } - if { [istarget arm*-*-*] } { - set et_vect_hw_misalign_saved($et_index) [expr ![check_effective_target_arm_vect_no_misalign]] + if { [istarget arm*-*-*] + && ![check_effective_target_arm_vect_no_misalign] } { + return 1 } - } - verbose "check_effective_target_vect_hw_misalign:\ - returning $et_vect_hw_misalign_saved($et_index)" 2 - return $et_vect_hw_misalign_saved($et_index) + return 0 + }] } @@ -6528,20 +5982,15 @@ proc check_effective_target_vect_aligned_arrays { } { # This won't change for different subtargets so cache the result. proc check_effective_target_natural_alignment_32 { } { - global et_natural_alignment_32 - - if [info exists et_natural_alignment_32_saved] { - verbose "check_effective_target_natural_alignment_32: using cached result" 2 - } else { - # FIXME: 32bit powerpc: guaranteed only if MASK_ALIGN_NATURAL/POWER. - set et_natural_alignment_32_saved 1 - if { ([istarget *-*-darwin*] && [is-effective-target lp64]) - || [istarget avr-*-*] } { - set et_natural_alignment_32_saved 0 - } - } - verbose "check_effective_target_natural_alignment_32: returning $et_natural_alignment_32_saved" 2 - return $et_natural_alignment_32_saved + # FIXME: 32bit powerpc: guaranteed only if MASK_ALIGN_NATURAL/POWER. + return [check_cached_effective_target_indexed natural_alignment_32 { + if { ([istarget *-*-darwin*] && [is-effective-target lp64]) + || [istarget avr-*-*] } { + return 0 + } else { + return 1 + } + }] } # Return 1 if types of size 64 bit or less are naturally aligned (aligned to their @@ -6550,19 +5999,10 @@ proc check_effective_target_natural_alignment_32 { } { # This won't change for different subtargets so cache the result. proc check_effective_target_natural_alignment_64 { } { - global et_natural_alignment_64 - - if [info exists et_natural_alignment_64_saved] { - verbose "check_effective_target_natural_alignment_64: using cached result" 2 - } else { - set et_natural_alignment_64_saved 0 - if { ([is-effective-target lp64] && ![istarget *-*-darwin*]) - || [istarget spu-*-*] } { - set et_natural_alignment_64_saved 1 - } - } - verbose "check_effective_target_natural_alignment_64: returning $et_natural_alignment_64_saved" 2 - return $et_natural_alignment_64_saved + return [check_cached_effective_target_indexed natural_alignment_64 { + expr { ([is-effective-target lp64] && ![istarget *-*-darwin*]) + || [istarget spu-*-*] } + }] } # Return 1 if all vector types are naturally aligned (aligned to their @@ -6632,24 +6072,10 @@ proc check_effective_target_vector_alignment_reachable_for_64bit { } { # Return 1 if the target only requires element alignment for vector accesses proc check_effective_target_vect_element_align { } { - global et_vect_element_align - global et_index - - if [info exists et_vect_element_align($et_index)] { - verbose "check_effective_target_vect_element_align:\ - using cached result" 2 - } else { - set et_vect_element_align($et_index) 0 - if { ([istarget arm*-*-*] + return [check_cached_effective_target_indexed vect_element_align { + expr { ([istarget arm*-*-*] && ![check_effective_target_arm_vect_no_misalign]) - || [check_effective_target_vect_hw_misalign] } { - set et_vect_element_align($et_index) 1 - } - } - - verbose "check_effective_target_vect_element_align:\ - returning $et_vect_element_align($et_index)" 2 - return $et_vect_element_align($et_index) + || [check_effective_target_vect_hw_misalign] }}] } # Return 1 if we expect to see unaligned accesses in at least some @@ -6664,21 +6090,11 @@ proc check_effective_target_vect_unaligned_possible { } { # Return 1 if the target supports vector LOAD_LANES operations, 0 otherwise. proc check_effective_target_vect_load_lanes { } { - global et_vect_load_lanes - - if [info exists et_vect_load_lanes] { - verbose "check_effective_target_vect_load_lanes: using cached result" 2 - } else { - set et_vect_load_lanes 0 - # We don't support load_lanes correctly on big-endian arm. - if { ([check_effective_target_arm_little_endian] && [check_effective_target_arm_neon_ok]) - || [istarget aarch64*-*-*] } { - set et_vect_load_lanes 1 - } - } - - verbose "check_effective_target_vect_load_lanes: returning $et_vect_load_lanes" 2 - return $et_vect_load_lanes + # We don't support load_lanes correctly on big-endian arm. + return [check_cached_effective_target vect_load_lanes { + expr { ([check_effective_target_arm_little_endian] + && [check_effective_target_arm_neon_ok]) + || [istarget aarch64*-*-*] }}] } # Return 1 if the target supports vector masked stores. @@ -6696,14 +6112,8 @@ proc check_effective_target_vect_scatter_store { } { # Return 1 if the target supports vector conditional operations, 0 otherwise. proc check_effective_target_vect_condition { } { - global et_vect_cond_saved - global et_index - - if [info exists et_vect_cond_saved($et_index)] { - verbose "check_effective_target_vect_cond: using cached result" 2 - } else { - set et_vect_cond_saved($et_index) 0 - if { [istarget aarch64*-*-*] + return [check_cached_effective_target_indexed vect_condition { + expr { [istarget aarch64*-*-*] || [istarget powerpc*-*-*] || [istarget ia64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*] @@ -6713,54 +6123,28 @@ proc check_effective_target_vect_condition { } { || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_cond_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_cond:\ - returning $et_vect_cond_saved($et_index)" 2 - return $et_vect_cond_saved($et_index) + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target supports vector conditional operations where # the comparison has different type from the lhs, 0 otherwise. proc check_effective_target_vect_cond_mixed { } { - global et_vect_cond_mixed_saved - global et_index - - if [info exists et_vect_cond_mixed_saved($et_index)] { - verbose "check_effective_target_vect_cond_mixed: using cached result" 2 - } else { - set et_vect_cond_mixed_saved($et_index) 0 - if { [istarget i?86-*-*] || [istarget x86_64-*-*] + return [check_cached_effective_target_indexed vect_cond_mixed { + expr { [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget aarch64*-*-*] || [istarget powerpc*-*-*] || ([istarget mips*-*-*] && [et-is-effective-target mips_msa]) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_cond_mixed_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_cond_mixed:\ - returning $et_vect_cond_mixed_saved($et_index)" 2 - return $et_vect_cond_mixed_saved($et_index) + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target supports vector char multiplication, 0 otherwise. proc check_effective_target_vect_char_mult { } { - global et_vect_char_mult_saved - global et_index - - if [info exists et_vect_char_mult_saved($et_index)] { - verbose "check_effective_target_vect_char_mult: using cached result" 2 - } else { - set et_vect_char_mult_saved($et_index) 0 - if { [istarget aarch64*-*-*] + return [check_cached_effective_target_indexed vect_char_mult { + expr { [istarget aarch64*-*-*] || [istarget ia64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*] || [check_effective_target_arm32] @@ -6768,27 +6152,14 @@ proc check_effective_target_vect_char_mult { } { || ([istarget mips*-*-*] && [et-is-effective-target mips_msa]) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_char_mult_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_char_mult:\ - returning $et_vect_char_mult_saved($et_index)" 2 - return $et_vect_char_mult_saved($et_index) + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target supports vector short multiplication, 0 otherwise. proc check_effective_target_vect_short_mult { } { - global et_vect_short_mult_saved - global et_index - - if [info exists et_vect_short_mult_saved($et_index)] { - verbose "check_effective_target_vect_short_mult: using cached result" 2 - } else { - set et_vect_short_mult_saved($et_index) 0 - if { [istarget ia64-*-*] + return [check_cached_effective_target_indexed vect_short_mult { + expr { [istarget ia64-*-*] || [istarget spu-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget powerpc*-*-*] @@ -6798,27 +6169,14 @@ proc check_effective_target_vect_short_mult { } { && ([et-is-effective-target mips_msa] || [et-is-effective-target mips_loongson])) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_short_mult_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_short_mult:\ - returning $et_vect_short_mult_saved($et_index)" 2 - return $et_vect_short_mult_saved($et_index) + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target supports vector int multiplication, 0 otherwise. proc check_effective_target_vect_int_mult { } { - global et_vect_int_mult_saved - global et_index - - if [info exists et_vect_int_mult_saved($et_index)] { - verbose "check_effective_target_vect_int_mult: using cached result" 2 - } else { - set et_vect_int_mult_saved($et_index) 0 - if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) + return [check_cached_effective_target_indexed vect_int_mult { + expr { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) || [istarget spu-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget ia64-*-*] @@ -6827,14 +6185,7 @@ proc check_effective_target_vect_int_mult { } { && [et-is-effective-target mips_msa]) || [check_effective_target_arm32] || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_int_mult_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_int_mult:\ - returning $et_vect_int_mult_saved($et_index)" 2 - return $et_vect_int_mult_saved($et_index) + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target supports 64 bit hardware vector @@ -6864,15 +6215,8 @@ proc check_effective_target_vect_long_mult { } { # Return 1 if the target supports vector even/odd elements extraction, 0 otherwise. proc check_effective_target_vect_extract_even_odd { } { - global et_vect_extract_even_odd_saved - global et_index - - if [info exists et_vect_extract_even_odd_saved($et_index)] { - verbose "check_effective_target_vect_extract_even_odd:\ - using cached result" 2 - } else { - set et_vect_extract_even_odd_saved($et_index) 0 - if { [istarget aarch64*-*-*] + return [check_cached_effective_target_indexed extract_even_odd { + expr { [istarget aarch64*-*-*] || [istarget powerpc*-*-*] || [is-effective-target arm_neon] || [istarget i?86-*-*] || [istarget x86_64-*-*] @@ -6882,27 +6226,14 @@ proc check_effective_target_vect_extract_even_odd { } { && ([et-is-effective-target mips_msa] || [et-is-effective-target mpaired_single])) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_extract_even_odd_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_extract_even_odd:\ - returning $et_vect_extract_even_odd_saved($et_index)" 2 - return $et_vect_extract_even_odd_saved($et_index) + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target supports vector interleaving, 0 otherwise. proc check_effective_target_vect_interleave { } { - global et_vect_interleave_saved - global et_index - - if [info exists et_vect_interleave_saved($et_index)] { - verbose "check_effective_target_vect_interleave: using cached result" 2 - } else { - set et_vect_interleave_saved($et_index) 0 - if { [istarget aarch64*-*-*] + return [check_cached_effective_target_indexed vect_interleave { + expr { [istarget aarch64*-*-*] || [istarget powerpc*-*-*] || [is-effective-target arm_neon] || [istarget i?86-*-*] || [istarget x86_64-*-*] @@ -6912,42 +6243,25 @@ proc check_effective_target_vect_interleave { } { && ([et-is-effective-target mpaired_single] || [et-is-effective-target mips_msa])) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_interleave_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_interleave:\ - returning $et_vect_interleave_saved($et_index)" 2 - return $et_vect_interleave_saved($et_index) + && [check_effective_target_s390_vx]) }}] } foreach N {2 3 4 8} { eval [string map [list N $N] { # Return 1 if the target supports 2-vector interleaving proc check_effective_target_vect_stridedN { } { - global et_vect_stridedN_saved - global et_index - - if [info exists et_vect_stridedN_saved($et_index)] { - verbose "check_effective_target_vect_stridedN:\ - using cached result" 2 - } else { - set et_vect_stridedN_saved($et_index) 0 + return [check_cached_effective_target_indexed vect_stridedN { if { (N & -N) == N && [check_effective_target_vect_interleave] && [check_effective_target_vect_extract_even_odd] } { - set et_vect_stridedN_saved($et_index) 1 + return 1 } if { ([istarget arm*-*-*] || [istarget aarch64*-*-*]) && N >= 2 && N <= 4 } { - set et_vect_stridedN_saved($et_index) 1 + return 1 } - } - - verbose "check_effective_target_vect_stridedN:\ - returning $et_vect_stridedN_saved($et_index)" 2 - return $et_vect_stridedN_saved($et_index) + return 0 + }] } }] } @@ -6998,71 +6312,33 @@ proc check_effective_target_vect64 { } { # Return 1 if the target supports vector copysignf calls. proc check_effective_target_vect_call_copysignf { } { - global et_vect_call_copysignf_saved - global et_index - - if [info exists et_vect_call_copysignf_saved($et_index)] { - verbose "check_effective_target_vect_call_copysignf:\ - using cached result" 2 - } else { - set et_vect_call_copysignf_saved($et_index) 0 - if { [istarget i?86-*-*] || [istarget x86_64-*-*] + return [check_cached_effective_target_indexed vect_call_copysignf { + expr { [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget powerpc*-*-*] - || [istarget aarch64*-*-*] } { - set et_vect_call_copysignf_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_call_copysignf:\ - returning $et_vect_call_copysignf_saved($et_index)" 2 - return $et_vect_call_copysignf_saved($et_index) + || [istarget aarch64*-*-*] }}] } # Return 1 if the target supports hardware square root instructions. proc check_effective_target_sqrt_insn { } { - global et_sqrt_insn_saved - - if [info exists et_sqrt_insn_saved] { - verbose "check_effective_target_hw_sqrt: using cached result" 2 - } else { - set et_sqrt_insn_saved 0 - if { [istarget i?86-*-*] || [istarget x86_64-*-*] + return [check_cached_effective_target sqrt_insn { + expr { [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget powerpc*-*-*] || [istarget aarch64*-*-*] || ([istarget arm*-*-*] && [check_effective_target_arm_vfp_ok]) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_sqrt_insn_saved 1 - } - } - - verbose "check_effective_target_hw_sqrt: returning et_sqrt_insn_saved" 2 - return $et_sqrt_insn_saved + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target supports vector sqrtf calls. proc check_effective_target_vect_call_sqrtf { } { - global et_vect_call_sqrtf_saved - global et_index - - if [info exists et_vect_call_sqrtf_saved($et_index)] { - verbose "check_effective_target_vect_call_sqrtf: using cached result" 2 - } else { - set et_vect_call_sqrtf_saved($et_index) 0 - if { [istarget aarch64*-*-*] + return [check_cached_effective_target_indexed vect_call_sqrtf { + expr { [istarget aarch64*-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*] || ([istarget powerpc*-*-*] && [check_vsx_hw_available]) || ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { - set et_vect_call_sqrtf_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_call_sqrtf:\ - returning $et_vect_call_sqrtf_saved($et_index)" 2 - return $et_vect_call_sqrtf_saved($et_index) + && [check_effective_target_s390_vx]) }}] } # Return 1 if the target supports vector lrint calls. @@ -7081,244 +6357,85 @@ proc check_effective_target_vect_call_lrint { } { # Return 1 if the target supports vector btrunc calls. proc check_effective_target_vect_call_btrunc { } { - global et_vect_call_btrunc_saved - global et_index - - if [info exists et_vect_call_btrunc_saved($et_index)] { - verbose "check_effective_target_vect_call_btrunc:\ - using cached result" 2 - } else { - set et_vect_call_btrunc_saved($et_index) 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_btrunc_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_call_btrunc:\ - returning $et_vect_call_btrunc_saved($et_index)" 2 - return $et_vect_call_btrunc_saved($et_index) + return [check_cached_effective_target_indexed vect_call_btrunc { + expr { [istarget aarch64*-*-*] }}] } # Return 1 if the target supports vector btruncf calls. proc check_effective_target_vect_call_btruncf { } { - global et_vect_call_btruncf_saved - global et_index - - if [info exists et_vect_call_btruncf_saved($et_index)] { - verbose "check_effective_target_vect_call_btruncf:\ - using cached result" 2 - } else { - set et_vect_call_btruncf_saved($et_index) 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_btruncf_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_call_btruncf:\ - returning $et_vect_call_btruncf_saved($et_index)" 2 - return $et_vect_call_btruncf_saved($et_index) + return [check_cached_effective_target_indexed vect_call_btruncf { + expr { [istarget aarch64*-*-*] }}] } # Return 1 if the target supports vector ceil calls. proc check_effective_target_vect_call_ceil { } { - global et_vect_call_ceil_saved - global et_index - - if [info exists et_vect_call_ceil_saved($et_index)] { - verbose "check_effective_target_vect_call_ceil: using cached result" 2 - } else { - set et_vect_call_ceil_saved($et_index) 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_ceil_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_call_ceil:\ - returning $et_vect_call_ceil_saved($et_index)" 2 - return $et_vect_call_ceil_saved($et_index) + return [check_cached_effective_target_indexed vect_call_ceil { + expr { [istarget aarch64*-*-*] }}] } # Return 1 if the target supports vector ceilf calls. proc check_effective_target_vect_call_ceilf { } { - global et_vect_call_ceilf_saved - global et_index - - if [info exists et_vect_call_ceilf_saved($et_index)] { - verbose "check_effective_target_vect_call_ceilf: using cached result" 2 - } else { - set et_vect_call_ceilf_saved($et_index) 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_ceilf_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_call_ceilf:\ - returning $et_vect_call_ceilf_saved($et_index)" 2 - return $et_vect_call_ceilf_saved($et_index) + return [check_cached_effective_target_indexed vect_call_ceilf { + expr { [istarget aarch64*-*-*] }}] } # Return 1 if the target supports vector floor calls. proc check_effective_target_vect_call_floor { } { - global et_vect_call_floor_saved - global et_index - - if [info exists et_vect_call_floor_saved($et_index)] { - verbose "check_effective_target_vect_call_floor: using cached result" 2 - } else { - set et_vect_call_floor_saved($et_index) 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_floor_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_call_floor:\ - returning $et_vect_call_floor_saved($et_index)" 2 - return $et_vect_call_floor_saved($et_index) + return [check_cached_effective_target_indexed vect_call_floor { + expr { [istarget aarch64*-*-*] }}] } # Return 1 if the target supports vector floorf calls. proc check_effective_target_vect_call_floorf { } { - global et_vect_call_floorf_saved - global et_index - - if [info exists et_vect_call_floorf_saved($et_index)] { - verbose "check_effective_target_vect_call_floorf: using cached result" 2 - } else { - set et_vect_call_floorf_saved($et_index) 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_floorf_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_call_floorf:\ - returning $et_vect_call_floorf_saved($et_index)" 2 - return $et_vect_call_floorf_saved($et_index) + return [check_cached_effective_target_indexed vect_call_floorf { + expr { [istarget aarch64*-*-*] }}] } # Return 1 if the target supports vector lceil calls. proc check_effective_target_vect_call_lceil { } { - global et_vect_call_lceil_saved - global et_index - - if [info exists et_vect_call_lceil_saved($et_index)] { - verbose "check_effective_target_vect_call_lceil: using cached result" 2 - } else { - set et_vect_call_lceil_saved($et_index) 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_lceil_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_call_lceil:\ - returning $et_vect_call_lceil_saved($et_index)" 2 - return $et_vect_call_lceil_saved($et_index) + return [check_cached_effective_target_indexed vect_call_lceil { + expr { [istarget aarch64*-*-*] }}] } # Return 1 if the target supports vector lfloor calls. proc check_effective_target_vect_call_lfloor { } { - global et_vect_call_lfloor_saved - global et_index - - if [info exists et_vect_call_lfloor_saved($et_index)] { - verbose "check_effective_target_vect_call_lfloor: using cached result" 2 - } else { - set et_vect_call_lfloor_saved($et_index) 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_lfloor_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_call_lfloor:\ - returning $et_vect_call_lfloor_saved($et_index)" 2 - return $et_vect_call_lfloor_saved($et_index) + return [check_cached_effective_target_indexed vect_call_lfloor { + expr { [istarget aarch64*-*-*] }}] } # Return 1 if the target supports vector nearbyint calls. proc check_effective_target_vect_call_nearbyint { } { - global et_vect_call_nearbyint_saved - global et_index - - if [info exists et_vect_call_nearbyint_saved($et_index)] { - verbose "check_effective_target_vect_call_nearbyint: using cached result" 2 - } else { - set et_vect_call_nearbyint_saved($et_index) 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_nearbyint_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_call_nearbyint:\ - returning $et_vect_call_nearbyint_saved($et_index)" 2 - return $et_vect_call_nearbyint_saved($et_index) + return [check_cached_effective_target_indexed vect_call_nearbyint { + expr { [istarget aarch64*-*-*] }}] } # Return 1 if the target supports vector nearbyintf calls. proc check_effective_target_vect_call_nearbyintf { } { - global et_vect_call_nearbyintf_saved - global et_index - - if [info exists et_vect_call_nearbyintf_saved($et_index)] { - verbose "check_effective_target_vect_call_nearbyintf:\ - using cached result" 2 - } else { - set et_vect_call_nearbyintf_saved($et_index) 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_nearbyintf_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_call_nearbyintf:\ - returning $et_vect_call_nearbyintf_saved($et_index)" 2 - return $et_vect_call_nearbyintf_saved($et_index) + return [check_cached_effective_target_indexed vect_call_nearbyintf { + expr { [istarget aarch64*-*-*] }}] } # Return 1 if the target supports vector round calls. proc check_effective_target_vect_call_round { } { - global et_vect_call_round_saved - global et_index - - if [info exists et_vect_call_round_saved($et_index)] { - verbose "check_effective_target_vect_call_round: using cached result" 2 - } else { - set et_vect_call_round_saved($et_index) 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_round_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_call_round:\ - returning $et_vect_call_round_saved($et_index)" 2 - return $et_vect_call_round_saved($et_index) + return [check_cached_effective_target_indexed vect_call_round { + expr { [istarget aarch64*-*-*] }}] } # Return 1 if the target supports vector roundf calls. proc check_effective_target_vect_call_roundf { } { - global et_vect_call_roundf_saved - global et_index - - if [info exists et_vect_call_roundf_saved($et_index)] { - verbose "check_effective_target_vect_call_roundf: using cached result" 2 - } else { - set et_vect_call_roundf_saved($et_index) 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_roundf_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect_call_roundf:\ - returning $et_vect_call_roundf_saved($et_index)" 2 - return $et_vect_call_roundf_saved($et_index) + return [check_cached_effective_target_indexed vect_call_roundf { + expr { [istarget aarch64*-*-*] }}] } # Return 1 if the target supports AND, OR and XOR reduction. @@ -7336,21 +6453,10 @@ proc check_effective_target_vect_fold_extract_last { } { # Return 1 if the target supports section-anchors proc check_effective_target_section_anchors { } { - global et_section_anchors_saved - - if [info exists et_section_anchors_saved] { - verbose "check_effective_target_section_anchors: using cached result" 2 - } else { - set et_section_anchors_saved 0 - if { [istarget powerpc*-*-*] - || [istarget arm*-*-*] - || [istarget aarch64*-*-*] } { - set et_section_anchors_saved 1 - } - } - - verbose "check_effective_target_section_anchors: returning $et_section_anchors_saved" 2 - return $et_section_anchors_saved + return [check_cached_effective_target section_anchors { + expr { [istarget powerpc*-*-*] + || [istarget arm*-*-*] + || [istarget aarch64*-*-*] }}] } # Return 1 if the target supports atomic operations on "int_128" values. @@ -7446,13 +6552,8 @@ proc check_effective_target_sync_long_long_runtime { } { # Return 1 if the target supports byte swap instructions. proc check_effective_target_bswap { } { - global et_bswap_saved - - if [info exists et_bswap_saved] { - verbose "check_effective_target_bswap: using cached result" 2 - } else { - set et_bswap_saved 0 - if { [istarget aarch64*-*-*] + return [check_cached_effective_target bswap { + expr { [istarget aarch64*-*-*] || [istarget alpha*-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget m68k-*-*] @@ -7465,27 +6566,16 @@ proc check_effective_target_bswap { } { #error not armv6 or later #endif int i; - } ""]) } { - set et_bswap_saved 1 - } - } - - verbose "check_effective_target_bswap: returning $et_bswap_saved" 2 - return $et_bswap_saved + } ""]) }}] } # Return 1 if the target supports atomic operations on "int" and "long". proc check_effective_target_sync_int_long { } { - global et_sync_int_long_saved - - if [info exists et_sync_int_long_saved] { - verbose "check_effective_target_sync_int_long: using cached result" 2 - } else { - set et_sync_int_long_saved 0 # This is intentionally powerpc but not rs6000, rs6000 doesn't have the # load-reserved/store-conditional instructions. - if { [istarget ia64-*-*] + return [check_cached_effective_target sync_int_long { + expr { [istarget ia64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget aarch64*-*-*] || [istarget alpha*-*-*] @@ -7500,27 +6590,16 @@ proc check_effective_target_sync_int_long { } { || ([istarget sparc*-*-*] && [check_effective_target_sparc_v9]) || [istarget spu-*-*] || ([istarget arc*-*-*] && [check_effective_target_arc_atomic]) - || [check_effective_target_mips_llsc] } { - set et_sync_int_long_saved 1 - } - } - - verbose "check_effective_target_sync_int_long: returning $et_sync_int_long_saved" 2 - return $et_sync_int_long_saved + || [check_effective_target_mips_llsc] }}] } # Return 1 if the target supports atomic operations on "char" and "short". proc check_effective_target_sync_char_short { } { - global et_sync_char_short_saved - - if [info exists et_sync_char_short_saved] { - verbose "check_effective_target_sync_char_short: using cached result" 2 - } else { - set et_sync_char_short_saved 0 # This is intentionally powerpc but not rs6000, rs6000 doesn't have the # load-reserved/store-conditional instructions. - if { [istarget aarch64*-*-*] + return [check_cached_effective_target sync_char_short { + expr { [istarget aarch64*-*-*] || [istarget ia64-*-*] || [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget alpha*-*-*] @@ -7534,13 +6613,7 @@ proc check_effective_target_sync_char_short { } { || ([istarget sparc*-*-*] && [check_effective_target_sparc_v9]) || [istarget spu-*-*] || ([istarget arc*-*-*] && [check_effective_target_arc_atomic]) - || [check_effective_target_mips_llsc] } { - set et_sync_char_short_saved 1 - } - } - - verbose "check_effective_target_sync_char_short: returning $et_sync_char_short_saved" 2 - return $et_sync_char_short_saved + || [check_effective_target_mips_llsc] }}] } # Return 1 if the target uses a ColdFire FPU. @@ -7692,6 +6765,7 @@ proc is-effective-target { arg } { default { error "unknown effective target keyword `$arg'" } } } + verbose "is-effective-target: $arg $selected" 2 return $selected } @@ -8822,23 +7896,17 @@ proc check_effective_target_fenv_exceptions {} { } proc check_effective_target_tiny {} { - global et_target_tiny_saved - - if [info exists et_target_tiny_saved] { - verbose "check_effective_target_tiny: using cached result" 2 - } else { - set et_target_tiny_saved 0 - if { [istarget aarch64*-*-*] - && [check_effective_target_aarch64_tiny] } { - set et_target_tiny_saved 1 - } - if { [istarget avr-*-*] - && [check_effective_target_avr_tiny] } { - set et_target_tiny_saved 1 - } - } - - return $et_target_tiny_saved + return [check_cached_effective_target tiny { + if { [istarget aarch64*-*-*] + && [check_effective_target_aarch64_tiny] } { + return 1 + } + if { [istarget avr-*-*] + && [check_effective_target_avr_tiny] } { + return 1 + } + return 0 + }] } # Return 1 if LOGICAL_OP_NON_SHORT_CIRCUIT is set to 0 for the current target. @@ -8924,7 +7992,6 @@ proc scan-ltrans-tree-dump-dem-not_required_options {} { # otherwise. Cache the result. proc check_effective_target_pie_copyreloc { } { - global pie_copyreloc_available_saved global tool global GCC_UNDER_TEST @@ -8937,9 +8004,7 @@ proc check_effective_target_pie_copyreloc { } { return 0 } - if [info exists pie_copyreloc_available_saved] { - verbose "check_effective_target_pie_copyreloc returning saved $pie_copyreloc_available_saved" 2 - } else { + return [check_cached_effective_target pie_copyreloc { # Set up and compile to see if linker supports PIE with copy # reloc. Include the current process ID in the file names to # prevent conflicts with invocations for multiple testsuites. @@ -8962,21 +8027,18 @@ proc check_effective_target_pie_copyreloc { } { if [string match "" $lines] then { verbose "check_effective_target_pie_copyreloc testfile compilation passed" 2 - set pie_copyreloc_available_saved 1 + return 1 } else { verbose "check_effective_target_pie_copyreloc testfile compilation failed" 2 - set pie_copyreloc_available_saved 0 + return 0 } - } - - return $pie_copyreloc_available_saved + }] } # Return 1 if the x86 target supports R_386_GOT32X relocation, 0 # otherwise. Cache the result. proc check_effective_target_got32x_reloc { } { - global got32x_reloc_available_saved global tool global GCC_UNDER_TEST @@ -8989,9 +8051,7 @@ proc check_effective_target_got32x_reloc { } { return 0 } - if [info exists got32x_reloc_available_saved] { - verbose "check_effective_target_got32x_reloc returning saved $got32x_reloc_available_saved" 2 - } else { + return [check_cached_effective_target got32x_reloc { # Include the current process ID in the file names to prevent # conflicts with invocations for multiple testsuites. @@ -9013,12 +8073,12 @@ proc check_effective_target_got32x_reloc { } { if [string match "" $lines] then { verbose "check_effective_target_got32x_reloc testfile compilation passed" 2 - set got32x_reloc_available_saved 1 + return 1 } else { verbose "check_effective_target_got32x_reloc testfile compilation failed" 2 - set got32x_reloc_available_saved 0 + return 0 } - } + }] return $got32x_reloc_available_saved } @@ -9027,7 +8087,6 @@ proc check_effective_target_got32x_reloc { } { # 0 otherwise. Cache the result. proc check_effective_target_tls_get_addr_via_got { } { - global tls_get_addr_via_got_available_saved global tool global GCC_UNDER_TEST @@ -9040,9 +8099,7 @@ proc check_effective_target_tls_get_addr_via_got { } { return 0 } - if [info exists tls_get_addr_via_got_available_saved] { - verbose "check_effective_target_tls_get_addr_via_got returning saved $tls_get_addr_via_got_available_saved" 2 - } else { + return [check_cached_effective_target tls_get_addr_via_got { # Include the current process ID in the file names to prevent # conflicts with invocations for multiple testsuites. @@ -9064,14 +8121,12 @@ proc check_effective_target_tls_get_addr_via_got { } { if [string match "" $lines] then { verbose "check_effective_target_tls_get_addr_via_got testfile compilation passed" 2 - set tls_get_addr_via_got_available_saved 1 + return 1 } else { verbose "check_effective_target_tls_get_addr_via_got testfile compilation failed" 2 - set tls_get_addr_via_got_available_saved 0 + return 0 } - } - - return $tls_get_addr_via_got_available_saved + }] } # Return 1 if the target uses comdat groups. -- cgit v1.1 From cd1bef27d286a40b2709a9ded77fed5a33a461c5 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Mon, 1 Oct 2018 06:49:35 -0600 Subject: Updated stack-clash implementation supporting 64k probes. This patch implements the use of the stack clash mitigation for aarch64. In Aarch64 we expect both the probing interval and the guard size to be 64KB and we enforce them to always be equal. We also probe up by 1024 bytes in the general case when a probe is required. AArch64 has the following probing conditions: 1a) Any initial adjustment less than 63KB requires no probing. An ABI defined safe buffer of 1Kbytes is used and a page size of 64k is assumed. b) Any final adjustment residual requires a probe at SP + 1KB. We know this to be safe since you would have done at least one page worth of allocations already to get to that point. c) Any final adjustment more than remainder (total allocation amount) larger than 1K - LR offset requires a probe at SP. safe buffer mentioned in 1a is maintained by the storing of FP/LR. In the case of -fomit-frame-pointer we can still count on LR being stored if the function makes a call, even if it's a tail call. The AArch64 frame layout code guarantees this and tests have been added to check against this particular case. 2) Any allocations larger than 1 page size, is done in increments of page size and probed up by 1KB leaving the residuals. 3a) Any residual for initial adjustment that is less than guard-size - 1KB requires no probing. Essentially this is a sliding window. The probing range determines the ABI safe buffer, and the amount to be probed up. Incrementally allocating less than the probing thresholds, e.g. recursive functions will not be an issue as the storing of LR counts as a probe. +-------------------+ | ABI SAFE REGION | +------------------------------ | | | | | | | | | | | | | | | | | | maximum amount | | | not needing a | | | probe | | | | | | | | | | | | | | | Probe offset when | ---------------------------- probe is required | | | +-------- +-------------------+ -------- Point of first probe | ABI SAFE REGION | --------------------- | | | | | | Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Target was tested with stack clash on and off by default. GLIBC testsuite also ran with stack clash on by default and no new regressions. Co-Authored-By: Richard Sandiford Co-Authored-By: Tamar Christina From-SVN: r264747 --- gcc/ChangeLog | 16 ++ gcc/config/aarch64/aarch64.c | 273 +++++++++++++++++++-- gcc/config/aarch64/aarch64.h | 8 + gcc/config/aarch64/aarch64.md | 2 +- gcc/testsuite/ChangeLog | 28 +++ gcc/testsuite/gcc.target/aarch64/stack-check-12.c | 22 ++ gcc/testsuite/gcc.target/aarch64/stack-check-13.c | 28 +++ .../gcc.target/aarch64/stack-check-cfa-1.c | 12 + .../gcc.target/aarch64/stack-check-cfa-2.c | 13 + .../gcc.target/aarch64/stack-check-prologue-1.c | 10 + .../gcc.target/aarch64/stack-check-prologue-10.c | 11 + .../gcc.target/aarch64/stack-check-prologue-11.c | 11 + .../gcc.target/aarch64/stack-check-prologue-12.c | 15 ++ .../gcc.target/aarch64/stack-check-prologue-13.c | 20 ++ .../gcc.target/aarch64/stack-check-prologue-14.c | 24 ++ .../gcc.target/aarch64/stack-check-prologue-15.c | 23 ++ .../gcc.target/aarch64/stack-check-prologue-2.c | 10 + .../gcc.target/aarch64/stack-check-prologue-3.c | 11 + .../gcc.target/aarch64/stack-check-prologue-4.c | 11 + .../gcc.target/aarch64/stack-check-prologue-5.c | 11 + .../gcc.target/aarch64/stack-check-prologue-6.c | 11 + .../gcc.target/aarch64/stack-check-prologue-7.c | 11 + .../gcc.target/aarch64/stack-check-prologue-8.c | 10 + .../gcc.target/aarch64/stack-check-prologue-9.c | 11 + .../gcc.target/aarch64/stack-check-prologue.h | 5 + gcc/testsuite/lib/target-supports.exp | 7 +- 26 files changed, 593 insertions(+), 21 deletions(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-12.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-13.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-cfa-1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-cfa-2.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-10.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-11.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-12.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-13.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-14.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-15.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-2.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-3.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-4.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-5.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-6.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-7.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-8.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-9.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue.h (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 70bfeb6..332f6dc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2018-10-01 Jeff Law + Richard Sandiford + Tamar Christina + + PR target/86486 + * config/aarch64/aarch64.md + (probe_stack_range): Add k (SP) constraint. + * config/aarch64/aarch64.h (STACK_CLASH_CALLER_GUARD, + STACK_CLASH_MAX_UNROLL_PAGES): New. + * config/aarch64/aarch64.c (aarch64_output_probe_stack_range): Emit + stack probes for stack clash. + (aarch64_allocate_and_probe_stack_space): New. + (aarch64_expand_prologue): Use it. + (aarch64_expand_epilogue): Likewise and update IP regs re-use criteria. + (aarch64_sub_sp): Add emit_move_imm optional param. + 2018-10-01 MCC CS PR tree-optimization/87261 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 12f7dfe..9fd5cb2 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -2816,10 +2816,11 @@ aarch64_add_sp (rtx temp1, rtx temp2, poly_int64 delta, bool emit_move_imm) if nonnull. */ static inline void -aarch64_sub_sp (rtx temp1, rtx temp2, poly_int64 delta, bool frame_related_p) +aarch64_sub_sp (rtx temp1, rtx temp2, poly_int64 delta, bool frame_related_p, + bool emit_move_imm = true) { aarch64_add_offset (Pmode, stack_pointer_rtx, stack_pointer_rtx, -delta, - temp1, temp2, frame_related_p); + temp1, temp2, frame_related_p, emit_move_imm); } /* Set DEST to (vec_series BASE STEP). */ @@ -3979,13 +3980,33 @@ aarch64_output_probe_stack_range (rtx reg1, rtx reg2) /* Loop. */ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, loop_lab); + HOST_WIDE_INT stack_clash_probe_interval + = 1 << PARAM_VALUE (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE); + /* TEST_ADDR = TEST_ADDR + PROBE_INTERVAL. */ xops[0] = reg1; - xops[1] = GEN_INT (PROBE_INTERVAL); + HOST_WIDE_INT interval; + if (flag_stack_clash_protection) + interval = stack_clash_probe_interval; + else + interval = PROBE_INTERVAL; + + gcc_assert (aarch64_uimm12_shift (interval)); + xops[1] = GEN_INT (interval); + output_asm_insn ("sub\t%0, %0, %1", xops); - /* Probe at TEST_ADDR. */ - output_asm_insn ("str\txzr, [%0]", xops); + /* If doing stack clash protection then we probe up by the ABI specified + amount. We do this because we're dropping full pages at a time in the + loop. But if we're doing non-stack clash probing, probe at SP 0. */ + if (flag_stack_clash_protection) + xops[1] = GEN_INT (STACK_CLASH_CALLER_GUARD); + else + xops[1] = CONST0_RTX (GET_MODE (xops[1])); + + /* Probe at TEST_ADDR. If we're inside the loop it is always safe to probe + by this amount for each iteration. */ + output_asm_insn ("str\txzr, [%0, %1]", xops); /* Test if TEST_ADDR == LAST_ADDR. */ xops[1] = reg2; @@ -4794,6 +4815,188 @@ aarch64_set_handled_components (sbitmap components) cfun->machine->reg_is_wrapped_separately[regno] = true; } +/* Allocate POLY_SIZE bytes of stack space using TEMP1 and TEMP2 as scratch + registers. If POLY_SIZE is not large enough to require a probe this function + will only adjust the stack. When allocating the stack space + FRAME_RELATED_P is then used to indicate if the allocation is frame related. + FINAL_ADJUSTMENT_P indicates whether we are allocating the outgoing + arguments. If we are then we ensure that any allocation larger than the ABI + defined buffer needs a probe so that the invariant of having a 1KB buffer is + maintained. + + We emit barriers after each stack adjustment to prevent optimizations from + breaking the invariant that we never drop the stack more than a page. This + invariant is needed to make it easier to correctly handle asynchronous + events, e.g. if we were to allow the stack to be dropped by more than a page + and then have multiple probes up and we take a signal somewhere in between + then the signal handler doesn't know the state of the stack and can make no + assumptions about which pages have been probed. */ + +static void +aarch64_allocate_and_probe_stack_space (rtx temp1, rtx temp2, + poly_int64 poly_size, + bool frame_related_p, + bool final_adjustment_p) +{ + HOST_WIDE_INT guard_size + = 1 << PARAM_VALUE (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE); + HOST_WIDE_INT guard_used_by_caller = STACK_CLASH_CALLER_GUARD; + /* When doing the final adjustment for the outgoing argument size we can't + assume that LR was saved at position 0. So subtract it's offset from the + ABI safe buffer so that we don't accidentally allow an adjustment that + would result in an allocation larger than the ABI buffer without + probing. */ + HOST_WIDE_INT min_probe_threshold + = final_adjustment_p + ? guard_used_by_caller - cfun->machine->frame.reg_offset[LR_REGNUM] + : guard_size - guard_used_by_caller; + + poly_int64 frame_size = cfun->machine->frame.frame_size; + + /* We should always have a positive probe threshold. */ + gcc_assert (min_probe_threshold > 0); + + if (flag_stack_clash_protection && !final_adjustment_p) + { + poly_int64 initial_adjust = cfun->machine->frame.initial_adjust; + poly_int64 final_adjust = cfun->machine->frame.final_adjust; + + if (known_eq (frame_size, 0)) + { + dump_stack_clash_frame_info (NO_PROBE_NO_FRAME, false); + } + else if (known_lt (initial_adjust, guard_size - guard_used_by_caller) + && known_lt (final_adjust, guard_used_by_caller)) + { + dump_stack_clash_frame_info (NO_PROBE_SMALL_FRAME, true); + } + } + + HOST_WIDE_INT size; + /* If SIZE is not large enough to require probing, just adjust the stack and + exit. */ + if (!poly_size.is_constant (&size) + || known_lt (poly_size, min_probe_threshold) + || !flag_stack_clash_protection) + { + aarch64_sub_sp (temp1, temp2, poly_size, frame_related_p); + return; + } + + if (dump_file) + fprintf (dump_file, + "Stack clash AArch64 prologue: " HOST_WIDE_INT_PRINT_DEC " bytes" + ", probing will be required.\n", size); + + /* Round size to the nearest multiple of guard_size, and calculate the + residual as the difference between the original size and the rounded + size. */ + HOST_WIDE_INT rounded_size = ROUND_DOWN (size, guard_size); + HOST_WIDE_INT residual = size - rounded_size; + + /* We can handle a small number of allocations/probes inline. Otherwise + punt to a loop. */ + if (rounded_size <= STACK_CLASH_MAX_UNROLL_PAGES * guard_size) + { + for (HOST_WIDE_INT i = 0; i < rounded_size; i += guard_size) + { + aarch64_sub_sp (NULL, temp2, guard_size, true); + emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx, + guard_used_by_caller)); + emit_insn (gen_blockage ()); + } + dump_stack_clash_frame_info (PROBE_INLINE, size != rounded_size); + } + else + { + /* Compute the ending address. */ + aarch64_add_offset (Pmode, temp1, stack_pointer_rtx, -rounded_size, + temp1, NULL, false, true); + rtx_insn *insn = get_last_insn (); + + /* For the initial allocation, we don't have a frame pointer + set up, so we always need CFI notes. If we're doing the + final allocation, then we may have a frame pointer, in which + case it is the CFA, otherwise we need CFI notes. + + We can determine which allocation we are doing by looking at + the value of FRAME_RELATED_P since the final allocations are not + frame related. */ + if (frame_related_p) + { + /* We want the CFA independent of the stack pointer for the + duration of the loop. */ + add_reg_note (insn, REG_CFA_DEF_CFA, + plus_constant (Pmode, temp1, rounded_size)); + RTX_FRAME_RELATED_P (insn) = 1; + } + + /* This allocates and probes the stack. Note that this re-uses some of + the existing Ada stack protection code. However we are guaranteed not + to enter the non loop or residual branches of that code. + + The non-loop part won't be entered because if our allocation amount + doesn't require a loop, the case above would handle it. + + The residual amount won't be entered because TEMP1 is a mutliple of + the allocation size. The residual will always be 0. As such, the only + part we are actually using from that code is the loop setup. The + actual probing is done in aarch64_output_probe_stack_range. */ + insn = emit_insn (gen_probe_stack_range (stack_pointer_rtx, + stack_pointer_rtx, temp1)); + + /* Now reset the CFA register if needed. */ + if (frame_related_p) + { + add_reg_note (insn, REG_CFA_DEF_CFA, + plus_constant (Pmode, stack_pointer_rtx, rounded_size)); + RTX_FRAME_RELATED_P (insn) = 1; + } + + emit_insn (gen_blockage ()); + dump_stack_clash_frame_info (PROBE_LOOP, size != rounded_size); + } + + /* Handle any residuals. Residuals of at least MIN_PROBE_THRESHOLD have to + be probed. This maintains the requirement that each page is probed at + least once. For initial probing we probe only if the allocation is + more than GUARD_SIZE - buffer, and for the outgoing arguments we probe + if the amount is larger than buffer. GUARD_SIZE - buffer + buffer == + GUARD_SIZE. This works that for any allocation that is large enough to + trigger a probe here, we'll have at least one, and if they're not large + enough for this code to emit anything for them, The page would have been + probed by the saving of FP/LR either by this function or any callees. If + we don't have any callees then we won't have more stack adjustments and so + are still safe. */ + if (residual) + { + HOST_WIDE_INT residual_probe_offset = guard_used_by_caller; + /* If we're doing final adjustments, and we've done any full page + allocations then any residual needs to be probed. */ + if (final_adjustment_p && rounded_size != 0) + min_probe_threshold = 0; + /* If doing a small final adjustment, we always probe at offset 0. + This is done to avoid issues when LR is not at position 0 or when + the final adjustment is smaller than the probing offset. */ + else if (final_adjustment_p && rounded_size == 0) + residual_probe_offset = 0; + + aarch64_sub_sp (temp1, temp2, residual, frame_related_p); + if (residual >= min_probe_threshold) + { + if (dump_file) + fprintf (dump_file, + "Stack clash AArch64 prologue residuals: " + HOST_WIDE_INT_PRINT_DEC " bytes, probing will be required." + "\n", residual); + + emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx, + residual_probe_offset)); + emit_insn (gen_blockage ()); + } + } +} + /* Add a REG_CFA_EXPRESSION note to INSN to say that register REG is saved at BASE + OFFSET. */ @@ -4821,7 +5024,7 @@ aarch64_add_cfa_expression (rtx_insn *insn, unsigned int reg, | local variables | <-- frame_pointer_rtx | | +-------------------------------+ - | padding0 | \ + | padding | \ +-------------------------------+ | | callee-saved registers | | frame.saved_regs_size +-------------------------------+ | @@ -4840,7 +5043,23 @@ aarch64_add_cfa_expression (rtx_insn *insn, unsigned int reg, Dynamic stack allocations via alloca() decrease stack_pointer_rtx but leave frame_pointer_rtx and hard_frame_pointer_rtx - unchanged. */ + unchanged. + + By default for stack-clash we assume the guard is at least 64KB, but this + value is configurable to either 4KB or 64KB. We also force the guard size to + be the same as the probing interval and both values are kept in sync. + + With those assumptions the callee can allocate up to 63KB (or 3KB depending + on the guard size) of stack space without probing. + + When probing is needed, we emit a probe at the start of the prologue + and every PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE bytes thereafter. + + We have to track how much space has been allocated and the only stores + to the stack we track as implicit probes are the FP/LR stores. + + For outgoing arguments we probe if the size is larger than 1KB, such that + the ABI specified buffer is maintained for the next callee. */ /* Generate the prologue instructions for entry into a function. Establish the stack frame by decreasing the stack pointer with a @@ -4889,7 +5108,16 @@ aarch64_expand_prologue (void) rtx ip0_rtx = gen_rtx_REG (Pmode, IP0_REGNUM); rtx ip1_rtx = gen_rtx_REG (Pmode, IP1_REGNUM); - aarch64_sub_sp (ip0_rtx, ip1_rtx, initial_adjust, true); + /* In theory we should never have both an initial adjustment + and a callee save adjustment. Verify that is the case since the + code below does not handle it for -fstack-clash-protection. */ + gcc_assert (known_eq (initial_adjust, 0) || callee_adjust == 0); + + /* Will only probe if the initial adjustment is larger than the guard + less the amount of the guard reserved for use by the caller's + outgoing args. */ + aarch64_allocate_and_probe_stack_space (ip0_rtx, ip1_rtx, initial_adjust, + true, false); if (callee_adjust != 0) aarch64_push_regs (reg1, reg2, callee_adjust); @@ -4945,7 +5173,11 @@ aarch64_expand_prologue (void) callee_adjust != 0 || emit_frame_chain); aarch64_save_callee_saves (DFmode, callee_offset, V0_REGNUM, V31_REGNUM, callee_adjust != 0 || emit_frame_chain); - aarch64_sub_sp (ip1_rtx, ip0_rtx, final_adjust, !frame_pointer_needed); + + /* We may need to probe the final adjustment if it is larger than the guard + that is assumed by the called. */ + aarch64_allocate_and_probe_stack_space (ip1_rtx, ip0_rtx, final_adjust, + !frame_pointer_needed, true); } /* Return TRUE if we can use a simple_return insn. @@ -4985,10 +5217,21 @@ aarch64_expand_epilogue (bool for_sibcall) /* A stack clash protection prologue may not have left IP0_REGNUM or IP1_REGNUM in a usable state. The same is true for allocations with an SVE component, since we then need both temporary registers - for each allocation. */ + for each allocation. For stack clash we are in a usable state if + the adjustment is less than GUARD_SIZE - GUARD_USED_BY_CALLER. */ + HOST_WIDE_INT guard_size + = 1 << PARAM_VALUE (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE); + HOST_WIDE_INT guard_used_by_caller = STACK_CLASH_CALLER_GUARD; + + /* We can re-use the registers when the allocation amount is smaller than + guard_size - guard_used_by_caller because we won't be doing any probes + then. In such situations the register should remain live with the correct + value. */ bool can_inherit_p = (initial_adjust.is_constant () - && final_adjust.is_constant () - && !flag_stack_clash_protection); + && final_adjust.is_constant ()) + && (!flag_stack_clash_protection + || known_lt (initial_adjust, + guard_size - guard_used_by_caller)); /* We need to add memory barrier to prevent read from deallocated stack. */ bool need_barrier_p @@ -5016,8 +5259,10 @@ aarch64_expand_epilogue (bool for_sibcall) hard_frame_pointer_rtx, -callee_offset, ip1_rtx, ip0_rtx, callee_adjust == 0); else - aarch64_add_sp (ip1_rtx, ip0_rtx, final_adjust, - !can_inherit_p || df_regs_ever_live_p (IP1_REGNUM)); + /* The case where we need to re-use the register here is very rare, so + avoid the complicated condition and just always emit a move if the + immediate doesn't fit. */ + aarch64_add_sp (ip1_rtx, ip0_rtx, final_adjust, true); aarch64_restore_callee_saves (DImode, callee_offset, R0_REGNUM, R30_REGNUM, callee_adjust != 0, &cfi_ops); diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index e5cdb1d..7b130be 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -84,6 +84,14 @@ #define LONG_DOUBLE_TYPE_SIZE 128 +/* This value is the amount of bytes a caller is allowed to drop the stack + before probing has to be done for stack clash protection. */ +#define STACK_CLASH_CALLER_GUARD 1024 + +/* This value controls how many pages we manually unroll the loop for when + generating stack clash probes. */ +#define STACK_CLASH_MAX_UNROLL_PAGES 4 + /* The architecture reserves all bits of the address for hardware use, so the vbit must go into the delta field of pointers to member functions. This is the same config as that in the AArch32 diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 7e7ca15..77c9497 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -6503,7 +6503,7 @@ ) (define_insn "probe_stack_range" - [(set (match_operand:DI 0 "register_operand" "=r") + [(set (match_operand:DI 0 "register_operand" "=rk") (unspec_volatile:DI [(match_operand:DI 1 "register_operand" "0") (match_operand:DI 2 "register_operand" "r")] UNSPECV_PROBE_STACK_RANGE))] diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 20db918..9d7f246 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,31 @@ +2018-10-01 Jeff Law + Richard Sandiford + Tamar Christina + + PR target/86486 + * gcc.target/aarch64/stack-check-12.c: New. + * gcc.target/aarch64/stack-check-13.c: New. + * gcc.target/aarch64/stack-check-cfa-1.c: New. + * gcc.target/aarch64/stack-check-cfa-2.c: New. + * gcc.target/aarch64/stack-check-prologue-1.c: New. + * gcc.target/aarch64/stack-check-prologue-10.c: New. + * gcc.target/aarch64/stack-check-prologue-11.c: New. + * gcc.target/aarch64/stack-check-prologue-12.c: New. + * gcc.target/aarch64/stack-check-prologue-13.c: New. + * gcc.target/aarch64/stack-check-prologue-14.c: New. + * gcc.target/aarch64/stack-check-prologue-15.c: New. + * gcc.target/aarch64/stack-check-prologue-2.c: New. + * gcc.target/aarch64/stack-check-prologue-3.c: New. + * gcc.target/aarch64/stack-check-prologue-4.c: New. + * gcc.target/aarch64/stack-check-prologue-5.c: New. + * gcc.target/aarch64/stack-check-prologue-6.c: New. + * gcc.target/aarch64/stack-check-prologue-7.c: New. + * gcc.target/aarch64/stack-check-prologue-8.c: New. + * gcc.target/aarch64/stack-check-prologue-9.c: New. + * gcc.target/aarch64/stack-check-prologue.h: New. + * lib/target-supports.exp + (check_effective_target_supports_stack_clash_protection): Add AArch64. + 2018-10-01 Tamar Christina * lib/target-supports.exp (check_cached_effective_target_indexed): New. diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-12.c b/gcc/testsuite/gcc.target/aarch64/stack-check-12.c new file mode 100644 index 0000000..4e3abcb --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-12.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16 -fno-asynchronous-unwind-tables -fno-unwind-tables" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +extern void arf (unsigned long int *, unsigned long int *); +void +frob () +{ + unsigned long int num[10000]; + unsigned long int den[10000]; + arf (den, num); +} + +/* This verifies that the scheduler did not break the dependencies + by adjusting the offsets within the probe and that the scheduler + did not reorder around the stack probes. */ +/* { dg-final { scan-assembler-times {sub\tsp, sp, #65536\n\tstr\txzr, \[sp, 1024\]} 2 } } */ +/* There is some residual allocation, but we don't care about that. Only that it's not probed. */ +/* { dg-final { scan-assembler-times {str\txzr, } 2 } } */ + + + diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-13.c b/gcc/testsuite/gcc.target/aarch64/stack-check-13.c new file mode 100644 index 0000000..1fcbae6 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-13.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16 -fno-asynchronous-unwind-tables -fno-unwind-tables" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define ARG32(X) X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X +#define ARG192(X) ARG32(X),ARG32(X),ARG32(X),ARG32(X),ARG32(X),ARG32(X) +void out1(ARG192(__int128)); +int t1(int); + +int t3(int x) +{ + if (x < 1000) + return t1 (x) + 1; + + out1 (ARG192(1)); + return 0; +} + + + +/* This test creates a large (> 1k) outgoing argument area that needs + to be probed. We don't test the exact size of the space or the + exact offset to make the test a little less sensitive to trivial + output changes. */ +/* { dg-final { scan-assembler-times "sub\\tsp, sp, #....\\n\\tstr\\txzr, \\\[sp" 1 } } */ + + + diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-cfa-1.c b/gcc/testsuite/gcc.target/aarch64/stack-check-cfa-1.c new file mode 100644 index 0000000..6885894 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-cfa-1.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16 -funwind-tables" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 128*1024 +#include "stack-check-prologue.h" + +/* { dg-final { scan-assembler-times {\.cfi_def_cfa_offset 65536} 1 } } */ +/* { dg-final { scan-assembler-times {\.cfi_def_cfa_offset 131072} 1 } } */ +/* { dg-final { scan-assembler-times {\.cfi_def_cfa_offset 0} 1 } } */ + +/* Checks that the CFA notes are correct for every sp adjustment. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-cfa-2.c b/gcc/testsuite/gcc.target/aarch64/stack-check-cfa-2.c new file mode 100644 index 0000000..5796a53 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-cfa-2.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16 -funwind-tables" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 1280*1024 + 512 +#include "stack-check-prologue.h" + +/* { dg-final { scan-assembler-times {\.cfi_def_cfa [0-9]+, 1310720} 1 } } */ +/* { dg-final { scan-assembler-times {\.cfi_def_cfa_offset 1311232} 1 } } */ +/* { dg-final { scan-assembler-times {\.cfi_def_cfa_offset 1310720} 1 } } */ +/* { dg-final { scan-assembler-times {\.cfi_def_cfa_offset 0} 1 } } */ + +/* Checks that the CFA notes are correct for every sp adjustment. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-1.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-1.c new file mode 100644 index 0000000..d2bfb78 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-1.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 128 +#include "stack-check-prologue.h" + +/* { dg-final { scan-assembler-times {str\s+xzr,} 0 } } */ + +/* SIZE is smaller than guard-size - 1Kb so no probe expected. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-10.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-10.c new file mode 100644 index 0000000..c9c9a1b --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-10.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE (6 * 64 * 1024) + (1 * 63 * 1024) + 512 +#include "stack-check-prologue.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 2 } } */ + +/* SIZE is more than 4x guard-size and remainder larger than guard-size - 1Kb, + 1 probe expected in a loop and 1 residual probe. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-11.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-11.c new file mode 100644 index 0000000..741f2f5 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-11.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE (6 * 64 * 1024) + (1 * 32 * 1024) +#include "stack-check-prologue.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ + +/* SIZE is more than 4x guard-size and remainder larger than guard-size - 1Kb, + 1 probe expected in a loop and 1 residual probe. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-12.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-12.c new file mode 100644 index 0000000..ece6800 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-12.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16 -fomit-frame-pointer -momit-leaf-frame-pointer" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +void +f (void) +{ + volatile int x[16384 + 1000]; + x[0] = 0; +} + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ + +/* SIZE is more than 1 guard-size, but only one 64KB page is used, expect only 1 + probe. Leaf function and omitting leaf pointers. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-13.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-13.c new file mode 100644 index 0000000..0fc900c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-13.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16 -fomit-frame-pointer -momit-leaf-frame-pointer" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +void h (void) __attribute__ ((noreturn)); + +void +f (void) +{ + volatile int x[16384 + 1000]; + x[30]=0; + h (); +} + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ +/* { dg-final { scan-assembler-times {str\s+x30, \[sp\]} 1 } } */ + +/* SIZE is more than 1 guard-size, but only one 64KB page is used, expect only 1 + probe. Leaf function and omitting leaf pointers, tail call to noreturn which + may only omit an epilogue and not a prologue. Checking for LR saving. */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-14.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-14.c new file mode 100644 index 0000000..ea733f8 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-14.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16 -fomit-frame-pointer -momit-leaf-frame-pointer" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +void h (void) __attribute__ ((noreturn)); + +void +f (void) +{ + volatile int x[16384 + 1000]; + if (x[0]) + h (); + x[345] = 1; + h (); +} + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ +/* { dg-final { scan-assembler-times {str\s+x30, \[sp\]} 1 } } */ + +/* SIZE is more than 1 guard-size, two 64k pages used, expect only 1 explicit + probe at 1024 and one implicit probe due to LR being saved. Leaf function + and omitting leaf pointers, tail call to noreturn which may only omit an + epilogue and not a prologue and control flow in between. Checking for + LR saving. */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-15.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-15.c new file mode 100644 index 0000000..63df4a5 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-15.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16 -fomit-frame-pointer -momit-leaf-frame-pointer" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +void g (volatile int *x) ; +void h (void) __attribute__ ((noreturn)); + +void +f (void) +{ + volatile int x[16384 + 1000]; + g (x); + h (); +} + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ +/* { dg-final { scan-assembler-times {str\s+x30, \[sp\]} 1 } } */ + +/* SIZE is more than 1 guard-size, two 64k pages used, expect only 1 explicit + probe at 1024 and one implicit probe due to LR being saved. Leaf function + and omitting leaf pointers, normal function call followed by a tail call to + noreturn which may only omit an epilogue and not a prologue and control flow + in between. Checking for LR saving. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-2.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-2.c new file mode 100644 index 0000000..61c52a2 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-2.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 2 * 1024 +#include "stack-check-prologue.h" + +/* { dg-final { scan-assembler-times {str\s+xzr,} 0 } } */ + +/* SIZE is smaller than guard-size - 1Kb so no probe expected. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-3.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-3.c new file mode 100644 index 0000000..0bef3c5 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-3.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 63 * 1024 +#include "stack-check-prologue.h" + +/* { dg-final { scan-assembler-times {str\s+xzr,} 1 } } */ + +/* SIZE is exactly guard-size - 1Kb, boundary condition so 1 probe expected. +*/ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-4.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-4.c new file mode 100644 index 0000000..5b8693a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-4.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 63 * 1024 + 512 +#include "stack-check-prologue.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ + +/* SIZE is more than guard-size - 1Kb and remainder is less than 1kB, + 1 probe expected. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-5.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-5.c new file mode 100644 index 0000000..2ee1635 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-5.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 64 * 1024 +#include "stack-check-prologue.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ + +/* SIZE is more than guard-size - 1Kb and remainder is zero, + 1 probe expected, boundary condition. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-6.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-6.c new file mode 100644 index 0000000..3c9b606 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-6.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 65 * 1024 +#include "stack-check-prologue.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ + +/* SIZE is more than guard-size - 1Kb and remainder is equal to 1kB, + 1 probe expected. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-7.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-7.c new file mode 100644 index 0000000..6324c03 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-7.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 127 * 1024 +#include "stack-check-prologue.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 2 } } */ + +/* SIZE is more than 1x guard-size and remainder equal than guard-size - 1Kb, + 2 probe expected, unrolled, no loop. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-8.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-8.c new file mode 100644 index 0000000..333f5fc --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-8.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 128 * 1024 +#include "stack-check-prologue.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 2 } } */ + +/* SIZE is more than 2x guard-size and no remainder, unrolled, no loop. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-9.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-9.c new file mode 100644 index 0000000..a3ff89b --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-9.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 6 * 64 * 1024 +#include "stack-check-prologue.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ + +/* SIZE is more than 4x guard-size and no remainder, 1 probe expected in a loop + and no residual probe. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue.h b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue.h new file mode 100644 index 0000000..b7e06ae --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue.h @@ -0,0 +1,5 @@ +int f_test (int x) +{ + char arr[SIZE]; + return arr[x]; +} diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 2e2c651..d741583 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8385,14 +8385,9 @@ proc check_effective_target_autoincdec { } { # proc check_effective_target_supports_stack_clash_protection { } { - # Temporary until the target bits are fully ACK'd. -# if { [istarget aarch*-*-*] } { -# return 1 -# } - if { [istarget x86_64-*-*] || [istarget i?86-*-*] || [istarget powerpc*-*-*] || [istarget rs6000*-*-*] - || [istarget s390*-*-*] } { + || [istarget aarch64*-**] || [istarget s390*-*-*] } { return 1 } return 0 -- cgit v1.1 From db6b62a858e578fdb7f9f754f2c4bf868d951fcb Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Mon, 1 Oct 2018 12:53:34 +0000 Subject: stack-clash: Add LR assert to layout_frame. Since stack clash depends on the LR being saved for non-leaf functions this patch adds an assert such that if this changes we would notice this. gcc/ PR target/86486 * config/aarch64/aarch64.c (aarch64_layout_frame): Add assert. From-SVN: r264748 --- gcc/ChangeLog | 5 +++++ gcc/config/aarch64/aarch64.c | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 332f6dc..0d02631 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-10-01 Tamar Christina + + PR target/86486 + * config/aarch64/aarch64.c (aarch64_layout_frame): Add assert. + 2018-10-01 Jeff Law Richard Sandiford Tamar Christina diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 9fd5cb2..9507608 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -4094,6 +4094,11 @@ aarch64_layout_frame (void) offset = 2 * UNITS_PER_WORD; } + /* With stack-clash, LR must be saved in non-leaf functions. */ + gcc_assert (crtl->is_leaf + || (cfun->machine->frame.reg_offset[R30_REGNUM] + != SLOT_NOT_REQUIRED)); + /* Now assign stack slots for them. */ for (regno = R0_REGNUM; regno <= R30_REGNUM; regno++) if (cfun->machine->frame.reg_offset[regno] == SLOT_REQUIRED) -- cgit v1.1 From eb471ba379597d73fcd79986cca5b8351a32770a Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Mon, 1 Oct 2018 12:56:40 +0000 Subject: Add support for SVE stack clash probing. This patch adds basic support for SVE stack clash protection. It is a first implementation and will use a loop to do the probing and stack adjustments. An example sequence is: .cfi_startproc mov x15, sp cntb x16, all, mul #11 add x16, x16, 304 .cfi_def_cfa_register 15 .SVLPSPL0: cmp x16, 61440 b.lt .SVLPEND0 sub sp, sp, 61440 str xzr, [sp, 0] sub x16, x16, 61440 b .SVLPSPL0 .SVLPEND0: sub sp, sp, x16 .cfi_escape 0xf,0xc,0x8f,0,0x92,0x2e,0,0x8,0x58,0x1e,0x23,0xb0,0x2,0x22 for a 64KB guard size, and for a 4KB guard size .cfi_startproc mov x15, sp cntb x16, all, mul #11 add x16, x16, 304 .cfi_def_cfa_register 15 .SVLPSPL0: cmp x16, 3072 b.lt .SVLPEND0 sub sp, sp, 3072 str xzr, [sp, 0] sub x16, x16, 3072 b .SVLPSPL0 .SVLPEND0: sub sp, sp, x16 .cfi_escape 0xf,0xc,0x8f,0,0x92,0x2e,0,0x8,0x58,0x1e,0x23,0xb0,0x2,0x22 This has about the same semantics as alloca, except we prioritize the common case where no probe is required. We also change the amount we adjust the stack and the probing interval to be the nearest value to `guard size - abi buffer` that fits in the 12-bit shifted immediate used by cmp. While this would mean we probe a bit more often than we require, in practice the amount of SVE vectors you'd need to spill is significant. Even more so to enter the loop more than once. gcc/ PR target/86486 * config/aarch64/aarch64-protos.h (aarch64_output_probe_sve_stack_clash): New. * config/aarch64/aarch64.c (aarch64_output_probe_sve_stack_clash, aarch64_clamp_to_uimm12_shift): New. (aarch64_allocate_and_probe_stack_space): Add SVE specific section. * config/aarch64/aarch64.md (probe_sve_stack_clash): New. gcc/testsuite/ PR target/86486 * gcc.target/aarch64/stack-check-prologue-16.c: New test * gcc.target/aarch64/stack-check-cfa-3.c: New test. * gcc.target/aarch64/sve/struct_vect_24.c: New test. * gcc.target/aarch64/sve/struct_vect_24_run.c: New test. From-SVN: r264749 --- gcc/ChangeLog | 9 ++ gcc/config/aarch64/aarch64-protos.h | 1 + gcc/config/aarch64/aarch64.c | 155 ++++++++++++++++++++- gcc/config/aarch64/aarch64.md | 19 +++ gcc/testsuite/ChangeLog | 8 ++ .../gcc.target/aarch64/stack-check-cfa-3.c | 13 ++ .../gcc.target/aarch64/stack-check-prologue-16.c | 32 +++++ .../gcc.target/aarch64/sve/struct_vect_24.c | 48 +++++++ .../gcc.target/aarch64/sve/struct_vect_24_run.c | 37 +++++ 9 files changed, 317 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-cfa-3.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-prologue-16.c create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/struct_vect_24.c create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/struct_vect_24_run.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0d02631..4da1c62 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,15 @@ 2018-10-01 Tamar Christina PR target/86486 + * config/aarch64/aarch64-protos.h (aarch64_output_probe_sve_stack_clash): New. + * config/aarch64/aarch64.c (aarch64_output_probe_sve_stack_clash, + aarch64_clamp_to_uimm12_shift): New. + (aarch64_allocate_and_probe_stack_space): Add SVE specific section. + * config/aarch64/aarch64.md (probe_sve_stack_clash): New. + +2018-10-01 Tamar Christina + + PR target/86486 * config/aarch64/aarch64.c (aarch64_layout_frame): Add assert. 2018-10-01 Jeff Law diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index caf1d20..5f18837 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -497,6 +497,7 @@ void aarch64_asm_output_labelref (FILE *, const char *); void aarch64_cpu_cpp_builtins (cpp_reader *); const char * aarch64_gen_far_branch (rtx *, int, const char *, const char *); const char * aarch64_output_probe_stack_range (rtx, rtx); +const char * aarch64_output_probe_sve_stack_clash (rtx, rtx, rtx, rtx); void aarch64_err_no_fpadvsimd (machine_mode); void aarch64_expand_epilogue (bool); void aarch64_expand_mov_immediate (rtx, rtx, rtx (*) (rtx, rtx) = 0); diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 9507608..1351caa 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -166,6 +166,7 @@ static bool aarch64_builtin_support_vector_misalignment (machine_mode mode, static machine_mode aarch64_simd_container_mode (scalar_mode, poly_int64); static bool aarch64_print_address_internal (FILE*, machine_mode, rtx, aarch64_addr_query_type); +static HOST_WIDE_INT aarch64_clamp_to_uimm12_shift (HOST_WIDE_INT val); /* Major revision number of the ARM Architecture implemented by the target. */ unsigned aarch64_architecture_version; @@ -4020,6 +4021,84 @@ aarch64_output_probe_stack_range (rtx reg1, rtx reg2) return ""; } +/* Emit the probe loop for doing stack clash probes and stack adjustments for + SVE. This emits probes from BASE to BASE - ADJUSTMENT based on a guard size + of GUARD_SIZE. When a probe is emitted it is done at most + MIN_PROBE_THRESHOLD bytes from the current BASE at an interval of + at most MIN_PROBE_THRESHOLD. By the end of this function + BASE = BASE - ADJUSTMENT. */ + +const char * +aarch64_output_probe_sve_stack_clash (rtx base, rtx adjustment, + rtx min_probe_threshold, rtx guard_size) +{ + /* This function is not allowed to use any instruction generation function + like gen_ and friends. If you do you'll likely ICE during CFG validation, + so instead emit the code you want using output_asm_insn. */ + gcc_assert (flag_stack_clash_protection); + gcc_assert (CONST_INT_P (min_probe_threshold) && CONST_INT_P (guard_size)); + gcc_assert (INTVAL (guard_size) > INTVAL (min_probe_threshold)); + + /* The minimum required allocation before the residual requires probing. */ + HOST_WIDE_INT residual_probe_guard = INTVAL (min_probe_threshold); + + /* Clamp the value down to the nearest value that can be used with a cmp. */ + residual_probe_guard = aarch64_clamp_to_uimm12_shift (residual_probe_guard); + rtx probe_offset_value_rtx = gen_int_mode (residual_probe_guard, Pmode); + + gcc_assert (INTVAL (min_probe_threshold) >= residual_probe_guard); + gcc_assert (aarch64_uimm12_shift (residual_probe_guard)); + + static int labelno = 0; + char loop_start_lab[32]; + char loop_end_lab[32]; + rtx xops[2]; + + ASM_GENERATE_INTERNAL_LABEL (loop_start_lab, "SVLPSPL", labelno); + ASM_GENERATE_INTERNAL_LABEL (loop_end_lab, "SVLPEND", labelno++); + + /* Emit loop start label. */ + ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, loop_start_lab); + + /* ADJUSTMENT < RESIDUAL_PROBE_GUARD. */ + xops[0] = adjustment; + xops[1] = probe_offset_value_rtx; + output_asm_insn ("cmp\t%0, %1", xops); + + /* Branch to end if not enough adjustment to probe. */ + fputs ("\tb.lt\t", asm_out_file); + assemble_name_raw (asm_out_file, loop_end_lab); + fputc ('\n', asm_out_file); + + /* BASE = BASE - RESIDUAL_PROBE_GUARD. */ + xops[0] = base; + xops[1] = probe_offset_value_rtx; + output_asm_insn ("sub\t%0, %0, %1", xops); + + /* Probe at BASE. */ + xops[1] = const0_rtx; + output_asm_insn ("str\txzr, [%0, %1]", xops); + + /* ADJUSTMENT = ADJUSTMENT - RESIDUAL_PROBE_GUARD. */ + xops[0] = adjustment; + xops[1] = probe_offset_value_rtx; + output_asm_insn ("sub\t%0, %0, %1", xops); + + /* Branch to start if still more bytes to allocate. */ + fputs ("\tb\t", asm_out_file); + assemble_name_raw (asm_out_file, loop_start_lab); + fputc ('\n', asm_out_file); + + /* No probe leave. */ + ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, loop_end_lab); + + /* BASE = BASE - ADJUSTMENT. */ + xops[0] = base; + xops[1] = adjustment; + output_asm_insn ("sub\t%0, %0, %1", xops); + return ""; +} + /* Determine whether a frame chain needs to be generated. */ static bool aarch64_needs_frame_chain (void) @@ -4877,21 +4956,73 @@ aarch64_allocate_and_probe_stack_space (rtx temp1, rtx temp2, } } - HOST_WIDE_INT size; /* If SIZE is not large enough to require probing, just adjust the stack and exit. */ - if (!poly_size.is_constant (&size) - || known_lt (poly_size, min_probe_threshold) + if (known_lt (poly_size, min_probe_threshold) || !flag_stack_clash_protection) { aarch64_sub_sp (temp1, temp2, poly_size, frame_related_p); return; } + HOST_WIDE_INT size; + /* Handle the SVE non-constant case first. */ + if (!poly_size.is_constant (&size)) + { + if (dump_file) + { + fprintf (dump_file, "Stack clash SVE prologue: "); + print_dec (poly_size, dump_file); + fprintf (dump_file, " bytes, dynamic probing will be required.\n"); + } + + /* First calculate the amount of bytes we're actually spilling. */ + aarch64_add_offset (Pmode, temp1, CONST0_RTX (Pmode), + poly_size, temp1, temp2, false, true); + + rtx_insn *insn = get_last_insn (); + + if (frame_related_p) + { + /* This is done to provide unwinding information for the stack + adjustments we're about to do, however to prevent the optimizers + from removing the R15 move and leaving the CFA note (which would be + very wrong) we tie the old and new stack pointer together. + The tie will expand to nothing but the optimizers will not touch + the instruction. */ + rtx stack_ptr_copy = gen_rtx_REG (Pmode, R15_REGNUM); + emit_move_insn (stack_ptr_copy, stack_pointer_rtx); + emit_insn (gen_stack_tie (stack_ptr_copy, stack_pointer_rtx)); + + /* We want the CFA independent of the stack pointer for the + duration of the loop. */ + add_reg_note (insn, REG_CFA_DEF_CFA, stack_ptr_copy); + RTX_FRAME_RELATED_P (insn) = 1; + } + + rtx probe_const = gen_int_mode (min_probe_threshold, Pmode); + rtx guard_const = gen_int_mode (guard_size, Pmode); + + insn = emit_insn (gen_probe_sve_stack_clash (Pmode, stack_pointer_rtx, + stack_pointer_rtx, temp1, + probe_const, guard_const)); + + /* Now reset the CFA register if needed. */ + if (frame_related_p) + { + add_reg_note (insn, REG_CFA_DEF_CFA, + gen_rtx_PLUS (Pmode, stack_pointer_rtx, + gen_int_mode (poly_size, Pmode))); + RTX_FRAME_RELATED_P (insn) = 1; + } + + return; + } + if (dump_file) fprintf (dump_file, - "Stack clash AArch64 prologue: " HOST_WIDE_INT_PRINT_DEC " bytes" - ", probing will be required.\n", size); + "Stack clash AArch64 prologue: " HOST_WIDE_INT_PRINT_DEC + " bytes, probing will be required.\n", size); /* Round size to the nearest multiple of guard_size, and calculate the residual as the difference between the original size and the rounded @@ -5494,6 +5625,20 @@ aarch64_uimm12_shift (HOST_WIDE_INT val) ); } +/* Returns the nearest value to VAL that will fit as a 12-bit unsigned immediate + that can be created with a left shift of 0 or 12. */ +static HOST_WIDE_INT +aarch64_clamp_to_uimm12_shift (HOST_WIDE_INT val) +{ + /* Check to see if the value fits in 24 bits, as that is the maximum we can + handle correctly. */ + gcc_assert ((val & 0xffffff) == val); + + if (((val & 0xfff) << 0) == val) + return val; + + return val & (0xfff << 12); +} /* Return true if val is an immediate that can be loaded into a register by a MOVZ instruction. */ diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 77c9497..b4a4315 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -6514,6 +6514,25 @@ [(set_attr "length" "32")] ) +;; This instruction is used to generate the stack clash stack adjustment and +;; probing loop. We can't change the control flow during prologue and epilogue +;; code generation. So we must emit a volatile unspec and expand it later on. + +(define_insn "@probe_sve_stack_clash_" + [(set (match_operand:P 0 "register_operand" "=rk") + (unspec_volatile:P [(match_operand:P 1 "register_operand" "0") + (match_operand:P 2 "register_operand" "r") + (match_operand:P 3 "const_int_operand" "n") + (match_operand:P 4 "aarch64_plus_immediate" "L")] + UNSPECV_PROBE_STACK_RANGE))] + "TARGET_SVE" +{ + return aarch64_output_probe_sve_stack_clash (operands[0], operands[2], + operands[3], operands[4]); +} + [(set_attr "length" "28")] +) + ;; Named pattern for expanding thread pointer reference. (define_expand "get_thread_pointerdi" [(match_operand:DI 0 "register_operand" "=r")] diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9d7f246..84c4fa9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2018-10-01 Tamar Christina + + PR target/86486 + * gcc.target/aarch64/stack-check-prologue-16.c: New test + * gcc.target/aarch64/stack-check-cfa-3.c: New test. + * gcc.target/aarch64/sve/struct_vect_24.c: New test. + * gcc.target/aarch64/sve/struct_vect_24_run.c: New test. + 2018-10-01 Jeff Law Richard Sandiford Tamar Christina diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-cfa-3.c b/gcc/testsuite/gcc.target/aarch64/stack-check-cfa-3.c new file mode 100644 index 0000000..41579f2 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-cfa-3.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fopenmp-simd -march=armv8-a+sve -fstack-clash-protection --param stack-clash-protection-guard-size=16 -funwind-tables" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#include "stack-check-prologue-16.c" + +/* Checks that the CFA notes are correct for every sp adjustment, but we also + need to make sure we can unwind correctly before the frame is set up. So + check that we're emitting r15 with a copy of sp an setting the CFA there. */ + +/* { dg-final { scan-assembler-times {mov\tx15, sp} 1 } } */ +/* { dg-final { scan-assembler-times {\.cfi_def_cfa_register 15} 1 } } */ +/* { dg-final { scan-assembler-times {\.cfi_escape 0xf,0xc,0x8f,0,0x92,0x2e,0,.*} 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-16.c b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-16.c new file mode 100644 index 0000000..d92ef47 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-16.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ +/* { dg-options "-O3 -fopenmp-simd -march=armv8-a+sve -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ + +/* Invoke X (P##n) for n in [0, 7]. */ +#define REPEAT8(X, P) \ + X (P##0) X (P##1) X (P##2) X (P##3) X (P##4) X (P##5) X (P##6) X (P##7) + +/* Invoke X (n) for all octal n in [0, 39]. */ +#define REPEAT40(X) \ + REPEAT8 (X, 0) REPEAT8 (X, 1) REPEAT8 (X, 2) REPEAT8 (X, 3) REPEAT8 (X, 4) + +/* Expect vector work to be done, with spilling of vector registers. */ +void +f2 (int x[40][100], int *y) +{ + /* Try to force some spilling. */ +#define DECLARE(N) int y##N = y[N]; + REPEAT40 (DECLARE); +#pragma omp simd + for (int i = 0; i < 100; ++i) + { +#define INC(N) x[N][i] += y##N; + REPEAT40 (INC); + } +} + +/* SVE spill, requires probing as vector size is unknown at compile time. */ + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 0\]} 1 } } */ +/* { dg-final { scan-assembler-times {cmp\s+x[0-9]+, 61440} 1 } } */ +/* { dg-final { scan-assembler-times {sub\s+x[0-9]+, x[0-9]+, 61440} 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_24.c b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_24.c new file mode 100644 index 0000000..68a9d5e --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_24.c @@ -0,0 +1,48 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ +/* { dg-options "-O3 -fopenmp-simd -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ + +#include + +#define N 50 +#define S 2 * 64 * 1024 + +/* Invoke X (P##n) for n in [0, 9]. */ +#define REPEAT8(X, P) \ + X (P##0) X (P##1) X (P##2) X (P##3) X (P##4) X (P##5) X (P##6) X (P##7) \ + X (P##8) X (P##9) + +/* Invoke X (n) for all n in [0, 49]. */ +#define REPEAT50(X) \ + REPEAT8 (X, ) REPEAT8 (X, 1) REPEAT8 (X, 2) REPEAT8 (X, 3) REPEAT8 (X, 4) + + /* Try to force some spilling. */ +#define DECLARE(N) int src##N = src[N * 4]; +#define INC(N) dest[i] += src##N; + +#define TEST_LOOP(NAME, TYPE) \ + void __attribute__ ((noinline, noclone, simd)) \ + NAME (TYPE *restrict dest, TYPE *restrict src) \ + { \ + REPEAT50 (DECLARE); \ + volatile char foo[S]; \ + foo[S-1]=1; \ + for (int i = 0; i < N; i++) \ + { \ + REPEAT50 (INC); \ + } \ + } + +#define TEST(NAME) \ + TEST_LOOP (NAME##_i32, int32_t) \ + TEST_LOOP (NAME##_i64, int64_t) \ + TEST_LOOP (NAME##_f32, float) \ + TEST_LOOP (NAME##_f64, double) + +TEST (test) + +/* Check the vectorized loop for stack clash probing. */ + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 0\]} 4 } } */ +/* { dg-final { scan-assembler-times {cmp\s+x[0-9]+, 61440} 4 } } */ +/* { dg-final { scan-assembler-times {sub\s+x[0-9]+, x[0-9]+, 61440} 4 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_24_run.c b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_24_run.c new file mode 100644 index 0000000..e764476 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_24_run.c @@ -0,0 +1,37 @@ +/* { dg-do run { target aarch64_sve_hw } } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ +/* { dg-options "-O3 -fopenmp-simd -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ + +#include "struct_vect_24.c" + +#undef TEST_LOOP +#define TEST_LOOP(NAME, TYPE) \ + { \ + TYPE out[N]; \ + TYPE in[N * 4]; \ + for (int i = 0; i < N; ++i) \ + { \ + out[i] = i * 7 / 2; \ + asm volatile ("" ::: "memory"); \ + } \ + for (int i = 0; i < N * 4; ++i) \ + { \ + in[i] = i * 9 / 2; \ + asm volatile ("" ::: "memory"); \ + } \ + NAME (out, in); \ + for (int i = 0; i < N; ++i) \ + { \ + TYPE expected = i * 7 / 2; \ + if (out[i] != out[0] + expected) \ + __builtin_abort (); \ + asm volatile ("" ::: "memory"); \ + } \ + } + +int __attribute__ ((optimize (0))) +main (void) +{ + TEST (test); + return 0; +} -- cgit v1.1 From 2c25083e75fa265fd6cdd749a264951dc002d90b Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Mon, 1 Oct 2018 12:58:21 +0000 Subject: Add a hook to support telling the mid-end when to probe the stack. This patch adds a hook to tell the mid-end about the probing requirements of the target. On AArch64 we allow a specific range for which no probing needs to be done. This same range is also the amount that will have to be probed up when a probe is needed after dropping the stack. Defining this probe comes with the extra requirement that the outgoing arguments size of any function that uses alloca and stack clash be at the very least 8 bytes. With this invariant we can skip doing the zero checks for alloca and save some code. A simplified version of the AArch64 stack frame is: +-----------------------+ | | | | | | +-----------------------+ |LR | +-----------------------+ |FP | +-----------------------+ |dynamic allocations | -\ probe range hook effects these +-----------------------+ --\ and ensures that outgoing stack |padding | -- args is always > 8 when alloca. +-----------------------+ ---/ Which means it's always safe to probe |outgoing stack args |-/ at SP +-----------------------+ This allows us to generate better code than without the hook without affecting other targets. With this patch I am also removing the stack_clash_protection_final_dynamic_probe hook which was added specifically for AArch64 but that is no longer needed. gcc/ PR target/86486 * explow.c (anti_adjust_stack_and_probe_stack_clash): Support custom probe ranges. * target.def (stack_clash_protection_alloca_probe_range): New. (stack_clash_protection_final_dynamic_probe): Remove. * targhooks.h (default_stack_clash_protection_alloca_probe_range) New. (default_stack_clash_protection_final_dynamic_probe): Remove. * targhooks.c: Likewise. * doc/tm.texi.in (TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE): New. (TARGET_STACK_CLASH_PROTECTION_FINAL_DYNAMIC_PROBE): Remove. * doc/tm.texi: Regenerate. From-SVN: r264750 --- gcc/ChangeLog | 14 ++++++++ gcc/doc/tm.texi | 8 +++-- gcc/doc/tm.texi.in | 2 +- gcc/explow.c | 95 ++++++++++++++++++++++++++++++++---------------------- gcc/target.def | 15 ++++++--- gcc/targhooks.c | 6 ++-- gcc/targhooks.h | 2 +- 7 files changed, 93 insertions(+), 49 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4da1c62..9eda3cd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,20 @@ 2018-10-01 Tamar Christina PR target/86486 + * explow.c (anti_adjust_stack_and_probe_stack_clash): Support custom + probe ranges. + * target.def (stack_clash_protection_alloca_probe_range): New. + (stack_clash_protection_final_dynamic_probe): Remove. + * targhooks.h (default_stack_clash_protection_alloca_probe_range) New. + (default_stack_clash_protection_final_dynamic_probe): Remove. + * targhooks.c: Likewise. + * doc/tm.texi.in (TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE): New. + (TARGET_STACK_CLASH_PROTECTION_FINAL_DYNAMIC_PROBE): Remove. + * doc/tm.texi: Regenerate. + +2018-10-01 Tamar Christina + + PR target/86486 * config/aarch64/aarch64-protos.h (aarch64_output_probe_sve_stack_clash): New. * config/aarch64/aarch64.c (aarch64_output_probe_sve_stack_clash, aarch64_clamp_to_uimm12_shift): New. diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 561bda3..b00e4b6 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -3450,8 +3450,12 @@ GCC computed the default from the values of the above macros and you will normally not need to override that default. @end defmac -@deftypefn {Target Hook} bool TARGET_STACK_CLASH_PROTECTION_FINAL_DYNAMIC_PROBE (rtx @var{residual}) -Some targets make optimistic assumptions about the state of stack probing when they emit their prologues. On such targets a probe into the end of any dynamically allocated space is likely required for safety against stack clash style attacks. Define this variable to return nonzero if such a probe is required or zero otherwise. You need not define this macro if it would always have the value zero. +@deftypefn {Target Hook} HOST_WIDE_INT TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE (void) +Some targets have an ABI defined interval for which no probing needs to be done. +When a probe does need to be done this same interval is used as the probe distance up when doing stack clash protection for alloca. +On such targets this value can be set to override the default probing up interval. +Define this variable to return nonzero if such a probe range is required or zero otherwise. Defining this hook also requires your functions which make use of alloca to have at least 8 byesof outgoing arguments. If this is not the case the stack will be corrupted. +You need not define this macro if it would always have the value zero. @end deftypefn @need 2000 diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index c509a9b..e2b6f94 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -2841,7 +2841,7 @@ GCC computed the default from the values of the above macros and you will normally not need to override that default. @end defmac -@hook TARGET_STACK_CLASH_PROTECTION_FINAL_DYNAMIC_PROBE +@hook TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE @need 2000 @node Frame Registers diff --git a/gcc/explow.c b/gcc/explow.c index 7d83eb1..1dabd6f 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -1958,10 +1958,21 @@ anti_adjust_stack_and_probe_stack_clash (rtx size) /* We can get here with a constant size on some targets. */ rtx rounded_size, last_addr, residual; - HOST_WIDE_INT probe_interval; + HOST_WIDE_INT probe_interval, probe_range; + bool target_probe_range_p = false; compute_stack_clash_protection_loop_data (&rounded_size, &last_addr, &residual, &probe_interval, size); + /* Get the back-end specific probe ranges. */ + probe_range = targetm.stack_clash_protection_alloca_probe_range (); + target_probe_range_p = probe_range != 0; + gcc_assert (probe_range >= 0); + + /* If no back-end specific range defined, default to the top of the newly + allocated range. */ + if (probe_range == 0) + probe_range = probe_interval - GET_MODE_SIZE (word_mode); + if (rounded_size != CONST0_RTX (Pmode)) { if (CONST_INT_P (rounded_size) @@ -1972,13 +1983,12 @@ anti_adjust_stack_and_probe_stack_clash (rtx size) i += probe_interval) { anti_adjust_stack (GEN_INT (probe_interval)); - /* The prologue does not probe residuals. Thus the offset here to probe just beyond what the prologue had already allocated. */ emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx, - (probe_interval - - GET_MODE_SIZE (word_mode)))); + probe_range)); + emit_insn (gen_blockage ()); } } @@ -1992,10 +2002,10 @@ anti_adjust_stack_and_probe_stack_clash (rtx size) anti_adjust_stack (GEN_INT (probe_interval)); /* The prologue does not probe residuals. Thus the offset here - to probe just beyond what the prologue had already allocated. */ + to probe just beyond what the prologue had already + allocated. */ emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx, - (probe_interval - - GET_MODE_SIZE (word_mode)))); + probe_range)); emit_stack_clash_protection_probe_loop_end (loop_lab, end_loop, last_addr, rotate_loop); @@ -2010,48 +2020,55 @@ anti_adjust_stack_and_probe_stack_clash (rtx size) hold live data. Furthermore, we do not want to probe into the red zone. - Go ahead and just guard the probe at *sp on RESIDUAL != 0 at - runtime if RESIDUAL is not a compile time constant. */ + If TARGET_PROBE_RANGE_P then the target has promised it's safe to + probe at offset 0. In which case we no longer have to check for + RESIDUAL == 0. However we still need to probe at the right offset + when RESIDUAL > PROBE_RANGE, in which case we probe at PROBE_RANGE. + + If !TARGET_PROBE_RANGE_P then go ahead and just guard the probe at *sp + on RESIDUAL != 0 at runtime if RESIDUAL is not a compile time constant. + */ + anti_adjust_stack (residual); + if (!CONST_INT_P (residual)) { label = gen_label_rtx (); - emit_cmp_and_jump_insns (residual, CONST0_RTX (GET_MODE (residual)), - EQ, NULL_RTX, Pmode, 1, label); - } + rtx_code op = target_probe_range_p ? LT : EQ; + rtx probe_cmp_value = target_probe_range_p + ? gen_rtx_CONST_INT (GET_MODE (residual), probe_range) + : CONST0_RTX (GET_MODE (residual)); - rtx x = force_reg (Pmode, plus_constant (Pmode, residual, - -GET_MODE_SIZE (word_mode))); - anti_adjust_stack (residual); - emit_stack_probe (gen_rtx_PLUS (Pmode, stack_pointer_rtx, x)); - emit_insn (gen_blockage ()); - if (!CONST_INT_P (residual)) - emit_label (label); - } + if (target_probe_range_p) + emit_stack_probe (stack_pointer_rtx); - /* Some targets make optimistic assumptions in their prologues about - how the caller may have probed the stack. Make sure we honor - those assumptions when needed. */ - if (size != CONST0_RTX (Pmode) - && targetm.stack_clash_protection_final_dynamic_probe (residual)) - { - /* SIZE could be zero at runtime and in that case *sp could hold - live data. Furthermore, we don't want to probe into the red - zone. + emit_cmp_and_jump_insns (residual, probe_cmp_value, + op, NULL_RTX, Pmode, 1, label); + } - Go ahead and just guard the probe at *sp on SIZE != 0 at runtime - if SIZE is not a compile time constant. */ - rtx label = NULL_RTX; - if (!CONST_INT_P (size)) + rtx x = NULL_RTX; + + /* If RESIDUAL isn't a constant and TARGET_PROBE_RANGE_P then we probe up + by the ABI defined safe value. */ + if (!CONST_INT_P (residual) && target_probe_range_p) + x = GEN_INT (probe_range); + /* If RESIDUAL is a constant but smaller than the ABI defined safe value, + we still want to probe up, but the safest amount if a word. */ + else if (target_probe_range_p) { - label = gen_label_rtx (); - emit_cmp_and_jump_insns (size, CONST0_RTX (GET_MODE (size)), - EQ, NULL_RTX, Pmode, 1, label); + if (INTVAL (residual) <= probe_range) + x = GEN_INT (GET_MODE_SIZE (word_mode)); + else + x = GEN_INT (probe_range); } + else + /* If nothing else, probe at the top of the new allocation. */ + x = plus_constant (Pmode, residual, -GET_MODE_SIZE (word_mode)); + + emit_stack_probe (gen_rtx_PLUS (Pmode, stack_pointer_rtx, x)); - emit_stack_probe (stack_pointer_rtx); emit_insn (gen_blockage ()); - if (!CONST_INT_P (size)) - emit_label (label); + if (!CONST_INT_P (residual)) + emit_label (label); } } diff --git a/gcc/target.def b/gcc/target.def index 9e22423..9733edf 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -5854,10 +5854,17 @@ these registers when the target switches are opposed to them.)", hook_void_void) DEFHOOK -(stack_clash_protection_final_dynamic_probe, - "Some targets make optimistic assumptions about the state of stack probing when they emit their prologues. On such targets a probe into the end of any dynamically allocated space is likely required for safety against stack clash style attacks. Define this variable to return nonzero if such a probe is required or zero otherwise. You need not define this macro if it would always have the value zero.", - bool, (rtx residual), - default_stack_clash_protection_final_dynamic_probe) +(stack_clash_protection_alloca_probe_range, + "Some targets have an ABI defined interval for which no probing needs to be done.\n\ +When a probe does need to be done this same interval is used as the probe distance \ +up when doing stack clash protection for alloca.\n\ +On such targets this value can be set to override the default probing up interval.\n\ +Define this variable to return nonzero if such a probe range is required or zero otherwise. \ +Defining this hook also requires your functions which make use of alloca to have at least 8 byes\ +of outgoing arguments. If this is not the case the stack will be corrupted.\n\ +You need not define this macro if it would always have the value zero.", + HOST_WIDE_INT, (void), + default_stack_clash_protection_alloca_probe_range) /* Functions specific to the C family of frontends. */ diff --git a/gcc/targhooks.c b/gcc/targhooks.c index afd56f3..3d8b3b9 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -2310,8 +2310,10 @@ default_excess_precision (enum excess_precision_type ATTRIBUTE_UNUSED) return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT; } -bool -default_stack_clash_protection_final_dynamic_probe (rtx residual ATTRIBUTE_UNUSED) +/* Default implementation for + TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE. */ +HOST_WIDE_INT +default_stack_clash_protection_alloca_probe_range (void) { return 0; } diff --git a/gcc/targhooks.h b/gcc/targhooks.h index f92ca5c..176c64d 100644 --- a/gcc/targhooks.h +++ b/gcc/targhooks.h @@ -277,7 +277,7 @@ extern unsigned int default_min_arithmetic_precision (void); extern enum flt_eval_method default_excess_precision (enum excess_precision_type ATTRIBUTE_UNUSED); -extern bool default_stack_clash_protection_final_dynamic_probe (rtx); +extern HOST_WIDE_INT default_stack_clash_protection_alloca_probe_range (void); extern void default_select_early_remat_modes (sbitmap); extern tree default_preferred_else_value (unsigned, tree, unsigned, tree *); -- cgit v1.1 From 8c6e3b2355b0cd245b0a4f802044d8fd885ea03e Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Mon, 1 Oct 2018 13:00:58 +0000 Subject: Ensure that outgoing argument size is at least 8 bytes when alloca and stack-clash. This patch adds a requirement that the number of outgoing arguments for a function is at least 8 bytes when using stack-clash protection and alloca. By using this condition we can avoid a check in the alloca code and so have smaller and simpler code there. A simplified version of the AArch64 stack frames is: +-----------------------+ | | | | | | +-----------------------+ |LR | +-----------------------+ |FP | +-----------------------+ |dynamic allocations | ---- expanding area which will push the outgoing +-----------------------+ args down during each allocation. |padding | +-----------------------+ |outgoing stack args | ---- safety buffer of 8 bytes (aligned) +-----------------------+ By always defining an outgoing argument, alloca(0) effectively is safe to probe at $sp due to the reserved buffer being there. It will never corrupt the stack. This is also safe for alloca(x) where x is 0 or x % page_size == 0. In the former it is the same case as alloca(0) while the latter is safe because any allocation pushes the outgoing stack args down: |FP | +-----------------------+ | | |dynamic allocations | ---- alloca (x) | | +-----------------------+ |padding | +-----------------------+ |outgoing stack args | ---- safety buffer of 8 bytes (aligned) +-----------------------+ Which means when you probe for the residual, if it's 0 you'll again just probe in the outgoing stack args range, which we know is non-zero (at least 8 bytes). gcc/ PR target/86486 * config/aarch64/aarch64.h (STACK_CLASH_MIN_BYTES_OUTGOING_ARGS, STACK_DYNAMIC_OFFSET): New. * config/aarch64/aarch64.c (aarch64_layout_frame): Update outgoing args size. (aarch64_stack_clash_protection_alloca_probe_range, TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE): New. gcc/testsuite/ PR target/86486 * gcc.target/aarch64/stack-check-alloca-1.c: New. * gcc.target/aarch64/stack-check-alloca-10.c: New. * gcc.target/aarch64/stack-check-alloca-2.c: New. * gcc.target/aarch64/stack-check-alloca-3.c: New. * gcc.target/aarch64/stack-check-alloca-4.c: New. * gcc.target/aarch64/stack-check-alloca-5.c: New. * gcc.target/aarch64/stack-check-alloca-6.c: New. * gcc.target/aarch64/stack-check-alloca-7.c: New. * gcc.target/aarch64/stack-check-alloca-8.c: New. * gcc.target/aarch64/stack-check-alloca-9.c: New. * gcc.target/aarch64/stack-check-alloca.h: New. * gcc.target/aarch64/stack-check-14.c: New. * gcc.target/aarch64/stack-check-15.c: New. From-SVN: r264751 --- gcc/ChangeLog | 10 +++++++++ gcc/config/aarch64/aarch64.c | 18 ++++++++++++++++ gcc/config/aarch64/aarch64.h | 17 +++++++++++++++ gcc/testsuite/ChangeLog | 17 +++++++++++++++ gcc/testsuite/gcc.target/aarch64/stack-check-14.c | 24 ++++++++++++++++++++++ gcc/testsuite/gcc.target/aarch64/stack-check-15.c | 21 +++++++++++++++++++ .../gcc.target/aarch64/stack-check-alloca-1.c | 14 +++++++++++++ .../gcc.target/aarch64/stack-check-alloca-10.c | 12 +++++++++++ .../gcc.target/aarch64/stack-check-alloca-2.c | 10 +++++++++ .../gcc.target/aarch64/stack-check-alloca-3.c | 10 +++++++++ .../gcc.target/aarch64/stack-check-alloca-4.c | 11 ++++++++++ .../gcc.target/aarch64/stack-check-alloca-5.c | 11 ++++++++++ .../gcc.target/aarch64/stack-check-alloca-6.c | 11 ++++++++++ .../gcc.target/aarch64/stack-check-alloca-7.c | 11 ++++++++++ .../gcc.target/aarch64/stack-check-alloca-8.c | 13 ++++++++++++ .../gcc.target/aarch64/stack-check-alloca-9.c | 12 +++++++++++ .../gcc.target/aarch64/stack-check-alloca.h | 13 ++++++++++++ 17 files changed, 235 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-14.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-15.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-alloca-1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-alloca-10.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-alloca-2.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-alloca-3.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-alloca-4.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-alloca-5.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-alloca-6.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-alloca-7.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-alloca-8.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-alloca-9.c create mode 100644 gcc/testsuite/gcc.target/aarch64/stack-check-alloca.h (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9eda3cd..a379cc4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,16 @@ 2018-10-01 Tamar Christina PR target/86486 + * config/aarch64/aarch64.h (STACK_CLASH_MIN_BYTES_OUTGOING_ARGS, + STACK_DYNAMIC_OFFSET): New. + * config/aarch64/aarch64.c (aarch64_layout_frame): + Update outgoing args size. + (aarch64_stack_clash_protection_alloca_probe_range, + TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE): New. + +2018-10-01 Tamar Christina + + PR target/86486 * explow.c (anti_adjust_stack_and_probe_stack_clash): Support custom probe ranges. * target.def (stack_clash_protection_alloca_probe_range): New. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 1351caa..2352407 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -4129,6 +4129,10 @@ aarch64_layout_frame (void) cfun->machine->frame.emit_frame_chain = aarch64_needs_frame_chain (); + /* Adjust the outgoing arguments size if required. Keep it in sync with what + the mid-end is doing. */ + crtl->outgoing_args_size = STACK_DYNAMIC_OFFSET (cfun); + #define SLOT_NOT_REQUIRED (-2) #define SLOT_REQUIRED (-1) @@ -4899,6 +4903,16 @@ aarch64_set_handled_components (sbitmap components) cfun->machine->reg_is_wrapped_separately[regno] = true; } +/* On AArch64 we have an ABI defined safe buffer. This constant is used to + determining the probe offset for alloca. */ + +static HOST_WIDE_INT +aarch64_stack_clash_protection_alloca_probe_range (void) +{ + return STACK_CLASH_CALLER_GUARD; +} + + /* Allocate POLY_SIZE bytes of stack space using TEMP1 and TEMP2 as scratch registers. If POLY_SIZE is not large enough to require a probe this function will only adjust the stack. When allocating the stack space @@ -18413,6 +18427,10 @@ aarch64_libgcc_floating_mode_supported_p #undef TARGET_CONSTANT_ALIGNMENT #define TARGET_CONSTANT_ALIGNMENT aarch64_constant_alignment +#undef TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE +#define TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE \ + aarch64_stack_clash_protection_alloca_probe_range + #undef TARGET_COMPUTE_PRESSURE_CLASSES #define TARGET_COMPUTE_PRESSURE_CLASSES aarch64_compute_pressure_classes diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index 7b130be..fa9af26 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -88,6 +88,10 @@ before probing has to be done for stack clash protection. */ #define STACK_CLASH_CALLER_GUARD 1024 +/* This value represents the minimum amount of bytes we expect the function's + outgoing arguments to be when stack-clash is enabled. */ +#define STACK_CLASH_MIN_BYTES_OUTGOING_ARGS 8 + /* This value controls how many pages we manually unroll the loop for when generating stack clash probes. */ #define STACK_CLASH_MAX_UNROLL_PAGES 4 @@ -1076,4 +1080,17 @@ extern poly_uint16 aarch64_sve_vg; #define REGMODE_NATURAL_SIZE(MODE) aarch64_regmode_natural_size (MODE) +/* Allocate a minimum of STACK_CLASH_MIN_BYTES_OUTGOING_ARGS bytes for the + outgoing arguments if stack clash protection is enabled. This is essential + as the extra arg space allows us to skip a check in alloca. */ +#undef STACK_DYNAMIC_OFFSET +#define STACK_DYNAMIC_OFFSET(FUNDECL) \ + ((flag_stack_clash_protection \ + && cfun->calls_alloca \ + && known_lt (crtl->outgoing_args_size, \ + STACK_CLASH_MIN_BYTES_OUTGOING_ARGS)) \ + ? ROUND_UP (STACK_CLASH_MIN_BYTES_OUTGOING_ARGS, \ + STACK_BOUNDARY / BITS_PER_UNIT) \ + : (crtl->outgoing_args_size + STACK_POINTER_OFFSET)) + #endif /* GCC_AARCH64_H */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 84c4fa9..0252a1d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,23 @@ 2018-10-01 Tamar Christina PR target/86486 + * gcc.target/aarch64/stack-check-alloca-1.c: New. + * gcc.target/aarch64/stack-check-alloca-10.c: New. + * gcc.target/aarch64/stack-check-alloca-2.c: New. + * gcc.target/aarch64/stack-check-alloca-3.c: New. + * gcc.target/aarch64/stack-check-alloca-4.c: New. + * gcc.target/aarch64/stack-check-alloca-5.c: New. + * gcc.target/aarch64/stack-check-alloca-6.c: New. + * gcc.target/aarch64/stack-check-alloca-7.c: New. + * gcc.target/aarch64/stack-check-alloca-8.c: New. + * gcc.target/aarch64/stack-check-alloca-9.c: New. + * gcc.target/aarch64/stack-check-alloca.h: New. + * gcc.target/aarch64/stack-check-14.c: New. + * gcc.target/aarch64/stack-check-15.c: New. + +2018-10-01 Tamar Christina + + PR target/86486 * gcc.target/aarch64/stack-check-prologue-16.c: New test * gcc.target/aarch64/stack-check-cfa-3.c: New test. * gcc.target/aarch64/sve/struct_vect_24.c: New test. diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-14.c b/gcc/testsuite/gcc.target/aarch64/stack-check-14.c new file mode 100644 index 0000000..a573d10 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-14.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +int t1(int); + +int t2(int x) +{ + char *p = __builtin_alloca (4050); + x = t1 (x); + return p[x]; +} + + +/* This test has a constant sized alloca that is smaller than the + probe interval. Only one probe is required since the value is larger + than 1024 bytes but smaller than 63k. + + The form can change quite a bit so we just check for two + probes without looking at the actual address. */ +/* { dg-final { scan-assembler-times "str\\txzr," 1 } } */ + + + diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-15.c b/gcc/testsuite/gcc.target/aarch64/stack-check-15.c new file mode 100644 index 0000000..497d83e --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-15.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +int t1(int); + +int t2(int x) +{ + char *p = __builtin_alloca (x); + x = t1 (x); + return p[x]; +} + + +/* This test has a variable sized alloca. It requires 3 probes. + One in the loop, one for the residual, one for when it's < 1024 and one for + when it's not. + + The form can change quite a bit so we just check for two + probes without looking at the actual address. */ +/* { dg-final { scan-assembler-times "str\\txzr," 3 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-1.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-1.c new file mode 100644 index 0000000..7fc189f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-1.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE y +#include "stack-check-alloca.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 2 } } */ +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp\]} 1 } } */ + +/* Dynamic alloca, expect loop, and 2 probes with 1kB offset and 1 at sp. + 1st probe is inside the loop for the full guard-size allocations, second + probe is for the case where residual is zero and the final probe for when + residiual is > 1024 bytes. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-10.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-10.c new file mode 100644 index 0000000..7c42206 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-10.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 127.5 * 64 * 1024 +#include "stack-check-alloca.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 2 } } */ + +/* Large alloca of an amount which isn't a multiple of a guard-size, and + residiual is more than 1kB. Loop expected with one 1Kb probe offset and + one residual probe at offset 1kB. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-2.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-2.c new file mode 100644 index 0000000..69fdd16 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-2.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 0 +#include "stack-check-alloca.h" + +/* { dg-final { scan-assembler-not {str\s+xzr,} } } */ + +/* Alloca of 0 should emit no probes, boundary condition. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-3.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-3.c new file mode 100644 index 0000000..fba3a7a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-3.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 100 +#include "stack-check-alloca.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 8\]} 1 } } */ + +/* Alloca is less than 1kB, 1 probe expected at word offset. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-4.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-4.c new file mode 100644 index 0000000..d53f30a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-4.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 2 * 1024 +#include "stack-check-alloca.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ + +/* Alloca is more than 1kB, but less than guard-size, 1 probe expected at + 1kB offset. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-5.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-5.c new file mode 100644 index 0000000..e0ff99f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-5.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 63 * 1024 +#include "stack-check-alloca.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ + +/* Alloca is more than 1kB, but less than guard-size, 1 probe expected at + 1kB offset. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-6.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-6.c new file mode 100644 index 0000000..c4bad9a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-6.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 63.5 * 1024 +#include "stack-check-alloca.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ + +/* Alloca is more than 1kB, but less than guard-size, 1 probe expected at 1kB + offset. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-7.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-7.c new file mode 100644 index 0000000..cba9ff8 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-7.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 64 * 1024 +#include "stack-check-alloca.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ + +/* Alloca is exactly one guard-size, 1 probe expected at 1kB offset. + Boundary condition. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-8.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-8.c new file mode 100644 index 0000000..5a35411 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-8.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 65 * 1024 +#include "stack-check-alloca.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 8\]} 1 } } */ + +/* Alloca is more than one guard-page, and residual is exactly 1Kb. 2 probes + expected. One at 1kB offset for the guard-size allocation and one at word + offset for the residual. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-9.c b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-9.c new file mode 100644 index 0000000..5773d80 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca-9.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +#define SIZE 127 * 64 * 1024 +#include "stack-check-alloca.h" + +/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ + +/* Large alloca of a constant amount which is a multiple of a guard-size, + no residiual. Loop expected with one 1Kb probe offset and no residual probe + because residual is at compile time known to be zero. */ diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-alloca.h b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca.h new file mode 100644 index 0000000..a4f7fa2 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-alloca.h @@ -0,0 +1,13 @@ +#include + +__attribute__((noinline, noipa)) +void g (char* ptr, int y) +{ + ptr[y] = '\0'; +} + +void f_caller (int y) +{ + char* pStr = alloca(SIZE); + g (pStr, y); +} \ No newline at end of file -- cgit v1.1 From 630b1e3a187dc843958e8966345da6191226b8e2 Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Mon, 1 Oct 2018 13:02:21 +0000 Subject: Allow setting of stack-clash via configure options. This patch defines a configure option to allow the setting of the default guard size via configure flags when building the target. The new flag is: * --with-stack-clash-protection-guard-size= The patch defines a new macro DEFAULT_STK_CLASH_GUARD_SIZE which targets need to use explicitly is they want to support this configure flag and values that users may have set. gcc/ PR target/86486 * configure.ac: Add stack-clash-protection-guard-size. * doc/install.texi: Document it. * config.in (DEFAULT_STK_CLASH_GUARD_SIZE): New. * params.def: Update comment for guard-size. (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE, PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL): Update description. * configure: Regenerate. From-SVN: r264752 --- gcc/ChangeLog | 11 +++++++++++ gcc/config.in | 7 +++++++ gcc/configure | 36 ++++++++++++++++++++++++++++++++++-- gcc/configure.ac | 23 +++++++++++++++++++++++ gcc/doc/install.texi | 5 +++++ gcc/params.def | 5 +++-- 6 files changed, 83 insertions(+), 4 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a379cc4..4d6ee32 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,17 @@ 2018-10-01 Tamar Christina PR target/86486 + * configure.ac: Add stack-clash-protection-guard-size. + * doc/install.texi: Document it. + * config.in (DEFAULT_STK_CLASH_GUARD_SIZE): New. + * params.def: Update comment for guard-size. + (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE, + PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL): Update description. + * configure: Regenerate. + +2018-10-01 Tamar Christina + + PR target/86486 * config/aarch64/aarch64.h (STACK_CLASH_MIN_BYTES_OUTGOING_ARGS, STACK_DYNAMIC_OFFSET): New. * config/aarch64/aarch64.c (aarch64_layout_frame): diff --git a/gcc/config.in b/gcc/config.in index 4db8aa1..d7c3fbf 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -55,6 +55,13 @@ #endif +/* Define to larger than zero set to the default stack clash protector size as + a power of two in bytes. */ +#ifndef USED_FOR_TARGET +#undef DEFAULT_STK_CLASH_GUARD_SIZE +#endif + + /* Define if you want to use __cxa_atexit, rather than atexit, to register C++ destructors for local statics and global objects. This is essential for fully standards-compliant handling of destructors, but requires diff --git a/gcc/configure b/gcc/configure index 9fb0eb5..3e33a69 100755 --- a/gcc/configure +++ b/gcc/configure @@ -906,6 +906,7 @@ enable_valgrind_annotations with_stabs enable_multilib enable_multiarch +with_stack_clash_protection_guard_size enable___cxa_atexit enable_decimal_float enable_fixed_point @@ -1727,6 +1728,9 @@ Optional Packages: --with-gnu-as arrange to work with GNU as --with-as arrange to use the specified as (full pathname) --with-stabs arrange to use stabs instead of host debug format + --with-stack-clash-protection-guard-size=size + Set the default stack clash protection guard size + for specific targets as a power of two in bytes. --with-dwarf2 force the default debug format to be DWARF 2 --with-specs=SPECS add SPECS to driver command-line processing --with-pkgversion=PKG Use PKG in the version string in place of "GCC" @@ -7439,6 +7443,34 @@ $as_echo "$enable_multiarch$ma_msg_suffix" >&6; } +# default stack clash protection guard size as power of twos in bytes. +# Please keep these in sync with params.def. +stk_clash_min=12 +stk_clash_max=30 + +# Keep the default value when the option is not used to 0, this allows us to +# distinguish between the cases where the user specifially set a value via +# configure and when the normal default value is used. + +# Check whether --with-stack-clash-protection-guard-size was given. +if test "${with_stack_clash_protection_guard_size+set}" = set; then : + withval=$with_stack_clash_protection_guard_size; DEFAULT_STK_CLASH_GUARD_SIZE="$with_stack_clash_protection_guard_size" +else + DEFAULT_STK_CLASH_GUARD_SIZE=0 +fi + +if test $DEFAULT_STK_CLASH_GUARD_SIZE -ne 0 \ + && (test $DEFAULT_STK_CLASH_GUARD_SIZE -lt $stk_clash_min \ + || test $DEFAULT_STK_CLASH_GUARD_SIZE -gt $stk_clash_max); then + as_fn_error "Invalid value $DEFAULT_STK_CLASH_GUARD_SIZE for --with-stack-clash-protection-guard-size. Must be between $stk_clash_min and $stk_clash_max." "$LINENO" 5 +fi + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_STK_CLASH_GUARD_SIZE $DEFAULT_STK_CLASH_GUARD_SIZE +_ACEOF + + # Enable __cxa_atexit for C++. # Check whether --enable-__cxa_atexit was given. if test "${enable___cxa_atexit+set}" = set; then : @@ -18463,7 +18495,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18466 "configure" +#line 18498 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18569,7 +18601,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18572 "configure" +#line 18604 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index ca51cdf..ff6444a 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -811,6 +811,29 @@ AC_MSG_RESULT($enable_multiarch$ma_msg_suffix) AC_SUBST(with_cpu) AC_SUBST(with_float) +# default stack clash protection guard size as power of twos in bytes. +# Please keep these in sync with params.def. +stk_clash_min=12 +stk_clash_max=30 + +# Keep the default value when the option is not used to 0, this allows us to +# distinguish between the cases where the user specifially set a value via +# configure and when the normal default value is used. +AC_ARG_WITH(stack-clash-protection-guard-size, +[AS_HELP_STRING([--with-stack-clash-protection-guard-size=size], +[Set the default stack clash protection guard size for specific targets as a power of two in bytes.])], +[DEFAULT_STK_CLASH_GUARD_SIZE="$with_stack_clash_protection_guard_size"], [DEFAULT_STK_CLASH_GUARD_SIZE=0]) +if test $DEFAULT_STK_CLASH_GUARD_SIZE -ne 0 \ + && (test $DEFAULT_STK_CLASH_GUARD_SIZE -lt $stk_clash_min \ + || test $DEFAULT_STK_CLASH_GUARD_SIZE -gt $stk_clash_max); then + AC_MSG_ERROR(m4_normalize([ + Invalid value $DEFAULT_STK_CLASH_GUARD_SIZE for --with-stack-clash-protection-guard-size. \ + Must be between $stk_clash_min and $stk_clash_max.])) +fi + +AC_DEFINE_UNQUOTED(DEFAULT_STK_CLASH_GUARD_SIZE, $DEFAULT_STK_CLASH_GUARD_SIZE, + [Define to larger than zero set the default stack clash protector size.]) + # Enable __cxa_atexit for C++. AC_ARG_ENABLE(__cxa_atexit, [AS_HELP_STRING([--enable-__cxa_atexit], [enable __cxa_atexit for C++])], diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 61ab97e..9302251 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -1414,6 +1414,11 @@ These features are extensions to the traditional SVR4-based MIPS ABIs and require support from GNU binutils and the runtime C library. +@item --with-stack-clash-protection-guard-size=@var{size} +On certain targets this option sets the default stack clash protection guard +size as a power of two in bytes. On AArch64 @var{size} is required to be either +12 (4KB) or 16 (64KB). + @item --enable-__cxa_atexit Define if you want to use __cxa_atexit, rather than atexit, to register C++ destructors for local statics and global objects. diff --git a/gcc/params.def b/gcc/params.def index 9f06973..4a5f204 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -213,14 +213,15 @@ DEFPARAM(PARAM_STACK_FRAME_GROWTH, "Maximal stack frame growth due to inlining (in percent).", 1000, 0, 0) +/* Keep these up to date with those in configure.ac. */ DEFPARAM(PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE, "stack-clash-protection-guard-size", - "Size of the stack guard expressed as a power of two.", + "Size of the stack guard expressed as a power of two in bytes.", 12, 12, 30) DEFPARAM(PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL, "stack-clash-protection-probe-interval", - "Interval in which to probe the stack expressed as a power of two.", + "Interval in which to probe the stack expressed as a power of two in bytes.", 12, 10, 16) /* The GCSE optimization will be disabled if it would require -- cgit v1.1 From fbe9af5042f7c09bc00c105ef1a30ac7149171e4 Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Mon, 1 Oct 2018 13:03:31 +0000 Subject: Set default values for stack-clash and do basic validation in back-end. This patch enforces that the default guard size for stack-clash protection for AArch64 be 64KB unless the user has overriden it via configure in which case the user value is used as long as that value is within the valid range. It also does some basic validation to ensure that the guard size is only 4KB or 64KB and also enforces that for aarch64 the stack-clash probing interval is equal to the guard size. gcc/ PR target/86486 * config/aarch64/aarch64.c (aarch64_override_options_internal): Add validation for stack-clash parameters and set defaults. From-SVN: r264753 --- gcc/ChangeLog | 6 ++++++ gcc/config/aarch64/aarch64.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4d6ee32..0eafc63f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,12 @@ 2018-10-01 Tamar Christina PR target/86486 + * config/aarch64/aarch64.c (aarch64_override_options_internal): + Add validation for stack-clash parameters and set defaults. + +2018-10-01 Tamar Christina + + PR target/86486 * configure.ac: Add stack-clash-protection-guard-size. * doc/install.texi: Document it. * config.in (DEFAULT_STK_CLASH_GUARD_SIZE): New. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 2352407..fc42354 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -10992,6 +10992,37 @@ aarch64_override_options_internal (struct gcc_options *opts) opts->x_param_values, global_options_set.x_param_values); + /* If the user hasn't changed it via configure then set the default to 64 KB + for the backend. */ + maybe_set_param_value (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE, + DEFAULT_STK_CLASH_GUARD_SIZE == 0 + ? 16 : DEFAULT_STK_CLASH_GUARD_SIZE, + opts->x_param_values, + global_options_set.x_param_values); + + /* Validate the guard size. */ + int guard_size = PARAM_VALUE (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE); + if (guard_size != 12 && guard_size != 16) + error ("only values 12 (4 KB) and 16 (64 KB) are supported for guard " + "size. Given value %d (%llu KB) is out of range.", + guard_size, (1ULL << guard_size) / 1024ULL); + + /* Enforce that interval is the same size as size so the mid-end does the + right thing. */ + maybe_set_param_value (PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL, + guard_size, + opts->x_param_values, + global_options_set.x_param_values); + + /* The maybe_set calls won't update the value if the user has explicitly set + one. Which means we need to validate that probing interval and guard size + are equal. */ + int probe_interval + = PARAM_VALUE (PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL); + if (guard_size != probe_interval) + error ("stack clash guard size '%d' must be equal to probing interval " + "'%d'", guard_size, probe_interval); + /* Enable sw prefetching at specified optimization level for CPUS that have prefetch. Lower optimization level threshold by 1 when profiling is enabled. */ -- cgit v1.1 From c98f502f0ab9e51357665d7afcad724feee6088b Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Mon, 1 Oct 2018 13:05:30 +0000 Subject: Cleanup the AArch64 testsuite when stack-clash is on. This patch cleans up the testsuite when a run is done with stack clash protection turned on. Concretely this switches off -fstack-clash-protection for a couple of tests: * assembler scan: some tests are quite fragile in that they check for exact assembly output, e.g. check for exact amount of sub etc. These won't match now. * vla: Some of the ubsan tests negative array indices. Because the arrays weren't used before the incorrect $sp wouldn't have been used. The correct value is restored on ret. Now however we probe the $sp which causes a segfault. * params: When testing the parameters we have to skip these on AArch64 because of our custom constraints on them. We already test them separately so this isn't a loss. Note that the testsuite is not entire clean due to gdb failure caused by alloca with stack clash. On AArch64 we output an incorrect .loc directive, but this is already the case with the current implementation in GCC and is a bug unrelated to this patch series. gcc/testsuite/ PR target/86486 * gcc.dg/pr82788.c: Skip for AArch64. * gcc.dg/guality/vla-1.c: Turn off stack-clash. * gcc.target/aarch64/subsp.c: Likewise. * gcc.dg/params/blocksort-part.c: Skip stack-clash checks on AArch64. * gcc.dg/stack-check-10.c: Add AArch64 specific checks. * gcc.dg/stack-check-12.c: ILP32 fixup. * gcc.dg/stack-check-5.c: Add AArch64 specific checks. * gcc.dg/stack-check-6a.c: Skip on AArch64, we don't support this. * testsuite/lib/target-supports.exp (check_effective_target_frame_pointer_for_non_leaf): AArch64 does not require frame pointer for non-leaf functions. From-SVN: r264754 --- gcc/testsuite/ChangeLog | 16 ++++++++++++++++ gcc/testsuite/c-c++-common/ubsan/vla-1.c | 2 +- gcc/testsuite/gcc.dg/params/blocksort-part.c | 1 + gcc/testsuite/gcc.dg/pr82788.c | 1 + gcc/testsuite/gcc.dg/stack-check-10.c | 1 + gcc/testsuite/gcc.dg/stack-check-5.c | 4 +++- gcc/testsuite/gcc.dg/stack-check-6a.c | 1 + gcc/testsuite/gcc.target/aarch64/stack-check-12.c | 8 +++++--- gcc/testsuite/gcc.target/aarch64/subsp.c | 2 +- gcc/testsuite/lib/target-supports.exp | 4 ---- 10 files changed, 30 insertions(+), 10 deletions(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0252a1d..e8ba7fc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,22 @@ 2018-10-01 Tamar Christina PR target/86486 + * gcc.dg/pr82788.c: Skip for AArch64. + * gcc.dg/guality/vla-1.c: Turn off stack-clash. + * gcc.target/aarch64/subsp.c: Likewise. + * gcc.dg/params/blocksort-part.c: Skip stack-clash checks + on AArch64. + * gcc.dg/stack-check-10.c: Add AArch64 specific checks. + * gcc.dg/stack-check-12.c: ILP32 fixup. + * gcc.dg/stack-check-5.c: Add AArch64 specific checks. + * gcc.dg/stack-check-6a.c: Skip on AArch64, we don't support this. + * testsuite/lib/target-supports.exp + (check_effective_target_frame_pointer_for_non_leaf): AArch64 does not + require frame pointer for non-leaf functions. + +2018-10-01 Tamar Christina + + PR target/86486 * gcc.target/aarch64/stack-check-alloca-1.c: New. * gcc.target/aarch64/stack-check-alloca-10.c: New. * gcc.target/aarch64/stack-check-alloca-2.c: New. diff --git a/gcc/testsuite/c-c++-common/ubsan/vla-1.c b/gcc/testsuite/c-c++-common/ubsan/vla-1.c index 52ade3a..c97465e 100644 --- a/gcc/testsuite/c-c++-common/ubsan/vla-1.c +++ b/gcc/testsuite/c-c++-common/ubsan/vla-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-fsanitize=vla-bound -Wall -Wno-unused-variable" } */ +/* { dg-options "-fsanitize=vla-bound -Wall -Wno-unused-variable -fno-stack-clash-protection" } */ typedef long int V; int x = -1; diff --git a/gcc/testsuite/gcc.dg/params/blocksort-part.c b/gcc/testsuite/gcc.dg/params/blocksort-part.c index a9154f2..1e67787 100644 --- a/gcc/testsuite/gcc.dg/params/blocksort-part.c +++ b/gcc/testsuite/gcc.dg/params/blocksort-part.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "AArch64 does not support these bounds." { aarch64*-*-* } { "--param stack-clash-protection-*" } } */ /*-------------------------------------------------------------*/ /*--- Block sorting machinery ---*/ diff --git a/gcc/testsuite/gcc.dg/pr82788.c b/gcc/testsuite/gcc.dg/pr82788.c index a8f628f..41c442f 100644 --- a/gcc/testsuite/gcc.dg/pr82788.c +++ b/gcc/testsuite/gcc.dg/pr82788.c @@ -1,4 +1,5 @@ /* { dg-do run } */ /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-probe-interval=10 --param stack-clash-protection-guard-size=12" } */ /* { dg-require-effective-target supports_stack_clash_protection } */ +/* { dg-skip-if "AArch64 does not support this interval." { aarch64*-*-* } } */ int main() { int a[1442]; return 0;} diff --git a/gcc/testsuite/gcc.dg/stack-check-10.c b/gcc/testsuite/gcc.dg/stack-check-10.c index a86956a..2f5a090 100644 --- a/gcc/testsuite/gcc.dg/stack-check-10.c +++ b/gcc/testsuite/gcc.dg/stack-check-10.c @@ -39,3 +39,4 @@ f3 (void) need a frame pointer. Otherwise neither should. */ /* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 2 "pro_and_epilogue" { target { ! frame_pointer_for_non_leaf } } } } */ /* { dg-final { scan-rtl-dump-times "Stack clash frame pointer needed" 2 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */ +/* { dg-final { scan-rtl-dump-times "Stack clash no probe small stack adjustment in prologue" 2 "pro_and_epilogue" { target { aarch64*-*-* } } } } */ diff --git a/gcc/testsuite/gcc.dg/stack-check-5.c b/gcc/testsuite/gcc.dg/stack-check-5.c index 604fa3c..0243147 100644 --- a/gcc/testsuite/gcc.dg/stack-check-5.c +++ b/gcc/testsuite/gcc.dg/stack-check-5.c @@ -66,7 +66,9 @@ f3 (void) /* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 4 "pro_and_epilogue" { target { ! frame_pointer_for_non_leaf } } } } */ /* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 2 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */ /* { dg-final { scan-rtl-dump-times "Stack clash frame pointer needed" 2 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */ - +/* AArch64 won't require a probe here due to the allocation amount being less than 1KB. */ +/* { dg-final { scan-rtl-dump-times "Stack clash no probe small stack adjustment in prologue" 3 "pro_and_epilogue" { target { aarch64*-*-* } } } } */ +/* { dg-final { scan-rtl-dump-times "Stack clash no probe no stack adjustment in prologue" 1 "pro_and_epilogue" { target { aarch64*-*-* } } } } */ /* We have selected the size of the array in f2/f3 to be large enough to not live in the red zone on targets that support it. diff --git a/gcc/testsuite/gcc.dg/stack-check-6a.c b/gcc/testsuite/gcc.dg/stack-check-6a.c index 8fb9c62..68dd9bc 100644 --- a/gcc/testsuite/gcc.dg/stack-check-6a.c +++ b/gcc/testsuite/gcc.dg/stack-check-6a.c @@ -5,6 +5,7 @@ /* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=16" } */ /* { dg-require-effective-target supports_stack_clash_protection } */ /* { dg-skip-if "" { *-*-* } { "-fstack-protector*" } { "" } } */ +/* { dg-skip-if "" { aarch64*-*-* } } */ #include "stack-check-6.c" diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-12.c b/gcc/testsuite/gcc.target/aarch64/stack-check-12.c index 4e3abcb..be5a57a 100644 --- a/gcc/testsuite/gcc.target/aarch64/stack-check-12.c +++ b/gcc/testsuite/gcc.target/aarch64/stack-check-12.c @@ -2,12 +2,14 @@ /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16 -fno-asynchronous-unwind-tables -fno-unwind-tables" } */ /* { dg-require-effective-target supports_stack_clash_protection } */ -extern void arf (unsigned long int *, unsigned long int *); +typedef unsigned __attribute__((mode(DI))) uint64_t; + +extern void arf (uint64_t *, uint64_t *); void frob () { - unsigned long int num[10000]; - unsigned long int den[10000]; + uint64_t num[10000]; + uint64_t den[10000]; arf (den, num); } diff --git a/gcc/testsuite/gcc.target/aarch64/subsp.c b/gcc/testsuite/gcc.target/aarch64/subsp.c index 70d848c..6ef6b2c 100644 --- a/gcc/testsuite/gcc.target/aarch64/subsp.c +++ b/gcc/testsuite/gcc.target/aarch64/subsp.c @@ -1,4 +1,4 @@ -/* { dg-options "-O" } */ +/* { dg-options "-O -fno-stack-clash-protection" } */ int foo (void *); diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index d741583..b82c332 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8396,10 +8396,6 @@ proc check_effective_target_supports_stack_clash_protection { } { # Return 1 if the target creates a frame pointer for non-leaf functions # Note we ignore cases where we apply tail call optimization here. proc check_effective_target_frame_pointer_for_non_leaf { } { - if { [istarget aarch*-*-*] } { - return 1 - } - # Solaris/x86 defaults to -fno-omit-frame-pointer. if { [istarget i?86-*-solaris*] || [istarget x86_64-*-solaris*] } { return 1 -- cgit v1.1 From 03ced4ab9f729cc4d5854439f136d84d1343b32d Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Mon, 1 Oct 2018 13:06:53 +0000 Subject: Allow back-ends to be able to do custom validations on params. This patch adds the ability for backends to add custom constrains to the param values by defining a new hook option_validate_param. This hook is invoked on every set_param_value which allows the back-end to ensure that the parameters are always within it's desired state. gcc/ * params.c (set_param_value): Add index of parameter being validated. * common/common-target.def (option_validate_param): New. * common/common-targhooks.h (default_option_validate_param): New. * common/common-targhooks.c (default_option_validate_param): New. * doc/tm.texi.in (TARGET_OPTION_VALIDATE_PARAM): New. * doc/tm.texi: Regenerate. From-SVN: r264755 --- gcc/ChangeLog | 10 ++++++++++ gcc/common/common-target.def | 7 +++++++ gcc/common/common-targhooks.c | 9 +++++++++ gcc/common/common-targhooks.h | 2 ++ gcc/doc/tm.texi | 4 ++++ gcc/doc/tm.texi.in | 2 ++ gcc/params.c | 2 +- 7 files changed, 35 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0eafc63f..7ae7b90 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,15 @@ 2018-10-01 Tamar Christina + * params.c (set_param_value): + Add index of parameter being validated. + * common/common-target.def (option_validate_param): New. + * common/common-targhooks.h (default_option_validate_param): New. + * common/common-targhooks.c (default_option_validate_param): New. + * doc/tm.texi.in (TARGET_OPTION_VALIDATE_PARAM): New. + * doc/tm.texi: Regenerate. + +2018-10-01 Tamar Christina + PR target/86486 * config/aarch64/aarch64.c (aarch64_override_options_internal): Add validation for stack-clash parameters and set defaults. diff --git a/gcc/common/common-target.def b/gcc/common/common-target.def index 019b1e7..8a268b6 100644 --- a/gcc/common/common-target.def +++ b/gcc/common/common-target.def @@ -56,6 +56,13 @@ DEFHOOK void, (void), hook_void_void) +DEFHOOK +(option_validate_param, +"Validate target-dependent value for @option{--param} settings, using\ + calls to @code{set_param_value}.", + bool, (int, int), + default_option_validate_param) + /* The initial value of target_flags. */ DEFHOOKPOD (default_target_flags, diff --git a/gcc/common/common-targhooks.c b/gcc/common/common-targhooks.c index 1b1a015..990c495 100644 --- a/gcc/common/common-targhooks.c +++ b/gcc/common/common-targhooks.c @@ -86,6 +86,15 @@ default_get_valid_option_values (int, const char *) return vec (); } +/* Default version of TARGET_OPTION_VALIDATE_PARAM. */ + +bool +default_option_validate_param (const int value ATTRIBUTE_UNUSED, + const int param ATTRIBUTE_UNUSED) +{ + return true; +} + const struct default_options empty_optimization_table[] = { { OPT_LEVELS_NONE, 0, NULL, 0 } diff --git a/gcc/common/common-targhooks.h b/gcc/common/common-targhooks.h index 4bdf8ef..b021ff0 100644 --- a/gcc/common/common-targhooks.h +++ b/gcc/common/common-targhooks.h @@ -30,6 +30,8 @@ extern bool default_target_handle_option (struct gcc_options *, location_t); extern vec default_get_valid_option_values (int, const char *); +extern bool default_option_validate_param (const int, const int); + extern const struct default_options empty_optimization_table[]; #endif diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index b00e4b6..83965b2 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -753,6 +753,10 @@ Set target-dependent initial values of fields in @var{opts}. Set target-dependent default values for @option{--param} settings, using calls to @code{set_default_param_value}. @end deftypefn +@deftypefn {Common Target Hook} bool TARGET_OPTION_VALIDATE_PARAM (int, @var{int}) +Validate target-dependent value for @option{--param} settings, using calls to @code{set_param_value}. +@end deftypefn + @defmac SWITCHABLE_TARGET Some targets need to switch between substantially different subtargets during compilation. For example, the MIPS target has one subtarget for diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index e2b6f94..e1966bd 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -729,6 +729,8 @@ options are changed via @code{#pragma GCC optimize} or by using the @hook TARGET_OPTION_DEFAULT_PARAMS +@hook TARGET_OPTION_VALIDATE_PARAM + @defmac SWITCHABLE_TARGET Some targets need to switch between substantially different subtargets during compilation. For example, the MIPS target has one subtarget for diff --git a/gcc/params.c b/gcc/params.c index 623296c..eb663be 100644 --- a/gcc/params.c +++ b/gcc/params.c @@ -209,7 +209,7 @@ set_param_value (const char *name, int value, error ("maximum value of parameter %qs is %u", compiler_params[i].option, compiler_params[i].max_value); - else + else if (targetm_common.option_validate_param (value, (int)i)) set_param_value_internal ((compiler_param) i, value, params, params_set, true); } -- cgit v1.1 From f622a56bcb4049083fcbb63bb27eca9230c89456 Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Mon, 1 Oct 2018 13:08:10 +0000 Subject: Update options framework for parameters to properly handle and validate configure time params. This patch changes it so that default parameters are validated during initialization. This change is needed to ensure parameters set via by the target specific common initialization routines still keep the parameters within the valid range. gcc/ * params.c (validate_param): New. (add_params): Use it. (set_param_value): Refactor param validation into validate_param. (diagnostic.h): Include. * diagnostic.h (diagnostic_ready_p): New. From-SVN: r264756 --- gcc/ChangeLog | 8 +++++++ gcc/diagnostic.h | 4 ++++ gcc/params.c | 63 +++++++++++++++++++++++++++++++++++++++++++------------- 3 files changed, 61 insertions(+), 14 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7ae7b90..7f4f4dd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2018-10-01 Tamar Christina + * params.c (validate_param): New. + (add_params): Use it. + (set_param_value): Refactor param validation into validate_param. + (diagnostic.h): Include. + * diagnostic.h (diagnostic_ready_p): New. + +2018-10-01 Tamar Christina + * params.c (set_param_value): Add index of parameter being validated. * common/common-target.def (option_validate_param): New. diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index 34ea03b..d4c605e 100644 --- a/gcc/diagnostic.h +++ b/gcc/diagnostic.h @@ -274,6 +274,10 @@ diagnostic_inhibit_notes (diagnostic_context * context) and similar functions. */ extern diagnostic_context *global_dc; +/* Returns whether the diagnostic framework has been intialized already and is + ready for use. */ +#define diagnostic_ready_p() (global_dc->printer != NULL) + /* The total count of a KIND of diagnostics emitted so far. */ #define diagnostic_kind_count(DC, DK) (DC)->diagnostic_count[(int) (DK)] diff --git a/gcc/params.c b/gcc/params.c index eb663be..b6a33df 100644 --- a/gcc/params.c +++ b/gcc/params.c @@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see #include "params.h" #include "params-enum.h" #include "diagnostic-core.h" +#include "diagnostic.h" #include "spellcheck.h" /* An array containing the compiler parameters and their current @@ -58,6 +59,10 @@ static const param_info lang_independent_params[] = { { NULL, 0, 0, 0, NULL, NULL } }; +static bool +validate_param (const int value, const param_info param, const int index); + + /* Add the N PARAMS to the current list of compiler parameters. */ void @@ -68,12 +73,26 @@ add_params (const param_info params[], size_t n) /* Allocate enough space for the new parameters. */ compiler_params = XRESIZEVEC (param_info, compiler_params, num_compiler_params + n); + param_info *dst_params = compiler_params + num_compiler_params; + /* Copy them into the table. */ - memcpy (compiler_params + num_compiler_params, - params, - n * sizeof (param_info)); + memcpy (dst_params, params, n * sizeof (param_info)); + /* Keep track of how many parameters we have. */ num_compiler_params += n; + + /* Initialize the pretty printing machinery in case we need to print an error, + but be sure not to initialize it if something else already has, e.g. a + language front-end like cc1. */ + if (!diagnostic_ready_p ()) + diagnostic_initialize (global_dc, 0); + + /* Now perform some validation and set the value if it validates. */ + for (size_t i = 0; i < n; i++) + { + if (validate_param (dst_params[i].default_value, dst_params[i], (int)i)) + dst_params[i].default_value = dst_params[i].default_value; + } } /* Add all parameters and default values that can be set in both the @@ -127,6 +146,31 @@ set_param_value_internal (compiler_param num, int value, params_set[i] = true; } +/* Validate PARAM and write an error if invalid. */ + +static bool +validate_param (const int value, const param_info param, const int index) +{ + /* These paremeters interpret bounds of 0 to be unbounded, as such don't + perform any range validation on 0 parameters. */ + if (value < param.min_value && param.min_value != 0) + { + error ("minimum value of parameter %qs is %u", + param.option, param.min_value); + return false; + } + else if (param.max_value > param.min_value && value > param.max_value) + { + error ("maximum value of parameter %qs is %u", + param.option, param.max_value); + return false; + } + else if (targetm_common.option_validate_param (value, index)) + return true; + + return false; +} + /* Return true if it can find the matching entry for NAME in the parameter table, and assign the entry index to INDEX. Return false otherwise. */ @@ -200,23 +244,14 @@ set_param_value (const char *name, int value, } i = (size_t)index; - if (value < compiler_params[i].min_value) - error ("minimum value of parameter %qs is %u", - compiler_params[i].option, - compiler_params[i].min_value); - else if (compiler_params[i].max_value > compiler_params[i].min_value - && value > compiler_params[i].max_value) - error ("maximum value of parameter %qs is %u", - compiler_params[i].option, - compiler_params[i].max_value); - else if (targetm_common.option_validate_param (value, (int)i)) + if (validate_param (value, compiler_params[i], i)) set_param_value_internal ((compiler_param) i, value, params, params_set, true); } /* Set the value of the parameter given by NUM to VALUE in PARAMS and PARAMS_SET, implicitly, if it has not been set explicitly by the - user. */ + user either via the commandline or configure. */ void maybe_set_param_value (compiler_param num, int value, -- cgit v1.1 From 329130cc40cc7b061690a2e8b416f1798e2fd36a Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Mon, 1 Oct 2018 13:09:29 +0000 Subject: Validate and set default parameters for stack-clash. This patch defines the default parameters and validation for the aarch64 stack clash probing interval and guard sizes. It cleans up the previous implementation and insures that at no point the invalidate arguments are present in the pipeline for AArch64. Currently they are only corrected once cc1 initalizes the back-end. The default for AArch64 is 64 KB for both of these and we only support 4 KB and 64 KB probes. We also enforce that any value you set here for the parameters must be in sync. If an invalid value is specified an error will be generated and compilation aborted. gcc/ * common/config/aarch64/aarch64-common.c (TARGET_OPTION_DEFAULT_PARAM, aarch64_option_default_param): New. (params.h): Include. (TARGET_OPTION_VALIDATE_PARAM, aarch64_option_validate_param): New. * config/aarch64/aarch64.c (aarch64_override_options_internal): Simplify stack-clash protection validation code. From-SVN: r264757 --- gcc/ChangeLog | 9 ++++++ gcc/common/config/aarch64/aarch64-common.c | 48 ++++++++++++++++++++++++++++++ gcc/config/aarch64/aarch64.c | 4 --- 3 files changed, 57 insertions(+), 4 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7f4f4dd..b4bc508 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,14 @@ 2018-10-01 Tamar Christina + * common/config/aarch64/aarch64-common.c (TARGET_OPTION_DEFAULT_PARAM, + aarch64_option_default_param): New. + (params.h): Include. + (TARGET_OPTION_VALIDATE_PARAM, aarch64_option_validate_param): New. + * config/aarch64/aarch64.c (aarch64_override_options_internal): Simplify + stack-clash protection validation code. + +2018-10-01 Tamar Christina + * params.c (validate_param): New. (add_params): Use it. (set_param_value): Refactor param validation into validate_param. diff --git a/gcc/common/config/aarch64/aarch64-common.c b/gcc/common/config/aarch64/aarch64-common.c index 292fb81..ffddc4d 100644 --- a/gcc/common/config/aarch64/aarch64-common.c +++ b/gcc/common/config/aarch64/aarch64-common.c @@ -30,6 +30,7 @@ #include "opts.h" #include "flags.h" #include "diagnostic.h" +#include "params.h" #ifdef TARGET_BIG_ENDIAN_DEFAULT #undef TARGET_DEFAULT_TARGET_FLAGS @@ -41,6 +42,10 @@ #undef TARGET_OPTION_OPTIMIZATION_TABLE #define TARGET_OPTION_OPTIMIZATION_TABLE aarch_option_optimization_table +#undef TARGET_OPTION_DEFAULT_PARAMS +#define TARGET_OPTION_DEFAULT_PARAMS aarch64_option_default_params +#undef TARGET_OPTION_VALIDATE_PARAM +#define TARGET_OPTION_VALIDATE_PARAM aarch64_option_validate_param /* Set default optimization options. */ static const struct default_options aarch_option_optimization_table[] = @@ -60,6 +65,49 @@ static const struct default_options aarch_option_optimization_table[] = { OPT_LEVELS_NONE, 0, NULL, 0 } }; +/* Implement target validation TARGET_OPTION_DEFAULT_PARAM. */ + +static bool +aarch64_option_validate_param (const int value, const int param) +{ + /* Check that both parameters are the same. */ + if (param == (int) PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE) + { + if (value != 12 && value != 16) + { + error ("only values 12 (4 KB) and 16 (64 KB) are supported for guard " + "size. Given value %d (%llu KB) is out of range", + value, (1ULL << value) / 1024ULL); + return false; + } + } + + return true; +} + +/* Implement TARGET_OPTION_DEFAULT_PARAMS. */ + +static void +aarch64_option_default_params (void) +{ + /* We assume the guard page is 64k. */ + int index = (int) PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE; + set_default_param_value (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE, + DEFAULT_STK_CLASH_GUARD_SIZE == 0 + ? 16 : DEFAULT_STK_CLASH_GUARD_SIZE); + + int guard_size + = default_param_value (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE); + + /* Set the interval parameter to be the same as the guard size. This way the + mid-end code does the right thing for us. */ + set_default_param_value (PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL, + guard_size); + + /* Validate the options. */ + aarch64_option_validate_param (guard_size, index); +} + /* Implement TARGET_HANDLE_OPTION. This function handles the target specific options for CPU/target selection. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index fc42354..d385b24 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -11002,10 +11002,6 @@ aarch64_override_options_internal (struct gcc_options *opts) /* Validate the guard size. */ int guard_size = PARAM_VALUE (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE); - if (guard_size != 12 && guard_size != 16) - error ("only values 12 (4 KB) and 16 (64 KB) are supported for guard " - "size. Given value %d (%llu KB) is out of range.", - guard_size, (1ULL << guard_size) / 1024ULL); /* Enforce that interval is the same size as size so the mid-end does the right thing. */ -- cgit v1.1 From fd5c626c681266845dbec0e84836823a5de3a45b Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 1 Oct 2018 13:10:48 +0000 Subject: re PR tree-optimization/87465 (Loop removal regression) 2018-10-01 Richard Biener PR tree-optimization/87465 * tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Fix typo causing branch miscounts. * gcc.dg/tree-ssa/cunroll-15.c: New testcase. From-SVN: r264758 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/tree-ssa/cunroll-15.c | 22 ++++++++++++++++++++++ gcc/tree-ssa-loop-ivcanon.c | 4 ++-- 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/cunroll-15.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b4bc508..fbe49a9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-10-01 Richard Biener + + PR tree-optimization/87465 + * tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Fix typo + causing branch miscounts. + 2018-10-01 Tamar Christina * common/config/aarch64/aarch64-common.c (TARGET_OPTION_DEFAULT_PARAM, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e8ba7fc..dced1ea 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-10-01 Richard Biener + + PR tree-optimization/87465 + * gcc.dg/tree-ssa/cunroll-15.c: New testcase. + 2018-10-01 Tamar Christina PR target/86486 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/cunroll-15.c b/gcc/testsuite/gcc.dg/tree-ssa/cunroll-15.c new file mode 100644 index 0000000..3fc752a --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/cunroll-15.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -funroll-loops -fdump-tree-cunroll-optimized -fdump-tree-optimized" } */ + +int Test(void) +{ + int c = 0; + const int in[4] = {4,3,4,4}; + for (unsigned i = 0; i < 4; i++) { + for (unsigned j = 0; j < i; j++) { + if (in[i] == in[j]) + break; + else + ++c; + } + } + return c; +} + +/* { dg-final { scan-tree-dump-times "optimized:\[^\n\r\]*completely unrolled" 2 "cunroll" } } */ +/* When SLP vectorization is enabled the following will fail because DOM + doesn't know how to deal with the vectorized initializer of in. */ +/* { dg-final { scan-tree-dump "return 1;" "optimized" } } */ diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c index 97c2ad9..eeae2a8 100644 --- a/gcc/tree-ssa-loop-ivcanon.c +++ b/gcc/tree-ssa-loop-ivcanon.c @@ -368,8 +368,8 @@ tree_estimate_loop_size (struct loop *loop, edge exit, edge edge_to_cancel, size->non_call_stmts_on_hot_path++; if (((gimple_code (stmt) == GIMPLE_COND && (!constant_after_peeling (gimple_cond_lhs (stmt), stmt, loop) - || constant_after_peeling (gimple_cond_rhs (stmt), stmt, - loop))) + || !constant_after_peeling (gimple_cond_rhs (stmt), stmt, + loop))) || (gimple_code (stmt) == GIMPLE_SWITCH && !constant_after_peeling (gimple_switch_index ( as_a (stmt)), -- cgit v1.1 From b093d688daa4c6e131007aaa397a55489d5b7ccb Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Mon, 1 Oct 2018 14:27:17 +0000 Subject: re PR fortran/65677 (Incomplete assignment on deferred-length character variable) 2018-10-01 Paul Thomas PR fortran/65677 * trans-expr.c (gfc_trans_assignment_1): Set the 'identical' flag in the call to gfc_check_dependency. 2018-10-01 Paul Thomas PR fortran/65677 * gfortran.dg/dependency_52.f90 : Expand the test to check both the call to adjustl and direct assignment of the substring. From-SVN: r264759 --- gcc/fortran/ChangeLog | 8 +++++++- gcc/fortran/dependency.c | 4 ++-- gcc/fortran/trans-expr.c | 4 ++-- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gfortran.dg/dependency_52.f90 | 22 ++++++++++++++++++---- 5 files changed, 35 insertions(+), 9 deletions(-) (limited to 'gcc') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 399d6f9..d513f2a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2018-10-01 Paul Thomas + + PR fortran/65677 + * trans-expr.c (gfc_trans_assignment_1): Set the 'identical' + flag in the call to gfc_check_dependency. + 2018-09-30 Paul Thomas PR fortran/87359 @@ -33,7 +39,7 @@ 2018-09-29 Paul Thomas - PR fortran/65667 + PR fortran/65677 * trans-expr.c (gfc_trans_assignment_1): If there is dependency fix the rse stringlength. diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c index a0bbd58..86359e5 100644 --- a/gcc/fortran/dependency.c +++ b/gcc/fortran/dependency.c @@ -240,7 +240,7 @@ gfc_dep_compare_functions (gfc_expr *e1, gfc_expr *e2, bool impure_ok) /* Special case: String arguments which compare equal can have different lengths, which makes them different in calls to procedures. */ - + if (e1->expr_type == EXPR_CONSTANT && e1->ts.type == BT_CHARACTER && e2->expr_type == EXPR_CONSTANT @@ -1907,7 +1907,7 @@ dummy_intent_not_in (gfc_expr **ep) /* Determine if an array ref, usually an array section specifies the entire array. In addition, if the second, pointer argument is provided, the function will return true if the reference is - contiguous; eg. (:, 1) gives true but (1,:) gives false. + contiguous; eg. (:, 1) gives true but (1,:) gives false. If one of the bounds depends on a dummy variable which is not INTENT(IN), also return false, because the user may have changed the variable. */ diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 9824848..37052b6 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -5281,7 +5281,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, /* See PR 41453. */ && !e->symtree->n.sym->attr.dummy /* FIXME - PR 87395 and PR 41453 */ - && e->symtree->n.sym->attr.save == SAVE_NONE + && e->symtree->n.sym->attr.save == SAVE_NONE && !e->symtree->n.sym->attr.associate_var && e->ts.type != BT_CHARACTER && e->ts.type != BT_DERIVED && e->ts.type != BT_CLASS && !sym->attr.elemental; @@ -10208,7 +10208,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, string_length = gfc_evaluate_now (rse.string_length, &rse.pre); else if (expr2->ts.type == BT_CHARACTER) { - if (expr1->ts.deferred && gfc_check_dependency (expr1, expr2, false)) + if (expr1->ts.deferred && gfc_check_dependency (expr1, expr2, true)) rse.string_length = gfc_evaluate_now (rse.string_length, &rse.pre); string_length = rse.string_length; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dced1ea..a8ed478 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-10-01 Paul Thomas + + PR fortran/65677 + * gfortran.dg/dependency_52.f90 : Expand the test to check both + the call to adjustl and direct assignment of the substring. + 2018-10-01 Richard Biener PR tree-optimization/87465 diff --git a/gcc/testsuite/gfortran.dg/dependency_52.f90 b/gcc/testsuite/gfortran.dg/dependency_52.f90 index 20c97ca..c176fd9 100644 --- a/gcc/testsuite/gfortran.dg/dependency_52.f90 +++ b/gcc/testsuite/gfortran.dg/dependency_52.f90 @@ -1,6 +1,6 @@ ! { dg-do run } ! -! Test the fix for PR65667, in which the dependency was missed and +! Test the fix for PR65677, in which the dependency was missed and ! the string length of 'text' was decremented twice. The rhs string ! length is now fixed after the function call so that the dependency ! on the length of 'text' is removed for later evaluations. @@ -10,16 +10,21 @@ module mod1 implicit none contains - subroutine getKeyword(string, keyword, rest) + subroutine getKeyword(string, keyword, rest, use_adjustl) character(:), allocatable, intent(IN) :: string character(:), allocatable, intent(OUT) :: keyword, rest integer :: idx character(:), allocatable :: text + logical :: use_adjustl keyword = '' rest = '' text = string - text = ADJUSTL(text(2:)) ! Note dependency. + if (use_adjustl) then + text = ADJUSTL(text(2:)) ! Note dependency. + else + text = text(2:) ! Check the old workaround. + endif idx = INDEX(text, ' ') if (idx == 0) then @@ -38,8 +43,17 @@ end module mod1 line = '@HERE IT IS' - call getKeyword(line, keyword, rest) + call getKeyword(line, keyword, rest, use_adjustl = .true.) if (keyword .ne. 'HERE') stop 1 if (rest .ne. 'IT IS') stop 2 + deallocate (line, keyword, rest) + + line = '@HERE IT IS' + + call getKeyword(line, keyword, rest, use_adjustl = .false.) + + if (keyword .ne. 'HERE') stop 3 + if (rest .ne. 'IT IS') stop 4 + deallocate (line, keyword, rest) end -- cgit v1.1 From 2da14663d0dee41a3f90f40704f9063e53a8b247 Mon Sep 17 00:00:00 2001 From: Carl Love Date: Mon, 1 Oct 2018 15:41:24 +0000 Subject: rs6000-builtin.def (__builtin_mffsl): New. gcc/ChangeLog: 2018-10-01 Carl Love * config/rs6000/rs6000-builtin.def (__builtin_mffsl): New. (__builtin_mtfsb0): New. (__builtin_mtfsb1): New. ( __builtin_set_fpscr_rn): New. (__builtin_set_fpscr_drn): New. * config/rs6000/rs6000.c (rs6000_expand_mtfsb_builtin): Add. (rs6000_expand_set_fpscr_rn_builtin): Add. (rs6000_expand_set_fpscr_drn_builtin): Add. (rs6000_expand_builtin): Add case statement entries for RS6000_BUILTIN_MTFSB0, RS6000_BUILTIN_MTFSB1, RS6000_BUILTIN_SET_FPSCR_RN, RS6000_BUILTIN_SET_FPSCR_DRN, RS6000_BUILTIN_MFFSL. (rs6000_init_builtins): Add ftype initialization and def_builtin calls for __builtin_mffsl, __builtin_mtfsb0, __builtin_mtfsb1, __builtin_set_fpscr_rn, __builtin_set_fpscr_drn. * config/rs6000.md (rs6000_mtfsb0, rs6000_mtfsb1, rs6000_mffscrn, rs6000_mffscdrn): Add define_insn. (rs6000_set_fpscr_rn, rs6000_set_fpscr_drn): Add define_expand. * doc/extend.texi: Add documentation for the builtins. gcc/testsuite/ChangeLog: 2018-10-01 Carl Love * gcc.target/powerpc/test_mffsl-p9.c: New file. * gcc.target/powerpc/test_fpscr_rn_builtin.c: New file. * gcc.target/powerpc/test_fpscr_drn_builtin.c: New file. * gcc.target/powerpc/test_fpscr_rn_builtin_error.c: New file. * gcc.target/powerpc/test_fpscr_drn_builtin_error.c: New file. From-SVN: r264762 --- gcc/ChangeLog | 22 +++ gcc/config/rs6000/rs6000-builtin.def | 24 +++ gcc/config/rs6000/rs6000.c | 176 +++++++++++++++++++ gcc/config/rs6000/rs6000.md | 175 ++++++++++++++++++- gcc/doc/extend.texi | 38 ++++- gcc/testsuite/ChangeLog | 8 + .../gcc.target/powerpc/test_fpscr_drn_builtin.c | 117 +++++++++++++ .../powerpc/test_fpscr_drn_builtin_error.c | 18 ++ .../gcc.target/powerpc/test_fpscr_rn_builtin.c | 190 +++++++++++++++++++++ .../powerpc/test_fpscr_rn_builtin_error.c | 22 +++ gcc/testsuite/gcc.target/powerpc/test_mffsl.c | 34 ++++ 11 files changed, 822 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin.c create mode 100644 gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c create mode 100644 gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin.c create mode 100644 gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c create mode 100644 gcc/testsuite/gcc.target/powerpc/test_mffsl.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fbe49a9..49f99ed 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,25 @@ +2018-10-01 Carl Love + + * config/rs6000/rs6000-builtin.def (__builtin_mffsl): New. + (__builtin_mtfsb0): New. + (__builtin_mtfsb1): New. + ( __builtin_set_fpscr_rn): New. + (__builtin_set_fpscr_drn): New. + * config/rs6000/rs6000.c (rs6000_expand_mtfsb_builtin): Add. + (rs6000_expand_set_fpscr_rn_builtin): Add. + (rs6000_expand_set_fpscr_drn_builtin): Add. + (rs6000_expand_builtin): Add case statement entries for + RS6000_BUILTIN_MTFSB0, RS6000_BUILTIN_MTFSB1, + RS6000_BUILTIN_SET_FPSCR_RN, RS6000_BUILTIN_SET_FPSCR_DRN, + RS6000_BUILTIN_MFFSL. + (rs6000_init_builtins): Add ftype initialization and def_builtin + calls for __builtin_mffsl, __builtin_mtfsb0, __builtin_mtfsb1, + __builtin_set_fpscr_rn, __builtin_set_fpscr_drn. + * config/rs6000.md (rs6000_mtfsb0, rs6000_mtfsb1, rs6000_mffscrn, + rs6000_mffscdrn): Add define_insn. + (rs6000_set_fpscr_rn, rs6000_set_fpscr_drn): Add define_expand. + * doc/extend.texi: Add documentation for the builtins. + 2018-10-01 Richard Biener PR tree-optimization/87465 diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def index f799681..976c36b 100644 --- a/gcc/config/rs6000/rs6000-builtin.def +++ b/gcc/config/rs6000/rs6000-builtin.def @@ -2486,11 +2486,35 @@ BU_SPECIAL_X (RS6000_BUILTIN_MFTB, "__builtin_ppc_mftb", BU_SPECIAL_X (RS6000_BUILTIN_MFFS, "__builtin_mffs", RS6000_BTM_ALWAYS, RS6000_BTC_MISC) +BU_SPECIAL_X (RS6000_BUILTIN_MFFSL, "__builtin_mffsl", + RS6000_BTM_ALWAYS, RS6000_BTC_MISC) + RS6000_BUILTIN_X (RS6000_BUILTIN_MTFSF, "__builtin_mtfsf", RS6000_BTM_ALWAYS, RS6000_BTC_MISC | RS6000_BTC_UNARY | RS6000_BTC_VOID, CODE_FOR_rs6000_mtfsf) +RS6000_BUILTIN_X (RS6000_BUILTIN_MTFSB0, "__builtin_mtfsb0", + RS6000_BTM_ALWAYS, + RS6000_BTC_MISC | RS6000_BTC_UNARY | RS6000_BTC_VOID, + CODE_FOR_rs6000_mtfsb0) + +RS6000_BUILTIN_X (RS6000_BUILTIN_MTFSB1, "__builtin_mtfsb1", + RS6000_BTM_ALWAYS, + RS6000_BTC_MISC | RS6000_BTC_UNARY | RS6000_BTC_VOID, + CODE_FOR_rs6000_mtfsb1) + +RS6000_BUILTIN_X (RS6000_BUILTIN_SET_FPSCR_RN, "__builtin_set_fpscr_rn", + RS6000_BTM_ALWAYS, + RS6000_BTC_MISC | RS6000_BTC_UNARY| RS6000_BTC_VOID, + CODE_FOR_rs6000_set_fpscr_rn) + +RS6000_BUILTIN_X (RS6000_BUILTIN_SET_FPSCR_DRN, "__builtin_set_fpscr_drn", + RS6000_BTM_ALWAYS, + RS6000_BTC_MISC | RS6000_BTM_64BIT | RS6000_BTC_UNARY + | RS6000_BTC_VOID, + CODE_FOR_rs6000_set_fpscr_drn) + BU_SPECIAL_X (RS6000_BUILTIN_CPU_INIT, "__builtin_cpu_init", RS6000_BTM_ALWAYS, RS6000_BTC_MISC) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index e99d3db..a2813c8 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -13260,6 +13260,13 @@ rs6000_expand_zeroop_builtin (enum insn_code icode, rtx target) /* Builtin not supported on this processor. */ return 0; + if (icode == CODE_FOR_rs6000_mffsl + && rs6000_isa_flags_explicit & OPTION_MASK_SOFT_FLOAT) + { + error ("__builtin_mffsl() not supported with -msoft-float"); + return const0_rtx; + } + if (target == 0 || GET_MODE (target) != tmode || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) @@ -13308,6 +13315,134 @@ rs6000_expand_mtfsf_builtin (enum insn_code icode, tree exp) op1 = copy_to_mode_reg (mode1, op1); pat = GEN_FCN (icode) (op0, op1); + if (!pat) + return const0_rtx; + emit_insn (pat); + + return NULL_RTX; +} + +static rtx +rs6000_expand_mtfsb_builtin (enum insn_code icode, tree exp) +{ + rtx pat; + tree arg0 = CALL_EXPR_ARG (exp, 0); + rtx op0 = expand_normal (arg0); + + if (icode == CODE_FOR_nothing) + /* Builtin not supported on this processor. */ + return 0; + + if (rs6000_isa_flags_explicit & OPTION_MASK_SOFT_FLOAT) + { + error ("__builtin_mtfsb0 and __builtin_mtfsb1 not supported with -msoft-float"); + return const0_rtx; + } + + /* If we got invalid arguments bail out before generating bad rtl. */ + if (arg0 == error_mark_node) + return const0_rtx; + + /* Only allow bit numbers 0 to 31. */ + if (!u5bit_cint_operand (op0, VOIDmode)) + { + error ("Argument must be a constant between 0 and 31."); + return const0_rtx; + } + + pat = GEN_FCN (icode) (op0); + if (!pat) + return const0_rtx; + emit_insn (pat); + + return NULL_RTX; +} + +static rtx +rs6000_expand_set_fpscr_rn_builtin (enum insn_code icode, tree exp) +{ + rtx pat; + tree arg0 = CALL_EXPR_ARG (exp, 0); + rtx op0 = expand_normal (arg0); + machine_mode mode0 = insn_data[icode].operand[0].mode; + + if (icode == CODE_FOR_nothing) + /* Builtin not supported on this processor. */ + return 0; + + if (rs6000_isa_flags_explicit & OPTION_MASK_SOFT_FLOAT) + { + error ("__builtin_set_fpscr_rn not supported with -msoft-float"); + return const0_rtx; + } + + /* If we got invalid arguments bail out before generating bad rtl. */ + if (arg0 == error_mark_node) + return const0_rtx; + + /* If the argument is a constant, check the range. Argument can only be a + 2-bit value. Unfortunately, can't check the range of the value at + compile time if the argument is a variable. The least significant two + bits of the argument, regardless of type, are used to set the rounding + mode. All other bits are ignored. */ + if (GET_CODE (op0) == CONST_INT && !const_0_to_3_operand(op0, VOIDmode)) + { + error ("Argument must be a value between 0 and 3."); + return const0_rtx; + } + + if (! (*insn_data[icode].operand[0].predicate) (op0, mode0)) + op0 = copy_to_mode_reg (mode0, op0); + + pat = GEN_FCN (icode) (op0); + if (!pat) + return const0_rtx; + emit_insn (pat); + + return NULL_RTX; +} +static rtx +rs6000_expand_set_fpscr_drn_builtin (enum insn_code icode, tree exp) +{ + rtx pat; + tree arg0 = CALL_EXPR_ARG (exp, 0); + rtx op0 = expand_normal (arg0); + machine_mode mode0 = insn_data[icode].operand[0].mode; + + if (TARGET_32BIT) + /* Builtin not supported in 32-bit mode. */ + fatal_error (input_location, + "__builtin_set_fpscr_drn is not supported in 32-bit mode."); + + if (rs6000_isa_flags_explicit & OPTION_MASK_SOFT_FLOAT) + { + error ("__builtin_set_fpscr_drn not supported with -msoft-float"); + return const0_rtx; + } + + if (icode == CODE_FOR_nothing) + /* Builtin not supported on this processor. */ + return 0; + + /* If we got invalid arguments bail out before generating bad rtl. */ + if (arg0 == error_mark_node) + return const0_rtx; + + /* If the argument is a constant, check the range. Agrument can only be a + 3-bit value. Unfortunately, can't check the range of the value at + compile time if the argument is a variable. The least significant two + bits of the argument, regardless of type, are used to set the rounding + mode. All other bits are ignored. */ + if (GET_CODE (op0) == CONST_INT && !const_0_to_7_operand(op0, VOIDmode)) + { + error ("Argument must be a value between 0 and 7."); + return const0_rtx; + } + + if (! (*insn_data[icode].operand[0].predicate) (op0, mode0)) + op0 = copy_to_mode_reg (mode0, op0); + + pat = GEN_FCN (icode) (op0); if (! pat) return const0_rtx; emit_insn (pat); @@ -16066,6 +16201,24 @@ rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, case RS6000_BUILTIN_MFFS: return rs6000_expand_zeroop_builtin (CODE_FOR_rs6000_mffs, target); + case RS6000_BUILTIN_MTFSB0: + return rs6000_expand_mtfsb_builtin (CODE_FOR_rs6000_mtfsb0, exp); + + case RS6000_BUILTIN_MTFSB1: + return rs6000_expand_mtfsb_builtin (CODE_FOR_rs6000_mtfsb1, exp); + + case RS6000_BUILTIN_SET_FPSCR_RN: + return rs6000_expand_set_fpscr_rn_builtin (CODE_FOR_rs6000_set_fpscr_rn, + exp); + + case RS6000_BUILTIN_SET_FPSCR_DRN: + return + rs6000_expand_set_fpscr_drn_builtin (CODE_FOR_rs6000_set_fpscr_drn, + exp); + + case RS6000_BUILTIN_MFFSL: + return rs6000_expand_zeroop_builtin (CODE_FOR_rs6000_mffsl, target); + case RS6000_BUILTIN_MTFSF: return rs6000_expand_mtfsf_builtin (CODE_FOR_rs6000_mtfsf, exp); @@ -16449,6 +16602,29 @@ rs6000_init_builtins (void) ftype = build_function_type_list (double_type_node, NULL_TREE); def_builtin ("__builtin_mffs", ftype, RS6000_BUILTIN_MFFS); + ftype = build_function_type_list (double_type_node, NULL_TREE); + def_builtin ("__builtin_mffsl", ftype, RS6000_BUILTIN_MFFSL); + + ftype = build_function_type_list (void_type_node, + intSI_type_node, + NULL_TREE); + def_builtin ("__builtin_mtfsb0", ftype, RS6000_BUILTIN_MTFSB0); + + ftype = build_function_type_list (void_type_node, + intSI_type_node, + NULL_TREE); + def_builtin ("__builtin_mtfsb1", ftype, RS6000_BUILTIN_MTFSB1); + + ftype = build_function_type_list (void_type_node, + intDI_type_node, + NULL_TREE); + def_builtin ("__builtin_set_fpscr_rn", ftype, RS6000_BUILTIN_SET_FPSCR_RN); + + ftype = build_function_type_list (void_type_node, + intDI_type_node, + NULL_TREE); + def_builtin ("__builtin_set_fpscr_drn", ftype, RS6000_BUILTIN_SET_FPSCR_DRN); + ftype = build_function_type_list (void_type_node, intSI_type_node, double_type_node, NULL_TREE); diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index bcabf4d..31a74ca 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -163,7 +163,13 @@ UNSPECV_MFTB ; move from time base UNSPECV_NLGR ; non-local goto receiver UNSPECV_MFFS ; Move from FPSCR - UNSPECV_MTFSF ; Move to FPSCR Fields + UNSPECV_MFFSL ; Move from FPSCR light instruction version + UNSPECV_MFFSCRN ; Move from FPSCR float rounding mode + UNSPECV_MFFSCDRN ; Move from FPSCR decimal float rounding mode + UNSPECV_MTFSF ; Move to FPSCR Fields 8 to 15 + UNSPECV_MTFSF_HI ; Move to FPSCR Fields 0 to 7 + UNSPECV_MTFSB0 ; Set FPSCR Field bit to 0 + UNSPECV_MTFSB1 ; Set FPSCR Field bit to 1 UNSPECV_SPLIT_STACK_RETURN ; A camouflaged return UNSPECV_SPEC_BARRIER ; Speculation barrier ]) @@ -5811,6 +5817,129 @@ xscvdpuxds %x0,%x1" [(set_attr "type" "fp")]) +(define_insn "rs6000_mtfsb0" + [(unspec_volatile [(match_operand:SI 0 "u5bit_cint_operand" "n")] + UNSPECV_MTFSB0)] + "TARGET_HARD_FLOAT" + "mtfsb0 %0" + [(set_attr "type" "fp")]) + +(define_insn "rs6000_mtfsb1" + [(unspec_volatile [(match_operand:SI 0 "u5bit_cint_operand" "n")] + UNSPECV_MTFSB1)] + "TARGET_HARD_FLOAT" + "mtfsb1 %0" + [(set_attr "type" "fp")]) + +(define_insn "rs6000_mffscrn" + [(set (match_operand:DF 0 "gpc_reg_operand" "=d") + (unspec_volatile:DF [(match_operand:DF 1 "gpc_reg_operand" "d")] + UNSPECV_MFFSCRN))] + "TARGET_P9_MISC" + "mffscrn %0,%1" + [(set_attr "type" "fp")]) + +(define_insn "rs6000_mffscdrn" + [(set (match_operand:DF 0 "gpc_reg_operand" "=d") + (unspec_volatile:DF [(const_int 0)] UNSPECV_MFFSCDRN)) + (use (match_operand:DF 1 "gpc_reg_operand" "d"))] + "TARGET_P9_MISC" + "mffscdrn %0,%1" + [(set_attr "type" "fp")]) + +(define_expand "rs6000_set_fpscr_rn" + [(match_operand 0 "reg_or_cint_operand")] + "TARGET_HARD_FLOAT" +{ + rtx tmp_df = gen_reg_rtx (DFmode); + + /* The floating point rounding control bits are FPSCR[62:63]. Put the + new rounding mode bits from operands[0][62:63] into FPSCR[62:63]. */ + if (TARGET_P9_MISC) + { + rtx src_df = gen_reg_rtx (DImode); + + src_df = simplify_gen_subreg (DFmode, operands[0], DImode, 0); + emit_insn (gen_rs6000_mffscrn (tmp_df, src_df)); + DONE; + } + + if (CONST_INT_P (operands[0])) + { + if ((INTVAL (operands[0]) & 0x1) == 0x1) + emit_insn (gen_rs6000_mtfsb1 (GEN_INT (31))); + else + emit_insn (gen_rs6000_mtfsb0 (GEN_INT (31))); + + if ((INTVAL (operands[0]) & 0x2) == 0x2) + emit_insn (gen_rs6000_mtfsb1 (GEN_INT (30))); + else + emit_insn (gen_rs6000_mtfsb0 (GEN_INT (30))); + } + else + { + rtx tmp_rn = gen_reg_rtx (DImode); + rtx tmp_di = gen_reg_rtx (DImode); + + /* Extract new RN mode from operand. */ + emit_insn (gen_anddi3 (tmp_rn, operands[0], GEN_INT (0x3))); + + /* Insert new RN mode into FSCPR. */ + emit_insn (gen_rs6000_mffs (tmp_df)); + tmp_di = simplify_gen_subreg (DImode, tmp_df, DFmode, 0); + emit_insn (gen_anddi3 (tmp_di, tmp_di, GEN_INT (-4))); + emit_insn (gen_iordi3 (tmp_di, tmp_di, tmp_rn)); + + /* Need to write to field k=15. The fields are [0:15]. Hence with + L=0, W=0, FLM_i must be equal to 8, 16 = i + 8*(1-W). FLM is an + 8-bit field[0:7]. Need to set the bit that corresponds to the + value of i that you want [0:7]. */ + tmp_df = simplify_gen_subreg (DFmode, tmp_di, DImode, 0); + emit_insn (gen_rs6000_mtfsf (GEN_INT (0x01), tmp_df)); + } + DONE; +}) + +(define_expand "rs6000_set_fpscr_drn" + [(match_operand:DI 0 "gpc_reg_operand")] + "TARGET_HARD_FLOAT" +{ + rtx tmp_df = gen_reg_rtx (DFmode); + + /* The decimal floating point rounding control bits are FPSCR[29:31]. Put the + new rounding mode bits from operands[0][61:63] into FPSCR[29:31]. */ + if (TARGET_P9_MISC) + { + rtx src_df = gen_reg_rtx (DFmode); + + emit_insn (gen_ashldi3 (operands[0], operands[0], GEN_INT (32))); + src_df = simplify_gen_subreg (DFmode, operands[0], DImode, 0); + emit_insn (gen_rs6000_mffscdrn (tmp_df, src_df)); + } + else + { + rtx tmp_rn = gen_reg_rtx (DImode); + rtx tmp_di = gen_reg_rtx (DImode); + + /* Extract new DRN mode from operand. */ + emit_insn (gen_anddi3 (tmp_rn, operands[0], GEN_INT (0x7))); + emit_insn (gen_ashldi3 (tmp_rn, tmp_rn, GEN_INT (32))); + + /* Insert new RN mode into FSCPR. */ + emit_insn (gen_rs6000_mffs (tmp_df)); + tmp_di = simplify_gen_subreg (DImode, tmp_df, DFmode, 0); + emit_insn (gen_anddi3 (tmp_di, tmp_di, GEN_INT (0xFFFFFFF8FFFFFFFF))); + emit_insn (gen_iordi3 (tmp_di, tmp_di, tmp_rn)); + + /* Need to write to field 7. The fields are [0:15]. The equation to + select the field is i + 8*(1-W). Hence with L=0 and W=1, need to set + i to 0x1 to get field 7 where i selects the field. */ + tmp_df = simplify_gen_subreg (DFmode, tmp_di, DImode, 0); + emit_insn (gen_rs6000_mtfsf_hi (GEN_INT (0x01), tmp_df)); + } + DONE; +}) + ;; Here, we use (set (reg) (unspec:DI [(fix:SI ...)] UNSPEC_FCTIWZ)) ;; rather than (set (subreg:SI (reg)) (fix:SI ...)) ;; because the first makes it clear that operand 0 is not live @@ -13507,6 +13636,43 @@ }) +;; The ISA 3.0 mffsl instruction is a lower latency instruction +;; for reading bits [29:31], [45:51] and [56:63] of the FPSCR. +(define_insn "rs6000_mffsl_hw" + [(set (match_operand:DF 0 "gpc_reg_operand" "=d") + (unspec_volatile:DF [(const_int 0)] UNSPECV_MFFSL))] + "TARGET_HARD_FLOAT" + "mffsl %0") + +(define_expand "rs6000_mffsl" + [(set (match_operand:DF 0 "gpc_reg_operand") + (unspec_volatile:DF [(const_int 0)] UNSPECV_MFFSL))] + "TARGET_HARD_FLOAT" +{ + /* If the low latency mffsl instruction (ISA 3.0) is available use it, + otherwise fall back to the older mffs instruction to emulate the mffsl + instruction. */ + + if (!TARGET_P9_MISC) + { + rtx tmp_di = gen_reg_rtx (DImode); + rtx tmp_df = gen_reg_rtx (DFmode); + + /* The mffs instruction reads the entire FPSCR. Emulate the mffsl + instruction using the mffs instruction and masking off the bits + the mmsl instruciton actually reads. */ + emit_insn (gen_rs6000_mffs (tmp_df)); + tmp_di = simplify_gen_subreg (DImode, tmp_df, DFmode, 0); + emit_insn (gen_anddi3 (tmp_di, tmp_di, GEN_INT (0x70007f0ffLL))); + + operands[0] = simplify_gen_subreg (DFmode, tmp_di, DImode, 0); + DONE; + } + + emit_insn (gen_rs6000_mffsl_hw (operands[0])); + DONE; +}) + (define_insn "rs6000_mffs" [(set (match_operand:DF 0 "gpc_reg_operand" "=d") (unspec_volatile:DF [(const_int 0)] UNSPECV_MFFS))] @@ -13520,6 +13686,13 @@ "TARGET_HARD_FLOAT" "mtfsf %0,%1") +(define_insn "rs6000_mtfsf_hi" + [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "n") + (match_operand:DF 1 "gpc_reg_operand" "d")] + UNSPECV_MTFSF_HI)] + "TARGET_HARD_FLOAT" + "mtfsf %0,%1,0,1") + ;; Power8 fusion support for fusing an addis instruction with a D-form load of ;; a GPR. The addis instruction must be adjacent to the load, and use the same diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index cfe6a8e..0d9b99f 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -15781,6 +15781,10 @@ uint64_t __builtin_ppc_get_timebase (); unsigned long __builtin_ppc_mftb (); __ibm128 __builtin_unpack_ibm128 (__ibm128, int); __ibm128 __builtin_pack_ibm128 (double, double); +double __builtin_mffs (void); +void __builtin_mtfsb0 (const int); +void __builtin_mtfsb1 (const int); +void __builtin_set_fpscr_rn (int); @end smallexample The @code{__builtin_ppc_get_timebase} and @code{__builtin_ppc_mftb} @@ -15789,7 +15793,21 @@ functions generate instructions to read the Time Base Register. The instructions and always returns the 64 bits of the Time Base Register. The @code{__builtin_ppc_mftb} function always generates one instruction and returns the Time Base Register value as an unsigned long, throwing away -the most significant word on 32-bit environments. +the most significant word on 32-bit environments. The @code{__builtin_mffs} +return the value of the FPSCR register. Note, ISA 3.0 supports the +@code{__builtin_mffsl()} which permits software to read the control and +non-sticky status bits in the FSPCR without the higher latency associated with +accessing the sticky status bits. The +@code{__builtin_mtfsb0} and @code{__builtin_mtfsb1} take the bit to change +as an argument. The valid bit range is between 0 and 31. The builtins map to +the @code{mtfsb0} and @code{mtfsb1} instructions which take the argument and +add 32. Hence these instructions only modify the FPSCR[32:63] bits by +changing the specified bit to a zero or one respectively. The +@code{__builtin_set_fpscr_rn} builtin allows changing both of the floating +point rounding mode bits. The argument is a 2-bit value. The argument can +either be a const int or stored in a variable. The builtin uses the ISA 3.0 +instruction @code{mffscrn} if available, otherwise it reads the FPSCR, masks +the current rounding mode bits out and OR's in the new value. @node Basic PowerPC Built-in Functions Available on ISA 2.05 @subsubsection Basic PowerPC Built-in Functions Available on ISA 2.05 @@ -15825,6 +15843,7 @@ The following built-in functions are available when hardware decimal floating point (@option{-mhard-dfp}) is available: @smallexample +void __builtin_set_fpscr_drn(int); _Decimal64 __builtin_ddedpd (int, _Decimal64); _Decimal128 __builtin_ddedpdq (int, _Decimal128); _Decimal64 __builtin_denbcd (int, _Decimal64); @@ -15839,6 +15858,14 @@ long long __builtin_dxex (_Decimal64); long long __builtin_dxexq (_Decimal128); _Decimal128 __builtin_pack_dec128 (unsigned long long, unsigned long long); unsigned long long __builtin_unpack_dec128 (_Decimal128, int); + +The @code{__builtin_set_fpscr_drn} builtin allows changing the three decimal +floating point rounding mode bits. The argument is a 3-bit value. The +argument can either be a const int or the value can be stored in a variable. +The builtin uses the ISA 3.0 instruction @code{mffscdrn} if available. +Otherwise the builtin reads the FPSCR, masks the current decimal rounding +mode bits out and OR's in the new value. + @end smallexample The following functions require @option{-mhard-float}, @@ -16040,6 +16067,9 @@ int __builtin_dfp_dtstsfi_ov (unsigned int comparison, _Decimal64 value); int __builtin_dfp_dtstsfi_ov (unsigned int comparison, _Decimal128 value); int __builtin_dfp_dtstsfi_ov_dd (unsigned int comparison, _Decimal64 value); int __builtin_dfp_dtstsfi_ov_td (unsigned int comparison, _Decimal128 value); + +double __builtin_mffsl(void); + @end smallexample The @code{__builtin_byte_in_set} function requires a 64-bit environment supporting ISA 3.0 or later. This function returns @@ -16091,6 +16121,12 @@ The @code{__builtin_dfp_dtstsfi_ov_dd} and require that the type of the @code{value} argument be @code{__Decimal64} and @code{__Decimal128} respectively. +The @code{__builtin_mffsl} uses the ISA 3.0 @code{mffsl} instruction to read +the FPSCR. The instruction is a lower latency version of the @code{mffs} +instruction. If the @code{mffsl} instruction is not available, then the +builtin uses the older @code{mffs} instruction to read the FPSCR. + + @node PowerPC AltiVec/VSX Built-in Functions @subsection PowerPC AltiVec/VSX Built-in Functions diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a8ed478..22713d9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2018-10-01 Carl Love + + * gcc.target/powerpc/test_mffsl-p9.c: New file. + * gcc.target/powerpc/test_fpscr_rn_builtin.c: New file. + * gcc.target/powerpc/test_fpscr_drn_builtin.c: New file. + * gcc.target/powerpc/test_fpscr_rn_builtin_error.c: New file. + * gcc.target/powerpc/test_fpscr_drn_builtin_error.c: New file. + 2018-10-01 Paul Thomas PR fortran/65677 diff --git a/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin.c b/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin.c new file mode 100644 index 0000000..685bf97 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin.c @@ -0,0 +1,117 @@ +/* { dg-do run { target { powerpc*-*-* && lp64 } } } */ +/* { dg-require-effective-target dfp_hw } */ +/* { dg-options "-O2 -std=c99" } */ + +#include + +#ifdef DEBUG +#include +#endif + +#define DRN_MASK 0x700000000LL /* DRN field mask */ + +void abort (void); + +int main () +{ + int i; + int val, bit; + double fpscr_val; + union blah { + double d; + unsigned long long ll; + } conv_val; + + unsigned long long ll_value; + register double f14; + + /* __builtin_set_fpscr_drn() builtin can take a const or a variable + value between 0 and 7 as the argument. + */ + + /* Test builtin decimal float rounding mode with const argument. */ + __builtin_set_fpscr_drn(7); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & DRN_MASK; + + if (ll_value != 0x700000000) + { +#ifdef DEBUG + printf("ERROR, __builtin_set_fpscr_drn(7) did not set rounding mode to 7.\n"); +#else + abort(); +#endif + } + + __builtin_set_fpscr_drn(2); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & DRN_MASK; + + if (ll_value != 0x200000000) + { +#ifdef DEBUG + printf("ERROR, __builtin_set_fpscr_drn(2) did not set rounding mode to 2.\n"); +#else + abort(); +#endif + } + + __builtin_set_fpscr_drn(5); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & DRN_MASK; + + if (ll_value != 0x500000000) + { +#ifdef DEBUG + printf("ERROR, __builtin_set_fpscr_drn(5) did not set rounding mode to 5.\n"); +#else + abort(); +#endif + } + + /* Test builtin decimal float rounding mode with variable as argument. */ + val = 7; + __builtin_set_fpscr_drn(val); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & DRN_MASK; + + if (ll_value != ((unsigned long long)val << 32)) + { +#ifdef DEBUG + printf("ERROR, __builtin_set_fpscr_drn(val=%d) did not set rounding mode to %d.\n", + val, val); +#else + abort(); +#endif + } + + val = 0; + __builtin_set_fpscr_drn(val); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & DRN_MASK; + + if (ll_value != ((unsigned long long)val << 32)) + { +#ifdef DEBUG + printf("ERROR, __builtin_set_fpscr_drn(val=%d) did not set rounding mode to %d.\n", + val, val); +#else + abort(); +#endif + } + + val = 2; + __builtin_set_fpscr_drn(val); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & DRN_MASK; + + if (ll_value != ((unsigned long long)val << 32)) + { +#ifdef DEBUG + printf("ERROR, __builtin_set_fpscr_drn(val=%d) did not set rounding mode to %d.\n", + val, val); +#else + abort(); +#endif + } +} diff --git a/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c b/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c new file mode 100644 index 0000000..58453f0 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c @@ -0,0 +1,18 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-require-effective-target dfp_hw } */ +/* { dg-options "-O2 -std=c99" } */ + +#include + +int main () +{ + + /* Test builin with out of range arguments. The builtin + __builtin_set_fpscr_drn() also support a variable as an argument but + can't test variable value at compile time. */ + + __builtin_set_fpscr_drn(-1); /* { dg-error "Argument must be a value between 0 and 7" } */ + __builtin_set_fpscr_drn(8); /* { dg-error "Argument must be a value between 0 and 7" } */ + +} + diff --git a/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin.c b/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin.c new file mode 100644 index 0000000..be05dcf --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin.c @@ -0,0 +1,190 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-options "-O2 -std=c99" } */ + +#include + +#ifdef DEBUG +#include +#endif + +#define RN_MASK 0x3LL /* RN field mask */ + +void abort (void); + +int main () +{ + int i; + int val, bit; + double fpscr_val; + union blah { + double d; + unsigned long long ll; + } conv_val; + + unsigned long long ll_value; + register double f14; + + /* __builtin_set_fpscr_rn() builtin can take a const or a variable + value between 0 and 3 as the argument. + __builtin_mtfsb0 and __builtin_mtfsb1 argument must be a constant + 30 or 31. + */ + + /* Test reading the FPSCR register */ + __asm __volatile ("mffs %0" : "=f"(f14)); + conv_val.d = f14; + + if (conv_val.d != __builtin_mffs()) + { +#ifdef DEBUG + printf("ERROR, __builtin_mffs() returned 0x%llx, not the expecected value 0x%llx\n", + __builtin_mffs(), conv_val.d); +#else + abort(); +#endif + } + + /* Test float rounding mode builtin with const value argument. */ + __builtin_set_fpscr_rn(3); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & RN_MASK; + + if (ll_value != 3) + { +#ifdef DEBUG + printf("ERROR, __builtin_set_fpscr_rn(3) returned 0x%llx, not the expecected value 0x%x\n", + ll_value, 3); +#else + abort(); +#endif + } + + val = 2; + __builtin_set_fpscr_rn(val); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & RN_MASK; + + if (ll_value != val) + { +#ifdef DEBUG + printf("ERROR, __builtin_set_fpscr_rn(val=%d) returned 0x%llx, not the expecected value 0x%x\n", + val, ll_value, val); +#else + abort(); +#endif + } + + /* Reset to 0 for testing */ + val = 0; + __builtin_set_fpscr_rn(val); + + __builtin_mtfsb1(31); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & 0x1LL; + + if (ll_value != 1) + { +#ifdef DEBUG + printf("ERROR, __builtin_mtfsb1(31) did not set the bit to a 1.\n"); +#else + abort(); +#endif + } + + __builtin_mtfsb0(31); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & 0x1LL; + + if (ll_value != 0) + { +#ifdef DEBUG + printf("ERROR, __builtin_mtfsb0(31) did not set the bit to a 0.\n"); +#else + abort(); +#endif + } + + __builtin_mtfsb1(30); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & 0x2LL; + + if (ll_value != 2) + { +#ifdef DEBUG + printf("ERROR, __builtin_mtfsb1(31) did not set the bit to a 1.\n"); +#else + abort(); +#endif + } + + __builtin_mtfsb0(30); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & 0x2LL; + + if (ll_value != 0) + { +#ifdef DEBUG + printf("ERROR, __builtin_mtfsb1(31) did not set the bit to a 0.\n"); +#else + abort(); +#endif + } + + __builtin_mtfsb1(0); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & (0x1LL << (31-0)); + + if (ll_value != (0x1LL << (31-0))) + { +#ifdef DEBUG + printf("ERROR, __builtin_mtfsb1(0) did not set the bit to a 1.\n"); +#else + abort(); +#endif + } + + __builtin_mtfsb0(0); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & (0x1LL << (31-0)); + + if (ll_value != 0) + { +#ifdef DEBUG + printf("ERROR, __builtin_mtfsb0(0) did not set the bit to a 0.\n"); +#else + abort(); +#endif + } + + + /* Test builtin float rounding mode with variable as argument. */ + val = 0; + __builtin_set_fpscr_rn(val); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & RN_MASK; + + if (ll_value != val) + { +#ifdef DEBUG + printf("ERROR, __builtin_set_fpscr_rn(val=%d) did not set rounding mode to %x.\n", + val, val); +#else + abort(); +#endif + } + + val = 3; + __builtin_set_fpscr_rn(val); + conv_val.d = __builtin_mffs(); + ll_value = conv_val.ll & RN_MASK; + + if (ll_value != val) + { +#ifdef DEBUG + printf("ERROR, __builtin_set_fpscr_rn(val=%d) did not set rounding mode to %x.\n", + val, val); +#else + abort(); +#endif + } +} diff --git a/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c b/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c new file mode 100644 index 0000000..a529ce6 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c @@ -0,0 +1,22 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-options "-O2 -std=c99" } */ + +#include + +int main () +{ + + /* Test builin with out of range arguments. Can only test for constant + int arguments. The builtins __builtin_set_fpscr_rn() also supports a + variable as an argument but can't test variable value at compile time. */ + + __builtin_mtfsb0(-1); /* { dg-error "Argument must be a constant between 0 and 31" } */ + __builtin_mtfsb0(32); /* { dg-error "Argument must be a constant between 0 and 31" } */ + + __builtin_mtfsb1(-1); /* { dg-error "Argument must be a constant between 0 and 31" } */ + __builtin_mtfsb1(32); /* { dg-error "Argument must be a constant between 0 and 31" } */ + + __builtin_set_fpscr_rn(-1); /* { dg-error "Argument must be a value between 0 and 3" } */ + __builtin_set_fpscr_rn(4); /* { dg-error "Argument must be a value between 0 and 3" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/test_mffsl.c b/gcc/testsuite/gcc.target/powerpc/test_mffsl.c new file mode 100644 index 0000000..278dfbf --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/test_mffsl.c @@ -0,0 +1,34 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-options "-O2 -std=c99" } */ + +#include + +#ifdef DEBUG +#include +#endif + +void abort (void); + +int main () +{ + + register double f14; + union blah { + double d; + unsigned long long ll; + } conv_val; + + /* Test reading the FPSCR register. */ + __asm __volatile ("mffs %0" : "=f"(f14)); + conv_val.d = f14; + + if (conv_val.d != __builtin_mffsl()) + { +#ifdef DEBUG + printf("ERROR, __builtin_mffsl() returned 0x%llx, not the expecected value 0x%llx\n", + __builtin_mffsl(), conv_val.d); +#else + abort(); +#endif + } +} -- cgit v1.1 From 84eea0f700ee5e76be8754a41d7f7e492473a1e5 Mon Sep 17 00:00:00 2001 From: Carl Love Date: Mon, 1 Oct 2018 15:57:13 +0000 Subject: Update, forgot to put the PR number in the Change Log. gcc/ChangeLog: 2018-10-01 Carl Love PR 69431 * config/rs6000/rs6000-builtin.def (__builtin_mffsl): New. (__builtin_mtfsb0): New. (__builtin_mtfsb1): New. ( __builtin_set_fpscr_rn): New. (__builtin_set_fpscr_drn): New. * config/rs6000/rs6000.c (rs6000_expand_mtfsb_builtin): Add. (rs6000_expand_set_fpscr_rn_builtin): Add. (rs6000_expand_set_fpscr_drn_builtin): Add. (rs6000_expand_builtin): Add case statement entries for RS6000_BUILTIN_MTFSB0, RS6000_BUILTIN_MTFSB1, RS6000_BUILTIN_SET_FPSCR_RN, RS6000_BUILTIN_SET_FPSCR_DRN, RS6000_BUILTIN_MFFSL. (rs6000_init_builtins): Add ftype initialization and def_builtin calls for __builtin_mffsl, __builtin_mtfsb0, __builtin_mtfsb1, __builtin_set_fpscr_rn, __builtin_set_fpscr_drn. * config/rs6000.md (rs6000_mtfsb0, rs6000_mtfsb1, rs6000_mffscrn, rs6000_mffscdrn): Add define_insn. (rs6000_set_fpscr_rn, rs6000_set_fpscr_drn): Add define_expand. * doc/extend.texi: Add documentation for the builtins. gcc/testsuite/ChangeLog: 2018-10-01 Carl Love PR 69431 * gcc.target/powerpc/test_mffsl-p9.c: New file. * gcc.target/powerpc/test_fpscr_rn_builtin.c: New file. * gcc.target/powerpc/test_fpscr_drn_builtin.c: New file. * gcc.target/powerpc/test_fpscr_rn_builtin_error.c: New file. * gcc.target/powerpc/test_fpscr_drn_builtin_error.c: New file. From-SVN: r264764 --- gcc/ChangeLog | 1 + gcc/testsuite/ChangeLog | 1 + 2 files changed, 2 insertions(+) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 49f99ed..b43cc38 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,6 @@ 2018-10-01 Carl Love + PR 69431 * config/rs6000/rs6000-builtin.def (__builtin_mffsl): New. (__builtin_mtfsb0): New. (__builtin_mtfsb1): New. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 22713d9..f322cc5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,6 @@ 2018-10-01 Carl Love + PR 69431 * gcc.target/powerpc/test_mffsl-p9.c: New file. * gcc.target/powerpc/test_fpscr_rn_builtin.c: New file. * gcc.target/powerpc/test_fpscr_drn_builtin.c: New file. -- cgit v1.1 From 2649038cea4670fb51ad82751126661ac9e86c8a Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 1 Oct 2018 18:11:46 +0100 Subject: * ru.po: Update. From-SVN: r264766 --- gcc/po/ChangeLog | 4 + gcc/po/ru.po | 29101 ++++++++++++++++++++--------------------------------- 2 files changed, 10738 insertions(+), 18367 deletions(-) (limited to 'gcc') diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index cc99fed..6be8683 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,7 @@ +2018-10-01 Joseph Myers + + * ru.po: Update. + 2018-07-30 Joseph Myers * de.po, sv.po: Update. diff --git a/gcc/po/ru.po b/gcc/po/ru.po index aa79305..ea56e32 100644 --- a/gcc/po/ru.po +++ b/gcc/po/ru.po @@ -1,19 +1,19 @@ # Translation of gcc messages to Russian # Copyright (C) 2006 Free Software Foundation, Inc. # This file is distributed under the same license as the gcc package. -# # Nadezhda Vyukova , 2006, 2014. # Nickolay V. Shmyrev , 2008. # Pavel Maryanov , 2006, 2008. # Yuri Kozlov , 2011. -# Pavel Maryanov , 2012. # Vladimir Galatenko , 2016. +# Pavel Maryanov , 2012, 2018. +# msgid "" msgstr "" -"Project-Id-Version: gcc 8.1-b20180128\n" +"Project-Id-Version: gcc 8.2.0\n" "Report-Msgid-Bugs-To: https://gcc.gnu.org/bugs/\n" "POT-Creation-Date: 2018-07-25 14:25+0000\n" -"PO-Revision-Date: 2018-01-30 10:25+0300\n" +"PO-Revision-Date: 2018-10-01 13:43+0300\n" "Last-Translator: Pavel Maryanov \n" "Language-Team: Russian \n" "Language: ru\n" @@ -22,6 +22,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Bugs: Report translation errors to the Language-Team address.\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Poedit 2.1.1\n" #: cfgrtl.c:2679 msgid "flow control insn inside a basic block" @@ -126,24 +127,21 @@ msgid "compilation terminated due to -Wfatal-errors.\n" msgstr "компиляция прервана из-за -Wfatal-errors.\n" #: diagnostic.c:525 -#, fuzzy, c-format -#| msgid "" -#| "Please submit a full bug report,\n" -#| "with preprocessed source if appropriate.\n" -#| "See %s for instructions.\n" +#, c-format msgid "" "Please submit a full bug report,\n" "with preprocessed source if appropriate.\n" msgstr "" "Отправьте подробное сообщение об ошибке\n" "с препроцессированным исходным кодом.\n" -"Смотрите инструкции в %s.\n" +"\n" #: diagnostic.c:531 -#, fuzzy, c-format -#| msgid "Use fp double instructions" +#, c-format msgid "See %s for instructions.\n" -msgstr "Использовать инструкции двойной точности плавающих вычислений" +msgstr "" +"Инструкции см. в %s.\n" +"\n" #: diagnostic.c:540 #, c-format @@ -271,7 +269,8 @@ msgid "" msgstr "" "\n" "\n" -"Продолжать? (y - да, n - нет) " +"Продолжать? \n" +"(y — да, n — нет) " #: gcc.c:3209 #, c-format @@ -288,310 +287,292 @@ msgid "Options:\n" msgstr "Ключи:\n" #: gcc.c:3428 -#, fuzzy -#| msgid " -pass-exit-codes Exit with highest error code from a phase\n" msgid " -pass-exit-codes Exit with highest error code from a phase.\n" -msgstr " -pass-exit-codes Выход с максимальным кодом возврата от прохода\n" +msgstr "" +" -pass-exit-codes Выход с максимальным кодом возврата от прохода.\n" +"\n" #: gcc.c:3429 -#, fuzzy -#| msgid " --help Display this information\n" msgid " --help Display this information.\n" -msgstr " --help Вывести этот текст\n" +msgstr "" +" --help Показать этот текст.\n" +"\n" #: gcc.c:3430 -#, fuzzy -#| msgid " --target-help Display target specific command line options\n" msgid " --target-help Display target specific command line options.\n" -msgstr " --target-help Показать специфические ключи целевой платформы\n" +msgstr "" +" --target-help Показать специфические ключи целевой платформы.\n" +"\n" #: gcc.c:3431 -#, fuzzy -#| msgid " --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...]\n" msgid " --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].\n" -msgstr " --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...]\n" +msgstr "" +" --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].\n" +"\n" #: gcc.c:3432 -#, fuzzy -#| msgid " Display specific types of command line options\n" msgid " Display specific types of command line options.\n" -msgstr " Показать специфические ключи командной строки\n" +msgstr "" +" Показать специфические ключи командной строки.\n" +"\n" #: gcc.c:3434 -#, fuzzy -#| msgid " (Use '-v --help' to display command line options of sub-processes)\n" msgid " (Use '-v --help' to display command line options of sub-processes).\n" -msgstr " (Задайте '-v --help' для вывода ключей всех проходов компиляции)\n" +msgstr "" +" ('-v --help' показывает ключи всех проходов компиляции).\n" +"\n" #: gcc.c:3435 -#, fuzzy -#| msgid " --version Display compiler version information\n" msgid " --version Display compiler version information.\n" -msgstr " --version Показать информацию о версии компилятора\n" +msgstr "" +" --version Показать информацию о версии компилятора.\n" +"\n" #: gcc.c:3436 -#, fuzzy -#| msgid " -dumpspecs Display all of the built in spec strings\n" msgid " -dumpspecs Display all of the built in spec strings.\n" -msgstr " -dumpspecs Показать встроенные спецификации\n" +msgstr "" +" -dumpspecs Показать все встроенные спецификации.\n" +"\n" #: gcc.c:3437 -#, fuzzy -#| msgid " -dumpversion Display the version of the compiler\n" msgid " -dumpversion Display the version of the compiler.\n" -msgstr " -dumpversion Показать версию компилятора\n" +msgstr "" +" -dumpversion Показать версию компилятора.\n" +"\n" #: gcc.c:3438 -#, fuzzy -#| msgid " -dumpmachine Display the compiler's target processor\n" msgid " -dumpmachine Display the compiler's target processor.\n" -msgstr " -dumpmachine Показать имя целевой платформы\n" +msgstr "" +" -dumpmachine Показать имя целевой платформы.\n" +"\n" #: gcc.c:3439 -#, fuzzy -#| msgid " -print-search-dirs Display the directories in the compiler's search path\n" msgid " -print-search-dirs Display the directories in the compiler's search path.\n" -msgstr " -print-search-dirs Показать каталоги поиска\n" +msgstr "" +" -print-search-dirs Показать каталоги поиска.\n" +"\n" #: gcc.c:3440 -#, fuzzy -#| msgid " -print-libgcc-file-name Display the name of the compiler's companion library\n" msgid " -print-libgcc-file-name Display the name of the compiler's companion library.\n" -msgstr " -print-libgcc-file-name Показать имя run-time библиотеки компилятора\n" +msgstr "" +" -print-libgcc-file-name Показать имя run-time библиотеки компилятора.\n" +"\n" #: gcc.c:3441 -#, fuzzy -#| msgid " -print-file-name= Display the full path to library \n" msgid " -print-file-name= Display the full path to library .\n" -msgstr " -print-file-name=<биб> Показать полное маршрутное имя библиотеки <биб>\n" +msgstr "" +" -print-file-name= Показать полное маршрутное имя библиотеки .\n" +"\n" #: gcc.c:3442 -#, fuzzy -#| msgid " -print-prog-name= Display the full path to compiler component \n" msgid " -print-prog-name= Display the full path to compiler component .\n" -msgstr " -print-prog-name=<прог> Показать полное имя компоненты компилятора <прог>\n" +msgstr "" +" -print-prog-name= Показать полное имя компонента компилятора .\n" +"\n" #: gcc.c:3443 -#, fuzzy -#| msgid "" -#| " -print-multiarch Display the target's normalized GNU triplet, used as\n" -#| " a component in the library path\n" msgid "" " -print-multiarch Display the target's normalized GNU triplet, used as\n" " a component in the library path.\n" msgstr "" -" -print-multiarch Показать триплет GNU, используемый как компонент маршрутных\n" -" имен библиотек\n" +" -print-multiarch Показать триплет GNU, используемый как компонент\n" +"\n" +" маршрутных имён библиотек.\n" #: gcc.c:3446 -#, fuzzy -#| msgid " -print-multi-directory Display the root directory for versions of libgcc\n" msgid " -print-multi-directory Display the root directory for versions of libgcc.\n" -msgstr " -print-multi-directory Показать корневой каталог с версиями libgcc\n" +msgstr "" +" -print-multi-directory Показать корневой каталог с версиями libgcc.\n" +"\n" #: gcc.c:3447 -#, fuzzy -#| msgid "" -#| " -print-multi-lib Display the mapping between command line options and\n" -#| " multiple library search directories\n" msgid "" " -print-multi-lib Display the mapping between command line options and\n" " multiple library search directories.\n" msgstr "" -" -print-multi-lib Показать соответствие между ключами и каталогами\n" -" поиска библиотек\n" +" -print-multi-lib Показать соответствие между ключами\n" +"\n" +" каталогами поиска библиотек.\n" +"\n" #: gcc.c:3450 -#, fuzzy -#| msgid " -print-multi-os-directory Display the relative path to OS libraries\n" msgid " -print-multi-os-directory Display the relative path to OS libraries.\n" -msgstr " -print-multi-os-directory Показать относительный маршрут к библиотекам операционной системы\n" +msgstr "" +" -print-multi-os-directory Показать относительный путь к библиотекам операционной системы.\n" +"\n" #: gcc.c:3451 -#, fuzzy -#| msgid " -print-sysroot Display the target libraries directory\n" msgid " -print-sysroot Display the target libraries directory.\n" -msgstr " -print-sysroot Показать каталог библиотек цели\n" +msgstr "" +" -print-sysroot Показать целевой каталог библиотек.\n" +"\n" #: gcc.c:3452 -#, fuzzy -#| msgid " -print-sysroot-headers-suffix Display the sysroot suffix used to find headers\n" msgid " -print-sysroot-headers-suffix Display the sysroot suffix used to find headers.\n" -msgstr " -print-sysroot-headers-suffix Вывести суффикс sysroot, используемый для поиска заголовочных файлов\n" +msgstr "" +" -print-sysroot-headers-suffix Показать суффикс sysroot, используемый для поиска заголовочных файлов.\n" +"\n" #: gcc.c:3453 -#, fuzzy -#| msgid " -Wa, Pass comma-separated on to the assembler\n" msgid " -Wa, Pass comma-separated on to the assembler.\n" -msgstr " -Wa,<ключи> Передать <ключи>, разделённые запятыми, ассемблеру\n" +msgstr "" +" -Wa,<ключи> Передать в ассемблер <ключи>, разделённые запятыми.\n" +"\n" #: gcc.c:3454 -#, fuzzy -#| msgid " -Wp, Pass comma-separated on to the preprocessor\n" msgid " -Wp, Pass comma-separated on to the preprocessor.\n" -msgstr " -Wp,<ключи> Передать <ключи>, разделённые запятыми, препроцессору\n" +msgstr "" +" -Wp,<ключи> Передать в препроцессор <ключи>, разделённые запятыми.\n" +"\n" #: gcc.c:3455 -#, fuzzy -#| msgid " -Wl, Pass comma-separated on to the linker\n" msgid " -Wl, Pass comma-separated on to the linker.\n" -msgstr " -Wl,<ключи> Передать <ключи>, разделённые запятыми, компоновщику\n" +msgstr "" +" -Wl,<ключи> Передать в компоновщик <ключи>, разделённые запятыми.\n" +"\n" #: gcc.c:3456 -#, fuzzy -#| msgid " -Xassembler Pass on to the assembler\n" msgid " -Xassembler Pass on to the assembler.\n" -msgstr " -Xassembler <арг> Передать <арг> ассемблеру\n" +msgstr "" +" -Xassembler <арг> Передать <арг> ассемблеру.\n" +"\n" #: gcc.c:3457 -#, fuzzy -#| msgid " -Xpreprocessor Pass on to the preprocessor\n" msgid " -Xpreprocessor Pass on to the preprocessor.\n" -msgstr " -Xpreprocessor <арг> Передать <арг> препроцессору\n" +msgstr "" +" -Xpreprocessor <арг> Передать <арг> препроцессору.\n" +"\n" #: gcc.c:3458 -#, fuzzy -#| msgid " -Xlinker Pass on to the linker\n" msgid " -Xlinker Pass on to the linker.\n" -msgstr " -Xlinker <арг> Передать <арг> компоновщику\n" +msgstr "" +" -Xlinker <арг> Передать <арг> компоновщику.\n" +"\n" #: gcc.c:3459 -#, fuzzy -#| msgid " -save-temps Do not delete intermediate files\n" msgid " -save-temps Do not delete intermediate files.\n" -msgstr " -save-temps Не удалять промежуточные файлы\n" +msgstr "" +" -save-temps Не удалять промежуточные файлы.\n" +"\n" #: gcc.c:3460 -#, fuzzy -#| msgid " -save-temps= Do not delete intermediate files\n" msgid " -save-temps= Do not delete intermediate files.\n" -msgstr " -save-temps= Не удалять промежуточные файлы\n" +msgstr "" +" -save-temps= Не удалять промежуточные файлы.\n" +"\n" #: gcc.c:3461 -#, fuzzy -#| msgid "" -#| " -no-canonical-prefixes Do not canonicalize paths when building relative\n" -#| " prefixes to other gcc components\n" msgid "" " -no-canonical-prefixes Do not canonicalize paths when building relative\n" " prefixes to other gcc components.\n" msgstr "" " -no-canonical-prefixes Не канонизировать пути при сборке относительных\n" -" префиксов к другим компонентам gcc\n" +" префиксов к другим компонентам gcc.\n" +"\n" #: gcc.c:3464 -#, fuzzy -#| msgid " -pipe Use pipes rather than intermediate files\n" msgid " -pipe Use pipes rather than intermediate files.\n" -msgstr " -pipe Передавать промежуточные данные по конвейеру\n" +msgstr "" +" -pipe Использовать конвейер, а не промежуточные файлы.\n" +"\n" #: gcc.c:3465 -#, fuzzy -#| msgid " -time Time the execution of each subprocess\n" msgid " -time Time the execution of each subprocess.\n" -msgstr " -time Включить хронометраж проходов\n" +msgstr "" +" -time Включить хронометраж проходов.\n" +"\n" #: gcc.c:3466 -#, fuzzy -#| msgid " -specs= Override built-in specs with the contents of \n" msgid " -specs= Override built-in specs with the contents of .\n" msgstr "" " -specs=<файл> Использовать <файл> спецификаций вместо \n" -" внутренних спецификаций компилятора\n" +" внутренних спецификаций компилятора.\n" +"\n" #: gcc.c:3467 -#, fuzzy -#| msgid " -std= Assume that the input sources are for \n" msgid " -std= Assume that the input sources are for .\n" -msgstr " -std=<стандарт> Считать, что исходный код следует <стандарту>\n" +msgstr "" +" -std=<стандарт> Считать, что исходный код следует <стандарту>.\n" +"\n" #: gcc.c:3468 -#, fuzzy -#| msgid "" -#| " --sysroot= Use as the root directory for headers\n" -#| " and libraries\n" msgid "" " --sysroot= Use as the root directory for headers\n" " and libraries.\n" msgstr "" -" --sysroot=<каталог> Использовать <каталог> как головной каталог для заголовков\n" -" и библиотек\n" +" --sysroot=<каталог> Использовать <каталог> как корневой для заголовков\n" +"\n" +" и библиотек.\n" #: gcc.c:3471 -#, fuzzy -#| msgid " -B Add to the compiler's search paths\n" msgid " -B Add to the compiler's search paths.\n" msgstr "" -" -B <каталог> добавить <каталог> к списку поиска программ \n" -" компилятора\n" +" -B <каталог> Добавить <каталог> к списку поиска программ \n" +" компилятора.\n" +"\n" #: gcc.c:3472 -#, fuzzy -#| msgid " -v Display the programs invoked by the compiler\n" msgid " -v Display the programs invoked by the compiler.\n" -msgstr " -v Отображать команды, запускаемые компилятором\n" +msgstr "" +" -v Показать команды, запускаемые компилятором.\n" +"\n" #: gcc.c:3473 -#, fuzzy -#| msgid " -### Like -v but options quoted and commands not executed\n" msgid " -### Like -v but options quoted and commands not executed.\n" -msgstr " -### Как -v, но параметры берутся в кавычки и команды не запускаются\n" +msgstr "" +" -### Как -v, но параметры берутся в кавычки и команды не запускаются.\n" +"\n" #: gcc.c:3474 -#, fuzzy -#| msgid " -E Preprocess only; do not compile, assemble or link\n" msgid " -E Preprocess only; do not compile, assemble or link.\n" -msgstr " -E Только препроцессирование - без компиляции, ассемблирования, компоновки\n" +msgstr "" +" -E Только препроцессинг, без компиляции, сборки и компоновки.\n" +"\n" #: gcc.c:3475 -#, fuzzy -#| msgid " -S Compile only; do not assemble or link\n" msgid " -S Compile only; do not assemble or link.\n" -msgstr " -S Только компиляция - без ассемблирования и компоновки\n" +msgstr "" +" -S Только компиляция, без ассемблирования сборки и компоновки.\n" +"\n" #: gcc.c:3476 -#, fuzzy -#| msgid " -c Compile and assemble, but do not link\n" msgid " -c Compile and assemble, but do not link.\n" -msgstr " -c Компиляция и ассемблирование, без компоновки\n" +msgstr "" +" -c Компиляция и сборка, но без компоновки.\n" +"\n" #: gcc.c:3477 -#, fuzzy -#| msgid " -o Place the output into \n" msgid " -o Place the output into .\n" -msgstr " -o <файл> Записать результат в <файл>\n" +msgstr "" +" -o <файл> Записать результат в <файл>.\n" +"\n" #: gcc.c:3478 -#, fuzzy -#| msgid " -pie Create a position independent executable\n" msgid "" " -pie Create a dynamically linked position independent\n" " executable.\n" -msgstr " -pie Генерировать позиционно-независимый код для выполняемых модулей\n" +msgstr "" +" -pie Генерировать позиционно-независимый код для\n" +"\n" +" выполняемых модулей.\n" #: gcc.c:3480 -#, fuzzy -#| msgid " -shared Create a shared library\n" msgid " -shared Create a shared library.\n" -msgstr " -shared Создать разделяемую библиотеку\n" +msgstr "" +" -shared Создать разделяемую библиотеку.\n" +"\n" #: gcc.c:3481 -#, fuzzy -#| msgid "" -#| " -x Specify the language of the following input files\n" -#| " Permissible languages include: c c++ assembler none\n" -#| " 'none' means revert to the default behavior of\n" -#| " guessing the language based on the file's extension\n" msgid "" " -x Specify the language of the following input files.\n" " Permissible languages include: c c++ assembler none\n" " 'none' means revert to the default behavior of\n" " guessing the language based on the file's extension.\n" msgstr "" -" -x <язык> Задать язык последующих входных файлов.\n" -" <язык> может быть: c c++ assembler none\n" -" 'none' означает, что далее язык нужно\n" -" определять по расширению имени файла\n" +" -x <язык> Указать язык для следующих входных файлов.\n" +" Допустимые языки: c c++ assembler none\n" +" 'none' означает стандартное поведение\n" +" угадывания языка по расширению файла.\n" #: gcc.c:3488 #, c-format @@ -602,8 +583,11 @@ msgid "" " other options on to these processes the -W options must be used.\n" msgstr "" "\n" -"Ключи, начинающиеся с -g, -f, -m, -O, -W, или --param автоматически\n" -"передаются процессам, запускаемым %s. Для передачи ключей этим процессам, используйте ключи -W<буква>.\n" +"Ключи, начинающиеся с -g, -f, -m, -O, -W, или --param, автоматически\n" +" передаются процессам, запускаемым %s.\n" +" Чтобы передать ключи\n" +" этим процессам, используйте ключи -W<буква>.\n" +"\n" #: gcc.c:5963 #, c-format @@ -639,11 +623,15 @@ msgstr "драйвер gcc версия %s; %sисполняет gcc верси #, c-format msgid "The bug is not reproducible, so it is likely a hardware or OS problem.\n" msgstr "" +"Ошибка не воспроизводится. Возможно, это проблема оборудования или ОС.\n" +"\n" #: gcc.c:6945 #, c-format msgid "Preprocessed source stored into %s file, please attach this to your bugreport.\n" msgstr "" +"Предварительно обработанный исходный текст сохранён в файле %s. Приложите его к отчёту об ошибке.\n" +"\n" #: gcc.c:7898 #, c-format @@ -685,9 +673,13 @@ msgid "" "\n" msgstr "" "Это свободно распространяемое программное обеспечение. Условия копирования\n" -"приведены в исходных текстах. Без гарантии каких-либо качеств, включая \n" +"приведены в исходных текстах.\n" +"\n" +" Без гарантии каких-либо качеств, включая \n" "коммерческую ценность и применимость для каких-либо целей.\n" "\n" +"\n" +"\n" #: gcc.c:8346 #, c-format @@ -735,92 +727,116 @@ msgstr "" #, c-format msgid " merge [options] Merge coverage file contents\n" msgstr "" +" merge [ключи] Слияние содержимого файлов покрытия\n" +"\n" #: gcov-tool.c:176 gcov-tool.c:271 -#, fuzzy, c-format -#| msgid " -n, --no-output Do not create an output file\n" +#, c-format msgid " -o, --output Output directory\n" -msgstr " -n, --no-output Не создавать выходной файл\n" +msgstr "" +" -o, --output Выходной каталог\n" +"\n" #: gcov-tool.c:177 gcov-tool.c:273 gcov-tool.c:425 -#, fuzzy, c-format -#| msgid " -v, --version Print version number, then exit\n" +#, c-format msgid " -v, --verbose Verbose mode\n" -msgstr " -v, --version Показать номер версии и выйти\n" +msgstr "" +" -v, --verbose Подробный вывод\n" +"\n" #: gcov-tool.c:178 #, c-format msgid " -w, --weight Set weights (float point values)\n" msgstr "" +" -w, --weight Веса каталогов 1, 2 (веществ. значения)\n" +"\n" #: gcov-tool.c:194 #, c-format msgid "Merge subcomand usage:" -msgstr "" +msgstr "Команда слияния (merge):" #: gcov-tool.c:269 #, c-format msgid " rewrite [options] Rewrite coverage file contents\n" msgstr "" +" rewrite [опции] <каталог> Перезаписать содержимое файла с данными покрытия\n" +"\n" #: gcov-tool.c:270 #, c-format msgid " -n, --normalize Normalize the profile\n" msgstr "" +" -n, --normalize Нормализовать профиль\n" +"\n" #: gcov-tool.c:272 #, c-format msgid " -s, --scale Scale the profile counters\n" msgstr "" +" -s, --scale <вещ. или дробь> Масштабировать счётчики профиля\n" +"\n" #: gcov-tool.c:290 #, c-format msgid "Rewrite subcommand usage:" -msgstr "" +msgstr "Команда перезаписи (rewrite):" #: gcov-tool.c:329 #, c-format msgid "scaling cannot co-exist with normalization, skipping\n" msgstr "" +"масштабирование и нормализация не могут использоваться совместно\n" +"\n" #: gcov-tool.c:342 gcov-tool.c:352 #, c-format msgid "incorrect format in scaling, using 1/1\n" msgstr "" +"некорректный формат для масштаба, используется 1/1\n" +"\n" #: gcov-tool.c:362 #, c-format msgid "normalization cannot co-exist with scaling\n" msgstr "" +"нормализация и масштабирование не могут использоваться совместно\n" +"\n" #: gcov-tool.c:419 #, c-format msgid " overlap [options] Compute the overlap of two profiles\n" msgstr "" +" overlap [опции] Вычислить перекрытие двух профилей\n" +"\n" #: gcov-tool.c:420 -#, fuzzy, c-format -#| msgid " -h, --help Print this help, then exit\n" +#, c-format msgid " -f, --function Print function level info\n" -msgstr " -h, --help Показать эту справку и выйти\n" +msgstr "" +" -f, --function Вывести информацию уровня функции\n" +"\n" #: gcov-tool.c:421 -#, fuzzy, c-format -#| msgid " -h, --help Print this help, then exit\n" +#, c-format msgid " -F, --fullname Print full filename\n" -msgstr " -h, --help Показать эту справку и выйти\n" +msgstr "" +" -F, --fullname Напечатать полное имя файла\n" +"\n" #: gcov-tool.c:422 -#, fuzzy, c-format -#| msgid " -h, --help Print this help, then exit\n" +#, c-format msgid " -h, --hotonly Only print info for hot objects/functions\n" -msgstr " -h, --help Показать эту справку и выйти\n" +msgstr "" +" -h, --hotonly Вывести информацию только о \"горячих\" объектах/функциях\n" +"\n" #: gcov-tool.c:423 -#, fuzzy, c-format -#| msgid " -h, --help Print this help, then exit\n" +#, c-format msgid " -o, --object Print object level info\n" -msgstr " -h, --help Показать эту справку и выйти\n" +msgstr "" +" -o, --object Вывести информацию уровня объекта\n" +"\n" #: gcov-tool.c:424 #, c-format @@ -830,15 +846,14 @@ msgstr "" #: gcov-tool.c:445 #, c-format msgid "Overlap subcomand usage:" -msgstr "" +msgstr "Команда перекрытия (overlap):" #: gcov-tool.c:511 -#, fuzzy, c-format -#| msgid "Usage: %s [OPTIONS]... CLASSNAMEmain [OUTFILE]\n" +#, c-format msgid "" "Usage: %s [OPTION]... SUB_COMMAND [OPTION]...\n" "\n" -msgstr "Использование: %s [КЛЮЧИ]... ИМЯ-КЛАССАmain [ВЫХОДНОЙ ФАЙЛ]\n" +msgstr "" #: gcov-tool.c:512 #, c-format @@ -848,16 +863,14 @@ msgid "" msgstr "" #: gcov-tool.c:513 -#, fuzzy, c-format -#| msgid " -h, --help Print this help, then exit\n" +#, c-format msgid " -h, --help Print this help, then exit\n" -msgstr " -h, --help Показать эту справку и выйти\n" +msgstr "" #: gcov-tool.c:514 -#, fuzzy, c-format -#| msgid " -v, --version Print version number, then exit\n" +#, c-format msgid " -v, --version Print version number, then exit\n" -msgstr " -v, --version Показать номер версии и выйти\n" +msgstr "" #: gcov-tool.c:518 gcov.c:835 #, c-format @@ -884,21 +897,19 @@ msgid "" "\n" msgstr "" "Это свободно распространяемое программное обеспечение. Условия копирования\n" -"приведены в исходных текстах. Без гарантии каких-либо качеств, включая \n" -"коммерческую ценность и применимость для каких-либо целей.\n" +"приведены в исходных текстах.\n" +"\n" +"\n" +"There is NO warranty; not even for MERCHANTABILITY or \n" +"FITNESS FOR A PARTICULAR PURPOSE.\n" "\n" #: gcov.c:811 -#, fuzzy, c-format -#| msgid "" -#| "Usage: gcov [OPTION]... SOURCE|OBJ...\n" -#| "\n" +#, c-format msgid "" "Usage: gcov [OPTION...] SOURCE|OBJ...\n" "\n" msgstr "" -"Использование: gcov [КЛЮЧ]... ИСХОДНЫЙ/ОБЪЕКТНЫЙ ФАЙЛ...\n" -"\n" #: gcov.c:812 #, c-format @@ -920,16 +931,11 @@ msgid " -b, --branch-probabilities Include branch probabilities in output\ msgstr " -b, --branch-probabilities Вывести вероятности переходов\n" #: gcov.c:815 -#, fuzzy, c-format -#| msgid "" -#| " -c, --branch-counts Given counts of branches taken\n" -#| " rather than percentages\n" +#, c-format msgid "" " -c, --branch-counts Output counts of branches taken\n" " rather than percentages\n" msgstr "" -" -c, --branch-counts При счётчиках переходов, заданных\n" -" в абсолютных, а не в процентных значениях\n" #: gcov.c:817 #, c-format @@ -957,10 +963,9 @@ msgid " -j, --human-readable Output human readable numbers\n" msgstr "" #: gcov.c:822 -#, fuzzy, c-format -#| msgid " -n, --no-output Do not create an output file\n" +#, c-format msgid " -k, --use-colors Emit colored output\n" -msgstr " -n, --no-output Не создавать выходной файл\n" +msgstr "" #: gcov.c:823 #, c-format @@ -968,8 +973,6 @@ msgid "" " -l, --long-file-names Use long output file names for included\n" " source files\n" msgstr "" -" -l, --long-file-names Выводить длинные имена включаемых\n" -" исходных файлов\n" #: gcov.c:825 #, c-format @@ -1016,16 +1019,14 @@ msgid " -v, --version Print version number, then exit\n" msgstr " -v, --version Показать номер версии и выйти\n" #: gcov.c:833 -#, fuzzy, c-format -#| msgid " -v, --version Print version number, then exit\n" +#, c-format msgid " -w, --verbose Print verbose informations\n" -msgstr " -v, --version Показать номер версии и выйти\n" +msgstr " -w, --verbose Вывод подробной информации\n" #: gcov.c:834 -#, fuzzy, c-format -#| msgid " -p, --preserve-paths Preserve all pathname components\n" +#, c-format msgid " -x, --hash-filenames Hash long pathnames\n" -msgstr " -p, --preserve-paths Сохранить все компоненты полного имени\n" +msgstr " -x, --hash-filenames Хэшировать длинные пути к файлам\n" #: gcov.c:845 #, c-format @@ -1058,39 +1059,42 @@ msgid "\n" msgstr "\n" #: gcov.c:1299 -#, fuzzy, c-format -#| msgid "%s: Cannot open output file: %s\n" +#, c-format msgid "Cannot open intermediate output file %s\n" -msgstr "%s: Ошибка открытия выходного файла: %s\n" +msgstr "Не удалось открыть промежуточный выходной файл: %s\n" #: gcov.c:1505 -#, fuzzy, c-format -#| msgid "%s:source file is newer than graph file '%s'\n" +#, c-format msgid "%s:source file is newer than notes file '%s'\n" -msgstr "%s:исходный файл новее чем файл графа '%s'\n" +msgstr "" +"%s: исходный файл новее файла заметок '%s'\n" +"\n" #: gcov.c:1510 -#, fuzzy, c-format -#| msgid "(the message is only displayed one per source file)\n" +#, c-format msgid "(the message is displayed only once per source file)\n" -msgstr "(для каждого файла исходных текстов сообщение будет выдано один раз)\n" +msgstr "" +"(сообщение выводится один раз для каждого исходного файла)\n" +"\n" #: gcov.c:1530 -#, fuzzy, c-format -#| msgid "%s:cannot open graph file\n" +#, c-format msgid "%s:cannot open notes file\n" -msgstr "%s:ошибка открытия графического файла\n" +msgstr "" +"%s: не удалось открыть файл заметок\n" +"\n" #: gcov.c:1536 -#, fuzzy, c-format -#| msgid "%s:not a gcov data file\n" +#, c-format msgid "%s:not a gcov notes file\n" -msgstr "%s:не файл данных gcov\n" +msgstr "" +"%s: не является файлом заметок gcov\n" +"\n" #: gcov.c:1549 #, c-format msgid "%s:version '%.4s', prefer '%.4s'\n" -msgstr "%s:версия '%.4s', предпочтительно '%.4s'\n" +msgstr "%s: версия '%.4s', предпочтительно '%.4s'\n" #: gcov.c:1600 #, c-format @@ -1123,15 +1127,16 @@ msgid "%s:version '%.4s', prefer version '%.4s'\n" msgstr "%s:версия '%.4s', предпочтительна версия '%.4s'\n" #: gcov.c:1764 -#, fuzzy, c-format -#| msgid "%s:stamp mismatch with graph file\n" +#, c-format msgid "%s:stamp mismatch with notes file\n" -msgstr "%s:штамп не соответствует графическому файлу\n" +msgstr "" +"%s:штамп не соответствует файлу заметок\n" +"\n" #: gcov.c:1807 #, c-format msgid "%s:profile mismatch for '%s'\n" -msgstr "%s:несоответствие профайла для '%s'\n" +msgstr "%s:несоответствие профиля для '%s'\n" #: gcov.c:1825 #, c-format @@ -1214,21 +1219,19 @@ msgid "call %2d never executed\n" msgstr "вызов %2d ни разу не исполнялся\n" #: gcov.c:2692 -#, fuzzy, c-format -#| msgid "branch %2d taken %s%s\n" +#, c-format msgid "branch %2d taken %s%s" -msgstr "переход %2d выполнен %s%s\n" +msgstr "переход %2d выполнен %s%s" #: gcov.c:2697 -#, fuzzy, c-format -#| msgid "branch %2d never executed\n" +#, c-format msgid "branch %2d never executed" -msgstr "переход %2d ни разу не исполнялся\n" +msgstr "переход %2d ни разу не выполнялся" #: gcov.c:2700 #, c-format msgid " (BB %d)" -msgstr "" +msgstr " (BB %d)" #: gcov.c:2707 #, c-format @@ -1259,10 +1262,9 @@ msgid "function returns address of local variable" msgstr "функция возвращает адрес локальной переменной" #: gimple-ssa-isolate-paths.c:544 gimple-ssa-isolate-paths.c:426 -#, fuzzy, gcc-internal-format -#| msgid "function returns address of local variable" +#, gcc-internal-format msgid "function may return address of local variable" -msgstr "функция возвращает адрес локальной переменной" +msgstr "функция может возвращать адрес локальной переменной" #: incpath.c:73 #, c-format @@ -1319,16 +1321,12 @@ msgid "In function %qs" msgstr "В функции %qs" #: langhooks.c:454 cp/error.c:3396 -#, fuzzy -#| msgid " inlined from %qs at %s:%d:%d" msgid " inlined from %qs at %r%s:%d:%d%R" -msgstr " включённом из %qs в %s:%d:%d" +msgstr " включённом из %qs в %r%s:%d:%d%R" #: langhooks.c:459 cp/error.c:3401 -#, fuzzy -#| msgid " inlined from %qs at %s:%d" msgid " inlined from %qs at %r%s:%d%R" -msgstr " включённом из %qs в %s:%d" +msgstr " включённом из %qs в %r%s:%d%R" #: langhooks.c:465 cp/error.c:3407 #, c-format @@ -1345,31 +1343,28 @@ msgstr "ошибка при генерации загрузок операндо #. What to print when a switch has no documentation. #: opts.c:185 -#, fuzzy -#| msgid "This switch lacks documentation" msgid "This option lacks documentation." msgstr "Этот ключ не документирован" #: opts.c:186 msgid "Uses of this option are diagnosed." -msgstr "" +msgstr "При использовании этого ключа выдается предупреждение" #: opts.c:1148 #, c-format msgid "default %d minimum %d maximum %d" -msgstr "" +msgstr "по умолчанию %d, минимум %d, максимум %d" #: opts.c:1215 #, c-format msgid "Same as %s. Use the latter option instead." -msgstr "" +msgstr "Аналог %s. Лучше использовать последний вариант." # #: opts.c:1223 -#, fuzzy, c-format -#| msgid "(%s %s %s %s %s" +#, c-format msgid "%s Same as %s." -msgstr "(%s %s %s %s %s" +msgstr "(%s Аналог %s." #: opts.c:1294 msgid "[default]" @@ -1386,13 +1381,14 @@ msgstr "[выключено]" #: opts.c:1333 #, c-format msgid " No options with the desired characteristics were found\n" -msgstr " Не найдено ключей с требуемыми характеристиками\n" +msgstr " Не найдены ключи с требуемыми характеристиками\n" #: opts.c:1342 -#, fuzzy, c-format -#| msgid " None found. Use --help=%s to show *all* the options supported by the %s front-end\n" +#, c-format msgid " None found. Use --help=%s to show *all* the options supported by the %s front-end.\n" -msgstr " Не найдено. Задайте --help=%s для вывода *всех* ключей, поддерживаемых для языка %s\n" +msgstr "" +" Ничего не найдено. --help=%s выводит *все* ключи, поддерживаемые для языка %s.\n" +"\n" #: opts.c:1348 #, c-format @@ -1444,17 +1440,15 @@ msgid "The following options are language-related" msgstr "Следующие ключи относятся к исходному языку" #: passes.c:1797 -#, fuzzy, c-format -#| msgid "deducing %qT as %qT" +#, c-format msgid "during %s pass: %s\n" -msgstr "вывод %qT как %qT" +msgstr "в течение прохода %s: %s\n" # #: passes.c:1802 -#, fuzzy, c-format -#| msgid "In file %s:%d\n" +#, c-format msgid "dump file: %s\n" -msgstr "В файле %s:%d\n" +msgstr "файл вывода: %s\n" #: plugin.c:923 msgid "Event" @@ -1544,10 +1538,11 @@ msgid "%s%s%s %sversion %s (%s) compiled by CC, " msgstr "%s%s%s %sверсия %s (%s) скомпилировано CC, " #: toplev.c:635 -#, fuzzy, c-format -#| msgid "GMP version %s, MPFR version %s, MPC version %s\n" +#, c-format msgid "GMP version %s, MPFR version %s, MPC version %s, isl version %s\n" -msgstr "Версия GMP %s, версия MPFR %s, версия MPC %s\n" +msgstr "" +"Версия GMP %s, версия MPFR %s, версия MPC %s, версия isl %s\n" +"\n" #: toplev.c:637 #, c-format @@ -1578,10 +1573,8 @@ msgid "function not considered for inlining" msgstr "функция не подлежит inline-подстановке" #: cif-code.def:43 -#, fuzzy -#| msgid "%qE is not initialized" msgid "caller is not optimized" -msgstr "%qE не инициализирован" +msgstr "вызывающая функция не оптимизирована" #: cif-code.def:47 msgid "function body not available" @@ -1640,14 +1633,12 @@ msgid "mismatched arguments" msgstr "несовпадающие аргументы" #: cif-code.def:96 -#, fuzzy -#| msgid "expected iteration declaration or initialization" msgid "mismatched declarations during linktime optimization" -msgstr "ожидалась декларация итерации или инициализация" +msgstr "несоответствие деклараций при оптимизации времени компоновки" #: cif-code.def:100 msgid "variadic thunk call" -msgstr "" +msgstr "выбор вариантного thunk" #: cif-code.def:104 msgid "originally indirect function call not considered for inlining" @@ -1675,23 +1666,19 @@ msgstr "несовпадение атрибута уровня оптимиза #: cif-code.def:129 msgid "callee refers to comdat-local symbols" -msgstr "" +msgstr "вызываемая функция ссылается на локальные comdat символы" #: cif-code.def:133 -#, fuzzy -#| msgid "optimization level attribute mismatch" msgid "function attribute mismatch" -msgstr "несовпадение атрибута уровня оптимизации" +msgstr "несовпадение атрибутов функции" #: cif-code.def:137 -#, fuzzy -#| msgid "unrecoverable error" msgid "unreachable" -msgstr "невосстанавливаемая ошибка" +msgstr "недостижим" #: cif-code.def:141 msgid "caller is instrumentation thunk" -msgstr "" +msgstr "вызывающая функция является thunk'ом инструментирования" #. The remainder are real diagnostic types. #: diagnostic.def:33 @@ -1741,164 +1728,139 @@ msgid "permerror: " msgstr "permerror: " #: params.def:49 -#, fuzzy, no-c-format -#| msgid "Maximal estimated outcome of branch considered predictable" +#, no-c-format msgid "Maximal estimated outcome of branch considered predictable." -msgstr "Максимальная оценка перехода по ветвлению, которое считается предсказанным" +msgstr "Максимальная оценка перехода по ветвлению, которое считается предсказанным." #: params.def:54 #, no-c-format msgid "The minimal estimated speedup allowing inliner to ignore inline-insns-single and inline-insns-auto." -msgstr "" +msgstr "Минимальная оценка ускорения, при которой допускается игнорирование параметров inline-insns-single и inline-insns-auto." #: params.def:71 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions in a single function eligible for inlining" +#, no-c-format msgid "The maximum number of instructions in a single function eligible for inlining." -msgstr "Максимальное число команд в функции, пригодной для inline-подстановки" +msgstr "Максимальное число команд в функции, пригодной для inline-подстановки." #: params.def:83 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions when automatically inlining" +#, no-c-format msgid "The maximum number of instructions when automatically inlining." -msgstr "Максимальное число команд при автоматической inline-подстановке" +msgstr "Максимальное число команд при автоматической inline-подстановке." #: params.def:88 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions inline function can grow to via recursive inlining" +#, no-c-format msgid "The maximum number of instructions inline function can grow to via recursive inlining." -msgstr "Максимальное число команд, на которое может увеличиться inline-функция в результате рекурсивной подстановки" +msgstr "Максимальное число команд, на которое может увеличиться inline-функция в результате рекурсивной подстановки." #: params.def:93 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions non-inline function can grow to via recursive inlining" +#, no-c-format msgid "The maximum number of instructions non-inline function can grow to via recursive inlining." -msgstr "Максимальное число инструкций, на которое может увеличится не-inline функция в результате рекурсивных inline-подстановок" +msgstr "Максимальное число инструкций, на которое может увеличится не-inline функция в результате рекурсивных inline-подстановок." #: params.def:98 -#, fuzzy, no-c-format -#| msgid "The maximum depth of recursive inlining for inline functions" +#, no-c-format msgid "The maximum depth of recursive inlining for inline functions." -msgstr "Максимальная глубина рекурсивных inline-подстановок для inline функций" +msgstr "Максимальная глубина рекурсивных inline-подстановок для inline функций." #: params.def:103 -#, fuzzy, no-c-format -#| msgid "The maximum depth of recursive inlining for non-inline functions" +#, no-c-format msgid "The maximum depth of recursive inlining for non-inline functions." -msgstr "Максимальная глубина рекурсивных inline-подстановок для не-inline функций" +msgstr "Максимальная глубина рекурсивных inline-подстановок для не-inline функций." #: params.def:108 -#, fuzzy, no-c-format -#| msgid "Inline recursively only when the probability of call being executed exceeds the parameter" +#, no-c-format msgid "Inline recursively only when the probability of call being executed exceeds the parameter." -msgstr "Выполнять рекурсивную inline-подстановку, только если вероятность данного вызова превышает значение этого параметра" +msgstr "Выполнять рекурсивную inline-подстановку, только если вероятность данного вызова превышает значение этого параметра." #: params.def:116 -#, fuzzy, no-c-format -#| msgid "The maximum number of nested indirect inlining performed by early inliner" +#, no-c-format msgid "The maximum number of nested indirect inlining performed by early inliner." -msgstr "Максимальное число вложенных косвенных inline-подстановок, выполняемых при первом проходе подстановок" +msgstr "Максимальное число вложенных косвенных inline-подстановок, выполняемых при первом проходе подстановок." #: params.def:122 -#, fuzzy, no-c-format -#| msgid "Probability that COMDAT function will be shared with different compilation unit" +#, no-c-format msgid "Probability that COMDAT function will be shared with different compilation unit." -msgstr "Вероятность того, что функция COMDAT будет разделена с другой единицей компиляции" +msgstr "Вероятность того, что функция COMDAT будет разделена с другой единицей компиляции." #: params.def:128 -#, fuzzy, no-c-format -#| msgid "Maximum probability of the entry BB of split region (in percent relative to entry BB of the function) to make partial inlining happen" +#, no-c-format msgid "Maximum probability of the entry BB of split region (in percent relative to entry BB of the function) to make partial inlining happen." -msgstr "Максимальная вероятность входного базового блока разбиваемого региона (в процентах по отношению к входному блоку функции) для выполнения частичной inline-подстановки" +msgstr "Максимальная вероятность входного базового блока разбиваемого региона (в процентах по отношению к входному блоку функции) для выполнения частичной inline-подстановки." #: params.def:135 -#, fuzzy, no-c-format -#| msgid "If -fvariable-expansion-in-unroller is used, the maximum number of times that an individual variable will be expanded during loop unrolling" +#, no-c-format msgid "If -fvariable-expansion-in-unroller is used, the maximum number of times that an individual variable will be expanded during loop unrolling." -msgstr "При использовании -fvariable-expansion-in-unroller - максимальное число копий каждой переменной, которое может быть создано при развертке цикла" +msgstr "При использовании -fvariable-expansion-in-unroller - максимальное число копий каждой переменной, которое может быть создано при развертке цикла." #: params.def:141 -#, fuzzy, no-c-format -#| msgid "If -ftree-vectorize is used, the minimal loop bound of a loop to be considered for vectorization" +#, no-c-format msgid "If -ftree-vectorize is used, the minimal loop bound of a loop to be considered for vectorization." -msgstr "При включенном -ftree-vectorize, минимальное число итераций цикла, пригодного для векторизации" +msgstr "При включенном -ftree-vectorize, минимальное число итераций цикла, пригодного для векторизации." #: params.def:152 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions to consider to fill a delay slot" +#, no-c-format msgid "The maximum number of instructions to consider to fill a delay slot." -msgstr "Максимальное число команд, рассматриваемых при заполнении гнезд задержки" +msgstr "Максимальное число команд, рассматриваемых при заполнении гнезд задержки." #: params.def:163 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions to consider to find accurate live register information" +#, no-c-format msgid "The maximum number of instructions to consider to find accurate live register information." -msgstr "Максимальное число команд, рассматриваемых при вычислении областей жизни значений на регистрах" +msgstr "Максимальное число команд, рассматриваемых при вычислении областей жизни значений на регистрах." #: params.def:173 -#, fuzzy, no-c-format -#| msgid "The maximum length of scheduling's pending operations list" +#, no-c-format msgid "The maximum length of scheduling's pending operations list." -msgstr "Максимальный размер списка ждущих операций при планировании" +msgstr "Максимальный размер списка ждущих операций при планировании." #: params.def:180 -#, fuzzy, no-c-format -#| msgid "The maximum number of backtrack attempts the scheduler should make when modulo scheduling a loop" +#, no-c-format msgid "The maximum number of backtrack attempts the scheduler should make when modulo scheduling a loop." -msgstr "Максимальное число попыток возврата при программной конвейеризации (планировании по модулю) цикла" +msgstr "Максимальное число попыток возврата при программной конвейеризации (планировании по модулю) цикла." #: params.def:185 -#, fuzzy, no-c-format -#| msgid "The size of function body to be considered large" +#, no-c-format msgid "The size of function body to be considered large." -msgstr "Размер тела \"большой\" функции" +msgstr "Размер тела \"большой\" функции." #: params.def:189 -#, fuzzy, no-c-format -#| msgid "Maximal growth due to inlining of large function (in percent)" +#, no-c-format msgid "Maximal growth due to inlining of large function (in percent)." -msgstr "Максимальный рост объема \"большой\" функции в результате inline-подстановок (в процентах)" +msgstr "Максимальный рост объема \"большой\" функции в результате inline-подстановок (в процентах)." #: params.def:193 -#, fuzzy, no-c-format -#| msgid "The size of translation unit to be considered large" +#, no-c-format msgid "The size of translation unit to be considered large." -msgstr "Размер тела \"большой\" функции" +msgstr "Размер тела \"большой\" функции." #: params.def:197 -#, fuzzy, no-c-format -#| msgid "How much can given compilation unit grow because of the inlining (in percent)" +#, no-c-format msgid "How much can given compilation unit grow because of the inlining (in percent)." -msgstr "Максимальный рост объема кода для единицы компиляции в результате inline-подстановок (в процентах)" +msgstr "Максимальный рост объема кода для единицы компиляции в результате inline-подстановок (в процентах)." #: params.def:201 -#, fuzzy, no-c-format -#| msgid "How much can given compilation unit grow because of the interprocedural constant propagation (in percent)" +#, no-c-format msgid "How much can given compilation unit grow because of the interprocedural constant propagation (in percent)." -msgstr "Максимальный рост объема кода для единицы компиляции в результате межпроцедурного распространения констант (в процентах)" +msgstr "Максимальный рост объема кода для единицы компиляции в результате межпроцедурного распространения констант (в процентах)." #: params.def:205 -#, fuzzy, no-c-format -#| msgid "Maximal estimated growth of function body caused by early inlining of single call" +#, no-c-format msgid "Maximal estimated growth of function body caused by early inlining of single call." -msgstr "Максимальная оценка роста тела функции в результате ранней inline-подстановки одного вызова" +msgstr "Максимальная оценка роста тела функции в результате ранней inline-подстановки одного вызова." #: params.def:209 -#, fuzzy, no-c-format -#| msgid "The size of stack frame to be considered large" +#, no-c-format msgid "The size of stack frame to be considered large." -msgstr "Размер окна стека, считающийся достаточно большим" +msgstr "Размер кадра стека, считающийся большим." #: params.def:213 -#, fuzzy, no-c-format -#| msgid "Maximal stack frame growth due to inlining (in percent)" +#, no-c-format msgid "Maximal stack frame growth due to inlining (in percent)." -msgstr "Максимальный рост окна стека из-за inline-подстановок функций (в процентах)" +msgstr "Максимальный рост кадра стека из-за inline-подстановок функций (в процентах)." #: params.def:218 #, no-c-format msgid "Size of the stack guard expressed as a power of two." -msgstr "" +msgstr "Size of the stack guard expressed as a power of two." #: params.def:223 #, no-c-format @@ -1906,406 +1868,344 @@ msgid "Interval in which to probe the stack expressed as a power of two." msgstr "" #: params.def:230 -#, fuzzy, no-c-format -#| msgid "The maximum amount of memory to be allocated by GCSE" +#, no-c-format msgid "The maximum amount of memory to be allocated by GCSE." -msgstr "Максимальный объем памяти для работы GCSE" +msgstr "Максимальный объем памяти для работы GCSE." #: params.def:237 -#, fuzzy, no-c-format -#| msgid "The maximum ratio of insertions to deletions of expressions in GCSE" +#, no-c-format msgid "The maximum ratio of insertions to deletions of expressions in GCSE." -msgstr "Максимальное отношение числа вставок к числу удалений выражений при глобальном исключении общих подвыражений (GCSE)" +msgstr "Максимальное отношение числа вставок к числу удалений выражений при глобальном исключении общих подвыражений (GCSE)." #: params.def:248 -#, fuzzy, no-c-format -#| msgid "The threshold ratio for performing partial redundancy elimination after reload" +#, no-c-format msgid "The threshold ratio for performing partial redundancy elimination after reload." -msgstr "Пороговое отношение для выполнения частичного удаления избыточных операций после прохода reload" +msgstr "Пороговое отношение для выполнения частичного удаления избыточных операций после прохода reload." #: params.def:255 -#, fuzzy, no-c-format -#| msgid "The threshold ratio of critical edges execution count that permit performing redundancy elimination after reload" +#, no-c-format msgid "The threshold ratio of critical edges execution count that permit performing redundancy elimination after reload." -msgstr "Пороговое соотношение счётчиков выполнения критических дуг, при котором после прохода reload может выполняться частичное удаление избыточных операций" +msgstr "Пороговое соотношение счётчиков выполнения критических дуг, при котором после прохода reload может выполняться частичное удаление избыточных операций." #: params.def:263 -#, fuzzy, no-c-format -#| msgid "Scaling factor in calculation of maximum distance an expression can be moved by GCSE optimizations" +#, no-c-format msgid "Scaling factor in calculation of maximum distance an expression can be moved by GCSE optimizations." -msgstr "Масштабирующий множитель при вычислении максимального расстояния, на которое выражение может быть смещено при GCSE" +msgstr "Масштабирующий множитель при вычислении максимального расстояния, на которое выражение может быть смещено при GCSE." #: params.def:269 -#, fuzzy, no-c-format -#| msgid "Cost at which GCSE optimizations will not constraint the distance an expression can travel" +#, no-c-format msgid "Cost at which GCSE optimizations will not constraint the distance an expression can travel." -msgstr "Стоимость, при которой в GCSE не будет ограничиваться расстояние перемещения выражений" +msgstr "Стоимость, при которой в GCSE не будет ограничиваться расстояние перемещения выражений." #: params.def:277 -#, fuzzy, no-c-format -#| msgid "Maximum depth of search in the dominator tree for expressions to hoist" +#, no-c-format msgid "Maximum depth of search in the dominator tree for expressions to hoist." -msgstr "Максимальная глубина поиска в дереве доминаторов для поднятия выражения" +msgstr "Максимальная глубина поиска в дереве доминаторов для поднятия выражения." #: params.def:285 #, no-c-format msgid "Maximum depth of sqrt chains to use when synthesizing exponentiation by a real constant." -msgstr "" +msgstr "Максимальная глубина цепочек sqrt при вычислении экспоненты вещественной константы." #: params.def:297 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions to consider to unroll in a loop" +#, no-c-format msgid "The maximum number of instructions to consider to unroll in a loop." -msgstr "Максимальное число инструкций в развернутом цикле" +msgstr "Максимальное число инструкций в развернутом цикле." #: params.def:303 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions to consider to unroll in a loop on average" +#, no-c-format msgid "The maximum number of instructions to consider to unroll in a loop on average." -msgstr "Максимальное среднее число реально выполняемых инструкций в развернутом цикле" +msgstr "Максимальное среднее число реально выполняемых инструкций в развернутом цикле." #: params.def:308 -#, fuzzy, no-c-format -#| msgid "The maximum number of unrollings of a single loop" +#, no-c-format msgid "The maximum number of unrollings of a single loop." -msgstr "Максимальный коэффициент развертки цикла" +msgstr "Максимальный коэффициент развертки цикла." #: params.def:313 -#, fuzzy, no-c-format -#| msgid "The maximum number of insns of a peeled loop" +#, no-c-format msgid "The maximum number of insns of a peeled loop." -msgstr "Максимальное число инструкций в раскатанном цикле" +msgstr "Максимальное число инструкций в раскатанном цикле." #: params.def:318 -#, fuzzy, no-c-format -#| msgid "The maximum number of peelings of a single loop" +#, no-c-format msgid "The maximum number of peelings of a single loop." -msgstr "Максимальный коэффициент раскатки цикла" +msgstr "Максимальный коэффициент раскатки цикла." #: params.def:323 -#, fuzzy, no-c-format -#| msgid "The maximum number of iterations through CFG to extend regions" +#, no-c-format msgid "The maximum number of branches on the path through the peeled sequence." -msgstr "Максимальное число итераций по CFG для расширения регионов" +msgstr "Максимальное число ветвлений на пути вдоль раскатанной последовательности." #: params.def:328 -#, fuzzy, no-c-format -#| msgid "The maximum number of insns of a completely peeled loop" +#, no-c-format msgid "The maximum number of insns of a completely peeled loop." -msgstr "Максимальное число инструкций в полностью раскатанном цикле" +msgstr "Максимальное число инструкций в полностью раскатанном цикле." #: params.def:333 -#, fuzzy, no-c-format -#| msgid "The maximum number of peelings of a single loop that is peeled completely" +#, no-c-format msgid "The maximum number of peelings of a single loop that is peeled completely." -msgstr "Максимальный коэффициент для полной раскатки цикла" +msgstr "Максимальный коэффициент, допустимый для полной раскатки цикла." #: params.def:338 -#, fuzzy, no-c-format -#| msgid "The maximum number of insns of a peeled loop that rolls only once" +#, no-c-format msgid "The maximum number of insns of a peeled loop that rolls only once." -msgstr "Максимальное число инструкций в раскатанном цикле, выполняемом только один раз" +msgstr "Максимальное число инструкций в раскатанном цикле, выполняемом только один раз." #: params.def:343 -#, fuzzy, no-c-format -#| msgid "The maximum depth of a loop nest we completely peel" +#, no-c-format msgid "The maximum depth of a loop nest we completely peel." -msgstr "Максимальное число инструкций в цикле, который полностью раскатывается" +msgstr "Максимальная глубина гнезда циклов, которое может быть полностью раскатано." #: params.def:349 -#, fuzzy, no-c-format -#| msgid "The maximum number of insns of an unswitched loop" +#, no-c-format msgid "The maximum number of insns of an unswitched loop." -msgstr "Максимальное число инструкций в разомкнутом (unswitched) цикле" +msgstr "Максимальное число инструкций в разомкнутом (unswitched) цикле." #: params.def:354 -#, fuzzy, no-c-format -#| msgid "The maximum number of unswitchings in a single loop" +#, no-c-format msgid "The maximum number of unswitchings in a single loop." -msgstr "Максимальный число размыканий одного цикла" +msgstr "Максимальный число размыканий одного цикла." #: params.def:361 -#, fuzzy, no-c-format -#| msgid "The maximum number of insns to duplicate when unfactoring computed gotos" +#, no-c-format msgid "The maximum number of insns in loop header duplicated by the copy loop headers pass." -msgstr "Максимальное число дублируемых инструкций при факторизации вычисляемых goto" +msgstr "Максимальное число инструкций в заголовке цикла, дублируемых в проходе копирования заголовков цикла." #: params.def:368 -#, fuzzy, no-c-format -#| msgid "Bound on the number of iterations the brute force # of iterations analysis algorithm evaluates" +#, no-c-format msgid "Bound on the number of iterations the brute force # of iterations analysis algorithm evaluates." -msgstr "Максимальное число итераций, при вычислении которого будет применен метод \"грубой силы\"" +msgstr "Максимальное число итераций, при вычислении которого будет применен метод \"грубой силы\"." #: params.def:374 -#, fuzzy, no-c-format -#| msgid "Bound on the cost of an expression to compute the number of iterations" +#, no-c-format msgid "Bound on the cost of an expression to compute the number of iterations." -msgstr "Граница цены выражения для вычисления числа итераций" +msgstr "Граница цены выражения для вычисления числа итераций." #: params.def:380 -#, fuzzy, no-c-format -#| msgid "A factor for tuning the upper bound that swing modulo scheduler uses for scheduling a loop" +#, no-c-format msgid "A factor for tuning the upper bound that swing modulo scheduler uses for scheduling a loop." -msgstr "Множитель для настройки верхней границы числа тактов при конвейеризации циклов методом swing modulo scheduling" +msgstr "Множитель для настройки верхней границы числа тактов при конвейеризации циклов методом swing modulo scheduling." #: params.def:385 #, no-c-format msgid "The minimum value of stage count that swing modulo scheduler will generate." -msgstr "Минимальное число стадий в конвейеризованном цикле при планировании методом swing modulo scheduling" +msgstr "Минимальное число стадий в конвейеризованном цикле при планировании методом swing modulo scheduling." #: params.def:389 -#, fuzzy, no-c-format -#| msgid "The number of cycles the swing modulo scheduler considers when checking conflicts using DFA" +#, no-c-format msgid "The number of cycles the swing modulo scheduler considers when checking conflicts using DFA." -msgstr "Число тактов, учитываемых алгоритмом swing modulo scheduling при проверке конфликтов по ресурсам" +msgstr "Число тактов, учитываемых алгоритмом swing modulo scheduling при проверке конфликтов по ресурсам." #: params.def:393 -#, fuzzy, no-c-format -#| msgid "A threshold on the average loop count considered by the swing modulo scheduler" +#, no-c-format msgid "A threshold on the average loop count considered by the swing modulo scheduler." -msgstr "Пороговое значение среднего числа итераций цикла для применения конвейеризации методом swing modulo scheduling" +msgstr "Пороговое значение среднего числа итераций цикла для применения конвейеризации методом swing modulo scheduling." #: params.def:398 #, no-c-format msgid "A basic block profile count is considered hot if it contributes to the given permillage of the entire profiled execution." -msgstr "" +msgstr "Базовый блок будет считаться горячим, если его счётчик вносит вклад в заданный интервал всего профиля" #: params.def:403 -#, fuzzy, no-c-format -#| msgid "Select fraction of the maximal frequency of executions of basic block in function given basic block needs to have to be considered hot" +#, no-c-format msgid "Select fraction of the maximal frequency of executions of basic block in function given basic block needs to have to be considered hot." -msgstr "Относительная максимальная частота повторений блока в программе, при превышении которой блок должен считаться критическим" +msgstr "Относительная максимальная частота повторений блока в программе, при превышении которой блок должен считаться критическим." #: params.def:408 #, no-c-format msgid "The minimum fraction of profile runs a given basic block execution count must be not to be considered unlikely." -msgstr "" +msgstr "Минимальная доля профиля, такая, что если счётчик блока ее превышает, то он не считается маловероятным" #: params.def:413 -#, fuzzy, no-c-format -#| msgid "Select fraction of the maximal frequency of executions of basic block in function given basic block get alignment" +#, no-c-format msgid "Select fraction of the maximal frequency of executions of basic block in function given basic block get alignment." -msgstr "Относительная максимальная частота повторений блока в программе, при превышении которой блок должен выравниваться" +msgstr "Относительная максимальная частота повторений блока в программе, при превышении которой блок должен выравниваться." #: params.def:418 -#, fuzzy, no-c-format -#| msgid "Loops iterating at least selected number of iterations will get loop alignement." +#, no-c-format msgid "Loops iterating at least selected number of iterations will get loop alignment.." msgstr "Циклы с таким или с большим количеством итераций будут выравниваться." #: params.def:434 -#, fuzzy, no-c-format -#| msgid "The maximum number of loop iterations we predict statically" +#, no-c-format msgid "The maximum number of loop iterations we predict statically." -msgstr "Максимальное число итераций цикла для статического предсказания" +msgstr "Максимальное число итераций цикла для статического предсказания." #: params.def:447 #, no-c-format msgid "Set the estimated probability in percentage for builtin expect. The default value is 90% probability." -msgstr "" +msgstr "Оценка вероятности в процентах для builtin expect. По умолчанию 90%." #: params.def:451 -#, fuzzy, no-c-format -#| msgid "The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is available" +#, no-c-format msgid "The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is available." -msgstr "Процент объёма кода функции, взвешенный по частоте выполнения, который должен быть охвачен при формировании трасс планирования. Используется, когда имеются данные профилирования" +msgstr "Процент объёма кода функции, взвешенный по частоте выполнения, который должен быть охвачен при формировании трасс планирования. Используется, когда имеются данные профилирования." #: params.def:455 -#, fuzzy, no-c-format -#| msgid "The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is not available" +#, no-c-format msgid "The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is not available." -msgstr "Процент объёма кода функции, взвешенный по частоте выполнения, который должен быть охвачен при формировании трасс планирования. используется, когда данные профилирования отсутствуют" +msgstr "Процент объёма кода функции, взвешенный по частоте выполнения, который должен быть охвачен при формировании трасс планирования. Используется, когда имеются данные профилирования." #: params.def:459 -#, fuzzy, no-c-format -#| msgid "Maximal code growth caused by tail duplication (in percent)" +#, no-c-format msgid "Maximal code growth caused by tail duplication (in percent)." -msgstr "Максимальный рост кода за счёт дублирования хвостов (в процентах)" +msgstr "Максимальный рост кода за счёт дублирования хвостов (в процентах)." #: params.def:463 -#, fuzzy, no-c-format -#| msgid "Stop reverse growth if the reverse probability of best edge is less than this threshold (in percent)" +#, no-c-format msgid "Stop reverse growth if the reverse probability of best edge is less than this threshold (in percent)." -msgstr "Прекратить обратный просмотр, если обратная вероятность лучшей дуги меньше заданного порогового значения (в процентах)" +msgstr "Прекратить обратный просмотр, если обратная вероятность лучшей дуги меньше заданного порогового значения (в процентах)." #: params.def:467 -#, fuzzy, no-c-format -#| msgid "Stop forward growth if the probability of best edge is less than this threshold (in percent). Used when profile feedback is available" +#, no-c-format msgid "Stop forward growth if the probability of best edge is less than this threshold (in percent). Used when profile feedback is available." -msgstr "Прекратить просмотр, если вероятность лучшей дуги меньше заданного порогового значения (в процентах). Используется, если доступны данные профилирования" +msgstr "Прекратить просмотр, если вероятность лучшей дуги меньше заданного порогового значения (в процентах). Используется, когда имеются данные профилирования." #: params.def:471 -#, fuzzy, no-c-format -#| msgid "Stop forward growth if the probability of best edge is less than this threshold (in percent). Used when profile feedback is not available" +#, no-c-format msgid "Stop forward growth if the probability of best edge is less than this threshold (in percent). Used when profile feedback is not available." -msgstr "Прекратить просмотр, если вероятность лучшей дуги меньше заданного порогового значения (в процентах). Используется при отсутствии данных профилирования" +msgstr "Прекратить просмотр, если вероятность лучшей дуги меньше заданного порогового значения (в процентах). Используется, когда имеются данные профилирования." #: params.def:477 -#, fuzzy, no-c-format -#| msgid "The maximum number of incoming edges to consider for crossjumping" +#, no-c-format msgid "The maximum number of incoming edges to consider for crossjumping." -msgstr "Максимальное число входящих дуг, рассматриваемых при перекрестных переходах" +msgstr "Максимальное число входящих дуг, рассматриваемых при перекрестных переходах." #: params.def:483 -#, fuzzy, no-c-format -#| msgid "The minimum number of matching instructions to consider for crossjumping" +#, no-c-format msgid "The minimum number of matching instructions to consider for crossjumping." -msgstr "Минимальное число совпадающих инструкций, при котором применяется оптимизация перекрестных ссылок" +msgstr "Минимальное число совпадающих инструкций, при котором применяется оптимизация перекрестных переходов." #: params.def:489 -#, fuzzy, no-c-format -#| msgid "The maximum expansion factor when copying basic blocks" +#, no-c-format msgid "The maximum expansion factor when copying basic blocks." -msgstr "Максимальный коэффициент увеличения размера кода при копировании базовых блоков" +msgstr "Максимальный коэффициент увеличения размера кода при копировании базовых блоков." #: params.def:495 -#, fuzzy, no-c-format -#| msgid "The maximum number of insns to duplicate when unfactoring computed gotos" +#, no-c-format msgid "The maximum number of insns to duplicate when unfactoring computed gotos." -msgstr "Максимальное число дублируемых инструкций при факторизации вычисляемых goto" +msgstr "Максимальное число дублируемых инструкций при факторизации вычисляемых goto." #: params.def:501 -#, fuzzy, no-c-format -#| msgid "The maximum length of path considered in cse" +#, no-c-format msgid "The maximum length of path considered in cse." -msgstr "Максимальная длина пути, рассматриваемого при экономии общих подвыражений" +msgstr "Максимальная длина пути, рассматриваемого при экономии общих подвыражений." #: params.def:505 -#, fuzzy, no-c-format -#| msgid "The maximum instructions CSE process before flushing" +#, no-c-format msgid "The maximum instructions CSE process before flushing." -msgstr "Максимальное число инструкций, обрабатываемых CSE между сбросами хеш-таблицы" +msgstr "Максимальное число инструкций, обрабатываемых CSE между сбросами хеш-таблицы." #: params.def:512 -#, fuzzy, no-c-format -#| msgid "The minimum cost of an expensive expression in the loop invariant motion" +#, no-c-format msgid "The minimum cost of an expensive expression in the loop invariant motion." -msgstr "При вынесении инвариантов цикла - минимальная цена выражения, рассматриваемого как дорогостоящее " +msgstr "При вынесении инвариантов цикла - минимальная цена выражения, рассматриваемого как дорогостоящее." #: params.def:521 -#, fuzzy, no-c-format -#| msgid "Bound on number of candidates below that all candidates are considered in iv optimizations" +#, no-c-format msgid "Bound on number of candidates below that all candidates are considered in iv optimizations." -msgstr "Если число кандидатов менее данного значения, при оптимизации индуктивных переменных рассматриваются все кандидаты" +msgstr "Если число кандидатов менее данного значения, при оптимизации индуктивных переменных рассматриваются все кандидаты." #: params.def:529 -#, fuzzy, no-c-format -#| msgid "Bound on number of iv uses in loop optimized in iv optimizations" +#, no-c-format msgid "Bound on number of iv uses in loop optimized in iv optimizations." -msgstr "Если число использований индуктивных переменных больше данного параметра, то их оптимизация не производится" +msgstr "Если число использований индуктивных переменных больше данного параметра, то их оптимизация не производится." #: params.def:537 -#, fuzzy, no-c-format -#| msgid "If number of candidates in the set is smaller, we always try to remove unused ivs during its optimization" +#, no-c-format msgid "If number of candidates in the set is smaller, we always try to remove unused ivs during its optimization." -msgstr "Если число кандидатов в множестве меньше этого значения, то при оптимизации множества всегда делается попытка удалить неиспользуемые независимые переменные" +msgstr "Если число кандидатов в множестве меньше этого значения, то при оптимизации множества всегда делается попытка удалить неиспользуемые независимые переменные." #: params.def:542 -#, fuzzy, no-c-format -#| msgid "The maximum number of peelings of a single loop" +#, no-c-format msgid "Average number of iterations of a loop." -msgstr "Максимальный коэффициент раскатки цикла" +msgstr "Среднее число итераций цикла." #: params.def:547 -#, fuzzy, no-c-format -#| msgid "Maximum number of active local stores in RTL dead store elimination" +#, no-c-format msgid "Maximum size (in bytes) of objects tracked bytewise by dead store elimination." -msgstr "Максимальное число активных локальных записей при исключении мертвых записей на RTL-представлении" +msgstr "Максимальный размер (в байтах) объектов, отслеживаемых побайтно, при исключении мертвых записей в память." #: params.def:552 -#, fuzzy, no-c-format -#| msgid "Bound on size of expressions used in the scalar evolutions analyzer" +#, no-c-format msgid "Bound on size of expressions used in the scalar evolutions analyzer." -msgstr "Верхняя граница размера выражений при анализе эволюции скалярных значений в циклах" +msgstr "Верхняя граница размера выражений при анализе эволюции скалярных значений в циклах." #: params.def:557 -#, fuzzy, no-c-format -#| msgid "Bound on the complexity of the expressions in the scalar evolutions analyzer" +#, no-c-format msgid "Bound on the complexity of the expressions in the scalar evolutions analyzer." -msgstr "Верхняя граница сложности выражений при анализе эволюции скалярных значений в циклах" +msgstr "Верхняя граница сложности выражений при анализе эволюции скалярных значений в циклах." #: params.def:562 #, no-c-format msgid "Maximum number of arguments in a PHI supported by TREE if-conversion unless the loop is marked with simd pragma." -msgstr "" +msgstr "Максимальное число аргументов PHI, поддерживаемое if-конверсией на древовидном представлении, если цикл не помечен прагмой simd." #: params.def:568 -#, fuzzy, no-c-format -#| msgid "Bound on number of runtime checks inserted by the vectorizer's loop versioning for alignment check" +#, no-c-format msgid "Bound on number of runtime checks inserted by the vectorizer's loop versioning for alignment check." -msgstr "Максимальное число проверок времени выполнения, добавляемых в код при векторизации циклов для проверки выравнивания" +msgstr "Максимальное число проверок времени выполнения, добавляемых в код при векторизации циклов для проверки выравнивания." #: params.def:573 -#, fuzzy, no-c-format -#| msgid "Bound on number of runtime checks inserted by the vectorizer's loop versioning for alias check" +#, no-c-format msgid "Bound on number of runtime checks inserted by the vectorizer's loop versioning for alias check." -msgstr "Максимальное число проверок времени выполнения, добавляемых в код при векторизации циклов для проверки алиасов" +msgstr "Максимальное число проверок времени выполнения, добавляемых в код при векторизации циклов для проверки алиасов." #: params.def:578 -#, fuzzy, no-c-format -#| msgid "Maximum number of namespaces to search for alternatives when name lookup fails" +#, no-c-format msgid "Maximum number of loop peels to enhance alignment of data references in a loop." -msgstr "Максимальное число пространств имен для поиска альтернатив при неуспешном поиске имени" +msgstr "Максимальное число начальных итераций цикла, которые могут быть раскатаны для выравнивания данных в цикле." #: params.def:583 -#, fuzzy, no-c-format -#| msgid "The maximum memory locations recorded by cselib" +#, no-c-format msgid "The maximum memory locations recorded by cselib." -msgstr "Максимальное число позиций в памяти, записываемых cselib" +msgstr "Максимальное число позиций в памяти, записываемых cselib." #: params.def:596 -#, fuzzy, no-c-format -#| msgid "Minimum heap expansion to trigger garbage collection, as a percentage of the total size of the heap" +#, no-c-format msgid "Minimum heap expansion to trigger garbage collection, as a percentage of the total size of the heap." -msgstr "Минимальный объем кучи, при котором включается сбора мусора, в процентах от общего размера памяти, выделенного под кучу" +msgstr "Минимальный объем кучи, при котором включается сбора мусора, в процентах от общего размера памяти, выделенного под кучу." #: params.def:601 -#, fuzzy, no-c-format -#| msgid "Minimum heap size before we start collecting garbage, in kilobytes" +#, no-c-format msgid "Minimum heap size before we start collecting garbage, in kilobytes." -msgstr "Минимальный размер кучи в килобайтах, при котором включается сбор мусора, в килобайтах" +msgstr "Минимальный размер кучи в килобайтах, при котором включается сбор мусора, в килобайтах." #: params.def:609 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions to search backward when looking for equivalent reload" +#, no-c-format msgid "The maximum number of instructions to search backward when looking for equivalent reload." -msgstr "Максимальное число инструкций для обратного просмотра при поиске эквивалентной загрузки в регистр" +msgstr "Максимальное число инструкций для обратного просмотра при поиске эквивалентной загрузки в регистр." #: params.def:614 -#, fuzzy, no-c-format -#| msgid "Target block's relative execution frequency (as a percentage) required to sink a statement" +#, no-c-format msgid "Target block's relative execution frequency (as a percentage) required to sink a statement." -msgstr "Относительная частота выполнения целевого блока (в процентах), необходимая для погружения инструкции" +msgstr "Относительная частота выполнения целевого блока (в процентах), необходимая для погружения инструкции." #: params.def:619 params.def:629 -#, fuzzy, no-c-format -#| msgid "The maximum number of blocks in a region to be considered for interblock scheduling" +#, no-c-format msgid "The maximum number of blocks in a region to be considered for interblock scheduling." -msgstr "Максимальное число блоков в отрезке для междублочночного планирования" +msgstr "Максимальное число блоков в отрезке для междублочночного планирования." #: params.def:624 params.def:634 -#, fuzzy, no-c-format -#| msgid "The maximum number of insns in a region to be considered for interblock scheduling" +#, no-c-format msgid "The maximum number of insns in a region to be considered for interblock scheduling." -msgstr "Максимальное число инструкций в отрезке для межблочного планирования" +msgstr "Максимальное число инструкций в отрезке для межблочного планирования." #: params.def:639 -#, fuzzy, no-c-format -#| msgid "The minimum probability of reaching a source block for interblock speculative scheduling" +#, no-c-format msgid "The minimum probability of reaching a source block for interblock speculative scheduling." -msgstr "Минимальная вероятность достижения блока для спекулятивного межблочного планирования" +msgstr "Минимальная вероятность достижения блока для спекулятивного межблочного планирования." #: params.def:644 -#, fuzzy, no-c-format -#| msgid "The maximum number of iterations through CFG to extend regions" +#, no-c-format msgid "The maximum number of iterations through CFG to extend regions." -msgstr "Максимальное число итераций по CFG для расширения регионов" +msgstr "Максимальное число итераций по CFG для расширения регионов." #: params.def:649 -#, fuzzy, no-c-format -#| msgid "The maximum conflict delay for an insn to be considered for speculative motion" +#, no-c-format msgid "The maximum conflict delay for an insn to be considered for speculative motion." -msgstr "Максимальная отсрочка конфликта для команды, рассматриваемой как кандидат для спекулятивного перемещения" +msgstr "Максимальная отсрочка конфликта для команды, рассматриваемой как кандидат для спекулятивного перемещения." #: params.def:654 #, no-c-format @@ -2315,125 +2215,107 @@ msgstr "Минимальная вероятность успеха при спе #: params.def:659 #, no-c-format msgid "The minimum probability an edge must have for the scheduler to save its state across it." -msgstr "" +msgstr "Минимальная вероятность, которую должно иметь ребро, чтобы планировщик сохранил свое состояние после прохождения ребра." #: params.def:664 -#, fuzzy, no-c-format -#| msgid "The maximum size of the lookahead window of selective scheduling" +#, no-c-format msgid "The maximum size of the lookahead window of selective scheduling." -msgstr "Максимальный размер окна при селективном планировании" +msgstr "Максимальный размер окна при селективном планировании." #: params.def:669 -#, fuzzy, no-c-format -#| msgid "Maximum number of times that an insn could be scheduled" +#, no-c-format msgid "Maximum number of times that an insn could be scheduled." -msgstr "Максимальное возможное количество планируемых выполнений команды" +msgstr "Максимальное возможное количество планируемых выполнений команды." #: params.def:674 -#, fuzzy, no-c-format -#| msgid "Maximum number of instructions in the ready list that are considered eligible for renaming" +#, no-c-format msgid "Maximum number of instructions in the ready list that are considered eligible for renaming." -msgstr "Максимальное число команд в списке готовых, которые могут рассматриваться как кандидаты на переименование" +msgstr "Максимальное число команд в списке готовых, которые могут рассматриваться как кандидаты на переименование." #: params.def:679 -#, fuzzy, no-c-format -#| msgid "Minimal distance between possibly conflicting store and load" +#, no-c-format msgid "Minimal distance between possibly conflicting store and load." -msgstr "Минимальная дистанция между возможно конфликтующими записью и чтением" +msgstr "Минимальная дистанция между возможно конфликтующими записью и чтением." #: params.def:684 #, no-c-format msgid "Hardware autoprefetcher scheduler model control flag. Number of lookahead cycles the model looks into; at '0' only enable instruction sorting heuristic. Disabled by default." -msgstr "" +msgstr "Флаг модели планирования для аппаратной предвыборки. Количество циклов, на которые ведётся планирование; при 0 используется только эвристика сортировки инструкций. По умолчанию эта опция отключена." #: params.def:689 -#, fuzzy, no-c-format -#| msgid "The maximum number of RTL nodes that can be recorded as combiner's last value" +#, no-c-format msgid "The maximum number of RTL nodes that can be recorded as combiner's last value." -msgstr "Максимальный размер выражения (число RTL-узлов), которое может быть записано как последнее известное значение псевдорегистра" +msgstr "Максимальный размер выражения (число RTL-узлов), которое может быть записано как последнее известное значение псевдорегистра." #: params.def:694 -#, fuzzy, no-c-format -#| msgid "The maximum number of incoming edges to consider for crossjumping" +#, no-c-format msgid "The maximum number of insns combine tries to combine." -msgstr "Максимальное число входящих дуг, рассматриваемых при перекрестных переходах" +msgstr "Максимальное число инструкций, для которых на проходе combine рассматривается возможность комбинирования." #: params.def:703 -#, fuzzy, no-c-format -#| msgid "The upper bound for sharing integer constants" +#, no-c-format msgid "The upper bound for sharing integer constants." -msgstr "Максимальное число небольших целочисленных констант, для которых в компиляторе будут использованы разделяемые структуры" +msgstr "Максимальное число небольших целочисленных констант, для которых в компиляторе будут использованы разделяемые структуры." #: params.def:708 -#, fuzzy, no-c-format -#| msgid "The lower bound for a buffer to be considered for stack smashing protection" +#, no-c-format msgid "The lower bound for a buffer to be considered for stack smashing protection." -msgstr "Ограничение снизу на буфер для защиты от разрушения стека" +msgstr "Ограничение снизу на буфер для защиты от разрушения стека." #: params.def:713 #, no-c-format msgid "The minimum size of variables taking part in stack slot sharing when not optimizing." -msgstr "" +msgstr "Минимальный размер переменных, которые могут разделять позицию в стеке в отсутствие оптимизации." #: params.def:732 -#, fuzzy, no-c-format -#| msgid "Maximum number of statements allowed in a block that needs to be duplicated when threading jumps" +#, no-c-format msgid "Maximum number of statements allowed in a block that needs to be duplicated when threading jumps." -msgstr "Максимальное число инструкций в блоке, который необходимо дублировать при протягивании переходов" +msgstr "Максимальное число инструкций в блоке, который необходимо дублировать при протягивании переходов." #: params.def:741 -#, fuzzy, no-c-format -#| msgid "Maximum number of fields in a structure before pointer analysis treats the structure as a single variable" +#, no-c-format msgid "Maximum number of fields in a structure before pointer analysis treats the structure as a single variable." -msgstr "Если число полей в структуре больше данного параметра, то при анализе указателей вся структура рассматривается как одна переменная" +msgstr "Если число полей в структуре больше данного параметра, то при анализе указателей вся структура рассматривается как одна переменная." #: params.def:746 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions ready to be issued to be considered by the scheduler during the first scheduling pass" +#, no-c-format msgid "The maximum number of instructions ready to be issued to be considered by the scheduler during the first scheduling pass." -msgstr "Максимальное число готовых к исполнению инструкций, рассматриваемых планировщиком на первом проходе планирования" +msgstr "Максимальное число готовых к исполнению инструкций, рассматриваемых планировщиком на первом проходе планирования." #: params.def:752 -#, fuzzy, no-c-format -#| msgid "Maximum number of active local stores in RTL dead store elimination" +#, no-c-format msgid "Maximum number of active local stores in RTL dead store elimination." -msgstr "Максимальное число активных локальных записей при исключении мертвых записей на RTL-представлении" +msgstr "Максимальное число активных локальных записей при исключении мертвых записей на RTL-представлении." #: params.def:762 -#, fuzzy, no-c-format -#| msgid "The number of insns executed before prefetch is completed" +#, no-c-format msgid "The number of insns executed before prefetch is completed." -msgstr "Число инструкций, выполненных до завершения предвыборки" +msgstr "Число инструкций, выполненных до завершения предвыборки." #: params.def:769 -#, fuzzy, no-c-format -#| msgid "The number of prefetches that can run at the same time" +#, no-c-format msgid "The number of prefetches that can run at the same time." -msgstr "Число предвыборок, которые могут выполняться одновременно" +msgstr "Число предвыборок, которые могут выполняться одновременно." #: params.def:776 -#, fuzzy, no-c-format -#| msgid "The size of L1 cache" +#, no-c-format msgid "The size of L1 cache." -msgstr "Размер кэша L1" +msgstr "Размер кэша L1." #: params.def:783 -#, fuzzy, no-c-format -#| msgid "The size of L1 cache line" +#, no-c-format msgid "The size of L1 cache line." -msgstr "Размер строки кэша L1" +msgstr "Размер строки кэша L1." #: params.def:790 -#, fuzzy, no-c-format -#| msgid "The size of L2 cache" +#, no-c-format msgid "The size of L2 cache." -msgstr "Размер кэша L2" +msgstr "Размер кэша L2." #: params.def:797 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions to consider to unroll in a loop on average" +#, no-c-format msgid "The maximum number of stmts in loop nest for loop interchange." -msgstr "Максимальное среднее число реально выполняемых инструкций в развернутом цикле" +msgstr "Максимальное среднее число реально выполняемых инструкций в развёрнутом цикле" #: params.def:804 #, no-c-format @@ -2441,85 +2323,74 @@ msgid "The minimum stride ratio for loop interchange to be profitable" msgstr "" #: params.def:815 -#, fuzzy, no-c-format -#| msgid "Whether to use canonical types" +#, no-c-format msgid "Whether to use canonical types." -msgstr "Использовать ли канонические типы" +msgstr "Использовать ли канонические типы." #: params.def:820 -#, fuzzy, no-c-format -#| msgid "Maximum length of partial antic set when performing tree pre optimization" +#, no-c-format msgid "Maximum length of partial antic set when performing tree pre optimization." -msgstr "Максимальная длина частичного antic-множества при выполнении предоптимизации древовидного представления" +msgstr "Максимальная длина частичного antic-множества при выполнении предоптимизации древовидного представления." #: params.def:830 -#, fuzzy, no-c-format -#| msgid "Maximum size of a SCC before SCCVN stops processing a function" +#, no-c-format msgid "Maximum size of a SCC before SCCVN stops processing a function." -msgstr "Максимальный размер SCC (сильносвязанной компоненты), при котором алгоритм перечисления значений SCCVN завершает обработку функции" +msgstr "Максимальный размер SCC (сильносвязанной компоненты), при котором алгоритм перечисления значений SCCVN завершает обработку функции." #: params.def:841 #, no-c-format msgid "Maximum number of disambiguations to perform per memory access." -msgstr "" +msgstr "Максимальное число разрешений неоднозначности при выполнении доступа к памяти." #: params.def:846 -#, fuzzy, no-c-format -#| msgid "Max loops number for regional RA" +#, no-c-format msgid "Max loops number for regional RA." -msgstr "Максимальное число циклов для использования распределения регистров по регионам" +msgstr "Максимальное число циклов для использования распределения регистров по регионам." #: params.def:851 -#, fuzzy, no-c-format -#| msgid "Max size of conflict table in MB" +#, no-c-format msgid "Max size of conflict table in MB." -msgstr "Максимальный размер таблицы конфликтов в мегабайтах" +msgstr "Максимальный размер таблицы конфликтов в мегабайтах." #: params.def:856 -#, fuzzy, no-c-format -#| msgid "The number of registers in each class kept unused by loop invariant motion" +#, no-c-format msgid "The number of registers in each class kept unused by loop invariant motion." -msgstr "Число регистров в каждом классе, оставляемых неиспользуемыми при вынесении инвариантов цикла" +msgstr "Число регистров в каждом классе, оставляемых неиспользуемыми при вынесении инвариантов цикла." #: params.def:861 #, no-c-format msgid "The max number of reload pseudos which are considered during spilling a non-reload pseudo." -msgstr "" +msgstr "Максимальное число reload-псевдорегистров, рассматриваемых при спиллинге не-reload псевдорегистра" #: params.def:866 #, no-c-format msgid "Minimal fall-through edge probability in percentage used to add BB to inheritance EBB in LRA." -msgstr "" +msgstr "Минимальная вероятность сквозного перехода в процентах, чтобы добавить блок к EBB наследования при локальном распределении регистров (LRA)" #: params.def:874 -#, fuzzy, no-c-format -#| msgid "The maximum ratio between array size and switch branches for a switch conversion to take place" +#, no-c-format msgid "The maximum ratio between array size and switch branches for a switch conversion to take place." -msgstr "Максимальное отношение между размером массива и числом веток в переключателе, при котором будет выполнена трансформация переключателя в таблицу" +msgstr "Максимальное отношение между размером массива и числом веток в переключателе, при котором будет выполнена трансформация переключателя в таблицу." #: params.def:882 -#, fuzzy, no-c-format -#| msgid "size of tiles for loop blocking" +#, no-c-format msgid "size of tiles for loop blocking." -msgstr "размер полос для блочной трансформации циклов" +msgstr "размер полос для блочной трансформации циклов." #: params.def:889 -#, fuzzy, no-c-format -#| msgid "maximum number of parameters in a SCoP" +#, no-c-format msgid "maximum number of parameters in a SCoP." -msgstr "максимальное число параметров в SCoP" +msgstr "максимальное число параметров в SCoP." #: params.def:896 -#, fuzzy, no-c-format -#| msgid "maximum number of parameters in a SCoP" +#, no-c-format msgid "maximum number of arrays per scop." -msgstr "максимальное число параметров в SCoP" +msgstr "максимальное число массивов на один scop." #: params.def:901 -#, fuzzy, no-c-format -#| msgid "The maximum number of insns of an unswitched loop" +#, no-c-format msgid "maximum number of isl operations, 0 means unlimited" -msgstr "Максимальное число инструкций в разомкнутом (unswitched) цикле" +msgstr "Максимальное число isl-операций, 0 означает отсутствие ограничений" #: params.def:907 #, no-c-format @@ -2527,375 +2398,339 @@ msgid "whether codegen errors should be ICEs when -fchecking." msgstr "" #: params.def:913 -#, fuzzy, no-c-format -#| msgid "Maximum number of datarefs in loop for building loop data dependencies" +#, no-c-format msgid "Maximum number of datarefs in loop for building loop data dependencies." -msgstr "максимальное число ссылок на данные для построения циклических зависимостей по данным" +msgstr "максимальное число ссылок на данные для построения циклических зависимостей по данным." #: params.def:920 -#, fuzzy, no-c-format -#| msgid "Max basic blocks number in loop for loop invariant motion" +#, no-c-format msgid "Max basic blocks number in loop for loop invariant motion." -msgstr "максимальное число базовых блоков в цикле для вынесения инвариантов цикла" +msgstr "максимальное число базовых блоков в цикле для вынесения инвариантов цикла." #: params.def:928 #, no-c-format msgid "use internal function id in profile lookup." -msgstr "" +msgstr "использовать внутренний идентификатор функции при поиске в профиле." #: params.def:936 #, no-c-format msgid "track topn target addresses in indirect-call profile." -msgstr "" +msgstr "отслеживать N наиболее частых адресов в профиле косвенных вызовов." #: params.def:942 -#, fuzzy, no-c-format -#| msgid "Maximum number of instructions in basic block to be considered for SLP vectorization" +#, no-c-format msgid "Maximum number of instructions in basic block to be considered for SLP vectorization." -msgstr "Максимальное число инструкций в базовом блоке для его векторизации" +msgstr "Максимальное число инструкций в базовом блоке для его векторизации." #: params.def:947 -#, fuzzy, no-c-format -#| msgid "Min. ratio of insns to prefetches to enable prefetching for a loop with an unknown trip count" +#, no-c-format msgid "Min. ratio of insns to prefetches to enable prefetching for a loop with an unknown trip count." -msgstr "Минимальное отношение числа инструкций к числу предвыборок для включения предвыборок в циклах с неизвестным числом итераций" +msgstr "Мин. отношение числа инструкций к числу предвыборок для включения предвыборок в циклах с неизвестным числом итераций." #: params.def:953 -#, fuzzy, no-c-format -#| msgid "Min. ratio of insns to mem ops to enable prefetching in a loop" +#, no-c-format msgid "Min. ratio of insns to mem ops to enable prefetching in a loop." -msgstr "Минимальное отношение числа инструкций к числу операций с памятью для включения предвыборок в цикле" +msgstr "Мин. отношение числа инструкций к числу операций с памятью для включения предвыборок в цикле." #: params.def:960 -#, fuzzy, no-c-format -#| msgid "Max. size of var tracking hash tables" +#, no-c-format msgid "Max. size of var tracking hash tables." -msgstr "Максимальный размер хеш-таблиц для отслеживания переменных" +msgstr "Макс. размер хеш-таблиц для отслеживания переменных." #: params.def:968 -#, fuzzy, no-c-format -#| msgid "Max. recursion depth for expanding var tracking expressions" +#, no-c-format msgid "Max. recursion depth for expanding var tracking expressions." -msgstr "Максимальная глубина рекурсии в раскрытии выражений при отслеживании переменных" +msgstr "Макс. глубина рекурсии в раскрытии выражений при отслеживании переменных." #: params.def:976 #, no-c-format msgid "Max. size of loc list for which reverse ops should be added." -msgstr "" +msgstr "Макс. размер списка позиций, для которых должны добавляться обратные операции." #: params.def:985 #, no-c-format msgid "Max. count of debug markers to expand or inline." -msgstr "" +msgstr "Макс. count of debug markers to expand or inline." #: params.def:992 -#, fuzzy, no-c-format -#| msgid "The minimum UID to be used for a nondebug insn" +#, no-c-format msgid "The minimum UID to be used for a nondebug insn." -msgstr "Минимальный идентификатор (UID), используемый для неотладочных инструкций" +msgstr "Минимальный идентификатор (UID), используемый для неотладочных инструкций." #: params.def:997 -#, fuzzy, no-c-format -#| msgid "Maximum allowed growth of size of new parameters ipa-sra replaces a pointer to an aggregate with" +#, no-c-format msgid "Maximum allowed growth of number and total size of new parameters that ipa-sra replaces a pointer to an aggregate with." -msgstr "Максимальный допустимый размер новых параметров, при котором выполняется замена указателя на агрегат при -ftree-sra" +msgstr "Максимальный допустимый размер новых параметров, при котором выполняется замена указателя на агрегат при ipa-sra." #: params.def:1003 -#, fuzzy, no-c-format -#| msgid "Size in bytes after which thread-local aggregates should be instrumented with the logging functions instead of save/restore pairs" +#, no-c-format msgid "Size in bytes after which thread-local aggregates should be instrumented with the logging functions instead of save/restore pairs." -msgstr "Размер в байтах при превышении которого локальные для потоков агрегаты будут инструментированы функциями журналирования вместо команд сохранения/восстановления" +msgstr "Размер в байтах, при превышении которого локальные для потоков агрегаты будут инструментированы функциями журналирования вместо команд сохранения/восстановления." #: params.def:1010 #, no-c-format msgid "Maximum size, in storage units, of an aggregate which should be considered for scalarization when compiling for speed." -msgstr "" +msgstr "Максимальный размер агрегатных объектов (в единицах памяти), для которых при оптимизации по скорости может выполняться скаляризация." #: params.def:1016 #, no-c-format msgid "Maximum size, in storage units, of an aggregate which should be considered for scalarization when compiling for size." -msgstr "" +msgstr "Максимальный размер агрегатных объектов (в единицах памяти), для которых при оптимизации по размеру может выполняться скаляризация." #: params.def:1022 -#, fuzzy, no-c-format -#| msgid "Maximum size of a list of values associated with each parameter for interprocedural constant propagation" +#, no-c-format msgid "Maximum size of a list of values associated with each parameter for interprocedural constant propagation." -msgstr "Максимальный размер списка значений, ассоциированных с каждым параметром, при межпроцедурном распространении констант" +msgstr "Максимальный размер списка значений, ассоциированных с каждым параметром, при межпроцедурном распространении констант." #: params.def:1028 -#, fuzzy, no-c-format -#| msgid "Threshold ipa-cp opportunity evaluation that is still considered beneficial to clone." +#, no-c-format msgid "Threshold ipa-cp opportunity evaluation that is still considered beneficial to clone.." -msgstr "Пороговое значение оценки целесообразности клонирования при выполнении межпроцедурного распространения констант" +msgstr "Пороговое значение оценки целесообразности клонирования при выполнении межпроцедурного распространения констант." #: params.def:1034 #, no-c-format msgid "Percentage penalty the recursive functions will receive when they are evaluated for cloning.." -msgstr "" +msgstr "Штрафная наценка в процентах для рекурсивных функций при их оценке для клонирования." #: params.def:1040 #, no-c-format msgid "Percentage penalty functions containing a single call to another function will receive when they are evaluated for cloning.." -msgstr "" +msgstr "Штрафная наценка в процентах для функций с единственным вызовом другой функции при их оценке для клонирования." #: params.def:1046 #, no-c-format msgid "Maximum number of aggregate content items for a parameter in jump functions and lattices." -msgstr "" +msgstr "Максимальное число элементов совокупного содержимого для параметра в функциях перехода и решетках." #: params.def:1052 #, no-c-format msgid "Compile-time bonus IPA-CP assigns to candidates which make loop bounds or strides known.." -msgstr "" +msgstr "Бонус времени компиляции, назначаемый IPA-CP тем кандидатам, которые позволяют определить границы или шаг цикла." #: params.def:1058 #, no-c-format msgid "Compile-time bonus IPA-CP assigns to candidates which make an array index known.." -msgstr "" +msgstr "Бонус времени компиляции, назначаемый IPA-CP тем кандидатам, которые позволяют определить индекс массива." #: params.def:1064 #, no-c-format msgid "Maximum number of statements that will be visited by IPA formal parameter analysis based on alias analysis in any given function." -msgstr "" +msgstr "Максимальное число операторов, исследуемых IPA при анализе формальных параметров на основе анализа алиасов в данной функции." #: params.def:1072 -#, fuzzy, no-c-format -#| msgid "Number of partitions the program should be split to" +#, no-c-format msgid "Number of partitions the program should be split to." -msgstr "Число партиций для разбиения программы" +msgstr "Число партиций для разбиения программы." #: params.def:1077 -#, fuzzy, no-c-format -#| msgid "Minimal size of a partition for LTO (in estimated instructions)" +#, no-c-format msgid "Minimal size of a partition for LTO (in estimated instructions)." -msgstr "Минимальный размер (число инструкций в) партиции при разбиении программы во время LTO" +msgstr "Минимальный размер (число инструкций в) партиции при разбиении программы во время LTO." #: params.def:1082 -#, fuzzy, no-c-format -#| msgid "Minimal size of a partition for LTO (in estimated instructions)" +#, no-c-format msgid "Maximal size of a partition for LTO (in estimated instructions)." -msgstr "Минимальный размер (число инструкций в) партиции при разбиении программы во время LTO" +msgstr "Минимальный размер (число инструкций в) партиции при разбиении программы во время LTO." #: params.def:1089 -#, fuzzy, no-c-format -#| msgid "Maximum number of namespaces to search for alternatives when name lookup fails" +#, no-c-format msgid "Maximum number of namespaces to search for alternatives when name lookup fails." -msgstr "Максимальное число пространств имен для поиска альтернатив при неуспешном поиске имени" +msgstr "Максимальное число пространств имен для поиска альтернатив при неуспешном поиске имени." #: params.def:1096 -#, fuzzy, no-c-format -#| msgid "Maximum number of conditional store pairs that can be sunk" +#, no-c-format msgid "Maximum number of conditional store pairs that can be sunk." -msgstr "Число отложенных пар условной записи, которые могут быть \"утоплены\"" +msgstr "Число отложенных пар условной записи, которые могут быть \"утоплены\"." #: params.def:1104 -#, fuzzy, no-c-format -#| msgid "The smallest number of different values for which it is best to use a jump-table instead of a tree of conditional branches, if 0, use the default for the machine" +#, no-c-format msgid "The smallest number of different values for which it is best to use a jump-table instead of a tree of conditional branches, if 0, use the default for the machine." -msgstr "Максимальное число различных значений, при котором выгоднее использовать таблицу переходов, чем дерево условных ветвлений; при 0 используется умолчание для данной машины" +msgstr "Максимальное число различных значений, при котором выгоднее использовать таблицу переходов, чем дерево условных ветвлений; при 0 используется умолчание для данной машины." #: params.def:1112 -#, fuzzy, no-c-format -#| msgid "Allow new data races on stores to be introduced" +#, no-c-format msgid "Allow new data races on stores to be introduced." -msgstr "Разрешить оптимизатору добавление новых гонок данных по записи данных" +msgstr "Разрешить оптимизатору добавление новых гонок данных по записи данных." #: params.def:1118 -#, fuzzy, no-c-format -#| msgid "Set the maximum number of instructions executed in parallel in reassociated tree. If 0, use the target dependent heuristic." +#, no-c-format msgid "Set the maximum number of instructions executed in parallel in reassociated tree. If 0, use the target dependent heuristic.." msgstr "Максимальное число параллельно выполняемых инструкций в дереве при реассоциировании ассоциативных операций. При 0 использовать эвристику данной целевой платформы." #: params.def:1124 -#, fuzzy, no-c-format -#| msgid "Maximum amount of similar bbs to compare a bb with" +#, no-c-format msgid "Maximum amount of similar bbs to compare a bb with." -msgstr "Максимальное число похожих базовых блоков, с которыми сравнивается данный блок" +msgstr "Максимальное число похожих базовых блоков, с которыми сравнивается данный блок." #: params.def:1129 #, no-c-format msgid "Allow the store merging pass to introduce unaligned stores if it is legal to do so." -msgstr "" +msgstr "Разрешить проходу слияния записей в память генерировать невыровненные записи, если это допустимо." #: params.def:1135 -#, fuzzy, no-c-format -#| msgid "Maximum number of active local stores in RTL dead store elimination" +#, no-c-format msgid "Maximum number of constant stores to merge in the store merging pass." -msgstr "Максимальное число активных локальных записей при исключении мертвых записей на RTL-представлении" +msgstr "Максимальное число активных локальных записей при исключении мертвых записей на RTL-представлении." #: params.def:1141 -#, fuzzy, no-c-format -#| msgid "Maximum amount of iterations of the pass over a function" +#, no-c-format msgid "Maximum amount of iterations of the pass over a function." -msgstr "Максимальное число итераций обработки каждой функции" +msgstr "Максимальное число итераций обработки каждой функции." #: params.def:1148 -#, fuzzy, no-c-format -#| msgid "Maximum number of strings for which strlen optimization pass will track string lengths" +#, no-c-format msgid "Maximum number of strings for which strlen optimization pass will track string lengths." -msgstr "Максимальное число строк, для которых проход оптимизации strlen будет отслеживать длины" +msgstr "Максимальное число строк, для которых проход оптимизации strlen будет отслеживать длины." #: params.def:1155 #, no-c-format msgid "Which -fsched-pressure algorithm to apply." -msgstr "" +msgstr "Алгоритм для -fsched-pressure." #: params.def:1161 #, no-c-format msgid "Maximum length of candidate scans for straight-line strength reduction." -msgstr "" +msgstr "Максимальная длина сканирования кандидатов для прямого понижения мощности операций." #: params.def:1167 -#, fuzzy, no-c-format -#| msgid "Enable stack probing" +#, no-c-format msgid "Enable asan stack protection." -msgstr "Включить проверку стека зондированием" +msgstr "Включить защиту стека средствами asan." #: params.def:1172 -#, fuzzy, no-c-format -#| msgid "Enable all optional instructions" +#, no-c-format msgid "Enable asan allocas/VLAs protection." -msgstr "Включить все необязательные инструкции" +msgstr "Включить защиту allocas/VLA средствами asan." #: params.def:1177 -#, fuzzy, no-c-format -#| msgid "Enable all optional instructions" +#, no-c-format msgid "Enable asan globals protection." -msgstr "Включить все необязательные инструкции" +msgstr "Включить защиту глобальных данных средствами asan." #: params.def:1182 -#, fuzzy, no-c-format -#| msgid "Enable saturation instructions" +#, no-c-format msgid "Enable asan store operations protection." -msgstr "Включить инструкции насыщения" +msgstr "Включить защиту от переполнения буферов при операциях записи средствами asan." #: params.def:1187 -#, fuzzy, no-c-format -#| msgid "Enable all optional instructions" +#, no-c-format msgid "Enable asan load operations protection." -msgstr "Включить все необязательные инструкции" +msgstr "Включить защиту от переполнения буферов при операциях чтения средствами asan." #: params.def:1192 -#, fuzzy, no-c-format -#| msgid "Enable saturation instructions" +#, no-c-format msgid "Enable asan builtin functions protection." -msgstr "Включить инструкции насыщения" +msgstr "Включить защиту от переполнения буферов для средствами asan." #: params.def:1197 #, no-c-format msgid "Enable asan detection of use-after-return bugs." -msgstr "" +msgstr "Включить выявление ошибок вида использование-после-выхода средствами asan" #: params.def:1202 #, no-c-format msgid "Use callbacks instead of inline code if number of accesses in function becomes greater or equal to this number." -msgstr "" +msgstr "Использовать обратные вызовы (callbacks) вместо inline-подстановок, если число обращений к функции превышает указанное значение." #: params.def:1208 #, no-c-format msgid "Use direct poisoning/unpoisoning instructions for variables smaller or equal to this number." -msgstr "" +msgstr "Использовать явно инструкции poison/unpoison для теневой памяти для переменных, размер которых не превышает указанного." #: params.def:1214 -#, fuzzy, no-c-format -#| msgid "Maximum number of namespaces to search for alternatives when name lookup fails" +#, no-c-format msgid "Maximum number of nested calls to search for control dependencies during uninitialized variable analysis." -msgstr "Максимальное число пространств имен для поиска альтернатив при неуспешном поиске имени" +msgstr "Максимальное вложенных вызовов для поиска зависимостей по управлению при анализе неинизиализированных имён." #: params.def:1220 #, no-c-format msgid "Maximum number of statements to be included into a single static constructor generated by Pointer Bounds Checker." -msgstr "" +msgstr "Максимальное число операторов, включаемых в один статический конструктор, генерируемый при проверке выхода за границы по указателям." #: params.def:1226 #, no-c-format msgid "Scale factor to apply to the number of statements in a threading path when comparing to the number of (scaled) blocks." -msgstr "" +msgstr "Масштабный множитель для применения к числу операторов в потоковом маршруте при сравнении с числом (масштабированных) блоков." #: params.def:1231 #, no-c-format msgid "Maximum number of arguments a PHI may have before the FSM threader will not try to thread through its block." -msgstr "" +msgstr "Максимальное число аргументов PHI, при котором FSM не будет пытаться протягивать переходы через соответствующий блок." #: params.def:1236 #, no-c-format msgid "Scale factor to apply to the number of blocks in a threading path when comparing to the number of (scaled) statements." -msgstr "" +msgstr "Масштабирующий множитель, применяемый к числу блоков на проходе протягивания переходов при сравнении с (масштабированным) числом операторов." #: params.def:1241 #, no-c-format msgid "Maximum number of instructions to copy when duplicating blocks on a finite state automaton jump thread path." -msgstr "" +msgstr "Максимальное число копируемых инструкций при дублировании блоков конечного автомата на проходе протягивания переходов." #: params.def:1246 -#, fuzzy, no-c-format -#| msgid "maximum number of basic blocks per function to be analyzed by Graphite" +#, no-c-format msgid "Maximum number of basic blocks on a finite state automaton jump thread path." -msgstr "максимальное число базовых блоков в функции, при котором применяются средства Graphite" +msgstr "Максимальное число базовых блоков в конечном автомате, используемом на проходе протягивания переходов." #: params.def:1251 -#, fuzzy, no-c-format -#| msgid "Maximum number of nops to insert for a hint (Default 2)" +#, no-c-format msgid "Maximum number of new jump thread paths to create for a finite state automaton." -msgstr "Максимальное число nops при вставке для подсказки (По умолчанию 2)" +msgstr "Максимальное число новых путей протягивания переходов, которые могут быть созданы в конечном автомате." #: params.def:1256 #, no-c-format msgid "Chunk size of omp schedule for loops parallelized by parloops." -msgstr "" +msgstr "Размер чанка в OMP-расписании для автоматически распараллеливаемых циклов." #: params.def:1261 #, no-c-format msgid "Schedule type of omp schedule for loops parallelized by parloops (static, dynamic, guided, auto, runtime)." -msgstr "" +msgstr "Тип расписания OMP для автоматически распараллеливаемых циклов (static, dynamic, guided, auto, runtime)." #: params.def:1268 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions to consider to unroll in a loop" +#, no-c-format msgid "Minimum number of iterations per thread of an innermost parallelized loop." -msgstr "Максимальное число инструкций в развернутом цикле" +msgstr "Минимальное число инструкций итераций на поток в развёрнутом цикле" #: params.def:1274 #, no-c-format msgid "Maximum recursion depth allowed when querying a property of an SSA name." -msgstr "" +msgstr "Максимальная глубина рекурсии, допустимая при запросах свойств SSA-имен." #: params.def:1280 -#, fuzzy, no-c-format -#| msgid "Maximum number of instructions in basic block to be considered for SLP vectorization" +#, no-c-format msgid "Maximum number of insns in a basic block to consider for RTL if-conversion." -msgstr "Максимальное число инструкций в базовом блоке для его векторизации" +msgstr "Максимальное число инструкций в базовом блоке, пригодном для if-конверсии." #: params.def:1286 #, no-c-format msgid "Maximum permissible cost for the sequence that would be generated by the RTL if-conversion pass for a branch that is considered predictable." -msgstr "" +msgstr "Максимальная допустимая стоимость последовательности, генерируемой при if-конверсии для перехода, который считается предсказуемым." #: params.def:1293 #, no-c-format msgid "Maximum permissible cost for the sequence that would be generated by the RTL if-conversion pass for a branch that is considered unpredictable." -msgstr "" +msgstr "Максимальная допустимая стоимость последовательности, генерируемой при if-конверсии для перехода, который считается непредсказуемым." #: params.def:1300 #, no-c-format msgid "Level of hsa debug stores verbosity" -msgstr "" +msgstr "Уровень подробности отладочной информации HSA при записях в память" #: params.def:1305 #, no-c-format msgid "Maximum number of may-defs visited when devirtualizing speculatively" -msgstr "" +msgstr "Максимальное число may-defs, просматриваемых при спекулятивной девиртуализации" #: params.def:1310 #, no-c-format msgid "Maximum number of assertions to add along the default edge of a switch statement during VRP" -msgstr "" +msgstr "Максимальное число утверждений (assertions), добавляемых вдоль default-дуги оператора switch во время VPR" #: params.def:1316 -#, fuzzy, no-c-format -#| msgid "Enable loop vectorization on trees" +#, no-c-format msgid "Enable loop epilogue vectorization using smaller vector size." -msgstr "Выполнить векторизацию циклов на древовидном представлении" +msgstr "Выполнить векторизацию эпилогов циклов, используя меньший размер векторов." #: params.def:1321 #, no-c-format @@ -2908,10 +2743,9 @@ msgid "Maximum unroll factor for the unroll-and-jam transformation." msgstr "" #: params.def:1331 -#, fuzzy, no-c-format -#| msgid "Maximum number of strings for which strlen optimization pass will track string lengths" +#, no-c-format msgid "Maximum number of bits for which we avoid creating FMAs." -msgstr "Максимальное число строк, для которых проход оптимизации strlen будет отслеживать длины" +msgstr "" #: c-family/c-format.c:382 msgid "format" @@ -3187,10 +3021,9 @@ msgid "" msgstr "" #: config/aarch64/aarch64.c:6629 -#, fuzzy, c-format -#| msgid "Unsupported operand for code '%c'" +#, c-format msgid "unsupported operand for code '%c'" -msgstr "Неподдерживаемый операнд для кода '%c'" +msgstr "" #: config/aarch64/aarch64.c:6640 config/aarch64/aarch64.c:6656 #: config/aarch64/aarch64.c:6668 config/aarch64/aarch64.c:6679 @@ -3198,23 +3031,21 @@ msgstr "Неподдерживаемый операнд для кода '%c'" #: config/aarch64/aarch64.c:6780 config/aarch64/aarch64.c:6791 #: config/aarch64/aarch64.c:6805 config/aarch64/aarch64.c:7027 #: config/aarch64/aarch64.c:7045 -#, fuzzy, c-format -#| msgid "invalid operand for code '%c'" +#, c-format msgid "invalid operand for '%%%c'" -msgstr "недопустимый операнд для кода '%c'" +msgstr "недопустимый операнд для кода '%%%c'" #: config/aarch64/aarch64.c:6725 config/aarch64/aarch64.c:6736 #: config/aarch64/aarch64.c:6887 config/aarch64/aarch64.c:6898 -#, fuzzy, c-format -#| msgid "invalid insn:" +#, c-format msgid "invalid vector constant" -msgstr "недопустимая инструкция:" +msgstr "" #: config/aarch64/aarch64.c:6748 config/aarch64/aarch64.c:6760 #: config/aarch64/aarch64.c:6771 #, c-format msgid "incompatible floating point / vector register operand for '%%%c'" -msgstr "" +msgstr "недопустимый операнд - плавающий или векторный регистр для кода '%%%c'" #: config/aarch64/aarch64.c:6839 config/arm/arm.c:22704 #, c-format @@ -3222,28 +3053,24 @@ msgid "missing operand" msgstr "отсутствует операнд" #: config/aarch64/aarch64.c:6924 -#, fuzzy, c-format -#| msgid "invalid insn:" +#, c-format msgid "invalid constant" -msgstr "недопустимая инструкция:" +msgstr "недопустимая константа" #: config/aarch64/aarch64.c:6927 -#, fuzzy, c-format -#| msgid "invalid %%d operand" +#, c-format msgid "invalid operand" -msgstr "некорректный операнд для %%d" +msgstr "некорректный операнд" #: config/aarch64/aarch64.c:7056 config/aarch64/aarch64.c:7061 -#, fuzzy, c-format -#| msgid "invalid operand code '%c'" +#, c-format msgid "invalid operand prefix '%%%c'" -msgstr "некорректный код операнда '%c'" +msgstr "некорректный префикс операнда '%%%c'" #: config/aarch64/aarch64.c:7078 -#, fuzzy, c-format -#| msgid "invalid addressing mode" +#, c-format msgid "invalid address mode" -msgstr "некорректный режим адресации" +msgstr "" #: config/alpha/alpha.c:5125 config/i386/i386.c:18561 #: config/powerpcspe/powerpcspe.c:24333 config/rs6000/rs6000.c:21875 @@ -3336,34 +3163,29 @@ msgid "invalid %%xn code" msgstr "некорректный код %%xn" #: config/alpha/alpha.c:5511 -#, fuzzy, c-format -#| msgid "invalid address" +#, c-format msgid "invalid operand address" -msgstr "некорректный адрес" +msgstr "некорректный адрес операнда" #: config/arc/arc.c:3808 -#, fuzzy, c-format -#| msgid "invalid operand to %%s code" +#, c-format msgid "invalid operand to %%Z code" -msgstr "некорректный операнд для кода %%s" +msgstr "некорректный операнд для кода %%Z" #: config/arc/arc.c:3816 -#, fuzzy, c-format -#| msgid "invalid operand to %%s code" +#, c-format msgid "invalid operand to %%z code" -msgstr "некорректный операнд для кода %%s" +msgstr "некорректный операнд для кода %%z" #: config/arc/arc.c:3824 -#, fuzzy, c-format -#| msgid "invalid operand to %%s code" +#, c-format msgid "invalid operands to %%c code" -msgstr "некорректный операнд для кода %%s" +msgstr "некорректный операнд для кода %%c" #: config/arc/arc.c:3832 -#, fuzzy, c-format -#| msgid "invalid operand to %%s code" +#, c-format msgid "invalid operand to %%M code" -msgstr "некорректный операнд для кода %%s" +msgstr "некорректный операнд для кода %%M" #: config/arc/arc.c:3840 config/m32r/m32r.c:2100 #, c-format @@ -3396,10 +3218,9 @@ msgid "invalid operand to %%V code" msgstr "некорректный операнд для кода %%V" #: config/arc/arc.c:4212 -#, fuzzy, c-format -#| msgid "invalid operand to %%s code" +#, c-format msgid "invalid operand to %%O code" -msgstr "некорректный операнд для кода %%s" +msgstr "некорректный операнд для кода %%O" #. Unknown flag. #. Undocumented flag. @@ -3410,10 +3231,9 @@ msgid "invalid operand output code" msgstr "неверный код выходного операнда" #: config/arc/arc.c:5860 -#, fuzzy, c-format -#| msgid "invalid UNSPEC as operand" +#, c-format msgid "invalid UNSPEC as operand: %d" -msgstr "некорректный операнд UNSPEC" +msgstr "некорректный операнд UNSPEC: %d" #: config/arc/arc.c:6149 config/cris/cris.c:2568 msgid "unrecognized supposed constant" @@ -3423,7 +3243,7 @@ msgstr "неопознанная константа" #: config/arm/arm.c:19186 config/arm/arm.c:19195 #, c-format msgid "invalid shift operand" -msgstr "некорректный операнд сдвига" +msgstr "некорректный оператор сдвига" #: config/arm/arm.c:22035 config/arm/arm.c:22053 #, c-format @@ -3462,10 +3282,9 @@ msgstr "инструкция никогда не выполняется" #. Former Maverick support, removed after GCC-4.7. #: config/arm/arm.c:22399 -#, fuzzy, c-format -#| msgid "Unsupported operand for code '%c'" +#, c-format msgid "obsolete Maverick format code '%c'" -msgstr "Неподдерживаемый операнд для кода '%c'" +msgstr "устаревший код формата Maverick '%c'" #: config/avr/avr.c:2655 #, c-format @@ -3494,16 +3313,16 @@ msgstr "некорректный адрес, не post_inc или pre_dec:" #: config/avr/avr.c:2939 msgid "internal compiler error. Bad address:" -msgstr "внутренняя ошибка компилятора: некорректный адрес:" +msgstr "внутренняя ошибка компилятора. Некорректный адрес:" #: config/avr/avr.c:2972 #, c-format msgid "Unsupported code '%c' for fixed-point:" -msgstr "" +msgstr "Неподдерживаемый код '%c' для значения с фикс. точкой:" #: config/avr/avr.c:2980 msgid "internal compiler error. Unknown mode:" -msgstr "внутренняя ошибка компилятора: неизвестный режим:" +msgstr "внутренняя ошибка компилятора. Неизвестный режим:" #: config/avr/avr.c:4022 config/avr/avr.c:4966 config/avr/avr.c:5413 msgid "invalid insn:" @@ -3528,51 +3347,41 @@ msgstr "некорректная инструкция сдвига:" #: config/avr/avr.c:6387 config/avr/avr.c:6868 config/avr/avr.c:7283 msgid "internal compiler error. Incorrect shift:" -msgstr "Внутренняя ошибка компилятора: некорректный сдвиг:" +msgstr "внутренняя ошибка компилятора. Некорректное смещение:" #: config/avr/avr.c:8689 -#, fuzzy -#| msgid "invalid types in fixed-point conversion" msgid "unsupported fixed-point conversion" -msgstr "неверные типы в преобразовании с фиксированной точкой" +msgstr "неподдерживаемое преобразование с фиксированной точкой" #: config/avr/avr.c:10046 -#, fuzzy -#| msgid "Loop variable" msgid "variable" -msgstr "Переменная цикла" +msgstr "переменная" #: config/avr/avr.c:10051 -#, fuzzy -#| msgid "redefinition of parameter %q+D" msgid "function parameter" -msgstr "повторное определение параметра %q+D" +msgstr "параметр функции" #: config/avr/avr.c:10056 -#, fuzzy -#| msgid "struct defined here" msgid "structure field" -msgstr "структура определена здесь" +msgstr "поле структуры" #: config/avr/avr.c:10062 -#, fuzzy -#| msgid "creating array of functions" msgid "return type of function" -msgstr "создание массива функций" +msgstr "тип результата функции" #: config/avr/avr.c:10067 -#, fuzzy -#| msgid "null pointer" msgid "pointer" -msgstr "нулевой указатель" +msgstr "указатель" #: config/avr/driver-avr.c:50 -#, fuzzy, c-format -#| msgid "unknown spec function %qs" +#, c-format msgid "" "Running spec function '%s' with %d args\n" "\n" -msgstr "неизвестная функция %qs в спецификации" +msgstr "" +"Выполняется spec функция '%s' с %d аргументами\n" +"\n" +"\n" #: config/bfin/bfin.c:1390 #, c-format @@ -3809,40 +3618,34 @@ msgid "invalid UNSPEC as operand" msgstr "некорректный операнд UNSPEC" #: config/i386/i386.c:17928 -#, fuzzy, c-format -#| msgid "invalid use of %" +#, c-format msgid "invalid use of register '%s'" -msgstr "неверное употребление спецификатора %" +msgstr "недопустимое использование регистра '%s'>" #: config/i386/i386.c:17933 -#, fuzzy, c-format -#| msgid "invalid type for make function" +#, c-format msgid "invalid use of asm flag output" -msgstr "некорректный тип для make функции" +msgstr "некорректное использование флага вывода в asm" #: config/i386/i386.c:18163 -#, fuzzy, c-format -#| msgid "invalid operand size for operand code '%c'" +#, c-format msgid "invalid operand size for operand code 'O'" -msgstr "недопустимый размер операнда для кода '%c'" +msgstr "недопустимый размер операнда для кода 'O'" #: config/i386/i386.c:18198 -#, fuzzy, c-format -#| msgid "invalid operand size for operand code '%c'" +#, c-format msgid "invalid operand size for operand code 'z'" -msgstr "недопустимый размер операнда для кода '%c'" +msgstr "недопустимый размер операнда для кода 'z'" #: config/i386/i386.c:18267 -#, fuzzy, c-format -#| msgid "invalid operand type used with operand code '%c'" +#, c-format msgid "invalid operand type used with operand code 'Z'" -msgstr "недопустимый тип операнда для кода '%c'" +msgstr "недопустимый тип операнда для кода 'Z'" #: config/i386/i386.c:18272 -#, fuzzy, c-format -#| msgid "invalid operand size for operand code '%c'" +#, c-format msgid "invalid operand size for operand code 'Z'" -msgstr "недопустимый размер операнда для кода '%c'" +msgstr "недопустимый размер операнда для кода 'Z'" #: config/i386/i386.c:18349 #, c-format @@ -3855,10 +3658,9 @@ msgid "operand is not a condition code, invalid operand code 'D'" msgstr "операнд не является кодом условия, неверный код операнда 'D'" #: config/i386/i386.c:18446 -#, fuzzy, c-format -#| msgid "operand is not a condition code, invalid operand code 'D'" +#, c-format msgid "operand is not a condition code, invalid operand code '%c'" -msgstr "операнд не является кодом условия, неверный код операнда 'D'" +msgstr "операнд не является кодом условия, неверный код операнда '%c'" #: config/i386/i386.c:18459 #, c-format @@ -3866,28 +3668,24 @@ msgid "operand is not an offsettable memory reference, invalid operand code 'H'" msgstr "операнд не является ссылкой на память со смещением, неверный код операнда 'H'" #: config/i386/i386.c:18474 -#, fuzzy, c-format -#| msgid "operand is not a condition code, invalid operand code 'Y'" +#, c-format msgid "operand is not an integer, invalid operand code 'K'" -msgstr "операнд не является кодом условия, неверный код операнда 'Y'" +msgstr "операнд не является кодом условия, неверный код операнда 'K'" #: config/i386/i386.c:18502 -#, fuzzy, c-format -#| msgid "operand is not a condition code, invalid operand code 'Y'" +#, c-format msgid "operand is not a specific integer, invalid operand code 'r'" -msgstr "операнд не является кодом условия, неверный код операнда 'Y'" +msgstr "операнд не является специфическим целым, неверный код операнда 'r'" #: config/i386/i386.c:18520 -#, fuzzy, c-format -#| msgid "operand is not a condition code, invalid operand code 'Y'" +#, c-format msgid "operand is not an integer, invalid operand code 'R'" -msgstr "операнд не является кодом условия, неверный код операнда 'Y'" +msgstr "операнд не является целым, неверный код операнда 'R'" #: config/i386/i386.c:18543 -#, fuzzy, c-format -#| msgid "operand is not a condition code, invalid operand code 'Y'" +#, c-format msgid "operand is not a specific integer, invalid operand code 'R'" -msgstr "операнд не является кодом условия, неверный код операнда 'Y'" +msgstr "операнд не является специфическим целым, неверный код операнда 'R'" #: config/i386/i386.c:18629 #, c-format @@ -3900,20 +3698,20 @@ msgid "invalid constraints for operand" msgstr "некорректные ограничения для операнда" #: config/i386/i386.c:18741 -#, fuzzy, c-format -#| msgid "invalid insn:" +#, c-format msgid "invalid vector immediate" -msgstr "недопустимая инструкция:" +msgstr "" #: config/i386/i386.c:29575 msgid "unknown insn mode" msgstr "некорректный режим инструкции" #: config/i386/djgpp.h:146 -#, fuzzy, c-format -#| msgid "-f%s ignored for Unicos/Mk (not supported)" +#, c-format msgid "-f%s ignored (not supported for DJGPP)\n" -msgstr "ключ -f%s для Unicos/Mk проигнорирован (не поддерживается)" +msgstr "" +"ключ -f%s проигнорирован (не поддерживается для DJGPP)\n" +"\n" #: config/ia64/ia64.c:5462 #, c-format @@ -4098,16 +3896,14 @@ msgid "MMIX Internal: This is not a constant:" msgstr "Внутреннее сообщение MMIX: это не константа:" #: config/msp430/msp430.c:3686 -#, fuzzy, c-format -#| msgid "invalid reference prefix" +#, c-format msgid "invalid operand prefix" -msgstr "неверный префикс ссылки" +msgstr "неверный префикс операнда" #: config/msp430/msp430.c:3720 -#, fuzzy, c-format -#| msgid "invalid use of %" +#, c-format msgid "invalid zero extract" -msgstr "неверное употребление спецификатора %" +msgstr "неверный операнд инструкции zero extract" #: config/powerpcspe/host-darwin.c:96 config/rs6000/host-darwin.c:96 #, c-format @@ -4121,7 +3917,7 @@ msgstr "Попробуйте выполнить '%s' в командной ст #: config/powerpcspe/powerpcspe.c:4411 config/rs6000/rs6000.c:4278 msgid "-maltivec=le not allowed for big-endian targets" -msgstr "" +msgstr "опция -maltivec=le недопустима для big-endian платформ" #: config/powerpcspe/powerpcspe.c:4423 config/rs6000/rs6000.c:4293 msgid "-mvsx requires hardware floating point" @@ -4144,30 +3940,24 @@ msgid "-mno-altivec disables vsx" msgstr "-mno-altivec отменяет vsx" #: config/powerpcspe/powerpcspe.c:4648 config/rs6000/rs6000.c:4436 -#, fuzzy -#| msgid "--resource requires -o" msgid "-mquad-memory requires 64-bit mode" -msgstr "ключ --resource требует задания -o" +msgstr "ключ -mquad-memory требует 64-битного режима" #: config/powerpcspe/powerpcspe.c:4651 config/rs6000/rs6000.c:4439 msgid "-mquad-memory-atomic requires 64-bit mode" -msgstr "" +msgstr "ключ -mquad-memory-atomic требует 64-битного режима" #: config/powerpcspe/powerpcspe.c:4663 config/rs6000/rs6000.c:4451 -#, fuzzy -#| msgid "Generate code in little endian mode" msgid "-mquad-memory is not available in little endian mode" -msgstr "Генерировать код для обратного (little endian) порядка байт" +msgstr "ключ -mquad-memory не поддерживается для обратного (little endian) порядка байт" #: config/powerpcspe/powerpcspe.c:4735 config/rs6000/rs6000.c:4532 -#, fuzzy -#| msgid "--resource requires -o" msgid "-mtoc-fusion requires 64-bit" -msgstr "ключ --resource требует задания -o" +msgstr "ключ -mtoc-fusion требует 64-битного режима" #: config/powerpcspe/powerpcspe.c:4742 config/rs6000/rs6000.c:4539 msgid "-mtoc-fusion requires medium/large code model" -msgstr "" +msgstr "для -mtoc-fusion требуется модель кода medium/large" #: config/powerpcspe/powerpcspe.c:11492 config/rs6000/rs6000.c:10947 msgid "bad move" @@ -4175,13 +3965,12 @@ msgstr "некорректная пересылка" #: config/powerpcspe/powerpcspe.c:23594 config/rs6000/rs6000.c:21164 msgid "Bad 128-bit move" -msgstr "" +msgstr "некорректная 128-битная пересылка" #: config/powerpcspe/powerpcspe.c:23785 config/rs6000/rs6000.c:21355 -#, fuzzy, c-format -#| msgid "invalid %%H value" +#, c-format msgid "invalid %%e value" -msgstr "некорректное %%H значение" +msgstr "некорректное %%e значение" #: config/powerpcspe/powerpcspe.c:23806 config/rs6000/rs6000.c:21376 #, c-format @@ -4258,59 +4047,55 @@ msgstr "некорректное значение %%y, попробуйте ис #: config/powerpcspe/powerpcspe.c:24996 config/rs6000/rs6000.c:22359 msgid "__float128 and __ibm128 cannot be used in the same expression" -msgstr "" +msgstr "__float128 и __ibm128 нельзя использовать в одном выражении" #: config/powerpcspe/powerpcspe.c:25002 config/rs6000/rs6000.c:22365 msgid "__ibm128 and long double cannot be used in the same expression" -msgstr "" +msgstr "__ibm128 и long double нельзя использовать в одном выражении" #: config/powerpcspe/powerpcspe.c:25008 config/rs6000/rs6000.c:22371 msgid "__float128 and long double cannot be used in the same expression" -msgstr "" +msgstr "__float128 и long double нельзя использовать в одном выражении" #: config/powerpcspe/powerpcspe.c:39380 config/rs6000/rs6000.c:36628 msgid "AltiVec argument passed to unprototyped function" msgstr "Аргумент AltiVec передан в функцию без прототипа" #: config/powerpcspe/powerpcspe.c:41186 config/rs6000/rs6000.c:38795 -#, fuzzy -#| msgid "Do not generate a single exit point for each function" msgid "Could not generate addis value for fusion" -msgstr "Не генерировать одну выходную точку для каждой функции" +msgstr "Не удалось сгенерировать дополнительное значение для синтеза" #: config/powerpcspe/powerpcspe.c:41258 config/rs6000/rs6000.c:38865 -#, fuzzy -#| msgid "unable to generate reloads for:" msgid "Unable to generate load/store offset for fusion" -msgstr "ошибка при генерации загрузок операндов на регистры для:" +msgstr "Не удалось сгенерировать смещение загрузки/сохранения для синтеза" #: config/powerpcspe/powerpcspe.c:41362 config/rs6000/rs6000.c:38964 msgid "Bad GPR fusion" -msgstr "" +msgstr "Некорректный GPR синтез" #: config/powerpcspe/powerpcspe.c:41580 config/rs6000/rs6000.c:39182 msgid "emit_fusion_p9_load, bad reg #1" -msgstr "" +msgstr "emit_fusion_p9_load, некорректный регистр #1" #: config/powerpcspe/powerpcspe.c:41626 config/rs6000/rs6000.c:39228 msgid "emit_fusion_p9_load, bad reg #2" -msgstr "" +msgstr "emit_fusion_p9_load, некорректный регистр #2" #: config/powerpcspe/powerpcspe.c:41629 config/rs6000/rs6000.c:39231 msgid "emit_fusion_p9_load not MEM" -msgstr "" +msgstr "emit_fusion_p9_load не память" #: config/powerpcspe/powerpcspe.c:41667 config/rs6000/rs6000.c:39269 msgid "emit_fusion_p9_store, bad reg #1" -msgstr "" +msgstr "emit_fusion_p9_store, некорректный регистр #1" #: config/powerpcspe/powerpcspe.c:41713 config/rs6000/rs6000.c:39315 msgid "emit_fusion_p9_store, bad reg #2" -msgstr "" +msgstr "emit_fusion_p9_store, некорректный регистр #2" #: config/powerpcspe/powerpcspe.c:41716 config/rs6000/rs6000.c:39318 msgid "emit_fusion_p9_store not MEM" -msgstr "" +msgstr "emit_fusion_p9_store не память" #: config/rl78/rl78.c:2004 config/rl78/rl78.c:2090 #, c-format @@ -4378,10 +4163,9 @@ msgid "invalid constant - try using an output modifier" msgstr "некорректная константа - попытайтесь использовать модификатор вывода" #: config/s390/s390.c:8004 -#, fuzzy, c-format -#| msgid "invalid constant for output modifier '%c'" +#, c-format msgid "invalid constant vector for output modifier '%c'" -msgstr "некорректная константа для модификатора вывода '%c'" +msgstr "некорректная константный вектор для модификатора вывода '%c'" #: config/s390/s390.c:8011 #, c-format @@ -4394,28 +4178,24 @@ msgid "invalid expression for output modifier '%c'" msgstr "некорректное выражение для модификатора вывода '%c'" #: config/s390/s390.c:12149 -#, fuzzy -#| msgid "AltiVec argument passed to unprototyped function" msgid "vector argument passed to unprototyped function" -msgstr "Аргумент AltiVec передан в функцию без прототипа" +msgstr "векторный аргумент передан в функцию без прототипа" #: config/s390/s390.c:16391 -#, fuzzy -#| msgid "pointer targets in return differ in signedness" msgid "types differ in signedness" -msgstr "при возврате результата указуемые типы различаются знаковостью" +msgstr "типы различаются знаковостью" #: config/s390/s390.c:16401 msgid "binary operator does not support two vector bool operands" -msgstr "" +msgstr "бинарный оператор не поддерживает два операнда-вектора с булевыми компонентами" #: config/s390/s390.c:16404 msgid "binary operator does not support vector bool operand" -msgstr "" +msgstr "бинарный оператор не поддерживает операнд - вектор с булевыми компонентами" #: config/s390/s390.c:16412 msgid "binary operator does not support mixing vector bool with floating point vector operands" -msgstr "" +msgstr "бинарный оператор не поддерживает сочетание операндов вектор с булевыми компонентами и вектор с плавающими компонентами" #: config/sh/sh.c:1210 #, c-format @@ -4476,8 +4256,7 @@ msgid "invalid %%s operand" msgstr "некорректный операнд для %%s" #: config/sparc/sparc.c:9600 -#, fuzzy, c-format -#| msgid "floating point constant not a valid immediate operand" +#, c-format msgid "floating-point constant not a valid immediate operand" msgstr "плавающая константа не является корректным непосредственным операндом" @@ -4614,34 +4393,24 @@ msgid "illegal operand detected" msgstr "обнаружен некорректный операнд" #: config/visium/visium.c:3374 -#, fuzzy -#| msgid "illegal operand detected" msgid "illegal operand " -msgstr "обнаружен некорректный операнд" +msgstr "недопустимый операнд " #: config/visium/visium.c:3425 -#, fuzzy -#| msgid "illegal operand detected" msgid "illegal operand address (1)" -msgstr "обнаружен некорректный операнд" +msgstr "некорректный адрес операнда (1)" #: config/visium/visium.c:3432 -#, fuzzy -#| msgid "illegal operand detected" msgid "illegal operand address (2)" -msgstr "обнаружен некорректный операнд" +msgstr "некорректный адрес операнда (2)" #: config/visium/visium.c:3447 -#, fuzzy -#| msgid "illegal operand detected" msgid "illegal operand address (3)" -msgstr "обнаружен некорректный операнд" +msgstr "некорректный адрес операнда (3)" #: config/visium/visium.c:3455 -#, fuzzy -#| msgid "illegal operand detected" msgid "illegal operand address (4)" -msgstr "обнаружен некорректный операнд" +msgstr "некорректный адрес операнда (4)" #: config/xtensa/xtensa.c:802 config/xtensa/xtensa.c:834 #: config/xtensa/xtensa.c:843 @@ -4677,7 +4446,7 @@ msgstr "адресное смещение - не константа" #: c/c-objc-common.c:173 msgid "aka" -msgstr "" +msgstr "aka" #: c/c-objc-common.c:206 msgid "({anonymous})" @@ -4828,10 +4597,9 @@ msgstr "ожидалось %<<%>" #: c/gimple-parser.c:1488 c/gimple-parser.c:1515 c/gimple-parser.c:1543 #: c/gimple-parser.c:1369 c/gimple-parser.c:1398 -#, fuzzy, gcc-internal-format -#| msgid "expected channel" +#, gcc-internal-format msgid "expected label" -msgstr "ожидался канал" +msgstr "ожидалась метка" #: cp/call.c:10487 msgid "candidate 1:" @@ -4850,34 +4618,24 @@ msgid "jump to case label" msgstr "переход по case-метке" #: cp/decl.c:3236 -#, fuzzy -#| msgid " enters try block" msgid "enters try block" -msgstr " входит в try-блок" +msgstr "входит в try-блок" #: cp/decl.c:3242 -#, fuzzy -#| msgid " enters catch block" msgid "enters catch block" -msgstr " входит в catch-блок" +msgstr "входит в catch-блок" #: cp/decl.c:3248 -#, fuzzy -#| msgid " enters OpenMP structured block" msgid "enters OpenMP structured block" -msgstr " входит в OpenMP структурный блок" +msgstr "входит в OpenMP структурный блок" #: cp/decl.c:3254 -#, fuzzy -#| msgid "Generate code for huge switch statements" msgid "enters synchronized or atomic statement" -msgstr "Генерировать код для больших переключателей" +msgstr "входит в синхронизируемый или атомарный оператор" #: cp/decl.c:3261 -#, fuzzy -#| msgid "expected statement" msgid "enters constexpr if statement" -msgstr "ожидался оператор" +msgstr "" #: cp/error.c:365 msgid "" @@ -4901,10 +4659,9 @@ msgid "" msgstr "" #: cp/error.c:730 -#, fuzzy, c-format -#| msgid "" +#, c-format msgid "" -msgstr "" +msgstr "" #. A lambda's "type" is essentially its signature. #: cp/error.c:735 @@ -4942,14 +4699,12 @@ msgid "{anonymous}" msgstr "{anonymous}" #: cp/error.c:1184 -#, fuzzy -#| msgid "(anonymous)" msgid "(anonymous namespace)" -msgstr "(anonymous)" +msgstr "(anonymous namespace)" #: cp/error.c:1276 msgid "