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

             Bug #: 55660
           Summary: ICE instead of some warning during lto build
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: vbyakov...@gmail.com


LTO compilation fails in the link time if o-files created with -funsigned-char
but linking without.
R174519 is the first commit when it was appeared.


$ cat t_f.c 
char n[3] = {'a','b','c'};
int foo(char *x)
{
  if (*x == 'y')
    return (int)*x;
  *x = 'y';
  return 0;
}

$ cat t_m.c
#include <stdio.h>

extern int foo (char*);

extern char n[3];

int main ()
{
  int i, m = 0;
  for (i = 0; i < 3; i++)
    m += foo(&n[i]);

  printf("%d\n", m);
}

$ gcc -c -m32 -O2  -flto t_f.c t_m.c -funsigned-char ; gcc -m32  -O2  -flto
t_f.o t_m.o  -o t0                                                              
In file included from :0:0:
t_m.c: In function a€?maina€™:
t_m.c:7:5: error: mismatching comparison operand types
 int main ()
     ^
char
unsigned char
if (_14 == 121)

t_m.c:7:5: internal compiler error: verify_gimple failed
0x98ab8b verify_gimple_in_cfg(function*)
        ../../gcc/gcc/tree-cfg.c:4728
0x8794d0 execute_function_todo
        ../../gcc/gcc/passes.c:1973
0x8787e9 do_per_function
        ../../gcc/gcc/passes.c:1705
0x8795f4 execute_todo
        ../../gcc/gcc/passes.c:2006
0x879a5e execute_one_ipa_transform_pass
        ../../gcc/gcc/passes.c:2183
0x879b42 execute_all_ipa_transforms()
        ../../gcc/gcc/passes.c:2213
0x5ae627 expand_function
        ../../gcc/gcc/cgraphunit.c:1615
0x5aeb00 expand_all_functions
        ../../gcc/gcc/cgraphunit.c:1726
0x5af58a compile()
        ../../gcc/gcc/cgraphunit.c:2024
0x512f39 lto_main()
        ../../gcc/gcc/lto/lto.c:3399
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.
lto-wrapper: gcc returned 1 exit status
/bin/ld: lto-wrapper failed
collect2: error: ld returned 1 exit status

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/export/users/vbyakovl/workspaces/gcc/install-ref/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure CFLAGS='-O0 -g3'
--prefix=/export/users/vbyakovl/workspaces/gcc/install-ref --disable-bootstrap
--enable-languages=c,c++,fortran,lto CXXFLAGS='-O0 -g3' 
Thread model: posix
gcc version 4.8.0 20121105 (experimental) (GCC)

Reply via email to