- 16 Jul, 2018 40 commits
-
-
The test program for ppc_float128_hw_available would always return false, since there is a syntax error in that test program. gcc/testsuite/ * lib/target-supports.exp (check_ppc_float128_hw_available): Fix syntax error. From-SVN: r262755
Segher Boessenkool committed -
The current implementation leaves an unnecessary register move. It is easier to just expand things in the expander already. This patch does that. * config/rs6000/rs6000.md (trunc<mode>sf2): Expand truncates of double-double modes to SFmode directly directly. (trunc<mode>sf2_fprs): Delete. From-SVN: r262754
Segher Boessenkool committed -
The libcalls for trunc and extend of a decimal float to a binary float, and vice versa, do not have "2" in the name, although all other such conversions do. * config/rs6000/rs6000.c (init_float128_ibm): Use the correct names for conversions between IFmode and the decimal floating point modes. (init_float128_ieee): Use the correct names for conversions between KFmode and the decimal floating point modes. From-SVN: r262753
Segher Boessenkool committed -
They had source and destination swapped in the name. * config/rs6000/rs6000.c (init_float128_ibm): Use more correct names for the conversions between TDmode and IFmode. (init_float128_ieee): Use more correct names for the conversions between TDmode and KFmode. From-SVN: r262752
Segher Boessenkool committed -
PR tree-optimization/86526 * builtins.c (expand_builtin_memcmp): Formatting fixes. (inline_expand_builtin_string_cmp): Likewise. (inline_string_cmp): Likewise. Use c_readstr instead of builtin_memcpy_read_str. Add unit_mode temporary. * gcc.c-torture/compile/pr86526.c: New test. From-SVN: r262750
Jakub Jelinek committed -
gcc/testsuite/ChangeLog: 2018-07-16 Carl Love <cel@us.ibm.com> * gcc.target/powerpc/divkc3-2.c: Add dg-require-effective-target longdouble128. * gcc.target/powerpc/divkc3-3.c: Ditto. * gcc.target/powerpc/mulkc3-2.c: Ditto. * gcc.target/powerpc/mulkc3-3.c: Ditto. * gcc.target/powerpc/fold-vec-mergehl-double.c: Update counts. * gcc.target/powerpc/pr85456.c: Make check Linux and AIX specific. From-SVN: r262749
Carl Love committed -
2018-07-16 Fritz Reese <fritzoreese@gmail.com> Fix handling of invalid assumed-shape/size arrays in legacy initializer lists. gcc/fortran/ChangeLog: PR fortran/83184 * decl.c (match_old_style_init): Initialize locus of variable expr when creating a data variable. (match_clist_expr): Verify array is explicit shape/size before attempting to allocate constant array constructor. gcc/testsuite/ChangeLog: PR fortran/83184 * gfortran.dg/assumed_rank_14.f90: New testcase. * gfortran.dg/assumed_rank_15.f90: New testcase. * gfortran.dg/dec_structure_8.f90: Update error messages. * gfortran.dg/dec_structure_23.f90: Update error messages. From-SVN: r262744
Fritz Reese committed -
2018-07-16 Fritz Reese <fritzoreese@gmail.com> gcc/fortran/ChangeLog: PR fortran/86417 * module.c (mio_component): Set component->loc when loading from module. From-SVN: r262743
Fritz Reese committed -
re PR middle-end/86528 (strlen of constant string malfunction -- had to back out fix for PR middle-end/77357) gcc: 2018-07-16 Bernd Edlinger <bernd.edlinger@hotmail.de> PR middle-end/86528 * builtins.c (check_access): Bail out if range[0] is no INTEGER_CST. * expr.c (string_constant): Fix the element size of ARRAY_TYPE. testsuite: 2018-07-16 Bernd Edlinger <bernd.edlinger@hotmail.de> PR middle-end/86528 * gcc.c-torture/execute/pr86528.c: New test. * gcc.dg/Wrestrict-10.c (test_arr_strcat_2): Fix typo. From-SVN: r262742
Bernd Edlinger committed -
From-SVN: r262741
Jonathan Wakely committed -
class.c (resolve_address_of_overloaded_function): Don't emit an inform if the matching permerror returns false. /cp 2018-07-16 Paolo Carlini <paolo.carlini@oracle.com> * class.c (resolve_address_of_overloaded_function): Don't emit an inform if the matching permerror returns false. * pt.c (check_specialization_namespace): Likewise. /testsuite 2018-07-16 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/template/spec40.C: New. * g++.dg/parse/ptrmem8.C: Likewise. From-SVN: r262740
Paolo Carlini committed -
The standard doesn't specify this partial specialization (it was required after the changes in N2637 but then should have been removed following LWG 1262). Its presence is observable because it causes different results when operator< has been overloaded for a shared_ptr specialization. PR libstdc++/86537 * include/bits/shared_ptr.h (less<shared_ptr<_Tp>>): Remove non-standard partial specialization. * include/bits/shared_ptr_base.h (_Sp_less): Remove class definition. (less<__shared_ptr<_Tp, _Lp>): Remove partial specialization. * testsuite/20_util/shared_ptr/comparison/86537.cc: New test. From-SVN: r262739
Jonathan Wakely committed -
gcc/ChangeLog: 2018-07-16 Kelvin Nilsen <kelvin@gcc.gnu.org> * doc/extend.texi (PowerPC AltiVec Built-in Functions): Alphabetize prototypes of built-in functions, separating out built-in functions that are listed in this section but should be described elsewhere. From-SVN: r262737
Kelvin Nilsen committed -
PR target/86511 * expmed.c (emit_store_flag): Do not emit setcc followed by a conditional move when trapping comparison was split to a non-trapping one (and vice versa). From-SVN: r262736
Uros Bizjak committed -
From-SVN: r262735
Andreas Krebbel committed -
On i386 the profiler call sequence always consists of 1 call instruction, so -mnop-mcount generates a single nop with the same length as a call. For S/390 longer sequences may be used in some cases, so -mnop-mcount generates the corresponding amount of nops. 2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com> * config/s390/s390.c (s390_function_profiler): Generate nops instead of profiler call sequences. * config/s390/s390.opt: Add the new option. 2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com> * gcc.target/s390/mnop-mcount-m31-fpic.c: New testcase. * gcc.target/s390/mnop-mcount-m31-mzarch.c: New testcase. * gcc.target/s390/mnop-mcount-m31.c: New testcase. * gcc.target/s390/mnop-mcount-m64-mfentry.c: New testcase. * gcc.target/s390/mnop-mcount-m64.c: New testcase. From-SVN: r262734
Ilya Leoshkevich committed -
This is the counterpart of the i386 feature introduced by 39a5a6a4: Add direct support for Linux kernel __fentry__ patching. 2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com> * config/s390/s390.c (s390_function_profiler): Generate __mcount_loc section. * config/s390/s390.opt: Add the new option. 2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com> * testsuite/gcc.target/s390/mrecord-mcount.c: New testcase. From-SVN: r262733
Ilya Leoshkevich committed -
On i386, the difference between mcount and fentry is that fentry comes before the prolog. On s390 mcount already comes before the prolog, but takes 4 instructions. This patch introduces the more efficient implementation (just 1 instruction) and puts it under -mfentry flag. The produced code is compatible only with newer glibc versions, which provide the __fentry__ symbol and do not clobber %r0 when resolving lazily bound functions. Because 31-bit PLT stubs assume %r12 contains GOT address, which is not the case when the code runs before the prolog, -mfentry is allowed only for 64-bit code. Also, code compiled with -mfentry cannot be used for the nested C functions, since they both use %r0. In this case instrumentation is not insterted, and a new warning is issued for each affected nested function. 2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com> * common.opt: Add the new warning. * config/s390/s390.c (s390_function_profiler): Emit "brasl %r0,__fentry__" when -mfentry is specified. (s390_option_override_internal): Disallow -mfentry for 31-bit CPUs. * config/s390/s390.opt: Add the new option. 2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com> * gcc.target/s390/mfentry-m64.c: New testcase. From-SVN: r262732
Ilya Leoshkevich committed -
This patch modifies the analysis of package contracts to split processing which is specific to package instantiations on its own. As a result, the lack of indicator Part_Of can now be properly assessed. ------------ -- Source -- ------------ -- gen_pack.ads generic package Gen_Pack is Pack_Var : Integer := 1; end Gen_Pack; -- gen_wrap.ads with Gen_Pack; generic package Gen_Wrap is Wrap_Var : Integer := 1; package Inst is new Gen_Pack; end Gen_Wrap; -- pack.ads with Gen_Pack; with Gen_Wrap; package Pack with SPARK_Mode => On, Abstract_State => State is procedure Force_Body; private package OK_Inst_1 is new Gen_Pack -- OK with Part_Of => State; -- OK package OK_Inst_2 is new Gen_Pack; -- OK pragma Part_Of (State); -- OK package OK_Inst_3 is new Gen_Wrap -- OK with Part_Of => State; -- OK package OK_Inst_4 is new Gen_Wrap; -- OK pragma Part_Of (State); package Error_Inst_1 is new Gen_Pack; -- Error package Error_Inst_2 is new Gen_Wrap; -- Error end Pack; -- pack.adb package body Pack with SPARK_Mode => On, Refined_State => (State => (OK_Inst_1.Pack_Var, OK_Inst_2.Pack_Var, OK_Inst_3.Wrap_Var, OK_Inst_3.Inst.Pack_Var, OK_Inst_4.Wrap_Var, OK_Inst_4.Inst.Pack_Var)) is procedure Force_Body is null; end Pack; ---------------------------- -- Compilation and output -- ---------------------------- $ gcc -c pack.adb pack.ads:23:12: indicator Part_Of is required in this context (SPARK RM 7.2.6(2)) pack.ads:23:12: "Error_Inst_1" is declared in the private part of package "Pack" pack.ads:24:12: indicator Part_Of is required in this context (SPARK RM 7.2.6(2)) pack.ads:24:12: "Error_Inst_2" is declared in the private part of package "Pack" 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * contracts.adb (Analyze_Contracts): Add specialized processing for package instantiation contracts. (Analyze_Package_Contract): Remove the verification of a missing Part_Of indicator. (Analyze_Package_Instantiation_Contract): New routine. * contracts.ads (Analyze_Package_Contract): Update the comment on usage. * sem_prag.adb (Check_Missing_Part_Of): Ensure that the entity of the instance is being examined when trying to determine whether a package instantiation needs a Part_Of indicator. From-SVN: r262731
Hristian Kirtchev committed -
2018-07-16 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * einfo.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb, inline.adb, sem.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_eval.adb, sem_util.adb: Minor reformatting. From-SVN: r262730
Hristian Kirtchev committed -
2018-07-16 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * frontend.adb: Only unnest subprograms if no previous errors were detected. From-SVN: r262729
Arnaud Charlet committed -
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle loops that contain blocks in the elaboration code for a package body. Create the elaboration subprogram wrapper only if there is a subprogram declaration in a block or loop. From-SVN: r262728
Ed Schonberg committed -
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_ch4.adb (Expand_Set_Membership): Use New_Copy_Tree to perform a deep copy of the left operand when building each conjuct of the expanded membership operation, to avoid sharing nodes between them. This sharing interferes with the unnesting machinery and is generally undesirable. From-SVN: r262727
Ed Schonberg committed -
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_unst.adb (Visit_Node): Handle 'Address references that are calls. From-SVN: r262726
Ed Schonberg committed -
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_unst.adb (Visit_Node): Handle the semantic of Storage_Pool field in relevant nodes: Allocate, Free, and return statements. From-SVN: r262725
Ed Schonberg committed -
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch12.adb (Analyze_Package_Instantiation): Handle properly an instance that carries an aspect Default_Storage_Pool that overrides a default storage pool that applies to the generic unit. The aspect in the generic unit was removed before copying it in the instance, rather than removing it from the copy of the aspects that are appended to the aspects in the instance. From-SVN: r262724
Ed Schonberg committed -
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * einfo.adb (Set_Is_Uplevel_Referenced_Entity): Flag can appear on loop parameters. * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle subprogram bodies. * exp_ch9.adb (Reset_Scopes_To): Set the scopes of entities local to an entry body to be the corresponding generated subprogram, for correct analysis of uplevel references. * exp_unst.adb (Visit_Node): Handle properly binary and unary operators Ignore pragmas, fix component associations. (Register_Subprograms): Subprograms in synchronized types must be treated as reachable. From-SVN: r262723
Ed Schonberg committed -
This patch corrects the mechanism which ensures that a package with a null Abstract_State does not introduce hidden state, by ignoring internal states and variables because they do not represent the "source" hidden state. 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * sem_util.adb (Check_No_Hidden_State): Ignore internally-generated states and variables. gcc/testsuite/ * gnat.dg/abstract_state1.adb, gnat.dg/abstract_state1.ads: New testcase. From-SVN: r262722
Hristian Kirtchev committed -
The Withed_Body field was added to N_With_Clause node to help the Walk_Library_Items routine, which was created for the CodePeer backend and later adopted by the GNATprove. This routine is meant to traverse all library units, such that declarations are visited before references. However, for complex units (in particular, with generics and child packages) it never worked reliably and backends developed their own workarounds. This patch deconstructs the field, as it hasn't been used for years. Semantics unaffected; no test provided. 2018-07-16 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sinfo.ads, sinfo.adb (Withed_Body): Remove. (Set_Withed_Body): Remove. From-SVN: r262721
Piotr Trojanek committed -
The debug switch -gnatd.WW enables extra info when traversing library units with Walk_Library_Items, which is used in the CodePeer and GNATprove. This routine was crashing when trying to print info about a unit with configuration pragmas (typically an .adc file). Now fixed. No test, as the crash only happens when a GNATprove backend is manually called with -gnatd.WW switch. Frontend is not affected. 2018-07-16 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem.adb (Walk_Library_Items): Skip units with configuration pragmas when printing debug info. From-SVN: r262720
Piotr Trojanek committed -
Cleanup only; semantics unaffected. 2018-07-16 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem.adb (Walk_Library_Items): Reuse local constant. (Is_Subunit_Of_Main): Turn condition to positive and flip the IF-THEN-ELSE branches; avoid potentially ineffective assignment to the Lib variable. From-SVN: r262719
Piotr Trojanek committed -
We previously removed the calls to Set_Withed_Body; this commit deconstructs calls to Withed_Body, which always returned False. The Set_Withed_Body/Withed_Body were helping the Walk_Library_Items routine traverse the AST of several compilation units such that declarations are visited before references. However, this never worked as it should and there is no point to keep the code more complicated than necessary. No test provided, because thie removed code was ineffective (and only used in the non-compiler backends, i.e. CodePeer and GNATprove). 2018-07-16 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem.adb (Walk_Library_Items): Deconstruct dead code. From-SVN: r262718
Piotr Trojanek committed -
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_ch4.adb (Expand_N_Op_Xor): Use common routine Expand_Nonbinary_Modular_Op. Needed for unnesting. From-SVN: r262717
Ed Schonberg committed -
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch3.adb (Inherit_Predicate_Flags): A non-discrete type may have a static predicate (for example True) but has no static_discrete_predicate. From-SVN: r262716
Ed Schonberg committed -
This patch corrects the generation of helper functions which verify the validity of record type scalar discriminants and scalar components when switches -gnata (assertions enabled) and -gnateV (validity checks on subprogram parameters) are in effect. 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * exp_attr.adb (Build_Record_VS_Func): Handle corner cases dealing with class-wide types and record extensions. gcc/testsuite/ * gnat.dg/validity_check3.adb, gnat.dg/validity_check3.ads: New testcase. From-SVN: r262715
Hristian Kirtchev committed -
This patch corrects an issue whereby spurious unhandled exception warnings on integer literals within static if and case expressions would be emitted when the restriction No_Exception_Propagation is enabled. ------------ -- Source -- ------------ -- gnat.adc pragma Restrictions (No_Exception_Propagation); pragma SPARK_Mode (On); -- pack.ads package Pack is procedure Filter (Ret : out Integer); end Pack; -- pack.adb package body Pack is subtype Nat is Integer range 0 .. 10; Default : constant Nat := 1; User_Override : constant Integer := -1; procedure Filter (Ret : out Integer) is Val : constant Nat := (if User_Override in Nat then User_Override else Default); begin Ret := Val; end Filter; end Pack; ---------------------------- -- Compilation and output -- ---------------------------- & gcc -c -gnatp -gnatwa pack.adb 2018-07-16 Justin Squirek <squirek@adacore.com> gcc/ada/ * sem_eval.adb (Eval_Integer_Literal): Add exception for avoiding checks on expanded literals within if and case expressions. From-SVN: r262714
Justin Squirek committed -
This patch updates the routines which produce Wide_String and Wide_Wide_String from a String to construct a result of the proper maximum size which is later sliced. 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * libgnat/s-wchwts.adb (Wide_String_To_String): Use the appropriate longest sequence factor. Code clean up. (Wide_Wide_String_To_String): Use the appropriate longest sequence factor. Code clean up. gcc/testsuite/ * gnat.dg/wide_wide_value1.adb: New testcase. From-SVN: r262713
Hristian Kirtchev committed -
This patch allows the compiler to report an error on Bit_Order when defined for a record extension. 2018-07-16 Javier Miranda <miranda@adacore.com> gcc/ada/ * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Report an error on Bit_Order when defined for a record extension. gcc/testsuite/ * gnat.dg/bit_order1.adb: New testcase. From-SVN: r262712
Javier Miranda committed -
2018-07-16 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/s-objrea.ads: Minor code clean up. From-SVN: r262711
Arnaud Charlet committed -
Rules in SPARK RM 7.1.3 were renumbered when adding support for tasking, but references in the comments were not updated. Now fixed. 2018-07-16 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem_ch3.adb (Process_Discriminants): Adjust reference to the SPARM RM rule. From-SVN: r262710
Piotr Trojanek committed
-