public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/110266] New: ice in gimple_range_adjustment
@ 2023-06-15  9:23 dcb314 at hotmail dot com
  2023-06-15  9:29 ` [Bug c/110266] " dcb314 at hotmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2023-06-15  9:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110266
           Summary: ice in gimple_range_adjustment
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 55326
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55326&action=edit
C source code

The attached C code does this with today's gcc trunk:

$ ~/gcc/results/bin/gcc -c -O2 bug933.c
during GIMPLE pass: vrp
blockswitch.c: In function ‘PsyBufferUpdate’:
blockswitch.c:347:13: internal compiler error: tree check: expected
integer_cst, have real_cst in to_wide, at tree.h:6314
0x1151782 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../trunk.year/gcc/tree.cc:8899
0x1b773a1 gimple_range_adjustment(vrange&, gimple const*)
        ../../trunk.year/gcc/gimple-range-fold.cc:0

It seems to have gone wrong sometime between 20230609 and 20230611.
Git hashes g:067a8c7cb897b6a1 and g:20c85207abd543c7.

I will have a go at reducing the code.

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

* [Bug c/110266] ice in gimple_range_adjustment
  2023-06-15  9:23 [Bug c/110266] New: ice in gimple_range_adjustment dcb314 at hotmail dot com
@ 2023-06-15  9:29 ` dcb314 at hotmail dot com
  2023-06-15 10:21 ` dcb314 at hotmail dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2023-06-15  9:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
Reduced code is:

typedef struct {
  int sizeS
} PsyInfo;
Hann_i;
*mdct_data;
PsyInfo PsyBufferUpdate_psyInfo;
mdct(N) {
  double tempr, s, sfreq, xr_0 = cos(N);
  int i;
  sfreq = sin(N);
  for (; N; i++) {
    tempr = xr_0 * s;
    mdct_data[i] = tempr;
    s = sfreq;
  }
}
PsyBufferUpdate() {
  if (PsyBufferUpdate_psyInfo.sizeS == 60)
    for (; Hann_i;)
      ;
  mdct(PsyBufferUpdate_psyInfo);
}

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

* [Bug c/110266] ice in gimple_range_adjustment
  2023-06-15  9:23 [Bug c/110266] New: ice in gimple_range_adjustment dcb314 at hotmail dot com
  2023-06-15  9:29 ` [Bug c/110266] " dcb314 at hotmail dot com
@ 2023-06-15 10:21 ` dcb314 at hotmail dot com
  2023-06-15 10:26 ` dcb314 at hotmail dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2023-06-15 10:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
After a couple of steps of bisect, I have this list of Authors in the git
range:

Author: Andrew MacLeod <amacleod@redhat.com>
Author: Andrew MacLeod <amacleod@redhat.com>
Author: Andrew MacLeod <amacleod@redhat.com>
Author: Andrew MacLeod <amacleod@redhat.com>
Author: GCC Administrator <gccadmin@gcc.gnu.org>
Author: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Author: David Malcolm <dmalcolm@redhat.com>

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

* [Bug c/110266] ice in gimple_range_adjustment
  2023-06-15  9:23 [Bug c/110266] New: ice in gimple_range_adjustment dcb314 at hotmail dot com
  2023-06-15  9:29 ` [Bug c/110266] " dcb314 at hotmail dot com
  2023-06-15 10:21 ` dcb314 at hotmail dot com
@ 2023-06-15 10:26 ` dcb314 at hotmail dot com
  2023-06-15 10:36 ` dcb314 at hotmail dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2023-06-15 10:26 UTC (permalink / raw)
  To: gcc-bugs

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

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amacleod at redhat dot com

--- Comment #3 from David Binderman <dcb314 at hotmail dot com> ---
Downto four commits in the range, all by Andrew.

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

