public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/61455] New: Internal compiler error, and other confused errors, when using array notation
@ 2014-06-09 10:43 nick.tomlinson at arm dot com
  2014-06-09 12:28 ` [Bug c++/61455] " jgreenhalgh at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: nick.tomlinson at arm dot com @ 2014-06-09 10:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61455
           Summary: Internal compiler error, and other confused errors,
                    when using array notation
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nick.tomlinson at arm dot com

Created attachment 32911
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32911&action=edit
A minimal reproducer

When building a simple, though incorrect, CilkPlus program using array
notation, it is possible to trigger an internal compiler error.

==== Steps to reproduce ====
[*] Build this file with: g++ -fcilkplus -O3 -c bug.cpp
[*] Comment out incorrect_error() and unprintable_error(), and retry.

Notes:
[*] Observed on ArchLinux with a locally built x86_64 GCC: r211050
    (x86_64-unknown-linux-gnu-g++) as an internal fault.
[*] Observed on ArchLinux with package maintainer's x86_64 GCC 4.9
    (g++) as a confused by previous errors message.
[*] I have confirmed the bug is still present in revision r211365.

==== What I expected to happen ====
[*] No internal compiler error.
[*] A (non-internal fault) error should be produced for internal_fault(), as
    it should not be possible to assign an int[2]  expression to an int
    lvalue.
[*] The compilation of incorrect_error() should not result in an error
    suggesting the rhs is an expression of type int.
[*] The compilation of unprintable_error() should not result in
    "not supported by dump_decl" output.





==== What actually happened ====
I get the following output:


==== r211050 gcc output with all three ====

$ x86_64-unknown-linux-gnu-g++ -fcilkplus -O3 -c bug.cpp
bug.cpp: In function 'void incorrect_error()':
bug.cpp:46:5: error: incompatible types in assignment of 'int' to 'int [2]'
   b = a[:];
     ^
bug.cpp: In function 'void unprintable_error()':
bug.cpp:57:8: error: 'b' cannot be scalar when 'a[#'integer_cst' not supported
by dump_decl#<declaration error>:#'integer_cst' not supported by
dump_decl#<declaration error>:#'integer_cst' not supported by
dump_decl#<declaration error>]' is not
   b = a[:];
        ^
bug.cpp: In function 'void internal_fault()':
bug.cpp:38:12: internal compiler error: in gimplify_expr, at gimplify.c:8263
   int b = a[:];
            ^
0xa03a58 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:8263
0x9ff8b0 gimplify_modify_expr
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:4529
0xa01758 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:7547
0xa05776 gimplify_stmt(tree_node**, gimple_statement_base**)
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:5375
0xa13fc9 gimplify_and_add
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:384
0xa13fc9 gimplify_decl_expr
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:1378
0xa02065 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:7740
0xa05776 gimplify_stmt(tree_node**, gimple_statement_base**)
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:5375
0xa02303 gimplify_statement_list
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:1431
0xa02303 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:7962
0xa05776 gimplify_stmt(tree_node**, gimple_statement_base**)
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:5375
0xa06646 gimplify_bind_expr
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:1098
0xa01d17 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:7744
0xa05776 gimplify_stmt(tree_node**, gimple_statement_base**)
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:5375
0xa06f76 gimplify_body(tree_node*, bool)
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:8654
0xa07576 gimplify_function_tree(tree_node*)
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/gimplify.c:8807
0x887a37 analyze_function
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/cgraphunit.c:650
0x888ce9 analyze_functions
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/cgraphunit.c:1028
0x88a575 finalize_compilation_unit()
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/cgraphunit.c:2331
0x679aee cp_write_global_declarations()
        /home/nicholas/GCCCilk/native/native/gcc-4.9.0/gcc/cp/decl2.c:4632
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


==== 4.9 gcc output with all three ====

$ g++ -fcilkplus -O3 -c bug.cpp
bug.cpp: In function 'void incorrect_error()':
bug.cpp:46:5: error: incompatible types in assignment of 'int' to 'int [2]'
   b = a[:];
     ^
bug.cpp: In function 'void unprintable_error()':
bug.cpp:57:8: error: 'b' cannot be scalar when 'a[#'integer_cst' not supported
by dump_decl#<declaration error>:#'integer_cst' not supported by
dump_decl#<declaration error>:#'integer_cst' not supported by
dump_decl#<declaration error>]' is not
   b = a[:];
        ^
bug.cpp:38: confused by earlier errors, bailing out


==== r211050 gcc output with only unprintable_error() ====

$ x86_64-unknown-linux-gnu-g++ -fcilkplus -O3 -c bug.cpp
bug.cpp: In function 'void unprintable_error()':
bug.cpp:57:8: error: 'b' cannot be scalar when 'a[#'integer_cst' not supported
by dump_decl#<declaration error>:#'integer_cst' not supported by
dump_decl#<declaration error>:#'integer_cst' not supported by
dump_decl#<declaration error>]' is not
   b = a[:];
        ^


==== 4.9 gcc output with all only unprintable_error() ====

$ g++ -fcilkplus -O3 -c bug.cpp
bug.cpp: In function 'void unprintable_error()':
bug.cpp:57:8: error: 'b' cannot be scalar when 'a[#'integer_cst' not supported
by dump_decl#<declaration error>:#'integer_cst' not supported by
dump_decl#<declaration error>:#'integer_cst' not supported by
dump_decl#<declaration error>]' is not
   b = a[:];
        ^


==== uname ====

$ uname -a
Linux squamata 3.14.4-1-ARCH #1 SMP PREEMPT Tue May 13 16:41:39 CEST 2014
x86_64 GNU/Linux


==== r211050 gcc version ====
$ x86_64-unknown-linux-gnu-g++ -v
Using built-in specs.
COLLECT_GCC=x86_64-unknown-linux-gnu-g++
COLLECT_LTO_WRAPPER=/home/nicholas/GCCCilk/native/gcc/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/nicholas/GCCCilk/native/native/gcc-4.9.0/configure
--prefix=/home/nicholas/GCCCilk/native/gcc --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.10.0 20140529 (experimental) (GCC) 


==== 4.9 gcc version ====

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/gcc-multilib/src/gcc-4.9-20140507/configure
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--disable-libssp --enable-gnu-unique-object --enable-linker-build-id
--enable-cloog-backend=isl --disable-cloog-version-check --enable-lto
--enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu
--enable-multilib --disable-werror --enable-checking=release
Thread model: posix
gcc version 4.9.0 20140507 (prerelease) (GCC)


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

* [Bug c++/61455] Internal compiler error, and other confused errors, when using array notation
  2014-06-09 10:43 [Bug middle-end/61455] New: Internal compiler error, and other confused errors, when using array notation nick.tomlinson at arm dot com
@ 2014-06-09 12:28 ` jgreenhalgh at gcc dot gnu.org
  2014-06-09 16:51 ` ktkachov at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jgreenhalgh at gcc dot gnu.org @ 2014-06-09 12:28 UTC (permalink / raw)
  To: gcc-bugs

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

jgreenhalgh at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Target|                            |x86_64-unknown-linux-gnu
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-06-09
                 CC|                            |jgreenhalgh at gcc dot gnu.org
          Component|middle-end                  |c++
     Ever confirmed|0                           |1

--- Comment #1 from jgreenhalgh at gcc dot gnu.org ---
Confirmed. Issue is present whether compiling the testcase as a C file or a C++
file.

Possibly related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57541


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

* [Bug c++/61455] Internal compiler error, and other confused errors, when using array notation
  2014-06-09 10:43 [Bug middle-end/61455] New: Internal compiler error, and other confused errors, when using array notation nick.tomlinson at arm dot com
  2014-06-09 12:28 ` [Bug c++/61455] " jgreenhalgh at gcc dot gnu.org
