Sortly,
We have a global variable which is initialized to 1 and named AMLogging.
When we compile our source it does not cause any problem but when we change
AMLogging = 0; 
and compile, if at run time we try to access to this variable it is causing
system to crash with a floating point exception to 4-byte aligned address.

We think that because the location of the variable moves to bss instead of data
section compiler makes alignment errors.

Following is about our compiler version and options used.

bt0puk:/home/mekici/crash/geltbas/acpu> mips-gcc -v -save-temps -DLANGUAGE_C
-O2 -g -DACPU_SCM -DGELT -DGFI_GM_RUN_TIME -DGM_USE_BPD -DGM_PM_TYPE_PROMPT
-nostdlib -I. -I./Includes -nostdinc -fsigned-char -fno-builtin -Wreturn-type
-Wuninitialized -Winline -Wswitch -Wchar-subscripts -Wshadow
-Wimplicit-function-declaration -DREL_220 -mlong-calls -mdivide-breaks -mfp32
-mhard-float -mdouble-float -march=rm9k -mips4 -EL -G 0 -c ./image-ver.c
Reading specs from /project/xana/gcc-3.4.3/bin/../lib/gcc/mips/3.4.3/specs
Configured with: ../gcc-3.4.3/configure --prefix=/home/beckers/crossdev
--target=mips --disable-threads --with-newlib --disable-shared
--enable-languages=c --with-stabs --nfp --with-gnu-as --with-gnu-ld
Thread model: single
gcc version 3.4.3
 /project/xana/gcc-3.4.3/bin/../libexec/gcc/mips/3.4.3/cc1 -E -quiet -nostdinc
-v -I. -I./Includes -iprefix /project/xana/gcc-3.4.3/bin/../lib/gcc/mips/3.4.3/
-DLANGUAGE_C -DACPU_SCM -DGELT -DGFI_GM_RUN_TIME -DGM_USE_BPD
-DGM_PM_TYPE_PROMPT -DREL_220 ./image-ver.c -G 0 -mel -mlong-calls
-mdivide-breaks -mfp32 -mhard-float -mdouble-float -march=rm9k -mips4
-Wreturn-type -Wuninitialized -Winline -Wswitch -Wchar-subscripts -Wshadow
-Wimplicit-function-declaration -fsigned-char -fno-builtin -fworking-directory
-O2 -o image-ver.i
#include "..." search starts here:
#include <...> search starts here:
 .
 ./Includes
 /usr/openwin/lib
 /ap/local/5.8/include
End of search list.
 /project/xana/gcc-3.4.3/bin/../libexec/gcc/mips/3.4.3/cc1 -fpreprocessed
image-ver.i -G 0 -mel -quiet -dumpbase image-ver.c -mlong-calls -mdivide-breaks
-mfp32 -mhard-float -mdouble-float -march=rm9k -mips4 -auxbase image-ver -g -O2
-Wreturn-type -Wuninitialized -Winline -Wswitch -Wchar-subscripts -Wshadow
-Wimplicit-function-declaration -version -fsigned-char -fno-builtin -o
image-ver.s
GNU C version 3.4.3 (mips)
        compiled by GNU C version 2.95.3 20010315 (release).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 /project/xana/gcc-3.4.3/bin/../lib/gcc/mips/3.4.3/../../../../mips/bin/as -G 0
-EL -mips4 -O2 -g -no-mdebug -32 -march=rm9k -v -o image-ver.o image-ver.s
GNU assembler version 050111 (mips) using BFD version 050111 20050111


-- 
           Summary: crash at unalign access
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mehmet dot ekici at alcatel dot com dot tr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27303

Reply via email to