This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR21595
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 16 May 2005 20:36:42 -0600 (MDT)
- Subject: Re: [PATCH] Fix PR21595
On Mon, 16 May 2005, Richard Guenther wrote:
> 2005-05-16 Richard Guenther <firstname.lastname@example.org>
> PR middle-end/21595
> * builtins.c (fold_builtin_constant_p): Handle
> &"string cst" as constant.
> * g++.dg/tree-ssa/builtin1.C: New testcase.
This is OK for mainline, and after a few days for the gcc-4_0 branch
as it is a regression from 3.4.
We should be able to consider array references other than 0 to also
be constant, but I appreciate there are middle-end representation
issues that may complicate things. "foo" + 0 = "foo", but "foo" + 1
!= "oo", when expressed in terms of STRING_CST.
> int main()
> if (! __builtin_constant_p (&"Hello"))
My maintainer-sense is tingling that it may be preferable to add
a "return 0;" at the end of main in this testcase. I can't quite
put my finger on why, as this is a link rather than an execution
test, but given that exiting main without a return value isn't a
part of this test, there's no reason to anger the coding style gods.
This tweak to the testcase is preapproved.