public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/43157] New: Segmentation fault in aggregate_value_p
@ 2010-02-24 0:00 d dot g dot gorbachev at gmail dot com
2010-02-24 0:02 ` [Bug lto/43157] " d dot g dot gorbachev at gmail dot com
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: d dot g dot gorbachev at gmail dot com @ 2010-02-24 0:00 UTC (permalink / raw)
To: gcc-bugs
--
Summary: Segmentation fault in aggregate_value_p
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: lto
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: d dot g dot gorbachev at gmail dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43157
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug lto/43157] Segmentation fault in aggregate_value_p
2010-02-24 0:00 [Bug lto/43157] New: Segmentation fault in aggregate_value_p d dot g dot gorbachev at gmail dot com
@ 2010-02-24 0:02 ` d dot g dot gorbachev at gmail dot com
2010-02-24 10:50 ` rguenth at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: d dot g dot gorbachev at gmail dot com @ 2010-02-24 0:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from d dot g dot gorbachev at gmail dot com 2010-02-24 00:01 -------
Created an attachment (id=19942)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19942&action=view)
Testcase
gcc -O1 -flto pr43157.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43157
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug lto/43157] Segmentation fault in aggregate_value_p
2010-02-24 0:00 [Bug lto/43157] New: Segmentation fault in aggregate_value_p d dot g dot gorbachev at gmail dot com
2010-02-24 0:02 ` [Bug lto/43157] " d dot g dot gorbachev at gmail dot com
@ 2010-02-24 10:50 ` rguenth at gcc dot gnu dot org
2010-06-03 15:25 ` [Bug lto/43157] Segmentation fault in aggregate_value_p, asm aliases do not work rguenth at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-02-24 10:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2010-02-24 10:50 -------
Confirmed. We somehow think that factorial_ has a body.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |lto
Last reconfirmed|0000-00-00 00:00:00 |2010-02-24 10:50:09
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43157
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug lto/43157] Segmentation fault in aggregate_value_p, asm aliases do not work
2010-02-24 0:00 [Bug lto/43157] New: Segmentation fault in aggregate_value_p d dot g dot gorbachev at gmail dot com
2010-02-24 0:02 ` [Bug lto/43157] " d dot g dot gorbachev at gmail dot com
2010-02-24 10:50 ` rguenth at gcc dot gnu dot org
@ 2010-06-03 15:25 ` rguenth at gcc dot gnu dot org
2010-07-20 13:09 ` rguenth at gcc dot gnu dot org
2010-07-22 14:15 ` rguenth at gcc dot gnu dot org
4 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-06-03 15:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2010-06-03 15:24 -------
Re-confirmed on trunk.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hubicka at gcc dot gnu dot
| |org
Last reconfirmed|2010-02-24 10:50:09 |2010-06-03 15:24:20
date| |
Summary|Segmentation fault in |Segmentation fault in
|aggregate_value_p |aggregate_value_p, asm
| |aliases do not work
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43157
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug lto/43157] Segmentation fault in aggregate_value_p, asm aliases do not work
2010-02-24 0:00 [Bug lto/43157] New: Segmentation fault in aggregate_value_p d dot g dot gorbachev at gmail dot com
` (2 preceding siblings ...)
2010-06-03 15:25 ` [Bug lto/43157] Segmentation fault in aggregate_value_p, asm aliases do not work rguenth at gcc dot gnu dot org
@ 2010-07-20 13:09 ` rguenth at gcc dot gnu dot org
2010-07-22 14:15 ` rguenth at gcc dot gnu dot org
4 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-07-20 13:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from rguenth at gcc dot gnu dot org 2010-07-20 13:08 -------
Re-confirmed.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2010-06-03 15:24:20 |2010-07-20 13:08:43
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43157
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug lto/43157] Segmentation fault in aggregate_value_p, asm aliases do not work
2010-02-24 0:00 [Bug lto/43157] New: Segmentation fault in aggregate_value_p d dot g dot gorbachev at gmail dot com
` (3 preceding siblings ...)
2010-07-20 13:09 ` rguenth at gcc dot gnu dot org
@ 2010-07-22 14:15 ` rguenth at gcc dot gnu dot org
4 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-07-22 14:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from rguenth at gcc dot gnu dot org 2010-07-22 14:14 -------
*** Bug 43658 has been marked as a duplicate of this bug. ***
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |zsojka at seznam dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43157
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug lto/43157] Segmentation fault in aggregate_value_p, asm aliases do not work
[not found] <bug-43157-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2010-12-10 14:29 ` davek at gcc dot gnu.org
@ 2011-02-14 1:28 ` davek at gcc dot gnu.org
3 siblings, 0 replies; 10+ messages in thread
From: davek at gcc dot gnu.org @ 2011-02-14 1:28 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43157
Dave Korn <davek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #9 from Dave Korn <davek at gcc dot gnu.org> 2011-02-14 01:08:17 UTC ---
Verified that the problem was indeed fixed by the patch in comment 8.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug lto/43157] Segmentation fault in aggregate_value_p, asm aliases do not work
[not found] <bug-43157-4@http.gcc.gnu.org/bugzilla/>
2010-11-20 14:41 ` d.g.gorbachev at gmail dot com
2010-12-10 6:58 ` davek at gcc dot gnu.org
@ 2010-12-10 14:29 ` davek at gcc dot gnu.org
2011-02-14 1:28 ` davek at gcc dot gnu.org
3 siblings, 0 replies; 10+ messages in thread
From: davek at gcc dot gnu.org @ 2010-12-10 14:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43157
--- Comment #8 from Dave Korn <davek at gcc dot gnu.org> 2010-12-10 14:29:03 UTC ---
Author: davek
Date: Fri Dec 10 14:28:58 2010
New Revision: 167688
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167688
Log:
gcc/ChangeLog:
PR middle-end/46674
PR lto/43157
* target.def (mangle_assembler_name): New target asm_out hook.
* targhooks.c (default_mangle_assembler_name): Add default hook
implementation.
* targhooks.h (default_mangle_assembler_name): Add prototype.
* lto-symtab.c (lto_symtab_register_decl): Use new hook when
processing DECL_ASSEMBLER_NAMEs for lto symtabs.
(lto_symtab_get_resolution): Likewise.
(lto_cgraph_replace_node): Likewise.
(lto_symtab_prevailing_decl): Likewise.
* lto-streamer-out.c (write_symbol): Likewise.
* doc/tm.texi.in (TARGET_MANGLE_ASSEMBLER_NAME): Add @hook directive.
* doc/tm.texi: Regenerate.
* config/i386/cygming.h (TARGET_MANGLE_ASSEMBLER_NAME): Define to
point at i386_pe_mangle_assembler_name.
* config/i386/winnt.c (i386_pe_mangle_assembler_name): New function.
* config/i386/i386-protos.h (i386_pe_mangle_assembler_name): Add
prototype.
lto-plugin/ChangeLog:
PR middle-end/46674
PR lto/43157
* configure.ac (SYM_STYLE): Don't AC_DEFINE.
* lto-plugin.c (sym_style): Don't use it; default to ss_none.
* configure: Regenerate.
* config.h.in: Likewise.
gcc/testsuite/ChangeLog:
PR middle-end/46674
PR lto/43157
* gcc.dg/pr43157.c: New file.
Added:
trunk/gcc/testsuite/gcc.dg/pr43157.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/cygming.h
trunk/gcc/config/i386/i386-protos.h
trunk/gcc/config/i386/winnt.c
trunk/gcc/doc/tm.texi
trunk/gcc/doc/tm.texi.in
trunk/gcc/lto-streamer-out.c
trunk/gcc/lto-symtab.c
trunk/gcc/target.def
trunk/gcc/targhooks.c
trunk/gcc/targhooks.h
trunk/gcc/testsuite/ChangeLog
trunk/lto-plugin/ChangeLog
trunk/lto-plugin/config.h.in
trunk/lto-plugin/configure
trunk/lto-plugin/configure.ac
trunk/lto-plugin/lto-plugin.c
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug lto/43157] Segmentation fault in aggregate_value_p, asm aliases do not work
[not found] <bug-43157-4@http.gcc.gnu.org/bugzilla/>
2010-11-20 14:41 ` d.g.gorbachev at gmail dot com
@ 2010-12-10 6:58 ` davek at gcc dot gnu.org
2010-12-10 14:29 ` davek at gcc dot gnu.org
2011-02-14 1:28 ` davek at gcc dot gnu.org
3 siblings, 0 replies; 10+ messages in thread
From: davek at gcc dot gnu.org @ 2010-12-10 6:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43157
Dave Korn <davek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |davek at gcc dot gnu.org
--- Comment #7 from Dave Korn <davek at gcc dot gnu.org> 2010-12-10 06:57:54 UTC ---
I can't reproduce any segfault, but this slightly-modified version of the
testcase fails on i686-pc-cygwin, which is a target where __USER_LABEL_PREFIX
is an underscore:
admin@ubik /gnu/gcc/obj-lto/gcc
$ cat pr43157.c
/* { dg-do link } */
/* { dg-require-effective-target lto } */
/* { dg-options "-O1 -flto -fuse-linker-plugin" } */
#define LABEL3(pfx, x) # pfx x
#define LABEL2(pfx, x) LABEL3(pfx, x)
#define LABEL(x) LABEL2(__USER_LABEL_PREFIX__, x)
unsigned int factorial_ (unsigned int) __asm__ (LABEL ("factorial"));
unsigned int factorial (unsigned int i)
{
return i > 1 ? i * factorial_ (i - 1) : 1;
}
int main (void)
{
return factorial (5);
}
admin@ubik /gnu/gcc/obj-lto/gcc
$ ./xgcc.exe -B. -O1 -flto -fuse-linker-plugin pr43157.c -o pr43157.exe
/win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccroMaGc.ltrans0.ltrans.o:ccroMaGc.ltrans
0.o:(.text.startup+0x16): undefined reference to `_factorial'
collect2: ld returned 1 exit status
Looking at the lto symtab in the generated .o file:
admin@ubik /gnu/gcc/obj-lto/gcc
$ nm --plugin /gnu/gcc/obj-asm-mangle/gcc/cyglto_plugin-0.dll pr43157.o
U _factorial
00000000 T factorial
00000000 T main
... you can see it's gotten confused about c-level vs. asm-level symbols, this
reflects in the generated resolution file:
admin@ubik /gnu/gcc/obj-lto/gcc
$ ./xgcc.exe -B. -O1 -flto -fuse-linker-plugin pr43157.c -o pr43157.exe --save-
temps
[Leaving LTRANS /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccU0cpRH.args]
[Leaving LTRANS pr43157.exe.ltrans.out]
[Leaving LTRANS /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccGUCoPM.args]
[Leaving LTRANS pr43157.exe.ltrans0.o]
pr43157.exe.ltrans0.ltrans.o:pr43157.exe.ltrans0.o:(.text.startup+0x16):
undefin
ed reference to `_factorial'
collect2: ld returned 1 exit status
admin@ubik /gnu/gcc/obj-lto/gcc
$ cat pr43157.res
1
pr43157.o 3
75 d804d237 PREVAILING_DEF_IRONLY _factorial
84 d804d237 PREVAILING_DEF _main
87 d804d237 UNDEF __factorial
With my patch for asm name mangling in lto symtabs, it works fine. The
generated lto symtab contains asm-level symbols only:
admin@ubik /gnu/gcc/obj-asm-mangle/gcc
$ ./xgcc.exe -B. -O1 -flto -fuse-linker-plugin -c pr43157.c -o pr43157.o
admin@ubik /gnu/gcc/obj-asm-mangle/gcc
$ nm --plugin /gnu/gcc/obj-asm-mangle/gcc/cyglto_plugin-0.dll pr43157.o
00000000 T _factorial
00000000 T _main
admin@ubik /gnu/gcc/obj-asm-mangle/gcc
$ ./xgcc.exe -B. -O1 -flto -fuse-linker-plugin pr43157.c -o pr43157.exe --save-
temps
[Leaving LTRANS /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccBfa3cb.args]
[Leaving LTRANS pr43157.exe.ltrans.out]
[Leaving LTRANS /win/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccmkGBnN.args]
[Leaving LTRANS pr43157.exe.ltrans0.o]
admin@ubik /gnu/gcc/obj-asm-mangle/gcc
$ cat pr43157.res
1
pr43157.o 2
75 f3900364 PREVAILING_DEF_IRONLY _factorial
84 f3900364 PREVAILING_DEF _main
admin@ubik /gnu/gcc/obj-asm-mangle/gcc
... and so the resolution file comes out correct.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug lto/43157] Segmentation fault in aggregate_value_p, asm aliases do not work
[not found] <bug-43157-4@http.gcc.gnu.org/bugzilla/>
@ 2010-11-20 14:41 ` d.g.gorbachev at gmail dot com
2010-12-10 6:58 ` davek at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2010-11-20 14:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43157
--- Comment #6 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2010-11-20 14:41:02 UTC ---
Can't reproduce it with GCC 4.6.0 20101113.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-02-14 1:08 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-24 0:00 [Bug lto/43157] New: Segmentation fault in aggregate_value_p d dot g dot gorbachev at gmail dot com
2010-02-24 0:02 ` [Bug lto/43157] " d dot g dot gorbachev at gmail dot com
2010-02-24 10:50 ` rguenth at gcc dot gnu dot org
2010-06-03 15:25 ` [Bug lto/43157] Segmentation fault in aggregate_value_p, asm aliases do not work rguenth at gcc dot gnu dot org
2010-07-20 13:09 ` rguenth at gcc dot gnu dot org
2010-07-22 14:15 ` rguenth at gcc dot gnu dot org
[not found] <bug-43157-4@http.gcc.gnu.org/bugzilla/>
2010-11-20 14:41 ` d.g.gorbachev at gmail dot com
2010-12-10 6:58 ` davek at gcc dot gnu.org
2010-12-10 14:29 ` davek at gcc dot gnu.org
2011-02-14 1:28 ` davek 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).