[C++ PATCH] Fix ICE with inline asm and MODIFY_EXPR/preinc/predec in output operand (PR c++/84961, take 2)

2018-03-21 Thread Jakub Jelinek
On Wed, Mar 21, 2018 at 01:01:38PM -0400, Jason Merrill wrote: > >> Hmm, it would be nice to share this with the similar patterns in > >> unary_complex_lvalue and cp_build_modify_expr. > > > You mean just outline the > > if (TREE_SIDE_EFFECTS (TREE_OPERAND (lhs, 0))) > > lhs =

Re: [C++ PATCH] Fix ICE with inline asm and MODIFY_EXPR/preinc/predec in output operand (PR c++/84961, take 2)

2018-03-21 Thread Jason Merrill
OK. On Wed, Mar 21, 2018 at 1:47 PM, Jakub Jelinek wrote: > On Wed, Mar 21, 2018 at 01:01:38PM -0400, Jason Merrill wrote: >> >> Hmm, it would be nice to share this with the similar patterns in >> >> unary_complex_lvalue and cp_build_modify_expr. >> >> > You mean just outline

Re: [C++ PATCH] Fix ICE with inline asm and MODIFY_EXPR/preinc/predec in output operand (PR c++/84961)

2018-03-21 Thread Jason Merrill
On Wed, Mar 21, 2018 at 6:26 AM, Jakub Jelinek wrote: > On Tue, Mar 20, 2018 at 05:58:43PM -0400, Jason Merrill wrote: >> On Tue, Mar 20, 2018 at 5:04 PM, Jakub Jelinek wrote: >> > --- gcc/cp/semantics.c.jj 2018-03-20 11:58:17.069356145 +0100 >> > +++

Re: [C++ PATCH] Fix ICE with inline asm and MODIFY_EXPR/preinc/predec in output operand (PR c++/84961)

2018-03-21 Thread Jakub Jelinek
On Tue, Mar 20, 2018 at 05:58:43PM -0400, Jason Merrill wrote: > On Tue, Mar 20, 2018 at 5:04 PM, Jakub Jelinek wrote: > > --- gcc/cp/semantics.c.jj 2018-03-20 11:58:17.069356145 +0100 > > +++ gcc/cp/semantics.c 2018-03-20 21:56:43.745292245 +0100 > > @@ -1512,6 +1512,26

Re: [C++ PATCH] Fix ICE with inline asm and MODIFY_EXPR/preinc/predec in output operand (PR c++/84961)

2018-03-20 Thread Jason Merrill
On Tue, Mar 20, 2018 at 5:04 PM, Jakub Jelinek wrote: > Hi! > > While in C, x = 10 or ++x or --x aren't lvalues and so we reject such > expressions in inline asm output operands (and inputs that only allow > memory, not registers), in C++ they apparently are lvalues; for output

[C++ PATCH] Fix ICE with inline asm and MODIFY_EXPR/preinc/predec in output operand (PR c++/84961)

2018-03-20 Thread Jakub Jelinek
Hi! While in C, x = 10 or ++x or --x aren't lvalues and so we reject such expressions in inline asm output operands (and inputs that only allow memory, not registers), in C++ they apparently are lvalues; for output operands we ICE in the gimplifier on this, because in the generic code MODIFY_EXPR