The current default of 10 minutes is much longer than most tests need on
common hardware. The slow tests all now have a dg-timeout-factor
directive that gives them more time to run relative to the default. The
default can also be overridden in ~/.dejagnurc or DEJAGNU=site.exp, so
it seems unnecessary to have such a large default.
This reduces the default from 10 minutes to 6 minutes, which still seems
more than enough.
libstdc++-v3/ChangeLog:
* testsuite/lib/libstdc++.exp (libstdc++_init): Reduce
default tool_timeout to 360.
As in r11-5449, this adds a muliplier to the timeout for slow tests.
This covers the majority of the <regex> and PSTL tests.
libstdc++-v3/ChangeLog:
* testsuite/20_util/specialized_algorithms/pstl/*: Add
dg-timeout-factor.
* testsuite/25_algorithms/pstl/*: Likewise.
* testsuite/26_numerics/pstl/*: Likewise.
* testsuite/28_regex/*: Likewise.
gcc/fortran/ChangeLog:
PR fortran/98011
* scanner.c (skip_free_comments, skip_fixed_comments): If only
-fopenacc but not -fopenmp is used, ignore OpenMP's conditional
compilation sentinels. Fix indentation, use 'else if' for readability.
gcc/testsuite/ChangeLog:
PR fortran/98011
* gfortran.dg/goacc/sentinel-free-form.f95:
* gfortran.dg/goacc-gomp/fixed-1.f: New test.
* gfortran.dg/goacc-gomp/free-1.f90: New test.
* gfortran.dg/goacc/fixed-5.f: New test.
Options: -fopenmp and -fopenacc imply concurrent calls to a
procedure; now also -fopenacc implies -frecursive, disabling
that larger local const-size array variables use static memory.
Run-time recursion check: Always reset the check variable at the
end of the procedure; this avoids a bogus error with -fopenmp
when called twice nonconcurrently/nonrecursively. (Issue requires
using -fno-automatic or -fmax-stack-var-size= to trigger.)
gcc/fortran/ChangeLog:
PR fortran/98010
PR fortran/98013
* options.c (gfc_post_options): Also imply recursive with
-fopenacc.
* trans-decl.c (gfc_generate_function_code): Simplify condition.
gcc/ada/
* sem_ch5.adb (Set_Assignment_Type): Combine calls to Ekind
using membership test.
(Should_Transform_BIP_Assignment): Replace assignment to a
"Result" variable with simple return statements; avoid repeated
calls to Unqual_Conv by declaring a local constant.
gcc/ada/
* contracts.adb (Check_Type_Or_Object_External_Properties): Make
sure to exclude all return objects from the SPARK legality rule
on effectively volatile variables.
* exp_ch6.adb (Expand_N_Extended_Return_Statement): Use the fast
track only when the declaration of the return object can be
dropped.
gcc/ada/
* einfo.ads (Is_Partial_DIC_Procedure): New function.
(Partial_DIC_Procedure): New procedure.
* einfo.adb (Is_Partial_DIC_Procedure): New function to return
whether a subprogram is a partial Default_Initial_Condition
procedure by checking the name (to avoid adding a new field).
(DIC_Procedure): Add a test that excludes partial DIC procedures
from being returned.
(Partial_DIC_Procedure): New procedure to return the partial DIC
procedure of a type, if it has one (otherwise returns Empty).
(Set_DIC_Procedure): Remove check for duplicate DIC procedures.
* exp_aggr.adb (Gen_Assign): Generate a call to the type's DIC
procedure in the case where an array component is default
initialized (due to an association with a box).
(Build_Record_Aggr_Code): For an extension aggregate, generate a
call to the ancestor type's DIC procedure (if any) when the
ancestor part is a subtype mark. For a record component
association that was specified with a box (tested for by
checking the new flag Was_Default_Init_Box_Association),
generate a call to the component type's DIC procedure (if it has
one).
* exp_ch4.adb (Expand_N_Allocator): When the allocated object is
default initialized and the designated type has a DIC aspect,
generate a call to the DIC procedure.
* exp_util.ads (Build_DIC_Call): Change the formal Obj_Id to
name Obj_Name, and change its type from Entity_Id to Node_Id
(and update comment).
(Build_DIC_Procedure_Body): Add formal Partial_DIC, remove
formal For_Freeze, and update comment accordingly.
(Build_DIC_Procedure_Declaration): Add formal Partial_DIC and
update comment.
* exp_util.adb
(Build_DIC_Call): Revised to use its Obj_Name (formerly Obj_Id)
formal directly rather than calling New_Occurrence_Of on it, to
allow arbitrary names to be passed rather than being limited to
Entity_Ids.
(Build_DIC_Procedure_Body): Call Add_Parent_DICs to generate
checks for DICs associated with any parent types, implementing
the required "additive" semantics for DICs. When building a DIC
procedure body for a partial view (when Partial_DIC is True),
call Add_Own_DIC when the type has its own DIC. In the case of
"full" DIC procedures, a call is generated to any partial DIC
procedure of the type (unless the procedure has a null body),
along with checks for any DICs inherited by the full view.
(Build_DIC_Procedure_Declaration): Add handling for partial DIC
procedures. For the suffix of a regular DIC procedure's name,
use "DIC" (instead of "Default_Initial_Condition"), and for the
suffix of a partial DIC procedure's name, use "Partial_DIC".
(Add_DIC_Check): Add the DIC pragma to the list of seen pragmas
(Pragmas_Seen).
(Add_Inherited_Tagged_DIC): Remove the formals Par_Typ,
Deriv_Typ, and Obj_Id, and add formal Expr, which denotes DIC's
expression. Remove the call to Replace_References (which is now
done in Add_Inherited_DICs).
(Add_Inherited_DICs): New procedure to locate a DIC pragma
associated with a parent type, replace its references
appropriately (such as any current instance references), and add
a check for the DIC.
(Add_Own_DIC): Add an Obj_Id formal to allow caller to pass the
_init formal of the generated DIC procedure.
(Add_Parent_DICs): New procedure to traverse a type's parents,
looking for DICs associated with those and calling
Add_Inherited_DICs to apply the appropriate DIC checks.
(Is_Verifiable_DIC_Pragma): Treat pragmas that have an Empty
first argument the same as a pragma without any arguments
(returning False for that case).
* exp_ch3.adb (Init_One_Dimension): Generate calls to the
component's DIC procedure when needed.
(Possible_DIC_Call): New function nested in Init_One_Dimension
to build a call to the array component type's DIC-checking
function when appropriate.
(Build_Array_Init_Proc): The presence of a DIC on the component
type is an additional condition for generating an init proc for
an array type.
(Build_Init_Statements): When the record component's type has a
DIC, and the component declaration does not have an
initialization expression, generate a call to the component
type's DIC procedure.
(Expand_N_Object_Declaration): Modify the call to Build_DIC_Call
to pass a new occurrence of the object's defining id rather than
the id itself.
(Freeze_Type): Only build a type's DIC procedure (if it has one)
for types that are not interfaces.
* exp_spark.adb (Expand_SPARK_N_Freeze_Type): Remove From_Freeze
actual and add a ??? comment.
(Expand_SPARK_N_Object_Declaration): Modify call to
Build_DIC_Call to pass a new occurrence of the object id rather
than the object id itself.
* sem_aggr.adb (Resolve_Record_Aggregate): Declare local flag
Is_Box_Init_By_Default and set it in cases where the component
association has a box and the component is being initialized by
default (as opposed to initialized by an initialization
expression associated with the component's declaration).
(Add_Association): If the association has a box for a component
initialized by default, the flag
Was_Default_Init_Box_Association is set on the new component
association (for later testing during expansion).
(Get_Value): Reset Is_Box_Init_By_Default to False.
* sem_ch3.adb (Build_Assertion_Bodies_For_Type): Rearrange code
to build DIC procedure bodies for a (noninterface) type that
Has_Own_DIC (for partial type views) or Has_DIC (for full type
views) as appropriate.
* sem_ch13.adb (Analyze_Aspect_Specifications,
Aspect_Default_Initial_Condition): Add an extra argument to the
DIC pragma to denote the type associated with the pragma (for
use in Build_DIC_Procedure_Body).
* sem_prag.adb (Analyze_Pragma): Allow two arguments for pragma
Default_Initial_Condition. If not already present, add an extra
argument denoting the type that the pragma is associated with.
* sem_util.adb (Propagate_DIC_Attributes): Retrieve any partial
DIC procedure associated with the type and add it to the type's
list of subprograms (Subprograms_For_Type).
* sinfo.ads (Was_Default_Init_Box_Association): New flag on
N_Component_Association nodes. Add subprograms to get and set
flag, as well as updating the documentation.
* sinfo.adb (Was_Default_Init_Box_Association): New function to
retrieve the corresponding flag (Flag14).
(Set_Was_Default_Init_Box_Association): New procedure to set the
corresponding flag (Flag14).
gcc/ada/
* libgnat/a-nbnbre.adb (Float_Conversions): Instantiate Conv
package only once in the body.
(Fixed_Conversions.Float_Aux): New instance.
(Fixed_Conversions.Conv_I): Likewise.
(Fixed_Conversions.Conv_U): Likewise.
(Fixed_Conversions.LLLI): New subtype.
(Fixed_Conversions.LLLU): Likewise.
(Fixed_Conversions.Too_Large): New constant.
(Fixed_Conversions.To_Big_Real): Reimplement.
(Fixed_Conversions.From_Big_Real): Likewise.
gcc/ada/
* exp_ch5.adb (Expand_Iterator_Loop_Over_Container): Check the
signature of the private operation Get_Element_Access to prevent
accidental use of a user-defined homonym subprogram.
gcc/ada/
* exp_util.adb (Get_Current_Value_Condition): Don't use current
value tracking in GNATprove mode.
* sem_res.adb (Resolve_Comparison_Op): Remove incomplete
special-casing for folding in GNATprove mode.
gcc/ada/
* errout.adb (Error_Msg_NEL): Do not call Set_Posted if errors
are being ignored.
(Error_Msg): Change Errors_Must_Be_Ignored to use the getter.
* sem_ch8.adb (Find_Direct_Name): Do not skip all the error
checks when ignoring errors, but instead do not add an entry to
the Urefs table if errors are being ignored.
* exp_ch5.adb: Minor comment fix.
gcc/ada/
* ali-util.adb (Get_File_Checksum): Remove dead code.
* exp_ch4.adb (Expand_Boolean_Operator, Expand_N_Op_Not,
Make_Boolean_Array_Op): Take Transform_Function_Array into
account.
* exp_ch6.adb (Expand_Call_Helper): Update comment. Code
cleanup.
* exp_util.adb (Build_Procedure_Form): Use new predefined name
Name_UP_RESULT.
* snames.ads-tmpl (Name_UP_RESULT): New predefined name. Code
cleanup: remove unused names from the project parser, moved to
gprbuild sources.
* xsnamest.adb: Add support for uppercase names.
gcc/ada/
* sem_util.adb (Enter_Name): When an inherited operation for a
local derived type is hidden by an explicit declaration of a
non-overloadable entity in the same scope, make the inherited
operation non-visible to prevent its accidental use elsewhere.
This avoids breaking LC SSA when SLP codegen pulled an out-of-loop
def into a loop when merging with in-loop defs for an external def.
2020-11-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/98064
* tree-vect-loop.c (vectorizable_live_operation): Avoid
breaking LC SSA for BB vectorization.
* g++.dg/vect/pr98064.cc: New testcase.
The optional target selector for the dg-require-effective-target
directive needs to be { target selector } not just { selector } as
currently documented.
gcc/ChangeLog:
* doc/sourcebuild.texi (Directives): Fix description of
dg-require-effective-target to include "target" in selector.
This makes sure to use the correct type for the LHS of the scalar
replacement statement.
20220-11-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/98048
* tree-vect-generic.c (expand_vector_operations_1): Use the
correct type for the scalar LHS replacement.
* gcc.dg/vect/pr98048.c: New testcase.
This allows using "testsuite/*" in libstdc++-v3/ChangeLog entries, which
was one of the original motivations for adding wildcard support in the
first place:
https://gcc.gnu.org/pipermail/gcc/2020-June/232719.html
contrib/ChangeLog:
* gcc-changelog/git_commit.py (wildcard_prefixes): Add libstdc++
testsuite directory.
During ICE reporting, sometimes rtl_dump_bb is called on partially
initialized basic blocks. This produces another ICE, obscuring the
original problem.
Fix by checking that that basic blocks are initialized before touching
their bb_infos.
gcc/ChangeLog:
2020-11-25 Ilya Leoshkevich <iii@linux.ibm.com>
* cfgrtl.c (rtl_bb_info_initialized_p): New function.
(rtl_dump_bb): Use rtl_bb_info_initialized_p before accessing bb
insns.
This recently submitted test was found to fail on some Cortex-M
targets. This was because codegen on these CPUs would emit a ldr
instead of a movw/movt pair, resulting in an overall smaller test
(i.e. the branch wasn't as far) and the behaviour being tested
for not being triggered.
This commit doubles the size of the test to account for this.
gcc/testsuite/ChangeLog:
* gcc.target/arm/pr91816.c: New test.
As discussed in the PR, e.g. on x86_64 (both -m32 and -m64) there is no
double-word modulo and so we expand it to a __{,u}mod[dt]i3 call.
For certain constant divisors we can do better. E.g. consider
32-bit word-size, 0x100000000ULL % 3 == 1, so we can use partly the Hacker's
delight modulo by summing digits approach and optimize
unsigned long long foo (unsigned long long x) { return x % 3; }
as
unsigned long long foo (unsigned long long x) {
unsigned int sum, carry;
carry = __builtin_add_overflow ((unsigned int) x, (unsigned int) (x >> 32), &sum);
sum += carry;
return sum % 3;
}
Similarly, 0x10000000ULL % 5 == 1 (note, 1 << 28), so
unsigned long long bar (unsigned long long x) { return x % 5; }
as
unsigned long long bar (unsigned long long x) {
unsigned int sum = x & ((1 << 28) - 1);
sum += (x >> 28) & ((1 << 28) - 1);
sum += (x >> 56);
return sum % 5;
}
etc.
And we can do also signed modulo,
long long baz (long long x) { return x % 5; }
as
long long baz (long long x) {
unsigned int sum = x & ((1 << 28) - 1);
sum += ((unsigned long long) x >> 28) & ((1 << 28) - 1);
sum += ((unsigned long long) x >> 56);
/* Sum adjustment for negative x. */
sum += (x >> 63) & 3;
unsigned int rem = sum % 5;
/* And finally adjust it to the right interval for negative values. */
return (int) (rem + ((x >> 63) & -4));
}
2020-11-30 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/97459
* internal-fn.h (expand_addsub_overflow): Declare.
* internal-fn.c (expand_addsub_overflow): No longer static.
* optabs.c (expand_doubleword_mod): New function.
(expand_binop): Optimize double-word mod with constant divisor.
* gcc.dg/pr97459-1.c: New test.
* gcc.dg/pr97459-2.c: New test.
- Define MULTILIB_DEFAULTS can reduce the total number of multilib if
the default arch and ABI are listed in the multilib config.
- This also simplify the implementation of --with-multilib-list.
gcc/ChangeLog:
* config.gcc (riscv*-*-*): Add TARGET_RISCV_DEFAULT_ABI and
TARGET_RISCV_DEFAULT_ARCH to tm_defines.
Remove including riscv/withmultilib.h for --with-multilib-list.
* config/riscv/riscv.h (STRINGIZING): New.
(__STRINGIZING): Ditto.
(MULTILIB_DEFAULTS): Ditto.
* config/riscv/withmultilib.h: Remove.
This issue is found when we try to always define MULTILIB_DEFAULTS for -march
and -mabi for RISC-V back-end, however `-print-multi-lib` will skip
multi-lib setting if match any one of flag in MULTILIB_DEFAULTS, even
some options are specified in the option list with '!'.
e.g.
We have default march=rv32i and mabi=ilp32.
And we have following multi-lib set:
". !march=rv32i !march=rv32im !march=rv32imafc !mabi=ilp32 !mabi=ilp32f;"
"rv32i/ilp32 march=rv32i !march=rv32im !march=rv32imafc mabi=ilp32 !mabi=ilp32f;"
"rv32im/ilp32 !march=rv32i march=rv32im !march=rv32imafc mabi=ilp32 !mabi=ilp32f;"
"rv32imafc/ilp32f !march=rv32i !march=rv32ic !march=rv32im march=rv32imafc !mabi=ilp32 mabi=ilp32f;"
`-print-multi-lib` willl show `.` and `rv32imafc/ilp32f` only, because
the mabi=ilp32 is matched, however there is `!march=rv32i` in `rv32im/ilp32`, so
`rv32im/ilp32` should keep, because it reject march=rv32i.
Note: This can be reproduced via following configure options with patch [1]:
gcc/configure --target=riscv64-elf --with-arch=rv32i --with-abi=ilp32 \
--with-multilib-generator="rv32i-ilp32--;rv32im-ilp32--;rv32imafc-ilp32f--"
[1] https://gcc.gnu.org/pipermail/gcc-patches/2020-November/559707.html
gcc/ChangeLog:
* gcc.c (print_multilib_info): Check default arguments not
appeared in multi-lib option list with '!'
When substituting a parameter variable of type character, the character
length was reset to 1. Fix this by copying the length.
gcc/fortran/ChangeLog:
* expr.c (simplify_parameter_variable): Fix up character length
after copying an array-valued expression.
gcc/testsuite/ChangeLog:
* gfortran.dg/pr98017.f90: New test.