VEC issues in GCC 4.3.0

Ian Lance Taylor iant@google.com
Fri Jun 19 14:54:00 GMT 2009


prashant rawat <pic.srawat@gmail.com> writes:

> I am using working on adding a few interprocedural data flow analysis
> passes on GCC 4.3.0 for my project.
> In the initialization pass, I collect all the required analysis
> information for each cgraph node in a data structure, and push it in
> VEC (with heap allocation). Then in the next passes meant for
> performing AVE, PAV, RD, PRE and other analyses, I use this VEC to
> retrieve information for each cgraph node.
> However, due to some reasons, I am getting all garbage values for some
> functions while making gcc (eg. while compiling function bid128_add.c)
> I retrieved the VEC information just after pushing in the
> initialization pass, and it valid. However, when I try to retrieve
> values from the VEC in the other passes, I get garbage values. I even
> made sure that all the other analyses passes do nothing but to only
> print the VEC values, so that there is no question of modification of
> the VEC values. However I still get the garbage values.
>
> Has anyone else faced such a problem with VEC? What could possibly be
> going wrong when the values pushed in the VEC are correct, but they
> get mangled in between the passes?
> (I tried using gc instead of heap, it doesnt work)

If anything you push on your VEC is or points to garbage collected
memory--e.g., the tree data structure--then you need to use VEC(TYPE,gc)
rather than VEC(TYPE,heap).  When you say that using gc instead of heap
doesn't work, do you mean that it fails in the same way, or in a
different way?

If using VEC(TYPE,gc) fails in the same way--if the values are valid at
the end of your pass but invalid in later passes--then I think you need
to tell us more about what sort of data you are storing and what the
garbage values look like when you retrieve them.

You may find it useful to configure with --enable-checking.  That is the
default for the development sources but not for releases.

Ian



More information about the Gcc-help mailing list