============== 1.c ==============
extern void f(void);
const char *s = "Hello, world!";

int main(void)
{
  f();
  return 0;
}
============== 2.c ==============
extern int puts(const char *);
extern const char s[];

void f(void)
{
  puts(s);
}
=================================
When compiling with `gcc -flto 1.c 2.c', it causes ICE:

2.c:2:19: warning: type of 's' does not match original declaration
1.c:2:13: note: previously declared here
In file included from 2.c:2:0,
                 from 1.c:2,
                 from :0:
2.c: In function 'f':
2.c:6:7: internal compiler error: tree check: expected array_type, have
pointer_type in array_ref_low_bound, at expr.c:6207

No ICE with `-combine' instead of `-flto':

2.c:2:19: error: conflicting types for 's'
1.c:2:13: note: previous definition of 's' was here


-- 
           Summary: [LTO] tree check: expected array_type, have pointer_type
                    in array_ref_low_bound
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: d dot g dot gorbachev at gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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

Reply via email to