I use gcc 4.1.2 under solaris and linux and compile code using next commands: Linux: gcc -pipe -Wall -Wextra -Winvalid-pch -ansi -pedantic -Wundef -Wc++-compat -Wfloat-equal -Wredundant-decls -Waggregate-return -Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wshadow -Wsign-compare -Wnested-externs -Wcast-qual -Wpointer-arith -Wdeclaration-after-statement -Werror -O2 -finline-functions -Wdisabled-optimization -DNDEBUG test.c -o mtest_l
Solaris: gcc -pipe -Wall -Wextra -Winvalid-pch -ansi -pedantic -Wundef -Wc++-compat -Wfloat-equal -Wredundant-decls -Waggregate-return -Wbad-function-cast -Wstrict-prototypes -Wcast-align -Wshadow -Wsign-compare -Wnested-externs -Wcast-qual -Wpointer-arith -Wdeclaration-after-statement -Werror -O2 -finline-functions -Wdisabled-optimization -DNDEBUG -g -o mtest test.c Segmentation fault happens when I try to run test program (see test.c attached). -- Summary: GCC 4.1.2 produce wrong assembler code with -O2 option enabled. Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: critical Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: _kirpichev_ at mail dot ru http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33374