public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/104975] New: ICE in execute, at gimple-harden-conditionals.cc:577
@ 2022-03-18  5:11 asolokha at gmx dot com
  2022-03-21  1:23 ` [Bug middle-end/104975] ICE in execute, at gimple-harden-conditionals.cc:577 and returns_twice and pure attributes on the same function pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: asolokha at gmx dot com @ 2022-03-18  5:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104975
           Summary: ICE in execute, at gimple-harden-conditionals.cc:577
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-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.1 20220313 snapshot (g:7e28750395889d16a9cba49cd5935ced7dc00ce8) ICEs
when compiling the following testcase w/ -O1 -fharden-compares -fno-inline
-fno-ipa-pure-const:

__attribute__ ((pure, returns_twice)) int
bar (int);

int
quux (void)
{
  return 0;
}

int
foo (short int x)
{
  x = !x;
  bar (quux ());

  return x;
}

% gcc-12.0.1 -O1 -fharden-compares -fno-inline -fno-ipa-pure-const -c
pjkdqdif.c
during GIMPLE pass: hardcmp
pjkdqdif.c: In function 'foo':
pjkdqdif.c:11:1: internal compiler error: in execute, at
gimple-harden-conditionals.cc:577
   11 | foo (short int x)
      | ^~~
0x81cbba execute
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/gimple-harden-conditionals.cc:577

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

* [Bug middle-end/104975] ICE in execute, at gimple-harden-conditionals.cc:577 and returns_twice and pure attributes on the same function
  2022-03-18  5:11 [Bug tree-optimization/104975] New: ICE in execute, at gimple-harden-conditionals.cc:577 asolokha at gmx dot com
@ 2022-03-21  1:23 ` pinskia at gcc dot gnu.org
  2022-03-21  8:49 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-03-21  1:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|tree-optimization           |middle-end
            Summary|ICE in execute, at          |ICE in execute, at
                   |gimple-harden-conditionals. |gimple-harden-conditionals.
                   |cc:577 and returns_twice    |cc:577 and returns_twice
                   |                            |and pure attributes on the
                   |                            |same function
           Keywords|ice-on-valid-code           |

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I don't know if this is exactly valid.
pure/const and returns_twice does not make sense together really.
One/Both of the attributes should be ignored.

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

* [Bug middle-end/104975] ICE in execute, at gimple-harden-conditionals.cc:577 and returns_twice and pure attributes on the same function
  2022-03-18  5:11 [Bug tree-optimization/104975] New: ICE in execute, at gimple-harden-conditionals.cc:577 asolokha at gmx dot com
  2022-03-21  1:23 ` [Bug middle-end/104975] ICE in execute, at gimple-harden-conditionals.cc:577 and returns_twice and pure attributes on the same function pinskia at gcc dot gnu.org
@ 2022-03-21  8:49 ` rguenth at gcc dot gnu.org
  2022-03-21  8:58 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-03-21  8:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I guess the attribute combination should be diagnosed (and pure dropped).  OTOH
ICEing from the combination with -fharden-compares is probabaly not a good
idea.

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

* [Bug middle-end/104975] ICE in execute, at gimple-harden-conditionals.cc:577 and returns_twice and pure attributes on the same function
  2022-03-18  5:11 [Bug tree-optimization/104975] New: ICE in execute, at gimple-harden-conditionals.cc:577 asolokha at gmx dot com
  2022-03-21  1:23 ` [Bug middle-end/104975] ICE in execute, at gimple-harden-conditionals.cc:577 and returns_twice and pure attributes on the same function pinskia at gcc dot gnu.org
  2022-03-21  8:49 ` rguenth at gcc dot gnu.org
@ 2022-03-21  8:58 ` marxin at gcc dot gnu.org
  2022-03-23 23:18 ` aoliva at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-03-21  8:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2022-03-21
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

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

* [Bug middle-end/104975] ICE in execute, at gimple-harden-conditionals.cc:577 and returns_twice and pure attributes on the same function
  2022-03-18  5:11 [Bug tree-optimization/104975] New: ICE in execute, at gimple-harden-conditionals.cc:577 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2022-03-21  8:58 ` marxin at gcc dot gnu.org
@ 2022-03-23 23:18 ` aoliva at gcc dot gnu.org
  2022-03-24 13:10 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: aoliva at gcc dot gnu.org @ 2022-03-23 23:18 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

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

--- Comment #3 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Created attachment 52676
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52676&action=edit
Candidate patch

Mine.  I'm testing this fix.

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

* [Bug middle-end/104975] ICE in execute, at gimple-harden-conditionals.cc:577 and returns_twice and pure attributes on the same function
  2022-03-18  5:11 [Bug tree-optimization/104975] New: ICE in execute, at gimple-harden-conditionals.cc:577 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2022-03-23 23:18 ` aoliva at gcc dot gnu.org
@ 2022-03-24 13:10 ` cvs-commit at gcc dot gnu.org
  2022-03-24 13:19 ` aoliva at gcc dot gnu.org
  2022-12-07  2:28 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-24 13:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alexandre Oliva <aoliva@gcc.gnu.org>:

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

commit r12-7800-gb8c4171ebd72079e55aceadbcfc883f517cdf895
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu Mar 24 10:02:27 2022 -0300

    hardcmp: split before dispatch edge

    If we harden a compare at the end of a block with an edge to the
    abnormal dispatch block, it won't have a single successor.  Arrange to
    split the block at its final stmt so as to have a single succ.


    for  gcc/ChangeLog

            PR middle-end/104975
            * gimple-harden-conditionals.cc
            (pass_harden_compares::execute): Force split in case of
            multiple edges.

    for  gcc/testsuite/ChangeLog

            PR middle-end/104975
            * gcc.dg/pr104975.c: New.

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

* [Bug middle-end/104975] ICE in execute, at gimple-harden-conditionals.cc:577 and returns_twice and pure attributes on the same function
  2022-03-18  5:11 [Bug tree-optimization/104975] New: ICE in execute, at gimple-harden-conditionals.cc:577 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2022-03-24 13:10 ` cvs-commit at gcc dot gnu.org
@ 2022-03-24 13:19 ` aoliva at gcc dot gnu.org
  2022-12-07  2:28 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: aoliva at gcc dot gnu.org @ 2022-03-24 13:19 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

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

--- Comment #5 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Fixed

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

* [Bug middle-end/104975] ICE in execute, at gimple-harden-conditionals.cc:577 and returns_twice and pure attributes on the same function
  2022-03-18  5:11 [Bug tree-optimization/104975] New: ICE in execute, at gimple-harden-conditionals.cc:577 asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2022-03-24 13:19 ` aoliva at gcc dot gnu.org
@ 2022-12-07  2:28 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-07  2:28 UTC (permalink / raw)
  To: gcc-bugs

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

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-12-07  2:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18  5:11 [Bug tree-optimization/104975] New: ICE in execute, at gimple-harden-conditionals.cc:577 asolokha at gmx dot com
2022-03-21  1:23 ` [Bug middle-end/104975] ICE in execute, at gimple-harden-conditionals.cc:577 and returns_twice and pure attributes on the same function pinskia at gcc dot gnu.org
2022-03-21  8:49 ` rguenth at gcc dot gnu.org
2022-03-21  8:58 ` marxin at gcc dot gnu.org
2022-03-23 23:18 ` aoliva at gcc dot gnu.org
2022-03-24 13:10 ` cvs-commit at gcc dot gnu.org
2022-03-24 13:19 ` aoliva at gcc dot gnu.org
2022-12-07  2:28 ` 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).