https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121279
--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #10)
> (In reply to Andrew Pinski from comment #8)
> > Created attachment 62127 [details]
> > untested patch
> >
> > Needs the testcase added, a full bootstrap and some extra comments.
> > BUT it looks like it is doing the correct thing.
>
> /home/apinski/src/upstream-gcc-git/gcc/libgomp/oacc-mem.c: In function
> ‘goacc_exit_datum_1’:
> /home/apinski/src/upstream-gcc-git/gcc/libgomp/oacc-mem.c:681:1: internal
> compiler error: in rewrite_to_defined_unconditional, at gimple-fold.cc:10582
> 681 | goacc_exit_datum_1 (struct gomp_device_descr *acc_dev, void *h,
> size_t s,
> | ^~~~~~~~~~~~~~~~~~
> 0x36b61c9 internal_error(char const*, ...)
I have a fix for this and the libstdc++ failures.
Note the libstdc++ failure is due to LIM code creating a raw temp decl and then
moving a statement for that and gimple_needing_rewrite_undefined thinks this
stmt needs to be rewritten.
That is:
```
/* If not emitting a load mark the uninitialized state on the
loop entry as not to be warned for. */
tree uninit = create_tmp_reg (TREE_TYPE (aux->tmp_var));
suppress_warning (uninit, OPT_Wuninitialized);
load = gimple_build_assign (aux->tmp_var, uninit);
```
This could/should be improved somehow but I have not looked into how just yet.
As for the ifcvt issue, I assumes that get_addr_base_and_unit_offset would
always be true which is not true. I needed to add code to support that case.
Note the code is basically from build_ref_for_offset but I can't exactly use
that as I need to put the statements in a sequence in some cases while in
others I need to do a replacement.