Bug 44989 - g++.dg/guality/redeclaration1.C
Summary: g++.dg/guality/redeclaration1.C
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: testsuite-fail, wrong-debug
Depends on:
Blocks:
 
Reported: 2010-07-19 13:40 UTC by H.J. Lu
Modified: 2021-12-24 07:52 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-07-23 12:56:35


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2010-07-19 13:40:52 UTC
On Linux/x86, revision 162274 gave:

FAIL: g++.dg/guality/redeclaration1.C  -O2 -flto  line 16 i == 24
FAIL: g++.dg/guality/redeclaration1.C  -O2 -fwhopr  line 16 i == 24

Revision 162258 is OK.
Comment 1 H.J. Lu 2010-07-19 13:42:25 UTC
Revision 162269 is bad and revision 162264 is good.
Comment 2 Jakub Jelinek 2010-07-19 16:32:01 UTC
The test is new, how could this be a regression?
Yes, -flto/-fwhopr has lots of issues with debug info.
Comment 3 Richard Biener 2010-07-23 12:56:35 UTC
Confirmed.
Comment 4 Richard Biener 2010-09-02 11:08:12 UTC
I can't get anything but { dg-skip-if "" { *-*-* } { "-fwhopr" "-flto" } { "" } } to work.  But then -O0 still fails for me.

13          int i = 42;^M
$1 = 0^M
$2 = 42^M
0 != 42

with gdb 7.1.
Comment 5 Jakub Jelinek 2010-09-02 11:51:58 UTC
This isn't a testsuite bug, but lto/whopr bug, and IMHO quite severe, it affects debugging even at -O0.
Comment 6 Jakub Jelinek 2010-09-02 12:37:01 UTC
Seems to be a bug in free_lang_data_in_block, which throws away the DECL_EXTERNAL decl from BLOCK_VARS, eventhough it is obviously very much needed. In fact, is there ever a case where what free_lang_data_in_block does is desirable?
Comment 7 Richard Biener 2010-11-03 16:01:41 UTC
No.  It's gone now ;)

But the FAILs remain.
Comment 8 Jakub Jelinek 2010-11-10 16:16:10 UTC
I don't think this is a P1 though, lto is known to have lots of issues with debug info, that isn't going to be fully fixed for 4.6, and this is just one of them.
Comment 9 Richard Biener 2010-11-15 15:52:48 UTC
Author: rguenth
Date: Mon Nov 15 15:52:42 2010
New Revision: 166757

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166757
Log:
2010-11-15  Richard Guenther  <rguenther@suse.de>

	PR lto/44989
	* g++.dg/guality/redeclaration1.C: Do not execute for LTO.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/guality/redeclaration1.C
Comment 10 Richard Biener 2010-11-15 15:53:07 UTC
Ok, the dg-skip if works.  LTO makes us print 24 for the first i.  Because
gdb name lookup is confused if the local i is gone.

So it's really wrong debug info.  But it's hardly a regression for LTO.

I'll commit the dg-skip and leave the bug open as non-regression.