From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by sourceware.org (Postfix) with ESMTPS id F14FA3858CD1 for ; Tue, 9 Apr 2024 07:04:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F14FA3858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F14FA3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::136 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712646254; cv=none; b=ba0YpjasbnWNNJAIav0j0eHilaOKldv/FsZtT7iimjs2WNq/HJ4dSL/EJUbt9DsmH2K2epCJBBlTENQKnX8Zjyc1rRA6YrBBoDS9YPr92q6dz1rq78qc4GRvGenqV8uESqm5Zhq0kxXLpmKDcmdKYA/TPWmPJYYaKJwM/WP4+7o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712646254; c=relaxed/simple; bh=qVpQBM6jsV2u/mEm8D6rEsQuJXUSddq3XNpEVb17wso=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=gAATOyICvTLfotb5Y56H/3sFs5ftrmhnViQMKkkpzc6cY9EfHpqiO5ThRu83lVkNQ2k2F2OaUAJgkf3s6Xo5xGFfFK3L8aBK65gKi2CWhxRhXNg33LKF1rNoOxqSg4Jk3I3kdHdtJnYcx+MgJo7Hl0QP9pB8+TuJlDJ/rvKdSO8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-516d6898bebso4068680e87.3 for ; Tue, 09 Apr 2024 00:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712646250; x=1713251050; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ICW3VL7O2DVaESFsvDWO6HheuAq345S3YzMylwv22FQ=; b=PiCSR81JfSu76XrajDnsVtxjddoik/pP62PHEAH1XMi37Pj5C0JSjDLUsTkdEQWyN/ Ubz0kYh289yxgNaEnY39ntZTQXAObm7LPT+1P/+o2HMwBhe13RB35dulXOyCNYg2DM13 h0drUfvvGhpuWOv92IWLO8cqdz0XGvnHLFDJ7zqtVDKdJIP7D6c/MkO5FaycPNu45Ger Hcra/8qDnInTOi9IzjzYYx7wYkEQtYMK+5wYfVjN7zMryJcGROqSRG+FInUkBjzj8hsx Oh6uGZPX1MN2Z8NOApVZuAfAGx65ZgVWWzgDJ8CupccjGZSa91SP0WHy2Bzg5xo59qF1 NGmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712646250; x=1713251050; h=content-transfer-encoding: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=ICW3VL7O2DVaESFsvDWO6HheuAq345S3YzMylwv22FQ=; b=vvj9s8LyLmUFkA8LLj2qbFYHlXxZChZg+fIdyCLKUqqT7QI+jhbGsn2nhMJcKAWfC/ 5ylhk+asLs2Y8uLBiWM11kO7wQ6AG29m0Dk7zwrEOjYgqccm5ubFrYECmi7IUDunU0ws K6N6zsb8Mw5Qy+RLk/HuFL+fW2Qdy5Zhejn6bjYMaX9m5i6/iGN85zzHQPsWsqPiKkRi kbKhZAXYKKj2PRzud/JI3CfKPuLI+mWL7vNz6++8z321trD+urVl0nChNNUO8ELA8uez mD4KH81J5lzdwsK/qK0adbW78zYp45iT9H+aBU5+MQ7aLb3yHD3SE9aRDwwxvGMVWSB0 mqLQ== X-Forwarded-Encrypted: i=1; AJvYcCXRniu+qZqHniNjPbJf3aYw0Rpnu/SVzT4VPbVHhSxRaWrB9o3+R3iRuJx+BoxX/cvski20YPSb2NeTaM+Gb1NUA2dXuu20MA== X-Gm-Message-State: AOJu0Yy/hfCj4gzy1kClyl60fdBtDWoX4hX4axVXMgLP9TlSVbCWM24Y zqyYP5sHkkmTGxUDaj2ZRRAILgp8Ep6rooIFC2X7cOjIw8EdSzi/5tIQR8wsUJZJpdtvUKp2etm Y6UBr+A5KUQO7b7eoja5axiisVgw= X-Google-Smtp-Source: AGHT+IEjtcX1zX309Tx40BSXZftUOM0Inr80dQ5lf8ESNnb/HMYWh1eNR/Iii6wJglTCMeFqmPB6xxpDKsnge+Ps4z4= X-Received: by 2002:a05:6512:3618:b0:516:c594:a074 with SMTP id f24-20020a056512361800b00516c594a074mr6722141lfs.55.1712646250128; Tue, 09 Apr 2024 00:04:10 -0700 (PDT) MIME-Version: 1.0 References: <56A9A5FB-8294-47CB-A6C4-22FD5561C71A@googlemail.com> In-Reply-To: From: Richard Biener Date: Tue, 9 Apr 2024 09:03:59 +0200 Message-ID: Subject: Re: [PATCH/RFC] On the use of -funreachable-traps to deal with PR 109627 To: Jeff Law Cc: Iain Sandoe , Jason Merrill , GCC Patches , Jakub Jelinek Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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, Apr 9, 2024 at 6:03=E2=80=AFAM Jeff Law wro= te: > > > > On 4/8/24 5:04 PM, Iain Sandoe wrote: > > Hi > > > > PR 109627 is about functions that have had their bodies completely elid= ed, but still have the wrappers for EH frames (either .cfi_xxx or LFSxx/LFE= xx). > > > > These are causing issues for some linkers because such functions result= in FDEs with a 0 code extent. > > > > The simplest representation of this is (from PR109527) > > > > void foo () { __builtin_unreachable (); } > With the possibility of sounding like a broken record, I think > __builtin_unreachable is fundamentally flawed. It generates no code > and just lets the program continue if ever "reached". This is a > security risk and (IMHO) just plain silly. We're in a situation that is > never supposed to happen, so continuing to execute code is just asking > for problems. > > If it were up to me, I'd have __builtin_unreachable emit a trap or > similar construct that should (in general) halt execution. __builtin_unreachable tells the compiler it's OK to omit a path to it while __builtin_trap doesn't. So once we replace the former with the latter we have to keep the path. Maybe that's OK. I do agree that the RTL representation of expanding __builtin_unreachable () to "nothing" is bad. Expanding to a trap always would be OK with me. Richard. > Jeff >