public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/101741] New: [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541
@ 2021-08-03  6:41 asolokha at gmx dot com
  2021-08-03 11:33 ` [Bug tree-optimization/101741] [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 since r12-2517-g1ce0b26e6e1e6c34 marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: asolokha at gmx dot com @ 2021-08-03  6:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101741
           Summary: [12 Regression] ICE in fold_stmt, at
                    gimple-range-fold.cc:541
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-checking, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-12.0.0-alpha20210801 snapshot (g:6f0c43e97825ee54e3779afbedcd0def12443001)
ICEs when compiling the following testcase w/ -O1:

int
foo (void);

unsigned int
toupper (int c)
{
  c = foo ();
  while (c)
    c = toupper (c);

  return c;
}

% gcc-12.0.0 -O1 -c kfqwhatr.c
during GIMPLE pass: dom
kfqwhatr.c: In function 'toupper':
kfqwhatr.c:5:1: internal compiler error: in fold_stmt, at
gimple-range-fold.cc:541
    5 | toupper (int c)
      | ^~~~~~~
0x7d2d8a fold_using_range::fold_stmt(irange&, gimple*, fur_source&, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210801/work/gcc-12-20210801/gcc/gimple-range-fold.cc:541
0x18e1b7e fold_range(irange&, gimple*, range_query*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210801/work/gcc-12-20210801/gcc/gimple-range-fold.cc:317
0x11ad8c5 vr_values::extract_range_basic(value_range_equiv*, gimple*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210801/work/gcc-12-20210801/gcc/vr-values.c:1234
0x18ea7e5 evrp_range_analyzer::record_ranges_from_stmt(gimple*, bool)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210801/work/gcc-12-20210801/gcc/gimple-ssa-evrp-analyze.c:308
0x1066e80 jt_state::record_ranges_from_stmt(gimple*, bool)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210801/work/gcc-12-20210801/gcc/tree-ssa-threadedge.c:1391
0x1066e80
jump_threader::record_temporary_equivalences_from_stmts_at_dest(edge_def*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210801/work/gcc-12-20210801/gcc/tree-ssa-threadedge.c:269
0x1067501 jump_threader::thread_through_normal_block(vec<jump_thread_edge*,
va_heap, vl_ptr>*, edge_def*, bitmap_head*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210801/work/gcc-12-20210801/gcc/tree-ssa-threadedge.c:977
0x1068600 jump_threader::thread_through_normal_block(vec<jump_thread_edge*,
va_heap, vl_ptr>*, edge_def*, bitmap_head*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210801/work/gcc-12-20210801/gcc/tree-ssa-threadedge.c:1262
0x1068600 jump_threader::thread_across_edge(edge_def*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210801/work/gcc-12-20210801/gcc/tree-ssa-threadedge.c:1150
0xf6eba4 dom_opt_dom_walker::after_dom_children(basic_block_def*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210801/work/gcc-12-20210801/gcc/tree-ssa-dom.c:1473
0x18ab16a dom_walker::walk(basic_block_def*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210801/work/gcc-12-20210801/gcc/domwalk.c:352
0xf70acb execute
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210801/work/gcc-12-20210801/gcc/tree-ssa-dom.c:764

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

* [Bug tree-optimization/101741] [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 since r12-2517-g1ce0b26e6e1e6c34
  2021-08-03  6:41 [Bug tree-optimization/101741] New: [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 asolokha at gmx dot com
@ 2021-08-03 11:33 ` marxin at gcc dot gnu.org
  2021-08-03 11:46 ` asolokha at gmx dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-08-03 11:33 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amacleod at redhat dot com,
                   |                            |marxin at gcc dot gnu.org
            Summary|[12 Regression] ICE in      |[12 Regression] ICE in
                   |fold_stmt, at               |fold_stmt, at
                   |gimple-range-fold.cc:541    |gimple-range-fold.cc:541
                   |                            |since
                   |                            |r12-2517-g1ce0b26e6e1e6c34
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-08-03

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed. Btw. why is the test-case marked as "invalid"?

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

* [Bug tree-optimization/101741] [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 since r12-2517-g1ce0b26e6e1e6c34
  2021-08-03  6:41 [Bug tree-optimization/101741] New: [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 asolokha at gmx dot com
  2021-08-03 11:33 ` [Bug tree-optimization/101741] [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 since r12-2517-g1ce0b26e6e1e6c34 marxin at gcc dot gnu.org
@ 2021-08-03 11:46 ` asolokha at gmx dot com
  2021-08-03 11:55 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: asolokha at gmx dot com @ 2021-08-03 11:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Arseny Solokha <asolokha at gmx dot com> ---
(In reply to Martin Liška from comment #1)
> why is the test-case marked as "invalid"?

It is definitely well-formed syntactically, but I'm not sure how to classify a
case of redefining a standard function which has a builtin in gcc w/ a function
w/ different return type. Is there any guidance that I could refer to in the
future when telling valid testcases from invalid ones?

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

* [Bug tree-optimization/101741] [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 since r12-2517-g1ce0b26e6e1e6c34
  2021-08-03  6:41 [Bug tree-optimization/101741] New: [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 asolokha at gmx dot com
  2021-08-03 11:33 ` [Bug tree-optimization/101741] [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 since r12-2517-g1ce0b26e6e1e6c34 marxin at gcc dot gnu.org
  2021-08-03 11:46 ` asolokha at gmx dot com
@ 2021-08-03 11:55 ` marxin at gcc dot gnu.org
  2021-08-03 20:05 ` msebor at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-08-03 11:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Arseny Solokha from comment #2)
> (In reply to Martin Liška from comment #1)
> > why is the test-case marked as "invalid"?
> 
> It is definitely well-formed syntactically, but I'm not sure how to classify
> a case of redefining a standard function which has a builtin in gcc w/ a
> function w/ different return type. Is there any guidance that I could refer
> to in the future when telling valid testcases from invalid ones?

Ah, that's the reason. I don't know what requirements do we have for such
functions..

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

* [Bug tree-optimization/101741] [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 since r12-2517-g1ce0b26e6e1e6c34
  2021-08-03  6:41 [Bug tree-optimization/101741] New: [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2021-08-03 11:55 ` marxin at gcc dot gnu.org
@ 2021-08-03 20:05 ` msebor at gcc dot gnu.org
  2021-08-09 20:25 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-08-03 20:05 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org
           Keywords|ice-on-invalid-code         |ice-on-valid-code

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
I believe invalid in the keyword means strictly syntactically invalid, not
undefined as a result of a semantic constraint (e.g., defining a standard
function; GCC normally handles that gracefully).

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

* [Bug tree-optimization/101741] [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 since r12-2517-g1ce0b26e6e1e6c34
  2021-08-03  6:41 [Bug tree-optimization/101741] New: [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2021-08-03 20:05 ` msebor at gcc dot gnu.org
@ 2021-08-09 20:25 ` cvs-commit at gcc dot gnu.org
  2021-08-09 20:26 ` amacleod at redhat dot com
  2022-11-28 22:51 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-09 20:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Macleod <amacleod@gcc.gnu.org>:

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

commit r12-2826-gc86c95edd165d674614516cda0b1fcb6616c1096
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Mon Aug 9 15:53:42 2021 -0400

    Ensure toupper and tolower follow the expected pattern.

    If the parameter is not compatible with the LHS, assume this is not really
a
    builtin function to avoid a trap.

            gcc/
            PR tree-optimization/101741
            * gimple-range-fold.cc (fold_using_range::range_of_builtin_call):
Check
            type of parameter for toupper/tolower.

            gcc/testsuite/
            * gcc.dg/pr101741.c: New.

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

* [Bug tree-optimization/101741] [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 since r12-2517-g1ce0b26e6e1e6c34
  2021-08-03  6:41 [Bug tree-optimization/101741] New: [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2021-08-09 20:25 ` cvs-commit at gcc dot gnu.org
@ 2021-08-09 20:26 ` amacleod at redhat dot com
  2022-11-28 22:51 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: amacleod at redhat dot com @ 2021-08-09 20:26 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Macleod <amacleod at redhat dot com> changed:

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

--- Comment #6 from Andrew Macleod <amacleod at redhat dot com> ---
Yeah, we aren't expecting the parameter and the LHS to be different.  Why do we
mark this as a builtin function if it doesn't match the parameter list?

Regardless, when folding the call we assumed the parameter type matches the
LHS.  This patch changes it so if the types do not match, we will assume
nothing about the function instead.

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

* [Bug tree-optimization/101741] [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 since r12-2517-g1ce0b26e6e1e6c34
  2021-08-03  6:41 [Bug tree-optimization/101741] New: [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2021-08-09 20:26 ` amacleod at redhat dot com
@ 2022-11-28 22:51 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-28 22:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

end of thread, other threads:[~2022-11-28 22:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03  6:41 [Bug tree-optimization/101741] New: [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 asolokha at gmx dot com
2021-08-03 11:33 ` [Bug tree-optimization/101741] [12 Regression] ICE in fold_stmt, at gimple-range-fold.cc:541 since r12-2517-g1ce0b26e6e1e6c34 marxin at gcc dot gnu.org
2021-08-03 11:46 ` asolokha at gmx dot com
2021-08-03 11:55 ` marxin at gcc dot gnu.org
2021-08-03 20:05 ` msebor at gcc dot gnu.org
2021-08-09 20:25 ` cvs-commit at gcc dot gnu.org
2021-08-09 20:26 ` amacleod at redhat dot com
2022-11-28 22:51 ` 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).