public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/55525] New: ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768
@ 2012-11-29  2:53 d.g.gorbachev at gmail dot com
  2012-11-29  2:55 ` [Bug lto/55525] " d.g.gorbachev at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2012-11-29  2:53 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55525

             Bug #: 55525
           Summary: ICE: tree check: expected array_type, have
                    pointer_type in array_ref_low_bound, at expr.c:6768
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: d.g.gorbachev@gmail.com


Created attachment 28826
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28826
Testcase

Compile with `gcc -flto 1.c 2.c'.


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

* [Bug lto/55525] ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768
  2012-11-29  2:53 [Bug lto/55525] New: ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768 d.g.gorbachev at gmail dot com
@ 2012-11-29  2:55 ` d.g.gorbachev at gmail dot com
  2012-11-29  3:07 ` d.g.gorbachev at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2012-11-29  2:55 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55525

Dmitry Gorbachev <d.g.gorbachev at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #28826|application/octet-stream    |text/plain
          mime type|                            |

--- Comment #1 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2012-11-29 02:55:03 UTC ---
Comment on attachment 28826
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28826
Testcase

4.6.4 and 4.7.3:
internal compiler error: in substitute_placeholder_in_expr, at tree.c:3418

4.6.4 (with checking):
internal compiler error: tree check: expected array_type, have pointer_type in
array_ref_low_bound, at expr.c:6410

4.7.3 (with checking):
internal compiler error: tree check: expected array_type, have pointer_type in
array_ref_low_bound, at expr.c:6820


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

* [Bug lto/55525] ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768
  2012-11-29  2:53 [Bug lto/55525] New: ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768 d.g.gorbachev at gmail dot com
  2012-11-29  2:55 ` [Bug lto/55525] " d.g.gorbachev at gmail dot com
@ 2012-11-29  3:07 ` d.g.gorbachev at gmail dot com
  2012-11-29  8:53 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2012-11-29  3:07 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55525

--- Comment #2 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2012-11-29 03:07:21 UTC ---
4.8.0:

In file included from :0:0:
1.c:3:6: warning: type of 's' does not match original declaration [enabled by
default]
 char s[8];
      ^
In file included from 1.c:8:0,
                 from :0:
2.c:1:7: note: previously declared here
 char *s = (char *) 0;
       ^
In file included from 1.c:8:0,
                 from :2:
1.c: In function 'main':
1.c:7:3: internal compiler error: tree check: expected array_type, have
pointer_type in array_ref_low_bound, at expr.c:6768
   return strcmp(&s[1], "foo");
   ^
0x87f7ab4 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
    ../../gcc-4.8/gcc/tree.c:8955
0x815572e tree_check(tree_node*, char const*, int, char const*, tree_code)
    ../../gcc-4.8/gcc/tree.h:3680
0x82c5aec array_ref_low_bound(tree_node*)
    ../../gcc-4.8/gcc/expr.c:6768
0x82c5118 get_inner_reference(tree_node*, long long*, long long*, tree_node**,
machine_mode*, int*, int*, bool)
    ../../gcc-4.8/gcc/expr.c:6616
0x817d9d4 get_object_alignment_2
    ../../gcc-4.8/gcc/builtins.c:295
0x817e46a get_pointer_alignment_1(tree_node*, unsigned int*, unsigned long
long*)
    ../../gcc-4.8/gcc/builtins.c:493
0x817e6e0 get_pointer_alignment(tree_node*)
    ../../gcc-4.8/gcc/builtins.c:540
0x8187fd8 expand_builtin_strcmp
    ../../gcc-4.8/gcc/builtins.c:3768
0x818f7d8 expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
    ../../gcc-4.8/gcc/builtins.c:6193
0x82d407d expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**)
    ../../gcc-4.8/gcc/expr.c:10108
0x82c96a3 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**)
    ../../gcc-4.8/gcc/expr.c:7816
0x82beec7 store_expr(tree_node*, rtx_def*, int, bool)
    ../../gcc-4.8/gcc/expr.c:5192
0x82bdd8f expand_assignment(tree_node*, tree_node*, bool)
    ../../gcc-4.8/gcc/expr.c:4978
0x81d275a expand_call_stmt
    ../../gcc-4.8/gcc/cfgexpand.c:2113
0x81d2851 expand_gimple_stmt_1
    ../../gcc-4.8/gcc/cfgexpand.c:2153
0x81d2e99 expand_gimple_stmt
    ../../gcc-4.8/gcc/cfgexpand.c:2305
0x81d9a28 expand_gimple_basic_block
    ../../gcc-4.8/gcc/cfgexpand.c:4084
0x81db331 gimple_expand_cfg
    ../../gcc-4.8/gcc/cfgexpand.c:4603


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

* [Bug lto/55525] ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768
  2012-11-29  2:53 [Bug lto/55525] New: ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768 d.g.gorbachev at gmail dot com
  2012-11-29  2:55 ` [Bug lto/55525] " d.g.gorbachev at gmail dot com
  2012-11-29  3:07 ` d.g.gorbachev at gmail dot com
