From: SourceForge.net <no...@so...> - 2009-08-17 01:59:19
|
Bugs item #2838712, was opened at 2009-08-16 22:59 Message generated for change (Tracker Item Submitted) made by jcpascal27 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2838712&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: gcc Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Juan José Cabrera Pascal (jcpascal27) Assigned to: Nobody/Anonymous (nobody) Summary: -O3 error, using asm procedure Initial Comment: gcc -v Reading specs from C:/Documents and Settings/Administrador/Mis documentos/Juan/C ompiladores/C/MinGW/bin/../lib/gcc/mingw32/3.4.5/specs Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --wi th-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --dis able-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --d isable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --with out-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enabl e-hash-synchronization --enable-libstdcxx-debug Thread model: win32 gcc version 3.4.5 (mingw-vista special r3) C code: void Test(void* c) { asm("movl 8(%ebp), %eax \n\t" "movaps (%eax), %xmm1 \n\t"); } int main(int argc, char** argv) { unsigned int c[10]; Test(&c); return 0; } if i compile the code above using -O3 i get the following assembly output: .file "p.c" .text .p2align 4,,15 .globl _Test .def _Test; .scl 2; .type 32; .endef _Test: pushl %ebp movl %esp, %ebp /APP movl 8(%ebp), %eax movaps (%eax), %xmm1 /NO_APP popl %ebp ret .def ___main; .scl 2; .type 32; .endef .p2align 4,,15 .globl _main .def _main; .scl 2; .type 32; .endef _main: pushl %ebp movl $16, %eax movl %esp, %ebp subl $56, %esp andl $-16, %esp call __alloca call ___main /APP movl 8(%ebp), %eax movaps (%eax), %xmm1 /NO_APP leave xorl %eax, %eax ret after the "call ___main" GCC is inserting the assembly code contained in the "Test" function in the body of the program, which isn't correct. if i compile the C code using -O2 or without optimization it compiles correctly. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2838712&group_id=2435 |
From: SourceForge.net <no...@so...> - 2009-08-18 04:02:25
|
Bugs item #2838712, was opened at 2009-08-16 21:59 Message generated for change (Comment added) made by peterjhurley You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2838712&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: gcc Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Juan José Cabrera Pascal (jcpascal27) Assigned to: Nobody/Anonymous (nobody) Summary: -O3 error, using asm procedure Initial Comment: gcc -v Reading specs from C:/Documents and Settings/Administrador/Mis documentos/Juan/C ompiladores/C/MinGW/bin/../lib/gcc/mingw32/3.4.5/specs Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --wi th-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --dis able-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --d isable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --with out-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enabl e-hash-synchronization --enable-libstdcxx-debug Thread model: win32 gcc version 3.4.5 (mingw-vista special r3) C code: void Test(void* c) { asm("movl 8(%ebp), %eax \n\t" "movaps (%eax), %xmm1 \n\t"); } int main(int argc, char** argv) { unsigned int c[10]; Test(&c); return 0; } if i compile the code above using -O3 i get the following assembly output: .file "p.c" .text .p2align 4,,15 .globl _Test .def _Test; .scl 2; .type 32; .endef _Test: pushl %ebp movl %esp, %ebp /APP movl 8(%ebp), %eax movaps (%eax), %xmm1 /NO_APP popl %ebp ret .def ___main; .scl 2; .type 32; .endef .p2align 4,,15 .globl _main .def _main; .scl 2; .type 32; .endef _main: pushl %ebp movl $16, %eax movl %esp, %ebp subl $56, %esp andl $-16, %esp call __alloca call ___main /APP movl 8(%ebp), %eax movaps (%eax), %xmm1 /NO_APP leave xorl %eax, %eax ret after the "call ___main" GCC is inserting the assembly code contained in the "Test" function in the body of the program, which isn't correct. if i compile the C code using -O2 or without optimization it compiles correctly. ---------------------------------------------------------------------- Comment By: Peter Hurley (peterjhurley) Date: 2009-08-18 00:02 Message: This is functioning as designed. From the online gcc 3.4.6 manual http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Optimize-Options.html#Optimize-Options: -finline-functions Integrate all simple functions into their callers. The compiler heuristically decides which functions are simple enough to be worth integrating in this way. If all calls to a given function are integrated, and the function is declared static, then the function is normally not output as assembler code in its own right. Enabled at level -O3. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2838712&group_id=2435 |
From: SF/projects/mingw n. l. <min...@li...> - 2012-06-14 14:59:12
|
Bugs item #2838712, was opened at 2009-08-16 18:59 Message generated for change (Settings changed) made by earnie You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2838712&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: gcc Group: None >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: Juan José Cabrera Pascal (jcpascal27) Assigned to: Nobody/Anonymous (nobody) Summary: -O3 error, using asm procedure Initial Comment: gcc -v Reading specs from C:/Documents and Settings/Administrador/Mis documentos/Juan/C ompiladores/C/MinGW/bin/../lib/gcc/mingw32/3.4.5/specs Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --wi th-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --dis able-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --d isable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --with out-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enabl e-hash-synchronization --enable-libstdcxx-debug Thread model: win32 gcc version 3.4.5 (mingw-vista special r3) C code: void Test(void* c) { asm("movl 8(%ebp), %eax \n\t" "movaps (%eax), %xmm1 \n\t"); } int main(int argc, char** argv) { unsigned int c[10]; Test(&c); return 0; } if i compile the code above using -O3 i get the following assembly output: .file "p.c" .text .p2align 4,,15 .globl _Test .def _Test; .scl 2; .type 32; .endef _Test: pushl %ebp movl %esp, %ebp /APP movl 8(%ebp), %eax movaps (%eax), %xmm1 /NO_APP popl %ebp ret .def ___main; .scl 2; .type 32; .endef .p2align 4,,15 .globl _main .def _main; .scl 2; .type 32; .endef _main: pushl %ebp movl $16, %eax movl %esp, %ebp subl $56, %esp andl $-16, %esp call __alloca call ___main /APP movl 8(%ebp), %eax movaps (%eax), %xmm1 /NO_APP leave xorl %eax, %eax ret after the "call ___main" GCC is inserting the assembly code contained in the "Test" function in the body of the program, which isn't correct. if i compile the C code using -O2 or without optimization it compiles correctly. ---------------------------------------------------------------------- >Comment By: Earnie Boyd (earnie) Date: 2012-06-14 07:59 Message: See peterjhurley's comment. ---------------------------------------------------------------------- Comment By: Peter Hurley (peterjhurley) Date: 2009-08-17 21:02 Message: This is functioning as designed. From the online gcc 3.4.6 manual http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Optimize-Options.html#Optimize-Options: -finline-functions Integrate all simple functions into their callers. The compiler heuristically decides which functions are simple enough to be worth integrating in this way. If all calls to a given function are integrated, and the function is declared static, then the function is normally not output as assembler code in its own right. Enabled at level -O3. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2838712&group_id=2435 |