public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/107994] New: [12/13 Regression] ICE in fold_convert_loc, at fold-const.cc:2606
@ 2022-12-06 18:04 gscfq@t-online.de
  2022-12-06 18:08 ` [Bug c/107994] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gscfq@t-online.de @ 2022-12-06 18:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107994
           Summary: [12/13 Regression] ICE in fold_convert_loc, at
                    fold-const.cc:2606
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Changed between 20210822 and 20210905 :


$ cat z1.c
typedef V __attribute__ ((__vector_size__ (32)));
int g;
void foo (V v)
{
  g == v;
  int v;
}


$ cat z2.c
typedef V __attribute__ ((__vector_size__ (32)));
int g;
V foo (V v)
{
  g == v;
  int v;
}


$ gcc-13-20221204 -c z1.c
z1.c:1:9: warning: type defaults to 'int' in declaration of 'V'
[-Wimplicit-int]
    1 | typedef V __attribute__ ((__vector_size__ (32)));
      |         ^
z1.c: In function 'foo':
z1.c:6:7: error: 'v' redeclared as different kind of symbol
    6 |   int v;
      |       ^
z1.c:3:13: note: previous definition of 'v' with type 'V' {aka '__vector(8)
int'}
    3 | void foo (V v)
      |           ~~^
z1.c:5:5: internal compiler error: in fold_convert_loc, at fold-const.cc:2606
    5 |   g == v;
      |   ~~^~~~
0xafb891 fold_convert_loc(unsigned int, tree_node*, tree_node*)
        ../../gcc/fold-const.cc:2606
0xb9ebd7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.cc:17113
0xb9dca2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.cc:17153
0xba1ff8 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.cc:7219
0xb9d41b gimplify_statement_list
        ../../gcc/gimplify.cc:2019
0xb9d41b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.cc:16805
0xba1ff8 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.cc:7219
0xba2912 gimplify_bind_expr
        ../../gcc/gimplify.cc:1430
0xb9d92a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.cc:16561
0xba1ff8 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.cc:7219
0xba399e gimplify_body(tree_node*, bool)
        ../../gcc/gimplify.cc:17620
0xba3f95 gimplify_function_tree(tree_node*)
        ../../gcc/gimplify.cc:17819
0x9bdab7 cgraph_node::analyze()
        ../../gcc/cgraphunit.cc:676
0x9c0de6 analyze_functions
        ../../gcc/cgraphunit.cc:1240
0x9c1f5d symbol_table::finalize_compilation_unit()
        ../../gcc/cgraphunit.cc:2514

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

* [Bug c/107994] [12/13 Regression] ICE in fold_convert_loc, at fold-const.cc:2606
  2022-12-06 18:04 [Bug c/107994] New: [12/13 Regression] ICE in fold_convert_loc, at fold-const.cc:2606 gscfq@t-online.de
@ 2022-12-06 18:08 ` pinskia at gcc dot gnu.org
  2022-12-06 19:09 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-06 18:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-12-06
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org
           Keywords|                            |error-recovery
   Target Milestone|---                         |12.3
             Status|UNCONFIRMED                 |ASSIGNED

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

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

* [Bug c/107994] [12/13 Regression] ICE in fold_convert_loc, at fold-const.cc:2606
  2022-12-06 18:04 [Bug c/107994] New: [12/13 Regression] ICE in fold_convert_loc, at fold-const.cc:2606 gscfq@t-online.de
  2022-12-06 18:08 ` [Bug c/107994] " pinskia at gcc dot gnu.org
@ 2022-12-06 19:09 ` pinskia at gcc dot gnu.org
  2022-12-21 12:13 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-06 19:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This should fix the issue (have not tested it yet):
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index 02415cb1b5c..ae13f9fd9e6 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -17098,6 +17098,9 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p,
gimple_seq *post_p,
                 memcmp for them would be very inefficient at best, and is
                 plain wrong if bitfields are involved.  */
                {
+                 if (error_operand_p (TREE_OPERAND (*expr_p, 1))
+                   return GS_ERROR;
+
                  tree type = TREE_TYPE (TREE_OPERAND (*expr_p, 1));

                  /* Vector comparisons need no boolification.  */

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

* [Bug c/107994] [12/13 Regression] ICE in fold_convert_loc, at fold-const.cc:2606
  2022-12-06 18:04 [Bug c/107994] New: [12/13 Regression] ICE in fold_convert_loc, at fold-const.cc:2606 gscfq@t-online.de
  2022-12-06 18:08 ` [Bug c/107994] " pinskia at gcc dot gnu.org
  2022-12-06 19:09 ` pinskia at gcc dot gnu.org
@ 2022-12-21 12:13 ` cvs-commit at gcc dot gnu.org
  2023-01-24 14:27 ` [Bug c/107994] [12 " cvs-commit at gcc dot gnu.org
  2023-01-24 14:27 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-12-21 12:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:845b514e8a150447ba041294586af76a6ac05158

commit r13-4828-g845b514e8a150447ba041294586af76a6ac05158
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Dec 21 12:27:58 2022 +0100

    middle-end/107994 - ICE after error with comparison gimplification

    The following avoids passing down error_mark_node to fold_convert.

            PR middle-end/107994
            * gimplify.cc (gimplify_expr): Catch errorneous comparison
            operand.

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

* [Bug c/107994] [12 Regression] ICE in fold_convert_loc, at fold-const.cc:2606
  2022-12-06 18:04 [Bug c/107994] New: [12/13 Regression] ICE in fold_convert_loc, at fold-const.cc:2606 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2022-12-21 12:13 ` cvs-commit at gcc dot gnu.org
@ 2023-01-24 14:27 ` cvs-commit at gcc dot gnu.org
  2023-01-24 14:27 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-24 14:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:45cff68d063b689bd6a9f30827b1fdd3f5ea2cb4

commit r12-9063-g45cff68d063b689bd6a9f30827b1fdd3f5ea2cb4
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Dec 21 12:27:58 2022 +0100

    middle-end/107994 - ICE after error with comparison gimplification

    The following avoids passing down error_mark_node to fold_convert.

            PR middle-end/107994
            * gimplify.cc (gimplify_expr): Catch errorneous comparison
            operand.

    (cherry picked from commit 845b514e8a150447ba041294586af76a6ac05158)

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

* [Bug c/107994] [12 Regression] ICE in fold_convert_loc, at fold-const.cc:2606
  2022-12-06 18:04 [Bug c/107994] New: [12/13 Regression] ICE in fold_convert_loc, at fold-const.cc:2606 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2023-01-24 14:27 ` [Bug c/107994] [12 " cvs-commit at gcc dot gnu.org
@ 2023-01-24 14:27 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-24 14:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |12.2.1
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
      Known to fail|                            |12.2.0

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2023-01-24 14:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-06 18:04 [Bug c/107994] New: [12/13 Regression] ICE in fold_convert_loc, at fold-const.cc:2606 gscfq@t-online.de
2022-12-06 18:08 ` [Bug c/107994] " pinskia at gcc dot gnu.org
2022-12-06 19:09 ` pinskia at gcc dot gnu.org
2022-12-21 12:13 ` cvs-commit at gcc dot gnu.org
2023-01-24 14:27 ` [Bug c/107994] [12 " cvs-commit at gcc dot gnu.org
2023-01-24 14:27 ` rguenth 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).