------- Comment #5 from pault at gcc dot gnu dot org 2007-06-28 08:04 ------- (In reply to comment #4) > (In reply to comment #2) > > This is related to PR 14771, most likely the parentheses are being ignored. > The parentheses are being ignored - in fact they disappear completely; I > presume that gfc_simplify_expr is the culprit.
Not so - it is matchexp.c, where there is an incorrect interpretation of the standard, such that parentheses are not applied to non-numeric expressions. All expressions in parentheses are data entities. Applying this (modifying gfc_get_parentheses to resolve the expression before doing anything with it.) causes one or two regressions because character lengths need to be carried over (I think!). The second test in this PR now works. > In addition, a temporary needs to be made for intent(out), derived types with > a > default initializer and the initialization applied to that, when the variable > is aliassed. > I note that other compilers apply the initialization in the callee, whereas > gfortran leaves that duty to the caller. I think that the former is "cleaner" Applying gfc_get_parentheses for this case, in resolve_code at the point where module operator assignments are detected, fixes the 1st test in thi PR, as long as the initialization is shifted to the callee. This latter was effected by writing a helper function to write an lvalue expression from a symbol; this has at least one other existing client and does not apparently cause any regressions. > in some sense and that we should make the change. > Thus, this little beauty comprises at least two bugs and should probably be > three PRs:-) I propose that, for the sake of tractability, it should be left > as it is. > Paul I am down to 5 regressions for the overall patch, so I had better assign myself the PR! Paul -- pault at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |pault at gcc dot gnu dot org |dot org | Status|NEW |ASSIGNED Last reconfirmed|2007-03-17 07:26:16 |2007-06-28 08:04:33 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31205