[Bug target/20540] New: "-march=i386" doesn't mean "limit instruction set to what 80386 understands"
gcc version 3.4.3-20050110 (Gentoo Linux 3.4.3.20050110, ssp-3.4.3.20050110-0, pie-8.7.7) Basically, I get P6 instructions in the assembly output when compiling with "-march=i386", but when I tried "-march=i486" id did the right thing (no P6 instructions). I hope it is just a simple problem of misunderstanding "i386" to mean something other than what the documentation (read: man page) says, rather than an actual bug with the definition of what instructions 386 can and can't issue. I don't think it's Gentoo's fault so I complain here. -- Summary: "-march=i386" doesn't mean "limit instruction set to what 80386 understands" Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: zeev dot tarantov at gmail dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20540
[Bug target/20540] "-march=i386" doesn't mean "limit instruction set to what 80386 understands"
--- Additional Comments From zeev dot tarantov at gmail dot com 2005-03-18 20:26 --- Created an attachment (id=8418) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8418&action=view) testcase source -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20540
[Bug target/20540] "-march=i386" doesn't mean "limit instruction set to what 80386 understands"
--- Additional Comments From zeev dot tarantov at gmail dot com 2005-03-18 20:27 --- Created an attachment (id=8419) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8419&action=view) testcase expected output this is what I get from "gcc -march=i486 -O3 -S -g opcode.c -o opcode.i486.s" -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20540
[Bug target/20540] "-march=i386" doesn't mean "limit instruction set to what 80386 understands"
--- Additional Comments From zeev dot tarantov at gmail dot com 2005-03-18 20:36 --- Created an attachment (id=8420) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8420&action=view) testcase unexpected output this is what I get from "gcc -march=i386 -O3 -S -g opcode.c -o opcode.i386.s". Notice the "movzbl" on line 28. I don't have a 80386 to test it, but I doubt it supports this. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20540
[Bug target/20540] "-march=i386" doesn't mean "limit instruction set to what 80386 understands"
--- Additional Comments From zeev dot tarantov at gmail dot com 2005-03-18 20:47 --- I forgot to say gcc was compiled with "-march=pentium3 -O3". I tried it now on gcc 3.3.5 and got the same deal. -- What|Removed |Added GCC host triplet||i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20540
[Bug inline-asm/37492] New: optimization causes inline assembler to emit syntax errors
Compiling the following with -O0 works. Compiling with -O2 produces assembly syntax errors. Using built-in specs. Target: i686-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.3.1 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.1/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.1/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-cld --enable-java-awt=gtk --with-arch=i686 --enable-languages=c,c++,java,treelang --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.1-r1 p1.1' Thread model: posix gcc version 4.3.1 (Gentoo 4.3.1-r1 p1.1) #include void test(unsigned int val) { unsigned int res, resz; asm( " xorl %1, %1\n" " movl $0x12345678, %0\n" " bsrl %2, %0 ; setz %b1 " : "=r" (res), "=r" (resz) : "g" (val) ); printf("val : %d\n", val); printf("res : %d\n", res); printf("resz: %d\n", resz); } int main() { test(0); test(1 << 7); test(1 << 15); test(1 << 30); return 0; } -- Summary: optimization causes inline assembler to emit syntax errors Product: gcc Version: 4.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: inline-asm AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: zeev dot tarantov at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37492
[Bug inline-asm/37492] optimization causes inline assembler to emit syntax errors
--- Comment #2 from zeev dot tarantov at gmail dot com 2008-09-12 14:24 --- Thank you so much and sorry for the spam in bugzilla. Is there anything like lint that would have helped me understand the mistake, without actually grokking the documentation? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37492