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 tree-optimization/54634] [4.8 Regression] miscompilation with -O3 -ftree-loop-distribution


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.


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