public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/103859] New: [11 Regression] ICE when functional declaration parameter list contains sized arrays
@ 2021-12-29 15:25 dtorrance at piedmont dot edu
  2021-12-29 16:32 ` [Bug c/103859] [11 Regression] ICE when function " marxin at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: dtorrance at piedmont dot edu @ 2021-12-29 15:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

* [Bug c/103859] [11 Regression] ICE when function declaration parameter list contains sized arrays
  2021-12-29 15:25 [Bug c/103859] New: [11 Regression] ICE when functional declaration parameter list contains sized arrays dtorrance at piedmont dot edu
@ 2021-12-29 16:32 ` marxin at gcc dot gnu.org
  2021-12-29 16:39 ` dtorrance at piedmont dot edu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-29 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2021-12-29

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Please attach pre-processed source code (-E option).

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

* [Bug c/103859] [11 Regression] ICE when function declaration parameter list contains sized arrays
  2021-12-29 15:25 [Bug c/103859] New: [11 Regression] ICE when functional declaration parameter list contains sized arrays dtorrance at piedmont dot edu
  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
  3 siblings, 0 replies; 5+ messages in thread
From: dtorrance at piedmont dot edu @ 2021-12-29 16:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Doug Torrance <dtorrance at piedmont dot edu> ---
Created attachment 52085
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52085&action=edit
preprocessed source for bug 103859

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

* [Bug c/103859] [11 Regression] ICE when function declaration parameter list contains sized arrays
  2021-12-29 15:25 [Bug c/103859] New: [11 Regression] ICE when functional declaration parameter list contains sized arrays dtorrance at piedmont dot edu
  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
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-29 20:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think there is a dup of this bug already and was already fixed for gcc
11.3.0.

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

* [Bug c/103859] [11 Regression] ICE when function declaration parameter list contains sized arrays
  2021-12-29 15:25 [Bug c/103859] New: [11 Regression] ICE when functional declaration parameter list contains sized arrays dtorrance at piedmont dot edu
                   ` (2 preceding siblings ...)
  2021-12-29 20:09 ` pinskia at gcc dot gnu.org
@ 2021-12-29 20:20 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-29 20:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|WAITING                     |RESOLVED

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 103770.

*** This bug has been marked as a duplicate of bug 103770 ***

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

end of thread, other threads:[~2021-12-29 20:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-29 15:25 [Bug c/103859] New: [11 Regression] ICE when functional declaration parameter list contains sized arrays dtorrance at piedmont dot edu
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

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).