diff --git a/src/plugins/e-acsl/scripts/e-acsl-gcc.sh b/src/plugins/e-acsl/scripts/e-acsl-gcc.sh
index 899bf267c8296a03059b6a3230edce82a69ef9f4..dc270bb7d092e5f70cb7695d5008f95273d9b4e7 100755
--- a/src/plugins/e-acsl/scripts/e-acsl-gcc.sh
+++ b/src/plugins/e-acsl/scripts/e-acsl-gcc.sh
@@ -52,9 +52,20 @@ SHORTOPTIONS="h,c,C,p,d:,o:,O:,v:,f,E:,R,L,M,l:,e:,g,q,s:,F:"
 # Prefix for an error message due to wrong arguments
 ERROR="ERROR parsing arguments:"
 
+# Architecture-dependent flags. Since by default Frama-C uses 32-bit
+# architecture we need to make sure that same architecture is used for
+# instrumentation and for compilation.
+MACHDEPFLAGS="`getconf LONG_BIT`"
+# -machdep option sent to frama-c
+MACHDEP="-machdep gcc_x86_$MACHDEPFLAGS"
+# Macro for correct preprocessing of Frama-C generated code
+CPPMACHDEP="-D__FC_MACHDEP_X86_$MACHDEPFLAGS"
+# GCC machine option
+GCCMACHDEP="-m$MACHDEPFLAGS"
+
 # Gcc
 CC="`check_tool 'gcc'`"
-CFLAGS="-std=c99 -g3 -O2 -pedantic -fno-builtin -Wall \
+CFLAGS="-std=c99 $GCCMACHDEP -g3 -O2 -pedantic -fno-builtin -Wall \
     -Wno-long-long \
     -Wno-attributes \
     -Wno-unused-result \
@@ -79,25 +90,6 @@ RTL="$EACSL_SHARE/e_acsl.c                      \
   $EACSL_SHARE/memory_model/e_acsl_bittree.c    \
 "
 
-# Frama-c machdep option
-ARCH="$(uname -m | tr -d '\n')"
-case $ARCH in
-  x86_64)
-    MACHDEPFLAGS="86_64"
-  ;;
-  i686)
-    MACHDEPFLAGS="86_32"
-  ;;
-  *)
-    error "Unsupported archirtecture: $ARCH"
-  ;;
-esac
-
-# -machdep option sent to frama-c
-MACHDEP="-machdep gcc_x$MACHDEPFLAGS"
-# Macro for correct preprocessing of Frama-C generated code
-CPPMACHDEP="-D__FC_MACHDEP_X$MACHDEPFLAGS"
-
 # CPP and LD flags for compilation of E-ACSL-generated sources
 EACSL_CPP_FLAGS="
     -D__FC_errno=(*__errno_location())