public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/101534] New: ICE in create_tailcall_accumulator, at tree-tailcall.c:1083
@ 2021-07-20 16:55 gscfq@t-online.de
  2021-07-20 17:47 ` [Bug tree-optimization/101534] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gscfq@t-online.de @ 2021-07-20 16:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101534
           Summary: ICE in create_tailcall_accumulator, at
                    tree-tailcall.c:1083
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Affects versions down to at least r5, at -O2+ :


$ cat z1.c
typedef int V __attribute__ ((vector_size (2 * sizeof (int))));
V
foo (void)
{
  V v = { };
  return v - foo();
}


$ gcc-12-20210718 -c z1.c -O1
$
$ gcc-12-20210718 -c z1.c -O2
during GIMPLE pass: tailr
z1.c: In function 'foo':
z1.c:7:1: internal compiler error: in fold_convert_loc, at fold-const.c:2542
    7 | }
      | ^
0xa3ce55 fold_convert_loc(unsigned int, tree_node*, tree_node*)
        ../../gcc/fold-const.c:2542
0x106c4fd create_tailcall_accumulator
        ../../gcc/tree-tailcall.c:1083
0x106ef5e tree_optimize_tail_calls_1
        ../../gcc/tree-tailcall.c:1166

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

* [Bug tree-optimization/101534] ICE in create_tailcall_accumulator, at tree-tailcall.c:1083
  2021-07-20 16:55 [Bug c/101534] New: ICE in create_tailcall_accumulator, at tree-tailcall.c:1083 gscfq@t-online.de
@ 2021-07-20 17:47 ` pinskia at gcc dot gnu.org
  2021-07-20 18:08 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-20 17:47 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
          Component|c                           |tree-optimization
   Last reconfirmed|                            |2021-07-20
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
(gdb) p debug_tree(ret_type)
 <vector_type 0xfffff5c70348 V
    type <integer_type 0xfffff59b05e8 int public SI
        size <integer_cst 0xfffff58e0fc0 constant 32>
        unit-size <integer_cst 0xfffff58e0fd8 constant 4>
        align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0xfffff59b05e8 precision:32 min <integer_cst 0xfffff58e0f78 -2147483648> max
<integer_cst 0xfffff58e0f90 2147483647>
        pointer_to_this <pointer_type 0xfffff59b1a40>>
    sizes-gimplified V2SI
    size <integer_cst 0xfffff58e0d80 type <integer_type 0xfffff59b00a8
bitsizetype> constant 64>
    unit-size <integer_cst 0xfffff58e0d98 type <integer_type 0xfffff59b0000
sizetype> constant 8>
    align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0xfffff59db670 nunits:2 context <translation_unit_decl 0xfffff5c608e8 t1.c>>
$1 = void
(gdb) p debug_tree(init)
 <integer_cst 0xfffff58e1128 type <integer_type 0xfffff59b05e8 int> constant 1>


create_tailcall_accumulator needs to create a splat/dup if the init type is
scalar and the ret_type is a vector.

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

* [Bug tree-optimization/101534] ICE in create_tailcall_accumulator, at tree-tailcall.c:1083
  2021-07-20 16:55 [Bug c/101534] New: ICE in create_tailcall_accumulator, at tree-tailcall.c:1083 gscfq@t-online.de
  2021-07-20 17:47 ` [Bug tree-optimization/101534] " pinskia at gcc dot gnu.org
@ 2021-07-20 18:08 ` pinskia at gcc dot gnu.org
  2021-07-20 18:23 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-20 18:08 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Mine.

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

* [Bug tree-optimization/101534] ICE in create_tailcall_accumulator, at tree-tailcall.c:1083
  2021-07-20 16:55 [Bug c/101534] New: ICE in create_tailcall_accumulator, at tree-tailcall.c:1083 gscfq@t-online.de
  2021-07-20 17:47 ` [Bug tree-optimization/101534] " pinskia at gcc dot gnu.org
  2021-07-20 18:08 ` pinskia at gcc dot gnu.org
