Skip to content
Snippets Groups Projects
  1. Nov 22, 2022
    • liuhongt's avatar
      Some tidy up for RA related hooks. · 826c22df
      liuhongt authored
      1. We also need to guard size of TO to be
      less than TARGET_SSE2 ? 2 : 4 in ix86_can_change_mode_class.
      2. Merge VALID_AVX512FP16_SCALAR_MODE plus BFmode
      into VALID_AVX512F_SCALAR_MODE since we've support 16-bit data move
      above SSE2, so no need for the condition of AVX512FP16 for those evex
      sse registers.
      3. Allocate DI/HImode to sse register for SSE2 above just like
      SImode since we've supported 16-bit data move between sse and gpr
      above SSE2, this will help RA to handle cases like (subreg:HI (reg:V8HI)
      0) or else RA will spill it. This enable optimization for
      pices-memset-{3,37,39}.c
      
      gcc/ChangeLog:
      
      	* config/i386/i386.cc (ix86_can_change_mode_class): Also guard
      	size of TO.
      	(ix86_hard_regno_mode_ok): Remove VALID_AVX512FP16_SCALAR_MODE
      	* config/i386/i386.h (VALID_AVX512FP16_SCALAR_MODE): Merged to
      	..
      	(VALID_AVX512F_SCALAR_MODE): .. this, also add HImode.
      	(VALID_SSE_REG_MODE): Add DI/HImode.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/i386/pieces-memset-3.c: Remove xfail.
      	* gcc.target/i386/pieces-memset-37.c: Remove xfail.
      	* gcc.target/i386/pieces-memset-39.c: Remove xfail.
      826c22df
    • Jason Merrill's avatar
      c++: contracts fixes · b20a3854
      Jason Merrill authored
      Fixing -Wunused-parm warnings and link errors depending on where -fcontracts
      appears on the command line.
      
      gcc/cp/ChangeLog:
      
      	* contracts.cc (build_contract_condition_function):
      	Set DECL_ARTIFICIAL on return value parm.
      	* g++spec.cc (lang_specific_driver): Add -lstdc++exp
      	just before -lstdc++.
      b20a3854
    • GCC Administrator's avatar
      Daily bump. · 8b7fee1d
      GCC Administrator authored
      8b7fee1d
    • David Malcolm's avatar
      analyzer: fix ICE on 'bind' that returns a struct [PR107788] · 4e4e45a4
      David Malcolm authored
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/107788
      	* region-model.cc (region_model::update_for_int_cst_return):
      	Require that the return type be an integer type.
      	(region_model::update_for_nonzero_return): Likewise.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/107788
      	* g++.dg/analyzer/fd-bind-pr107783.C: New test.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      4e4e45a4
    • David Malcolm's avatar
      analyzer: fix ICE on 'bind' with non-pointer arg [P107783] · 12a4785c
      David Malcolm authored
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/107783
      	* region-model-impl-calls.cc (kf_accept::matches_call_types_p):
      	Require that args 1 and 2 be pointers.
      	(kf_bind::matches_call_types_p): Require that arg 1 be a pointer.
      	* region-model.h (call_details::arg_is_pointer_p): New
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/107783
      	* gcc.dg/analyzer/fd-bind-pr107783.c: New test.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      12a4785c
    • David Malcolm's avatar
      analyzer: fix ICE on writes to errno [PR107777] · 358dab90
      David Malcolm authored
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/107777
      	* call-summary.cc
      	(call_summary_replay::convert_region_from_summary_1): Handle
      	RK_THREAD_LOCAL and RK_ERRNO in switch.
      	* region-model.cc (region_model::get_representative_path_var_1):
      	Likewise.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/107777
      	* gcc.dg/analyzer/call-summaries-errno.c: New test.
      	* gcc.dg/analyzer/errno-pr107777.c: New test.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      358dab90
    • David Malcolm's avatar
      analyzer, testsuite: add more examples taken from CWE · 9ada4596
      David Malcolm authored
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/analyzer/CWE-131-examples.c: New test.
      	* gcc.dg/analyzer/file-CWE-1341-example.c: New test.
      	* gcc.dg/analyzer/malloc-CWE-401-example.c: New test.
      	* gcc.dg/analyzer/malloc-CWE-415-examples.c: New test.
      	* gcc.dg/analyzer/malloc-CWE-416-examples.c: New test.
      	* gcc.dg/analyzer/malloc-CWE-590-examples.c: New test.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      9ada4596
  2. Nov 21, 2022
    • Lewis Hyatt's avatar
      libcpp: Fix paste error with unknown pragma after macro expansion · 6f46d14d
      Lewis Hyatt authored
      In directives.cc, do_pragma() contains logic to handle a case such as the new
      testcase pragma-omp-unknown.c, where an unknown pragma was the result of macro
      expansion (for pragma namespaces that permit expansion). This no longer works
      correctly as shown by the testcase, fixed by adding PREV_WHITE to the flags on
      the second token to prevent an unwanted paste.  Also fixed the memory leak,
      since the temporary tokens are pushed on their own context, nothing prevents
      freeing of the buffer that holds them when the context is eventually popped.
      
      libcpp/ChangeLog:
      
      	* directives.cc (do_pragma): Fix memory leak in token buffer.  Fix
      	unwanted paste between two tokens.
      
      gcc/testsuite/ChangeLog:
      
      	* c-c++-common/gomp/pragma-omp-unknown.c: New test.
      6f46d14d
    • Sebastian Huber's avatar
      RTEMS: Use local-exec TLS model by default · 5c0d171f
      Sebastian Huber authored
      gcc/ChangeLog:
      
      	* config/rtems.h (SUBTARGET_CC1_SPEC): Undef and define.
      5c0d171f
    • Sebastian Huber's avatar
      Allow subtarget customization of CC1_SPEC · 58c3d9cd
      Sebastian Huber authored
      gcc/ChangeLog:
      
      	* gcc.cc (SUBTARGET_CC1_SPEC): Define if not defined.
      	(cc1_spec): Append SUBTARGET_CC1_SPEC.
      58c3d9cd
    • Jonathan Wakely's avatar
      libstdc++: Reduce size of std::bind_front(F) result · cbd05ca5
      Jonathan Wakely authored
      When there are no bound arguments to a std::bind_front call we don't
      need the overhead of compiling, initializing, and accessing an empty
      tuple.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/functional (_Bind_front0): New class template.
      	(_Bind_front_t): Use _Bind_front0 when there are no bound
      	arguments.
      	* testsuite/20_util/function_objects/bind_front/107784.cc:
      	New test.
      cbd05ca5
    • Jonathan Wakely's avatar
      libstdc++: Check static assertions earlier in chrono::duration · ed77dcb9
      Jonathan Wakely authored
      This ensures that we fail a static assertion before giving any other
      errors. Instantiating chrono::duration<int, chrono::seconds> will now
      print this before the other errors caused by it:
      
      error: static assertion failed: period must be a specialization of ratio
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/chrono.h (duration): Check preconditions on
      	template arguments before using them.
      ed77dcb9
    • Jonathan Wakely's avatar
      libstdc++: Improve Doxygen comments in <tuple> · 94f7baf2
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* include/std/tuple: Add better Doxygen comments.
      94f7baf2
    • Dimitar Dimitrov's avatar
      testsuite: Add filter for target socket support · 9fe9dd24
      Dimitar Dimitrov authored
      
      The new analyzer tests for sockets are failing on embedded targets.
      The newlib and avr-libc C libraries do not support sockets.
      
      Testing done:
        - No changes in gcc.sum for x86_64-pc-linux-gnu, with or without this
          patch.
        - Filtered cases are now UNSUPPORTED instead of failing on AVR and PRU
          backends.
      
      gcc/ChangeLog:
      
      	* doc/sourcebuild.texi (sockets): Document new check.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/analyzer/fd-accept.c: Require sockets.
      	* gcc.dg/analyzer/fd-bind.c: Ditto.
      	* gcc.dg/analyzer/fd-connect.c: Ditto.
      	* gcc.dg/analyzer/fd-datagram-socket.c: Ditto.
      	* gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c:
      	Ditto.
      	* gcc.dg/analyzer/fd-glibc-byte-stream-socket.c: Ditto.
      	* gcc.dg/analyzer/fd-glibc-datagram-client.c: Ditto.
      	* gcc.dg/analyzer/fd-glibc-datagram-socket.c: Ditto.
      	* gcc.dg/analyzer/fd-listen.c: Ditto.
      	* gcc.dg/analyzer/fd-manpage-getaddrinfo-client.c: Ditto.
      	* gcc.dg/analyzer/fd-mappage-getaddrinfo-server.c: Ditto.
      	* gcc.dg/analyzer/fd-socket-meaning.c: Ditto.
      	* gcc.dg/analyzer/fd-socket-misuse.c: Ditto.
      	* gcc.dg/analyzer/fd-stream-socket-active-open.c: Ditto.
      	* gcc.dg/analyzer/fd-stream-socket-passive-open.c: Ditto.
      	* gcc.dg/analyzer/fd-stream-socket.c: Ditto.
      	* gcc.dg/analyzer/fd-symbolic-socket.c: Ditto.
      	* lib/target-supports.exp (check_effective_target_sockets): New
      	check.
      
      Signed-off-by: default avatarDimitar Dimitrov <dimitar@dinux.eu>
      9fe9dd24
    • Andrew Carlotti's avatar
      Expand comment for tree_niter_desc.max · f80bfdcc
      Andrew Carlotti authored
      This requirement is enforced by a gcc_checking_assert in
      record_estimate.
      
      gcc/ChangeLog:
      
      	* tree-ssa-loop.h (tree_niter_desc): Update comment.
      f80bfdcc
    • Andrew Carlotti's avatar
      Modify test, to prevent the next patch breaking it · 2aec4088
      Andrew Carlotti authored
      The upcoming c[lt]z idiom recognition patch eliminates the need for a
      brute force computation of the iteration count of these loops. The test
      is intended to verify that ivcanon can determine the loop count when the
      condition is given by a chain of constant computations.
      
      We replace the constant operations with a more complicated chain that should
      resist future idiom recognition.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/pr77975.c: Make tests more robust.
      2aec4088
    • Andrew Carlotti's avatar
      Refactor number_of_iterations_popcount · eea52e38
      Andrew Carlotti authored
      This includes various changes to improve clarity, and to enable the code
      to be more similar to the clz and ctz idiom recognition added in
      subsequent patches.
      
      We create new number_of_iterations_bitcount function, which will be used
      to call the other bit-counting recognition functions added in subsequent
      patches, as well as a generic comment describing the loop structures
      that are common to each idiom. Some of the variables in
      number_of_iterations_popcount are given more descriptive names, and the
      popcount expression builder is extracted into a separate function.
      
      As part of the refactoring, we also fix a bug where the max loop count
      for modes shorter than an integer would be incorrectly computed as if
      the input mode were actually an integer.
      
      We also ensure that niter->max takes into account the final value for
      niter->niter (after any folding and simplifying), since if the latter is a
      constant, then record_estimate mandates that the two values are equivalent.
      
      gcc/ChangeLog:
      
      	* tree-ssa-loop-niter.cc
      	(number_of_iterations_exit_assumptions): Modify to call...
      	(number_of_iterations_bitcount): ...this new function.
      	(number_of_iterations_popcount): Now called by the above.
      	Refactor, and extract popcount expression builder to...
      	(build_popcount_expr): this new function.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/tree-ssa/popcount-max.c: New test.
      eea52e38
    • Andrew Carlotti's avatar
      Remove prototype for number_of_iterations_popcount · fe985a23
      Andrew Carlotti authored
      gcc/ChangeLog:
      
      	* tree-ssa-loop-niter.cc (ssa_defined_by_minus_one_stmt_p): Move
      	(number_of_iterations_popcount): Move, and remove separate prototype.
      fe985a23
    • Andrew Carlotti's avatar
      Ensure at_stmt is defined before an early exit · f0e4f676
      Andrew Carlotti authored
      This prevents a null dereference error when outputing debug information
      following an early exit from number_of_iterations_exit_assumptions.
      
      gcc/ChangeLog:
      
      	* tree-ssa-loop-niter.cc (number_of_iterations_exit_assumptions):
      	Move at_stmt assignment.
      f0e4f676
    • Torbjörn SVENSSON's avatar
      testsuite: Windows paths use \ and not / · 9df85f33
      Torbjörn SVENSSON authored
      
      Without this patch, the following error is reported on Windows:
      
      In file included from t:\build\arm-none-eabi\include\c++\11.3.1\string:54,
                        from t:\build\arm-none-eabi\include\c++\11.3.1\bits\locale_classes.h:40,
                        from t:\build\arm-none-eabi\include\c++\11.3.1\bits\ios_base.h:41,
                        from t:\build\arm-none-eabi\include\c++\11.3.1\ios:42,
                        from t:\build\arm-none-eabi\include\c++\11.3.1\ostream:38,
                        from t:\build\arm-none-eabi\include\c++\11.3.1\iostream:39:
      t:\build\arm-none-eabi\include\c++\11.3.1\bits\range_access.h:36:10: note: include 't:\build\arm-none-eabi\include\c++\11.3.1\initializer_list' translated to import
      arm-none-eabi-g++.exe: warning: .../gcc/testsuite/g++.dg/modules/pr99023_b.X: linker input file unused because linking not done
      FAIL: g++.dg/modules/pr99023_b.X -std=c++2a  dg-regexp 6 not found: "[^\n]*: note: include '[^\n]*/initializer_list' translated to import\n"
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/modules/pr99023_b.X: Match Windows paths too.
      
      Co-Authored-By: default avatarYvan ROUX <yvan.roux@foss.st.com>
      Signed-off-by: default avatarTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
      9df85f33
    • Tobias Burnus's avatar
      libgomp/gcn: fix/improve struct output · 6edcb5dc
      Tobias Burnus authored
      output.printf_data.(value union) contains text[128], which has the size
      of 128 bytes, sufficient for 16 uint64_t variables; hence value_u64[2]
      could be extended to value_u64[6] - sufficient for all required arguments
      to gomp_target_rev.  Additionally, next_output.printf_data.(msg union)
      contained msg_u64 which then is no longer needed and also caused 32bit
      vs 64bit alignment issues.
      
      libgomp/
      	* config/gcn/libgomp-gcn.h (struct output):
      	Remove 'msg_u64' from the union, change
      	value_u64[2] to value_u64[6].
      	* config/gcn/target.c (GOMP_target_ext): Update accordingly.
      	* plugin/plugin-gcn.c (process_reverse_offload, console_output):
      	Likewise.
      6edcb5dc
    • Torbjörn SVENSSON's avatar
      libcpp/remap: Only override if string matched · 711f56ad
      Torbjörn SVENSSON authored
      
      For systems with HAVE_DOS_BASED_FILE_SYSTEM set, only override the
      pointer if the backslash pattern matches.
      
      Output without this patch:
      .../gcc/testsuite/gcc.dg/cpp/pr71681-2.c:5:10: fatal error: a/t2.h: No such file or directory
      
      With patch applied, no output and the test case succeeds.
      
      libcpp/ChangeLog
      
      	* files.cc: Ensure pattern matches before use.
      
      Signed-off-by: default avatarTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
      711f56ad
    • Christophe Lyon's avatar
      genmultilib: Fix sanity check · ccb9c7b1
      Christophe Lyon authored
      My previous patch to add a sanity check to genmultilib actually
      checked the number of dirnames with the number of "sets of options"
      rather than the number of options, thus breaking the build on some
      targets.
      
      To avoid duplicating once more the loop that constructs the sed
      patterns, this patch checks that the current dirname/osdirname is not
      empty in the existing loops.
      
      Are there targets where:
      if [ "$1" != "${opt}" ]; then
      is "legally" executed with an empty $1? (and thus where this patch
      would incorrectly trigger an error?)
      
      Sorry for the breakage. Tested on aarch64 by adding an option to
      t-aarch64 and no corresponding dirname, and on x86_64.
      
      gcc/ChangeLog:
      
      	* genmultilib: Fix options and dirnames/osdirnames sanity check.
      ccb9c7b1
    • Philipp Tomsich's avatar
      RISC-V: Fix ICE in branch<ANYI:mode>_shiftedarith_equals_zero · 4c7d336b
      Philipp Tomsich authored
      With the recent improvements to the splitting of special cases of
      branch patterns on RISC-V, a dependency on an unmerged/in-discussion
      change for branch-equals-zero slipped in: this allowed a non-X mode to
      be presented to branch-equals-zero (where only X mode is permissible).
      
      This addresses the issue by wrapping the ANYI operand in a paradoxical
      SUBREG:X (the high bits can be safely ignored, as we we perform an
      and-immediate before the branch in the pattern).
      
      Tested against the GCC testsuite and committed as obvious.
      
      gcc/ChangeLog:
      
      	PR target/107786
      	* config/riscv/riscv.md
      	(*branch<ANYI:mode>_shiftedarith_equals_zero): Wrap ANYI
      	in a subreg, as our branch instructions only supports X.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/pr107786-2.c: New test.
      	* gcc.target/riscv/pr107786.c: New test.
      4c7d336b
    • Eric Botcazou's avatar
      ada: Adjust recent change for returns involving function calls · 2473f28d
      Eric Botcazou authored
      gcc/ada/
      
      	* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Constant>: Revert
      	latest change.
      	* gcc-interface/trans.cc (gnat_to_gnu) <N_Object_Declaration>:
      	Tweak latest change.
      2473f28d
    • Marc Poulhiès's avatar
      ada: Do not share Packed Array Type if sizes of types differ · a186dd15
      Marc Poulhiès authored
      If a subtype has a Size attribute value different than the size of its
      ancestor, then the Packed Array Type can't be shared and a new one must
      be created.
      
      gcc/ada/
      
      	* exp_pakd.adb (Create_Packed_Array_Impl_Type): Do not share PAT
      	if sizes of types differ.
      a186dd15
    • Ronan Desplanques's avatar
      ada: Order pragmas alphabetically in reference manual · 6f089469
      Ronan Desplanques authored
      gcc/ada/
      
      	* doc/gnat_rm/implementation_defined_pragmas.rst: Restore
      	alphabetical ordering.
      	* gnat_rm.texi: Regenerate.
      	* gnat_ugn.texi: Regenerate.
      6f089469
    • Eric Botcazou's avatar
      ada: Minor tweak in assertion · 5947b1ee
      Eric Botcazou authored
      For an array subtype, being definite is the same as being constrained.
      
      gcc/ada/
      
      	* sem_util.adb (Needs_Secondary_Stack): Test Is_Constrained
      	directly instead of Is_Definite_Subtype for an array subtype.
      5947b1ee
    • Steve Baird's avatar
      ada: Internal compiler error for Sequential Partition_Elaboration_Policy · 24dde337
      Steve Baird authored
      In some cases, compilation of a function with a limited class-wide result
      type could fail with an internal error if a Sequential
      Partition_Elaboration_Policy is specified. To prevent this, we want specifying
      a Sequential Partition_Elaboration_Policy to have the side effect of
      imposing a No_Task_Hierarchy restriction. But doing that in a straightforward
      way leads to problems with incorrectly accepting violations of H.6(6). So
      a new restriction, No_Task_Hierarchy_Implicit, is introduced.
      
      gcc/ada/
      
      	* libgnat/s-rident.ads: Define a new restriction,
      	No_Task_Hierarchy_Implicit. This is like the No_Task_Hierarchy
      	restriction, but with the difference that setting this restriction
      	does not mean the H.6(6) post-compilation check is satisified.
      	* exp_ch6.adb (Add_Task_Actuals_To_Build_In_Place_Call): If it is
      	known that the function result cannot have tasks, then pass in a
      	null literal for the activation chain actual parameter. This
      	avoids generating a reference to an entity that
      	Build_Activation_Chain_Entity may have chosen not to generate a
      	declaration for.
      	* gnatbind.adb (List_Applicable_Restrictions): Do not list the
      	No_Task_Hierarchy_Implicit restriction.
      	* restrict.adb: Special treatment for the
      	No_Task_Hierarchy_Implicit restriction in functions
      	Get_Restriction_Id and Restriction_Active. The former is needed to
      	disallow the (unlikely) case that a user tries to explicitly
      	reference the No_Task_Hierarchy_Implicit restriction.
      	* sem_prag.adb (Analyze_Pragma): If a Sequential
      	Partition_Elaboration_Policy is specified (and the
      	No_Task_Hierarchy restriction is not already enabled), then enable
      	the No_Task_Hierarchy_Implicit restriction.
      24dde337
    • Eric Botcazou's avatar
      ada: Small cleanup in Expand_N_Object_Declaration · dee004a9
      Eric Botcazou authored
      This reuses a local constant more consistently, removes a duplicate of this
      local constant, renames local variables, alphabetizes declarations, makes a
      few consistency tweaks and adjusts a couple of comments.
      
      No functional changes.
      
      gcc/ada/
      
      	* exp_ch3.adb (Expand_N_Object_Declaration): Use Typ local
      	constant throughout, remove Ret_Obj_Typ local constant, rename
      	Ref_Type into Acc_Typ in a couple of places, remove a useless call
      	to Set_Etype, use a consistent checks suppression scheme, adjust
      	comments for the sake of consistencty and alphabetize some local
      	declarations.
      	* exp_ch6.adb (Expand_Simple_Function_Return): Remove a couple of
      	redundant local constants.
      dee004a9
    • Steve Baird's avatar
      ada: Ada 2022 Image attribute bugs · 76aac607
      Steve Baird authored
      Two issues. First, the two procedures
      Ada.Strings.Text_Buffers.Output_Mapping.[Wide_]Wide_Put each correctly
      call Encode, but that call was missing from the corresponding Put procedure.
      Second, if a record type contains an array-valued Data component as well as
      both a Max_Length and Current_Length component, then the slice
      Data (Current_Length + 1 .. Max_Length) should usually be treated like
      uninitialized data. It should not participate in things like equality
      comparisons. In particular, it should not participate in 'Image results.
      To accomplish this, such a type usually ought to have a Put_Image aspect
      specification. This Put_Image aspect specification was missing for the
      three Super_String types declared in the
      Ada.Strings.[Wide_[Wide_]]Superbounded packages.
      
      gcc/ada/
      	* libgnat/a-sttebu.adb (Put): Add missing call to Encode.
      	* libgnat/a-strsup.ads: Declare new Put_Image procedure and add
      	Put_Image aspect specification for type Super_String.
      	* libgnat/a-strsup.adb (Put_Image): New procedure.
      	* libgnat/a-stwisu.ads: Declare new Put_Image procedure and add
      	Put_Image aspect specification for type Super_String.
      	* libgnat/a-stwisu.adb (Put_Image): New procedure.
      	* libgnat/a-stzsup.ads: Declare new Put_Image procedure and add
      	Put_Image aspect specification for type Super_String.
      	* libgnat/a-stzsup.adb (Put_Image): New procedure.
      76aac607
    • Ghjuvan Lacambre's avatar
      ada: Disable subprogram call validation in CodePeer mode · 7dcf757a
      Ghjuvan Lacambre authored
      CodePeer builds with assertions enabled started failing when this
      validation was introduced. We temporarily disable this validation for
      CodePeer in order to buy time before fixing the underlying issue.
      
      gcc/ada/
      
      	* frontend.adb (Frontend): Disable subprogram call validation.
      7dcf757a
    • Bob Duff's avatar
      ada: Move warnings switches · bc50ac71
      Bob Duff authored
      This patch moves warning switches from Opt into Warnsw, fixes some minor
      discrepancies, and cleans up the code.
      
      No change in behavior.
      
      gcc/ada/
      
      	* warnsw.ads, warnsw.adb: Move warning flags here from package
      	Opt. Rename Warning_Record to be Warnings_State. Use an array
      	instead of a record; this simplifies the code. Add renamings of
      	all the array components for easy reference outside this package.
      	Pass the "Family" to Set_Warning_Switch. Use more table-driven
      	code. Misc cleanup and comment fixes.
      	* opt.ads: Move warning switches to Warnsw.
      	* gnat1drv.adb
      	(Adjust_Global_Switches): Expanded names needed.
      	* inline.ads: Rename Warning_Record to be Warnings_State.
      	* sem_ch12.adb: Likewise.
      	* sem_prag.adb: Use new Set_Warning_Switch.
      	* contracts.adb, errout.adb, exp_aggr.adb, exp_ch11.adb: Adjust
      	imports for move to Warnsw.
      	* exp_ch5.adb, exp_prag.adb, exp_util.adb, frontend.adb: Likewise.
      	* layout.adb, lib-xref.adb, restrict.adb, scn.adb, sem_aggr.adb:
      	Likewise.
      	* sem_attr.adb, sem_case.adb, sem_ch10.adb, sem_ch11.adb:
      	Likewise.
      	* sem_ch13.adb, sem_ch3.adb, sem_ch4.adb, sem_ch5.adb: Likewise.
      	* sem_ch6.adb, sem_ch7.adb, sem_ch8.adb, sem_elab.adb: Likewise.
      	* sem_eval.adb, sem_res.adb, sem_util.adb, sem_warn.adb: Likewise.
      	* switch-c.adb: Likewise.
      bc50ac71
    • Steve Baird's avatar
      ada: Improve documentation for -gnatw.h warnings · 84e80d55
      Steve Baird authored
      The -gnatw.h option enables warnings about "gaps" in record layout
      specifications. In the case of a "partial" layout specification, where the
      locations of some components are left unspecified, the resulting warnings
      may be incomplete or incorrect. Document this implementation limitation.
      
      gcc/ada/
      
      	* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Improve
      	the description of how the -gnatw.h switch interacts with
      	"partial" record layout specifications (i.e., specifications where
      	the locations of some components are left unspecified).
      	* gnat_ugn.texi: Regenerate.
      84e80d55
    • Marc Poulhiès's avatar
      ada: Reject nonconfirming Size attribute value for aliased object · 493e760d
      Marc Poulhiès authored
      Only confirming Size must be supported for aliased object of elementary
      type (see RM 13.1 in the "Implementation Advice").
      
         -- size is 1-byte
         type Y is range 0 .. 20;
         type Ay is access all Y;
      
         -- Var size is 8-bytes
         Var : aliased Y := 5 with Size => 64;
      
         --  JP.all is a 1-byte reference to an 8-bytes objects.
         JP : Ay := Var'Access;
      
      The above JP.all references the first byte of the 8-byte Var object,
      which is, for example, not correct on little-endian systems.
      
      This change rejects nonconfirming Size attribute on such objects
      instead of miscompiling it.
      
      gcc/ada/
      
      	* sem_ch13.adb (Check_One_Attr): produce error when Size attribute
      	used on aliased object of elementary types with nonconfirming
      	value.
      493e760d
    • Ronan Desplanques's avatar
      ada: Fix gnatmake's parsing of adc files · 6d0d71ea
      Ronan Desplanques authored
      Before this patch, gnatmake's parser for adc files failed to ignore
      semicolons located inside comments. This patch fixes that behavior.
      
      gcc/ada/
      
      	* sfn_scan.adb (Scan_SFN_Pragmas): Improve handling of comments.
      6d0d71ea
    • Ronan Desplanques's avatar
      ada: Tweak error messages on misplaced with keywords · 8bebbf7b
      Ronan Desplanques authored
      Before this patch, with clauses placed in declarative sections were
      interpreted by the compiler as incorrect aspect specifications, which
      led to confusing error messages.
      
      This patch makes it so more syntax errors involving the with keyword
      are diagnosed as intended with clauses instead of aspect
      specifications.
      
      gcc/ada/
      
      	* par-ch3.adb (P_Declarative_Item): Tweak handling of with keyword.
      8bebbf7b
    • Jakub Jelinek's avatar
      i386: Uglify some local identifiers in *intrin.h [PR107748] · ec8ec09f
      Jakub Jelinek authored
      While reporting PR107748 (where is a problem with non-uglified names,
      but I've left it out because it needs fixing anyway), I've noticed
      various spots where identifiers in *intrin.h headers weren't uglified.
      The following patch fixed those that are related to unions (I've grepped
      for [a-zA-Z]\.[a-zA-Z] spots).
      The reason we need those to be uglified is the same as why the arguments
      of the inlines are __ prefixed and most of automatic vars in the inlines
      - say a, v or u aren't part of implementation namespace and so users could
       #define u whatever->something
       #include <x86intrin.h>
      and it should still work, as long as u is not e.g. one of the names
      of the functions/macros the header provides (_mm* etc.).
      
      2022-11-21  Jakub Jelinek  <jakub@redhat.com>
      
      	PR target/107748
      	* config/i386/avx512fp16intrin.h (_mm512_castph512_ph128,
      	_mm512_castph512_ph256, _mm512_castph128_ph512,
      	_mm512_castph256_ph512, _mm512_set1_pch): Uglify names of local
      	variables and union members.
      	* config/i386/avx512fp16vlintrin.h (_mm256_castph256_ph128,
      	_mm256_castph128_ph256, _mm256_set1_pch, _mm_set1_pch): Likewise.
      	* config/i386/smmintrin.h (_mm_extract_ps): Likewise.
      ec8ec09f
    • Christophe Lyon's avatar
      genmultilib: Add sanity check · f0d3b6e3
      Christophe Lyon authored
      When a list of dirnames is provided to genmultilib, its length is
      expected to match the number of options.  If this is not the case, the
      build fails later for reasons not obviously related to this mistake.
      This patch adds a sanity check to help diagnose such cases.
      
      Tested by adding an option to t-aarch64 and no corresponding dirname,
      with both bash and dash.
      
      v2: do not use arrays (bash feature).
      
      OK for trunk?
      
      gcc/ChangeLog:
      
      	* genmultilib: Add sanity check.
      f0d3b6e3
    • Martin Liska's avatar
      changelog: Fix extra space after tab. · 3d3b561f
      Martin Liska authored
      3d3b561f
Loading