This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] 4.3 regression: CSE clobbers EH reg
- From: "Andreas Krebbel" <Andreas dot Krebbel at de dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 20 Feb 2008 11:14:40 +0100
- Subject: [PATCH] 4.3 regression: CSE clobbers EH reg
Hello,
cse currently does not respect the artificial defs done at bb start.
So it happens for the 27_io/ios_base/storage/2.cc on s390. Cse claims
to already know the value of an eh register from a previous bb and
reuses that instead of taking the value set by the eh code.
The attached patch invalidates all regs with artificial defs at bb
start when switching to a new bb along the path.
This fixes the testcase on s390 and s390x.
Bootstrapped on x86_64, s390 and s390x.
No regressions.
Ok for 4.3 and mainline?
Bye,
-Andreas-
2008-02-20 Andreas Krebbel <krebbel1@de.ibm.com>
* cse.c (cse_extended_basic_block): Invalidate artificial defs
at bb start.
Index: gcc/cse.c
===================================================================
*** gcc/cse.c.orig 2008-02-19 14:26:21.000000000 +0100
--- gcc/cse.c 2008-02-19 16:41:44.000000000 +0100
*************** cse_extended_basic_block (struct cse_bas
*** 5975,5980 ****
--- 5975,5995 ----
int no_conflict = 0;
bb = ebb_data->path[path_entry].bb;
+
+ /* Invalidate recorded information for eh regs if there is an EH
+ edge pointing to that bb. */
+ if (bb_has_eh_pred (bb))
+ {
+ struct df_ref **def_rec;
+
+ for (def_rec = df_get_artificial_defs (bb->index); *def_rec; def_rec++)
+ {
+ struct df_ref *def = *def_rec;
+ if (DF_REF_FLAGS (def) & DF_REF_AT_TOP)
+ invalidate (DF_REF_REG (def), GET_MODE (DF_REF_REG (def)));
+ }
+ }
+
FOR_BB_INSNS (bb, insn)
{
/* If we have processed 1,000 insns, flush the hash table to