From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121555 invoked by alias); 18 Jun 2019 22:31:26 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 121533 invoked by uid 89); 18 Jun 2019 22:31:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=funny, HX-Languages-Length:798 X-Spam-Status: No, score=-6.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 2 recipients 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; Tue, 18 Jun 2019 22:31:25 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A72CA836; Tue, 18 Jun 2019 22:31:24 +0000 (UTC) Received: from ovpn-116-166.phx2.redhat.com (ovpn-116-166.phx2.redhat.com [10.3.116.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB9DB5F7C0; Tue, 18 Jun 2019 22:31:23 +0000 (UTC) Message-ID: <1560897082.3885.10.camel@redhat.com> Subject: Re: [PATCH][gcc] libgccjit: check result_type in gcc_jit_context_new_binary_op From: David Malcolm To: Andrea Corallo , "gcc-patches@gcc.gnu.org" , "jit@gcc.gnu.org" Cc: nd Date: Tue, 01 Jan 2019 00:00:00 -0000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 18 Jun 2019 22:31:24 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2019-q2/txt/msg00005.txt.bz2 On Mon, 2019-06-10 at 09:15 +0000, Andrea Corallo wrote: > Hi all, > I would like to propose this patch to check for the return type of > binary operators to be a numeric type. > Not doing so can lead the compiler into funny crashes. > > Does not introduce regressions running make check-jit. > > OK for trunk? > > Bests > Andrea > > 2019-06-09 Andrea Corallo andrea.corallo@arm.com > > * libgccjit.c (gcc_jit_context_new_binary_op): Check result_type to > be a > numeric type. Thanks for this patch. Please can you add a test case that triggers the error-handling case? (I'm trying to imagine a situation where this could have happened). See gcc/testsuite/jit.dg/test-error-new-binary-op-bad-op.c or similar. Dave