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

            Bug ID: 69677
           Summary: [6 Regression] bootstrap failed with
                    --with-arch=corei7 --with-cpu=corei7
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: jakub at redhat dot com
  Target Milestone: ---

On ia32, r233128 failed to bootstrap when configured with

--with-arch=corei7 --with-cpu=corei7 --prefix=/usr/6.0.0 --enable-clocale=gnu
--with-system-zlib --enable-shared --with-demangler-in-ld --enable-libmpx
i686-linux --with-fpmath=sse --enable-languages=c,c++,fortran,java,lto,objc

https://gcc.gnu.org/ml/gcc-regression/2016-02/msg00068.html

[hjl@gnu-skl-1 gcc]$ cat /tmp/x.i
typedef int DItype __attribute__ ((mode (DI)));
typedef int SItype __attribute__ ((mode (SI)));
typedef unsigned int USItype __attribute__ ((mode (SI)));
struct DWstruct {SItype low, high;};
typedef union
{
  struct DWstruct s;
  DItype ll;
} DWunion;
DItype
__negdi2 (DItype u)
{
  const DWunion uu = {.ll = u};
  const DWunion w = { {.low = -uu.s.low,
         .high = -uu.s.high - ((USItype) -uu.s.low > 0) } };

  return w.ll;
}
[hjl@gnu-skl-1 gcc]$ ./xgcc -B./ -S -O2 /tmp/x.i
/tmp/x.i: In function ‘__negdi2’:
/tmp/x.i:18:1: internal compiler error: Segmentation fault
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[hjl@gnu-skl-1 gcc]$ 

(gdb) bt
#0  0x086ffe63 in val_signbit_p(machine_mode, unsigned long long) ()
#1  0x08d73438 in combine_simplify_rtx(rtx_def*, machine_mode, int, int) ()
#2  0x08d750ad in subst(rtx_def*, rtx_def*, rtx_def*, int, int, int) ()
#3  0x08d74e1f in subst(rtx_def*, rtx_def*, rtx_def*, int, int, int) ()
#4  0x08d76327 in try_combine(rtx_insn*, rtx_insn*, rtx_insn*, rtx_insn*, int*,
rtx_insn*) ()
#5  0x08d7c4b1 in (anonymous namespace)::pass_combine::execute(function*) ()
#6  0x08662051 in execute_one_pass(opt_pass*) ()
#7  0x08662669 in execute_pass_list_1(opt_pass*) ()
#8  0x0866267c in execute_pass_list_1(opt_pass*) ()
#9  0x086626c9 in execute_pass_list(function*, opt_pass*) ()
#10 0x08358b33 in cgraph_node::expand() ()
#11 0x0835a3e4 in symbol_table::compile() [clone .part.51] ()
#12 0x0835c73f in symbol_table::finalize_compilation_unit() ()
#13 0x0872b897 in compile_file() ()
#14 0x081d6871 in toplev::main(int, char**) ()
#15 0x081d8911 in main ()
(gdb) disass
Dump of assembler code for function _Z13val_signbit_p12machine_modey:
   0x086ffe10 <+0>:     push   %ebx
   0x086ffe11 <+1>:     xor    %eax,%eax
   0x086ffe13 <+3>:     sub    $0x10,%esp
   0x086ffe16 <+6>:     mov    0x18(%esp),%edx
   0x086ffe1a <+10>:    mov    0x1c(%esp),%ecx
   0x086ffe1e <+14>:    mov    0x20(%esp),%ebx
   0x086ffe22 <+18>:    cmpb   $0x2,0x8f99440(%edx)
   0x086ffe29 <+25>:    mov    %ecx,(%esp)
   0x086ffe2c <+28>:    mov    %ebx,0x4(%esp)
   0x086ffe30 <+32>:    je     0x86ffe40 <_Z13val_signbit_p12machine_modey+48>
   0x086ffe32 <+34>:    add    $0x10,%esp
   0x086ffe35 <+37>:    pop    %ebx
   0x086ffe36 <+38>:    ret    
   0x086ffe37 <+39>:    mov    %esi,%esi
   0x086ffe39 <+41>:    lea    0x0(%edi,%eiz,1),%edi
   0x086ffe40 <+48>:    movzwl 0x8f99360(%edx,%edx,1),%ecx
   0x086ffe48 <+56>:    sub    $0x1,%ecx
   0x086ffe4b <+59>:    cmp    $0x3f,%ecx
   0x086ffe4e <+62>:    ja     0x86ffe32 <_Z13val_signbit_p12machine_modey+34>
   0x086ffe50 <+64>:    movq   0x8f98ea0(,%edx,8),%xmm0
   0x086ffe59 <+73>:    xor    %eax,%eax
   0x086ffe5b <+75>:    xor    %edx,%edx
---Type <return> to continue, or q <return> to quit---
   0x086ffe5d <+77>:    test   $0x20,%cl
   0x086ffe60 <+80>:    sete   %al
=> 0x086ffe63 <+83>:    movdqa (%esp),%xmm2
   0x086ffe68 <+88>:    setne  %dl
   0x086ffe6b <+91>:    shl    %cl,%eax
   0x086ffe6d <+93>:    shl    %cl,%edx
   0x086ffe6f <+95>:    pand   %xmm0,%xmm2
   0x086ffe73 <+99>:    movd   %eax,%xmm0
   0x086ffe77 <+103>:   pinsrd $0x1,%edx,%xmm0
   0x086ffe7d <+109>:   pxor   %xmm2,%xmm0
   0x086ffe81 <+113>:   punpcklqdq %xmm0,%xmm0
   0x086ffe85 <+117>:   ptest  %xmm0,%xmm0
   0x086ffe8a <+122>:   sete   %al
   0x086ffe8d <+125>:   add    $0x10,%esp
   0x086ffe90 <+128>:   pop    %ebx
   0x086ffe91 <+129>:   ret    
End of assembler dump.
(gdb) p $esp
$1 = (void *) 0xffffcb68
(gdb)

Reply via email to