[Bug c++/60336] empty struct value is passed differently in C and C++

2018-09-05 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #54 from Jonathan Wakely --- Oh, and for completeness, GCC 8.1.0 -fabi-version=11 also prints a garbage value of course: 1:2:3:4:5:4195842:6:7:8:9

[Bug c++/60336] empty struct value is passed differently in C and C++

2018-09-05 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 Jonathan Wakely changed: What|Removed |Added Target Milestone|--- |8.0 --- Comment #53 from Jonathan

[Bug c++/60336] empty struct value is passed differently in C and C++

2018-01-26 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #52 from H.J. Lu --- *** Bug 69846 has been marked as a duplicate of this bug. ***

[Bug c++/60336] empty struct value is passed differently in C and C++

2017-11-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 Marek Polacek changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug c++/60336] empty struct value is passed differently in C and C++

2017-11-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #50 from Marek Polacek --- Author: mpolacek Date: Wed Nov 22 16:06:18 2017 New Revision: 255066 URL: https://gcc.gnu.org/viewcvs?rev=255066=gcc=rev Log: PR c++/60336 PR middle-end/67239 PR target/68355

[Bug c++/60336] empty struct value is passed differently in C and C++

2017-10-24 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 Marek Polacek changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned

[Bug c++/60336] empty struct value is passed differently in C and C++

2017-10-23 Thread vanyacpp at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 Ivan Sorokin changed: What|Removed |Added CC||vanyacpp at gmail dot com --- Comment

[Bug c++/60336] empty struct value is passed differently in C and C++

2017-07-04 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 Andrew Pinski changed: What|Removed |Added Target Milestone|6.5 |---

[Bug c++/60336] empty struct value is passed differently in C and C++

2017-07-04 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 Richard Biener changed: What|Removed |Added Target Milestone|6.4 |6.5 --- Comment #48 from Richard

[Bug c++/60336] empty struct value is passed differently in C and C++

2016-12-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 Jakub Jelinek changed: What|Removed |Added Target Milestone|6.3 |6.4 --- Comment #47 from Jakub Jelinek

[Bug c++/60336] empty struct value is passed differently in C and C++

2016-08-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 Richard Biener changed: What|Removed |Added Target Milestone|6.2 |6.3

[Bug c++/60336] empty struct value is passed differently in C and C++

2016-04-27 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 Jakub Jelinek changed: What|Removed |Added Target Milestone|6.0 |6.2 --- Comment #46 from Jakub Jelinek

[Bug c++/60336] empty struct value is passed differently in C and C++

2016-01-27 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #45 from H.J. Lu --- I opened a clang bug: https://llvm.org/bugs/show_bug.cgi?id=26337 I propose the following definitions: i. An empty record is: 1. A class without member. Or 2. An array of empty records. Or 3. A

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-16 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 H.J. Lu changed: What|Removed |Added Attachment #36723|0 |1 is obsolete|

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-16 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #44 from H.J. Lu --- *** Bug 68355 has been marked as a duplicate of this bug. ***

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-16 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #42 from H.J. Lu --- (In reply to H.J. Lu from comment #29) > (In reply to Andrew Pinski from comment #27) > > Comment on attachment 36720 [details] > > A patch > > > > How does this interact with LTO where

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-16 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #39 from Andrew Pinski --- You should also update gimplify.c's zero_sized_type to be the same as your empty_record_p.

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-16 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #40 from H.J. Lu --- (In reply to H.J. Lu from comment #38) > Created attachment 36724 [details] > An updated patch to add empty_record_p > > I am testing it now. It doesn't work since it misses for (binfo = TYPE_BINFO (type),

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-16 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #41 from H.J. Lu --- (In reply to Andrew Pinski from comment #39) > You should also update gimplify.c's zero_sized_type to be the same as your > empty_record_p. It won't work since the size of empty class isn't zero in C++. We just

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #25 from H.J. Lu --- (In reply to Andrew Pinski from comment #23) > (In reply to H.J. Lu from comment #22) > > This is a target independent issue. Clang++ skips empty struct argument > > and g++ passes it. Skip empty struct argument

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #30 from Andrew Pinski --- (In reply to H.J. Lu from comment #29) > (In reply to Andrew Pinski from comment #27) > > Comment on attachment 36720 [details] > > A patch > > > > How does this interact with LTO where

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #31 from H.J. Lu --- (In reply to Andrew Pinski from comment #30) > > Isn't an empty record is one without any field decls? I thin it is language specific.

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #27 from Andrew Pinski --- Comment on attachment 36720 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36720 A patch How does this interact with LTO where lang_hooks.decls.empty_record_p is not defined?

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #34 from Andrew Pinski --- (In reply to H.J. Lu from comment #33) > (In reply to Andrew Pinski from comment #32) > > (In reply to H.J. Lu from comment #31) > > > (In reply to Andrew Pinski from comment #30) > > > > > > > > Isn't an

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #29 from H.J. Lu --- (In reply to Andrew Pinski from comment #27) > Comment on attachment 36720 [details] > A patch > > How does this interact with LTO where lang_hooks.decls.empty_record_p is not > defined? We can stream out empty

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 H.J. Lu changed: What|Removed |Added Attachment #36720|0 |1 is obsolete|

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #26 from H.J. Lu --- Created attachment 36720 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36720=edit A patch I am testing this patch.

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 H.J. Lu changed: What|Removed |Added Target Milestone|--- |6.0

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #33 from H.J. Lu --- (In reply to Andrew Pinski from comment #32) > (In reply to H.J. Lu from comment #31) > > (In reply to Andrew Pinski from comment #30) > > > > > > Isn't an empty record is one without any field decls? > > > > I

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #32 from Andrew Pinski --- (In reply to H.J. Lu from comment #31) > (In reply to Andrew Pinski from comment #30) > > > > Isn't an empty record is one without any field decls? > > I thin it is language specific. How so? An record

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 H.J. Lu changed: What|Removed |Added Attachment #36721|0 |1 is obsolete|

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #35 from H.J. Lu --- (In reply to Andrew Pinski from comment #34) > > So no FIELD_DECL as part of fields; only var or type or method_decl? struct dummy { }; struct true_type { struct dummy i; }; gave: (gdb) cal debug_tree (type)

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #37 from Andrew Pinski --- (In reply to H.J. Lu from comment #35) > (In reply to Andrew Pinski from comment #34) > > > > So no FIELD_DECL as part of fields; only var or type or method_decl? > > struct dummy { }; > struct true_type

[Bug c++/60336] empty struct value is passed differently in C and C++

2015-11-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #38 from H.J. Lu --- Created attachment 36724 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36724=edit An updated patch to add empty_record_p I am testing it now.

[Bug c++/60336] empty struct value is passed differently in C and C++

2014-08-12 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 H.J. Lu hjl.tools at gmail dot com changed: What|Removed |Added Component|target |c++

[Bug c++/60336] empty struct value is passed differently in C and C++

2014-08-12 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #23 from Andrew Pinski pinskia at gcc dot gnu.org --- (In reply to H.J. Lu from comment #22) This is a target independent issue. Clang++ skips empty struct argument and g++ passes it. Skip empty struct argument requires middle-end

[Bug c++/60336] empty struct value is passed differently in C and C++

2014-08-12 Thread vagran.ast at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336 --- Comment #24 from vagran vagran.ast at gmail dot com --- Just to be on a safe side, please, also do not forget that empty struct (or class) is really zero in the case when another structure (or class) is derived from it. For example, such test