public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "seurer at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/110616] New: [14 regression] ICE after r14-2117-gdd86a5a69cbda4
Date: Mon, 10 Jul 2023 16:02:39 +0000	[thread overview]
Message-ID: <bug-110616-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 110616
           Summary: [14 regression] ICE after r14-2117-gdd86a5a69cbda4
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

g:dd86a5a69cbda40cf76388a65d3317c91cb2b501, r14-2117-gdd86a5a69cbda4

commit dd86a5a69cbda40cf76388a65d3317c91cb2b501
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Jun 22 11:40:46 2023 +0200

    tree-optimization/96208 - SLP of non-grouped loads

The ICE only occurs with -mcpu=power7.  This is cut down from a much larger
test thus the warnings.

Note that this still fails with r14-2421-g2c60368ab5706a 


$ /home/seurer/gcc/git/install/gcc-test/bin/gcc -c -o do_fit.o -DSPEC_CPU
-DNDEBUG  -I. -DHAVE_CONFIG_H -m64 -O2 -mcpu=power7 failsX.c

failsX.c: In function 'calc_similar_ind':
failsX.c:32:14: warning: implicit declaration of function 'sqrt'
[-Wimplicit-function-declaration]
   32 |     return 2*sqrt(rd/rs);
      |              ^~~~
failsX.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
  +++ |+#include <math.h>
    1 | typedef int atom_id;
failsX.c:32:14: warning: incompatible implicit declaration of built-in function
'sqrt' [-Wbuiltin-declaration-mismatch]
   32 |     return 2*sqrt(rd/rs);
      |              ^~~~
failsX.c:32:14: note: include '<math.h>' or provide a declaration of 'sqrt'
during GIMPLE pass: vect
failsX.c:12:6: internal compiler error: Segmentation fault
   12 | real calc_similar_ind(int bRho,int nind,atom_id *index,real mass[],
      |      ^~~~~~~~~~~~~~~~
0x10cc57eb crash_signal
        /home/seurer/gcc/git/gcc-test/gcc/toplev.cc:314
0x11d56c7c vect_supportable_dr_alignment(vec_info*, dr_vec_info*, tree_node*,
int)
        /home/seurer/gcc/git/gcc-test/gcc/tree-vect-data-refs.cc:6817
0x11d5ec8f vect_enhance_data_refs_alignment(_loop_vec_info*)
        /home/seurer/gcc/git/gcc-test/gcc/tree-vect-data-refs.cc:2044
0x1107d363 vect_analyze_loop_2
        /home/seurer/gcc/git/gcc-test/gcc/tree-vect-loop.cc:2772
0x1107ec9b vect_analyze_loop_1
        /home/seurer/gcc/git/gcc-test/gcc/tree-vect-loop.cc:3303
0x1107f5f3 vect_analyze_loop(loop*, vec_info_shared*)
        /home/seurer/gcc/git/gcc-test/gcc/tree-vect-loop.cc:3457
0x110d4607 try_vectorize_loop_1
        /home/seurer/gcc/git/gcc-test/gcc/tree-vectorizer.cc:1064
0x110d4607 try_vectorize_loop
        /home/seurer/gcc/git/gcc-test/gcc/tree-vectorizer.cc:1180
0x110d4e43 execute
        /home/seurer/gcc/git/gcc-test/gcc/tree-vectorizer.cc:1296
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


$ /home/seurer/gcc/git/install/gcc-test/bin/gcc -c -o do_fit.o -DSPEC_CPU
-DNDEBUG  -I. -DHAVE_CONFIG_H -m64 -O2 -mcpu=power8 failsX.c
failsX.c: In function 'calc_similar_ind':
failsX.c:32:14: warning: implicit declaration of function 'sqrt'
[-Wimplicit-function-declaration]
   32 |     return 2*sqrt(rd/rs);
      |              ^~~~
failsX.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
  +++ |+#include <math.h>
    1 | typedef int atom_id;
failsX.c:32:14: warning: incompatible implicit declaration of built-in function
'sqrt' [-Wbuiltin-declaration-mismatch]
   32 |     return 2*sqrt(rd/rs);
      |              ^~~~
failsX.c:32:14: note: include '<math.h>' or provide a declaration of 'sqrt'


$ cat failsX.c
typedef int atom_id;

typedef float real;

typedef real rvec[3];

static real sqr(real x)
{
  return (x*x);
}

real calc_similar_ind(int bRho,int nind,atom_id *index,real mass[],
        rvec x[],rvec xp[])
{
  int i, j, d;
  real m, tm, xs, xd, rs, rd;

  tm=0;
  rs=0;
  rd=0;
  for(j=0; j<nind; j++) {
      i = j;
    m = mass[i];
    tm += m;
    for(d=0 ; d<3; d++) {
      xd = x[i][d] - xp[i][d];
      rd += m * sqr(xd);
 xs = x[i][d] + xp[i][d];
 rs += m * sqr(xs);
    }
  }
    return 2*sqrt(rd/rs);
}

             reply	other threads:[~2023-07-10 16:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10 16:02 seurer at gcc dot gnu.org [this message]
2023-07-11  7:45 ` [Bug tree-optimization/110616] " rguenth at gcc dot gnu.org
2023-07-11  8:54 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110616-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).