This is the mail archive of the gcc-bugs@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]

[Bug fortran/51218] [4.6/4.7 Regression] Potential optimization bug due to implicit_pure?


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51218

--- Comment #25 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-25 17:44:29 UTC ---
(In reply to comment #24)
> > Thanks for the bugreport and the (valid)
> > testcase.
> 
> To be pedantic, the test case was not valid

Can you tell me what's wrong with the test case of comment 16? It looks
perfectly valid to me.

(One might argue about the result the program should print, i.e. whether a
compiler may optimize "a = f() + f()" to "a= 2*f()" even if "f" is impure. I
think the standard is a bit ambiguous about that one. But independently how one
decides, I fail to see how it makes the program invalid. [And I stand firmly on
the side that the compiler should not do this optimization (by default for any
-O... level). On the other hand, I am also in favour of pure functions and
prefer subroutines if the procedure is not pure.])


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