From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1360F3851889; Wed, 23 Nov 2022 18:04:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1360F3851889 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669226686; bh=o2qyFyfVuV11dAHYlWeRf6chOPkXMJU1SGcwe7HVhMM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aTUflZV0D7Jq3k/8yN35GEP1+UVvo2xtuYoUWNJj+EUUvZN/peQ6qNTD7qa8q3ewW dPNNzHRjP1vDmwBDuxsZxFv5GiXn/WdjCO+WsJeS8pH7CBu60+dVKXofilgvLha7pm BeqZ38GuUa8Lg/WRrkv1EjjhKxDJjbD1jPk6k0jQ= From: "lh_mouse at 126 dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105523] Wrong warning array subscript [0] is outside array bounds Date: Wed, 23 Nov 2022 18:04:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: lh_mouse at 126 dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105523 --- Comment #10 from LIU Hao --- (In reply to Andrew Pinski from comment #8) > That inline-asm is not correct and GCC does not understand segments if you > don't use named address space feature. >=20 Named address space is not supported unless a GNU standard is selected. https://gcc.godbolt.org/z/nbEMz6xMq ``` int read_gs_30(void) { return *(int* __seg_gs) 0x30; } ``` With `-std=3Dc99`: ``` : In function 'read_gs_30': :4:18: error: expected ')' before '__seg_gs' 4 | return *(int* __seg_gs) 0x30; | ~ ^~~~~~~~~ | ) Compiler returned: 1 ```=