* [Bug c/110266] ice in gimple_range_adjustment
  2023-06-15  9:23 [Bug c/110266] New: ice in gimple_range_adjustment dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2023-06-15 10:26 ` dcb314 at hotmail dot com
@ 2023-06-15 10:36 ` dcb314 at hotmail dot com
  2023-06-15 10:48 ` dcb314 at hotmail dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2023-06-15 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from David Binderman <dcb314 at hotmail dot com> ---
$ git bisect bad 07767389fb390814
07767389fb390814d9b6142e9d0341b7b9fd1cc2 is the first bad commit
commit 07767389fb390814d9b6142e9d0341b7b9fd1cc2
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Fri Jun 9 12:58:57 2023 -0400

    Provide a unified range-op table.

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

* [Bug c/110266] ice in gimple_range_adjustment
  2023-06-15  9:23 [Bug c/110266] New: ice in gimple_range_adjustment dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2023-06-15 10:36 ` dcb314 at hotmail dot com
@ 2023-06-15 10:48 ` dcb314 at hotmail dot com
  2023-06-15 15:53 ` [Bug tree-optimization/110266] [14 Regression] " pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2023-06-15 10:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from David Binderman <dcb314 at hotmail dot com> ---
Second test case:

# include <math.h>

int Hann_i, PsyBufferUpdate_psyInfo_0, PsyBufferUpdate_i;
double *mdct_data;
double PsyBufferUpdate_sfreq;
void PsyBufferUpdate() {
  if (PsyBufferUpdate_psyInfo_0 == 4)
    for (; Hann_i;)
      ;
  {
    double xr_0 = cos(PsyBufferUpdate_psyInfo_0);
    PsyBufferUpdate_sfreq = sin(PsyBufferUpdate_psyInfo_0);
    for (; PsyBufferUpdate_psyInfo_0; PsyBufferUpdate_i++)
      mdct_data[PsyBufferUpdate_i] = xr_0 * PsyBufferUpdate_sfreq;
  }
}

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

* [Bug tree-optimization/110266] [14 Regression] ice in gimple_range_adjustment
  2023-06-15  9:23 [Bug c/110266] New: ice in gimple_range_adjustment dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2023-06-15 10:48 ` dcb314 at hotmail dot com
@ 2023-06-15 15:53 ` pinskia at gcc dot gnu.org
  2023-06-15 15:59 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-15 15:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0
            Summary|ice in                      |[14 Regression] ice in
                   |gimple_range_adjustment     |gimple_range_adjustment
          Component|c                           |tree-optimization
           Keywords|                            |ice-on-valid-code
            Version|unknown                     |14.0

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

* [Bug tree-optimization/110266] [14 Regression] ice in gimple_range_adjustment
  2023-06-15  9:23 [Bug c/110266] New: ice in gimple_range_adjustment dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2023-06-15 15:53 ` [Bug tree-optimization/110266] [14 Regression] " pinskia at gcc dot gnu.org
@ 2023-06-15 15:59 ` pinskia at gcc dot gnu.org
  2023-06-15 17:38 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-15 15:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-06-15
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, reduced testcase:
```
double PsyBufferUpdate(int n)
{
  if (n == 4)
    {
      _Complex double t = __builtin_cexpi(n);
      return __real t * __imag t;
    }
  return 0;
}
```

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

* [Bug tree-optimization/110266] [14 Regression] ice in gimple_range_adjustment
  2023-06-15  9:23 [Bug c/110266] New: ice in gimple_range_adjustment dcb314 at hotmail dot com
                   ` (6 preceding siblings ...)
  2023-06-15 15:59 ` pinskia at gcc dot gnu.org
@ 2023-06-15 17:38 ` cvs-commit at gcc dot gnu.org
  2023-06-15 17:38 ` amacleod at redhat dot com
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-06-15 17:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 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:6c121a2c687c56b09ecc11ef6ae1893ec5006325

