[PATCH] Builtin strcpy/strncpy/memcpy/strcmp/fputs fixes and optimizations

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Thu Nov 30 05:59:00 GMT 2000


 > 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


More information about the Gcc-patches mailing list