------- Comment #7 from dfranke at gcc dot gnu dot org 2008-12-29 14:25 ------- (In reply to comment #4) > Here is a testcase which we would not get unless we take intent(in) into > account: [...] > foo should always be zero as bar should not be able to touch b or c.
Is this really related to the INTENT? For the equivalent C/C++ cases, I tried prototypes with int, int*, const int*, int& and const int& respectively -- only if the arguments are passed by value, the return value of foo is optimized to zero (as shown by "-O3 -fdump-tree-optimized"). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23169