This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Builtin strcpy/strncpy/memcpy/strcmp/fputs fixes and optimizations
- To: jakub at redhat dot com, rth at redhat dot com
- Subject: Re: [PATCH] Builtin strcpy/strncpy/memcpy/strcmp/fputs fixes and optimizations
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Thu, 30 Nov 2000 08:59:35 -0500 (EST)
- Cc: gcc-patches at gcc dot gnu dot org
> From: Jakub Jelinek <jakub@redhat.com>
>
> fputs ("foobar" + (i++ & 3), f) and miscompile
>
> To sum up, c_getstr guarantees the argument is constant string with constant
> length without side effects if returning non-NULL, while c_strlen does not
> (I think it just guarantees that if it returns an INTEGER_CST that it does
> not have side effects).
I want to make sure I understand this. The c_strlen() function won't
return an INTEGER_CST for the fputs() case above but *will* return a
non-NULL tree expr which corresponds to "6 - (i++ & 3)", right?
That's why you have to check whether its an INTEGER_CST or prefer
c_getstr?
Thanks,
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions