public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/107453] New: New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail
@ 2022-10-28 21:39 seurer at gcc dot gnu.org
  2022-10-28 21:42 ` [Bug target/107453] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: seurer at gcc dot gnu.org @ 2022-10-28 21:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107453

            Bug ID: 107453
           Summary: New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

g:4fe34cdcc80ac225b80670eabc38ac5e31ce8a5a, r13-3549-g4fe34cdcc80ac2

FAIL: gcc.dg/c2x-stdarg-4.c execution test
FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O0  execution test
FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O1  execution test
FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O2  execution test
FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  execution test
FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O3 -g  execution test
FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -Os  execution test


One traceback

(gdb) run
Starting program: /home/seurer/gcc/git/build/gcc-test/c2x-stdarg-4.exe 

Program received signal SIGABRT, Aborted.
0x00002000002192a8 in raise () from /lib64/glibc-hwcaps/power9/libc-2.28.so
(gdb) where
#0  0x00002000002192a8 in raise () from /lib64/glibc-hwcaps/power9/libc-2.28.so
#1  0x00002000001f3eb4 in abort () from /lib64/glibc-hwcaps/power9/libc-2.28.so
#2  0x0000000010000fa0 in main () at
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/c2x-stdarg-4.c:153


The abort is from here:

  if (f (1, 2.0, 3, 4.0) != 10.0)
    abort ();



Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Oct 28 14:40:25 2022 +0000

    c: tree: target: C2x (...) function prototypes and va_start relaxation

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/107453] New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail
  2022-10-28 21:39 [Bug other/107453] New: New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail seurer at gcc dot gnu.org
@ 2022-10-28 21:42 ` pinskia at gcc dot gnu.org
  2022-10-31 17:08 ` ebotcazou at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-28 21:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107453

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
From https://gcc.gnu.org/pipermail/gcc-patches/2022-October/604152.html:
It's possible further
target-specific fixes will be needed; target maintainers should watch
out for failures of c2x-stdarg-4.c, the execution test, which would
indicate that this feature is not working correctly.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/107453] New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail
  2022-10-28 21:39 [Bug other/107453] New: New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail seurer at gcc dot gnu.org
  2022-10-28 21:42 ` [Bug target/107453] " pinskia at gcc dot gnu.org
@ 2022-10-31 17:08 ` ebotcazou at gcc dot gnu.org
  2022-11-05  9:34 ` tschwinge at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2022-10-31 17:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107453

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-10-31
              Build|powerpc64-linux-gnu,        |
                   |powerpc64le-linux-gnu       |
               Host|powerpc64-linux-gnu,        |
                   |powerpc64le-linux-gnu       |
                 CC|                            |ebotcazou at gcc dot gnu.org
             Target|powerpc64-linux-gnu,        |
                   |powerpc64le-linux-gnu       |
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Likewise on SPARC64.  It's a TARGET_STRICT_ARGUMENT_NAMING target, so we have
in expand_call:

  /* Count the arguments and set NUM_ACTUALS.  */
  num_actuals =
    call_expr_nargs (exp) + num_complex_actuals + structure_value_addr_parm;

  /* Compute number of named args.
     First, do a raw count of the args for INIT_CUMULATIVE_ARGS.  */

  if (type_arg_types != 0)
    n_named_args
      = (list_length (type_arg_types)
         /* Count the struct value address, if it is passed as a parm.  */
         + structure_value_addr_parm);
  else
    /* If we know nothing, treat all args as named.  */
    n_named_args = num_actuals;

which yields n_named_args = num_actuals since type_arg_types == 0 and then:

  if (type_arg_types != 0
      && targetm.calls.strict_argument_naming (args_so_far))
    ;

so n_named_args = num_actuals in the end and the game is over.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/107453] New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail
  2022-10-28 21:39 [Bug other/107453] New: New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail seurer at gcc dot gnu.org
  2022-10-28 21:42 ` [Bug target/107453] " pinskia at gcc dot gnu.org
  2022-10-31 17:08 ` ebotcazou at gcc dot gnu.org
@ 2022-11-05  9:34 ` tschwinge at gcc dot gnu.org
  2022-11-05 10:23 ` [Bug target/107453] [13 Regression] " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2022-11-05  9:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107453

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2022-10-31 00:00:00         |2022-11-5
                 CC|                            |tschwinge at gcc dot gnu.org,
                   |                            |vries at gcc dot gnu.org

--- Comment #3 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
Similarly -- I guess had to be expeced -- commit
r13-3549-g4fe34cdcc80ac225b80670eabc38ac5e31ce8a5a "c: tree: target: C2x (...)
function prototypes and va_start relaxation" needs some follow-on work for
nvptx target.  A number of the test cases PASS, but the following ones don't:


    +FAIL: gcc.dg/c2x-stdarg-4.c (test for excess errors)
    +UNRESOLVED: gcc.dg/c2x-stdarg-4.c compilation failed to produce executable

    ptxas /tmp/cc2o4IWl.o, line 912; error   : Call has wrong number of
