re PR lto/56297 (LTO: multiple definition error with global register variables)

2013-02-12  Richard Biener  <rguenther@suse.de>

	PR lto/56297
	* lto-streamer-out.c (write_symbol): Do not output symbols
	for hard register variables.

	* gcc.dg/lto/pr56297_0.c: New testcase.
	* gcc.dg/lto/pr56297_0.c: Likewise.

From-SVN: r195979
This commit is contained in:
Richard Biener 2013-02-12 15:14:32 +00:00 committed by Richard Biener
parent e68a4ef6ea
commit 7cbda5184c
5 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2013-02-12 Richard Biener <rguenther@suse.de>
PR lto/56297
* lto-streamer-out.c (write_symbol): Do not output symbols
for hard register variables.
2013-02-12 Georg-Johann Lay <avr@gjlay.de>
PR target/54222

View File

@ -1166,7 +1166,8 @@ write_symbol (struct streamer_tree_cache_d *cache,
if (!TREE_PUBLIC (t)
|| is_builtin_fn (t)
|| DECL_ABSTRACT (t)
|| TREE_CODE (t) == RESULT_DECL)
|| TREE_CODE (t) == RESULT_DECL
|| (TREE_CODE (t) == VAR_DECL && DECL_HARD_REGISTER (t)))
return;
gcc_assert (TREE_CODE (t) == VAR_DECL

View File

@ -1,3 +1,9 @@
2013-02-12 Richard Biener <rguenther@suse.de>
PR lto/56297
* gcc.dg/lto/pr56297_0.c: New testcase.
* gcc.dg/lto/pr56297_0.c: Likewise.
2013-02-12 Janus Weil <janus@gcc.gnu.org>
PR fortran/46952

View File

@ -0,0 +1,13 @@
/* { dg-lto-do link } */
/* { dg-lto-options { { -flto -fno-common } } } */
#if __x86_64__ || __i386__
register int i asm("esp");
#else
extern int i;
#endif
int main(void)
{
return i;
}

View File

@ -0,0 +1,5 @@
#if __x86_64__ || __i386__
register int i asm("esp");
#else
int i;
#endif