[Bf-blender-cvs] [277dc47eeaf] blender2.8: Remove volatile, causing issues w/ GCC/ubsan

Campbell Barton noreply at git.blender.org
Sat Jul 29 00:45:21 CEST 2017


Commit: 277dc47eeaf4d96cfaf927e29288dbe69322d272
Author: Campbell Barton
Date:   Sat Jul 29 08:58:11 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB277dc47eeaf4d96cfaf927e29288dbe69322d272

Remove volatile, causing issues w/ GCC/ubsan

Should remove from master since its workaround for Cygwin
but too close to release.

===================================================================

M	source/blender/render/intern/include/shading.h
M	source/blender/render/intern/source/shadeinput.c

===================================================================

diff --git a/source/blender/render/intern/include/shading.h b/source/blender/render/intern/include/shading.h
index 13f16ce0bd7..3ef6e9d7476 100644
--- a/source/blender/render/intern/include/shading.h
+++ b/source/blender/render/intern/include/shading.h
@@ -57,7 +57,7 @@ typedef struct ShadeSample {
 void shade_material_loop(struct ShadeInput *shi, struct ShadeResult *shr);
 
 void shade_input_set_triangle_i(struct ShadeInput *shi, struct ObjectInstanceRen *obi, struct VlakRen *vlr, short i1, short i2, short i3);
-void shade_input_set_triangle(struct ShadeInput *shi, volatile int obi, volatile int facenr, int normal_flip);
+void shade_input_set_triangle(struct ShadeInput *shi, int obi, int facenr, int normal_flip);
 void shade_input_copy_triangle(struct ShadeInput *shi, struct ShadeInput *from);
 void shade_input_calc_viewco(struct ShadeInput *shi, float x, float y, float z, float view[3], float dxyview[2], float co[3], float dxco[3], float dyco[3]);
 void shade_input_set_viewco(struct ShadeInput *shi, float x, float y, float sx, float sy, float z);
diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c
index 597a2338fe7..660b82b884d 100644
--- a/source/blender/render/intern/source/shadeinput.c
+++ b/source/blender/render/intern/source/shadeinput.c
@@ -292,12 +292,8 @@ void shade_input_set_triangle_i(ShadeInput *shi, ObjectInstanceRen *obi, VlakRen
 	}
 }
 
-/* note, facenr declared volatile due to over-eager -O2 optimization's
- * on cygwin (particularly -frerun-cse-after-loop)
- */
-
 /* copy data from face to ShadeInput, scanline case */
-void shade_input_set_triangle(ShadeInput *shi, volatile int obi, volatile int facenr, int UNUSED(normal_flip))
+void shade_input_set_triangle(ShadeInput *shi, int obi, int facenr, int UNUSED(normal_flip))
 {
 	if (facenr > 0) {
 		shi->obi = &R.objectinstance[obi];




More information about the Bf-blender-cvs mailing list