[Bug fortran/93483] ICE in gfc_constructor_copy, at fortran/constructor.c:103

sgk at troutmask dot apl.washington.edu gcc-bugzilla@gcc.gnu.org
Thu Oct 13 21:39:26 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93483

--- Comment #16 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Thu, Oct 13, 2022 at 08:56:55PM +0000, anlauf at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93483
> 
> --- Comment #15 from anlauf at gcc dot gnu.org ---
> (In reply to anlauf from comment #14)
> > Is it conceivable that a somewhat weaker form of simplification, which
> > addresses the parentheses as well as the basic unary and binary operators
> > could still be used for the time being?
> > 
> > There is simplify_intrinsic_op; it just needs to be made non-static.
> > And seems to work here, also for Mikael's example.
> > 
> > So on top of the posted patch,
> 
> Argh, this doesn't work.  My fault.
> 

gfc_simplify_expr will call simplify_intrinsic_op.  Thisi, I think,
leads to arith.cc:gfc_uplus and arith.cc:gfc_parentheses.  These
simply copy the expression to a new expression without trying to reduce
the expression, and then returns.  For unary plus, instead of copying
the expression, gfortran could copy the operand.  For parentheses,
one would need to walk the expression to see if it can be reduced.


More information about the Gcc-bugs mailing list