]> gcc.gnu.org Git - gcc.git/commitdiff
Merge branch 'master' into devel/sphinx
authorMartin Liska <mliska@suse.cz>
Mon, 22 Nov 2021 16:39:30 +0000 (17:39 +0100)
committerMartin Liska <mliska@suse.cz>
Mon, 22 Nov 2021 16:39:30 +0000 (17:39 +0100)
gcc/cp/parser.c
gcc/doc/invoke.texi
gcc/testsuite/c-c++-common/goacc/routine-6.c [new file with mode: 0644]
libgcc/unwind-dw2-fde-dip.c
libstdc++-v3/include/bits/c++config

index aa7f0e4b526b8353cf67aaaf90d627905afa450e..e2b5d6842fc4c18068dc5c27f8a2ab295124d852 100644 (file)
@@ -46852,8 +46852,8 @@ cp_parser_late_parsing_oacc_routine (cp_parser *parser, tree attrs)
      emission easier.  */
   parser->oacc_routine->clauses = nreverse (parser->oacc_routine->clauses);
   cp_parser_pop_lexer (parser);
-  /* Later, cp_finalize_oacc_routine will process the clauses, and then set
-     fndecl_seen.  */
+  /* Later, cp_finalize_oacc_routine will process the clauses.  */
+  parser->oacc_routine->fndecl_seen = true;
 
   return attrs;
 }
@@ -46871,16 +46871,17 @@ cp_finalize_oacc_routine (cp_parser *parser, tree fndecl, bool is_defn)
          || fndecl == error_mark_node)
        return;
 
-      if (parser->oacc_routine->fndecl_seen)
-       {
-         error_at (parser->oacc_routine->loc,
-                   "%<#pragma acc routine%> not immediately followed by"
-                   " a single function declaration or definition");
-         parser->oacc_routine = NULL;
-         return;
-       }
       if (TREE_CODE (fndecl) != FUNCTION_DECL)
        {
+         if (parser->oacc_routine->fndecl_seen)
+           {
+             error_at (parser->oacc_routine->loc,
+                       "%<#pragma acc routine%> not immediately followed by"
+                       " a single function declaration or definition");
+             parser->oacc_routine = NULL;
+             return;
+           }
+
          cp_ensure_no_oacc_routine (parser);
          return;
        }
@@ -46921,11 +46922,6 @@ cp_finalize_oacc_routine (cp_parser *parser, tree fndecl, bool is_defn)
                         parser->oacc_routine->clauses,
                         DECL_ATTRIBUTES (fndecl));
        }
-
-      /* Don't unset parser->oacc_routine here: we may still need it to
-        diagnose wrong usage.  But, remember that we've used this "#pragma acc
-        routine".  */
-      parser->oacc_routine->fndecl_seen = true;
     }
 }
 
index 714a4155bd2cca9d77d8de17714b56f4f95fbe05..34484f6ba7907b3e72f669ca4e67feb8ca87fb71 100644 (file)
@@ -14672,10 +14672,6 @@ by the RTL if-conversion pass for a branch that is considered unpredictable.
 If @option{-fvariable-expansion-in-unroller} is used, the maximum number
 of times that an individual variable will be expanded during loop unrolling.
 
-@item tracer-min-branch-probability-feedback
-Stop forward growth if the probability of best edge is less than
-this threshold (in percent). Used when profile feedback is available.
-
 @item partial-inlining-entry-probability
 Maximum probability of the entry BB of split region
 (in percent relative to entry BB of the function)
@@ -14725,10 +14721,6 @@ A threshold on the average loop count considered by the swing modulo scheduler.
 The number of cycles the swing modulo scheduler considers when checking
 conflicts using DFA.
 
-@item max-inline-insns-recursive-auto
-The maximum number of instructions non-inline function
-can grow to via recursive inlining.
-
 @item graphite-allow-codegen-errors
 Whether codegen errors should be ICEs when @option{-fchecking}.
 
@@ -14778,10 +14770,6 @@ when comparing to the number of (scaled) blocks.
 Maximum number of nested calls to search for control dependencies
 during uninitialized variable analysis.
 
-@item sra-max-scalarization-size-Osize
-Maximum size, in storage units, of an aggregate
-which should be considered for scalarization when compiling for size.
-
 @item fsm-scale-path-blocks
 Scale factor to apply to the number of blocks in a threading path
 when comparing to the number of (scaled) statements.
