From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7684 invoked by alias); 3 Oct 2003 14:34:50 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 7676 invoked by uid 48); 3 Oct 2003 14:34:50 -0000 Date: Fri, 03 Oct 2003 14:34:00 -0000 Message-ID: <20031003143450.7675.qmail@sources.redhat.com> From: "taylor at candd dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20030929205632.12448.taylor@candd.org> References: <20030929205632.12448.taylor@candd.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug driver/12448] -MT / -MQ don't behave as documented. X-Bugzilla-Reason: CC X-SW-Source: 2003-10/txt/msg00236.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12448 ------- Additional Comments From taylor at candd dot org 2003-10-03 14:34 ------- To reproduce the problem, consider the following Makefile: CC = gcc CFLAGS = -MD -MT foo.o -MF foo.d MV = mv foo.o: bar.c ${CC} bar.c -o - > xfoo.o ${MV} xfoo.o foo.o Suppose bar.c includes no files, then the resulting foo.d file will contain: foo.o -: bar.c But, it should contain: foo.o: bar.c The - should NOT be present. You could argue about whether - should ever be a target within the .d file, but regardless -- if the user specified one or more targets with -MT / -MQ, then the *DEFAULT* target should *NOT* be used. Eliminating or editing the cpp_unique_options line, as mentioned, fixes the problem. Deleting the line (my preferred fix) bootstraps just fine. There do not appear to be any tests within the testsuite that test the -MT / -MQ / -MD / -MMD / -MF / -M options. If someone will give me a pointer on how to have the testsuite compare two files -- the generated .d file against the correct .d file, I will gladly write a test case for this bug.