parameters
    ptxas /tmp/cc2o4IWl.o, line 912; error   : Type of argument does not match
formal parameter '%in_ar0'
    ptxas /tmp/cc2o4IWl.o, line 912; error   : Alignment of argument does not
match formal parameter '%in_ar0'
    ptxas /tmp/cc2o4IWl.o, line 960; error   : Call has wrong number of
parameters
    ptxas /tmp/cc2o4IWl.o, line 960; error   : Type of argument does not match
formal parameter '%in_ar0'
    ptxas /tmp/cc2o4IWl.o, line 996; error   : Call has wrong number of
parameters
    ptxas /tmp/cc2o4IWl.o, line 996; error   : Type of argument does not match
formal parameter '%in_ar0'
    ptxas fatal   : Ptx assembly aborted due to errors
    nvptx-as: ptxas returned 255 exit status


    +PASS: gcc.dg/torture/c2x-stdarg-split-1a.c   -O0  (test for excess errors)
    +FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O0  execution test
    +PASS: gcc.dg/torture/c2x-stdarg-split-1a.c   -O1  (test for excess errors)
    +FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O1  execution test
    +PASS: gcc.dg/torture/c2x-stdarg-split-1a.c   -O2  (test for excess errors)
    +FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O2  execution test
    +PASS: gcc.dg/torture/c2x-stdarg-split-1a.c   -O3 -g  (test for excess
errors)
    +FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O3 -g  execution test
    +PASS: gcc.dg/torture/c2x-stdarg-split-1a.c   -Os  (test for excess errors)
    +FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -Os  execution test

    error   : Prototype doesn't match for 'f' in 'input file 2 at offset
14552', first defined in 'input file 2 at offset 14552'
    error   : Prototype doesn't match for 'g' in 'input file 2 at offset
14552', first defined in 'input file 2 at offset 14552'
    nvptx-run: cuLinkAddData failed: unknown error (CUDA_ERROR_UNKNOWN, 999)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/107453] [13 Regression] New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail
  2022-10-28 21:39 [Bug other/107453] New: New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail seurer at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-11-05  9:34 ` tschwinge at gcc dot gnu.org
@ 2022-11-05 10:23 ` rguenth at gcc dot gnu.org
  2022-11-07  8:51 ` chenglulu at loongson dot cn
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-11-05 10:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107453

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
           Keywords|                            |testsuite-fail
            Summary|New stdarg tests in         |[13 Regression] New stdarg
                   |r13-3549-g4fe34cdcc80ac2    |tests in
                   |fail                        |r13-3549-g4fe34cdcc80ac2
                   |                            |fail
   Target Milestone|---                         |13.0

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/107453] [13 Regression] New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail
  2022-10-28 21:39 [Bug other/107453] New: New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail seurer at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-11-05 10:23 ` [Bug target/107453] [13 Regression] " rguenth at gcc dot gnu.org
@ 2022-11-07  8:51 ` chenglulu at loongson dot cn
  2023-01-06 14:00 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: chenglulu at loongson dot cn @ 2022-11-07  8:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107453

chenglulu <chenglulu at loongson dot cn> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chenglulu at loongson dot cn

--- Comment #4 from chenglulu <chenglulu at loongson dot cn> ---

On LoongArch:
Since type_arg_types is null, the value of n_named_args is set to num_actuals.

      function_arg_info arg (type, argpos < n_named_args);
      if (pass_by_reference (args_so_far_pnt, arg))

then arg.named is true. Cause test failure.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/107453] [13 Regression] New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail
  2022-10-28 21:39 [Bug other/107453] New: New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail seurer at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-11-07  8:51 ` chenglulu at loongson dot cn
@ 2023-01-06 14:00 ` jakub at gcc dot gnu.org
  2023-01-09 12:37 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-06 14:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107453

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 54203
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54203&action=edit
gcc13-pr107453.patch

I wonder if we shouldn't apply following patch.  At least c2x-stdarg-4.c with
it passes on powerpc64le-linux and I don't see any regressions on
dg.exp=*stdarg* on x86_64-linux -m32/-m64.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/107453] [13 Regression] New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail
  2022-10-28 21:39 [Bug other/107453] New: New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail seurer at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-01-06 14:00 ` jakub at gcc dot gnu.org
