This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ping, Ping: [Patch, fortran] PR27411 - crashes in sra_walk_expr and emit_move_insn


Roger,

This is not an objection, I'm just curious. Could you explain the
sequence of events whereby adding parenthesis around an expression
in the source code avoids an ICE in emit_move_insn? I don't know
enough fortran to understand "outputs%signal_number", or how this
would cause the scalarizer to generate mismatched types that can
survive thoughout tree-ssa, only to crash at RTL expansion time.


I am surprised that it survives through tree_ssa. Take a look at Andrew's comment in the PR; it is spot on. gfortran is not following the references far enough in translating the index array. In consequence, a structure is taken as the index array - look at the code in the PR, or better still, dump it yourself. After this, put some brackets around the index array , which has the effect of creating an integer temporary and this is visible in the code. Presumably, emit_move_insn is the bad thing that happens when you try to use a structure as an index array?

Not fully understanding the issues, I can't tell whether it would
be helpful to add additional sanity checking to the gimplifier, or
elsewhere in the middle-end, to help catch this earlier.


As I remarked when I submitted, this patch might not be considered to be sufficient and that one should fix this in the middle-end. One the otherhand, I have been contemplating an internal_parentheses operator that makes temporaries for the scalarizer, in order to make gfortran a bit more maintainable. This fix would fall naturally into such a framework.

I hope that this helps

Paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]