[Bug middle-end/100734] [12 Regression] /test/gnu/gcc/objdir/gcc/include-fixed/stdlib.h:291:8: internal compiler error: in from_mode_char, at attribs.h:304

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue May 25 19:13:53 GMT 2021


--- Comment #9 from Martin Sebor <msebor at gcc dot gnu.org> ---
(In reply to John David Anglin from comment #5)
> Breakpoint 1, attr_access::from_mode_char (
>     c=<error reading variable: Cannot access memory at address 0x0>)
>     at ../../gcc/gcc/attribs.h:304
> 304       gcc_unreachable ();

This error says that &c is null.  c comes from the code below:

#1  0x4000000000a8311c in init_attr_rdwr_indices (rwm=0x800003fffdff14e0,
    attrs=0x800003fffdf1b9b0) at ../../gcc/gcc/attribs.c:2146

      mode = TREE_VALUE (mode);
      if (TREE_CODE (mode) != STRING_CST)
      gcc_assert (TREE_CODE (mode) == STRING_CST);

      for (const char *m = TREE_STRING_POINTER (mode); *m; )

Either TREE_STRING_POINTER (mode) is null or mode is set to null after one of
the calls to strtoul() later in the function.

More information about the Gcc-bugs mailing list