From de5deae8e34f8b3ddf3c9020c4de959f98fb8b1c Mon Sep 17 00:00:00 2001 From: ac-stef Date: Thu, 17 Apr 2014 01:09:36 +0200 Subject: [PATCH] fix: gcc crashing the client This workaround lowers the optimisation level for those parts of the code, that gcc 4.7 (and probably other versions) would compile to a binary that crashes after a while. The previous solution for this so-called "linux bug" was to use clang instead of gcc. Thx, Jpablon, for doing all the work on this. --- source/src/vertmodel.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/src/vertmodel.h b/source/src/vertmodel.h index f29bb3c2..a3bd8b08 100644 --- a/source/src/vertmodel.h +++ b/source/src/vertmodel.h @@ -179,6 +179,9 @@ struct vertmodel : model numdyndraws = draws.length(); } +#if defined(__GNUC__) && defined(__OPTIMIZE__) +__attribute__((optimize(2))) +#endif dyncacheentry *gendynverts(animstate &as, anpos &cur, anpos *prev, float ai_t) { dyncacheentry *d = dyncache.start(); @@ -290,6 +293,9 @@ struct vertmodel : model } } +#if defined(__GNUC__) && defined(__OPTIMIZE__) +__attribute__((optimize(2))) +#endif shadowcacheentry *genshadowvolume(animstate &as, anpos &cur, anpos *prev, float ai_t, vec *buf) { if(!shareverts) return NULL; @@ -350,6 +356,9 @@ struct vertmodel : model return d; } +#if defined(__GNUC__) && defined(__OPTIMIZE__) +__attribute__((optimize(2))) +#endif lightcacheentry *lightvertexes(animstate &as, anpos &cur, anpos *prev, float ai_t, vec *buf) { if(dbgvlight) return NULL;