diff options
author | Richard Guenther <rguenther@suse.de> | 2010-01-13 22:21:25 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-01-13 22:21:25 +0000 |
commit | 5db959b6480186de1df9242f5b91d5e7fa75c30a (patch) | |
tree | 359c4896609ee7f80473c97fa28f6fc3f69ed247 /gcc/tree-ssa-ccp.c | |
parent | 30c73d1a3664f84897116ceb7a81cba553c8d52f (diff) | |
download | gcc-5db959b6480186de1df9242f5b91d5e7fa75c30a.zip gcc-5db959b6480186de1df9242f5b91d5e7fa75c30a.tar.gz gcc-5db959b6480186de1df9242f5b91d5e7fa75c30a.tar.bz2 |
re PR tree-optimization/42730 (ice: verify_stmts failed)
2010-01-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42730
* tree-ssa-ccp.c (maybe_fold_stmt_indirect): Add shortcut for
offset zero.
* gcc.c-torture/compile/pr42730.c: New testcase.
From-SVN: r155872
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index f3f113c..b40dba3 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -2120,6 +2120,10 @@ maybe_fold_stmt_indirect (tree expr, tree base, tree offset) && is_gimple_min_invariant (DECL_INITIAL (base))) return DECL_INITIAL (base); + /* If there is no offset involved simply return the folded base. */ + if (integer_zerop (offset)) + return base; + /* Try folding *(&B+O) to B.X. */ t = maybe_fold_offset_to_reference (loc, base_addr, offset, TREE_TYPE (expr)); |