public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/105232] New: ICE in tree_to_poly_int64, at tree.cc:3224
@ 2022-04-11 20:28 k.even-mendoza at imperial dot ac.uk
  2022-04-11 20:43 ` [Bug tree-optimization/105232] [11/12 Regression] ICE in tree_to_poly_int64 via check_builtin pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: k.even-mendoza at imperial dot ac.uk @ 2022-04-11 20:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105232
           Summary: ICE in tree_to_poly_int64, at tree.cc:3224
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: k.even-mendoza at imperial dot ac.uk
  Target Milestone: ---

The following code crashed gcc-12 with all flags, and gcc-11 with -O1, -O2, -O3
and -Os but works fine with -O0. gcc-10 and below works fine.

===
c;
#define d(expr, e)                                                            
\
  char *f = expr;                                                             
\
  strlen(f) ?: ++c;
struct {
  char a[0], b[1537228674000000000]
} cma[] = {{}, {}, {}, {}, {}, {}};
g() { d(cma[4].a, ) }
===

crashed with:
/home/user42/data/gcc-csmith-1201/gcc-install/bin/gcc -O2 fuzzer-file-3200.c
...
fuzzer-file-3200-1.c:8:7: note: in expansion of macro ‘d’
    8 | g() { d(cma[4].a, ) }
      |       ^
during GIMPLE pass: waccess
fuzzer-file-3200-1.c:8:1: internal compiler error: in tree_to_poly_int64, at
tree.cc:3224
    8 | g() { d(cma[4].a, ) }
      | ^
0x7e75cb tree_to_poly_int64(tree_node const*)
        .././../gcc-source/gcc/tree.cc:3224
0x7e75cb tree_to_poly_int64(tree_node const*)
        .././../gcc-source/gcc/tree.cc:3222
...
0xc0ffb8 check_builtin
        .././../gcc-source/gcc/gimple-ssa-warn-access.cc:3181
0xc0ffb8 check_call
        .././../gcc-source/gcc/gimple-ssa-warn-access.cc:4280
0xc0ffb8 check_block
        .././../gcc-source/gcc/gimple-ssa-warn-access.cc:4393
0xc0ffb8 execute
        .././../gcc-source/gcc/gimple-ssa-warn-access.cc:4742

===========================
With -O0 it ends without crashing and prints the right error:
gcc-11 -O0 fuzzer-file-3200.c
...
fuzzer-file-3200.c:8:7: note: in expansion of macro ‘d’
    8 | g() { d(cma[4].a, ) }
      |       ^
fuzzer-file-3200.c: At top level:
fuzzer-file-3200.c:7:3: error: size of variable ‘cma’ is too large
    7 | } cma[] = {{}, {}, {}, {}, {}, {}};

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

end of thread, other threads:[~2022-04-12 10:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11 20:28 [Bug c/105232] New: ICE in tree_to_poly_int64, at tree.cc:3224 k.even-mendoza at imperial dot ac.uk
2022-04-11 20:43 ` [Bug tree-optimization/105232] [11/12 Regression] ICE in tree_to_poly_int64 via check_builtin pinskia at gcc dot gnu.org
2022-04-12  7:51 ` marxin at gcc dot gnu.org
2022-04-12  7:54 ` rguenth at gcc dot gnu.org
2022-04-12  7:54 ` rguenth at gcc dot gnu.org
2022-04-12  8:54 ` cvs-commit at gcc dot gnu.org
2022-04-12  8:54 ` [Bug tree-optimization/105232] [11 " rguenth at gcc dot gnu.org
2022-04-12 10:49 ` cvs-commit at gcc dot gnu.org
2022-04-12 10:50 ` rguenth 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).