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 PR tree-optimization/19967.


Hi Kazu,

On Tue, 15 Feb 2005, Kazu Hirata wrote:
> Consider the testcase below.  The comment there pretty much says what
> the problem is.  The return type of strstr and the like needs to be
> "char *" rather than "const char *", and builtin folders need to take
> that into account.

Forgive me for asking this to be solved slightly differently, but
my personal preference would be to instead change the prototypes
of fold_builtin_strstr and friends to take both a "arglist" and
"type", as we do for many other fold_builtin_foo functions.  You
can then fold_convert the result to type "type" rather than calling
build_type_no_quals to build a new type.  fold shouldn't need to
create new types, and this should helps ensure that

	TREE_TYPE (fold (t)) == TREE_TYPE (t)

[Not always guaranteed but aspired to :)]


Consider those changes pre-approved, if it bootstraps and regression
tests without problems.


> 2005-02-15  Kazu Hirata  <kazu@cs.umass.edu>
>
> 	PR tree-optimization/19967
> 	* builtins.c (fold_builtin_strstr): Convert the folded result
> 	to "char *".

You also need to list all of the modified functions in the ChangeLog :>


Many thanks for fixing this.

Roger
--


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