[Bug lto/60635] New: ICE when mixing C and Fortran lto1: error: use operand missing for stmt

vladimir.fuka at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Mar 24 15:23:00 GMT 2014


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

            Bug ID: 60635
           Summary: ICE when mixing C and Fortran lto1: error: use operand
                    missing for stmt
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vladimir.fuka at gmail dot com

The code is quite possibly non-standard or totally buggy, but prints the
expected answer without -flto.


bigend.c:

#include <stdint.h>
#include <stdbool.h>

static bool littleendian=true;

uint16_t bigendc16(union{uint16_t * n;uint8_t* b;}x){

  if (!littleendian) return *x.n;

  uint16_t res = ((uint16_t)(x.b[1])<<0) |
                 ((uint16_t)(x.b[0])<<8);
  return res;
}


testbigend.f90:

program test
  use iso_fortran_env

  interface
    integer(int16) function bigendc16(x) bind(C)
      import
      integer(int16), intent(in) :: x
    end function
  end interface

  integer(int16) :: x16 = 12345
  x16 = bigendc16(x16)
  print *,x16
end program







> gfortran-4.9 bigend.c testbigend.f90 -Ofast -flto

In function 'bigendc16.constprop':
lto1: error: use operand missing for stmt
_13
# .MEM_15 = VDEF <.MEM_14(D)>
x = VIEW_CONVERT_EXPR<union 
{
  uint16_t * n;
  uint8_t * b;
}>(_13);
lto1: internal compiler error: verify_ssa failed
0xad59db verify_ssa(bool)
 ../../gcc-svn/gcc/tree-ssa.c:1096
0x88530c execute_function_todo
 ../../gcc-svn/gcc/passes.c:1854
0x885c33 execute_todo
 ../../gcc-svn/gcc/passes.c:1887
0x887ac1 execute_one_ipa_transform_pass
 ../../gcc-svn/gcc/passes.c:2076
0x887ac1 execute_all_ipa_transforms()
 ../../gcc-svn/gcc/passes.c:2107
0x887c51 apply_ipa_transforms
 ../../gcc-svn/gcc/passes.c:2121
0x885af1 do_per_function
 ../../gcc-svn/gcc/passes.c:1583
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: gfortran-4.9 returned 1 exit status
/usr/bin/ld: lto-wrapper failed
collect2: error: ld returned 1 exit status



More information about the Gcc-bugs mailing list