diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2022-06-17 17:01:31 +0200 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2022-06-20 20:33:22 +0200 |
commit | ddc9b963ab9f267e8cc54be1fa6fcca2e8b0eb84 (patch) | |
tree | c29f786243fddf6794c82317fae78e6a153af0b9 /gcc | |
parent | 1c79be2d3daf01d8fb4680eea5f45c21635abde2 (diff) | |
download | gcc-ddc9b963ab9f267e8cc54be1fa6fcca2e8b0eb84.zip gcc-ddc9b963ab9f267e8cc54be1fa6fcca2e8b0eb84.tar.gz gcc-ddc9b963ab9f267e8cc54be1fa6fcca2e8b0eb84.tar.bz2 |
i386: Fix assert in ix86_function_arg [PR105970]
The mode of pointer argument should equal ptr_mode, not Pmode.
2022-06-17 Uroš Bizjak <ubizjak@gmail.com>
gcc/ChangeLog:
PR target/105970
* config/i386/i386.cc (ix86_function_arg): Assert that
the mode of pointer argumet is equal to ptr_mode, not Pmode.
gcc/testsuite/ChangeLog:
PR target/105970
* gcc.target/i386/pr105970.c: New test.
(cherry picked from commit 1f8278bfcfc7f7157bf2b405471e67dd5097636b)
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/i386/i386.cc | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr105970.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index 86752a6..83995a8 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 0000000..326486f --- /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" |