From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by sourceware.org (Postfix) with ESMTPS id 948D43858D33 for ; Tue, 29 Nov 2022 08:30:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 948D43858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x234.google.com with SMTP id a7so15946643ljq.12 for ; Tue, 29 Nov 2022 00:30:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=myV1okCpWdwlasZKo8P+5lu0bfYY4gYpie/u2s0p4Mw=; b=Vae+Lq0EGSQyfWMqA4RTmXW5e751Ufvxxnu1NjIkcPM9B14Ci/WgEXSwfdvb4ZeKd1 QVgNPC8rkH0oQlmdctohhREtyRMkSW8xi7iD6iTuCsTgnrsQvbU9UQR+ifPvc2wRexF/ fwo9xtdjqLSlRS+QbyRQ8krdcE2uFWOsQVc63QhecEtejn4UAGOamHabuvRn/rd+b4TW +LbGLuTXw60Qnp4Kzuljddewgzly7QDMmCTlobCUtY+BFHL9lvzbb0sb7ckbdLcYiWg3 DBNiWoPIUxoLVXU9XZdR+FFHi1eQmFK8KuG3T9+s5p9Xv6zcfB6xk1ICNpCYjH/4bS7R M7VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=myV1okCpWdwlasZKo8P+5lu0bfYY4gYpie/u2s0p4Mw=; b=z35MVtvReKQnaA1IjdYZEEZxmQFNNKYZfn+wmKNmq0ubKFjP07A3+D/h9JV21/8Oyq ZX1VSqAGLZSuRkVWhUeZ/MI2EjrgXOHQokp7EUKHdP8+Q+/E7fwK9Wjcaakf5wbw8cPw JcXlJG3rHcaZFI73tZoW+WxDRoiqH1djbGUdqdm7kCgwGAbiA+PZP9g3f6Kpx9A9hyX9 sck1B9BDleeM8sL1QtGkBUq7h6ExMZcAGHQBxAmPIjBCSNgoT19ZVwnSBKfcryzawuY8 m4HLd2g/YlXiVUuaGoMd9g2HvfjpAHv9IAoSQlz1BVo2Ll43qC5MEzM7s5C+CxXyrHac fWhg== X-Gm-Message-State: ANoB5pkHuYzeQYCLk4VpFBq6AnJYlzzYp55QC0IRHeUG6zNbsMdCttjT SZa28YB3Hsg/bj415WPlHiq1GsxdlqtBVGXnGcA= X-Google-Smtp-Source: AA0mqf4l5ZIb1DypDsz7KNR8dZaaUewM/sK+Fm+qgtwfO1kguxiV3Wjr29OXTeQABIvEcV3O9Z/fLmxT5x3ovbbbCEY= X-Received: by 2002:a2e:7818:0:b0:279:bf32:34dd with SMTP id t24-20020a2e7818000000b00279bf3234ddmr16992ljc.31.1669710654149; Tue, 29 Nov 2022 00:30:54 -0800 (PST) MIME-Version: 1.0 References: <4789825.31r3eYUQgx@thunderbird> In-Reply-To: <4789825.31r3eYUQgx@thunderbird> From: Richard Biener Date: Tue, 29 Nov 2022 09:30:42 +0100 Message-ID: Subject: Re: Division by zero on A53 which does not raise an exception To: Stephen Smith Cc: gcc@gcc.gnu.org, binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham 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 Tue, Nov 29, 2022 at 5:39 AM Stephen Smith via Gcc wrote: > > I am working on a project which is using an A53 core. The core does not > raise an exception if there is a division by zero (for either integer or > floating point division). > > The designers chose to set status bits for the floating point case but not > raise an exception. With the integer division no status bits are set. > > Does the GCC compilers or Binutils assembler and linker have a way to deal > with this issue on the ARM A53 processor? > > For Linux, was special support added in the kernel to help Glibc with this > issue? If so, I will comb the linux source tree. > > My project is using GCC 7.3.0 I'm second-guessing that you want to have an exception raised for integer division by zero? Since the C standard defines this as invoking undefined behavior and GCC generally takes advantage of this reliably getting an exception is difficult. There's -fsanitize=integer-divide-by-zero -fsanitize-undefined-trap-on-error which you could use. There are targets with options like -mcheck-zero-division but arm is not amongst those. Richard. > >