[Bug c++/60517] warning/error for taking address of member of a temporary object

2017-07-24 Thread fredrik.hederstie...@securitas-direct.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 Fredrik Hederstierna changed: What|Removed |Added CC||fredrik.hederstierna@securi

[Bug c++/60517] warning/error for taking address of member of a temporary object

2017-07-24 Thread fredrik.hederstie...@securitas-direct.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #20 from Fredrik Hederstierna --- Simplest fix might be something like? - else + else if (access->grp_no_warning) so we do not always suppress warnings, but name will look funny for temp.

[Bug c++/60517] warning/error for taking address of member of a temporary object

2017-07-24 Thread fredrik.hederstie...@securitas-direct.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #21 from Fredrik Hederstierna --- Started with fix for PR 43347 to not warn on artificial aggregates https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43347

[Bug c++/60517] warning/error for taking address of member of a temporary object

2017-07-24 Thread lopezibanez at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #22 from Manuel López-Ibáñez --- I honestly think the uninitialized warning and fixing TREE_NOWARNING is a red-herring. My testcase should get a warning even if .x[0] is initialized. The problem is taking the address of a temporary. T

[Bug c++/60517] warning/error for taking address of member of a temporary object

2017-07-25 Thread fredrik.hederstie...@securitas-direct.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #23 from Fredrik Hederstierna --- Ah ok, yes I think you are right. The check could possibly be in "cp/typeck.c" and "cp/tree.c"? but I'm not familiar with this C++ parsing code. Interesting that this code gets warning: B* foo(A

[Bug c++/60517] warning/error for taking address of member of a temporary object

2017-07-25 Thread lopezibanez at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #24 from Manuel López-Ibáñez --- How does typeck.c check that it is a temporary? The important thing is not that it is an ARRAY_REF but that it is a member of a temporary object. Not sure how to check that. Marc points above that the

[Bug c++/60517] warning/error for taking address of member of a temporary object

2019-08-05 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 Martin Sebor changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Bug c++/60517] warning/error for taking address of member of a temporary object

2019-08-05 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #26 from Martin Sebor --- Author: msebor Date: Tue Aug 6 00:08:45 2019 New Revision: 274130 URL: https://gcc.gnu.org/viewcvs?rev=274130&root=gcc&view=rev Log: PR c++/60517 - warning/error for taking address of member of a temporary

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-11-22 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #18 from Marc Glisse --- The .uninit dump for the original testcase now looks like: double foo(A) (struct A a) { double SR.1; : return SR.1_2(D); } which the uninit pass would warn about, except that SR.1 is marked TREE_NO_W

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-03-13 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #1 from Marc Glisse --- I see in the dump: # .MEM_4 = VDEF <.MEM_8> D.2272 ={v} {CLOBBER}; # VUSE <.MEM_4> _5 = MEM[(doubleD.39 *)&D.2272]; which looks like something we could warn about in the middle-end.

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-03-13 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #2 from Manuel López-Ibáñez --- (In reply to Marc Glisse from comment #1) > I see in the dump: > > # .MEM_4 = VDEF <.MEM_8> > D.2272 ={v} {CLOBBER}; > # VUSE <.MEM_4> > _5 = MEM[(doubleD.39 *)&D.2272]; > > which looks like so

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-03-14 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #3 from Marc Glisse --- (In reply to Manuel López-Ibáñez from comment #2) > (In reply to Marc Glisse from comment #1) > > I see in the dump: > > > > # .MEM_4 = VDEF <.MEM_8> > > D.2272 ={v} {CLOBBER}; > > # VUSE <.MEM_4> > > _

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-03-14 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #4 from Manuel López-Ibáñez --- (In reply to Marc Glisse from comment #3) > (In reply to Manuel López-Ibáñez from comment #2) > > (In reply to Marc Glisse from comment #1) > > > I see in the dump: > > > > > > # .MEM_4 = VDEF <.MEM_8

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-03-14 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #5 from Marc Glisse --- (In reply to Manuel López-Ibáñez from comment #4) > Where is the clobber added? front-end, I expect (sorry, I'm trying to get something to work on windows and don't have my usual sources at hand). > The closer

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-03-14 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #6 from Marc Glisse --- (In reply to Marc Glisse from comment #5) > I would need a different (middle-end) warning that > detects return &local_var, To confirm this, I looked at the last dangling reference I debugged, recompiled it wit

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-03-14 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #7 from Manuel López-Ibáñez --- (In reply to Marc Glisse from comment #6) > (In reply to Marc Glisse from comment #5) > > I would need a different (middle-end) warning that > > detects return &local_var, > > To confirm this, I looked

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-03-14 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #8 from Marc Glisse --- (In reply to Manuel López-Ibáñez from comment #7) > To avoid duplicates, the front-end could just return something else, like > NULL, when it detects this case (I guess the behavior is undefined and we > can do

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-03-14 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 Marc Glisse changed: What|Removed |Added CC||glisse at gcc dot gnu.org --- Comment #9 fr

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-04-05 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #10 from Marc Glisse --- Created attachment 32549 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32549&action=edit first try With -O -fdisable-tree-esra (see PR 60770), it warns on the testcase. Twice because the DSE pass is run

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-04-06 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 Marc Glisse changed: What|Removed |Added Attachment #32549|0 |1 is obsolete|

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-04-06 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #12 from Manuel López-Ibáñez --- (In reply to Marc Glisse from comment #11) > Created attachment 32551 [details] > first try > > With clobber removal now. Why do you want to remove the clobber? I understood your idea to avoid dupli

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-04-06 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #13 from Marc Glisse --- (In reply to Manuel López-Ibáñez from comment #12) > Why do you want to remove the clobber? I am in the DSE pass, so removing the clobber as a dead store is the easiest thing to do ;-) Ok, it might not be su

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-06-26 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 Paolo Carlini changed: What|Removed |Added CC||lisp2d at lisp2d dot net --- Comment #14

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-07-31 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #15 from Marc Glisse --- Author: glisse Date: Thu Jul 31 09:33:58 2014 New Revision: 213323 URL: https://gcc.gnu.org/viewcvs?rev=213323&root=gcc&view=rev Log: 2014-07-31 Marc Glisse PR c++/60517 gcc/c/ * c-typeck.c (c_fin

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-08-22 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 Manuel López-Ibáñez changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug c++/60517] warning/error for taking address of member of a temporary object

2014-08-22 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60517 --- Comment #17 from Marc Glisse --- (In reply to Manuel López-Ibáñez from comment #16) > Note that we still do not warn for my original testcase. I didn't close the PR ;-) There are patches around that may need more work, see these discussions