Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid loop extent reduction #97

Open
miklos1 opened this issue Oct 21, 2016 · 3 comments
Open

Invalid loop extent reduction #97

miklos1 opened this issue Oct 21, 2016 · 3 comments
Labels

Comments

@miklos1
Copy link
Contributor

miklos1 commented Oct 21, 2016

COFFEE did the following transformation:

--- /tmp/pyop2-cache-uid11480/95256e7f5216f51a1d88d64fe2f433bc_p5040.c  2016-10-20 18:15:50.711984816 +0100
+++ /tmp/pyop2-cache-uid11480/16b9d6342d4efc75d2e86893dd6db688_p5237.c  2016-10-20 18:15:25.199611203 +0100
@@ -38,13 +38,23 @@
   for (int  ip_1  = 0; ip_1 < 2; ip_1 += 1)
   {

+    for (int  k0  = 0; k0 < 2; k0 += 1)
+    {
+      
+      for (int  k1  = 0; k1 < 2; k1 += 1)
+      {
+        t8[ip_1][k0][k1] = t2[k0] * t6[ip_1][k1];
+        
+      }
+      
+    }
+    
     for (int  k0  = 0; k0 < 3; k0 += 1)
     {

       for (int  k1  = 0; k1 < 2; k1 += 1)
       {
         t7[ip_1][k0][k1] = t1[k0] * t6[ip_1][k1];
-        t8[ip_1][k0][k1] = t2[k0] * t6[ip_1][k1];

       }  

This reduces the extent of the k0 loop from 3 to 2 for t8[ip_1][k0][k1] = t2[k0] * t6[ip_1][k1];. This would be legal, had t8 been previously initialised to zero, but it wasn't. The loop that was reduced was supposed to initialise it, thus the reduced loop leaving entries uninitialised, and causing all kind of horrible symptoms.

@miklos1 miklos1 added the bug label Oct 21, 2016
miklos1 added a commit to firedrakeproject/tsfc that referenced this issue Oct 21, 2016
@miklos1
Copy link
Contributor Author

miklos1 commented Oct 21, 2016

@FabioLuporini: Just wanted to document this, so we won't forget this problem. Not urgent to fix it, since it is not triggered per firedrakeproject/tsfc@1d7ce21.

@FabioLuporini
Copy link
Contributor

OK, thanks.

@FabioLuporini
Copy link
Contributor

I prefer to keep this open for reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants