From patchwork Wed Apr 26 09:00:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2 via Gcc-patches" X-Patchwork-Id: 87743 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp99402vqo; Wed, 26 Apr 2023 02:01:07 -0700 (PDT) X-Google-Smtp-Source: AKy350aFL5KjyhsY5u1upuynjImP5izZiouF1i/EZiLmFXn+ikogWXDNQG5sBnM2aai/NfwGnKYl X-Received: by 2002:a17:906:c155:b0:94f:432f:242f with SMTP id dp21-20020a170906c15500b0094f432f242fmr20113124ejc.67.1682499667714; Wed, 26 Apr 2023 02:01:07 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id 17-20020a170906015100b0094f4f2ba2afsi12315605ejh.584.2023.04.26.02.01.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 02:01:07 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=POALzMDb; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8CBC23858C1F for ; Wed, 26 Apr 2023 09:01:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8CBC23858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682499666; bh=nWQGHeJkm28PEv+3noYMZMqJyKV1E78i+i2RsqVETsE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=POALzMDbEu0KDl6Vi6vDhCZFjBjTFKtlI/zd59NtxKbZ77hc9vWqOGCU4qGfiLBUH YCuslBlHf29PgTlRzIFZGrvltbVfqV0QaE1rmkqA7Y5S8K2VaiA95+P+eXkuuRvdUL fYkCBd63qb095lpK/VMadFKCdz0rT2hmeewWivj4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by sourceware.org (Postfix) with ESMTPS id 504C13858CDA for ; Wed, 26 Apr 2023 09:00:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 504C13858CDA X-IronPort-AV: E=Sophos;i="5.99,227,1677567600"; d="scan'208";a="210758024" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 26 Apr 2023 02:00:13 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 26 Apr 2023 02:00:10 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Wed, 26 Apr 2023 02:00:10 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vl/igTpi4w7L5ZY2v5jcmIje+FFpLwke8xphGKlyirqne+Q+VhKPtD62Zq7qD1JJZH7MkWe/eY388jzB8ZSd9koiK9JYiwpDfA1KcKib9qZ9jlweoBru3p5I5+thbnOuzU4v/DwVYd2p2pn8zOmxzBGxFQEaw4JZ5e1aqskukm3EfR3EYp0WZ1Xtg2JSQ9ud55Suoh/cWGcG4abwnYKqRd8cURJLJcx3z3R8Iu1uLpW9P4UJc+Nfle+3eZwKACW9sF8+Vup8a1xFSsTQIPAHbeBEV4kTUpXvryjlQzs/p47yPqs9KadFDS7q13b/nRo08IxTQhbDrb47DxnVSMvVXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nWQGHeJkm28PEv+3noYMZMqJyKV1E78i+i2RsqVETsE=; b=Lls6Uyd0uq9u932o7bLhVjFW/9sAorJJ8Se1iYHNj+TWVjq4TXVDcktW/MSS4msnVPkpbuNYffEgI3nvL+/DFahTC/TGH5mNY2hmK7qOdspiO2Iv5wSRAvDCWRl3P5gAEkSzoN6NxRwc33Rd/h1Cq5Pjw95LUL8m+bhSLSjkBnz5kaXJS4jDo6LvATkvwRSZuOmM3VuTnjX7k5H8EJR3bWBXfeL1OREJSGlqIpLsBAqxyystlhnD7Wj1fWidXqeZPAXVxVZxWa3R+eDK8KuUXGsyqSmFmGgkvCOTTb6nK1tvq6mCAGydHqmaVBnsDeDDczBtlWr92yoRTDjh00IfoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none Received: from CY4PR11MB1896.namprd11.prod.outlook.com (2603:10b6:903:11a::7) by SN7PR11MB6799.namprd11.prod.outlook.com (2603:10b6:806:261::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.21; Wed, 26 Apr 2023 09:00:09 +0000 Received: from CY4PR11MB1896.namprd11.prod.outlook.com ([fe80::9d0d:b920:314d:7775]) by CY4PR11MB1896.namprd11.prod.outlook.com ([fe80::9d0d:b920:314d:7775%11]) with mapi id 15.20.6319.034; Wed, 26 Apr 2023 09:00:09 +0000 To: Subject: [PATCH] avr: Set param_min_pagesize to 0 [PR105523] Thread-Topic: [PATCH] avr: Set param_min_pagesize to 0 [PR105523] Thread-Index: AQHZeB2AxGY8ZqesEES+5xHxMlF3oQ== Date: Wed, 26 Apr 2023 09:00:08 +0000 Message-ID: Accept-Language: en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/16.72.23042300 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CY4PR11MB1896:EE_|SN7PR11MB6799:EE_ x-ms-office365-filtering-correlation-id: 5b6e0098-24a1-4aa5-a203-08db4634a2f7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OJ7nfPRol0ZTy6Bn/Tk+x+oypvzdzsAerqsHl+rHIb+LG65xuxpgSbeRL8s9nI1C1J4KS0l84JyeDToSogFSuTaHnu45ehCcxv+1VnGLQkOJP8Cih7QYFPSSBZ3qC7JZP/pxzExdQdxRUK57KUd6B91G7+5o9GNMSX2bnr9vSf6diUGoen7j51ZEhG/xaBaF0ZDSzIJHbEGfZM/lhZ7gVYQ/f0rdR0rtWji39OF6M+TQq1OmGtW5YBXruFVBkwkvH1mQlCEZIUj8sbZ9+fEx805/SQPVZ+Nog2ixcEQIuoDDs3zRwVeYJ9YGDM0IPSvLxWpZsQyMOeBdKUhTtwTP29Hpy6BYmZKVKWRzSgwNomZd/Kc4m9rw7rJfgpTYDnfgLZz9iLv7Pt/HazbUezq8by0AgASy1ntbN/PryWNNlneU7XdRAkOC7mPtqWMj9IMeG+1QWuUlLpBoOdagl4xi4fDhjDN9UVyAFwNRHvhh7AzeLaijgLVT/BTQ3rSwmmHHsvPLQGA/tOunffdrKq5B5f/9OnIBghFs2tZv2ylAanEUR26tT5B8U9tUPeysmoT2nDz0IYkKvxn4r3Sj7eksnfAjlIotEFnXyqFz0VI1NvNdpHM7l6s5n8TRUd3BXMov+rKNrZR0oUl3AZGdEIuIZA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR11MB1896.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(346002)(376002)(39860400002)(366004)(136003)(396003)(451199021)(38100700002)(122000001)(38070700005)(5660300002)(2906002)(8936002)(8676002)(36756003)(33656002)(86362001)(84970400001)(6486002)(71200400001)(26005)(6506007)(6512007)(478600001)(2616005)(83380400001)(186003)(66946007)(76116006)(66556008)(6916009)(66446008)(64756008)(66476007)(91956017)(316002)(41300700001)(45980500001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?EpSSXplTmPLdskq3y1E9SPPrEDi3?= =?utf-8?q?7HyTSeOM86s4zYpSUDcBoh6O5k0kRUis8oqhXkwiumsFch4/zGvSvfCBl7qxhu9bV?= =?utf-8?q?xjeihfoUmNa+ucYV/jrKX5P2iddybV6MFI9R1vOWCZjsm3sJEf/PZCdYeS8EP4gdP?= =?utf-8?q?ONf3hqt7R5ABOCqs5SHcpWYLuBR0mwbbAjgB2cORsp1Vcrf1rWYo3BP8/OgYeUO+D?= =?utf-8?q?ClITfLDCgZC3/cqdHuuRa/bjPuOjAaOkWUs5GRqc1n7Py0jbtRzTg8qWwOTuOVU/e?= =?utf-8?q?lxHxGwnXS4u51PeJbIpkpBX/wM2HQgh5nY+oDA4/b28uA06PUQZ70K28vpvRjE2O5?= =?utf-8?q?jDpMKPdtcIUZPyow+3JPBG34wBmyR7e6rDkSN4JJ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3pjhb/L9IpscqzP+K1FFZqlodIMfyn17M2yis9N5k?= =?utf-8?q?z43KPCDIu+KKcTESN+rurO8rl63nxOwWOupQR/o1lIlujtD5jyVBA8zU0B9ambDi0?= =?utf-8?q?hW4EaTom8rjcHy5WBoomxRhPgLa3iYlhgzcvMbnRel6d7PhmFseRqVxu1quvcmDM+?= =?utf-8?q?M68EwcZdcjsdy7IALreahxcADlEGE7eshNS96mUOhenXS1s8xNbtbDdnaCnsnVv94?= =?utf-8?q?uVXPTSH2PN/tzwHvektdvpLO9qrn7sn8g2cCOB5d2Mr112BR1Th97Dh902iQ2yGBN?= =?utf-8?q?EjIx519d9Z0oPLxXhn9Den4RUEN8ZMXTkJBbQdcHXqCT0yp3fI6Jzcw=3D?= Content-ID: <186D375007FD934B946B96A47E5092E4@namprd11.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR11MB1896.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b6e0098-24a1-4aa5-a203-08db4634a2f7 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Apr 2023 09:00:08.9378 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TGkjuWXt/k4E1ZIGVxdTewItSBNioESo1BXTCuV67WaCAOm0GBM3+8fUkFoN8PwISQTMLfT9C6OQRrn38lAIUCvM+2j69WrWEuI83/mxfMf/7ylZSeQWOzyOdqDVoFsO X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB6799 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_DMARC_QUARANTINE, KAM_SHORT, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "SenthilKumar.Selvaraj--- via Gcc-patches" From: "Li, Pan2 via Gcc-patches" Reply-To: SenthilKumar.Selvaraj@microchip.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764228771683890117?= X-GMAIL-MSGID: =?utf-8?q?1764228771683890117?= Hi, This patch fixes PR 105523 by setting param_min_pagesize to 0 for the avr target. For this target, zero and offsets from zero are perfectly valid addresses, and the default value of param_min_pagesize ends up triggering warnings on valid memory accesses. Ok for trunk and backporting to 13 and 12 branches? Regards Senthil PR target/105523 gcc/ChangeLog: * config/avr/avr.cc (avr_option_override): Set param_min_pagesize to 0. gcc/testsuite/ChangeLog: * gcc.target/avr/pr105523.c: New test. diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc index c193430cf07..3b862f4e4ac 100644 --- a/gcc/config/avr/avr.cc +++ b/gcc/config/avr/avr.cc @@ -56,6 +56,7 @@ #include "tree-pass.h" #include "print-rtl.h" #include "rtl-iter.h" +#include "opts.h" /* This file should be included last. */ #include "target-def.h" @@ -769,6 +770,9 @@ avr_option_override (void) avr_gasisr_prologues = 0; #endif + SET_OPTION_IF_UNSET (&global_options, &global_options_set, + param_min_pagesize, 0); + if (!avr_set_core_architecture()) return; diff --git a/gcc/testsuite/gcc.target/avr/pr105523.c b/gcc/testsuite/gcc.target/avr/pr105523.c new file mode 100644 index 00000000000..fbbf7bf4422 --- /dev/null +++ b/gcc/testsuite/gcc.target/avr/pr105523.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-Os -Wall" } */ + +/* Verify no "array subscript 0 is outside array bounds of" is generated + for accessing memory addresses in the 0-4096 range. */ + +typedef __UINT8_TYPE__ uint8_t; + +#define SREG (*(volatile uint8_t*) (0x3F + __AVR_SFR_OFFSET__ )) + +void bar (void) +{ + SREG = 0; +}