This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix GC problem with complex types



On Nov 23, 2004, at 1:25 PM, Janis Johnson wrote:


On Mon, Nov 22, 2004 at 09:28:54PM -0500, Andrew Pinski wrote:
We are GCing some complex types which we still have reference to.
The problem is the the variable which stores last vector type is not
marked with GTY, this fixes the problem.  The reason why I also marked
the int as GTY is because if we don't we could have a possible PCH
problem but I did not test that patch at all.

OK? Bootstrapped and tested on ppc-darwin with no regressions.

I tried this with my original testcase on powerpc-linux and it still segfaults, then tried it with the small testcase from the PR with ggc params to force frequent garbage collection and that fails.

Oh, know why this did not fix the problem, I had forgot to add it to the GTFILES (why is needed again, why can't this be done automatically). I also added the assert in build_word_mode_vector_type like there is in the bug report. And fixed where the GTY markers should be, before the type.

OK? Bootstrapped and tested on powerpc-darwin with no regressions.

Thanks,
Andrew Pinski

Testcase:
/* { dg-do compile } */
/* { dg-options "--param ggc-min-expand=0 -param ggc-min-heapsize=0" } */
__attribute__ ((vector_size (64))) unsigned char v1, v2, v3;
void
vadd (void)
{
v1 = v2 + v3;
}
void
test_add (void)
{
vadd ();
}
void
vsub (void)
{
v1 = v2 - v3;
}


ChangeLog:

	* tree-complex.c (vector_inner_type): New variable moved from
	build_word_mode_vector_type.
	(vector_last_type): Likewise.
	(vector_last_nunits): Likewise.
	(build_word_mode_vector_type): Use the new variables.
	* Makefile.in (tree-complex.o): Add gt-tree-complex.h $(GGC_H).
	(GTFILES): Add tree-complex.c.
	(gt-tree-complex.h): New rule, add it to the rest of the gt-* rules.
	

Attachment: temp.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]