https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119474

--- Comment #8 from Andrew Stubbs <ams at gcc dot gnu.org> ---
This patch fixes the ICE and produces working code at -O2 and -O3:

diff --git a/gcc/omp-offload.cc b/gcc/omp-offload.cc
index da2b54b76485..1778a70bf755 100644
--- a/gcc/omp-offload.cc
+++ b/gcc/omp-offload.cc
@@ -1907,7 +1907,7 @@ oacc_rewrite_var_decl (tree *tp, int *walk_subtrees, void
*data)
       /* Adjust the type of the component ref itself.  */
       tree comp_type = TREE_TYPE (*tp);
       int comp_quals = TYPE_QUALS (comp_type);
-      if (TREE_CODE (*tp) == COMPONENT_REF && comp_quals != base_quals)
+      if (/*TREE_CODE (*tp) == COMPONENT_REF &&*/ comp_quals != base_quals)
        {
          comp_quals |= base_quals;
          TREE_TYPE (*tp)

However, we now get a new ICE at -O1 in emit-rtl.cc:663

  /* Allow truncation but not extension since we do not know if the
     number is signed or unsigned.  */                             
  gcc_assert (prec <= v.get_precision ());                         

I think this is probably caused by address space 4 using 32-bit pointers
(normal pointers are 64-bit), but I've not confirmed this yet.

Reply via email to