From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 350473939C02; Thu, 11 Jun 2020 11:15:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 350473939C02 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591874111; bh=v7d/ILrg8GVvleqTIf+5e5ck9Splqeq5shthmQgwi6k=; h=From:To:Subject:Date:From; b=Or2V/lB5yx4gr/5KldfyZEOc+6NGJCuxAGRT2bB723JUDU+Un4eQSJ38Wd5D8zc4y nMi6HBEwHIp7LiXT39SknnQpeFjICYa8UKavn6SrYByKD9k3sGJfuOeaVuUZqG5bSL B8O+F0cC80Pgh/Od3UKMcp/qkarpfGM+NY0Ko+WE= From: "macro@linux-mips.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95637] New: Read-only data assigned to `.sdata' rather than `.rodata' Date: Thu, 11 Jun 2020 11:15:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: macro@linux-mips.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone cf_gcctarget Message-ID: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2020 11:15:11 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95637 Bug ID: 95637 Summary: Read-only data assigned to `.sdata' rather than `.rodata' Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: macro@linux-mips.org Target Milestone: --- Target: riscv*-*-linux-gnu As observed in PR fortran/95631 read-only data gets assigned to `.sdata' rather than `.rodata', which in turn causes invalid attempts to modify it not to be trapped at run time. A test case from the PR referred is: C C CHANGE THE VALUE OF 4 C CALL INC(4) WRITE (*, 30) 4 30 FORMAT ('2+2=3D',I4) END SUBROUTINE INC(I) I =3D I + 1 END which is supposed to trap on the modification of literal 4 in INC. Instead the program runs to completion and prints: 2+2=3D 5 I have no C language test case at hand, but I guess it does not matter, this one is sweet and simple.=