This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++ PATCH: Fix PR 862



This patch documents and/or removes C++ front-end options.

In particular:

  -fconst-strings
  -fnonansi-builtins
  -fstats
  -fweak

are documented, and:

  -flabels-ok
  -fvtable-gc
  -fxref
  -Wextern-inline

are removed.  Of the latter, -flabels-ok was a truy horrendous hack
which thankfully didn't work; it was designed to allow use of
label-names as values, like the `&&foo' extension, but not requiring
the `&&'.  I left support for -fvtable-gc and -fxref in the compiler,
but removed the options; these are good ideas, and might get finished
sometime.  -Wextern-inline didn't do anything, so I zapped it.

Tetsed on i686-pc-linux-gnu, installed on the mainline and on the
branch.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2001-04-26  Mark Mitchell  <mark@codesourcery.com>

	* invoke.texi: Document more C++ command-line options.

2001-04-26  Mark Mitchell  <mark@codesourcery.com>

	Remove support for -Wextern-inline, -flabels-ok, -fvtable-gc, -fxref
	* cp-tree.h (warn_extern_inline): Remove.
	(flag_labels_ok): Likewise.
	* decl2.c (warn_extern_inline): Remove.
	(flag_labels_ok): Likewise.
	(lang_f_options): Remove labels-ok, vtable-gc, xref.
	(unsupported_options): Add them.
	(cxx_decode_option): Don't accept -Wextern-inline.
	* method.c (hack_identifier): Remove -flabels-ok support.
	* spew.c (see_typename): Likewise.

2001-04-26  Mark Mitchell  <mark@codesourcery.com>

	* g++.dg/vtgc1.C: XFAIL.
	* g++.old-deja/g++.other/crash18.C: Likewise.
	
Index: invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/invoke.texi,v
retrieving revision 1.273.2.12
diff -c -p -r1.273.2.12 invoke.texi
*** invoke.texi	2001/04/19 13:32:26	1.273.2.12
--- invoke.texi	2001/04/26 19:19:17
*************** two definitions were merged.
*** 1230,1235 ****
--- 1230,1246 ----
  This option is no longer useful on most targets, now that support has
  been added for putting variables into BSS without making them common.
  
