https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85503

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
base here is a constant pool constant, containing
(const:DI (plus:DI (symbol_ref:DI ("_ZN26OnHoverHandlerGraphicsItem7cornersE")
[flags 0xc0] <var_decl 0x7fffefa59ea0 corners>)
        (const_int 8 [0x8])))
so this fails both because the symbol_ref in there isn't a constant pool
address, but address of a static data member, but also because it isn't a
symbol_ref, but address within that static data member.

At least for now, I think easiest is to adjust const_load_sequence_p, so that
it better matches what replace_swapped_load_constant expects.
--- gcc/config/rs6000/rs6000-p8swap.c.jj        2018-03-20 22:05:58.000000000
+0100
+++ gcc/config/rs6000/rs6000-p8swap.c   2018-04-23 21:12:22.259096174 +0200
@@ -593,8 +593,10 @@ const_load_sequence_p (swap_web_entry *i
                 remove this special test.  */
              rtx const_vector = get_pool_constant (base);
              if (GET_CODE (const_vector) == SYMBOL_REF
-                 && !CONSTANT_POOL_ADDRESS_P (const_vector))
-                   return false;
+                 && CONSTANT_POOL_ADDRESS_P (const_vector))
+               const_vector = get_pool_constant (const_vector);
+             if (GET_CODE (const_vector) != CONST_VECTOR)
+               return false;
            }
        }
     }

Reply via email to