On Mon, Dec 10, 2001 at 11:57:12AM +0100, Franz Sirl wrote:
>
> No, that isn't the problem, Alan Modra broke it with his "obvious" patch ;-).
Oops, sorry. I should have pressed harder to move the simplified (and corrected!) 3.1 rs6000_unique_section over to the branch. That horrible section index expression
sec = ((TREE_CODE (decl) == FUNCTION_DECL ? 0 : 1) + (readonly ? 0 : 2) + (needs_sdata ? 1 : 0) + ((DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node) ? 4 : 0));
goes wrong with DECL_INITIAL (decl) == 0 && TREE_CODE (decl) != FUNCTION_DECL
Yeah, exactly, we end up with sec == 7 here, which results in a nice out-of-range access for the array.
What do you think about my patch? Avoiding code duplication is a good thing in my eyes :-). Though the patch won't apply to the mainline in it's current form, it's just your mainline stuff with a few conditionals added to fit being called from rs6000_select_section().
Franz.