Skip to content
Snippets Groups Projects
  1. Feb 27, 2025
    • Jakub Jelinek's avatar
      gimple-range-phi: Fix comment typo · fc605b05
      Jakub Jelinek authored
      During reading of this file I've noticed a typo in the comment, which
      this patch fixes.
      
      2025-02-27  Jakub Jelinek  <jakub@redhat.com>
      
      	* gimple-range-phi.cc (phi_analyzer::process_phi): Fix comment typo,
      	dpoesn;t -> doesn't.
      fc605b05
    • Jakub Jelinek's avatar
      Makefile: Link in {simple,lazy}-diagnostic-path.o [PR116143] · fb684f16
      Jakub Jelinek authored
      Some of the plugin.exp tests FAIL in --enable-checking=release builds while
      they succeed in --enable-checking=yes builds.
      Initially I've changed some small simple out of line methods into inline ones
      in the header, but the tests kept failing, just with different symbols.
      
      The _ZN22simple_diagnostic_path9add_eventEmP9tree_nodeiPKcz symbol (and the
      others too) are normally emitted in simple-diagnostic-path.o, it isn't some
      fancy C++ optimization of classes with final method or LTO optimization.
      
      The problem is that simple-diagnostic-path.o is like most objects added into
      libbackend.a and we then link libbackend.a without -Wl,--whole-archive ...
      -Wl,--no-whole-archive around it (and can't easily, not all system compilers
      and linkers will support that).
      With --enable-checking=yes simple-diagnostic-path.o is pulled in, because
      selftest-run-tests.o calls simple_diagnostic_path_cc_tests and so
      simple-diagnostic-path.o is linked in.
      With --enable-checking=release self-tests aren't done and nothing links in
      simple-diagnostic-path.o, because nothing in the compiler proper needs
      anything from it, only the plugin tests.
      
      Using -Wl,-M on cc1 linking, I see that in --enable-checking=release
      build
      analyzer/analyzer-selftests.o
      digraph.o
      dwarf2codeview.o
      fibonacci_heap.o
      function-tests.o
      hash-map-tests.o
      hash-set-tests.o
      hw-doloop.o
      insn-peep.o
      lazy-diagnostic-path.o
      options-urls.o
      ordered-hash-map-tests.o
      pair-fusion.o
      print-rtl-function.o
      resource.o
      rtl-tests.o
      selftest-rtl.o
      selftest-run-tests.o
      simple-diagnostic-path.o
      splay-tree-utils.o
      typed-splay-tree.o
      vmsdbgout.o
      aren't linked into cc1 (the *test* for obvious reasons of not doing
      selftests, pair-fusion.o because it is aarch64 specific, hw-doloop.o because
      x86 doesn't have doloop opts, vmsdbgout.o because not on VMS).
      
      So, the question is if and what from digraph.o, fibinacci_heap.o,
      hw-doloop.o, insn-peep.o, lazy-diagnostic-path.o, options-urls.o,
      pair-fusion.o, print-rtl-function.o, resource.o, simple-diagnostic-path.o,
      splay-tree-utils.o, typed-splay-tree.o are supposed to be part of the
      plugin API if anything and how we arrange for those to be linked in when
      plugins are enabled.
      
      The following patch just adds unconditionally the
      {simple,lazy}-diagnostic-path.o objects to the link lines before libbackend.a
      so that their content is available to plugin users.
      
      2025-02-27  Jakub Jelinek  <jakub@redhat.com>
      
      	PR testsuite/116143
      	* Makefile.in (EXTRA_BACKEND_OBJS): New variable.
      	(BACKEND): Use it before libbackend.a.
      fb684f16
    • Jakub Jelinek's avatar
      alias: Perform offset arithmetics in poly_offset_int rather than poly_int64 [PR118819] · b570f48c
      Jakub Jelinek authored
      This PR is about ubsan error on the c - cx1 + cy1 evaluation in the first
      hunk.
      
      The following patch hopefully fixes that by doing the additions/subtractions
      in poly_offset_int rather than poly_int64 and then converting back to poly_int64.
      If it doesn't fit, -1 is returned (which means it is unknown if there is a conflict
      or not).
      
      2025-02-27  Jakub Jelinek  <jakub@redhat.com>
      
      	PR middle-end/118819
      	* alias.cc (memrefs_conflict_p): Perform arithmetics on c, xsize and
      	ysize in poly_offset_int and return -1 if it is not representable in
      	poly_int64.
      b570f48c
    • GCC Administrator's avatar
      Daily bump. · edd9ad2a
      GCC Administrator authored
      edd9ad2a
  2. Feb 26, 2025
    • Patrick Palka's avatar
      libstdc++: Add code comment documenting LWG 4027 change [PR118083] · 640697f7
      Patrick Palka authored
      	PR libstdc++/118083
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/ranges_base.h
      	(ranges::__access::__possibly_const_range): Mention LWG 4027.
      640697f7
    • Jakub Jelinek's avatar
      c: Assorted fixes for flexible array members in unions [PR119001] · ad2908ed
      Jakub Jelinek authored
      r15-209 allowed flexible array members inside of unions, but as the
      following testcase shows, not everything has been adjusted for that.
      Unlike structures, in unions flexible array member (as an extension)
      can be any of the members, not just the last one, as in union all
      members are effectively last.
      The first hunk is about an ICE on the initialization of the FAM
      in union which is not the last FIELD_DECL with a string literal,
      the second hunk just formatting fix, third hunk fixes a bug in which
      we were just throwing away the initializers (except for with string literal)
      of FAMs in unions which aren't the last FIELD_DECL, and the last hunk
      is to diagnose FAM errors in unions the same as for structures, in
      particular trying to initialize a FAM with non-constant or initialization
      in nested context.
      
      2025-02-26  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c/119001
      gcc/
      	* varasm.cc (output_constructor_regular_field): Don't fail
      	assertion if next is non-NULL and FIELD_DECL if
      	TREE_CODE (local->type) is UNION_TYPE.
      gcc/c/
      	* c-typeck.cc (pop_init_level): Don't clear constructor_type
      	if DECL_CHAIN of constructor_fields is NULL but p->type is UNION_TYPE.
      	Formatting fix.
      	(process_init_element): Diagnose non-static initialization of flexible
      	array member in union or FAM in union initialization in nested context.
      gcc/testsuite/
      	* gcc.dg/pr119001-1.c: New test.
      	* gcc.dg/pr119001-2.c: New test.
      ad2908ed
    • Jakub Jelinek's avatar
      c: stddef.h C23 fixes [PR114870] · 8d22474a
      Jakub Jelinek authored
      The stddef.h header for C23 defines __STDC_VERSION_STDDEF_H__ and
      unreachable macros multiple times in some cases.
      The header doesn't have normal multiple inclusion guard, because it supports
      for glibc inclusion with __need_{size_t,wchar_t,ptrdiff_t,wint_t,NULL}.
      While the definition of __STDC_VERSION_STDDEF_H__ and unreachable is done
      solely in the #ifdef _STDDEF_H part, so they are defined only if stddef.h
      is included without those __need_* macros defined.  But actually once
      stddef.h is included without the __need_* macros, _STDDEF_H is then defined
      and while further stddef.h includes without __need_* macros don't do
      anything:
       #if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
            && !defined(__STDDEF_H__)) \
           || defined(__need_wchar_t) || defined(__need_size_t) \
           || defined(__need_ptrdiff_t) || defined(__need_NULL) \
           || defined(__need_wint_t)
      if one includes whole stddef.h first and then stddef.h with some of the
      __need_* macros defined, the #ifdef _STDDEF_H part is used again.
      It isn't that big deal for most cases, as it uses extra guarding macros
      like:
       #ifndef _GCC_MAX_ALIGN_T
       #define _GCC_MAX_ALIGN_T
       ...
       #endif
      etc., but for __STDC_VERSION_STDDEF_H__/unreachable nothing like that is
      used.
      
      So, either we do what the following patch does and just don't define
      __STDC_VERSION_STDDEF_H__/unreachable second time, or use #ifndef
      unreachable separately for the #define unreachable() case, or use
      new _GCC_STDC_VERSION_STDDEF_H macro to guard this (or two, one for
      __STDC_VERSION_STDDEF_H__ and one for unreachable), or rework the initial
      condition to be just
       #if !defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
           && !defined(__STDDEF_H__)
      - I really don't understand why the header should do anything at all after
      it has been included once without __need_* macros.  But changing how this
      behaves after 35 years might be risky for various OS/libc combinations.
      
      2025-02-26  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c/114870
      	* ginclude/stddef.h (__STDC_VERSION_STDDEF_H__, unreachable): Don't
      	redefine multiple times if stddef.h is first included without __need_*
      	defines and later with them.  Move nullptr_t and unreachable and
      	__STDC_VERSION_STDDEF_H__ definitions into the same
      	defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L #if block.
      
      	* gcc.dg/c23-stddef-2.c: New test.
      8d22474a
    • Jakub Jelinek's avatar
      arm: Fix up REVERSE_CONDITION macro [PR119002] · 40bf0770
      Jakub Jelinek authored
      The linaro CI found my PR119002 patch broke bootstrap on arm.
      Seems the problem is that it has incorrect REVERSE_CONDITION macro
      definition.
      All other target's REVERSE_CONDITION definitions and the default one
      just use the macro's arguments, while arm.h definition uses the MODE
      argument but uses code instead of CODE (the first argument).
      This happens to work because before my patch the only use of the
      macro was in jump.cc with
        /* First see if machine description supplies us way to reverse the
           comparison.  Give it priority over everything else to allow
           machine description to do tricks.  */
        if (GET_MODE_CLASS (mode) == MODE_CC
            && REVERSIBLE_CC_MODE (mode))
          return REVERSE_CONDITION (code, mode);
      but in my patch it is used with GT rather than code.
      
      2025-02-26  Jakub Jelinek  <jakub@redhat.com>
      
      	PR rtl-optimization/119002
      	* config/arm/arm.h (REVERSE_CONDITION): Use CODE - the macro
      	argument - in the macro rather than code.
      40bf0770
    • Vladimir N. Makarov's avatar
      [PR119021][LRA]: Fix rtl correctness check failure in LRA. · 7ce3a8e8
      Vladimir N. Makarov authored
        Patch to fix PR115458 contained a code change in dealing with asm
      errors to avoid cycling in reporting the error for asm gotos.  This
      code was wrong and resulted in checking RTL correctness failure.  This
      patch reverts the code change and solves cycling in asm error
      reporting in a different way.
      
      gcc/ChangeLog:
      
      	PR middle-end/119021
      	* lra.cc (lra_asm_insn_error): Use lra_invalidate_insn_data
      	instead of lra_update_insn_regno_info.
      	* lra-assigns.cc (lra_split_hard_reg_for): Restore old code.
      7ce3a8e8
    • Alexandre Oliva's avatar
      [testsuite] add x86 effective target · 55bf33f3
      Alexandre Oliva authored
      I got tired of repeating the conditional that recognizes ia32 or
      x86_64, and introduced 'x86' as a shorthand for that, adjusting all
      occurrences in target-supports.exp, to set an example.  I found some
      patterns that recognized i?86* and x86_64*, but I took those as likely
      cut&pastos instead of trying to preserve those weirdnesses.
      
      
      for  gcc/ChangeLog
      
      	* doc/sourcebuild.texi: Add x86 effective target.
      
      for  gcc/testsuite/ChangeLog
      
      	* lib/target-supports.exp (check_effective_target_x86): New.
      	Replace all uses of i?86-*-* and x86_64-*-* in this file.
      55bf33f3
    • Alexandre Oliva's avatar
      [testsuite] adjust expectations of x86 vect-simd-clone tests · e6f5fade
      Alexandre Oliva authored
      Some vect-simd-clone tests fail when targeting ancient x86 variants,
      because the expected transformations only take place with -msse4 or
      higher.
      
      So arrange for these tests to take an -msse4 option on x86, so that
      the expected vectorization takes place, but decay to a compile test if
      vect.exp would enable execution but the target doesn't have an sse4
      runtime.  This requires the new dg-do-if to override the action on a
      target while retaining the default action on others, instead of
      disabling the test.
      
      We can count on avx512f compile-time support for these tests, because
      vect_simd_clones requires that on x86, and that implies sse4 support,
      so we need not complicate the scan conditionals with tests for sse4,
      except on the last test.
      
      
      for  gcc/ChangeLog
      
      	* doc/sourcebuild.texi (dg-do-if): Document.
      
      for  gcc/testsuite/ChangeLog
      
      	* lib/target-supports-dg.exp (dg-do-if): New.
      	* gcc.dg/vect/vect-simd-clone-16f.c: Use -msse4 on x86, and
      	skip in case execution is enabled but the runtime isn't.
      	* gcc.dg/vect/vect-simd-clone-17f.c: Likewise.
      	* gcc.dg/vect/vect-simd-clone-18f.c: Likewise.
      	* gcc.dg/vect/vect-simd-clone-20.c: Likewise, but only skip
      	the scan test.
      e6f5fade
    • Jakub Jelinek's avatar
      simple-diagnostic-path: Inline two trivial methods [PR116143] · 3b72464b
      Jakub Jelinek authored
      Various plugin tests fail with --enable-checking=release, because the
      num_events and num_threads methods of simple_diagnostic_path are only used
      inside of #if CHECKING_P code inside of GCC proper and then tested inside of
      some plugin tests.  So, with --enable-checking=yes they are compiled into
      cc1/cc1plus etc. binaries and plugins can call those, but with
      --enable-checking=release they are optimized away (at least for LTO builds).
      
      As they are trivial, the following patch just defines them inline, so that
      the plugin tests get their definitions directly and don't have to rely
      on cc1/cc1plus etc. exporting those.
      
      2025-02-26  Jakub Jelinek  <jakub@redhat.com>
      
      	PR testsuite/116143
      	* simple-diagnostic-path.h (simple_diagnostic_path::num_events): Define
      	inline.
      	(simple_diagnostic_path::num_threads): Likewise.
      	* simple-diagnostic-path.cc (simple_diagnostic_path::num_events):
      	Remove out of line definition.
      	(simple_diagnostic_path::num_threads): Likewise.
      3b72464b
    • Andre Vehreschild's avatar
      Fortran: Remove SAVE_EXPR on lhs in assign [PR108233] · 751b3704
      Andre Vehreschild authored
      With vectorial shaped datatypes like e.g. complex numbers, fold_convert
      inserts a SAVE_EXPR.  Using that on the lhs in an assignment prevented
      the update of the variable, when in a coarray.
      
      	PR fortran/108233
      
      gcc/fortran/ChangeLog:
      
      	* trans-expr.cc (gfc_trans_assignment_1): Remove SAVE_EXPR on lhs.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/coarray/complex_1.f90: New test.
      751b3704
    • Tamar Christina's avatar
      testsuite: Add pragma novector to more tests [PR118464] · ebe7cd9f
      Tamar Christina authored
      These loops will now vectorize the entry finding
      loops.  As such we get more failures because they
      were not expecting to be vectorized.
      
      Fixed by adding #pragma GCC novector.
      
      gcc/testsuite/ChangeLog:
      
      	PR tree-optimization/118464
      	PR tree-optimization/116855
      	* g++.dg/ext/pragma-unroll-lambda-lto.C: Add pragma novector.
      	* gcc.dg/tree-ssa/gen-vect-2.c: Likewise.
      	* gcc.dg/tree-ssa/gen-vect-25.c: Likewise.
      	* gcc.dg/tree-ssa/gen-vect-32.c: Likewise.
      	* gcc.dg/tree-ssa/ivopt_mult_2g.c: Likewise.
      	* gcc.dg/tree-ssa/ivopts-5.c: Likewise.
      	* gcc.dg/tree-ssa/ivopts-6.c: Likewise.
      	* gcc.dg/tree-ssa/ivopts-7.c: Likewise.
      	* gcc.dg/tree-ssa/ivopts-8.c: Likewise.
      	* gcc.dg/tree-ssa/ivopts-9.c: Likewise.
      	* gcc.dg/tree-ssa/predcom-dse-1.c: Likewise.
      	* gcc.dg/tree-ssa/predcom-dse-10.c: Likewise.
      	* gcc.dg/tree-ssa/predcom-dse-11.c: Likewise.
      	* gcc.dg/tree-ssa/predcom-dse-12.c: Likewise.
      	* gcc.dg/tree-ssa/predcom-dse-2.c: Likewise.
      	* gcc.dg/tree-ssa/predcom-dse-3.c: Likewise.
      	* gcc.dg/tree-ssa/predcom-dse-4.c: Likewise.
      	* gcc.dg/tree-ssa/predcom-dse-5.c: Likewise.
      	* gcc.dg/tree-ssa/predcom-dse-6.c: Likewise.
      	* gcc.dg/tree-ssa/predcom-dse-7.c: Likewise.
      	* gcc.dg/tree-ssa/predcom-dse-8.c: Likewise.
      	* gcc.dg/tree-ssa/predcom-dse-9.c: Likewise.
      	* gcc.target/i386/pr90178.c: Likewise.
      ebe7cd9f
    • GCC Administrator's avatar
      Daily bump. · 7de2f64d
      GCC Administrator authored
      7de2f64d
  3. Feb 25, 2025
    • Iain Buclaw's avatar
      libphobos: Generate test files for phobos testsuite · c2ece139
      Iain Buclaw authored
      Extracts all public unittests from libphobos/src and emits them as
      standalone tests in the testsuite using the tests_extractor script.
      
      Compiling every module in the Phobos library with unittests included is
      computationally expensive, and these tests are now only ran when
      GCC_TEST_RUN_EXPENSIVE is not empty.
      
      When instead just compiling the unittests and linking in the module
      under test, this has been observed to reduce the time spent running the
      testsuite by more than half.
      
      libphobos/ChangeLog:
      
      	* testsuite/libphobos.phobos/shared/phobos-shared.exp: Require
      	is-effective-target run_expensive_tests.
      	* testsuite/libphobos.phobos/static/phobos-static.exp: Likewise.
      	* testsuite/libphobos.phobos/phobos.exp: New test.
      	* testsuite/libphobos.phobos/std_algorithm_comparison.d: New test.
      	* testsuite/libphobos.phobos/std_algorithm_iteration.d: New test.
      	* testsuite/libphobos.phobos/std_algorithm_mutation.d: New test.
      	* testsuite/libphobos.phobos/std_algorithm_searching.d: New test.
      	* testsuite/libphobos.phobos/std_algorithm_setops.d: New test.
      	* testsuite/libphobos.phobos/std_algorithm_sorting.d: New test.
      	* testsuite/libphobos.phobos/std_array.d: New test.
      	* testsuite/libphobos.phobos/std_ascii.d: New test.
      	* testsuite/libphobos.phobos/std_base64.d: New test.
      	* testsuite/libphobos.phobos/std_bigint.d: New test.
      	* testsuite/libphobos.phobos/std_bitmanip.d: New test.
      	* testsuite/libphobos.phobos/std_checkedint.d: New test.
      	* testsuite/libphobos.phobos/std_complex.d: New test.
      	* testsuite/libphobos.phobos/std_concurrency.d: New test.
      	* testsuite/libphobos.phobos/std_container_array.d: New test.
      	* testsuite/libphobos.phobos/std_container_binaryheap.d: New test.
      	* testsuite/libphobos.phobos/std_container_dlist.d: New test.
      	* testsuite/libphobos.phobos/std_container_rbtree.d: New test.
      	* testsuite/libphobos.phobos/std_container_slist.d: New test.
      	* testsuite/libphobos.phobos/std_container_util.d: New test.
      	* testsuite/libphobos.phobos/std_conv.d: New test.
      	* testsuite/libphobos.phobos/std_csv.d: New test.
      	* testsuite/libphobos.phobos/std_datetime_date.d: New test.
      	* testsuite/libphobos.phobos/std_datetime_interval.d: New test.
      	* testsuite/libphobos.phobos/std_datetime_package.d: New test.
      	* testsuite/libphobos.phobos/std_datetime_stopwatch.d: New test.
      	* testsuite/libphobos.phobos/std_datetime_systime.d: New test.
      	* testsuite/libphobos.phobos/std_datetime_timezone.d: New test.
      	* testsuite/libphobos.phobos/std_demangle.d: New test.
      	* testsuite/libphobos.phobos/std_digest_crc.d: New test.
      	* testsuite/libphobos.phobos/std_digest_hmac.d: New test.
      	* testsuite/libphobos.phobos/std_digest_md.d: New test.
      	* testsuite/libphobos.phobos/std_digest_murmurhash.d: New test.
      	* testsuite/libphobos.phobos/std_digest_package.d: New test.
      	* testsuite/libphobos.phobos/std_digest_ripemd.d: New test.
      	* testsuite/libphobos.phobos/std_digest_sha.d: New test.
      	* testsuite/libphobos.phobos/std_encoding.d: New test.
      	* testsuite/libphobos.phobos/std_exception.d: New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_building_blocks_affix_allocator.d:
      	New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_building_blocks_aligned_block_list.d:
      	New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_building_blocks_allocator_list.d:
      	New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_building_blocks_ascending_page_allocator.d:
      	New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_building_blocks_bitmapped_block.d:
      	New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_building_blocks_bucketizer.d:
      	New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_building_blocks_fallback_allocator.d:
      	New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_building_blocks_free_list.d:
      	New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_building_blocks_kernighan_ritchie.d:
      	New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_building_blocks_quantizer.d:
      	New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_building_blocks_region.d: New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_building_blocks_scoped_allocator.d:
      	New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_building_blocks_segregator.d:
      	New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_building_blocks_stats_collector.d:
      	New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_common.d: New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_gc_allocator.d: New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_mallocator.d: New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_package.d: New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_showcase.d: New test.
      	* testsuite/libphobos.phobos/std_experimental_allocator_typed.d: New test.
      	* testsuite/libphobos.phobos/std_file.d: New test.
      	* testsuite/libphobos.phobos/std_format_package.d: New test.
      	* testsuite/libphobos.phobos/std_format_read.d: New test.
      	* testsuite/libphobos.phobos/std_format_spec.d: New test.
      	* testsuite/libphobos.phobos/std_format_write.d: New test.
      	* testsuite/libphobos.phobos/std_functional.d: New test.
      	* testsuite/libphobos.phobos/std_getopt.d: New test.
      	* testsuite/libphobos.phobos/std_int128.d: New test.
      	* testsuite/libphobos.phobos/std_internal_cstring.d: New test.
      	* testsuite/libphobos.phobos/std_internal_scopebuffer.d: New test.
      	* testsuite/libphobos.phobos/std_json.d: New test.
      	* testsuite/libphobos.phobos/std_logger_core.d: New test.
      	* testsuite/libphobos.phobos/std_logger_nulllogger.d: New test.
      	* testsuite/libphobos.phobos/std_math_algebraic.d: New test.
      	* testsuite/libphobos.phobos/std_math_exponential.d: New test.
      	* testsuite/libphobos.phobos/std_math_hardware.d: New test.
      	* testsuite/libphobos.phobos/std_math_operations.d: New test.
      	* testsuite/libphobos.phobos/std_math_remainder.d: New test.
      	* testsuite/libphobos.phobos/std_math_rounding.d: New test.
      	* testsuite/libphobos.phobos/std_math_traits.d: New test.
      	* testsuite/libphobos.phobos/std_math_trigonometry.d: New test.
      	* testsuite/libphobos.phobos/std_meta.d: New test.
      	* testsuite/libphobos.phobos/std_mmfile.d: New test.
      	* testsuite/libphobos.phobos/std_numeric.d: New test.
      	* testsuite/libphobos.phobos/std_outbuffer.d: New test.
      	* testsuite/libphobos.phobos/std_package.d: New test.
      	* testsuite/libphobos.phobos/std_parallelism.d: New test.
      	* testsuite/libphobos.phobos/std_path.d: New test.
      	* testsuite/libphobos.phobos/std_random.d: New test.
      	* testsuite/libphobos.phobos/std_range_interfaces.d: New test.
      	* testsuite/libphobos.phobos/std_range_package.d: New test.
      	* testsuite/libphobos.phobos/std_range_primitives.d: New test.
      	* testsuite/libphobos.phobos/std_regex_package.d: New test.
      	* testsuite/libphobos.phobos/std_signals.d: New test.
      	* testsuite/libphobos.phobos/std_socket.d: New test.
      	* testsuite/libphobos.phobos/std_stdio.d: New test.
      	* testsuite/libphobos.phobos/std_string.d: New test.
      	* testsuite/libphobos.phobos/std_sumtype.d: New test.
      	* testsuite/libphobos.phobos/std_traits.d: New test.
      	* testsuite/libphobos.phobos/std_typecons.d: New test.
      	* testsuite/libphobos.phobos/std_typetuple.d: New test.
      	* testsuite/libphobos.phobos/std_uni_package.d: New test.
      	* testsuite/libphobos.phobos/std_uri.d: New test.
      	* testsuite/libphobos.phobos/std_utf.d: New test.
      	* testsuite/libphobos.phobos/std_uuid.d: New test.
      	* testsuite/libphobos.phobos/std_variant.d: New test.
      	* testsuite/libphobos.phobos/std_zlib.d: New test.
      c2ece139
    • Giuseppe D'Angelo's avatar
      libstdc++: add support for constexpr stable_sort (P2562R1) · ff43f985
      Giuseppe D'Angelo authored
      
      stable_sort has been made constexpr in C++26. Apart from plastering a
      few functions with constexpr, there's an implementation challenge, that
      is: stable_sort takes different codepaths in case extra memory can be
      allocated. Rather than doing some major refactorings, simply use the
      non-allocating path during constant evaluation. That's the same codepath
      used when extra memory could not be allocated, as well as by
      freestanding.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/algorithmfwd.h (stable_sort): Add constexpr.
      	* include/bits/ranges_algo.h (__stable_sort_fn): Add constexpr
      	to the function call operators.
      	* include/bits/stl_algo.h (__stable_sort): Add constexpr.
      	During constant evaluation, always use the non-allocating path.
      	(stable_sort): Add constexpr.
      	(__inplace_stable_sort): Likewise.
      	(__merge_without_buffer): Likewise.
      	* include/bits/version.def (constexpr_algorithms): Bump value
      	for C++26.
      	* include/bits/version.h: Regnerate.
      	* testsuite/25_algorithms/cpp_lib_constexpr.cc: Test the bumped
      	feature-testing macro.
      	* testsuite/25_algorithms/headers/algorithm/synopsis.cc: Adapt
      	the test to constexpr stable_sort.
      	* testsuite/25_algorithms/stable_sort/constexpr.cc: New test.
      
      Signed-off-by: default avatarGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>
      ff43f985
    • Giuseppe D'Angelo's avatar
      libstdc++: add a constexpr macro for C++26 · 6a30ffd7
      Giuseppe D'Angelo authored
      
      Following the precedent of _GLIBCXX20_CONSTEXPR.
      
      It will be used to decorate some functions which have been made
      constexpr in C++26 (for instance P2562R1, and maybe P3508R0, P3369R0,
      ...).
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/c++config (_GLIBCXX26_CONSTEXPR): New macro.
      
      Signed-off-by: default avatarGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>
      6a30ffd7
    • Jonathan Wakely's avatar
      libstdc++: Fix typo in std::fill SFINAE constraint [PR93059] · 2256e308
      Jonathan Wakely authored
      The r15-4321-gd8ef4471cb9c9f change incorrectly used __value as the
      member of the __memcpyable_integer trait, but it should have been
      __width. That meant this overload was not being used for _Tp != _Up.
      
      Also return after doing the loop for the consteval case. The missing
      return wasn't causing incorrect behaviour because the consteval loop
      increments the iterator until it equals the end of the range, so the
      memset isn't done.  But it's still better to return and not even try
      to do the memset.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/93059
      	* include/bits/stl_algobase.h (__fill_a1): Fix typo in SFINAE
      	constraint.
      2256e308
    • Andrew Pinski's avatar
      i386: Fix pr101950-2.c [PR115028] · 892ee5ff
      Andrew Pinski authored
      
      So what is happening here is that after r15-268-g9dbff9c05520a7,
      a move instruction still exists after combine and the register
      allocator choses different register allocation order for the xor
      and because the input operand of lzcntq is not the same as output
      operand, there is an extra xor that happens (due to an errata).
      
      This fixes the testcase by using loading from a pointer instead
      of a function argument directly. The register allocator has more
      freedom since the load has no hard register associated with it (rdi)
      so it can be in eax register right away.
      
      Tested for both -m32 and -m64 on x86_64-linux-gnu.
      
      gcc/testsuite/ChangeLog:
      
      	PR testsuite/115028
      	* gcc.target/i386/pr101950-2.c: Use a pointer argument instead
      	of the argument directly.
      
      Signed-off-by: default avatarAndrew Pinski <quic_apinski@quicinc.com>
      892ee5ff
    • Iain Buclaw's avatar
      libphobos: Add script for extracting unittests from phobos · df4565ea
      Iain Buclaw authored
      This script parses all unittests annotated with three slashes (`///')
      and extracts them into a standalone test case.  The intended use is for
      generating inexpensive tests to be ran for the phobos testsuite.
      
      libphobos/ChangeLog:
      
      	* scripts/.gitignore: Add tests_extractor.
      	* scripts/README: Document tests_extractor.d.
      	* scripts/tests_extractor.d: New file.
      df4565ea
    • Iain Buclaw's avatar
      libphobos: Organize druntime and phobos tests under common directory · a407eada
      Iain Buclaw authored
      The druntime and druntime_shared tests are identical, save for one
      compiled with `-static-libphobos' and the other `-shared-libphobos'.
      Move them to libphobos.druntime/static and libphobos.druntime/shared
      respectively.  This has also been done for libphobos.phobos.
      
      libphobos/ChangeLog:
      
      	* testsuite/libphobos.druntime_shared/druntime_shared.exp: Move to...
      	* testsuite/libphobos.druntime/shared/druntime-shared.exp: ...here.
      	* testsuite/libphobos.druntime/druntime.exp: Move to...
      	* testsuite/libphobos.druntime/static/druntime-static.exp: ...here.
      	* testsuite/libphobos.phobos_shared/phobos_shared.exp: Move to...
      	* testsuite/libphobos.phobos/shared/phobos-shared.exp: ...here.
      	* testsuite/libphobos.phobos/phobos.exp: Move to...
      	* testsuite/libphobos.phobos/static/phobos-static.exp: ...here.
      a407eada
    • François Dumont's avatar
      libstdc++: [_Hashtable] Fix hash code cache usage when stateful hash functor · bcc8dea6
      François Dumont authored
      It is wrong to reuse a cached hash code from another container when this code depends
      on the state of the container's Hash functor.
      
      Add checks that Hash functor is stateless before reusing the cached hash code.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/hashtable_policy.h
      	(_Hash_code_base::_M_copy_code, _Hash_code_base::_M_store_code): Remove.
      	* include/bits/hashtable.h (_M_hash_code_ext): New.
      	(_M_merge_multi(_Hashtable&)): Use latter.
      	(_M_copy_code): New.
      	(_M_assign): Use latter.
      	(_M_bucket_index_ex): New.
      	(_M_equals): Use latter.
      	(_M_store_code): New.
      	(_M_src_hash_code): Remove key_type parameter.
      	* testsuite/23_containers/unordered_map/modifiers/merge.cc (test10): New
      	test case.
      bcc8dea6
    • Jason Merrill's avatar
      doc: update C++98 bootstrap note · dc9db800
      Jason Merrill authored
      r10-11132 uses C++11 default member initializers, which breaks bootstrapping
      with a C++98 compiler.
      
      gcc/ChangeLog:
      
      	* doc/install.texi: 10.5 won't bootstrap with C++98.
      dc9db800
    • Vladimir N. Makarov's avatar
      [PR115458][LRA]: Run split sub-pass more times · 2341f675
      Vladimir N. Makarov authored
        In this PR case LRA needs to provide too many hard regs for insn
      reloads, where some reload pseudos require 8 aligned regs for
      themselves.  As the last attempt, LRA tries to split live ranges of
      hard regs for insn reload pseudos.  It is a very rare case.  An
      inheritance pseudo involving a reload pseudo of the insn can be
      spilled in the assignment sub-pass run right after splitting and we need
      to run split sub-pass for the inheritance pseudo now.
      
      gcc/ChangeLog:
      
      	PR target/115458
      	* lra-int.h (LRA_MAX_FAILED_SPLITS): Define and check its value.
      	(lra_split_hard_reg_for): Change prototype.
      	* lra.cc (lra): Try to split hard reg range several times after a
      	failure.
      	* lra-assigns.cc (lra_split_hard_reg_for): Add an arg, a flag of
      	giving up.  Report asm error and nullify the asm insn depending on
      	the arg value.
      
      gcc/testsuite/ChangeLog:
      
      	PR target/115458
      	* g++.target/riscv/pr115458.C: New.
      2341f675
    • Jakub Jelinek's avatar
      pru: Fix pru_pragma_ctable_entry diagnostics [PR118991] · 0bb431d0
      Jakub Jelinek authored
      HOST_WIDE_INT_PRINT* macros aren't supposed to be used in
      gcc-internal-format format strings, we have the w modifier for HOST_WIDE_INT
      in that case, the HOST_WIDE_INT_PRINT* macros might not work properly on
      some hosts (e.g. mingw32 has HOST_LONG_LONG_FORMAT "I64" and that is
      something pretty-print doesn't handle, while it handles "ll" for long long)
      and also the use of macros in the middle of format strings breaks
      translations (both that exgettext can't retrieve the string from there
      and we get
       #: config/pru/pru-pragma.cc:61
       msgid "%<CTABLE_ENTRY%> index %"
       msgstr ""
      
       #: config/pru/pru-pragma.cc:64
       msgid "redefinition of %<CTABLE_ENTRY %"
       msgstr ""
      in po/gcc.pot and also the macros are different on different hosts,
      so even if exgettext extracted say "%<CTABLE_ENTRY%> index %lld is not valid"
      it could be translated on some hosts but not e.g. mingw32).
      
      So, the following patch just uses %wd instead.
      
      Tested it before/after the
      patch on
       #pragma ctable_entry 12 0x48040000
       #pragma ctable_entry 1024 0x48040000
       #pragma ctable_entry 12 0x48040001
      and the result is the same.
      
      2025-02-25  Jakub Jelinek  <jakub@redhat.com>
      
      	PR translation/118991
      	* config/pru/pru-pragma.cc (pru_pragma_ctable_entry): Use %wd
      	instead of %" HOST_WIDE_INT_PRINT "d to print a hwi in error.
      0bb431d0
    • Patrick Palka's avatar
      libstdc++: Implement LWG 4027 change to possibly-const-range [PR118083] · 1b9e4fe2
      Patrick Palka authored
      
      LWG 4027 effectively makes the const range access CPOs ranges::cfoo behave
      more consistently across C++23 and C++20 (pre-P2278R4) and also more
      consistently with the std::cfoo range accessors, as the below testcase
      adjustments demonstrate (which mostly consist of reverting workarounds
      added by r14-3771-gf12e26f3496275 and r13-7186-g0d94c6df183375).
      
      In passing fix PR118083 which reports that the input_range constraint on
      possibly-const-range is missing in our implementation.  A consequence of
      this is that the const range access CPOs now consistently reject a non-range
      argument, and so in some our of tests we need to introduce otherwise
      unused begin/end members.
      
      	PR libstdc++/118083
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/ranges_base.h
      	(ranges::__access::__possibly_const_range): Adjust logic as per
      	LWG 4027.  Add missing input_range constraint.
      	* testsuite/std/ranges/access/cbegin.cc (test05): Verify LWG
      	4027 testcases.
      	* testsuite/std/ranges/access/cdata.cc: Adjust, simplify and
      	consolidate some tests after the above.
      	* testsuite/std/ranges/access/cend.cc: Likewise.
      	* testsuite/std/ranges/access/crbegin.cc: Likewise.
      	* testsuite/std/ranges/access/crend.cc: Likewise.
      	* testsuite/std/ranges/adaptors/join.cc: Likewise.
      	* testsuite/std/ranges/adaptors/take_while.cc: Likewise.
      	* testsuite/std/ranges/adaptors/transform.cc: Likewise.
      
      Reviewed-by: default avatarJonathan Wakely <jwakely@redhat.com>
      1b9e4fe2
    • Iain Buclaw's avatar
      libphobos: Add scripts to update Makefile.am after an upstream merge · fffe14f0
      Iain Buclaw authored
      These two scripts have been used for updating Makefile.am whenever
      there's been a file added/removed from either Druntime or Phobos since
      the start, but never included in the source tree.
      
      libphobos/ChangeLog:
      
      	* libdruntime/Makefile.am: Update comment.
      	* libdruntime/Makefile.in: Regenerate.
      	* src/Makefile.am: Update comment.
      	* src/Makefile.in: Regenerate.
      	* scripts/.gitignore: New file.
      	* scripts/README: New file.
      	* scripts/gen_druntime_sources.d: New file.
      	* scripts/gen_phobos_sources.d: New file.
      fffe14f0
    • Iain Buclaw's avatar
      d/i386: Add CET TargetInfo key and predefined version [PR118654] · c17044e5
      Iain Buclaw authored
      Adds a new i386 d_target_info_spec entry to handle requests for
      `__traits(getTargetInfo, "CET")', and add predefined target version
      `GNU_CET' when the option `-fcf-protecton' is used.
      
      Both TargetInfo key and predefined version have been added to the D
      front-end documentation.
      
      In the library, `GNU_CET' replaces the existing use of the user-defined
      version flag `CET' when building libphobos.
      
      	PR d/118654
      
      gcc/ChangeLog:
      
      	* config/i386/i386-d.cc (ix86_d_target_versions): Predefine GNU_CET.
      	(ix86_d_handle_target_cf_protection): New.
      	(ix86_d_register_target_info): Add 'CET' TargetInfo key.
      
      gcc/d/ChangeLog:
      
      	* implement-d.texi: Document CET version and traits key.
      
      libphobos/ChangeLog:
      
      	* Makefile.in: Regenerate.
      	* configure: Regenerate.
      	* configure.ac: Remove CET_DFLAGS.
      	* libdruntime/Makefile.am: Replace CET_DFLAGS with CET_FLAGS.
      	* libdruntime/Makefile.in: Regenerate.
      	* libdruntime/core/thread/fiber/package.d: Replace CET with GNU_CET.
      	* src/Makefile.am: Replace CET_DFLAGS with CET_FLAGS.
      	* src/Makefile.in: Regenerate.
      	* testsuite/Makefile.in: Regenerate.
      	* testsuite/testsuite_flags.in: Replace CET_DFLAGS with CET_FLAGS.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/target/i386/i386.exp: New test.
      	* gdc.dg/target/i386/targetinfo_CET.d: New test.
      c17044e5
    • Iain Buclaw's avatar
      d: Increase max parallelism of the D testsuite · 2d812eec
      Iain Buclaw authored
      It was noticed that when running the testsuite for gdc and libphobos in
      parallel, this was capped at 10 simultaneous jobs each.  Increase this
      limit to 128, which enables running for example `make check-d -j48` to
      complete in half the time.
      
      gcc/d/ChangeLog:
      
      	* Make-lang.in (check_gdc_parallelize): Increase to 128.
      
      libphobos/ChangeLog:
      
      	* testsuite/Makefile.am (check_p_subno): Remove variable.
      	(check_p_subdirs): Increase default parallel slots to 128.
      	* testsuite/Makefile.in: Regenerate.
      2d812eec
    • Andre Vehreschild's avatar
      Fortran: Fix detection of descriptor arrays in coarray [PR107635] · af73228f
      Andre Vehreschild authored
      Look at the formal arguments generated type in the function declaration
      to figure if an argument is a descriptor arrays.  Fix handling of class
      types while splitting coarray expressions.
      
      	PR fortran/107635
      
      gcc/fortran/ChangeLog:
      
      	* coarray.cc (fixup_comp_refs): For class types set correct
      	component (class) type.
      	(split_expr_at_caf_ref): Provide location.
      	* trans-intrinsic.cc (conv_caf_send_to_remote): Look at
      	generated formal argument and not declared one to detect
      	descriptor arrays.
      	(conv_caf_sendget): Same.
      af73228f
    • Andre Vehreschild's avatar
      Fortran: Use correct size when transferring between images [PR107635] · cc81363c
      Andre Vehreschild authored
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      
      	* trans-intrinsic.cc (conv_caf_sendget): Use the size of data
      	transferred between the two images and not the descritor's size.
      cc81363c
    • Jakub Jelinek's avatar
      openmp: Mark OpenMP atomic write expression as read [PR119000] · cdffc763
      Jakub Jelinek authored
      The following testcase was emitting false positive warning that
      the rhs of #pragma omp atomic write was stored but not read,
      when the atomic actually does read it.  The following patch
      fixes that by calling default_function_array_read_conversion
      on it, so that it is marked as read as well as converted from
      lvalue to rvalue.
      Furthermore, the code had
      if (code == NOP_EXPR) ... else ... if (code == NOP_EXPR) ...
      with none of ... parts changing code, so I've merged the two ifs.
      
      2025-02-25  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c/119000
      	* c-parser.cc (c_parser_omp_atomic): For omp write call
      	default_function_array_read_conversion on the rhs expression.
      	Merge the two adjacent if (code == NOP_EXPR) blocks.
      
      	* c-c++-common/gomp/pr119000.c: New test.
      cdffc763
    • Jakub Jelinek's avatar
      openmp: Fix handling of declare target statics with array type which need destruction [PR118876] · 86a4af27
      Jakub Jelinek authored
      The following testcase ICEs because it attempts to emit the __tcfa function twice,
      once when handling the host destruction and once when handling nohost destruction.
      
      This patch fixes it by using __omp_tcfa function for the nohost case and marks it
      with the needed "omp declare target" and "omp declare target nohost" attributes.
      
      2025-02-25  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/118876
      	* cp-tree.h (register_dtor_fn): Add a bool argument defaulted to false.
      	* decl.cc (start_cleanup_fn): Add OMP_TARGET argument, use
      	"__omp_tcf" prefix rather than "__tcf" in that case.  Add
      	"omp declare target" and "omp declare target nohost" attributes
      	to the fndecl.
      	(register_dtor_fn): Add OMP_TARGET argument, pass it down to
      	start_cleanup_fn.
      	* decl2.cc (one_static_initialization_or_destruction): Add OMP_TARGET
      	argument, pass it down to register_dtor_fn.
      	(emit_partial_init_fini_fn): Pass omp_target to
      	one_static_initialization_or_destruction.
      	(handle_tls_init): Pass false to
      	one_static_initialization_or_destruction.
      
      	* g++.dg/gomp/pr118876.C: New test.
      86a4af27
    • Jakub Jelinek's avatar
      c++: Fix range for with PMFs [PR118923] · a41b3f54
      Jakub Jelinek authored
      The following testcases segfault because the new range for -frange-for-ext-temps
      temporary extension extends even the internal TARGET_EXPRs created by
      get_member_function_from_ptrfunc.
      
      The following patch fixes that by using get_internal_target_expr for those
      instead of force_target_expr (similarly in cp_finish_decl and
      build_comparison_op) and using force_target_expr inside of
      get_internal_target_expr.
      
      2025-02-25  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/118923
      	* tree.cc (get_internal_target_expr): Use force_target_expr
      	instead of build_target_expr_with_type.
      	* typeck.cc (get_member_function_from_ptrfunc): Use
      	get_internal_target_expr instead of force_target_expr.
      	* decl.cc (cp_finish_decl): Likewise.
      	* method.cc (build_comparison_op): Likewise.
      
      	* g++.dg/cpp0x/pr118923.C: New test.
      	* g++.dg/cpp1y/pr118923.C: New test.
      a41b3f54
    • GCC Administrator's avatar
      Daily bump. · 90b735b3
      GCC Administrator authored
      90b735b3
  4. Feb 24, 2025
    • Robin Dapp's avatar
      RISC-V: Include pattern stmts for dynamic LMUL computation [PR114516]. · 6be1b9e9
      Robin Dapp authored
      When scanning for program points, i.e. vector statements, we're missing
      pattern statements.  In PR114516 this becomes obvious as we choose
      LMUL=8 assuming there are only three statements but the divmod pattern
      adds another three.  Those push us beyond four registers so we need to
      switch to LMUL=4.
      
      This patch adds pattern statements to the program points which helps
      calculate a better register pressure estimate.
      
      	PR target/114516
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv-vector-costs.cc (compute_estimated_lmul):
      	Add pattern statements to program points.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/vect/costmodel/riscv/rvv/pr114516.c: New test.
      6be1b9e9
    • Robin Dapp's avatar
      vect: Use original LHS type for gather pattern [PR118950]. · f3d4208e
      Robin Dapp authored
      In PR118950 we do not zero masked elements in a gather load.
      While recognizing a gather/scatter pattern we do not use the original
      type of the LHS.  This matters because the type can differ with bool
      patterns (e.g. _Bool vs unsigned char) and we don't notice the need
      for zeroing out the padding bytes.
      
      This patch just uses the original LHS's type.
      
      	PR middle-end/118950
      
      gcc/ChangeLog:
      
      	* tree-vect-patterns.cc (vect_recog_gather_scatter_pattern): Use
      	original LHS's type.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/autovec/pr118950.c: New test.
      f3d4208e
    • Jakub Jelinek's avatar
      reassoc: Fix up optimize_range_tests_to_bit_test [PR118915] · 58062796
      Jakub Jelinek authored
      The following testcase is miscompiled due to a bug in
      optimize_range_tests_to_bit_test.  It is trying to optimize
      check for a in [-34,-34] or [-26,-26] or [-6,-6] or [-4,inf] ranges.
      Another reassoc optimization folds the the test for the first
      two ranges into (a + 34U) & ~8U in [0U,0U] range, and extract_bit_test_mask
      actually has code to virtually undo it and treat that again as test
      for a being -34 or -26.  The problem is that optimize_range_tests_to_bit_test
      remembers in the type variable TREE_TYPE (ranges[i].exp); from the first
      range.  If extract_bit_test_mask doesn't do that virtual undoing of the
      BIT_AND_EXPR handling, that is just fine, the returned exp is ranges[i].exp.
      But if the first range is BIT_AND_EXPR, the type could be different, the
      BIT_AND_EXPR form has the optional cast to corresponding unsigned type
      in order to avoid introducing UB.  Now, type was used to fill in the
      max value if ranges[j].high was missing in subsequently tested range,
      and so in this particular testcase the [-4,inf] range which was
      signed int and so [-4,INT_MAX] was treated as [-4,UINT_MAX] instead.
      And we were subtracting values of 2 different types and trying to make
      sense out of that.
      
      The following patch fixes this by using the type of the low bound
      (which is always non-NULL) for the max value of the high bound instead.
      
      2025-02-24  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/118915
      	* tree-ssa-reassoc.cc (optimize_range_tests_to_bit_test): For
      	highj == NULL_TREE use TYPE_MAX_VALUE (TREE_TYPE (lowj)) rather
      	than TYPE_MAX_VALUE (type).
      
      	* gcc.c-torture/execute/pr118915.c: New test.
      58062796
    • Richard Biener's avatar
      tree-optimization/118973 - stray abnormal edge after DCE · 9e4c57f7
      Richard Biener authored
      DCE preserves stmts performing abnormal control flow transfer but
      currently has an exception for replaceable allocations and cxa_atexit
      calls.  That results in a broken CFG since DCE isn't set up to prune
      abnormal edges possibly hanging off those.
      
      While we could try to add this handling, the following is the safe
      fix at this point and more suitable for backporting.
      
      	PR tree-optimization/118973
      	* tree-ssa-dce.cc (mark_stmt_if_obviously_necessary): Calls
      	that alter control flow in unpredictable ways need to be
      	preserved.
      
      	* g++.dg/torture/pr118973.C: New testcase.
      9e4c57f7
Loading