public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/52004] New: bad asm generated with -O2 -finline-functions (and maybe -ftracer)
@ 2012-01-26  0:51 marbacz at gmail dot com
  2012-01-26  1:02 ` [Bug rtl-optimization/52004] " marbacz at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: marbacz at gmail dot com @ 2012-01-26  0:51 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52004
           Summary: bad asm generated with -O2 -finline-functions (and
                    maybe -ftracer)
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: marbacz@gmail.com


Created attachment 26469
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26469
Test case from GDB.

Compiling attached file (from GDB 7.4) generates assembly that chokes the
assembler. I'm attaching original and reduced testcases. I'm not sure whether
the reduced one is still valid C but on that one you don't need -ftracer (-O2
-finline-functions is enough for the assembler to fail).

gcc -O2 -finline-functions -ftracer -c linux-x86-low.c 
linux-x86-low.c: Assembler messages:
linux-x86-low.c:2570: Error: symbol `start_i386_reg_a' is already defined
linux-x86-low.c:2572: Error: symbol `end_i386_reg_a' is already defined
linux-x86-low.c:2579: Error: symbol `start_i386_reg_b' is already defined
linux-x86-low.c:2583: Error: symbol `end_i386_reg_b' is already defined
linux-x86-low.c:2584: Error: symbol `start_i386_reg_c' is already defined
linux-x86-low.c:2587: Error: symbol `end_i386_reg_c' is already defined
linux-x86-low.c:2694: Error: symbol `start_i386_void_call_2_a' is already
defined
linux-x86-low.c:2699: Error: symbol `end_i386_void_call_2_a' is already defined
linux-x86-low.c:2715: Error: symbol `start_i386_void_call_2_b' is already
defined
linux-x86-low.c:2718: Error: symbol `end_i386_void_call_2_b' is already defined
linux-x86-low.c:2666: Error: symbol `start_i386_int_call_1_a' is already
defined
linux-x86-low.c:2668: Error: symbol `end_i386_int_call_1_a' is already defined
linux-x86-low.c:2680: Error: symbol `start_i386_int_call_1_c' is already
defined
linux-x86-low.c:2683: Error: symbol `end_i386_int_call_1_c' is already defined
linux-x86-low.c:2081: Error: symbol `start_amd64_void_call_2_b' is already
defined
linux-x86-low.c:2082: Error: symbol `end_amd64_void_call_2_b' is already
defined
linux-x86-low.c:2075: Error: symbol `start_amd64_void_call_2_a' is already
defined
linux-x86-low.c:2077: Error: symbol `end_amd64_void_call_2_a' is already
defined


~ # gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.7.0-svn-183541-20120125/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.7.0-svn-183541-20120125
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0-svn-183541-20120125/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.0-svn-183541-20120125
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.0-svn-183541-20120125/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.7.0-svn-183541-20120125/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0-svn-183541-20120125/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
--disable-fixed-point --with-ppl --with-cloog --disable-ppl-version-check
--with-cloog-include=/usr/include/cloog-ppl --enable-lto --enable-nls
--without-included-gettext --with-system-zlib --disable-werror
--enable-secureplt --disable-multilib --enable-libmudflap --enable-libssp
--enable-libgomp
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.7.0-svn-183541-20120125/python
--enable-checking=assert,fold,gc,misc,rtlflag,runtime,tree --disable-libgcj
--disable-libquadmath --enable-languages=c,c++ --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--enable-targets=all --with-pkgversion='svn 183541-20120125'
--enable-build-with-cxx
Thread model: posix
gcc version 4.7.0 20120125 (experimental) (svn 183541-20120125)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug rtl-optimization/52004] bad asm generated with -O2 -finline-functions (and maybe -ftracer)
  2012-01-26  0:51 [Bug rtl-optimization/52004] New: bad asm generated with -O2 -finline-functions (and maybe -ftracer) marbacz at gmail dot com
@ 2012-01-26  1:02 ` marbacz at gmail dot com
  2012-01-26  2:50 ` pinskia at gcc dot gnu.org
  2012-01-26  3:48 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: marbacz at gmail dot com @ 2012-01-26  1:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Marcin Baczynski <marbacz at gmail dot com> 2012-01-26 00:37:21 UTC ---
Created attachment 26470
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26470
Reduced test case.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug rtl-optimization/52004] bad asm generated with -O2 -finline-functions (and maybe -ftracer)
  2012-01-26  0:51 [Bug rtl-optimization/52004] New: bad asm generated with -O2 -finline-functions (and maybe -ftracer) marbacz at gmail dot com
  2012-01-26  1:02 ` [Bug rtl-optimization/52004] " marbacz at gmail dot com
@ 2012-01-26  2:50 ` pinskia at gcc dot gnu.org
  2012-01-26  3:48 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-26  2:50 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-26 00:46:24 UTC ---
inline-asm that contains a label is buggy:
"start_" "amd64_ref1" ":"

*** This bug has been marked as a duplicate of bug 20468 ***


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug rtl-optimization/52004] bad asm generated with -O2 -finline-functions (and maybe -ftracer)
  2012-01-26  0:51 [Bug rtl-optimization/52004] New: bad asm generated with -O2 -finline-functions (and maybe -ftracer) marbacz at gmail dot com
  2012-01-26  1:02 ` [Bug rtl-optimization/52004] " marbacz at gmail dot com
  2012-01-26  2:50 ` pinskia at gcc dot gnu.org
@ 2012-01-26  3:48 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-26  3:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-26 00:50:40 UTC ---
Those functions should be marked as noinline and noclone or better yet use
toplevel inline-asm for those instructions.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-26  0:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-26  0:51 [Bug rtl-optimization/52004] New: bad asm generated with -O2 -finline-functions (and maybe -ftracer) marbacz at gmail dot com
2012-01-26  1:02 ` [Bug rtl-optimization/52004] " marbacz at gmail dot com
2012-01-26  2:50 ` pinskia at gcc dot gnu.org
2012-01-26  3:48 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).