diff options
author | Jason Merrill <jason@casey.soma.redhat.com> | 2000-06-06 00:15:37 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2000-06-05 20:15:37 -0400 |
commit | a7833bec2c0ac811e6410bb7dbd41c07b7c58c8d (patch) | |
tree | 58c1726948217376f8b52442cc2f1011662e5064 | |
parent | 3ae18eaf85fbb012583730c8312aca6286b6275f (diff) | |
download | gcc-a7833bec2c0ac811e6410bb7dbd41c07b7c58c8d.zip gcc-a7833bec2c0ac811e6410bb7dbd41c07b7c58c8d.tar.gz gcc-a7833bec2c0ac811e6410bb7dbd41c07b7c58c8d.tar.bz2 |
fold-const.c (fold, [...]): Elide conversion between cv-qualified versions of types.
* fold-const.c (fold, case COND_EXPR): Elide conversion between
cv-qualified versions of types.
From-SVN: r34416
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fold-const.c | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 649a871..e0195c7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-06-05 Jason Merrill <jason@casey.soma.redhat.com> + + * fold-const.c (fold, case COND_EXPR): Elide conversion between + cv-qualified versions of types. + Mon Jun 5 14:06:18 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * config/sparc/sparc.c (short_branch): Correct error in range diff --git a/gcc/fold-const.c b/gcc/fold-const.c index ca50852..3b759e8 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -6903,6 +6903,10 @@ fold (expr) tree comp_op1 = TREE_OPERAND (arg0, 1); tree comp_type = TREE_TYPE (comp_op0); + /* Avoid adding NOP_EXPRs in case this is an lvalue. */ + if (TYPE_MAIN_VARIANT (comp_type) == TYPE_MAIN_VARIANT (type)) + comp_type = type; + switch (comp_code) { case EQ_EXPR: |