This is the mail archive of the
mailing list for the GCC project.
The road to fixing 16306
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: gcc-patches at gcc dot gnu dot org, law at redhat dot com, amacleod at redhat dot com
- Date: Sat, 25 Dec 2004 19:22:26 -0500
- Subject: The road to fixing 16306
This is the first of two parts for fixing 16306, a regression where we
decide to copy-prop a non-restricted pointer into a restricted one,
losing the restrict information in the process.
This is part one because out-of-ssa coalesces the variables as well,
causing the regression to still occur.
However, i'm unclear on how to fix out-of-ssa (in a way that isn't a
For DOM, it suffices to just tell it to not copy-prop from a
non-restrict qualified pointer into a restrict qualified one.
Bootstrapped and regtested on i686-pc-linux-gnu.
Okay for mainline?
2004-12-25 Daniel Berlin <firstname.lastname@example.org>
* tree-ssa-dom.c (record_equivalences_from_stmt): Don't copy-prop from a
non-restrict qualified type into a restricted one.
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dom.c,v
retrieving revision 2.80
diff -u -p -r2.80 tree-ssa-dom.c
--- tree-ssa-dom.c 13 Dec 2004 20:12:33 -0000 2.80
+++ tree-ssa-dom.c 26 Dec 2004 00:09:57 -0000
@@ -2645,7 +2645,8 @@ record_equivalences_from_stmt (tree stmt
if (lhs_code == SSA_NAME)
tree rhs = TREE_OPERAND (stmt, 1);
+ tree rhstype = TREE_TYPE (rhs);
+ tree lhstype = TREE_TYPE (lhs);
/* Strip away any useless type conversions. */
@@ -2657,7 +2658,10 @@ record_equivalences_from_stmt (tree stmt
just costs time and space. */
&& (TREE_CODE (rhs) == SSA_NAME
- || is_gimple_min_invariant (rhs)))
+ || is_gimple_min_invariant (rhs))
+ /* Don't copy-prop a non-restricted type into a restricted one, but
+ allow the reverse. */
+ && (TYPE_RESTRICT (lhstype) <= TYPE_RESTRICT (rhstype)))
SSA_NAME_VALUE (lhs) = rhs;
/* alloca never returns zero and the address of a non-weak symbol