@ 2023-01-09 12:37 ` cvs-commit at gcc dot gnu.org
  2023-01-09 12:44 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-09 12:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107453

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:b1879fb84e78fa2c530e66de43f3dc125820864a

commit r13-5067-gb1879fb84e78fa2c530e66de43f3dc125820864a
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Jan 9 13:36:22 2023 +0100

    calls: Fix up TYPE_NO_NAMED_ARGS_STDARG_P handling [PR107453]

    On powerpc64le-linux, the following patch fixes
    -FAIL: gcc.dg/c2x-stdarg-4.c execution test
    -FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O0  execution test
    -FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O1  execution test
    -FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O2  execution test
    -FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O2 -flto
-fno-use-linker-plugin -flto-partition=none  execution test
    -FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  execution test
    -FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -O3 -g  execution test
    -FAIL: gcc.dg/torture/c2x-stdarg-split-1a.c   -Os  execution test
    The problem is mismatch between the caller and callee side.
    On the callee side, we do:
      /* NAMED_ARG is a misnomer.  We really mean 'non-variadic'. */
      if (!cfun->stdarg)
        data->arg.named = 1;  /* No variadic parms.  */
      else if (DECL_CHAIN (parm))
        data->arg.named = 1;  /* Not the last non-variadic parm. */
      else if (targetm.calls.strict_argument_naming (all->args_so_far))
        data->arg.named = 1;  /* Only variadic ones are unnamed.  */
      else
        data->arg.named = 0;  /* Treat as variadic.  */
    which is later passed to the target hooks to determine if a particular
    argument is named or not.  Now, cfun->stdarg is determined from the
stdarg_p
    call, which for the new C2X TYPE_NO_NAMED_ARGS_STDARG_P function types
    (rettype fn (...)) returns true.  Such functions have no named arguments,
    so data->arg.named will be 0 in function.cc.  But on the caller side,
    as TYPE_NO_NAMED_ARGS_STDARG_P function types have TYPE_ARG_TYPES NULL,
    we instead treat those calls as unprototyped even when they are prototyped
    - /* If we know nothing, treat all args as named.  */ n_named_args =
num_actuals;
    in 2 spots.  We need to treat the TYPE_NO_NAMED_ARGS_STDARG_P cases as
    prototyped with no named arguments.

    2023-01-09  Jakub Jelinek  <jakub@redhat.com>

            PR target/107453
            * calls.cc (expand_call): For calls with
            TYPE_NO_NAMED_ARGS_STDARG_P (funtype) use zero for n_named_args.
            Formatting fix.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/107453] [13 Regression] New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail
  2022-10-28 21:39 [Bug other/107453] New: New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail seurer at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-01-09 12:37 ` cvs-commit at gcc dot gnu.org
@ 2023-01-09 12:44 ` jakub at gcc dot gnu.org
  2023-01-09 20:07 ` tschwinge at gcc dot gnu.org
  2023-03-15 12:39 ` xry111 at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-09 12:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107453

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on powerpc64le-linux.  I've also on a cross to sparc64-linux tested that
without the patch both c2x-stdarg-4.c and c2x-stdarg-split-1{a,b}.c at -O0
abort and with the patch succeed.
No testing on nvptx nor loongarch, so if it is still broken there, please
reopen.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/107453] [13 Regression] New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail
  2022-10-28 21:39 [Bug other/107453] New: New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail seurer at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-01-09 12:44 ` jakub at gcc dot gnu.org
@ 2023-01-09 20:07 ` tschwinge at gcc dot gnu.org
  2023-03-15 12:39 ` xry111 at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2023-01-09 20:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107453

--- Comment #8 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #7)
> No testing on nvptx

Thanks, confirming fixed for nvptx target, too.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/107453] [13 Regression] New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail
  2022-10-28 21:39 [Bug other/107453] New: New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail seurer at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-01-09 20:07 ` tschwinge at gcc dot gnu.org
@ 2023-03-15 12:39 ` xry111 at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-03-15 12:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107453

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xry111 at gcc dot gnu.org

--- Comment #9 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Confirm fixed for LoongArch.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-03-15 12:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-28 21:39 [Bug other/107453] New: New stdarg tests in r13-3549-g4fe34cdcc80ac2 fail seurer at gcc dot gnu.org
2022-10-28 21:42 ` [Bug target/107453] " pinskia at gcc dot gnu.org
2022-10-31 17:08 ` ebotcazou at gcc dot gnu.org
2022-11-05  9:34 ` tschwinge at gcc dot gnu.org
2022-11-05 10:23 ` [Bug target/107453] [13 Regression] " rguenth at gcc dot gnu.org
2022-11-07  8:51 ` chenglulu at loongson dot cn
2023-01-06 14:00 ` jakub at gcc dot gnu.org
2023-01-09 12:37 ` cvs-commit at gcc dot gnu.org
2023-01-09 12:44 ` jakub at gcc dot gnu.org
2023-01-09 20:07 ` tschwinge at gcc dot gnu.org
2023-03-15 12:39 ` xry111 at gcc dot gnu.org

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).