8048298: Clang needs to lower optimization level for some files
authoriveresov
Thu, 26 Jun 2014 12:01:44 -0700
changeset 25347 4ca04b797b3a
parent 25344 c9c8045983ec
child 25348 ae2df33eddfe
8048298: Clang needs to lower optimization level for some files Summary: Optimization options need to be lowered for some files when using clang 5.0 and 5.1 Reviewed-by: twisti
hotspot/make/bsd/makefiles/gcc.make
--- a/hotspot/make/bsd/makefiles/gcc.make	Mon Jun 23 04:44:02 2014 +0000
+++ b/hotspot/make/bsd/makefiles/gcc.make	Thu Jun 26 12:01:44 2014 -0700
@@ -322,9 +322,20 @@
 
 # Work around some compiler bugs.
 ifeq ($(USE_CLANG), true)
+  # Clang 4.2
   ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
     OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
     OPT_CFLAGS/unsafe.o += -O1
+  # Clang 5.0
+  else ifeq ($(shell expr $(CC_VER_MAJOR) = 5 \& $(CC_VER_MINOR) = 0), 1)
+    OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
+    OPT_CFLAGS/unsafe.o += -O1
+  # Clang 5.1
+  else ifeq ($(shell expr $(CC_VER_MAJOR) = 5 \& $(CC_VER_MINOR) = 1), 1)
+    OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
+    OPT_CFLAGS/unsafe.o += -O1
+  else
+    $(error "Update compiler workarounds for Clang $(CC_VER_MAJOR).$(CC_VER_MINOR)")
   endif
 else
   # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.