This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/54634] [4.8 Regression] miscompilation with -O3 -ftree-loop-distribution
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Sep 2012 13:43:33 +0000
- Subject: [Bug tree-optimization/54634] [4.8 Regression] miscompilation with -O3 -ftree-loop-distribution
- Auto-submitted: auto-generated
- References: <bug-54634-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54634
--- Comment #6 from rguenther at suse dot de <rguenther at suse dot de> 2012-09-20 13:43:33 UTC ---
On Thu, 20 Sep 2012, Joost.VandeVondele at mat dot ethz.ch wrote:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54634
>
> --- Comment #5 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> 2012-09-20 13:06:50 UTC ---
> (In reply to comment #4)
> > Ah, binomial () is pure.
>
> In this case, it was presumably triggered by Tobias' changes for PR54389.
> binomial() has not been declared pure in the source, but most likely correctly
> declared 'implicitly pure' but the Fortran frontend.
Btw, it's just what triggers the latent bug in data dependence analysis.
I am testing
Index: gcc/tree-data-ref.c
===================================================================
--- gcc/tree-data-ref.c (revision 191561)
+++ gcc/tree-data-ref.c (working copy)
@@ -4307,10 +4307,10 @@ get_references_in_stmt (gimple stmt, VEC
*references = NULL;
/* ASM_EXPR and CALL_EXPR may embed arbitrary side effects.
- Calls have side-effects, except those to const or pure
- functions. */
+ As we cannot model data-references to not spelled out
+ accesses give up if they may occur. */
if ((stmt_code == GIMPLE_CALL
- && !(gimple_call_flags (stmt) & (ECF_CONST | ECF_PURE)))
+ && !(gimple_call_flags (stmt) & ECF_CONST))
|| (stmt_code == GIMPLE_ASM
&& (gimple_asm_volatile_p (stmt) || gimple_vuse (stmt))))
clobbers_memory = true;
currently.