aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2020-11-25[Ada] Simplify Ekind tests with wrappers and membership testsPiotr Trojanek1-13/+10
gcc/ada/ * einfo.adb: Use composite wrappers (e.g. Is_Subprogram_Or_Entry) and membership tests where it appears to improve clarity.
2020-11-25[Ada] Simplify Is_Standard_xxx_Type routines with membership testsPiotr Trojanek1-31/+9
gcc/ada/ * einfo.adb (Is_Standard_Character_Type, Is_Standard_String_Type): Simplify. (Last_Formal): Use procedural variant of Next_Formal.
2020-11-25[Ada] Consistently use explicit Entity_Id type instead of aliasPiotr Trojanek1-11/+11
gcc/ada/ * einfo.adb: Replace "E" with Entity_Id in local object declarations.
2020-11-25[Ada] Don't constant-fold renamed qualified expressionsSteve Baird1-1/+43
gcc/ada/ * exp_ch2.adb (Expand_Entity_Reference): A new local predicate Is_Object_Renaming_Name indicates whether a given expression occurs (after looking through qualified expressions and type conversions) as the name of an object renaming declaration. If Current_Value is available but this new predicate is True, then ignore the availability of Current_Value.
2020-11-25[Ada] Remove dead and duplicated diagnostics for generic access typesPiotr Trojanek1-18/+3
gcc/ada/ * sem_ch12.adb (Instantiate_Type): Remove extra whitespace. (Validate_Access_Type_Instance): Remove dead (and duplicated) code.
2020-11-25[Ada] Remove hyphens in two cases of "side-effect" used as a nounGary Dismukes1-2/+2
gcc/ada/ * exp_util.adb (Possible_Side_Effect_In_SPARK): Replace hyphen with a space in "side-effect" (two instances).
2020-11-25[Ada] Crash on right shift operator for signed integersJustin Squirek3-8/+22
gcc/ada/ * doc/gnat_rm/intrinsic_subprograms.rst (Shifts and Rotates): Document behavior on negative numbers * gnat_rm.texi: Regenerate. * sem_eval.adb (Fold_Shift): Set modulus to be based on the RM size for non-modular integer types.
2020-11-25[Ada] Reinstate utime based code for vx6 in __gnat_copy_attribsOlivier Hainque1-1/+16
gcc/ada/ * adaint.c (__gnat_copy_attribs): Reinstate code based on utime for timestamp processing on VxWorks 6.
2020-11-25[Ada] Minimize side-effect removal in GNATprove modeYannick Moy3-13/+34
gcc/ada/ * exp_util.adb (Remove_Side_Effects): Only remove side-effects in GNATprove mode when this is useful. * sem_res.adb (Set_Slice_Subtype): Make sure in GNATprove mode to define the Itype when needed, so that run-time errors can be analyzed. * sem_util.adb (Enclosing_Declaration): Correctly take into account renaming declarations.
2020-11-25[Ada] Adjust support for 128-bit integer types in System.Random_NumbersEric Botcazou1-0/+35
gcc/ada/ * libgnat/s-rannum.adb (Random_Discrete): Specifically deal with the case where the size of the base type is larger than 64 bits.
2020-11-25[Ada] Fix internal compilation error on circular type in SPARK codeYannick Moy1-2/+2
gcc/ada/ * sem_ch3.adb (Access_Type_Declaration): Set Etype before checking for volatility compatibility.
2020-11-25[Ada] Add support for 128-bit integer types to GNAT.Random_NumbersEric Botcazou2-2/+16
gcc/ada/ * libgnat/g-rannum.ads (Random): New functions returning 128-bit. * libgnat/g-rannum.adb (Random): Implement them and alphabetize. (To_Signed): New unchecked conversion function for 128-bit.
2020-11-25[Ada] Allow debugging finalization-related expanded codeArnaud Charlet1-1/+33
gcc/ada/ * exp_ch7.adb (Build_Finalization_Master, Build_Finalizer, Build_Object_Declarations, Make_Deep_Array_Body, Wrap_Transient_Expression): Call Set_Debug_Info_Needed on temporaries when Debug_Generated_Code is True.
2020-11-25[Ada] Unrecursify Set_Digit/Set_Image_Unsigned procedureLiaiss Merzougue2-36/+50
gcc/ada/ * libgnat/s-imagei.adb (Set_Digits): Rewrite the procedure to remove recursion. (Image_Integer, Set_Image_Integer): Update assertions and remove redundant ones. * libgnat/s-imageu.adb (Set_Image_Unsigned): Rewrite the procedure to remove recursion.
2020-11-25[Ada] Remove repeated calls to Attribute_NamePiotr Trojanek2-11/+11
gcc/ada/ * exp_util.adb (Attribute_Constrained_Static_Value): Fix body box. * sem_attr.adb (Eval_Attribute): Replace repeated calls to Attribute_Name with a captured value of the Attribute_Id; also, remove extra parens around Is_Generic_Type.
2020-11-25[Ada] Fix crash on invalid `pragma Profile`Ghjuvan Lacambre1-1/+5
gcc/ada/ * sem_prag.adb (Analyze_Pragma): Emit error on wrong argument nkind.
2020-11-25[Ada] Reuse Is_Named_Number where possiblePiotr Trojanek2-2/+2
gcc/ada/ * sem_attr.adb, sem_prag.adb: Use Is_Named_Number.
2020-11-25[Ada] Fix style and typos in code for expanding attribute referencesPiotr Trojanek2-34/+33
gcc/ada/ * exp_attr.adb, exp_util.adb: Fix style and typos in comments.
2020-11-25[Ada] Minor refine type of a counter variablePiotr Trojanek1-2/+2
gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference): A variable that is only incremented in the code has now type Nat; conversion is now unnecessary.
2020-11-25arm: Add test that was missing from old commit [PR91816]Stam Markianos-Wright1-0/+63
A while back I submitted GCC10 commit: 44f77a6dea2f312ee1743f3dde465c1b8453ee13 for PR91816. Turns out I was an idiot and forgot to include the test in the actual git commit. Tested that the test still passes on a cross arm-none-eabi and also in a Cortex A-15 bootstrap with no regressions. gcc/testsuite/ChangeLog: PR target/91816 * gcc.target/arm/pr91816.c: New test.
2020-11-25middle-end: Reject flexible array members in __builtin_clear_padding [PR97943]Jakub Jelinek5-1/+85
As mentioned in the PR, we currently ICE on flexible array members in structs and unions during __builtin_clear_padding processing. Jason said in the PR he'd prefer an error in these cases over forcefully handling it as [0] arrays (everything is padding then) or consider the arrays to have as many whole elements as would fit into the tail padding. So, this patch implements that. 2020-11-25 Jakub Jelinek <jakub@redhat.com> PR middle-end/97943 * gimple-fold.c (clear_padding_union, clear_padding_type): Error on and ignore flexible array member fields. Ignore fields with error_mark_node type. * c-c++-common/builtin-clear-padding-2.c: New test. * c-c++-common/builtin-clear-padding-3.c: New test. * g++.dg/ext/builtin-clear-padding-1.C: New test. * gcc.dg/builtin-clear-padding-2.c: New test.
2020-11-25Daily bump.GCC Administrator7-1/+442
2020-11-24PR c/97955 - ICE in build_array_type_1 on invalid redeclaration of function ↵Martin Sebor2-2/+9
with VLA parameter gcc/c-family/ChangeLog: * c-warn.c (warn_parm_array_mismatch): Avoid invalid redeclarations. gcc/testsuite/ChangeLog: * gcc.dg/pr97955.c: New test.
2020-11-24Add a note.Martin Sebor1-1/+1
gcc/testsuite/ChangeLog: * gcc.dg/Wstringop-overflow-47.c: Add a note.
2020-11-24c++: ICE with int{} in template. [PR97899]Jason Merrill2-0/+14
split_nonconstant_init_1 was confused by a CONSTRUCTOR with non-aggregate type, which (with COMPOUND_LITERAL_P set) we use in a template to represent a braced functional cast. It seems to me that there's no good reason to do split_nonconstant_init at all in a template. gcc/cp/ChangeLog: PR c++/97899 * typeck2.c (store_init_value): Don't split_nonconstant_init in a template. gcc/testsuite/ChangeLog: PR c++/97899 * g++.dg/cpp0x/initlist-template3.C: New test.
2020-11-24Revert: "Fix -ffast-math flags handling inconsistencies"Ulrich Weigand2-35/+29
This reverts commit c4fa3728ab4f78984a549894e0e8c4d6a253e540, which caused a regression in the default for flag_excess_precision. 2020-11-24 Ulrich Weigand <uweigand@de.ibm.com> gcc/ PR tree-optimization/97970 * doc/invoke.texi (-ffast-math): Revert last change. * opts.c: Revert last change.
2020-11-24Adjust regex pattern to expect an additional attribute and function return typeMartin Sebor1-8/+8
gcc/testsuite/ChangeLog: * gfortran.dg/gomp/declare-target-4.f90: Adjust pattern to expect an additional attribute and function return type.
2020-11-24[PR97933] LRA: find correctly last empty dest block.Vladimir N. Makarov1-5/+3
gcc/ 2020-11-24 Vladimir Makarov <vmakarov@redhat.com> PR bootstrap/97933 * lra.c (lra_process_new_insns): Stop on the first real insn after head of e->dest.
2020-11-24arm: correctly handle negating INT_MIN in arm_split_atomic_op [PR97534]Richard Earnshaw2-1/+10
arm_split_atomic_op handles subtracting a constant by converting it into addition of the negated constant. But if the type of the operand is int and the constant is -1 we currently end up generating invalid RTL which can lead to an abort later on. The problem is that in a HOST_WIDE_INT, INT_MIN is represented as 0xffffffff80000000 and the negation of this is 0x0000000080000000, but that's not a valid constant for use in SImode operations. The fix is straight-forward which is to use gen_int_mode rather than simply GEN_INT. This knows how to correctly sign-extend the negated constant when this is needed. gcc/ PR target/97534 * config/arm/arm.c (arm_split_atomic_op): Use gen_int_mode when negating a const_int. gcc/testsuite * gcc.dg/pr97534.c: New test.
2020-11-24aarch64: Fix aapcs64 testsuite failuresRichard Sandiford2-2/+2
Various aapcs64 tests were failing at -O1 and above because the assignments to testfunc_ptr were being deleted as dead. That in turn happened because FUNC_VAL_CHECK hid the tail call to myfunc using an LR asm trick: asm volatile ("mov %0, x30" : "=r" (saved_return_address)); asm volatile ("mov x30, %0" : : "r" ((unsigned long long) myfunc)); and so the compiler couldn't see any calls that might read testfunc_ptr. That in itself could be fixed by adding a memory clobber to the second asm above, forcing the compiler to keep both the testfunc_ptr and the saved_return_address assignments. But since this is an ABI test, it seems better to make sure that we don't do any IPA at all. The fact that doing IPA caused a problem was kind-of helpful and so it might be better to avoid making the test “work” in the presence of IPA. The patch therefore just replaced “noinline” with “noipa”. gcc/testsuite/ * gcc.target/aarch64/aapcs64/abitest.h (FUNC_VAL_CHECK): Use noipa rather than noinline. * gcc.target/aarch64/aapcs64/abitest-2.h (FUNC_VAL_CHECK): Likewise.
2020-11-24IBM Z: Restrict vec_cmp<m><n> on z13Ilya Leoshkevich1-1/+1
Commit 5d9ade39b872 ("IBM Z: Fix PR97326: Enable fp compares in vec_cmp") made it possible to create rtxes that describe signaling comparisons on z13, which are not supported by the hardware. Restrict this by using vcond_comparison_operator predicate. gcc/ChangeLog: 2020-11-24 Ilya Leoshkevich <iii@linux.ibm.com> * config/s390/vector.md: Use vcond_comparison_operator predicate.
2020-11-24IBM Z: Update autovec-*-quiet-uneq expectationsIlya Leoshkevich2-2/+8
Commit 229752afe315 ("VEC_COND_EXPR optimizations") has improved code generation: we no longer need "vx x,x,-1", which turned out to be superfluous. Instead, we simply swap 0 and -1 arguments of the preceding "vsel". gcc/testsuite/ChangeLog: 2020-11-23 Ilya Leoshkevich <iii@linux.ibm.com> * gcc.target/s390/zvector/autovec-double-quiet-uneq.c: Expect that "vx" is not emitted. * gcc.target/s390/zvector/autovec-float-quiet-uneq.c: Likewise.
2020-11-24Fix -ffast-math flags handling inconsistenciesUlrich Weigand2-29/+35
This patch implements the following set of changes: 1. If a component flag of -ffast-math (or -funsafe-math-optimizations) is explicitly set (or reset) on the command line, this should override any implicit change due to -f(no-)fast-math, no matter in which order the flags come on the command line. This change affects all flags. 2. Any component flag modified from its default by -ffast-math should be reset to the default by -fno-fast-math. This was previously not done for the following flags: -fcx-limited-range -fexcess-precision= 3. Once -ffinite-math-only is true, the -f(no-)signaling-nans flag has no meaning (if we have no NaNs at all, it does not matter whether there is a difference between quiet and signaling NaNs). Therefore, it does not make sense for -ffast-math to imply -fno-signaling-nans. (This is also a documentation change.) 4. -ffast-math is documented to imply -fno-rounding-math, however the latter setting is the default anyway; therefore it does not make sense to try to modify it from its default setting. 5. The __FAST_MATH__ preprocessor macro should be defined if and only if all the component flags of -ffast-math are set to the value that is documented as the effect of -ffast-math. The following flags were currently *not* so tested: -fcx-limited-range -fassociative-math -freciprocal-math -frounding-math (Note that we should still *test* for -fno-rounding-math here even though it is not set as to 4. -ffast-math -frounding-math should not set the __FAST_MATH__ macro.) This is also a documentation change. 2020-11-24 Ulrich Weigand <uweigand@de.ibm.com> gcc/ * doc/invoke.texi (-ffast-math): Remove mention of -fno-signaling-nans. Clarify conditions when __FAST_MATH__ preprocessor macro is defined. * opts.c (common_handle_option): Pass OPTS_SET to set_fast_math_flags and set_unsafe_math_optimizations_flags. (set_fast_math_flags): Add OPTS_SET argument, and use it to avoid setting flags already explicitly set on the command line. In the !set case, also reset x_flag_cx_limited_range and x_flag_excess_precision. Never reset x_flag_signaling_nans or x_flag_rounding_math. (set_unsafe_math_optimizations_flags): Add OPTS_SET argument, and use it to avoid setting flags already explicitly set on the command line. (fast_math_flags_set_p): Also test x_flag_cx_limited_range, x_flag_associative_math, x_flag_reciprocal_math, and x_flag_rounding_math.
2020-11-24[Ada] Fix inconsistent parameter of SPARK_Msg_NEPiotr Trojanek1-1/+1
gcc/ada/ * sem_prag.adb (Analyze_Global_Item): Call SPARK_Msg_NE with the entity, not with its identifier.
2020-11-24[Ada] Cannot process -S -o with GNAT LLVMArnaud Charlet3-0/+8
gcc/ada/ * opt.ads (Generate_Asm): New flag. * osint-c.adb (Set_Output_Object_File_Name): Accept any extension when generating assembly. * adabkend.adb (Scan_Compiler_Args): Recognize -S.
2020-11-24[Ada] Reuse Is_Packed_Array where possiblePiotr Trojanek7-21/+12
gcc/ada/ * exp_attr.adb, exp_ch4.adb, exp_intr.adb, sem_ch8.adb, sem_res.adb, sem_type.adb, sem_util.adb: Reuse Is_Packed_Array.
2020-11-24[Ada] Fix minor typos in commentsPiotr Trojanek2-2/+2
gcc/ada/ * checks.adb (Apply_Access_Check): Remove unbalanced paren. * exp_attr.adb (Expand_N_Attribute_Reference): Fix typo in comment.
2020-11-24[Ada] Compiler crash on assertion pragma in ghost regionJustin Squirek1-0/+6
gcc/ada/ * sem_prag.adb (Analyze_Pragma): Mark relevant pragmas as ghost when they are within a ghost region.
2020-11-24[Ada] Reuse In_Same_List where possiblePiotr Trojanek4-10/+7
gcc/ada/ * contracts.adb, freeze.adb, sem_ch12.adb, sem_prag.adb: Reuse In_Same_List.
2020-11-24[Ada] Simplify Is_Loop_PragmaPiotr Trojanek1-6/+4
gcc/ada/ * sem_prag.adb (Is_Loop_Pragma): Avoid repeated calls to Original_Node; remove unnecessary IF statement.
2020-11-24[Ada] Replace chained if-then-elsif with case stmt for attribute idsPiotr Trojanek1-83/+87
gcc/ada/ * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Rewrite with a CASE statement.
2020-11-24[Ada] Cleanup expansion of attribute ConstrainedPiotr Trojanek2-9/+4
gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference): Replace calls to Sloc with a local constant Loc; remove call to Analyze_And_Resolve and return, which is exactly what happens anyway (and other branches in the Constrained declare block appear to rely on analysis, resolution and returning happening in all cases). * sem_util.adb: Remove useless parens.
2020-11-24[Ada] Recognize delta and extension aggregates as objectsPiotr Trojanek1-1/+4
gcc/ada/ * sem_util.adb (Is_Object_Reference): Delta and extension aggregates are objects.
2020-11-24[Ada] Implement No_Unrecognized_{Aspects,Pragmas} restrictionsGhjuvan Lacambre5-26/+56
gcc/ada/ * libgnat/s-rident.ads (System.Rident): Register new restriction IDs. * par-ch13.adb (Get_Aspect_Specifications): Add restriction check. * par-prag.adb (Process_Restrictions_Or_Restriction_Warnings): Register No_Unrecognized_Aspects restriction. * sem_prag.adb (Analyze_Pragma): Add restriction check. * snames.ads-tmpl: Create restriction names.
2020-11-24[Ada] Accept local objects in the prefix of attribute Loop_EntryPiotr Trojanek1-1/+5
gcc/ada/ * sem_attr.adb (Declared_Within): Return True for objects declared within the attribute Loop_Entry prefix itself.
2020-11-24[Ada] Fix crash in GNATprove on inlined subprogram in default expressionYannick Moy1-1/+1
gcc/ada/ * sem_ch3.adb (Process_Discriminants): Correctly set right context for analyzing default value of discriminant.
2020-11-24[Ada] Wrong resolution of universal_access = operatorsArnaud Charlet1-24/+88
gcc/ada/ * sem_type.adb (Add_One_Interp.Is_Universal_Operation): Account for universal_access = operator. (Disambiguate): Take into account preference on universal_access = operator when relevant. (Disambiguate.Is_User_Defined_Anonymous_Access_Equality): New.
2020-11-24[Ada] Premature finalization on build in place return and case expressionArnaud Charlet2-4/+37
gcc/ada/ * exp_util.adb (Is_Finalizable_Transient): Take into account return statements containing N_Expression_With_Actions. Also clean up a condition to make it more readable. * exp_ch6.adb: Fix typo.
2020-11-24[Ada] Small cleanup in the Ada.Text_IO hierarchyEric Botcazou16-114/+66
gcc/ada/ * libgnat/a-wtdeio.adb (TFT): Delete and adjust throughout. * libgnat/a-wtenau.adb (TFT): Likewise. * libgnat/a-wtfiio.adb (TFT): Likewise. * libgnat/a-wtflio.adb (TFT): Likewise. * libgnat/a-wtinio.adb (TFT): Likewise. * libgnat/a-wtinio__128.adb (TFT): Likewise. * libgnat/a-wtmoio.adb (TFT): Likewise. * libgnat/a-wtmoio__128.adb (TFT): Likewise. * libgnat/a-ztdeio.adb (TFT): Likewise. * libgnat/a-ztenau.adb (TFT): Likewise. * libgnat/a-ztfiio.adb (TFT): Likewise. * libgnat/a-ztflio.adb (TFT): Likewise. * libgnat/a-ztinio.adb (TFT): Likewise. * libgnat/a-ztinio__128.adb (TFT): Likewise. * libgnat/a-ztmoio.adb (TFT): Likewise. * libgnat/a-ztmoio__128.adb (TFT): Likewise.
2020-11-24[Ada] AI12-0394 Named Numbers and User-Defined Numeric LiteralsArnaud Charlet10-55/+161
gcc/ada/ * sem_ch13.adb (Validate_Literal_Aspect): Add support for named numbers and in particular overload of the Real_Literal function. * sem_res.adb (Resolve): Add support for named numbers in Real_Literal and Integer_Literal resolution. * einfo.adb, einfo.ads (Related_Expression, Set_Related_Expression): Allow E_Function. * uintp.ads (UI_Image_Max): Bump size of buffer to avoid loosing precision. * sem_eval.adb: Fix typo in comment. * libgnat/a-nbnbin.adb, libgnat/a-nbnbin.ads (From_String): Return a Valid_Big_Integer. * libgnat/a-nbnbre.adb, libgnat/a-nbnbre.ads (From_String): New variant taking two strings. Return a Valid_Big_Real.