@ 2014-06-09 16:51 ` ktkachov at gcc dot gnu.org
  2014-08-01 16:55 ` kyukhin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2014-06-09 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bviyer at gmail dot com,
                   |                            |ktkachov at gcc dot gnu.org

--- Comment #2 from ktkachov at gcc dot gnu.org ---
cc'ing Balaji since he's done CilkPlus work most recently IIRC.


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

* [Bug c++/61455] Internal compiler error, and other confused errors, when using array notation
  2014-06-09 10:43 [Bug middle-end/61455] New: Internal compiler error, and other confused errors, when using array notation nick.tomlinson at arm dot com
  2014-06-09 12:28 ` [Bug c++/61455] " jgreenhalgh at gcc dot gnu.org
  2014-06-09 16:51 ` ktkachov at gcc dot gnu.org
@ 2014-08-01 16:55 ` kyukhin at gcc dot gnu.org
  2014-08-01 17:01 ` kyukhin at gcc dot gnu.org
  2014-08-04 11:42 ` nick.tomlinson at arm dot com
  4 siblings, 0 replies; 6+ messages in thread
From: kyukhin at gcc dot gnu.org @ 2014-08-01 16:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Kirill Yukhin <kyukhin at gcc dot gnu.org> ---
Author: kyukhin
Date: Fri Aug  1 16:54:27 2014
New Revision: 213491

URL: https://gcc.gnu.org/viewcvs?rev=213491&root=gcc&view=rev
Log:
    PR middle-end/61455

gcc/c-family/
    * array-notation-common.c (extract_array_notation_exprs): Handling
    of DECL_EXPR added.

gcc/c/
    * c-array-notation.c (expand_array_notations): Handling
    of DECL_EXPR added.

gcc/cp/
    * cp-array-notation.c (expand_array_notation_exprs): Handling of
    DECL_EXPR improved. Changed handling for INIT_EXPR.

gcc/testsuite/
    * c-c++-common/cilk-plus/AN/pr61455.c: New test.
    * c-c++-common/cilk-plus/AN/pr61455-2.c: Likewise.


Added:
    trunk/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455-2.c
    trunk/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455.c
Modified:
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/array-notation-common.c
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-array-notation.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-array-notation.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/61455] Internal compiler error, and other confused errors, when using array notation
  2014-06-09 10:43 [Bug middle-end/61455] New: Internal compiler error, and other confused errors, when using array notation nick.tomlinson at arm dot com
                   ` (2 preceding siblings ...)
  2014-08-01 16:55 ` kyukhin at gcc dot gnu.org
@ 2014-08-01 17:01 ` kyukhin at gcc dot gnu.org
  2014-08-04 11:42 ` nick.tomlinson at arm dot com
  4 siblings, 0 replies; 6+ messages in thread
From: kyukhin at gcc dot gnu.org @ 2014-08-01 17:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Kirill Yukhin <kyukhin at gcc dot gnu.org> ---
Author: kyukhin
Date: Fri Aug  1 17:00:51 2014
New Revision: 213492

URL: https://gcc.gnu.org/viewcvs?rev=213492&root=gcc&view=rev
Log:
    PR middle-end/61455

gcc/c-family/
    * array-notation-common.c (extract_array_notation_exprs): Handling
    of DECL_EXPR added.

gcc/c/
    * c-array-notation.c (expand_array_notations): Handling
    of DECL_EXPR added.

gcc/cp/
    * cp-array-notation.c (expand_array_notation_exprs): Handling of
    DECL_EXPR improved. Changed handling for INIT_EXPR.

gcc/testsuite/
    * c-c++-common/cilk-plus/AN/pr61455.c: New test.
    * c-c++-common/cilk-plus/AN/pr61455-2.c: Likewise.


Added:
    branches/gcc-4_9-branch/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455-2.c
    branches/gcc-4_9-branch/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455.c
Modified:
    branches/gcc-4_9-branch/gcc/c-family/ChangeLog
    branches/gcc-4_9-branch/gcc/c-family/array-notation-common.c
    branches/gcc-4_9-branch/gcc/c/ChangeLog
    branches/gcc-4_9-branch/gcc/c/c-array-notation.c
    branches/gcc-4_9-branch/gcc/cp/ChangeLog
    branches/gcc-4_9-branch/gcc/cp/cp-array-notation.c
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/61455] Internal compiler error, and other confused errors, when using array notation
  2014-06-09 10:43 [Bug middle-end/61455] New: Internal compiler error, and other confused errors, when using array notation nick.tomlinson at arm dot com
                   ` (3 preceding siblings ...)
  2014-08-01 17:01 ` kyukhin at gcc dot gnu.org
@ 2014-08-04 11:42 ` nick.tomlinson at arm dot com
  4 siblings, 0 replies; 6+ messages in thread
From: nick.tomlinson at arm dot com @ 2014-08-04 11:42 UTC (permalink / raw)
  To: gcc-bugs

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

Nick Tomlinson <nick.tomlinson at arm dot com> changed:

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

--- Comment #5 from Nick Tomlinson <nick.tomlinson at arm dot com> ---
I built GCC r213543 this morning, and have found that the code in the minimal
reproducer no longer produces an ICE - good work! :D - Thanks.


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

end of thread, other threads:[~2014-08-04 11:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-09 10:43 [Bug middle-end/61455] New: Internal compiler error, and other confused errors, when using array notation nick.tomlinson at arm dot com
2014-06-09 12:28 ` [Bug c++/61455] " jgreenhalgh at gcc dot gnu.org
2014-06-09 16:51 ` ktkachov at gcc dot gnu.org
2014-08-01 16:55 ` kyukhin at gcc dot gnu.org
2014-08-01 17:01 ` kyukhin at gcc dot gnu.org
2014-08-04 11:42 ` nick.tomlinson at arm dot com

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