diff options
author | Richard Guenther <rguenther@suse.de> | 2007-09-04 08:38:56 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-09-04 08:38:56 +0000 |
commit | 04d86531d7cf2080903ea85d27d79daa944828fb (patch) | |
tree | 333af519eb1ef7bdaff0a09aeb9d6248eee3cef5 /gcc/tree-pretty-print.c | |
parent | fc7a6a0dfa65af07a199aa34823d81800ec35f64 (diff) | |
download | gcc-04d86531d7cf2080903ea85d27d79daa944828fb.zip gcc-04d86531d7cf2080903ea85d27d79daa944828fb.tar.gz gcc-04d86531d7cf2080903ea85d27d79daa944828fb.tar.bz2 |
re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 (ok with gcc-4.2.1))
2007-09-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/33291
* tree-pretty-print.c (dump_generic_node): Dump all
qualifiers for pointer types, not only first. Dump
qualifiers for aggregate types as well.
* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Always
use the canonical type for building ARRAY_REFs.
* gimplify.c (canonicalize_addr_expr): Clean up. The
correct validness check is compatibility of the pointer
types. Always use the canonical type for building
ARRAY_REFs and ADDR_EXPRs.
* tree-ssa-forwprop.c (forward_propagate_addr_expr): Revert
change that disabled propagation of ADDR_EXPRs into statements
with volatile ops.
* gcc.dg/volatile2.c: New testcase.
* gcc.dg/pr32721.c: Adjust volatile reference pattern.
* gcc.dg/tree-ssa/forwprop-1.c: Remove xfail.
* gcc.dg/tree-ssa/forwprop-2.c: Likewise.
* gcc.dg/tree-ssa/pr17141-1.c: Likewise.
From-SVN: r128068
Diffstat (limited to 'gcc/tree-pretty-print.c')
-rw-r--r-- | gcc/tree-pretty-print.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index acc16d5..c1fd68b 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -622,9 +622,9 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, if (quals & TYPE_QUAL_CONST) pp_string (buffer, " const"); - else if (quals & TYPE_QUAL_VOLATILE) - pp_string (buffer, "volatile"); - else if (quals & TYPE_QUAL_RESTRICT) + if (quals & TYPE_QUAL_VOLATILE) + pp_string (buffer, " volatile"); + if (quals & TYPE_QUAL_RESTRICT) pp_string (buffer, " restrict"); if (TYPE_REF_CAN_ALIAS_ALL (node)) @@ -718,17 +718,26 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, case RECORD_TYPE: case UNION_TYPE: case QUAL_UNION_TYPE: - /* Print the name of the structure. */ - if (TREE_CODE (node) == RECORD_TYPE) - pp_string (buffer, "struct "); - else if (TREE_CODE (node) == UNION_TYPE) - pp_string (buffer, "union "); + { + unsigned int quals = TYPE_QUALS (node); - if (TYPE_NAME (node)) - dump_generic_node (buffer, TYPE_NAME (node), spc, flags, false); - else - print_struct_decl (buffer, node, spc, flags); - break; + if (quals & TYPE_QUAL_CONST) + pp_string (buffer, "const "); + if (quals & TYPE_QUAL_VOLATILE) + pp_string (buffer, "volatile "); + + /* Print the name of the structure. */ + if (TREE_CODE (node) == RECORD_TYPE) + pp_string (buffer, "struct "); + else if (TREE_CODE (node) == UNION_TYPE) + pp_string (buffer, "union "); + + if (TYPE_NAME (node)) + dump_generic_node (buffer, TYPE_NAME (node), spc, flags, false); + else + print_struct_decl (buffer, node, spc, flags); + break; + } case LANG_TYPE: NIY; |