other/2722: Option -MD does not work in gcc>2.95 in some cases

vignani@tin.it vignani@tin.it
Thu May 3 02:36:00 GMT 2001


>Number:         2722
>Category:       other
>Synopsis:       Option -MD does not work in gcc>2.95 in some cases
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 03 02:36:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     vignani@tin.it
>Release:        from gcc-2.96 to gcc-20010430
>Organization:
>Environment:
Linux Mandrake 8.0 on i686
>Description:
When using the -MD option with an output file with no
extension, gcc passes a wrong argument list to cc1. This
is related to a counter going down to -1 and a dot character
being written out of an array bound. Since the results are
unpredictable, it is not always possible to reproduce the
bug (e.g. it didn't show up on Linux Mandrake 7.2)
>How-To-Repeat:
gcc -v -MD anyfile.c -o anyfile
>Fix:
Patch provided for gcc-20010430. This avoids writing into
arg[-1] when no extension (dot) is found. Also, suffix_subst
is always appended, even with there is no filename.
Tested by recompiling gcc itself and dosemu (which uses -MD)
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-unknown-content-type-IgorPatch; name="gcc30.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gcc30.patch"

LS0tIGdjYy5jCVR1ZSBNYXkgIDEgMTg6Mzc6NTggMjAwMQorKysgZ2NjLmMJV2VkIE1heSAgMiAx
NjoxOTozNiAyMDAxCkBAIC01MjcxLDcgKzUyNzEsNyBAQAogCSAgICBkb19zcGVjXzEgKCIgIiwg
MCwgTlVMTF9QVFIpOwogCSAgaWYgKHN1ZmZpeF9zdWJzdCkKIAkgICAgewotCSAgICAgIHVuc2ln
bmVkIGxlbmd0aCA9IHN0cmxlbiAoYXJnKTsKKwkgICAgICBpbnQgbGVuZ3RoID0gc3RybGVuIChh
cmcpOwogCiAJICAgICAgd2hpbGUgKGxlbmd0aC0tICYmICFJU19ESVJfU0VQQVJBVE9SIChhcmdb
bGVuZ3RoXSkpCiAJCWlmIChhcmdbbGVuZ3RoXSA9PSAnLicpCkBAIC01MjgwLDExICs1MjgwLDEx
IEBACiAJCSAgICBicmVhazsKIAkJICB9CiAJICAgICAgZG9fc3BlY18xIChhcmcsIDEsIE5VTExf
UFRSKTsKLQkgICAgICBpZiAoIWFyZ1tsZW5ndGhdKQorCSAgICAgIGlmIChsZW5ndGg+PTAgJiYg
IWFyZ1tsZW5ndGhdKQogCQl7CiAJCSAgKChjaGFyICopYXJnKVtsZW5ndGhdID0gJy4nOwotCQkg
IGRvX3NwZWNfMSAoc3VmZml4X3N1YnN0LCAxLCBOVUxMX1BUUik7CiAJCX0KKwkgICAgICBkb19z
cGVjXzEgKHN1ZmZpeF9zdWJzdCwgMSwgTlVMTF9QVFIpOwogCSAgICB9CiAJICBlbHNlCiAJICAg
IGRvX3NwZWNfMSAoYXJnLCAxLCBOVUxMX1BUUik7Cg==



More information about the Gcc-bugs mailing list