diff options
author | Richard Guenther <rguenther@suse.de> | 2009-12-16 23:07:10 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-12-16 23:07:10 +0000 |
commit | cb799353d6b2f1972bb59a26654d57b7c4d526de (patch) | |
tree | a2fa08ca483d4b193a92311ed0fad9cd52d6aa09 | |
parent | 483a1dce8a60446bef569c47f371fe7e8b50010a (diff) | |
download | gcc-cb799353d6b2f1972bb59a26654d57b7c4d526de.zip gcc-cb799353d6b2f1972bb59a26654d57b7c4d526de.tar.gz gcc-cb799353d6b2f1972bb59a26654d57b7c4d526de.tar.bz2 |
re PR lto/42392 ([LTO] ICE with top level asm)
2009-12-16 Richard Guenther <rguenther@suse.de>
PR lto/42392
* langhooks.c (lhd_begin_section): Make sure to switch back
to the text section, not some random one.
* gcc.dg/lto/20091216-1_0.c: New testcase.
From-SVN: r155298
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/langhooks.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/20091216-1_0.c | 9 |
4 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b774fa3..6b03b42 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-12-16 Richard Guenther <rguenther@suse.de> + + PR lto/42392 + * langhooks.c (lhd_begin_section): Make sure to switch back + to the text section, not some random one. + 2009-12-16 Jakub Jelinek <jakub@redhat.com> * tree-chrec.c (chrec_convert_1): Only fold (T2)(t +- x) to diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 8505ec4..92eacd4 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -604,6 +604,8 @@ lhd_begin_section (const char *name) /* Save the old section so we can restore it in lto_end_asm_section. */ gcc_assert (!saved_section); saved_section = in_section; + if (!saved_section) + saved_section = text_section; /* Create a new section and switch to it. */ section = get_section (name, SECTION_DEBUG, NULL); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d2beaf3..e960cd0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-12-16 Richard Guenther <rguenther@suse.de> + + PR lto/42392 + * gcc.dg/lto/20091216-1_0.c: New testcase. + 2009-12-15 Jason Merrill <jason@redhat.com> PR c++/42387 diff --git a/gcc/testsuite/gcc.dg/lto/20091216-1_0.c b/gcc/testsuite/gcc.dg/lto/20091216-1_0.c new file mode 100644 index 0000000..8d12022 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091216-1_0.c @@ -0,0 +1,9 @@ +/* { dg-lto-do run } */ + +asm (".globl start; start: nop"); + +int +main () +{ + return 0; +} |