public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/95353] New: [10/11 Regression] GCC can't build binutils
@ 2020-05-27  2:03 hjl.tools at gmail dot com
  2020-05-27  2:05 ` [Bug middle-end/95353] " hjl.tools at gmail dot com
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: hjl.tools at gmail dot com @ 2020-05-27  2:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95353
           Summary: [10/11 Regression] GCC can't build binutils
           Product: gcc
           Version: 10.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: msebor at gcc dot gnu.org
  Target Milestone: ---

Assembler in binutils has

struct frag {
  ...
  /* Data begins here.  */
  char fr_literal[1];
};

and fr_literal is accessed as

char *buf = fragp->fr_fix + fragp->fr_literal;

GCC 10 gave

gas/config/tc-csky.c: In function ‘md_convert_frag’:
gas/config/tc-csky.c:4507:9: error: writing 1 byte into a region of size 0
[-Wer
ror=stringop-overflow=]
 4507 |  buf[1] = BYTE_1 (CSKYV1_INST_SUBI | (7 << 4));
      |         ^

I checked in this:

char *buf = fragp->fr_fix + &fragp->fr_literal[0];

as a workaround.  But it doesn't solve the problem in existing binutils
sources and some future version of gcc might see through the obfuscation
of the source, rendering this work-around ineffective.  is there a solution
which is future proof?

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

end of thread, other threads:[~2021-01-21 22:51 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27  2:03 [Bug middle-end/95353] New: [10/11 Regression] GCC can't build binutils hjl.tools at gmail dot com
2020-05-27  2:05 ` [Bug middle-end/95353] " hjl.tools at gmail dot com
2020-05-27  2:21 ` pinskia at gcc dot gnu.org
2020-05-27  3:15 ` hjl.tools at gmail dot com
2020-05-27  4:58 ` hjl.tools at gmail dot com
2020-05-27  6:42 ` glisse at gcc dot gnu.org
2020-05-27  8:07 ` [Bug tree-optimization/95353] " rguenth at gcc dot gnu.org
2020-05-27 15:15 ` msebor at gcc dot gnu.org
2020-05-28  4:41 ` amodra at gmail dot com
2020-05-28 15:21 ` msebor at gcc dot gnu.org
2020-05-28 20:10 ` [Bug tree-optimization/95353] [10/11 Regression] spurious -Wstringop-overflow writing to a trailing array plus offset msebor at gcc dot gnu.org
2020-06-03  0:13 ` msebor at gcc dot gnu.org
2020-06-03 16:10 ` msebor at gcc dot gnu.org
2020-06-04 16:18 ` msebor at gcc dot gnu.org
2020-06-10 18:02 ` cvs-commit at gcc dot gnu.org
2020-06-10 18:03 ` [Bug tree-optimization/95353] [10 " msebor at gcc dot gnu.org
2020-06-13 17:32 ` cvs-commit at gcc dot gnu.org
2020-07-23  6:51 ` rguenth at gcc dot gnu.org
2020-08-03 14:41 ` msebor at gcc dot gnu.org
2021-01-06 16:37 ` msebor at gcc dot gnu.org
2021-01-21 22:51 ` msebor at gcc dot gnu.org

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).