This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/23169] INTENT information not used in the middle-end for optimizations
- From: "dfranke at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Dec 2008 14:25:50 -0000
- Subject: [Bug fortran/23169] INTENT information not used in the middle-end for optimizations
- References: <bug-23169-280@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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