This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc/*: Deletion of unnecessary processing


Hello All

Miura Yasuyuki wrote:
Small correction.
I shortened initialization.

-- Yasuyuki

2007-09-18 Miura Yasuyuki <kokosabu@gmail.com>

* fond-const.c: Deletion of unnecessary processing.

Typo, fold not fond



Index: fold-const.c =================================================================== --- fold-const.c (revision 128577) +++ fold-const.c (working copy) @@ -665,10 +665,8 @@

memset (quo, 0, sizeof quo);

-  memset (num, 0, sizeof num); /* to zero 9th element */
-  memset (den, 0, sizeof den);
-
   encode (num, lnum, hnum);
+  num[4] = 0;  /* to zero 9th element */
   encode (den, lden, hden);

/* Special code for when the divisor < BASE. */



Is such a micro optimization requiring the effort? I find the original memset much easier to read, and much more robust to code changes....

I'm not an expert about fold-const.c code....

But next year, I am not sure that many GCC developers would understand the
   num[4] = 0;  /* to zero 9th element */
statement. I'm not understanding it today!

Of course, if this optimisation is winning 1% of CPU time I understand it is worth doing.

Just my (newbie in fold-const.c) impression.

Regards

--
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]