Commit 7b668f9e by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/6759 (ice when compiling 32 bit sparc code)

	PR optimization/6759
	* cse.c (cse_insn): Fold src_eqv just once, store it folded back into
	the REQ_EQUAL note.

	* g++.dg/opt/cse1.C: New test.

From-SVN: r54469
parent 85d49058
2002-06-10 Jakub Jelinek <jakub@redhat.com> 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 PR c/6660
* c-decl.c (grokfield): Allow user defined types if they declare * c-decl.c (grokfield): Allow user defined types if they declare
structs or unions for unnamed fields. structs or unions for unnamed fields.
......
...@@ -4915,7 +4915,10 @@ cse_insn (insn, libcall_insn) ...@@ -4915,7 +4915,10 @@ cse_insn (insn, libcall_insn)
&& (tem = find_reg_note (insn, REG_EQUAL, NULL_RTX)) != 0 && (tem = find_reg_note (insn, REG_EQUAL, NULL_RTX)) != 0
&& (! rtx_equal_p (XEXP (tem, 0), SET_SRC (sets[0].rtl)) && (! rtx_equal_p (XEXP (tem, 0), SET_SRC (sets[0].rtl))
|| GET_CODE (SET_DEST (sets[0].rtl)) == STRICT_LOW_PART)) || 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. /* Canonicalize sources and addresses of destinations.
We do this in a separate pass to avoid problems when a MATCH_DUP is We do this in a separate pass to avoid problems when a MATCH_DUP is
...@@ -5019,7 +5022,6 @@ cse_insn (insn, libcall_insn) ...@@ -5019,7 +5022,6 @@ cse_insn (insn, libcall_insn)
eqvmode = GET_MODE (SUBREG_REG (XEXP (dest, 0))); eqvmode = GET_MODE (SUBREG_REG (XEXP (dest, 0)));
do_not_record = 0; do_not_record = 0;
hash_arg_in_memory = 0; hash_arg_in_memory = 0;
src_eqv = fold_rtx (src_eqv, insn);
src_eqv_hash = HASH (src_eqv, eqvmode); src_eqv_hash = HASH (src_eqv, eqvmode);
/* Find the equivalence class for the equivalent expression. */ /* Find the equivalence class for the equivalent expression. */
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
* gcc.dg/20020527-1.c: New test. * gcc.dg/20020527-1.c: New test.
* g++.dg/opt/cse1.C: New test.
2002-06-07 Roger Sayle <roger@eyesopen.com> 2002-06-07 Roger Sayle <roger@eyesopen.com>
* gcc.dg/20020607-2.c: New test case. * gcc.dg/20020607-2.c: New test case.
......
// 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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment