[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2020-03-20 Thread ch3root at openwall dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 --- Comment #18 from Alexander Cherepanov --- Adding a `memset` makes trunk fail too: -- #include #include struct s { char c; int i; };

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-12-17 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 --- Comment #17 from Martin Jambor --- If we really decide to fix this in SRA, i can be done (after the previous patches in the series are in) with something like https://gcc.gnu.org/ml/gcc-patches/2019-12/msg01185.html

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-12-03 Thread ch3root at openwall dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 --- Comment #16 from Alexander Cherepanov --- BTW this bug combines nicely with pr71460. Possible effects: - padding in a long double inside a struct is lost on x86-64; - sNaN is converted to qNaN in a double inside a struct on x86-32. Both are

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-15 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 --- Comment #15 from Martin Jambor --- (In reply to rguent...@suse.de from comment #14) > On Fri, 15 Nov 2019, jamborm at gcc dot gnu.org wrote: > > [...] But yes, for your example we'd copy-prop out c and b which > might then have created

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-15 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 --- Comment #14 from rguenther at suse dot de --- On Fri, 15 Nov 2019, jamborm at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 > > --- Comment #13 from Martin Jambor --- > (In reply to rguent...@suse.de from

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-15 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 --- Comment #13 from Martin Jambor --- (In reply to rguent...@suse.de from comment #10) > [...] But total scalarization works with the premise > that we don't see any direct accesses to source or destination That is not true, total

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-14 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 --- Comment #12 from rguenther at suse dot de --- On Thu, 14 Nov 2019, ch3root at openwall dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 > > --- Comment #9 from Alexander Cherepanov --- > > Now as an exercise build a

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-14 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 --- Comment #11 from rguenther at suse dot de --- On Thu, 14 Nov 2019, msebor at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 > > Martin Sebor changed: > >What|Removed |Added

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-14 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 --- Comment #10 from rguenther at suse dot de --- On Thu, 14 Nov 2019, pinskia at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 > > --- Comment #7 from Andrew Pinski --- > I have another idea, cant we add fake

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-14 Thread ch3root at openwall dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 --- Comment #9 from Alexander Cherepanov --- > Now as an exercise build a complete testcase for the DSE issue above. Source code: -- #include #include struct s { char

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment #8

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-14 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 --- Comment #7 from Andrew Pinski --- I have another idea, cant we add fake field decls while doing structure layout? Then sra total scalarization will just work. And there is no other magic in the compiler needed?

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-14 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 --- Comment #6 from rguenther at suse dot de --- On November 14, 2019 5:11:55 PM GMT+01:00, "jamborm at gcc dot gnu.org" wrote: >https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 > >--- Comment #5 from Martin Jambor --- >While I don't share

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-14 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 --- Comment #5 from Martin Jambor --- While I don't share this preference about assignments, SRA only ignores padding when doing "total scalarization" aka the poor man's aggregate copy propagation because in that mode it would have to invent

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 Richard Biener changed: What|Removed |Added CC||jamborm at gcc dot gnu.org --- Comment

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 --- Comment #3 from Richard Biener --- Note when changing struct s to say struct s { char c; int i __attribute__((aligned(128))); }; you can (if you disable SRA!) observe that RTL expansion copies padding for aggregate assignments: g:

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 Richard Biener changed: What|Removed |Added Keywords||wrong-code CC|

[Bug tree-optimization/92486] Wrong optimization: padding in structs is not copied even with memcpy

2019-11-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92486 Martin Liška changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|