Bug 42531

Summary: FAIL: gcc.c-torture/compile/20011119-1.c
Product: gcc Reporter: Dave Korn <davek>
Component: ltoAssignee: Dave Korn <davek>
Status: VERIFIED FIXED    
Severity: normal CC: gcc-bugs, hjl.tools
Priority: P3    
Version: 4.5.0   
Target Milestone: ---   
URL: http://gcc.gnu.org/ml/gcc-patches/2009-12/msg01253.html
Host: i686-pc-cygwin Target: i686-pc-cygwin
Build: i686-pc-cygwin Known to work:
Known to fail: Last reconfirmed:
Attachments: Avoid emitting asterisk in assembler section directives.

Description Dave Korn 2009-12-29 02:51:21 UTC
GCC: HEAD@155348, i686-pc-cygwin native, libelf-0.8.13:

> > FAIL: gcc.c-torture/compile/20011119-1.c (test for excess errors)
> > Excess errors:
> > /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/cccnrdgl.s:13: Error: junk at end of
> > line, first unrecognized character is `*'

  Looking at the generated assembly using --save-temps:

> >     32          .section        .gnu.lto_*_xxx,"dr"

Ref: http://gcc.gnu.org/ml/gcc/2009-12/threads.html#00292

Source not attached because it's in the testsuite.

Patch to follow.
Comment 1 Dave Korn 2009-12-29 02:53:41 UTC
Created attachment 19408 [details]
Avoid emitting asterisk in assembler section directives.

Several other places in lto-streamer-out.c take this same approach of simply skipping a leading asterisk.  Bootstrapped and tests running now, will post to -patches list when they finish.
Comment 2 Dave Korn 2009-12-30 16:37:40 UTC
Test runs all finished.

Before: http://gcc.gnu.org/ml/gcc-testresults/2009-12/msg02081.html
After:  http://gcc.gnu.org/ml/gcc-testresults/2009-12/msg02582.html

No new fails.  Sending patch.
Comment 3 Dave Korn 2009-12-30 23:21:13 UTC
Subject: Bug 42531

Author: davek
Date: Wed Dec 30 23:20:55 2009
New Revision: 155528

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155528
Log:
	PR lto/42531
	* lto-streamer-out.c (produce_asm): Skip any leading asterisk when
	using DECL_ASSEMBLER_NAME to generate a section name.
	(copy_function): Likewise.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lto-streamer-out.c

Comment 4 H.J. Lu 2009-12-31 15:12:17 UTC
Revision 155528 caused:

FAIL: gcc.dg/lto/20081222 c_lto_20081222_0.o-c_lto_20081222_1.o link
FAIL: gcc.dg/lto/20081222 c_lto_20081222_0.o-c_lto_20081222_1.o link
FAIL: gcc.dg/lto/20081222 c_lto_20081222_0.o-c_lto_20081222_1.o link
FAIL: gcc.dg/lto/20081222 c_lto_20081222_0.o-c_lto_20081222_1.o link,  (internal compiler error)

One error is

c_lto_20081222_0.wpa.ltrans.o: In function `main':
c_lto_20081222_0.wpa.o:(.text+0x7): undefined reference to `x'
collect2: ld returned 1 exit status

The difference in o. files is

-  [ 4] .gnu.lto_*INT_x   PROGBITS        00000000 000040 0000e3 00      0   0  1
+  [ 4] .gnu.lto_INT_x    PROGBITS        00000000 000040 0000e3 00      0   0  1

Either "*" is expected or the fix is incomplete.
Comment 5 H.J. Lu 2009-12-31 17:56:07 UTC
A different patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2009-12/msg01253.html
Comment 6 hjl@gcc.gnu.org 2010-01-01 16:49:29 UTC
Subject: Bug 42531

Author: hjl
Date: Fri Jan  1 16:49:15 2010
New Revision: 155555

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155555
Log:
Remove asterisk in LTO section name.

2010-01-01  H.J. Lu  <hongjiu.lu@intel.com>

	PR lto/42531
	* lto-streamer-out.c (produce_asm): Revert the last change.
	(copy_function): Likewise.

	* lto-streamer.c (lto_get_section_name): Skip any leading
	asterisk in name.

Added:
    trunk/gcc/ChangeLog
    trunk/gcc/ChangeLog-2009
      - copied, changed from r155554, trunk/gcc/ChangeLog
Modified:
    trunk/gcc/lto-streamer-out.c
    trunk/gcc/lto-streamer.c

Comment 7 Dave Korn 2010-02-06 00:34:32 UTC
closing old bug after reverifying with latest sources and patch for bug 42776
Comment 8 Dave Korn 2010-02-06 00:35:17 UTC
just verified against r.156467