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

            Bug ID: 119474
           Summary: GCN 'libgomp.oacc-c++/pr96835-1.C' ICE 'during GIMPLE
                    pass: ivopts'
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: openacc
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: ams at gcc dot gnu.org, burnus at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, rguenth at gcc dot gnu.org,
                    tschwinge at gcc dot gnu.org
        Depends on: 96835
  Target Milestone: ---
            Target: GCN

+++ This bug was initially created as a clone of Bug #96835 +++

(In reply to myself from comment PR96835#10)
> The test cases I've just pushed: 'libgomp.c++/pr96835-1{,-O0}.C',
> 'libgomp.oacc-c++/pr96835-1.C' now behave as expected, with one exception. 
> Could you: Andrew, Richard please have a look why
> 'libgomp.oacc-c++/pr96835-1.C' for '-foffload=amdgcn-amdhsa', '-O2' is
> running into what looks like a(nother) GCN vectorizer vs. address spaces
> ICE?  (Your favourite ones, I know!)

(Or, maybe, the appearance of 'vector' here actually is due to its use in the
user code?  But OpenACC handling and its use of address spaces appears
relevant?)

>     [...]/libgomp.oacc-c++/../libgomp.c++/pr96835-1.C: In function 
> 'main._omp_fn.0':
>     [...]/libgomp.oacc-c++/../libgomp.c++/pr96835-1.C:36:11: error: 
> incompatible types in 'PHI' argument 1
>     vector(4) int *
>     
>     <address-space-4> struct vector *
>     
>     vectp_v1.3_3 = PHI <vectp_v1.3_47(5), &v1(2)>
>     during GIMPLE pass: vect
>     [...]/libgomp.oacc-c++/../libgomp.c++/pr96835-1.C:36:11: internal 
> compiler error: verify_gimple failed
>     0x215b066 internal_error(char const*, ...)
>             [...]/source-gcc/gcc/diagnostic-global-context.cc:517
>     0x111d22e verify_gimple_in_cfg(function*, bool, bool)
>             [...]/source-gcc/gcc/tree-cfg.cc:5683
>     0xfb40d0 execute_function_todo
>             [...]/source-gcc/gcc/passes.cc:2101
>     0xfb464b execute_todo
>             [...]/source-gcc/gcc/passes.cc:2155
>     [...]
>     gcn mkoffload: fatal error: 
> [...]/install/offload-amdgcn-amdhsa/bin//x86_64-pc-linux-gnu-accel-amdgcn-amdhsa-gcc
>  returned 1 exit status

I noticed that I'm able to reproduce this ICE also without the offloading
machinery, by directly invoking the GCN target compiler with '-O2 -fopenacc':

    $ build-gcc-offload-amdgcn-amdhsa/gcc/xg++
-Bbuild-gcc-offload-amdgcn-amdhsa/gcc/
source-gcc/libgomp/testsuite/libgomp.oacc-c++/pr96835-1.C -S -O2 -fopenacc
    In file included from
source-gcc/libgomp/testsuite/libgomp.oacc-c++/pr96835-1.C:5:
    source-gcc/libgomp/testsuite/libgomp.oacc-c++/../libgomp.c++/pr96835-1.C:
In function ‘main._omp_fn.0’:
   
source-gcc/libgomp/testsuite/libgomp.oacc-c++/../libgomp.c++/pr96835-1.C:36:11:
error: incompatible types in ‘PHI’ argument 1
       36 |   #pragma acc serial copyout(res)
          |           ^~~
    vector(64) int *

    <address-space-4> struct vector *

    vectp_v1.13_29 = PHI <vectp_v1.13_12(5), &v1(2)>
    during GIMPLE pass: vect
   
source-gcc/libgomp/testsuite/libgomp.oacc-c++/../libgomp.c++/pr96835-1.C:36:11:
internal compiler error: verify_gimple failed
    [...]

..., or also with '-O1 -fopenacc':

    $ build-gcc-offload-amdgcn-amdhsa/gcc/xg++
-Bbuild-gcc-offload-amdgcn-amdhsa/gcc/
source-gcc/libgomp/testsuite/libgomp.oacc-c++/pr96835-1.C -S -O1 -fopenacc
    In file included from
source-gcc/libgomp/testsuite/libgomp.oacc-c++/pr96835-1.C:5:
    source-gcc/libgomp/testsuite/libgomp.oacc-c++/../libgomp.c++/pr96835-1.C:
In function ‘main._omp_fn.0’:
   
source-gcc/libgomp/testsuite/libgomp.oacc-c++/../libgomp.c++/pr96835-1.C:36:11:
error: invalid types in nop conversion
       36 |   #pragma acc serial copyout(res)
          |           ^~~
    unsigned long
    <address-space-4> struct vector *
    ivtmp.20_40 = (unsigned long) &v1;
    during GIMPLE pass: ivopts
   
source-gcc/libgomp/testsuite/libgomp.oacc-c++/../libgomp.c++/pr96835-1.C:36:11:
internal compiler error: verify_gimple failed
    [...]


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96835
[Bug 96835] Constructor in offload template class

Reply via email to