From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55963 invoked by alias); 26 Oct 2016 19:18:03 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 55950 invoked by uid 89); 26 Oct 2016 19:18:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=3487, 348,7 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Oct 2016 19:18:01 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E25D8050A for ; Wed, 26 Oct 2016 19:18:00 +0000 (UTC) Received: from reynosa.quesejoda.com (vpn-59-95.rdu2.redhat.com [10.10.59.95]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9QJHvRN030108 for ; Wed, 26 Oct 2016 15:17:59 -0400 To: gcc-patches From: Aldy Hernandez Subject: [PR debug/77773] segfault when compiling __simd64_float16_t with -g Message-ID: <21e018d1-4d2c-5f46-6ec1-1cc54c180e58@redhat.com> Date: Wed, 26 Oct 2016 19:18:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1AABC3830D4C422A3D4F6879" X-SW-Source: 2016-10/txt/msg02182.txt.bz2 This is a multi-part message in MIME format. --------------1AABC3830D4C422A3D4F6879 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 828 The following one-liner segfaults on arm-eabi when compiled with -mfloat-abi=hard -g: __simd64_float16_t usingit; The problem is that the pretty printer (in simple_type_specificer()) is dereferencing a NULL result from c_common_type_for_mode: int prec = TYPE_PRECISION (t); if (ALL_FIXED_POINT_MODE_P (TYPE_MODE (t))) t = c_common_type_for_mode (TYPE_MODE (t), TYPE_SATURATING (t)); else t = c_common_type_for_mode (TYPE_MODE (t), TYPE_UNSIGNED (t)); if (TYPE_NAME (t)) The type in question is: which corresponds to HFmode and which AFAICT, does not have a type by design. I see that other uses of *type_for_node() throughout the compiler check the result for NULL, so perhaps we should do the same here. The attached patch fixes the problem. OK for trunk? --------------1AABC3830D4C422A3D4F6879 Content-Type: text/plain; charset=UTF-8; name="curr" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="curr" Content-length: 1456 Y29tbWl0IDEwYzVhNTRjYjFiZjQ2ODQ4NjRiMDFjYjk2NWQ4M2YzZmU0NzQ3 OTcKQXV0aG9yOiBBbGR5IEhlcm5hbmRleiA8YWxkeWhAcmVkaGF0LmNvbT4K RGF0ZTogICBXZWQgT2N0IDI2IDEyOjA2OjA5IDIwMTYgLTA3MDAKCiAgICAJ UFIgZGVidWcvNzc3NzMKICAgIAkqIGMtcHJldHR5LXByaW50LmMgKHNpbXBs ZV90eXBlX3NwZWNpZmllcik6IERvIG5vdCBkZXJlZmVyZW5jZSBgdCcKICAg IAlpZiBOVUxMLgoKZGlmZiAtLWdpdCBhL2djYy9jLWZhbWlseS9jLXByZXR0 eS1wcmludC5jIGIvZ2NjL2MtZmFtaWx5L2MtcHJldHR5LXByaW50LmMKaW5k ZXggOTA0MjhjYS4uNmJiMzhhOSAxMDA2NDQKLS0tIGEvZ2NjL2MtZmFtaWx5 L2MtcHJldHR5LXByaW50LmMKKysrIGIvZ2NjL2MtZmFtaWx5L2MtcHJldHR5 LXByaW50LmMKQEAgLTM0OCw3ICszNDgsNyBAQCBjX3ByZXR0eV9wcmludGVy OjpzaW1wbGVfdHlwZV9zcGVjaWZpZXIgKHRyZWUgdCkKIAkgICAgdCA9IGNf Y29tbW9uX3R5cGVfZm9yX21vZGUgKFRZUEVfTU9ERSAodCksIFRZUEVfU0FU VVJBVElORyAodCkpOwogCSAgZWxzZQogCSAgICB0ID0gY19jb21tb25fdHlw ZV9mb3JfbW9kZSAoVFlQRV9NT0RFICh0KSwgVFlQRV9VTlNJR05FRCAodCkp OwotCSAgaWYgKFRZUEVfTkFNRSAodCkpCisJICBpZiAodCAmJiBUWVBFX05B TUUgKHQpKQogCSAgICB7CiAJICAgICAgc2ltcGxlX3R5cGVfc3BlY2lmaWVy ICh0KTsKIAkgICAgICBpZiAoVFlQRV9QUkVDSVNJT04gKHQpICE9IHByZWMp CkBAIC0zNjIsNiArMzYyLDcgQEAgY19wcmV0dHlfcHJpbnRlcjo6c2ltcGxl X3R5cGVfc3BlY2lmaWVyICh0cmVlIHQpCiAJICAgICAgc3dpdGNoIChjb2Rl KQogCQl7CiAJCWNhc2UgSU5URUdFUl9UWVBFOgorCQkgIGdjY19hc3NlcnQg KHQgIT0gTlVMTCk7CiAJCSAgdHJhbnNsYXRlX3N0cmluZyAoVFlQRV9VTlNJ R05FRCAodCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gIjx1bm5hbWVkLXVuc2lnbmVkOiIKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogIjx1bm5hbWVkLXNpZ25lZDoiKTsK --------------1AABC3830D4C422A3D4F6879--