https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70348
--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> --- The problem is that there is a PARM_DECL in the IL of the function which is not listed among DECL_ARGUMENTS of the function: The function we are in is: (gdb) call debug_generic_expr(cfun->decl) foo._omp_fn.0 but look at the context of the PARM_DECL in question: (gdb) call debug_tree (op) <parm_decl 0x7ffff6a5cc80 sum type <integer_type 0x7ffff6891888 unsigned int sizes-gimplified public unsigned SI size <integer_cst 0x7ffff688dee8 constant 32> unit size <integer_cst 0x7ffff688df00 constant 4> align 32 symtab 0 alias set -1 canonical type 0x7ffff6891888 precision 32 min <integer_cst 0x7ffff688df18 0> max <integer_cst 0x7ffff688ded0 4294967295> context <translation_unit_decl 0x7ffff6a671e0 D.2915> pointer_to_this <pointer_type 0x7ffff68b2498>> addressable used unsigned SI file pr70348.c line 7 col 26 size <integer_cst 0x7ffff688dee8 32> unit size <integer_cst 0x7ffff688df00 4> align 32 context <function_decl 0x7ffff6a627e0 foo> arg-type <integer_type 0x7ffff6891888 unsigned int>> Also, if you check the uid of the PARM_DECL: (gdb) p op->decl_minimal.uid $3 = 2907 you will see that it corresponds to a parameter the original function foo, from which OpenACC outlined bits to foo._omp_fn.0: foo (intD.6 nD.2906, unsigned intD.9 sumD.2907) And just by the way, because of the context mismatch, the testcase ICEs in expand_expr_real_1 when compiled at -O0: pr70348.c: In function ‘foo._omp_fn.0’: pr70348.c:11:9: internal compiler error: in expand_expr_real_1, at expr.c:9651 #pragma acc parallel reduction(+:sum) ^~~ 0xa61521 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /home/mjambor/gcc/icln/src/gcc/expr.c:9645 0xa5a4c3 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /home/mjambor/gcc/icln/src/gcc/expr.c:7962 0xa5178b store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool, tree_node*) /home/mjambor/gcc/icln/src/gcc/expr.c:5406 0xa5039c expand_assignment(tree_node*, tree_node*, bool) /home/mjambor/gcc/icln/src/gcc/expr.c:5175 0x90e4bc expand_gimple_stmt_1 /home/mjambor/gcc/icln/src/gcc/cfgexpand.c:3618 0x90e8ad expand_gimple_stmt /home/mjambor/gcc/icln/src/gcc/cfgexpand.c:3714 0x9159be expand_gimple_basic_block /home/mjambor/gcc/icln/src/gcc/cfgexpand.c:5720 0x917487 execute /home/mjambor/gcc/icln/src/gcc/cfgexpand.c:6335 All in all, this is an OpenACC lowering/expansion bug.