[Bf-blender-cvs] [c6c49d90dc6] master: Remove volatile, causing issues w/ GCC/ubsan

Campbell Barton noreply at git.blender.org
Wed Aug 2 22:56:03 CEST 2017


Commit: c6c49d90dc6856f978e15d80673c6211dcba6fd9
Author: Campbell Barton
Date:   Thu Aug 3 07:10:20 2017 +1000
Branches: master
https://developer.blender.org/rBc6c49d90dc6856f978e15d80673c6211dcba6fd9

Remove volatile, causing issues w/ GCC/ubsan

Was Cygwin workaround, no longer needed.

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

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 20602314526..b4ff5f52fcf 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