https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111537
--- Comment #9 from Iain Buclaw ---
(In reply to Iain Buclaw from comment #8)
> I see in the olden days when D sat outside of GCC, this is what was done too.
>
> https://github.com/D-Programming-GDC/gdc/commit/
>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111537
--- Comment #8 from Iain Buclaw ---
Looking at C++ FE, I see they construct the string literal using
build_string (4, "foo")
because I can see the terminating 0 in the pretty-printed string.
---
unit-size
align:8
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111537
--- Comment #7 from Iain Buclaw ---
(In reply to David Malcolm from comment #5)
> Is D correctly building that string_cst? Are D strings 0-terminated?
Yes, D strings are 0-terminated.
The way I've done it is, the string is constructed using
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111537
--- Comment #6 from David Malcolm ---
Oops; the above got truncated; the string_cst prints as follows in gdb
(gdb) pt string_cst
unit-size
align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111537
--- Comment #5 from David Malcolm ---
It's complaining about the read from the string literal.
If I change the string in the reproducer from "hello world" to "foo", I see:
(gdb) pt string_cst
unit-size
align:8
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111537
--- Comment #4 from David Malcolm ---
(In reply to David Malcolm from comment #3)
> Thanks; that reproducer works for me.
...or rather, demonstrates the ICE in a way that I can see in the debugger.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111537
David Malcolm changed:
What|Removed |Added
Last reconfirmed||2023-10-11
Ever confirmed|0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111537
--- Comment #2 from Iain Buclaw ---
(In reply to David Malcolm from comment #1)
> Am trying to reproduce locally, but when I run this in my BUILDDIR/gcc:
> ./gdc -B. -S -fanalyzer oob.d
> I get:
> d21: error: cannot find source code for
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111537
--- Comment #1 from David Malcolm ---
Am trying to reproduce locally, but when I run this in my BUILDDIR/gcc:
./gdc -B. -S -fanalyzer oob.d
I get:
d21: error: cannot find source code for runtime library file 'object.d'
Possibly a silly