changeset 19768:ebddbfbbb935 draft

(svn r24701) -Fix [FS#5246]: Workaround an overoptimisation done by GCC 4.5
author smatz <smatz@openttd.org>
date Sun, 11 Nov 2012 17:39:54 +0000 (2012-11-11)
parents 2a11204038e3
children 0abcb662c2a0
files config.lib
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/config.lib
+++ b/config.lib
@@ -1350,6 +1350,12 @@
 			cxxflags="$cxxflags -std=gnu++0x"
 		fi
 
+		if [ $cc_version -eq 45 ]; then
+			# Prevent optimisation supposing enums are in a range specified by the standard
+			# For details, see http://gcc.gnu.org/PR43680
+			flags="$flags -fno-tree-vrp"
+		fi
+
 		if [ $cc_version -ge 47 ]; then
 			# Disable -Wnarrowing which gives many warnings, such as:
 			# warning: narrowing conversion of '...' from 'unsigned int' to 'int' inside { } [-Wnarrowing]