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]
Other format: [Raw text]

[PATCH] Remove pedantic_lvalues


As pre-approved by Joseph the following removes pedantic_lvalues
which the C FE now handles itself without help from fold-const.c.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

The C++ FE is still not happy without NON_LVALUE_EXPRs though.

Richard.

2014-11-11  Richard Biener  <rguenther@suse.de>

	* tree-core.h (pedantic_lvalues): Remove.
	* fold-const.c (pedantic_lvalues): Likewise.
	(pedantic_non_lvalue_loc): Remove conditional non_lvalue_loc call.

	c/
	* c-decl.c (c_init_decl_processing): Do not set pedantic_lvalues
	to true.

Index: trunk/gcc/c/c-decl.c
===================================================================
*** trunk.orig/gcc/c/c-decl.c	2014-10-29 13:34:20.979438627 +0100
--- trunk/gcc/c/c-decl.c	2014-11-11 14:16:04.605138651 +0100
*************** c_init_decl_processing (void)
*** 3947,3954 ****
  
    input_location = save_loc;
  
-   pedantic_lvalues = true;
- 
    make_fname_decl = c_make_fname_decl;
    start_fname_decls ();
  }
--- 3947,3952 ----
Index: trunk/gcc/fold-const.c
===================================================================
*** trunk.orig/gcc/fold-const.c	2014-11-11 10:54:01.424669165 +0100
--- trunk/gcc/fold-const.c	2014-11-11 14:15:36.954139861 +0100
*************** non_lvalue_loc (location_t loc, tree x)
*** 2160,2179 ****
    return build1_loc (loc, NON_LVALUE_EXPR, TREE_TYPE (x), x);
  }
  
- /* Nonzero means lvalues are limited to those valid in pedantic ANSI C.
-    Zero means allow extended lvalues.  */
- 
- int pedantic_lvalues;
- 
  /* When pedantic, return an expr equal to X but certainly not valid as a
     pedantic lvalue.  Otherwise, return X.  */
  
  static tree
  pedantic_non_lvalue_loc (location_t loc, tree x)
  {
-   if (pedantic_lvalues)
-     return non_lvalue_loc (loc, x);
- 
    return protected_set_expr_location_unshare (x, loc);
  }
  
--- 2160,2171 ----
Index: trunk/gcc/tree-core.h
===================================================================
*** trunk.orig/gcc/tree-core.h	2014-11-11 09:39:42.722864279 +0100
--- trunk/gcc/tree-core.h	2014-11-11 14:17:49.193134074 +0100
*************** extern GTY(()) builtin_info_type builtin
*** 1877,1886 ****
  /* If nonzero, an upper limit on alignment of structure fields, in bits,  */
  extern unsigned int maximum_field_alignment;
  
- /* Nonzero means lvalues are limited to those valid in pedantic ANSI C.
-    Zero means allow extended lvalues.  */
- extern int pedantic_lvalues;
- 
  /* Points to the FUNCTION_DECL of the function whose body we are reading.  */
  extern GTY(()) tree current_function_decl;
  
--- 1877,1882 ----


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