------- Comment #1 from matz at gcc dot gnu dot org 2009-05-02 02:34 ------- The assert triggers because of a real pre-existing bug. local variables with DECL_HARD_REGISTER set must not be put into SSA form. is_gimple_reg has to return false for them. It doesn't anymore since some changes by richi (CCed), I think.
Te update_address_taken pass sets DECL_GIMPLE_REG_P on the sp_r1 variable. This is because of the special handling of vector modes. But it doesn't take into account variables which can't be gimple_reg for other reasons than simply being of wrong type. I think the 2009-03-31 change in is_gimple_reg that moved the DECL_GIMPLE_REG_P handling earlier might be the cause. But fixing it there probably is not enough, it's better to not set DECL_GIMPLE_REG_P at all on this VAR_DECL. The same is true for volatile decl (in this example it has a hardreg _and_ is volatile even), which also seems to be ignored in the address_taken pass. This whole business of special-casing COMPLEX_TYPE and VECTOR_TYPE regarding gimple regs seems highly dubious to me. The different places setting this flag freely use a random mixture of tests on !TREE_THIS_VOLATILE (t) and/or (TREE_CODE (t) == VAR_DECL && !DECL_HARD_REGISTER (t)) and/or !needs_to_live_in_memory (t)) or sometimes nothing at all. In fact at least all three of these tests are required everywhere, except where it's clear that we just created a completely new temporary. Meanwhile the immediate problem can be fixed by the below patch: Index: tree-ssa.c =================================================================== --- tree-ssa.c (Revision 147044) +++ tree-ssa.c (Arbeitskopie) @@ -1573,7 +1573,10 @@ execute_update_addresses_taken (bool do_ if (!DECL_GIMPLE_REG_P (var) && !bitmap_bit_p (not_reg_needs, DECL_UID (var)) && (TREE_CODE (TREE_TYPE (var)) == COMPLEX_TYPE - || TREE_CODE (TREE_TYPE (var)) == VECTOR_TYPE)) + || TREE_CODE (TREE_TYPE (var)) == VECTOR_TYPE) + && !TREE_THIS_VOLATILE (var) + && (TREE_CODE (var) == VAR_DECL && !DECL_HARD_REGISTER (var)) + && !needs_to_live_in_memory (var)) { DECL_GIMPLE_REG_P (var) = 1; mark_sym_for_renaming (var); -- matz at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu dot | |org Summary|[4.5 Regression] r1467817 |[4.5 Regression] r146817 |broke libgloss build for SPU|broke libgloss build for SPU http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40001