User account creation filtered due to spam.

Bug 39533 - [5/6/7/8 Regression] -MM may list a header file twice
Summary: [5/6/7/8 Regression] -MM may list a header file twice
Status: WAITING
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: 4.4.0
: P4 trivial
Target Milestone: 5.5
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-23 21:36 UTC by H.J. Lu
Modified: 2016-08-03 10:46 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.3.3
Known to fail:
Last reconfirmed: 2009-05-22 14:38:46


Attachments
A testcase (7.18 KB, application/octet-stream)
2009-03-23 21:44 UTC, H.J. Lu
Details
A updated testcase (324 bytes, application/octet-stream)
2009-03-24 17:26 UTC, H.J. Lu
Details
A real tescase (308 bytes, application/octet-stream)
2009-03-24 17:43 UTC, H.J. Lu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2009-03-23 21:36:49 UTC
"gcc -MM" may list a header file twice.
Comment 1 Andrew Pinski 2009-03-23 21:39:58 UTC
Example?
Comment 2 H.J. Lu 2009-03-23 21:44:32 UTC
Created attachment 17527 [details]
A testcase

# gcc -MM x.c -Iinclude 	
x.o: x.c foo.h include/ansidecl.h include/libiberty.h include/ansidecl.h

include/ansidecl.h is listed twice. Icc 11.1 generates:

[hjl@gnu-6 dep-1]$ /opt/intel/cce/11.1/bin/icc -MM  x.c -Iinclude 
x.o: x.c foo.h include/ansidecl.h include/libiberty.h
[hjl@gnu-6 dep-1]$
Comment 3 Andrew Pinski 2009-03-24 01:48:13 UTC
This testcase is not complete, it does not include foo.h.
Comment 4 Andrew Pinski 2009-03-24 01:50:41 UTC
If I do
cat > foo.h << EOF
#include <ansidecl.h>
EOF

I get the duplicated include file but I don;t think it matters as it is included twice, how does the cpp know they are really the same include file

Comment 5 H.J. Lu 2009-03-24 17:26:13 UTC
Created attachment 17536 [details]
A updated testcase

Here is the correct testcase.
Comment 6 H.J. Lu 2009-03-24 17:26:39 UTC
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2009-03/msg01133.html
Comment 7 H.J. Lu 2009-03-24 17:43:55 UTC
Created attachment 17537 [details]
A real tescase

This should be correct.
Comment 8 Ralf Wildenhues 2009-03-24 17:49:18 UTC
Why is this a bug?  I'm really curious to know; the manual doesn't document
that -MM output is uniquified.
Comment 9 Tom Tromey 2009-03-30 21:23:41 UTC
It is not really a bug, but it is ugly.
Comment 10 H.J. Lu 2009-03-30 21:26:46 UTC
(In reply to comment #9)
> It is not really a bug, but it is ugly.
> 

Is there anything wrong with my patch?
Comment 11 Tom Tromey 2009-03-30 21:50:00 UTC
I am looking at it right now.
Comment 12 Steven Bosscher 2009-07-15 07:30:56 UTC
Tom, ping.
Comment 13 Jakub Jelinek 2012-03-13 12:46:44 UTC
4.4 branch is being closed, moving to 4.5.4 target.
Comment 14 Jakub Jelinek 2013-04-12 15:16:33 UTC
GCC 4.6.4 has been released and the branch has been closed.
Comment 15 Richard Biener 2014-06-12 13:44:15 UTC
The 4.7 branch is being closed, moving target milestone to 4.8.4.
Comment 16 Jakub Jelinek 2014-12-19 13:34:23 UTC
GCC 4.8.4 has been released.
Comment 17 Richard Biener 2015-06-23 08:16:53 UTC
The gcc-4_8-branch is being closed, re-targeting regressions to 4.9.3.
Comment 18 Jakub Jelinek 2015-06-26 19:58:09 UTC
GCC 4.9.3 has been released.
Comment 19 Richard Biener 2016-08-03 10:44:49 UTC
GCC 4.9 branch is being closed