This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[PATCH]: Fix gfortran regressions
- From: "Daniel Berlin" <dberlin at dberlin dot org>
- To: "GCC Patches" <gcc-patches at gcc dot gnu dot org>, "Fortran List" <fortran at gcc dot gnu dot org>
- Date: Sun, 1 Jul 2007 16:43:25 -0400
- Subject: [PATCH]: Fix gfortran regressions
I forgot that VIEW_CONVERT_EXPR was a tcc_reference expression, which
means it gets value numbered like the rest of our loads/stores.
The default case of value numbering references used to just happily
ignore the operation in question if it wasn't handled.
This means it would value number VIEW_CONVERT<int4>("A4") and
VIEW_CONVERT<int4>("A5") to the same.
To prevent this from happening in the future, I have modified the
default case to be gcc_unreachable, and made the things we were
*expecting* to fall into the default, explicit.
I will commit this once java finishes testing, it has already been
verified to fix the gfortran regressions.
Bootstrapped and regtested on i686-darwin and i686-linux
2007-07-01 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle constants
and ohter expected operations explicitly, change default to
gcc_unreachable.
Index: tree-ssa-sccvn.c
===================================================================
--- tree-ssa-sccvn.c (revision 126149)
+++ tree-ssa-sccvn.c (working copy)
@@ -524,6 +524,10 @@ copy_reference_ops_from_ref (tree ref, V
temp.op0 = TREE_OPERAND (ref, 1);
temp.op1 = TREE_OPERAND (ref, 3);
break;
+ case STRING_CST:
+ case INTEGER_CST:
+ case COMPLEX_CST:
+ case VECTOR_CST:
case VALUE_HANDLE:
case VAR_DECL:
case PARM_DECL:
@@ -532,12 +536,23 @@ copy_reference_ops_from_ref (tree ref, V
case SSA_NAME:
temp.op0 = ref;
break;
- default:
+ /* These are only interesting for their operands, their
+ existence, and their type. They will never be the last
+ ref in the chain of references (IE they require an
+ operand), so we don't have to put anything
+ for op* as it will be handled by the iteration */
+ case IMAGPART_EXPR:
+ case REALPART_EXPR:
+ case VIEW_CONVERT_EXPR:
+ case ADDR_EXPR:
break;
+ default:
+ gcc_unreachable ();
+
}
VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
- if (REFERENCE_CLASS_P (ref))
+ if (REFERENCE_CLASS_P (ref) || TREE_CODE (ref) == ADDR_EXPR)
ref = TREE_OPERAND (ref, 0);
else
ref = NULL_TREE;