On Thu, Apr 22, 2021 at 3:52 PM Martin Liška <mli...@suse.cz> wrote:
>
> Right now, we require a C++11 compiler, so the check is not needed any
> longer.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed once GCC 11.1 is released?

For system.h please keep it working for C code (not sure if we use
a C compiler anywhere).

Richard.

> Thanks,
> Martin
>
> gcc/analyzer/ChangeLog:
>
>         * program-state.cc (program_state::operator=): Remove
>         __cplusplus >= 201103.
>         (program_state::program_state): Likewise.
>         * program-state.h: Likewise.
>         * region-model.h (class region_model): Remove dead code.
>
> gcc/ChangeLog:
>
>         * bitmap.h (class auto_bitmap): Remove
>         __cplusplus >= 201103.
>         * config/aarch64/aarch64.c: Likewise.
>         * gimple-ssa-store-merging.c 
> (store_immediate_info::store_immediate_info):
>         Likewise.
>         * sbitmap.h: Likewise.
>         * system.h (STATIC_ASSERT): Likewise.
> ---
>  gcc/analyzer/program-state.cc  |  2 --
>  gcc/analyzer/program-state.h   |  4 ----
>  gcc/analyzer/region-model.h    |  5 -----
>  gcc/bitmap.h                   |  2 --
>  gcc/config/aarch64/aarch64.c   |  2 --
>  gcc/gimple-ssa-store-merging.c | 10 +---------
>  gcc/sbitmap.h                  |  2 --
>  gcc/system.h                   |  9 +--------
>  8 files changed, 2 insertions(+), 34 deletions(-)
>
> diff --git a/gcc/analyzer/program-state.cc b/gcc/analyzer/program-state.cc
> index f8094621309..5c690b08fd3 100644
> --- a/gcc/analyzer/program-state.cc
> +++ b/gcc/analyzer/program-state.cc
> @@ -731,7 +731,6 @@ program_state::operator= (const program_state &other)
>    return *this;
>  }
>
> -#if __cplusplus >= 201103
>  /* Move constructor for program_state (when building with C++11).  */
>  program_state::program_state (program_state &&other)
>  : m_region_model (other.m_region_model),
> @@ -747,7 +746,6 @@ program_state::program_state (program_state &&other)
>
>    m_valid = other.m_valid;
>  }
> -#endif
>
>  /* program_state's dtor.  */
>
> diff --git a/gcc/analyzer/program-state.h b/gcc/analyzer/program-state.h
> index 898c57ff833..f16fe6ba984 100644
> --- a/gcc/analyzer/program-state.h
> +++ b/gcc/analyzer/program-state.h
> @@ -192,11 +192,7 @@ public:
>    program_state (const extrinsic_state &ext_state);
>    program_state (const program_state &other);
>    program_state& operator= (const program_state &other);
> -
> -#if __cplusplus >= 201103
>    program_state (program_state &&other);
> -#endif
> -
>    ~program_state ();
>
>    hashval_t hash () const;
> diff --git a/gcc/analyzer/region-model.h b/gcc/analyzer/region-model.h
> index 4123500f3bc..a169396dcb5 100644
> --- a/gcc/analyzer/region-model.h
> +++ b/gcc/analyzer/region-model.h
> @@ -414,11 +414,6 @@ class region_model
>    region_model (region_model_manager *mgr);
>    region_model (const region_model &other);
>    ~region_model ();
> -
> -#if 0//__cplusplus >= 201103
> -  region_model (region_model &&other);
> -#endif
> -
>    region_model &operator= (const region_model &other);
>
>    bool operator== (const region_model &other) const;
> diff --git a/gcc/bitmap.h b/gcc/bitmap.h
> index 84632af7009..26138556b2a 100644
> --- a/gcc/bitmap.h
> +++ b/gcc/bitmap.h
> @@ -951,10 +951,8 @@ class auto_bitmap
>    // Prevent making a copy that references our bitmap.
>    auto_bitmap (const auto_bitmap &);
>    auto_bitmap &operator = (const auto_bitmap &);
> -#if __cplusplus >= 201103L
>    auto_bitmap (auto_bitmap &&);
>    auto_bitmap &operator = (auto_bitmap &&);
> -#endif
>
>    bitmap_head m_bits;
>  };
> diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
> index 12625a4bee3..62fcad88215 100644
> --- a/gcc/config/aarch64/aarch64.c
> +++ b/gcc/config/aarch64/aarch64.c
> @@ -221,9 +221,7 @@ public:
>       predicate in each predicate argument register.  This means that
>       we need at least 12 pieces.  */
>    static const unsigned int MAX_PIECES = NUM_FP_ARG_REGS + NUM_PR_ARG_REGS;
> -#if __cplusplus >= 201103L
>    static_assert (MAX_PIECES >= 8, "Need to store at least 8 predicates");
> -#endif
>
>    /* Describes one piece of a PST.  Each piece is one of:
>
> diff --git a/gcc/gimple-ssa-store-merging.c b/gcc/gimple-ssa-store-merging.c
> index 7eb50d65a20..123c92d9b44 100644
> --- a/gcc/gimple-ssa-store-merging.c
> +++ b/gcc/gimple-ssa-store-merging.c
> @@ -1595,17 +1595,9 @@ store_immediate_info::store_immediate_info (unsigned 
> HOST_WIDE_INT bs,
>    : bitsize (bs), bitpos (bp), bitregion_start (brs), bitregion_end (bre),
>      stmt (st), order (ord), rhs_code (rhscode), n (nr),
>      ins_stmt (ins_stmtp), bit_not_p (bitnotp), ops_swapped_p (false),
> -    lp_nr (nr2)
> -#if __cplusplus >= 201103L
> -    , ops { op0r, op1r }
> +    lp_nr (nr2), ops { op0r, op1r }
>  {
>  }
> -#else
> -{
> -  ops[0] = op0r;
> -  ops[1] = op1r;
> -}
> -#endif
>
>  /* Struct representing a group of stores to contiguous memory locations.
>     These are produced by the second phase (coalescing) and consumed in the
> diff --git a/gcc/sbitmap.h b/gcc/sbitmap.h
> index 89a86e49f60..17660e5a65e 100644
> --- a/gcc/sbitmap.h
> +++ b/gcc/sbitmap.h
> @@ -301,10 +301,8 @@ private:
>    /* Prevent making a copy that refers to our sbitmap.  */
>    auto_sbitmap (const auto_sbitmap &);
>    auto_sbitmap &operator = (const auto_sbitmap &);
> -#if __cplusplus >= 201103L
>    auto_sbitmap (auto_sbitmap &&);
>    auto_sbitmap &operator = (auto_sbitmap &&);
> -#endif
>
>    /* The bitmap we are managing.  */
>    sbitmap m_bitmap;
> diff --git a/gcc/system.h b/gcc/system.h
> index a3f5948aaee..ef6eb5f2738 100644
> --- a/gcc/system.h
> +++ b/gcc/system.h
> @@ -829,14 +829,7 @@ extern void fancy_abort (const char *, int, const char *)
>  #define STATIC_CONSTANT_P(X) (false && (X))
>  #endif
>
> -/* static_assert (COND, MESSAGE) is available in C++11 onwards.  */
> -#if __cplusplus >= 201103L
> -#define STATIC_ASSERT(X) \
> -  static_assert ((X), #X)
> -#else
> -#define STATIC_ASSERT(X) \
> -  typedef int assertion1[(X) ? 1 : -1] ATTRIBUTE_UNUSED
> -#endif
> +#define STATIC_ASSERT(X) static_assert ((X), #X)
>
>  /* Provide a fake boolean type.  We make no attempt to use the
>     C99 _Bool, as it may not be available in the bootstrap compiler,
> --
> 2.31.1
>

Reply via email to