summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-20 01:38:27 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-20 01:38:27 +0000
commita7ea5e81e50d7947b0d050373b6b24eb583ef5b6 (patch)
treedffc7ec646ed782d1cf4c5f053cb52946bc4ee1c /gcc/fold-const.c
parent8e65ed48d73de24422d040b4b4e85ad507cd9720 (diff)
downloadgcc-a7ea5e81e50d7947b0d050373b6b24eb583ef5b6.tar.gz
* c-decl.c (c_init_decl_processing): Set pedantic_lvalues to
true unconditionally. * c-typeck.c (unary_complex_lvalue, pedantic_lvalue_warning): Remove. (build_unary_op, build_modify_expr): Don't handle extended lvalues. (build_component_ref, build_conditional_expr): Call non_lvalue instead of pedantic_non_lvalue. (build_c_cast): Don't condition use of non_lvalue on pedantic. * fold-const.c (fold): Don't check pedantic directly for COMPOUND_EXPR. Ensure that results for COMPOUND_EXPR are passed to pedantic_non_lvalue. * doc/extend.texi: Remove documentation of extended lvalues. testsuite: * gcc.c-torture/compile/981022-1.c: Remove. * gcc.dg/array-5.c: Remove XFAIL. * gcc.dg/sequence-pt-1.c: Remove test using extended lvalues. * gcc.dg/cast-lvalue-1.c, gcc.dg/compound-lvalue-1.c, gcc.dg/cond-lvalue-1.c: Update. * gcc.dg/cast-lvalue-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76192 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index b226215e9b0..402a560cebf 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -8170,12 +8170,12 @@ fold (tree expr)
case COMPOUND_EXPR:
/* When pedantic, a compound expression can be neither an lvalue
nor an integer constant expression. */
- if (TREE_SIDE_EFFECTS (arg0) || pedantic)
+ if (TREE_SIDE_EFFECTS (arg0) || TREE_CONSTANT (arg1))
return t;
/* Don't let (0, 0) be null pointer constant. */
if (integer_zerop (arg1))
- return build1 (NOP_EXPR, type, arg1);
- return convert (type, arg1);
+ return pedantic_non_lvalue (build1 (NOP_EXPR, type, arg1));
+ return pedantic_non_lvalue (convert (type, arg1));
case COMPLEX_EXPR:
if (wins)