This fixes a tree-sharing ICE. It seems as if all unshare_expr I added were required in this case. The first long testcase is based on the real testcase from the OpenACC testsuite, the second one is what reduction produced - but I thought some nested reduction might be interesting as well; hence, I included both tests. Bootstrapped and regtested on x86-64-gnu-linux w/o offloading. OK for mainline and GCC 12? (It gives an ICE with GCC 10 but not with GCC 9; thus, more regression-fix backporting would be possible, if someone cares.) Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955