+2002-06-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR optimization/6759
+ * cse.c (cse_insn): Fold src_eqv just once, store it folded back into
+ the REQ_EQUAL note.
+
2002-06-10 Jakub Jelinek <jakub@redhat.com>
PR c/6660
&& (tem = find_reg_note (insn, REG_EQUAL, NULL_RTX)) != 0
&& (! rtx_equal_p (XEXP (tem, 0), SET_SRC (sets[0].rtl))
|| GET_CODE (SET_DEST (sets[0].rtl)) == STRICT_LOW_PART))
- src_eqv = canon_reg (XEXP (tem, 0), NULL_RTX);
+ {
+ src_eqv = fold_rtx (canon_reg (XEXP (tem, 0), NULL_RTX), insn);
+ XEXP (tem, 0) = src_eqv;
+ }
/* Canonicalize sources and addresses of destinations.
We do this in a separate pass to avoid problems when a MATCH_DUP is
eqvmode = GET_MODE (SUBREG_REG (XEXP (dest, 0)));
do_not_record = 0;
hash_arg_in_memory = 0;
- src_eqv = fold_rtx (src_eqv, insn);
src_eqv_hash = HASH (src_eqv, eqvmode);
/* Find the equivalence class for the equivalent expression. */
* gcc.dg/20020527-1.c: New test.
+ * g++.dg/opt/cse1.C: New test.
+
2002-06-07 Roger Sayle <roger@eyesopen.com>
* gcc.dg/20020607-2.c: New test case.
--- /dev/null
+// PR optimization/6759
+// This testcase ICEd on SPARC because folded REG_EQUAL
+// note was note stored back and fold_rtx left invalid rtx
+// in it.
+// { dg-do compile }
+// { dg-options "-O2" }
+
+struct A
+{
+ long long a;
+ A (unsigned short d) : a (d) {}
+} x (65535);