https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114285
Xi Ruoyao changed:
What|Removed |Added
CC||xry111 at gcc dot gnu.org
--- Comment #9 fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114285
--- Comment #8 from Antoni ---
Created attachment 57726
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57726&action=edit
Reproducer using union
I tried switching to a union and I still get the same error.
A union is used by std::optional
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114285
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #7
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114285
--- Comment #6 from Andrew Pinski ---
(In reply to Antoni from comment #4)
> A load in LLVM returns undef, so it is not UB. The problem is in
> rustc_codegen_gcc itself.
Right, GCC gimple semantics are different from LLVM semantics. GCC gimple
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114285
--- Comment #5 from Antoni ---
(In reply to Andrew Pinski from comment #3)
> >Rust will sometimes copy uninitialized memory and I'd like to avoid
> >disabling this specific warning.
>
>
> Note in C, there are specific rules about copying unit
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114285
--- Comment #4 from Antoni ---
(In reply to Andrew Pinski from comment #3)
> >Rust will sometimes copy uninitialized memory and I'd like to avoid
> >disabling this specific warning.
>
>
> Note in C, there are specific rules about copying unit
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114285
--- Comment #3 from Andrew Pinski ---
>Rust will sometimes copy uninitialized memory and I'd like to avoid disabling
>this specific warning.
Note in C, there are specific rules about copying unitialized memory. Most is
it is undefined. It is
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114285
--- Comment #2 from David Malcolm ---
(In reply to Antoni from comment #0)
> Created attachment 57655 [details]
> Reproducer for the bug
[...]
> I tried to reproduce in C and I attached the reproducer.
Trunk with -fanalyzer: https://godbolt.o
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114285
--- Comment #1 from Richard Biener ---
Given GCC considers memory to be initialized when you write to it and
copying from A to B involves a write to B the uninit info would be lost if
A is uninitialized. So IMO it's reasonable to diagnose a cop