folding STRING_CST + INTEGER_CST

Aldy Hernandez aldyh@redhat.com
Mon Jun 24 21:58:00 GMT 2002


> We'd need to ensure that "hello"+3 != "HELlo"+3 (while still having "lo"
> == "lo"), as well as that (("hello"+3)-3) == "hello", and so on.

ahhhh!

another alternative is to fold STRING_CST+INTEGER_CST when we are
building the trees for certain builtins accepting "const char *".  
the following come to mind:

	strspn, strstr, strcspn, strrchr, strchr, index, fputs

...since we know we don't need equality operations on them.

aldy



More information about the Gcc mailing list