Skip to content

Commit

Permalink
Disable use of the i386 assembly for option -O0
Browse files Browse the repository at this point in the history
We don't compile in the assembly code if compiler optimisations are disabled as
the number of registers used in the assembly code doesn't work with the -O0
option. Also anyone select -O0 probably doesn't want to compile in the assembly
code anyway.
  • Loading branch information
redtangent committed Jul 10, 2018
1 parent c6bf5b4 commit d064b5c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/mbedtls/bn_mul.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@
/* armcc5 --gnu defines __GNUC__ but doesn't support GNU's extended asm */
#if defined(__GNUC__) && \
( !defined(__ARMCC_VERSION) || __ARMCC_VERSION >= 6000000 )
#if defined(__i386__)

/*
* Disable use of the i386 assembly code below if option -O0, to disable all
* compiler optimisations, is passed, detected with __OPTIMIZE__
* This is done as the number of registers used in the assembly code doesn't
* work with the -O0 option.
*/
#if defined(__i386__) && !defined(__OPTIMIZE__)

#define MULADDC_INIT \
asm( \
Expand Down

0 comments on commit d064b5c

Please sign in to comment.