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: PATCH for tree-to-rtl expansion of C functions


This patch looks incorrect.  First if there are new testsuite failures
you need to modify the testcases so they no longer fail.  E.g. it
should be possible by checking "&& ! defined (__OPTIMIZE_SIZE__)" in
stdio-opt-1.c.

Ok, I will create a patch for the testcase as well.


Second, you seem to not only disable the fprintf->fwrite
transformation, but also fprintf->fputs transformation.  The latter
shouldn't cause any extra arguments or registers used, in fact it may
decrease the number for fprintf(s, "%s", "foo") -> fputs("foo", s)
because the "%s" no longer needs to be passed to the stdio function.

Ok, I will not modify c-common.c. However, I made some measurements on our testbed and surprisingly the overall result was that preventing fprintf->fputs transformation produced significant size reduction (with transformation 0.3% vs. 0.5% without). One cause for this was the opposite order of passing arguments to fprintf and fputs, which cause other instructions and registers to be reorganized.


Regards,
  Arpad.



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