[PATCH, i386]: Committed: Mark some of builtin functions const

Daniel Berlin dberlin@dberlin.org
Wed Jun 13 17:16:00 GMT 2007


On 6/13/07, Uros Bizjak <ubizjak@gmail.com> wrote:
> Daniel Berlin wrote:
> >>
> >> -      def_builtin_const (OPTION_MASK_ISA_64BIT, "__builtin_infq",
> >> ftype, IX86_BUILTIN_INFQ);
> >> +      def_builtin (OPTION_MASK_ISA_64BIT, "__builtin_infq", ftype,
> >> IX86_BUILTIN_INFQ);
> >>
> >>        ftype = build_function_type_list (float128_type_node,
> >>                                         float128_type_node,
> >>                                         NULL_TREE);
> >> -      def_builtin_const (OPTION_MASK_ISA_64BIT, "__builtin_fabsq",
> >> ftype, IX86_BUILTIN_FABSQ);
> >> +      def_builtin (OPTION_MASK_ISA_64BIT, "__builtin_fabsq", ftype,
> >> IX86_BUILTIN_FABSQ);
> >
> > Why did you deconst these?
> >
>
> Because they expand through custom expanders, and these just don't care
> about TREE_READONLY.

CONST are used for more than this.

The tree level uses it to avoid placing clobbers at call sites.
Removing const is going to increase the number of vdefs in the
program, and make optimization worse.

You should, in fact,  make all the functions ones you possibly can, const :)

>
> Uros.
>
>



More information about the Gcc-patches mailing list