+ @item -fno-const-strings 
+ Give string constants type @code{char *} instead of type @code{const
+ char *}.  By default, G++ uses type @code{const char *} as required by
+ the standard.  Even if you use @samp{-fno-const-strings}, you cannot
+ actually modify the value of a string constant, unless you also use
+ @samp{-fwritable-strings}.
+ 
+ This option might be removed in a future release of G++.  For maximum
+ portability, you should structure your code so that it works with
+ string constants that have type @code{const char *}.
+ 
  @item -fdollars-in-identifiers
  Accept @samp{$} in identifiers.  You can also explicitly prohibit use of
  @samp{$} with the option @samp{-fno-dollars-in-identifiers}.  (GNU C allows
*************** errors if these functions are not inline
*** 1319,1324 ****
--- 1330,1340 ----
  Disable pedantic warnings about constructs used in MFC, such as implicit
  int and getting a pointer to member function via non-standard syntax.
  
+ @item -fno-nonansi-builtins
+ Disable builtin declarations of functions that are not mandated by
+ ANSI/ISO C.  These include @code{ffs}, @code{alloca}, @code{_exit},
+ @code{index}, @code{bzero}, @code{conjf}, and other related functions.
+ 
  @item -fno-operator-names
  Do not treat the operator name keywords @code{and}, @code{bitand},
  @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
*************** of the language, you can save some space
*** 1348,1353 ****
--- 1364,1373 ----
  exception handling uses the same information, but it will generate it as
  needed.
  
+ @item -fstats
+ Emit statistics about front-end processing at the end of the compilation.
+ This information is generally only useful to the G++ development team.
+ 
  @item -ftemplate-depth-@var{n}
  Set the maximum instantiation depth for template classes to @var{n}.
  A limit on the template instantiation depth is needed to detect
*************** those.
*** 1376,1381 ****
--- 1396,1408 ----
  
  Like all options that change the ABI, all C++ code, @emph{including
  libgcc.a} must be built with the same setting of this option.
+ 
+ @item -fno-weak 
+ Do not use weak symbol support, even if it is provied by the linker.
+ By default, G++ will use weak symbols if they are available.  This
+ option exists only for testing, and should not be used by end-users;
+ it will result in inferior code and has no benefits.  This option may
+ be removed in a future release of G++.
  
  @item -nostdinc++
  Do not search for header files in the standard directories specific to
Index: cp/cp-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.572.2.20
diff -c -p -r1.572.2.20 cp-tree.h
*** cp-tree.h	2001/04/20 23:59:53	1.572.2.20
--- cp-tree.h	2001/04/26 19:19:22
*************** extern int warn_ecpp;
*** 1074,1083 ****
  
  extern int warn_sign_promo;
  
- /* Non-zero means warn when a function is declared extern and later inline.  */
- 
- extern int warn_extern_inline;
- 
  /* Non-zero means warn when an old-style cast is used.  */
  
  extern int warn_old_style_cast;
--- 1074,1079 ----
*************** typedef enum instantiate_type_flags {
*** 3203,3212 ****
    itf_no_attributes = 1 << 1, /* ignore attributes on comparisons */
    itf_ptrmem_ok = 1 << 2,     /* pointers to member ok (internal use) */
  } instantiate_type_flags;
- 
- /* Non-zero means that if a label exists, and no other identifier
-    applies, use the value of the label.  */
- extern int flag_labels_ok;
  
  /* Nonzero means allow Microsoft extensions without a pedwarn.  */
  extern int flag_ms_extensions;
--- 3199,3204 ----
Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
retrieving revision 1.437.2.12
diff -c -p -r1.437.2.12 decl2.c
*** decl2.c	2001/04/19 22:40:07	1.437.2.12
--- decl2.c	2001/04/26 19:19:24
*************** int warn_overloaded_virtual;
*** 283,292 ****
  
  int warn_nonvdtor;
  
- /* Non-zero means warn when a function is declared extern and later inline.  */
- 
- int warn_extern_inline;
- 
  /* Non-zero means warn when the compiler will reorder code.  */
  
  int warn_reorder;
--- 283,288 ----
*************** int warn_deprecated = 1;
*** 337,346 ****
  #endif
  int dollars_in_ident = DOLLARS_IN_IDENTIFIERS;
  
- /* Nonzero means that labels can be used as first-class objects */
- 
- int flag_labels_ok;
- 
  /* Nonzero means allow Microsoft extensions without a pedwarn.  */
  
  int flag_ms_extensions;
--- 333,338 ----
*************** lang_f_options[] =
*** 488,494 ****
    {"implement-inlines", &flag_implement_inlines, 1},
    {"implicit-inline-templates", &flag_implicit_inline_templates, 1},
    {"implicit-templates", &flag_implicit_templates, 1},
-   {"labels-ok", &flag_labels_ok, 1},
    {"ms-extensions", &flag_ms_extensions, 1},
    {"nonansi-builtins", &flag_no_nonansi_builtin, 0},
    {"operator-names", &flag_operator_names, 1},
--- 480,485 ----
*************** lang_f_options[] =
*** 498,507 ****
    {"rtti", &flag_rtti, 1},
    {"stats", &flag_detailed_statistics, 1},
    {"use-cxa-atexit", &flag_use_cxa_atexit, 1},
-   {"vtable-gc", &flag_vtable_gc, 1},
    {"vtable-thunks", &flag_vtable_thunks, 1},
!   {"weak", &flag_weak, 1},
!   {"xref", &flag_gnu_xref, 1}
  };
  
  /* The list of `-f' options that we no longer support.  The `-f'
--- 489,496 ----
    {"rtti", &flag_rtti, 1},
    {"stats", &flag_detailed_statistics, 1},
    {"use-cxa-atexit", &flag_use_cxa_atexit, 1},
    {"vtable-thunks", &flag_vtable_thunks, 1},
!   {"weak", &flag_weak, 1}
  };
  
  /* The list of `-f' options that we no longer support.  The `-f'
*************** static const char * const unsupported_op
*** 512,521 ****
--- 501,513 ----
    "cond-mismatch",
    "enum-int-equiv",
    "guiding-decls",
+   "labels-ok",
    "nonnull-objects",
    "squangle",
    "strict-prototype",
    "this-is-variable",
+   "vtable-gc",
+   "xref"
  };
  
  /* Compare two option strings, pointed two by P1 and P2, for use with
*************** cxx_decode_option (argc, argv)
*** 716,723 ****
  	warn_parentheses = setting;
        else if (!strcmp (p, "non-virtual-dtor"))
  	warn_nonvdtor = setting;
-       else if (!strcmp (p, "extern-inline"))
- 	warn_extern_inline = setting;
        else if (!strcmp (p, "reorder"))
  	warn_reorder = setting;
        else if (!strcmp (p, "synth"))
--- 708,713 ----
Index: cp/method.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/method.c,v
retrieving revision 1.190.2.9
diff -c -p -r1.190.2.9 method.c
*** method.c	2001/04/12 07:35:01	1.190.2.9
--- method.c	2001/04/26 19:19:24
*************** hack_identifier (value, name)
*** 182,191 ****
  #endif
  	    }
  	}
-       if (flag_labels_ok && IDENTIFIER_LABEL_VALUE (name))
- 	{
- 	  return IDENTIFIER_LABEL_VALUE (name);
- 	}
        return error_mark_node;
      }
  
--- 182,187 ----
Index: cp/spew.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/spew.c,v
retrieving revision 1.43.4.2
diff -c -p -r1.43.4.2 spew.c
*** spew.c	2001/03/07 01:19:55	1.43.4.2
--- spew.c	2001/04/26 19:19:24
*************** see_typename ()
*** 701,712 ****
    if (yychar == IDENTIFIER)
      {
        lastiddecl = lookup_name (yylval.ttype, -2);
!       if (lastiddecl == 0)
! 	{
! 	  if (flag_labels_ok)
! 	    lastiddecl = IDENTIFIER_LABEL_VALUE (yylval.ttype);
! 	}
!       else
  	yychar = identifier_type (lastiddecl);
      }
  }
--- 701,707 ----
    if (yychar == IDENTIFIER)
      {
        lastiddecl = lookup_name (yylval.ttype, -2);
!       if (lastiddecl)
  	yychar = identifier_type (lastiddecl);
      }
  }
Index: testsuite/g++.dg/vtgc1.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.dg/vtgc1.C,v
retrieving revision 1.1.4.1
diff -c -p -r1.1.4.1 vtgc1.C
*** vtgc1.C	2001/02/28 09:33:24	1.1.4.1
--- vtgc1.C	2001/04/26 19:19:26
***************
*** 1,5 ****
--- 1,6 ----
  // { dg-do compile }
  // { dg-options "-fvtable-gc" }
+ // { dg-excess-errors "-fvtable-gc unsupported" { xfail *-*-* } }
  // Origin: Hans-Peter Nilsson <hp@bitrange.com>
  
  class Base0
*************** void x3 (Multivs1 *ii) { ii->f2();}
*** 118,133 ****
--- 119,147 ----
  void x4 (Multiss2 *ii) { ii->f2();}
  void x5 (Multivv3 *ii) { ii->f2();}
  
+ // { dg-final { setup_xfail *-*-* } }
  // { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Multivv3, 0" } }
+ // { dg-final { setup_xfail *-*-* } }
  // { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*VTT for Multivv3, 0" } }
+ // { dg-final { setup_xfail *-*-* } }
  // { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Multiss2, vtable for Base2" } }
+ // { dg-final { setup_xfail *-*-* } }
  // { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Multivs1, vtable for Base2" } }
+ // { dg-final { setup_xfail *-*-* } }
  // { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*VTT for Multivs1, vtable for Base2" } }
+ // { dg-final { setup_xfail *-*-* } }
  // { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Multisv0, vtable for Side0" } }
+ // { dg-final { setup_xfail *-*-* } }
  // { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*VTT for Multisv0, vtable for Side0" } }
+ // { dg-final { setup_xfail *-*-* } }
  // { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Side0, 0" } }
+ // { dg-final { setup_xfail *-*-* } }
  // { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for VbasedA, 0" } }
+ // { dg-final { setup_xfail *-*-* } }
  // { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*VTT for VbasedA, 0" } }
+ // { dg-final { setup_xfail *-*-* } }
  // { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Base2, vtable for Base1" } }
+ // { dg-final { setup_xfail *-*-* } }
  // { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Base1, vtable for Base0" } }
+ // { dg-final { setup_xfail *-*-* } }
  // { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Base0, 0" } }
Index: testsuite/g++.old-deja/g++.other/crash18.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.other/crash18.C,v
retrieving revision 1.3
diff -c -p -r1.3 crash18.C
*** crash18.C	2000/12/30 16:47:17	1.3
--- crash18.C	2001/04/26 19:19:26
***************
*** 1,7 ****
  // Build don't link:
  // Special g++ Options: -fvtable-gc
  // Origin: Mark Mitchell <mitchell@codesourcery.com>
! // excess errors test - XFAIL *-*-coff *-*-aout *-*-hms mips*-sgi-irix*
  
  struct S {
    virtual void f ();
--- 1,7 ----
  // Build don't link:
  // Special g++ Options: -fvtable-gc
  // Origin: Mark Mitchell <mitchell@codesourcery.com>
! // excess errors test - XFAIL *-*-*
  
  struct S {
    virtual void f ();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]