diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-03 16:10:36 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-03 16:10:36 +0000 |
commit | b0d55af98f2b56baf63412b9fbbba328cc47c5ea (patch) | |
tree | 62c86844e52b8e51458705334fbece00cb800c65 /gcc/c-family | |
parent | 220a05bbae7a0b5202afb5ec20624d879b3e14f6 (diff) | |
download | ppe42-gcc-b0d55af98f2b56baf63412b9fbbba328cc47c5ea.tar.gz ppe42-gcc-b0d55af98f2b56baf63412b9fbbba328cc47c5ea.zip |
2010-12-03 Richard Guenther <rguenther@suse.de>
PR c/46745
* c-pretty-print.c (pp_c_postfix_expression): Handle MEM_REF.
(pp_c_unary_expression): Likewise.
(pp_c_expression): Likewise.
cp/
* error.c (dump_expr): Handle MEM_REF.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167433 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/c-family/c-pretty-print.c | 31 |
2 files changed, 38 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 84eef7d7453..2ea3960170f 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,10 @@ +2010-12-03 Richard Guenther <rguenther@suse.de> + + PR c/46745 + * c-pretty-print.c (pp_c_postfix_expression): Handle MEM_REF. + (pp_c_unary_expression): Likewise. + (pp_c_expression): Likewise. + 2010-11-30 Nicola Pero <nicola.pero@meta-innovation.com> * c-common.h (objc_finish_function): New. diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c index d72ff309753..843e7a4224e 100644 --- a/gcc/c-family/c-pretty-print.c +++ b/gcc/c-family/c-pretty-print.c @@ -1531,6 +1531,10 @@ pp_c_postfix_expression (c_pretty_printer *pp, tree e) } break; + case MEM_REF: + pp_c_expression (pp, e); + break; + case COMPLEX_CST: case VECTOR_CST: pp_c_compound_literal (pp, e); @@ -1661,6 +1665,32 @@ pp_c_unary_expression (c_pretty_printer *pp, tree e) pp_c_cast_expression (pp, TREE_OPERAND (e, 0)); break; + case MEM_REF: + if (TREE_CODE (TREE_OPERAND (e, 0)) == ADDR_EXPR + && integer_zerop (TREE_OPERAND (e, 1))) + pp_c_expression (pp, TREE_OPERAND (TREE_OPERAND (e, 0), 0)); + else + { + pp_c_star (pp); + if (!integer_zerop (TREE_OPERAND (e, 1))) + { + pp_c_left_paren (pp); + if (!integer_onep (TYPE_SIZE_UNIT + (TREE_TYPE (TREE_TYPE (TREE_OPERAND (e, 0)))))) + pp_c_type_cast (pp, ptr_type_node); + } + pp_c_cast_expression (pp, TREE_OPERAND (e, 0)); + if (!integer_zerop (TREE_OPERAND (e, 1))) + { + pp_plus (pp); + pp_c_integer_constant (pp, + fold_convert (ssizetype, + TREE_OPERAND (e, 1))); + pp_c_right_paren (pp); + } + } + break; + case REALPART_EXPR: case IMAGPART_EXPR: pp_c_ws_string (pp, code == REALPART_EXPR ? "__real__" : "__imag__"); @@ -2065,6 +2095,7 @@ pp_c_expression (c_pretty_printer *pp, tree e) case CONJ_EXPR: case ADDR_EXPR: case INDIRECT_REF: + case MEM_REF: case NEGATE_EXPR: case BIT_NOT_EXPR: case TRUTH_NOT_EXPR: |