public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dtorrance at piedmont dot edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/103859] New: [11 Regression] ICE when functional declaration parameter list contains sized arrays
Date: Wed, 29 Dec 2021 15:25:37 +0000	[thread overview]
Message-ID: <bug-103859-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 103859
           Summary: [11 Regression] ICE when functional declaration
                    parameter list contains sized arrays
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dtorrance at piedmont dot edu
  Target Milestone: ---

I'm getting the following internal compiler error when compiling
ts_interpolation.c from PHCpack [1] in Debian unstable using gcc 11.2.0 on a
number of architectures (armel, armhf, i386, mipsel, s390x, powerpc, and
ppc64).  This isn't a problem using gcc 10.3.1.

A simple workaround is to switch from p[n] to *p in the function declaration.

I've simplified the failing code down to a few lines:

$ gcc -c test.c
during RTL pass: expand
test.c: In function 'main':
test.c:16:3: internal compiler error: Segmentation fault
   16 |   horner(n + 1, f, x[i]);
      |   ^~~~~~~~~~~~~~~~~~~~~~
0x8ae09e6 internal_error(char const*, ...)
        ???:0
0x8b5d8c3 get_size_range(range_query*, tree_node*, gimple*, tree_node**, int)
        ???:0
0x8be739c expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.
Preprocessed source stored into /tmp/cc2JQxrQ.out file, please attach this to
your bugreport.
=== BEGIN GCC DUMP ===
72708: // Target: i686-linux-gnu
72708: // Configured with: ../src/configure -v --with-pkgversion='Debian
11.2.0-13' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-11
--program-prefix=i686-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib
--enable-libphobos-checking=release --with-target-system-zlib=auto
--enable-objc-gc=auto --enable-targets=all --enable-multiarch --disable-werror
--with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic --enable-checking=release --build=i686-linux-gnu
--host=i686-linux-gnu --target=i686-linux-gnu
72708: // Thread model: posix
72708: // Supported LTO compression algorithms: zlib zstd
72708: // gcc version 11.2.0 (Debian 11.2.0-13) 
72708: // 
72708: // during RTL pass: expand
72708: // test.c: In function 'main':
72708: // test.c:16:3: internal compiler error: Segmentation fault
72708: //    16 |   horner(n + 1, f, x[i]);
72708: //       |   ^~~~~~~~~~~~~~~~~~~~~~
72708: // 0x8ae09e6 internal_error(char const*, ...)
72708: //       ???:0
72708: // 0x8b5d8c3 get_size_range(range_query*, tree_node*, gimple*,
tree_node**, int)
72708: //       ???:0
72708: // 0x8be739c expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
72708: //       ???:0
72708: // Please submit a full bug report,
72708: // with preprocessed source if appropriate.
72708: // Please include the complete backtrace with any bug report.
72708: // See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.
72708: 
72708: // /usr/lib/gcc/i686-linux-gnu/11/cc1 -quiet -imultiarch i386-linux-gnu
test.c -quiet -dumpbase test.c -dumpbase-ext .c -mtune=generic -march=i686
-fasynchronous-unwind-tables -o - -frandom-seed=0 -fdump-noaddr
72708: 
72708: # 0 "test.c"
72708: # 0 "<built-in>"
72708: # 0 "<command-line>"
72708: # 1 "/usr/include/stdc-predef.h" 1 3 4
72708: # 0 "<command-line>" 2
72708: # 1 "test.c"
72708: typedef struct dcmplx dcmplx;
72708: 
72708: struct dcmplx {
72708:   double re;
72708:   double im;
72708: };
72708: 
72708: dcmplx horner(int n, dcmplx p[n], dcmplx x);
72708: 
72708: int main(void)
72708: {
72708: 
72708:   int i, n;
72708:   dcmplx x[n + 1], f[n + 1];
72708: 
72708:   horner(n + 1, f, x[i]);
72708: 
72708:   return 0;
72708: }
=== END GCC DUMP ===

[1]
https://github.com/janverschelde/PHCpack/blob/master/src/Feedback/ts_interpolation.c

             reply	other threads:[~2021-12-29 15:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-29 15:25 dtorrance at piedmont dot edu [this message]
2021-12-29 16:32 ` [Bug c/103859] [11 Regression] ICE when function " marxin at gcc dot gnu.org
2021-12-29 16:39 ` dtorrance at piedmont dot edu
2021-12-29 20:09 ` pinskia at gcc dot gnu.org
2021-12-29 20:20 ` pinskia 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-103859-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).