[PATCH] Optimize strcpy(p, "abc") and memcpy(p, "abc", 4) (take 2)

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Sun Nov 26 18:49:00 GMT 2000


 > 2000-11-26  Jakub Jelinek  <jakub@redhat.com>
 > 
 >         * expr.h (store_by_pieces): Add prototype.
 >         * expr.c (struct store_by_pieces): Renamed from clear_by_pieces.
 >         (store_by_pieces): New.
 >         (clear_by_pieces): New.
 >         (clear_by_pieces_1): New.
 >         (store_by_pieces_1): Renamed from clear_by_pieces, handle storing
 >         arbitrary compiler generated constants into memory block.
 >         (store_by_pieces_2): Renamed from clear_by_pieces_1, likewise.

Could store_by_pieces be used to inline memset with an arbitrary
"value" parameter?  I.e. if the value is 'a' and len 5, create a
string "aaaaa" and do the same thing builtin memcpy does?

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions


More information about the Gcc-patches mailing list