Skip to content

Commit 1f8278b

Browse files
committed
i386: Fix assert in ix86_function_arg [PR105970]
The mode of pointer argument should equal ptr_mode, not Pmode. 2022-06-17 Uroš Bizjak <[email protected]> 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.
1 parent 1d6044c commit 1f8278b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

gcc/config/i386/i386.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3348,7 +3348,7 @@ ix86_function_arg (cumulative_args_t cum_v, const function_arg_info &arg)
33483348
if (POINTER_TYPE_P (arg.type))
33493349
{
33503350
/* This is the pointer argument. */
3351-
gcc_assert (TYPE_MODE (arg.type) == Pmode);
3351+
gcc_assert (TYPE_MODE (arg.type) == ptr_mode);
33523352
/* It is at -WORD(AP) in the current frame in interrupt and
33533353
exception handlers. */
33543354
reg = plus_constant (Pmode, arg_pointer_rtx, -UNITS_PER_WORD);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* PR target/105970 */
2+
/* { dg-do compile { target { ! ia32 } } } */
3+
/* { dg-require-effective-target maybe_x32 } */
4+
/* { dg-options "-mx32 -mgeneral-regs-only -maddress-mode=long" } */
5+
6+
#include "../../gcc.dg/torture/pr68037-1.c"

0 commit comments

Comments
 (0)