@ 2012-11-29  8:53 ` rguenth at gcc dot gnu.org
  2012-12-05  8:48 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-11-29  8:53 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55525

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-11-29
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> 2012-11-29 08:53:09 UTC ---
Mine.

I suppose we could simply error out for the mismatch.  The issue here is of
course that we simply substitute the prevailing declaration into expressions
that expect the mismatching type.

Let me think a bit more about this.


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

* [Bug lto/55525] ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768
  2012-11-29  2:53 [Bug lto/55525] New: ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768 d.g.gorbachev at gmail dot com
                   ` (2 preceding siblings ...)
  2012-11-29  8:53 ` rguenth at gcc dot gnu.org
@ 2012-12-05  8:48 ` rguenth at gcc dot gnu.org
  2012-12-05  9:33 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-05  8:48 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55525

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-05 08:47:45 UTC ---
Author: rguenth
Date: Wed Dec  5 08:47:40 2012
New Revision: 194183

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194183
Log:
2012-12-05  Richard Biener  <rguenther@suse.de>

    PR lto/55525
    * gimple-streamer-in.c (input_gimple_stmt): Fixup ARRAY_REFs as well.

    * gcc.dg/lto/pr55525_0.c: New testcase.
    * gcc.dg/lto/pr55525_1.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/lto/pr55525_0.c
    trunk/gcc/testsuite/gcc.dg/lto/pr55525_1.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimple-streamer-in.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug lto/55525] ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768
  2012-11-29  2:53 [Bug lto/55525] New: ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768 d.g.gorbachev at gmail dot com
                   ` (3 preceding siblings ...)
  2012-12-05  8:48 ` rguenth at gcc dot gnu.org
@ 2012-12-05  9:33 ` rguenth at gcc dot gnu.org
  2013-01-07 14:48 ` ro at gcc dot gnu.org
  2013-01-07 14:56 ` rguenther at suse dot de
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-05  9:33 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55525

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.8.0

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-05 09:32:46 UTC ---
Fixed on trunk.


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

* [Bug lto/55525] ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768
  2012-11-29  2:53 [Bug lto/55525] New: ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768 d.g.gorbachev at gmail dot com
                   ` (4 preceding siblings ...)
  2012-12-05  9:33 ` rguenth at gcc dot gnu.org
@ 2013-01-07 14:48 ` ro at gcc dot gnu.org
  2013-01-07 14:56 ` rguenther at suse dot de
  6 siblings, 0 replies; 8+ messages in thread
From: ro at gcc dot gnu.org @ 2013-01-07 14:48 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55525

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ro at gcc dot gnu.org

--- Comment #6 from Rainer Orth <ro at gcc dot gnu.org> 2013-01-07 14:47:53 UTC ---
Unfortunately, the testcase fails for 32-bit on Solaris with Sun ld:

ld: fatal: symbol 's' has differing sizes:
        (file c_lto_pr55525_0.o value=0x8; file c_lto_pr55525_1.o value=0x4);
        tentative symbol cannot override defined symbol of smaller size
ld: fatal: file processing errors. No output written to
gcc-dg-lto-pr55525-01.ex
e
collect2: error: ld returned 1 exit status

  Rainer


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

* [Bug lto/55525] ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768
  2012-11-29  2:53 [Bug lto/55525] New: ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768 d.g.gorbachev at gmail dot com
                   ` (5 preceding siblings ...)
  2013-01-07 14:48 ` ro at gcc dot gnu.org
@ 2013-01-07 14:56 ` rguenther at suse dot de
  6 siblings, 0 replies; 8+ messages in thread
From: rguenther at suse dot de @ 2013-01-07 14:56 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55525

--- Comment #7 from rguenther at suse dot de <rguenther at suse dot de> 2013-01-07 14:55:31 UTC ---
On Mon, 7 Jan 2013, ro at gcc dot gnu.org wrote:

> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55525
> 
> Rainer Orth <ro at gcc dot gnu.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |ro at gcc dot gnu.org
> 
> --- Comment #6 from Rainer Orth <ro at gcc dot gnu.org> 2013-01-07 14:47:53 UTC ---
> Unfortunately, the testcase fails for 32-bit on Solaris with Sun ld:
> 
> ld: fatal: symbol 's' has differing sizes:
>         (file c_lto_pr55525_0.o value=0x8; file c_lto_pr55525_1.o value=0x4);
>         tentative symbol cannot override defined symbol of smaller size
> ld: fatal: file processing errors. No output written to
> gcc-dg-lto-pr55525-01.ex
> e
> collect2: error: ld returned 1 exit status

Does it work with replacing char s[8] with char s[sizeof (char *)]?

If so, patch is ok.

Richard.


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

end of thread, other threads:[~2013-01-07 14:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-29  2:53 [Bug lto/55525] New: ICE: tree check: expected array_type, have pointer_type in array_ref_low_bound, at expr.c:6768 d.g.gorbachev at gmail dot com
2012-11-29  2:55 ` [Bug lto/55525] " d.g.gorbachev at gmail dot com
2012-11-29  3:07 ` d.g.gorbachev at gmail dot com
2012-11-29  8:53 ` rguenth at gcc dot gnu.org
2012-12-05  8:48 ` rguenth at gcc dot gnu.org
2012-12-05  9:33 ` rguenth at gcc dot gnu.org
2013-01-07 14:48 ` ro at gcc dot gnu.org
2013-01-07 14:56 ` rguenther at suse dot de

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