This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71372] [6/7 Regression] C++ FE drops TREE_THIS_VOLATILE in cp_fold on all tcc_reference trees
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 02 Jun 2016 07:52:23 +0000
- Subject: [Bug c++/71372] [6/7 Regression] C++ FE drops TREE_THIS_VOLATILE in cp_fold on all tcc_reference trees
- Auto-submitted: auto-generated
- References: <bug-71372-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71372
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to rguenther@suse.de from comment #8)
> On Thu, 2 Jun 2016, rguenther at suse dot de wrote:
> Actually it's not a bug of those but of the callers (given fold_binary
> doesn't get to see that flag).
Exactly.
>
> > > see just
> > > switch (TREE_CODE_LENGTH (code))
> > > {
> > > case 1:
> > > op0 = TREE_OPERAND (t, 0);
> > > tem = fold_unary_loc (loc, code, type, op0);
> > > return tem ? tem : expr;
> > > case 2:
> > > op0 = TREE_OPERAND (t, 0);
> > > op1 = TREE_OPERAND (t, 1);
> > > tem = fold_binary_loc (loc, code, type, op0, op1);
> > > return tem ? tem : expr;
> > > case 3:
> > > op0 = TREE_OPERAND (t, 0);
> > > op1 = TREE_OPERAND (t, 1);
> > > op2 = TREE_OPERAND (t, 2);
> > > tem = fold_ternary_loc (loc, code, type, op0, op1, op2);
> > > return tem ? tem : expr;
> > > without really trying to preserve anything.
>
> This would need to do the fixup in case of tcc_reference codes.
> Fortunately fold () calls are rare.
Well, both C and C++ FEs now call them pretty much on everything. So certainly
not rare.