diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3eeb33f830707634fcf17487f38e618d36ed82c4..2132888d522cd20bb744e3c2255a8d7a216ef67d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2006-01-24  Andrew Pinski  <pinskia@physics.uc.edu>
+
+	PR tree-opt/25860
+	* tree-ssa-pre.c (phi_translate): Return NULL
+	for AGGREGATE_TYPE's.
+
 2006-01-24  Zack Weinberg  <zackw@panix.com>
 
 	* genautomata.c (process_state_for_insn_equiv_partition):
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3434543725a4c42adedf2da17393ff44f90da84f..b44c815dcf758a05d0d16fae7b4b91634fcf4aee 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-01-24  Andrew Pinski  <pinskia@physics.uc.edu>
+
+	PR tree-opt/25860
+	* gcc.c-torture/compile/pr25860.c: New test.
+
 2006-01-24  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
 	PR c++/25552
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr25860.c b/gcc/testsuite/gcc.c-torture/compile/pr25860.c
new file mode 100644
index 0000000000000000000000000000000000000000..033b567d8dee3959803725b2c955627d05e5f36b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr25860.c
@@ -0,0 +1,20 @@
+/* We used to ICE because PRE would try to PRE the load of *Note from the
+   loop. */
+
+struct g
+{
+  int i;
+};
+struct f
+{
+  struct g i;
+};
+int GSM_RingNoteGetFullDuration(struct g)__attribute__((const));
+void savewav(struct f *gg)
+{
+  struct g *Note;
+  long i = 0,j,length=0;
+  Note = &gg->i;
+  for (j=0;j<GSM_RingNoteGetFullDuration(*Note);j++)
+    ;
+}
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index a695e90807bcd98e3070df2d53dd4781a96cfc0e..ebc40cff5d7636e4a7cbb81a9e17ed5ae7ae2dca 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -1159,7 +1159,8 @@ phi_translate (tree expr, value_set_t set, basic_block pred,
 	VEC (tree, gc) * oldvuses = NULL;
 	VEC (tree, gc) * newvuses = NULL;
 
-	if (TREE_CODE (expr) != INDIRECT_REF)
+	if (TREE_CODE (expr) != INDIRECT_REF
+	    || AGGREGATE_TYPE_P (TREE_TYPE (expr)))
 	  return NULL;
 
 	newop1 = phi_translate (find_leader (set, oldop1),