public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: "haochen.jiang" <haochenj@ecsmtp.sh.intel.com>,
	gcc-regression@gcc.gnu.org, gcc-patches@gcc.gnu.org,
	haochen.jiang@intel.com
Subject: Re: [r14-5930 Regression] FAIL: gcc.c-torture/compile/libcall-2.c -Os (test for excess errors) on Linux/x86_64
Date: Wed, 29 Nov 2023 09:20:55 +0100	[thread overview]
Message-ID: <87ttp5c6mw.fsf@oracle.com> (raw)
In-Reply-To: <ZWbtjbDDiBHM0JFu@tucnak> (Jakub Jelinek's message of "Wed, 29 Nov 2023 08:51:41 +0100")


> On Wed, Nov 29, 2023 at 07:51:15AM +0100, Jose E. Marchesi wrote:
>> > FAIL: gcc.c-torture/compile/libcall-2.c   -O1  (test for excess errors)
>> > FAIL: gcc.c-torture/compile/libcall-2.c -O2 -flto
>> > -fno-use-linker-plugin -flto-partition=none (test for excess errors)
>> > FAIL: gcc.c-torture/compile/libcall-2.c -O2 -flto -fuse-linker-plugin
>> > -fno-fat-lto-objects (test for excess errors)
>> > FAIL: gcc.c-torture/compile/libcall-2.c   -O2  (test for excess errors)
>> > FAIL: gcc.c-torture/compile/libcall-2.c   -O3 -g  (test for excess errors)
>> > FAIL: gcc.c-torture/compile/libcall-2.c   -Os  (test for excess errors)
>> 
>> Sorry about the regression.
>> 
>> I installed the patch below to skip the test if the target is not x86_64
>> in lp64, as obvious.  This should fix the issue.
>> 
>> >From 4ed0740c6e807460ce79a351094329fdeb551545 Mon Sep 17 00:00:00 2001
>> From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
>> Date: Wed, 29 Nov 2023 07:44:59 +0100
>> Subject: [PATCH] testsuite: fix gcc.c-torture/compile/libcall-2.c in -m32
>> 
>> This test relies on having __int128 in x86_64 targets, which is only
>> available in -m64.
>> 
>> gcc/testsuite/ChangeLog
>> 
>> 	* gcc.c-torture/compile/libcall-2.c: Skip test in -m32.
>> ---
>>  gcc/testsuite/gcc.c-torture/compile/libcall-2.c | 2 ++
>>  1 file changed, 2 insertions(+)
>> 
>> diff --git a/gcc/testsuite/gcc.c-torture/compile/libcall-2.c b/gcc/testsuite/gcc.c-torture/compile/libcall-2.c
>> index b33944c83ff..9b889172025 100644
>> --- a/gcc/testsuite/gcc.c-torture/compile/libcall-2.c
>> +++ b/gcc/testsuite/gcc.c-torture/compile/libcall-2.c
>> @@ -2,6 +2,8 @@
>>     indirect calls.  */
>>  
>>  /* { dg-do compile } */
>> +/* __int128 is not supported in x86 -m32.  */
>> +/* { dg-skip-if "" { ! { x86_64-*-* && { ! ilp32 } } } } */
>>  /* { dg-options "-O2 -mcmodel=large" { target x86_64-*-* } } */
>>  /* { dg-final { scan-assembler "globl\t__divti3" } } */
>
> This is not correct.
> When a test uses __int128, it should be guarded with int128 effective
> target.
> But, as the test doesn't really test anything on non-x86 nor ia32,
> it doesn't belong to gcc.c-torture/compile/ at all, it is x86 specific
> test which should be moved to gcc.target/i386/libcall-1.c
> And, should have
> /* { dg-do compile { target int128 } } */
> /* { dg-options "-O2 -mcmodel=large" } */
> /* { dg-final { scan-assembler "globl\t__divti3" } } */
> I guess no need to bother with the extra guard for -mcmodel=large,
> because -m32/-mx32 don't have __int128 support, and x86_64-*-*
> is incorrect anyway (because with that target one can have all
> of -m32/-m64/-mx32).

OK to the patch below?

From a697f9e9442d96d3eda228b825dd8e8e06206c03 Mon Sep 17 00:00:00 2001
From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
Date: Wed, 29 Nov 2023 09:16:48 +0100
Subject: [PATCH] testsuite: move gcc.c-torture/compile/libcall-2.c to
 gcc.target/i386/libcall-1.c

This patch relocates a test that is really x86 specific, and changes
it to use check_effective_target_int128.

gcc/testsuite/ChangeLog

	* gcc.c-torture/compile/libcall-2.c: Remove.
	* gcc.target/i386/libcall-1.c: Moved from
	gcc.c-torture/compile/libcall-2.c and adapted to use
	effective-target for int128_t.
---
 .../compile/libcall-2.c => gcc.target/i386/libcall-1.c}     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
 rename gcc/testsuite/{gcc.c-torture/compile/libcall-2.c => gcc.target/i386/libcall-1.c} (50%)

diff --git a/gcc/testsuite/gcc.c-torture/compile/libcall-2.c b/gcc/testsuite/gcc.target/i386/libcall-1.c
similarity index 50%
rename from gcc/testsuite/gcc.c-torture/compile/libcall-2.c
rename to gcc/testsuite/gcc.target/i386/libcall-1.c
index 9b889172025..8bd6684a925 100644
--- a/gcc/testsuite/gcc.c-torture/compile/libcall-2.c
+++ b/gcc/testsuite/gcc.target/i386/libcall-1.c
@@ -1,10 +1,8 @@
 /* Make sure that external refences for libcalls are generated even for
    indirect calls.  */
 
-/* { dg-do compile } */
-/* __int128 is not supported in x86 -m32.  */
-/* { dg-skip-if "" { ! { x86_64-*-* && { ! ilp32 } } } } */
-/* { dg-options "-O2 -mcmodel=large" { target x86_64-*-* } } */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O2 -mcmodel=large" } */
 /* { dg-final { scan-assembler "globl\t__divti3" } } */
 
 __int128 a, b; void foo () { a = a / b; }
-- 
2.30.2


  reply	other threads:[~2023-11-29  8:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28 23:19 haochen.jiang
2023-11-29  6:51 ` Jose E. Marchesi
2023-11-29  7:51   ` Jakub Jelinek
2023-11-29  8:20     ` Jose E. Marchesi [this message]
2023-11-29  8:22       ` Jakub Jelinek
2023-11-29  8:32         ` Jose E. Marchesi
2023-12-01 13:55 FX Coudert
2023-12-01 14:38 ` Iain Sandoe
2023-12-02  9:04   ` FX Coudert
2023-12-04  8:40     ` Jose E. Marchesi
2023-12-11  8:23       ` FX Coudert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ttp5c6mw.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc-regression@gcc.gnu.org \
    --cc=haochen.jiang@intel.com \
    --cc=haochenj@ecsmtp.sh.intel.com \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).