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, TREE_LIST removal] remove calls to build_constructor_from_list from coverage.c


On Wed, May 12, 2010 at 4:31 AM, Nathan Froyd <froydnj@codesourcery.com> wrote:
>> Please track revisions you port in http://gcc.gnu.org/PR43977.
>
> Ack, will do. ?I see that you already tackled this bit.

Well, I tried, but not one patch bootstrapped without changes. And my
only fast development machine is broken at the moment so I haven't
made much progress these last few days.

Anyway, the coverage.c changes are r114291, r114400, and r114401. Are
you going to take care of these three?


> Pushing the computation of TREE_CONSTANT down into build_constructor
> seems reasonable enough--eventually build_constructor_from_list will go
> away and we'd have to compute it there anyway. ?I see a couple of places
> where a front-end directly sets TREE_CONSTANT on the result of
> build_constructor...but I don't think it's worth trying to split
> build_constructor into a variant that sets TREE_CONSTANT and one that
> doesn't.

Agreed.


> Index: tree.c
> ===================================================================
> --- tree.c ? ? ?(revision 159280)
> +++ tree.c ? ? ?(working copy)
> @@ -1332,8 +1332,19 @@ tree
> ?build_constructor (tree type, VEC(constructor_elt,gc) *vals)
> ?{
> ? tree c = make_node (CONSTRUCTOR);
> + ?unsigned int i;
> + ?constructor_elt *elt;
> + ?bool constant_p = true;
> +
> ? TREE_TYPE (c) = type;
> ? CONSTRUCTOR_ELTS (c) = vals;
> +
> + ?for (i = 0; VEC_iterate (constructor_elt, vals, i, elt); i++)
> + ? ?if (!TREE_CONSTANT (elt->value))
> + ? ? ?constant_p = false;

add a "break" here.


> +
> + ?TREE_CONSTANT (c) = constant_p;
> +
> ? return c;
> ?}


Ciao!
Steven


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