@ 2021-07-20 18:23 ` pinskia at gcc dot gnu.org
  2021-07-20 18:36 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-20 18:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The fix which I am testing:
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -1080,6 +1080,9 @@ create_tailcall_accumulator (const char *label,
basic_block bb, tree init)

   phi = create_phi_node (tmp, bb);
   /* RET_TYPE can be a float when -ffast-maths is enabled.  */
+  /* For vectors create a dup. */
+  if (VECTOR_TYPE_P (ret_type))
+    init = build_vector_from_val (ret_type, fold_convert (TREE_TYPE
(ret_type), init));
   add_phi_arg (phi, fold_convert (ret_type, init), single_pred_edge (bb),
               UNKNOWN_LOCATION);
   return PHI_RESULT (phi);

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

* [Bug tree-optimization/101534] ICE in create_tailcall_accumulator, at tree-tailcall.c:1083
  2021-07-20 16:55 [Bug c/101534] New: ICE in create_tailcall_accumulator, at tree-tailcall.c:1083 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-07-20 18:23 ` pinskia at gcc dot gnu.org
@ 2021-07-20 18:36 ` pinskia at gcc dot gnu.org
  2021-07-20 22:03 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-20 18:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 51183
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51183&action=edit
Patch which is under testing

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

* [Bug tree-optimization/101534] ICE in create_tailcall_accumulator, at tree-tailcall.c:1083
  2021-07-20 16:55 [Bug c/101534] New: ICE in create_tailcall_accumulator, at tree-tailcall.c:1083 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-07-20 18:36 ` pinskia at gcc dot gnu.org
@ 2021-07-20 22:03 ` pinskia at gcc dot gnu.org
  2021-07-21 19:28 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-20 22:03 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                URL|                            |https://gcc.gnu.org/piperma
                   |                            |il/gcc-patches/2021-July/57
                   |                            |5692.html

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Patch submitted:
https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575692.html

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

* [Bug tree-optimization/101534] ICE in create_tailcall_accumulator, at tree-tailcall.c:1083
  2021-07-20 16:55 [Bug c/101534] New: ICE in create_tailcall_accumulator, at tree-tailcall.c:1083 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-07-20 22:03 ` pinskia at gcc dot gnu.org
@ 2021-07-21 19:28 ` pinskia at gcc dot gnu.org
  2021-07-22 16:17 ` pinskia at gcc dot gnu.org
  2021-08-13 22:55 ` [Bug tree-optimization/101534] [12 Regression] " pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-21 19:28 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|https://gcc.gnu.org/piperma |https://gcc.gnu.org/piperma
                   |il/gcc-patches/2021-July/57 |il/gcc-patches/2021-July/57
                   |5692.html                   |5771.html

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Updated patch:
https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575771.html

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

* [Bug tree-optimization/101534] ICE in create_tailcall_accumulator, at tree-tailcall.c:1083
  2021-07-20 16:55 [Bug c/101534] New: ICE in create_tailcall_accumulator, at tree-tailcall.c:1083 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2021-07-21 19:28 ` pinskia at gcc dot gnu.org
@ 2021-07-22 16:17 ` pinskia at gcc dot gnu.org
  2021-08-13 22:55 ` [Bug tree-optimization/101534] [12 Regression] " pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-22 16:17 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I put the wrong PR # in the commit log, I forgot the 4 at the end :(.
r12-2473

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

* [Bug tree-optimization/101534] [12 Regression] ICE in create_tailcall_accumulator, at tree-tailcall.c:1083
  2021-07-20 16:55 [Bug c/101534] New: ICE in create_tailcall_accumulator, at tree-tailcall.c:1083 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2021-07-22 16:17 ` pinskia at gcc dot gnu.org
@ 2021-08-13 22:55 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-13 22:55 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
            Summary|ICE in                      |[12 Regression] ICE in
                   |create_tailcall_accumulator |create_tailcall_accumulator
                   |, at tree-tailcall.c:1083   |, at tree-tailcall.c:1083

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

end of thread, other threads:[~2021-08-13 22:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20 16:55 [Bug c/101534] New: ICE in create_tailcall_accumulator, at tree-tailcall.c:1083 gscfq@t-online.de
2021-07-20 17:47 ` [Bug tree-optimization/101534] " pinskia at gcc dot gnu.org
2021-07-20 18:08 ` pinskia at gcc dot gnu.org
2021-07-20 18:23 ` pinskia at gcc dot gnu.org
2021-07-20 18:36 ` pinskia at gcc dot gnu.org
2021-07-20 22:03 ` pinskia at gcc dot gnu.org
2021-07-21 19:28 ` pinskia at gcc dot gnu.org
2021-07-22 16:17 ` pinskia at gcc dot gnu.org
2021-08-13 22:55 ` [Bug tree-optimization/101534] [12 Regression] " pinskia 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).