From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1363) id BA9B33858287; Mon, 20 Jun 2022 20:06:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA9B33858287 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Uros Bizjak To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-10082] i386: Fix assert in ix86_function_arg [PR105970] X-Act-Checkin: gcc X-Git-Author: Uros Bizjak X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: f6b3ea602441ee870b6dd40cf8fa80fba127d99c X-Git-Newrev: 84fe5ace4734cb0eeb342114e744455a7178b0e2 Message-Id: <20220620200644.BA9B33858287@sourceware.org> Date: Mon, 20 Jun 2022 20:06:44 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2022 20:06:44 -0000 https://gcc.gnu.org/g:84fe5ace4734cb0eeb342114e744455a7178b0e2 commit r11-10082-g84fe5ace4734cb0eeb342114e744455a7178b0e2 Author: Uros Bizjak Date: Fri Jun 17 17:01:31 2022 +0200 i386: Fix assert in ix86_function_arg [PR105970] The mode of pointer argument should equal ptr_mode, not Pmode. 2022-06-17 Uroš Bizjak gcc/ChangeLog: PR target/105970 * config/i386/i386.c (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) Diff: --- gcc/config/i386/i386.c | 2 +- gcc/testsuite/gcc.target/i386/pr105970.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a90f64e9d39..1623bbcbd2d 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3249,7 +3249,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 00000000000..326486faebf --- /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"