This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/54095] Unnecessary static variable renaming
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 25 Sep 2012 09:04:20 +0000
- Subject: [Bug lto/54095] Unnecessary static variable renaming
- Auto-submitted: auto-generated
- References: <bug-54095-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54095
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #28215|0 |1
is obsolete| |
--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-25 09:04:20 UTC ---
Created attachment 28264
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28264
new patch
Next try using symtab_real_symbol_p. Works better, but I now fail to
rename multiple uses of
static inline void
unread_char (int ch)
{
if (ch == '\n')
read_md_lineno--;
ungetc (ch, read_md_file);
}
from read-md.h during bootstrap (thus, with C++). symtab_real_symbol_p returns
false for
_ZL11unread_chari/2124 (unread_char) @0x7ffff5feb9c0
Type: function
Visibility:
next sharing asm name: 2108
previous sharing asm name: 2125
References: read_md_lineno/1445 (read)read_md_lineno/1445
(write)read_md_file/1443 (read)
Referring:
Function unread_char/2124 is inline copy in read_rtx_code/460
Clone of _ZL11unread_chari/428
Availability: local
Function flags: analyzed local finalized
Called by: _ZL17read_rtx_variadicP7rtx_def/462 (0.01 per call) (inlined)
Calls: ungetc/515 (0.01 per call)
but we still stream its IL (and thus I get section conflicts)?
We also have non-inlined copies:
_ZL11unread_chari/1437 (unread_char) @0x7ffff600b3a8
Type: function
Visibility: prevailing_def_ironly
previous sharing asm name: 428
References: read_md_lineno/1445 (read)read_md_lineno/1445
(write)read_md_file/1443 (read)
Referring:
Read from file: build/read-md.o
Availability: local
Function flags: analyzed local finalized
Called by: _Z16read_skip_spacesv/1471 _Z24fatal_with_file_and_linePKcz/1469
(0.39 per call)
Calls: ungetc/515 (1.00 per call)
Not sure how I can make a reproducer, the following works
static inline int foo (int i) { asm("#"); asm("#"); asm ("#"); asm
("#");asm("#"); asm("#"); asm ("#"); asm ("#");asm("#"); asm("#"); asm ("#");
asm ("#");asm("#"); asm("#"); asm ("#"); asm ("#");asm("#"); asm("#"); asm
("#"); asm ("#" : : "g" (&i)); asm("#"); asm("#"); asm ("#"); asm ("#");
return i/10; }
int __attribute__((flatten)) bar (int j)
{
return foo (j);
}
int main()
{
return foo (0) + bar (0) + foo (0);
}