aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-04-12 12:45:58 -0700
committerJim Wilson <wilson@gcc.gnu.org>1993-04-12 12:45:58 -0700
commitb76478952ba40bfb81febeeb3f76983b53cdff5e (patch)
tree104e76477bdd453015d1f3c59b1cf03d5e08cdaa /gcc
parent29df70e6ff84935cebf6aa0e568d1fbf8234fb31 (diff)
downloadgcc-b76478952ba40bfb81febeeb3f76983b53cdff5e.zip
gcc-b76478952ba40bfb81febeeb3f76983b53cdff5e.tar.gz
gcc-b76478952ba40bfb81febeeb3f76983b53cdff5e.tar.bz2
(fold...
(fold, COMPOUND_EXPR case): When pedantic, don't simplify a COMPOUND_EXPR, so that it won't be mistaken for an lvalue or an integer constant expression. From-SVN: r4103
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fold-const.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index bc23a4e..5e79960 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -4413,7 +4413,9 @@ fold (expr)
return t;
case COMPOUND_EXPR:
- if (TREE_SIDE_EFFECTS (arg0))
+ /* When pedantic, a compound expression can be neither an lvalue
+ nor an integer constant expression. */
+ if (TREE_SIDE_EFFECTS (arg0) || pedantic)
return t;
/* Don't let (0, 0) be null pointer constant. */
if (integer_zerop (arg1))