Gabriel,
I'm attaching two gzipped tar files, one that includes the makefile, source file, and all files generated by the unpatched svn Cil, and another that includes the same files after applying my patch. I wasn't exactly sure which ones you wanted, but they were small enough to send everything and let you decide.

I agree with you that my patch may not be correct. I wasn't entirely sure how Cil was deciding how to modify builtins, and I'm also not sure about the GCC specification. I do think, however, that the patch is in the right place, and, as you can see by diffing the output files from the two attachments, the extra increment is eliminated, which was my immediate goal.

Jesse

On 02/15/2011 08:00 AM, Gabriel Kerneis wrote:
On Thu, Feb 03, 2011 at 02:13:12PM -0500, Jesse M Draper wrote:
My patch to src/frontc/cabs2cil.ml checks for
"__builtin_object_size" and, following the pattern in
"__builtin_constant_p", drops the side effects.
I am not convinced this patch is correct (although current behaviour is
obviously a bug).  Gcc doc states:
     If there are any side-effects in them, it returns (size_t) -1 for
     type 0 or 1 and (size_t) 0 for type 2 or 3.
which your patch does not perform.

I'll think about it.

I have not been able to reproduce the problem on my Ubuntu system
because its gcc does not generate the call to __builtin_object_size,
and I have not figured out how gcc decides whether or not to generate
it.
Could you please send the cilbug.c.i (produced on MacOS X)?  I would
like to include it in the testsuite.

Best,

Attachment: cilsvnbug.tar.gz
Description: GNU Zip compressed data

Attachment: cilsvnbugfixed.tar.gz
Description: GNU Zip compressed data

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to