diff --git a/gcc/testsuite/c-c++-common/goacc/routine-6.c b/gcc/testsuite/c-c++-common/goacc/routine-6.c
new file mode 100644 (file)
index 0000000..0a231a0
--- /dev/null
@@ -0,0 +1,4 @@
+/* PR c++/101731 */
+
+#pragma acc routine    /* { dg-error "not immediately followed by a single function declaration or definition" "" { target c++ } } */
+int foo (int bar ());
index 5095b6830bf79e2e794d51e4ae1824d50078dd34..3f302826d2d4907401cb29170684dbd31b9d5315 100644 (file)
@@ -101,16 +101,35 @@ static const fde * _Unwind_Find_registered_FDE (void *pc, struct dwarf_eh_bases
 #define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550)
 #endif
 
+#ifdef CRT_GET_RFIB_DATA
+#define NEED_DBASE_MEMBER 1
+#else
+#define NEED_DBASE_MEMBER 0
+#endif
+
 struct unw_eh_callback_data
 {
   _Unwind_Ptr pc;
-  void *tbase;
+#if NEED_DBASE_MEMBER
   void *dbase;
+#endif
   void *func;
   const fde *ret;
   int check_cache;
 };
 
+/* Returns DATA->dbase if available, else NULL.  */
+static inline _Unwind_Ptr
+unw_eh_callback_data_dbase (const struct unw_eh_callback_data *data
+                           __attribute__ ((unused)))
+{
+#if NEED_DBASE_MEMBER
+  return (_Unwind_Ptr) data->dbase;
+#else
+  return 0;
+#endif
+}
+
 struct unw_eh_frame_hdr
 {
   unsigned char version;
@@ -140,9 +159,11 @@ static struct frame_hdr_cache_element *frame_hdr_cache_head;
 /* Like base_of_encoded_value, but take the base from a struct
    unw_eh_callback_data instead of an _Unwind_Context.  */
 
-static _Unwind_Ptr
-base_from_cb_data (unsigned char encoding, struct unw_eh_callback_data *data)
+static inline _Unwind_Ptr
+base_from_cb_data (unsigned char encoding __attribute__ ((unused)),
+                  _Unwind_Ptr dbase __attribute__ ((unused)))
 {
+#if NEED_DBASE_MEMBER
   if (encoding == DW_EH_PE_omit)
     return 0;
 
@@ -154,12 +175,15 @@ base_from_cb_data (unsigned char encoding, struct unw_eh_callback_data *data)
       return 0;
 
     case DW_EH_PE_textrel:
-      return (_Unwind_Ptr) data->tbase;
+      return 0;
     case DW_EH_PE_datarel:
-      return (_Unwind_Ptr) data->dbase;
+      return dbase;
     default:
       gcc_unreachable ();
     }
+#else /* !NEED_DBASE_MEMBER */
+  return 0;
+#endif
 }
 
 static int
@@ -359,9 +383,10 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
 # endif
 #endif
 
+  _Unwind_Ptr dbase = unw_eh_callback_data_dbase (data);
   p = read_encoded_value_with_base (hdr->eh_frame_ptr_enc,
                                    base_from_cb_data (hdr->eh_frame_ptr_enc,
-                                                      data),
+                                                      dbase),
                                    (const unsigned char *) (hdr + 1),
                                    &eh_frame);
 
@@ -375,7 +400,7 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
 
       p = read_encoded_value_with_base (hdr->fde_count_enc,
                                        base_from_cb_data (hdr->fde_count_enc,
-                                                          data),
+                                                          dbase),
                                        p, &fde_count);
       /* Shouldn't happen.  */
       if (fde_count == 0)
@@ -431,8 +456,8 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
      As soon as GLIBC will provide API so to notify that a library has been
      removed, we could cache this (and thus use search_object).  */
   ob.pc_begin = NULL;
-  ob.tbase = data->tbase;
-  ob.dbase = data->dbase;
+  ob.tbase = NULL;
+  ob.dbase = (void *) dbase;
   ob.u.single = (fde *) eh_frame;
   ob.s.i = 0;
   ob.s.b.mixed_encoding = 1;  /* Need to assume worst case.  */
@@ -443,7 +468,7 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
       unsigned int encoding = get_fde_encoding (data->ret);
 
       read_encoded_value_with_base (encoding,
-                                   base_from_cb_data (encoding, data),
+                                   base_from_cb_data (encoding, dbase),
                                    data->ret->pc_begin, &func);
       data->func = (void *) func;
     }
@@ -461,8 +486,9 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
     return ret;
 
   data.pc = (_Unwind_Ptr) pc;
-  data.tbase = NULL;
+#if NEED_DBASE_MEMBER
   data.dbase = NULL;
+#endif
   data.func = NULL;
   data.ret = NULL;
   data.check_cache = 1;
@@ -472,8 +498,12 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
 
   if (data.ret)
     {
-      bases->tbase = data.tbase;
+      bases->tbase = NULL;
+#if NEED_DBASE_MEMBER
       bases->dbase = data.dbase;
+#else
+      bases->dbase = NULL;
+#endif
       bases->func = data.func;
     }
   return data.ret;
index 4b7fa6593001f4ca3370f75ffdd7eff3a09d0575..cbcdedb366fcd69fddc7e10d6fa9b8bf494d1b8a 100644 (file)
 # define _GLIBCXX11_DEPRECATED_SUGGEST(ALT)
 #endif
 
-#if defined(__DEPRECATED) && (__cplusplus >= 201403L)
+#if defined(__DEPRECATED) && (__cplusplus >= 201402L)
 # define _GLIBCXX14_DEPRECATED _GLIBCXX_DEPRECATED
 # define _GLIBCXX14_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
 #else
 # define _GLIBCXX17_DEPRECATED_SUGGEST(ALT)
 #endif
 
-#if defined(__DEPRECATED) && (__cplusplus > 201703L)
+#if defined(__DEPRECATED) && (__cplusplus >= 202002L)
 # define _GLIBCXX20_DEPRECATED(MSG) [[deprecated(MSG)]]
 # define _GLIBCXX20_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
 #else
This page took 0.138391 seconds and 5 git commands to generate.