commit r14-1871-g6c121a2c687c56b09ecc11ef6ae1893ec5006325
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Thu Jun 15 11:59:55 2023 -0400

    Check for integer only complex.

    With the expanded capabilities of range-op dispatch, floating point
    complex objects can appear when folding, whic they couldn't before.
    In the processig for extracting integers from complex ints, make sure it
    is an integer complex.

            PR tree-optimization/110266
            gcc/
            * gimple-range-fold.cc (adjust_imagpart_expr): Check for integer
            complex type.
            (adjust_realpart_expr): Ditto.

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

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

* [Bug tree-optimization/110266] [14 Regression] ice in gimple_range_adjustment
  2023-06-15  9:23 [Bug c/110266] New: ice in gimple_range_adjustment dcb314 at hotmail dot com
                   ` (7 preceding siblings ...)
  2023-06-15 17:38 ` cvs-commit at gcc dot gnu.org
@ 2023-06-15 17:38 ` amacleod at redhat dot com
  2023-06-15 17:57 ` cvs-commit at gcc dot gnu.org
  2023-06-16 23:32 ` pinskia at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: amacleod at redhat dot com @ 2023-06-15 17:38 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Macleod <amacleod at redhat dot com> changed:

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

--- Comment #8 from Andrew Macleod <amacleod at redhat dot com> ---
fixed.

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

* [Bug tree-optimization/110266] [14 Regression] ice in gimple_range_adjustment
  2023-06-15  9:23 [Bug c/110266] New: ice in gimple_range_adjustment dcb314 at hotmail dot com
                   ` (8 preceding siblings ...)
  2023-06-15 17:38 ` amacleod at redhat dot com
@ 2023-06-15 17:57 ` cvs-commit at gcc dot gnu.org
  2023-06-16 23:32 ` pinskia at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-06-15 17:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:

https://gcc.gnu.org/g:91fb8bdb3944b78bca4f739583ff490c83a92fe7

commit r14-1872-g91fb8bdb3944b78bca4f739583ff490c83a92fe7
Author: Andrew Pinski <apinski@marvell.com>
Date:   Thu Jun 15 17:49:40 2023 +0000

    Add another testcase for PR 110266

    Since the combining of sin/cos into cexpi is depedent
    on the target, this adds another testcase which had failed (earlier in
    evpr rather than vrp2) that will fail on all targets rather than
    ones which have sincos or C99 math functions.

    Committed as obvious after a quick test.

    gcc/testsuite/ChangeLog:

            PR tree-optimization/110266
            * gcc.c-torture/compile/pr110266.c: New test.

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

* [Bug tree-optimization/110266] [14 Regression] ice in gimple_range_adjustment
  2023-06-15  9:23 [Bug c/110266] New: ice in gimple_range_adjustment dcb314 at hotmail dot com
                   ` (9 preceding siblings ...)
  2023-06-15 17:57 ` cvs-commit at gcc dot gnu.org
@ 2023-06-16 23:32 ` pinskia at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-16 23:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zsojka at seznam dot cz

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 110219 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2023-06-16 23:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15  9:23 [Bug c/110266] New: ice in gimple_range_adjustment dcb314 at hotmail dot com
2023-06-15  9:29 ` [Bug c/110266] " dcb314 at hotmail dot com
2023-06-15 10:21 ` dcb314 at hotmail dot com
2023-06-15 10:26 ` dcb314 at hotmail dot com
2023-06-15 10:36 ` dcb314 at hotmail dot com
2023-06-15 10:48 ` dcb314 at hotmail dot com
2023-06-15 15:53 ` [Bug tree-optimization/110266] [14 Regression] " pinskia at gcc dot gnu.org
2023-06-15 15:59 ` pinskia at gcc dot gnu.org
2023-06-15 17:38 ` cvs-commit at gcc dot gnu.org
2023-06-15 17:38 ` amacleod at redhat dot com
2023-06-15 17:57 ` cvs-commit at gcc dot gnu.org
2023-06-16 23:32 ` 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).