public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/95637] New: Read-only data assigned to `.sdata' rather than `.rodata'
@ 2020-06-11 11:15 macro@linux-mips.org
  2020-06-11 21:06 ` [Bug target/95637] " wilson at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: macro@linux-mips.org @ 2020-06-11 11:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95637

            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=',I4)
      END

      SUBROUTINE INC(I)
      I = 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=   5

I have no C language test case at hand, but I guess it does not matter,
this one is sweet and simple.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-01-14 21:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11 11:15 [Bug target/95637] New: Read-only data assigned to `.sdata' rather than `.rodata' macro@linux-mips.org
2020-06-11 21:06 ` [Bug target/95637] " wilson at gcc dot gnu.org
2020-06-12 21:37 ` macro@linux-mips.org
2020-06-15 23:21 ` wilson at gcc dot gnu.org
2020-06-23 22:58 ` macro@linux-mips.org
2020-06-28 10:40 ` ebotcazou at gcc dot gnu.org
2020-06-30  0:05 ` LpSolit at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).