The following avoids propagating abnormals with the recent tweak
to look through PRE introduced copies between equal values.
PR tree-optimization/110777
* tree-ssa-sccvn.cc (eliminate_dom_walker::eliminate_avail):
Avoid propagating abnormals.
* gcc.dg/pr110777.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -w" } */
+
+void pm_message (int);
+int *findOrAddBackgroundInPalette_palette_pnm;
+static void findOrAddBackgroundInPalette(unsigned *paletteSizeP,
+ int *backgroundIndexP) {
+ if (*paletteSizeP) {
+ *backgroundIndexP = (*paletteSizeP)++;
+ pm_message(0);
+ }
+ pm_message(findOrAddBackgroundInPalette_palette_pnm[*backgroundIndexP]);
+}
+void computeColorMap(int *backgroundIndexP) {
+ unsigned paletteSize;
+ findOrAddBackgroundInPalette(&paletteSize, backgroundIndexP);
+}
+int main() {
+ unsigned backgroundIndex;
+ _setjmp();
+ computeColorMap(&backgroundIndex);
+}
if (gimple_assign_rhs_class (ass) == GIMPLE_SINGLE_RHS)
{
tree rhs1 = gimple_assign_rhs1 (ass);
- if (CONSTANT_CLASS_P (rhs1) || TREE_CODE (rhs1) == SSA_NAME)
+ if (CONSTANT_CLASS_P (rhs1)
+ || (TREE_CODE (rhs1) == SSA_NAME
+ && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs1)))
av = rhs1;
}
return av;