On 2009-04-20 10:04:00 -0400, Joern Rennecke wrote:
>> As the bug occurs only when malloc is in the tested function,
>
> Note that gcc 'knows' that memory obtained by malloc does not
> alias other memory.

Yes, in the case of GMP, this was a GMP internal function, not malloc,
but this function is declared with __attribute__ ((malloc)), and the
bug disappears if I remove this attribute. I noticed that when I tried
to simplify the testcase.

> You can use a differently named wrapper function for malloc,
> or use the malloc attribute for another function, to experiment
> how this affects code generation.

I did a test with a wrapper function my_malloc (that just calls
malloc and returns its value), but the bug was still visible,
perhaps due to optimization.

-- 
Vincent Lefèvre <vinc...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

Reply via email to