Michael Matz wrote:
after much pondering about the issue we came up with this design to
handle restrict more generally.

Cool! Thanks for the last-minute patch.

If I understand the patch correctly, it does handle the problem of inlining restrict pointers correctly – which was previously a missed-optimization. (Both for Fortran but also for C/C++ with __restrict__, e.g. PR58526)


However, I do not quite see whether it also handles Fortran's derived types correctly; namely the problem where a derived type has, e.g., an allocatable component (= restrict pointer) but where the type is then used for a variable with target attribute, which turns also the type's components into nonrestrict pointers. That's the infamous PR45586.

My possibly wrong impression is that it doesn't yet fix that issue, but that it paves the way to doing so. Am I correct?


--- internal-fn.def     (revision 205123)
+++ internal-fn.def     (working copy)

+DEF_INTERNAL_FN (DEL_RESTRICT,  /*ECF_LEAF |*/ ECF_NOTHROW)

PR 58723, I'd guess ;-)
(ICE due to internal_fn ending up into the cgraph.)

Tobias

Reply via email to