diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index 3d189e124e460..f158cc3aaea51 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -3348,7 +3348,7 @@ ix86_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) if (POINTER_TYPE_P (arg.type)) { /* This is the pointer argument. */ - gcc_assert (TYPE_MODE (arg.type) == Pmode); + gcc_assert (TYPE_MODE (arg.type) == ptr_mode); /* It is at -WORD(AP) in the current frame in interrupt and exception handlers. */ reg = plus_constant (Pmode, arg_pointer_rtx, -UNITS_PER_WORD); diff --git a/gcc/testsuite/gcc.target/i386/pr105970.c b/gcc/testsuite/gcc.target/i386/pr105970.c new file mode 100644 index 0000000000000..326486faebfc9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr105970.c @@ -0,0 +1,6 @@ +/* PR target/105970 */ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-require-effective-target maybe_x32 } */ +/* { dg-options "-mx32 -mgeneral-regs-only -maddress-mode=long" } */ + +#include "../../gcc.dg/torture/pr68037-1.c"