From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 783333858C39 for ; Tue, 9 Jan 2024 16:01:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 783333858C39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 783333858C39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704816076; cv=none; b=Qtg9xfrU0Qj1EJgLIR7BKYh3UAmyh1SgL4vue201v/Rp+kIwIKFBqViuDQLrTR2FhmdMpmUGQbiC5SL7geXOT59JURxBZwZXRf7yJukcOkar40SqRy27TotaCjN8nU1AObZrR1VszlG8TQ+upFrecSorNmo8Icsdz9wAbeAKyQY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704816076; c=relaxed/simple; bh=ttuoXFGR2zQuBJpMBJdTuNlo0G1Voj8B2kjmztLUiYU=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=CvkJa+yvSEcKYMkpwNLzlhWmbaPpYlqilp1Iagf8KBLX+gfmqxZgP5fkhL3G/xUXXTzModlIoL06+eobKhy2Nm1dgm8tnA3fTLnKI1atMIjB8RS6A7JSzn4YJg8S84Y5Il4w9ByCMf/tonqWXCy9S0x3qAvBHoIAWd5CfIo3B/4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704816071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0h764NXTSHhTv6u9JbB9LGzCQ4yGeEozUoeO2fWTEA4=; b=ISmLulI+JTLXXLVieGdNylg6/gL+Re1vZSf32nfyX6itoYoa7o2uFSulRYsL0ashZJop5m VVftXcjjDhiuRLX9oAwwNXUKeJqAfITUyCpL5kOum1bBXF+y345UJfNJj6UZT00bHD/w50 ZIRrYl700vI78zw4IaR/eBOQGulfqFw= Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-675-UjFef3O2MAqHKaJtdoFqXA-1; Tue, 09 Jan 2024 11:01:04 -0500 X-MC-Unique: UjFef3O2MAqHKaJtdoFqXA-1 Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-3bbac3d23f8so3874237b6e.0 for ; Tue, 09 Jan 2024 08:01:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704816063; x=1705420863; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0h764NXTSHhTv6u9JbB9LGzCQ4yGeEozUoeO2fWTEA4=; b=jq9cuEhn2ClkXUqCiuaaWtPDW4nFaOlNWojiHa+cq07uxzXmsFPz1jZpBuwd2QwTiK dbbSgISJyJYcZqGfy1tH7ZnMVo6wUm2DlYbfp8r6HMvX/b1nFyFpZ6NuzEL+8i1PIJAT lwXfjDTOnnglnbqoxWTMHiKoaikSaYgwgR485sVpGJtzdzXZ1g/flG2X8tnd9odFs5Z0 GlfO+5ipoUcfQhxZg0FDw6ayWqAl4HpJCo6+7SQxGmVvCaZXzH83ZLnGEt57Dz+bQBF3 zUOfaAiGRLb7sYwM5E86hlySsWyvkBGWEK0JS45f1YLg138IgcAqdOYBXyR/hoJfJg/r zEew== X-Gm-Message-State: AOJu0Yz02mZ6cNpNq/7AvKzwEUHdUvR6i8F5zsgtBWjx/YeZ5PceCiR3 pK5vDLWD44qbOQzz+nYPIDWS8kfwU8BxV5h9SOrHhhUJgC0BO8f1FhPBy5ej3VW0li4FYQnhC4Z 1Ey9crknK9RwjyW4= X-Received: by 2002:a05:6808:22a4:b0:3bd:3962:1640 with SMTP id bo36-20020a05680822a400b003bd39621640mr1690097oib.0.1704816063353; Tue, 09 Jan 2024 08:01:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IHz9d9iTGN2nMF7OFjbBc3ttfXw/aWfo5PXhAGd31yjMiH9ik7C04PlxDrzkjH/JbP59fUwPw== X-Received: by 2002:a05:6808:22a4:b0:3bd:3962:1640 with SMTP id bo36-20020a05680822a400b003bd39621640mr1690088oib.0.1704816063133; Tue, 09 Jan 2024 08:01:03 -0800 (PST) Received: from t14s.localdomain (c-76-28-97-5.hsd1.ma.comcast.net. [76.28.97.5]) by smtp.gmail.com with ESMTPSA id ev16-20020a0562140a9000b0067f6174c766sm998496qvb.0.2024.01.09.08.01.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 08:01:02 -0800 (PST) Message-ID: <74e66bf566ded48ecc2f7cc4e55bf8b92efdd5b2.camel@redhat.com> Subject: Re: [PATCH] libgccjit: Support signed char flag From: David Malcolm To: Antoni Boucher , "jit@gcc.gnu.org" , "gcc-patches@gcc.gnu.org" Date: Tue, 09 Jan 2024 11:01:01 -0500 In-Reply-To: <455400c598a6a9e0932c4c5b15c5d8fc30355ade.camel@zoho.com> References: <455400c598a6a9e0932c4c5b15c5d8fc30355ade.camel@zoho.com> User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, 2023-12-21 at 08:42 -0500, Antoni Boucher wrote: > Hi. > This patch adds support for the -fsigned-char flag. Thanks. The patch looks correct to me. > I'm not sure how to test it since I stumbled upon this bug when I > found > this other bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107863) > which is now fixed. > Any idea how I could test this patch? We already document that GCC_JIT_TYPE_CHAR has "some signedness". The bug being fixed here is that gcc_jit_context compilations were always treating "char" as unsigned, regardless of the value of -fsigned-char (either from the target's default, or as a context option), when it makes more sense to follow the C frontend's behavior. So perhaps jit-written code with a context that has -fsigned-char as an option (via gcc_jit_context_add_command_line_option), and which promotes a negative char to a signed int, and then returns the result as an int? Presumably if we're erroneously forcing "char" to be unsigned, the int will be in the range 0x80 to 0xff, rather that being negative. Dave