From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id 7ECA53858401 for ; Sun, 5 Sep 2021 16:24:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7ECA53858401 Received: by mail-lj1-x236.google.com with SMTP id i28so6981216ljm.7 for ; Sun, 05 Sep 2021 09:24:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=AEm88X0YwHiHqBI6+DN7cDj0uYKu0+l62MVRzdgyIHI=; b=NL8PyRLa25FvZlRj8/7sRMdg4ReRsTgjqdJfTG1adf1JfahhtxF+c+BVW7g5zpDQe0 9xb8xUFCnRi2bTykufMPeWBtF960AziMBICu/g61PeCqg48VXTKVRVF+NyvZlJmeeUYN mm/t4idXnqeADO03/ZbLdekCNZDglAFJKlgXq6JmEf8akGapqShi5Rm/lfjM7ho8eU3F HSpCE7rEyrTfNmOnBtgC6i8J4FWNcvzk5h/RoaPcwLcmK48ldGlwZ/olgXfJ3OSJtycz 1+LG28iHf+m0JsXlh1udhqhN3ReI5FY1ZQN4d8qA0fo+0IZJpM9/3+JQENOCVl387VdS bRpg== X-Gm-Message-State: AOAM530Q4hT00TBn+URSP9fboKAS73/f/x4EaZY4oiYUzyh1VJT8wk/2 jxml75j3/jnskaO9cdXmU6R3fWkour/oqiw8A7f9Vw== X-Google-Smtp-Source: ABdhPJwzYQeaRHkXxRiEi0m98WzZUzMMCSomp90tNf9B+E1kg9yggif3j02DVEb5+2cQ94d1YDKWXajpcAoijNHy4KY= X-Received: by 2002:a2e:6c05:: with SMTP id h5mr7294941ljc.73.1630859039616; Sun, 05 Sep 2021 09:23:59 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ian Lance Taylor Date: Sun, 5 Sep 2021 09:23:48 -0700 Message-ID: Subject: Re: Rust Compatibility To: Philip Herron Cc: gcc-rust@gcc.gnu.org, David Edelsohn , Brad Spengler Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_SPF_WL autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-rust@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: gcc-rust mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2021 16:24:02 -0000 On Thu, Sep 2, 2021 at 7:06 AM Philip Herron w= rote: > > Yesterday this issue was posted to us on GitHub https://github.com/Rust-G= CC/gccrs/issues/653, which revolves around strict-aliasing rules. > > The conversation was focused on what level of compatibility we are aiming= for in the Rust language. This is important, and I don't believe we should= allow specific language features/development outside the official Rust pro= cesses. This means we do not want to have any GCC specific attributes or la= nguage features and we won't provide a shortcut to bypass RFC processes. > > Though I believe we should always allow users to invoke GCC Rust however = they wish (since the FE inherits the common GCC options), this is the point= of free software to me. To mitigate any GCC vs Rustc incompatibility, our = cargo-gccrs wrapper was always intended to map rust arguments over to the G= CC version of these to get the intended Rustc behaviour. But still, when us= ers want to invoke gccrs directly, it is up to them to choose what options = they want, good or bad, including using gcc-plugins. > > Some of the feedback seems that if we allow users to compile code with or= without strict aliasing, this may allow for code to compile with GCC but n= ot with rustc which "splits the ecosystem". So I wanted to run this by you = guys here to get feedback on what people think about allowing users to choo= se their GCC compilation options in general. Using that rather strict sense of splitting the ecosystem, there are various GCC optimization options that will split the ecosystem, because they will cause code to behave differently. It's not just -fstrict-aliasing, it's also options like -ffast-math or -fexcess-precision which can all cause code to be compiled differently. Your choice is to either carefully forbid those options for Rust or to permit them and warn people accordingly. Personally I would favor permitting them. Ian