[Bug rtl-optimization/55247] [4.8 Regression] internal compiler error: Max. number of generated reload insns per insn is achieved (90)

2012-11-09 Thread hjl.tools at gmail dot com


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



--- Comment #3 from H.J. Lu hjl.tools at gmail dot com 2012-11-10 01:32:06 
UTC ---

There are 2 issues here:



1. Should we use



movdqu(%eax), %xmm0# 19*movti_internal_rex64/4[length = 5]

movdqa%xmm0, (%rsp)# 29*movti_internal_rex64/5[length = 5]



to copy 16 bytes?



2. Should we split *movti_internal_rex64 if -mno-sse is used?


[Bug rtl-optimization/55247] [4.8 Regression] internal compiler error: Max. number of generated reload insns per insn is achieved (90)

2012-11-09 Thread hjl.tools at gmail dot com


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



--- Comment #4 from H.J. Lu hjl.tools at gmail dot com 2012-11-10 01:39:16 
UTC ---

We don't properly handle memory operand in



(insn 19 17 20 2 (set (reg:TI 85 [ *_15 ])

(mem:TI (zero_extend:DI (reg:SI 82)) [0 *_15+0 S16 A32])) x.i:29 61

{*movti_internal_rex64}

 (expr_list:REG_DEAD (reg:SI 82) 

(expr_list:REG_EQUIV (mem/c:TI (plus:DI (reg/f:DI 20 frame)

(const_int -16 [0xfff0])) [0 sym+0 S16 A64])


[Bug rtl-optimization/55247] [4.8 Regression] internal compiler error: Max. number of generated reload insns per insn is achieved (90)

2012-11-09 Thread hjl.tools at gmail dot com


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



--- Comment #5 from H.J. Lu hjl.tools at gmail dot com 2012-11-10 01:58:31 
UTC ---

We fail to see (mem:TI (zero_extend:DI (reg:SI 82))) is offsettable.


[Bug target/55258] New: SSE register isn't used for 16byte copy

2012-11-09 Thread hjl.tools at gmail dot com


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



 Bug #: 55258

   Summary: SSE register isn't used for 16byte copy

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: target

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com

CC: ubiz...@gmail.com





[hjl@gnu-tools-1 pr55247]$ cat x.i 

typedef unsigned int uint32_t;

typedef uint32_t Elf32_Word;

typedef uint32_t Elf32_Addr;

typedef struct {

  Elf32_Word st_name;

  Elf32_Addr st_value;

  Elf32_Word st_size;

  unsigned char st_other;

} Elf32_Sym;

typedef struct {

  Elf32_Word r_info;

}

Elf32_Rela;

typedef struct {

  union {

Elf32_Addr d_ptr;

  }

  d_un;

} Elf32_Dyn;

struct link_map   {

  Elf32_Dyn *l_info[34];

};

extern void symbind32 (Elf32_Sym *);

void

_dl_profile_fixup (struct link_map *l, Elf32_Word reloc_arg)

{

  const Elf32_Sym *const symtab  = (const void *) l-l_info[6]-d_un.d_ptr;

  const Elf32_Rela *const reloc  = (const void *) (l-l_info[23]-d_un.d_ptr +

reloc_arg * sizeof (Elf32_Rela));

  Elf32_Sym sym = symtab[(reloc-r_info)  8];

  symbind32 (sym);

}

[hjl@gnu-tools-1 pr55247]$ /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc

-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O -Wall -mx32

-maddress-mode=short  -S x.i -o short.asm

[hjl@gnu-tools-1 pr55247]$ cat short.asm 

.filex.i

.text

.globl_dl_profile_fixup

.type_dl_profile_fixup, @function

_dl_profile_fixup:

.LFB0:

.cfi_startproc

subl$24, %esp

.cfi_def_cfa_offset 32

movl24(%edi), %edx

movl92(%edi), %eax

movl(%eax), %eax

movl(%eax,%esi,4), %eax

shrl$8, %eax

sall$4, %eax

addl(%edx), %eax

movq8(%eax), %rdx

movq(%eax), %rax

movq%rax, (%esp)

movq%rdx, 8(%esp)

movl%esp, %edi

callsymbind32

addl$24, %esp

.cfi_def_cfa_offset 8

ret

.cfi_endproc

.LFE0:

.size_dl_profile_fixup, .-_dl_profile_fixup

.identGCC: (GNU) 4.8.0 20121110 (experimental)

.section.note.GNU-stack,,@progbits

[hjl@gnu-tools-1 pr55247]$ /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc

-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O -Wall -mx32

-maddress-mode=long  -S x.i -o long.asm

[hjl@gnu-tools-1 pr55247]$ cat long.asm 

.filex.i

.text

.globl_dl_profile_fixup

.type_dl_profile_fixup, @function

_dl_profile_fixup:

.LFB0:

.cfi_startproc

subq$40, %rsp

.cfi_def_cfa_offset 48

movl24(%rdi), %edx

movl92(%rdi), %eax

movl(%rax), %eax

movl(%eax,%esi,4), %eax

shrl$8, %eax

sall$4, %eax

addl(%rdx), %eax

movdqu(%eax), %xmm0

movdqa%xmm0, (%rsp)

movq(%rsp), %rax

movq8(%rsp), %rdx

movq%rax, 16(%rsp)

movq%rdx, 24(%rsp)

leaq16(%rsp), %rdi

callsymbind32

addq$40, %rsp

.cfi_def_cfa_offset 8

ret

.cfi_endproc

.LFE0:

.size_dl_profile_fixup, .-_dl_profile_fixup

.identGCC: (GNU) 4.8.0 20121110 (experimental)

.section.note.GNU-stack,,@progbits

[hjl@gnu-tools-1 pr55247]$ 



For TARGET_SSE_UNALIGNED_LOAD_OPTIMAL/TARGET_SSE_UNALIGNED_STORE_OPTIMAL,

we should always generate



movdqu(%eax), %xmm0

movdqa%xmm0, (%rsp)


[Bug rtl-optimization/55247] [4.8 Regression] internal compiler error: Max. number of generated reload insns per insn is achieved (90)

2012-11-09 Thread hjl.tools at gmail dot com


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



--- Comment #6 from H.J. Lu hjl.tools at gmail dot com 2012-11-10 02:30:16 
UTC ---

Something like this:



diff --git a/gcc/explow.c b/gcc/explow.c

index 6109832..9ec38f9 100644

--- a/gcc/explow.c

+++ b/gcc/explow.c

@@ -84,12 +84,22 @@ plus_constant (enum machine_mode mode, rtx x, HOST_WIDE_INT 

c)

   rtx y;

   rtx tem;

   int all_constant = 0;

+  enum machine_mode zero_extend_mode;



   gcc_assert (GET_MODE (x) == VOIDmode || GET_MODE (x) == mode);



   if (c == 0)

 return x;



+  if (GET_CODE (x) == ZERO_EXTEND)

+{

+  zero_extend_mode = GET_MODE (x);

+  x = XEXP (x, 0);

+  mode = GET_MODE (x);

+}

+  else

+zero_extend_mode = VOIDmode;

+

  restart:



   code = GET_CODE (x);

@@ -195,7 +205,11 @@ plus_constant (enum machine_mode mode, rtx x,

HOST_WIDE_INT

 c)

   else if (all_constant)

 return gen_rtx_CONST (mode, x);

   else

-return x;

+{

+  if (zero_extend_mode != VOIDmode)

+x = gen_rtx_ZERO_EXTEND (zero_extend_mode, x);

+  return x;

+}

 }

 ^L

 /* If X is a sum, return a new sum like X but lacking any constant terms.

diff --git a/gcc/recog.c b/gcc/recog.c

index ee68e30..d3dd591 100644

--- a/gcc/recog.c

+++ b/gcc/recog.c

@@ -1934,15 +1934,21 @@ int

 offsettable_address_addr_space_p (int strictp, enum machine_mode mode, rtx y,

   addr_space_t as)

 {

-  enum rtx_code ycode = GET_CODE (y);

+  enum rtx_code ycode;

   rtx z;

-  rtx y1 = y;

+  rtx y1;

   rtx *y2;

   int (*addressp) (enum machine_mode, rtx, addr_space_t) =

 (strictp ? strict_memory_address_addr_space_p

  : memory_address_addr_space_p);

   unsigned int mode_sz = GET_MODE_SIZE (mode);



+  if (GET_CODE (y) == ZERO_EXTEND)

+y = XEXP (y, 0);

+

+  ycode = GET_CODE (y);

+  y1 = y;

+

   if (CONSTANT_ADDRESS_P (y))

 return 1;


[Bug middle-end/55259] New: plus_constant doesn't handle zero-extended address properly

2012-11-09 Thread hjl.tools at gmail dot com


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



 Bug #: 55259

   Summary: plus_constant doesn't handle zero-extended address

properly

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: middle-end

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com





For address,



#0  plus_constant (mode=SImode, x=0x70fadf40, c=8)

at /export/gnu/import/git/gcc/gcc/explow.c:211

#1  0x006f9b04 in adjust_address_1 (memref=0x70fff2e8, 

mode=DImode, offset=8, validate=1, adjust_address=1, adjust_object=0)

at /export/gnu/import/git/gcc/gcc/emit-rtl.c:2113

#2  0x00cdd259 in split_double_mode (mode=TImode, 

operands=0x7fffd828, num=0, lo_half=0x7fffd8f0, 

hi_half=0x7fffd8f8)

at /export/gnu/import/git/gcc/gcc/config/i386/i386.c:14721

#3  0x00ceafe7 in ix86_split_to_parts (operand=0x70fff2e8, 

parts=0x7fffd8f0, mode=TImode)

at /export/gnu/import/git/gcc/gcc/config/i386/i386.c:20695

#4  0x00ceb4ad in ix86_split_long_move (

operands=0x17a5fa0 recog_data)

at /export/gnu/import/git/gcc/gcc/config/i386/i386.c:20794



Breakpoint 2, plus_constant (mode=DImode, x=0x70fadf30, c=8)

at /export/gnu/import/git/gcc/gcc/explow.c:96

96  zero_extend_mode = GET_MODE (x);

(gdb) call debug_rtx (x)

(zero_extend:DI (reg:SI 0 ax [82]))

(gdb) 



it should generate



(gdb) call debug_rtx (x)

(zero_extend:DI (plus:SI (reg:SI 0 ax [82])

(const_int 8 [0x8])))

(gdb)



Instead, plus_constant generates



(gdb) call debug_rtx (addr)

(plus:DI (zero_extend:DI (reg:SI 0 ax [82]))

(const_int 8 [0x8]))


[Bug middle-end/55259] plus_constant doesn't handle zero-extended address properly

2012-11-09 Thread hjl.tools at gmail dot com


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



--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2012-11-10 04:13:32 
UTC ---

A potential fix:



diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c

index 95bbfa7..d7c454c 100644

--- a/gcc/emit-rtl.c

+++ b/gcc/emit-rtl.c

@@ -2109,6 +2109,12 @@ adjust_address_1 (rtx memref, enum machine_mode mode,

HOS

T_WIDE_INT offset,

 addr = gen_rtx_LO_SUM (address_mode, XEXP (addr, 0),

plus_constant (address_mode,

   XEXP (addr, 1), offset));

+  else if (GET_CODE (addr) == ZERO_EXTEND)

+{

+  addr = XEXP (addr, 0);

+  addr = plus_constant (GET_MODE (addr), addr, offset);

+  addr = gen_rtx_ZERO_EXTEND (address_mode, addr);

+}

   else

 addr = plus_constant (address_mode, addr, offset);

 }


[Bug target/55258] SSE register isn't used for 16byte copy

2012-11-10 Thread hjl.tools at gmail dot com


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



--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2012-11-10 08:52:22 
UTC ---

Created attachment 28651

  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=28651

Something like this


[Bug rtl-optimization/55247] [4.8 Regression] internal compiler error: Max. number of generated reload insns per insn is achieved (90)

2012-11-10 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|NEW |UNCONFIRMED

  Component|middle-end  |rtl-optimization

 Depends on||55259

 Ever Confirmed|1   |0



--- Comment #12 from H.J. Lu hjl.tools at gmail dot com 2012-11-10 19:02:04 
UTC ---

(In reply to comment #11)

 ~/gcc-build/gcc/cc1 -O2 -mx32 -maddress-mode=long pr55247.c

 

 results in following sequence:

 

 movdqu  (%eax), %xmm0

 movdqa  %xmm0, (%rsp)

 movq(%rsp), %rax

 movq8(%rsp), %rdx

 movq%rax, 16(%rsp)

 movq%rdx, 24(%rsp)

 

 while -maddress=mode=short produces expected code:

 

 movq8(%eax), %rdx

 movq(%eax), %rax

 movq%rdx, 8(%esp)

 movq%rax, (%esp)



This is related to PR 55259.  This patch:



http://gcc.gnu.org/ml/gcc-patches/2012-11/msg00799.html



fixes it.


[Bug rtl-optimization/55247] [4.8 Regression] internal compiler error: Max. number of generated reload insns per insn is achieved (90)

2012-11-10 Thread hjl.tools at gmail dot com


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



--- Comment #13 from H.J. Lu hjl.tools at gmail dot com 2012-11-10 19:11:03 
UTC ---

(In reply to comment #12)

 (In reply to comment #11)

  ~/gcc-build/gcc/cc1 -O2 -mx32 -maddress-mode=long pr55247.c

  

  results in following sequence:

  

  movdqu  (%eax), %xmm0

  movdqa  %xmm0, (%rsp)

  movq(%rsp), %rax

  movq8(%rsp), %rdx

  movq%rax, 16(%rsp)

  movq%rdx, 24(%rsp)

  

  while -maddress=mode=short produces expected code:

  

  movq8(%eax), %rdx

  movq(%eax), %rax

  movq%rdx, 8(%esp)

  movq%rax, (%esp)

 

 This is related to PR 55259.  This patch:

 

 http://gcc.gnu.org/ml/gcc-patches/2012-11/msg00799.html

 

 fixes it.



With this fix, we don't need to change *movti_internal_rex64

since it generates redundant load/store.


[Bug middle-end/55259] plus_constant doesn't handle zero-extended address properly

2012-11-11 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED

   Target Milestone|--- |4.8.0



--- Comment #3 from H.J. Lu hjl.tools at gmail dot com 2012-11-11 23:54:51 
UTC ---

Fixed.


[Bug rtl-optimization/55247] [4.8 Regression] internal compiler error: Max. number of generated reload insns per insn is achieved (90)

2012-11-11 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED



--- Comment #16 from H.J. Lu hjl.tools at gmail dot com 2012-11-11 23:55:38 
UTC ---

Fixed.


[Bug middle-end/55279] New: New pseudo registers aren't supported in CSE

2012-11-11 Thread hjl.tools at gmail dot com


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



 Bug #: 55279

   Summary: New pseudo registers aren't supported in CSE

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: middle-end

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com





Since CSE allocates register table in init_cse_reg_info,

if a pseudo register is created to convert memory address,

we get



==23925== 

==23925== Debugger has detached.  Valgrind regains control.  We continue.

==23925== Invalid write of size 4

==23925==at 0xF813E1: get_cse_reg_info_1(unsigned int) (cse.c:826)

==23925==by 0xF81473: get_cse_reg_info(unsigned int) (cse.c:841)

==23925==by 0xF84792: hash_rtx_cb(rtx_def const*, machine_mode, int*, int*,

bool, int (*)(rtx_def const*, machine_mode, rtx_def**, machine_mode*))

(cse.c:2312)

==23925==by 0xF85097: hash_rtx(rtx_def const*, machine_mode, int*, int*,

bool) (cse.c:2560)

==23925==by 0xF850C7: canon_hash(rtx_def*, machine_mode) (cse.c:2571)

==23925==by 0xF899F7: cse_insn(rtx_def*) (cse.c:4703)

==23925==by 0xF8EA8A: cse_extended_basic_block(cse_basic_block_data*)

(cse.c:6408)

==23925==by 0xF8F024: cse_main(rtx_def*, int) (cse.c:6585)

==23925==by 0xF90D40: rest_of_handle_cse() (cse.c:7435)

==23925==by 0x936857: execute_one_pass(opt_pass*) (passes.c:2337)

==23925==by 0x936ACE: execute_pass_list(opt_pass*) (passes.c:2398)

==23925==by 0x936AFF: execute_pass_list(opt_pass*) (passes.c:2399)

==23925==  Address 0xb7611fc is 12 bytes after a block of size 2,560 alloc'd

==23925==at 0x4A0881C: malloc (vg_replace_malloc.c:270)

==23925==by 0x10E4F74: xmalloc (xmalloc.c:147)

==23925==by 0xF812FF: init_cse_reg_info(unsigned int) (cse.c:793)

==23925==by 0xF8EE57: cse_main(rtx_def*, int) (cse.c:6528)

==23925==by 0xF90D40: rest_of_handle_cse() (cse.c:7435)

==23925==by 0x936857: execute_one_pass(opt_pass*) (passes.c:2337)

==23925==by 0x936ACE: execute_pass_list(opt_pass*) (passes.c:2398)

==23925==by 0x936AFF: execute_pass_list(opt_pass*) (passes.c:2399)

==23925==by 0x666D1D: expand_function(cgraph_node*) (cgraphunit.c:1643)

==23925==by 0x6671D8: expand_all_functions() (cgraphunit.c:1747)

==23925==by 0x667C62: compile() (cgraphunit.c:2045)

==23925==by 0x667DE1: finalize_compilation_unit() (cgraphunit.c:2122)

==23925== 



get_cse_reg_info_1 doesn't check if regno  cse_reg_info_table_size.


[Bug middle-end/55142] [4.8 Regression] internal compiler error: in plus_constant, at explow.c:88

2012-11-11 Thread hjl.tools at gmail dot com


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



--- Comment #32 from H.J. Lu hjl.tools at gmail dot com 2012-11-12 04:08:02 
UTC ---

Can we limit



(zero_extend:DI (plus:SI (FOO:SI) (const_int Y)))



to



(plus:DI (zero_extend:DI (FOO:SI)) (const_int Y))



transformation to Y  TARGET SPECIFIC VALUE? For x86-64,

it is -16*1023*1024.


[Bug middle-end/55279] New pseudo registers aren't supported in CSE

2012-11-11 Thread hjl.tools at gmail dot com


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



--- Comment #2 from H.J. Lu hjl.tools at gmail dot com 2012-11-12 07:25:27 
UTC ---

If we revert the explow.c change:



http://gcc.gnu.org/viewcvs?view=revisionrevision=177592



gcc.dg/Warray-bounds.c will cause valgrind error with



-fno-diagnostics-show-caret -O2 -Warray-bounds -S -mx32 -maddress-mode=long


[Bug rtl-optimization/55290] New: LRA depends on uninitialised values

2012-11-12 Thread hjl.tools at gmail dot com


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



 Bug #: 55290

   Summary: LRA depends on uninitialised values

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: rtl-optimization

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com

CC: vmaka...@redhat.com





[hjl@gnu-tools-1 gcc]$ cat /tmp/z.i

int a[10];



void g(int *p);

void h(int p);



int* f(void) {

int b[10] = { };

struct {

   int c[10];

} c = { { } };



g(a[8]);

g(a[9]);



g(a[0]);

g(b[0]);

g(c.c[0]);



return a;

}

[hjl@gnu-tools-1 gcc]$ valgrind ./cc1 -fpreprocessed /tmp/z.i -quiet -dumpbase

z.i -m64 -mtune=generic -march=x86-64 -auxbase z -O2 -version -o z.s

==5815== Memcheck, a memory error detector

==5815== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.

==5815== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info

==5815== Command: ./cc1 -fpreprocessed /tmp/z.i -quiet -dumpbase z.i -m64

-mtune=generic -march=x86-64 -auxbase z -O2 -version -o z.s

==5815== 

GNU C (GCC) version 4.8.0 20121112 (experimental) (x86_64-unknown-linux-gnu)

compiled by GNU C version 4.7.2 20120921 (Red Hat 4.7.2-2), GMP version

5.0.2, MPFR version 3.1.0, MPC version 0.9

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

GNU C (GCC) version 4.8.0 20121112 (experimental) (x86_64-unknown-linux-gnu)

compiled by GNU C version 4.7.2 20120921 (Red Hat 4.7.2-2), GMP version

5.0.2, MPFR version 3.1.0, MPC version 0.9

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

Compiler executable checksum: 28512814d6c61d240aec0db5bb852766

==5815== Conditional jump or move depends on uninitialised value(s)

==5815==at 0x8A4EA5: sparseset_bit_p(sparseset_def*, unsigned long)

(sparseset.h:147)

==5815==by 0x8A5A18: mark_pseudo_regno_live(int) (ira-lives.c:291)

==5815==by 0x8A5CC7: mark_pseudo_reg_live(rtx_def*, unsigned int)

(ira-lives.c:375)

==5815==by 0x8A5D34: mark_ref_live(df_ref_d*) (ira-lives.c:389)

==5815==by 0x8A849F: process_bb_node_lives(ira_loop_tree_node*)

(ira-lives.c:1322)

==5815==by 0x884217: ira_traverse_loop_tree(bool, ira_loop_tree_node*, void

(*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*)) (ira-build.c:1609)

==5815==by 0x8A90BE: ira_create_allocno_live_ranges() (ira-lives.c:1596)

==5815==by 0x8885FD: ira_build() (ira-build.c:3210)

==5815==by 0x87F5EE: ira(_IO_FILE*) (ira.c:4476)

==5815==by 0x87FB86: rest_of_handle_ira() (ira.c:4710)

==5815==by 0x937D39: execute_one_pass(opt_pass*) (passes.c:2339)

==5815==by 0x937FB0: execute_pass_list(opt_pass*) (passes.c:2400)

==5815== 

==5815== Conditional jump or move depends on uninitialised value(s)

==5815==at 0x8A4EA5: sparseset_bit_p(sparseset_def*, unsigned long)

(sparseset.h:147)

==5815==by 0x8A4F37: sparseset_set_bit(sparseset_def*, unsigned long)

(sparseset.h:166)

==5815==by 0x8A5355: make_object_born(ira_object*) (ira-lives.c:122)

==5815==by 0x8A5A37: mark_pseudo_regno_live(int) (ira-lives.c:295)

==5815==by 0x8A5CC7: mark_pseudo_reg_live(rtx_def*, unsigned int)

(ira-lives.c:375)

==5815==by 0x8A5D34: mark_ref_live(df_ref_d*) (ira-lives.c:389)

==5815==by 0x8A849F: process_bb_node_lives(ira_loop_tree_node*)

(ira-lives.c:1322)

==5815==by 0x884217: ira_traverse_loop_tree(bool, ira_loop_tree_node*, void

(*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*)) (ira-build.c:1609)

==5815==by 0x8A90BE: ira_create_allocno_live_ranges() (ira-lives.c:1596)

==5815==by 0x8885FD: ira_build() (ira-build.c:3210)

==5815==by 0x87F5EE: ira(_IO_FILE*) (ira.c:4476)

==5815==by 0x87FB86: rest_of_handle_ira() (ira.c:4710)

==5815== 

==5815== Conditional jump or move depends on uninitialised value(s)

==5815==at 0x88FD3C: sparseset_bit_p(sparseset_def*, unsigned long)

(sparseset.h:147)

==5815==by 0x88FDCE: sparseset_set_bit(sparseset_def*, unsigned long)

(sparseset.h:166)

==5815==by 0x890B9A: build_conflict_bit_table() (ira-conflicts.c:174)

==5815==by 0x892B9F: ira_build_conflicts() (ira-conflicts.c:856)

==5815==by 0x888647: ira_build() (ira-build.c:3227)

==5815==by 0x87F5EE: ira(_IO_FILE*) (ira.c:4476)

==5815==by 0x87FB86: rest_of_handle_ira() (ira.c:4710)

==5815==by 0x937D39: execute_one_pass(opt_pass*) (passes.c:2339)

==5815==by 0x937FB0: execute_pass_list(opt_pass*) (passes.c:2400)

==5815==by 0x937FE1: execute_pass_list(opt_pass*) (passes.c:2401)

==5815==by 0x667BCD: expand_function(cgraph_node*) (cgraphunit.c:1643)

==5815==by 0x668088: expand_all_functions() (cgraphunit.c:1747)

==5815== 

==5815== Conditional jump or move depends on uninitialised value(s)

==5815==at 0x8E2237: 

[Bug objc/55291] New: libsanitizer doesn't build multilib

2012-11-12 Thread hjl.tools at gmail dot com


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



 Bug #: 55291

   Summary: libsanitizer doesn't build multilib

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: objc

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com





On Linux/x86-64, libsanitizer doesn't build multilib, like -m32 and

-mx32.


[Bug other/55292] New: libsanitizer doesn't support x32

2012-11-12 Thread hjl.tools at gmail dot com


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



 Bug #: 55292

   Summary: libsanitizer doesn't support x32

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: other

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com





sanitizer_common/sanitizer_linux.cc has



void *internal_mmap(void *addr, uptr length, int prot, int flags,

int fd, u64 offset) {

#if __WORDSIZE == 64

  return (void *)syscall(__NR_mmap, addr, length, prot, flags, fd, offset);

#else

  return (void *)syscall(__NR_mmap2, addr, length, prot, flags, fd, offset);

#endif

}



uptr internal_filesize(fd_t fd) {

#if __WORDSIZE == 64

  struct stat st;

  if (syscall(__NR_fstat, fd, st))

return -1;

#else

  struct stat64 st;

  if (syscall(__NR_fstat64, fd, st))

return -1;

#endif

  return (uptr)st.st_size;

}



They are incorrect for x32.


[Bug objc/55291] libsanitizer doesn't build multilib

2012-11-12 Thread hjl.tools at gmail dot com


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



--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2012-11-13 00:33:06 
UTC ---

configure.ac has



#AM_ENABLE_MULTILIB(, ..)


[Bug other/55304] New: libsanitizer can't be used with GCC autoconf

2012-11-12 Thread hjl.tools at gmail dot com


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



 Bug #: 55304

   Summary: libsanitizer can't be used with GCC autoconf

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: other

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com





GCC only requires autoconf 2.64 while configure.ac has



AC_PREREQ([2.68])


[Bug objc/55291] libsanitizer doesn't build multilib

2012-11-12 Thread hjl.tools at gmail dot com


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



--- Comment #2 from H.J. Lu hjl.tools at gmail dot com 2012-11-13 03:48:39 
UTC ---

After I fixed configure.ac, make install gave me:



 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libasan.la

'/export/build/gnu/gcc-x32/release/usr/gcc-4.8.0-x32/lib/../lib'

libtool: install: error: cannot install `libasan.la' to a directory not ending

in /usr/gcc-4.8.0-x32/lib



It can't tell /usr/gcc-4.8.0-x32/lib/../lib is the same as

/usr/gcc-4.8.0-x32/lib.


[Bug objc/55291] libsanitizer doesn't build multilib

2012-11-12 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |NEW

   Last reconfirmed||2012-11-13

   Target Milestone|--- |4.8.0

 Ever Confirmed|0   |1



--- Comment #3 from H.J. Lu hjl.tools at gmail dot com 2012-11-13 07:11:04 
UTC ---

A patch:



http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=12debb750e5a48fd8bbe7a12ca9dd75dc88e2be5



is checked into hjl/asan branch at



http://gcc.gnu.org/git/?p=gcc.git;a=summary


[Bug other/55292] libsanitizer doesn't support x32

2012-11-12 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



   Target Milestone|--- |4.8.0


[Bug other/55304] libsanitizer can't be used with GCC autoconf

2012-11-12 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||WONTFIX



--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2012-11-13 07:12:06 
UTC ---

libsanitizer doesn't use GCC autoconf.


[Bug other/55304] libsanitizer can't be used with GCC autoconf

2012-11-13 Thread hjl.tools at gmail dot com


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



--- Comment #3 from H.J. Lu hjl.tools at gmail dot com 2012-11-13 11:27:39 
UTC ---

One problem is AM_PROG_LIBTOOL, which is the part of libtool.

GCC autoconf doesn't use libtool since we have in-tree

libtool.  To use GCC autoconf, we need also use the rest of

libtool support in GCC source tree. That means it will make

libsanitizer depends on GCC source tree.


[Bug target/55142] [4.8 Regression] internal compiler error: in plus_constant, at explow.c:88

2012-11-13 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



URL||http://gcc.gnu.org/ml/gcc-p

   ||atches/2012-11/msg00991.htm

   ||l

  Component|middle-end  |target



--- Comment #34 from H.J. Lu hjl.tools at gmail dot com 2012-11-13 14:32:23 
UTC ---

A patch is posted at



http://gcc.gnu.org/ml/gcc-patches/2012-11/msg00991.html


[Bug objc/55291] libsanitizer doesn't build multilib

2012-11-13 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 CC||ebotcazou at gcc dot

   ||gnu.org



--- Comment #5 from H.J. Lu hjl.tools at gmail dot com 2012-11-13 14:44:35 
UTC ---

*** Bug 55313 has been marked as a duplicate of this bug. ***


[Bug other/55313] libsanitizer cannot be installed

2012-11-13 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||DUPLICATE



--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2012-11-13 14:44:35 
UTC ---

Dup.



*** This bug has been marked as a duplicate of bug 55291 ***


[Bug target/55307] libgcc's __cpu_indicator_init does not check for avx correctly

2012-11-13 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |NEW

   Last reconfirmed||2012-11-13

  Component|other   |target

 CC||areg.melikadamyan at gmail

   ||dot com, hjl.tools at gmail

   ||dot com

 Ever Confirmed|0   |1

   Target Milestone|--- |4.8.0


[Bug c/55299] missed optimization: ASR idiom

2012-11-13 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |NEW

   Last reconfirmed||2012-11-13

 CC||areg.melikadamyan at gmail

   ||dot com, hjl.tools at gmail

   ||dot com

 Ever Confirmed|0   |1



--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2012-11-13 14:58:03 
UTC ---

clang generates:



movb%sil, %cl

sarl%cl, %edi

movl%edi, %eax

ret


[Bug other/55304] libsanitizer can't be used with GCC autoconf

2012-11-13 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |NEW

URL||http://gcc.gnu.org/ml/gcc-p

   ||atches/2012-11/msg01003.htm

   ||l

   Last reconfirmed||2012-11-13

   Target Milestone|--- |4.8.0

 Ever Confirmed|0   |1



--- Comment #4 from H.J. Lu hjl.tools at gmail dot com 2012-11-13 16:54:21 
UTC ---

This patch



http://gcc.gnu.org/ml/gcc-patches/2012-11/msg01003.html



fixes it.


[Bug target/55142] [4.8 Regression] internal compiler error: in plus_constant, at explow.c:88

2012-11-13 Thread hjl.tools at gmail dot com


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



--- Comment #35 from H.J. Lu hjl.tools at gmail dot com 2012-11-13 18:21:30 
UTC ---

This regression is triggered by revision 188008:



http://gcc.gnu.org/ml/gcc-cvs/2012-05/msg00038.html



aka the un-sign-extension of sizetype constants.


[Bug other/55304] libsanitizer can't be used with GCC autoconf

2012-11-13 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|NEW |RESOLVED

 Resolution||FIXED



--- Comment #6 from H.J. Lu hjl.tools at gmail dot com 2012-11-14 00:02:55 
UTC ---

Fixed.


[Bug other/55292] libsanitizer doesn't support x32

2012-11-14 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED



--- Comment #2 from H.J. Lu hjl.tools at gmail dot com 2012-11-14 13:47:25 
UTC ---

Fixed.


[Bug bootstrap/55051] [4.8 Regression] profiledbootstrap failed

2012-11-14 Thread hjl.tools at gmail dot com


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



--- Comment #4 from H.J. Lu hjl.tools at gmail dot com 2012-11-14 15:06:44 
UTC ---

With revision 193500, we got



libdecnumber -I../../src-trunk/gcc/../libdecnumber/bid -I../libdecnumber

-I../../src-trunk/gcc/../libbacktrace../../src-trunk/gcc/gimple-iterator.c

-o gimple-iterator.o

../../src-trunk/gcc/fold-const.c:16732:1: internal compiler error: in

edge_badness, at ipa-inline.c:921

 }

 ^

0x11ddca7 edge_badness

../../src-trunk/gcc/ipa-inline.c:921

0x11ddf41 update_edge_key

../../src-trunk/gcc/ipa-inline.c:987

0x11df257 inline_small_functions

../../src-trunk/gcc/ipa-inline.c:1476

0x11dff6a ipa_inline

../../src-trunk/gcc/ipa-inline.c:1794

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.

make[6]: *** [fold-const.o] Error 1


[Bug bootstrap/55051] [4.8 Regression] profiledbootstrap failed

2012-11-14 Thread hjl.tools at gmail dot com


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



--- Comment #5 from H.J. Lu hjl.tools at gmail dot com 2012-11-14 15:08:53 
UTC ---

There are



  badness = (relative_time_benefit (callee_info, edge, edge_time)

 * (INT_MIN / 16 / RELATIVE_TIME_BENEFIT_RANGE));

  badness /= (growth * MAX (1, callee_info-growth));

  gcc_checking_assert (badness =0  badness = INT_MIN / 16);


[Bug other/55291] libsanitizer doesn't build multilib

2012-11-14 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|NEW |RESOLVED

 Resolution||FIXED



--- Comment #7 from H.J. Lu hjl.tools at gmail dot com 2012-11-15 00:04:31 
UTC ---

Fixed.


[Bug bootstrap/55051] [4.8 Regression] profiledbootstrap failed

2012-11-14 Thread hjl.tools at gmail dot com


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



--- Comment #12 from H.J. Lu hjl.tools at gmail dot com 2012-11-15 00:30:51 
UTC ---

Revision 193513 gave:



../../src-trunk/gcc/common/common-targhooks.c: In function

'default_target_handle_option(gcc_options*, gcc_options*, cl_decoded_option

const*, unsigned int)':

../../src-trunk/gcc/common/common-targhooks.c:85:4: note: file

/export/gnu/import/git/gcc-test-profile/bld/gcc/common/common-targhooks.gcda

not found, execution counts estimated

   };



In file included from ../../src-trunk/gcc/gcov.c:47:0:

../../src-trunk/gcc/gcov.c: In function 'read_count_file(function_info*)':

../../src-trunk/gcc/gcov-io.c:555:54: error: array subscript is above array

bounds [-Werror=array-bounds]

   cur_bitvector = histo_bitvector[bv_ix++];

  ^

In file included from ../../src-trunk/gcc/gcov-dump.c:30:0:

../../src-trunk/gcc/gcov-io.c:555:54: error: array subscript is above array

bounds [-Werror=array-bounds]

   cur_bitvector = histo_bitvector[bv_ix++];

  ^

cc1plus: all warnings being treated as errors

make[6]: *** [gcov-dump.o] Error 1

make[6]: *** Waiting for unfinished jobs

cc1plus: all warnings being treated as errors

make[6]: *** [gcov.o] Error 1

rm gcj-dbtool.pod jcf-dump.pod jv-convert.pod grmic.pod gc


[Bug other/55333] New: [x32] 8 asan test failures

2012-11-14 Thread hjl.tools at gmail dot com


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



 Bug #: 55333

   Summary: [x32] 8 asan test failures

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: other

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com





Schedule of variations:

unix/-mx32



Running target unix/-mx32

Using /usr/share/dejagnu/baseboards/unix.exp as board description file for

target.

Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.

Using /export/gnu/import/git/gcc/gcc/testsuite/config/default.exp as

tool-and-target-specific interface file.

Running /export/gnu/import/git/gcc/gcc/testsuite/gcc.dg/asan/asan.exp ...

FAIL: c-c++-common/asan/memcmp-1.c  -O0  output pattern test, is

=

==3035== ERROR: AddressSanitizer stack-buffer-overflow on address 0xffe91e45 at

pc 0xf5b1e798 bp 0xffe91df0 sp 0xffe91d90

READ of size 1 at 0xffe91e45 thread T0

#0 0xf5b1e797 in __interceptor_memcmp

/export/gnu/import/git/gcc/libsanitizer/asan/asan_interceptors.cc:218

(discriminator 1)

Address 0xffe91e45 is located at offset 37 in frame main of T0's stack:

  This frame has 2 object(s):

[32, 36) 'a1'

[96, 100) 'a2'

HINT: this may be a false positive if your program uses some custom stack

unwind mechanism

  (longjmp and C++ exceptions *are* supported)

Shadow byte and word:

  0x3ffd23c8: 4

  0x3ffd23c8: 04 f4 f4 f4

More shadow bytes:

  0x3ffd23b8: 00 00 00 00

  0x3ffd23bc: 00 00 00 00

  0x3ffd23c0: 00 00 00 00

  0x3ffd23c4: f1 f1 f1 f1

=0x3ffd23c8: 04 f4 f4 f4

  0x3ffd23cc: f2 f2 f2 f2

  0x3ffd23d0: 04 f4 f4 f4

  0x3ffd23d4: f3 f3 f3 f3

  0x3ffd23d8: 00 00 00 00

Stats: 0M malloced (0M for red zones) by 0 calls

Stats: 0M realloced by 0 calls

Stats: 0M freed by 0 calls

Stats: 0M really freed by 0 calls

Stats: 0M (0 full pages) mmaped in 0 calls

  mmaps   by size class: 

  mallocs by size class: 

  frees   by size class: 

  rfrees  by size class: 

Stats: malloc large: 0 small slow: 0

==3035== ABORTING

, should match ERROR: AddressSanitizer stack-buffer-overflow.*(

|

)#0 0x[0-9a-f]+ (in _*(interceptor_|)memcmp |[(])[^

]*(

|

)#1 0x[0-9a-f]+ (in _*main|[(])[^

]*(

|

)

FAIL: c-c++-common/asan/memcmp-1.c  -O1  output pattern test, is

=

==3135== ERROR: AddressSanitizer stack-buffer-overflow on address 0xffe3c135 at

pc 0xf5b81798 bp 0xffe3c100 sp 0xffe3c0a0

READ of size 1 at 0xffe3c135 thread T0

#0 0xf5b81797 in __interceptor_memcmp

/export/gnu/import/git/gcc/libsanitizer/asan/asan_interceptors.cc:218

(discriminator 1)

Address 0xffe3c135 is located at offset 37 in frame main of T0's stack:

  This frame has 2 object(s):

[32, 36) 'a1'

[96, 100) 'a2'

HINT: this may be a false positive if your program uses some custom stack

unwind mechanism

  (longjmp and C++ exceptions *are* supported)

Shadow byte and word:

  0x3ffc7826: 4

  0x3ffc7824: f1 f1 04 f4

More shadow bytes:

  0x3ffc7814: 00 00 00 00

  0x3ffc7818: 00 00 00 00

  0x3ffc781c: 00 00 00 00

  0x3ffc7820: 00 00 f1 f1

=0x3ffc7824: f1 f1 04 f4

  0x3ffc7828: f4 f4 f2 f2

  0x3ffc782c: f2 f2 04 f4

  0x3ffc7830: f4 f4 f3 f3

  0x3ffc7834: f3 f3 00 00

Stats: 0M malloced (0M for red zones) by 0 calls

Stats: 0M realloced by 0 calls

Stats: 0M freed by 0 calls

Stats: 0M really freed by 0 calls

Stats: 0M (0 full pages) mmaped in 0 calls

  mmaps   by size class: 

  mallocs by size class: 

  frees   by size class: 

  rfrees  by size class: 

Stats: malloc large: 0 small slow: 0

==3135== ABORTING

, should match ERROR: AddressSanitizer stack-buffer-overflow.*(

|

)#0 0x[0-9a-f]+ (in _*(interceptor_|)memcmp |[(])[^

]*(

|

)#1 0x[0-9a-f]+ (in _*main|[(])[^

]*(

|

)

FAIL: c-c++-common/asan/memcmp-1.c  -O2  output pattern test, is

=

==3220== ERROR: AddressSanitizer stack-buffer-overflow on address 0xffa93f15 at

pc 0xf5b6d798 bp 0xffa93ee0 sp 0xffa93e80

READ of size 1 at 0xffa93f15 thread T0

#0 0xf5b6d797 in __interceptor_memcmp

/export/gnu/import/git/gcc/libsanitizer/asan/asan_interceptors.cc:218

(discriminator 1)

Address 0xffa93f15 is located at offset 37 in frame main of T0's stack:

  This frame has 2 object(s):

[32, 36) 'a1'

[96, 100) 'a2'

HINT: this may be a false positive if your program uses some custom stack

unwind mechanism

  (longjmp and C++ exceptions *are* supported)

Shadow byte and word:

  0x3ff527e2: 4

  0x3ff527e0: f1 f1 04 f4

More shadow bytes:

  0x3ff527d0: 00 00 00 00

  0x3ff527d4: 00 00 00 00

  0x3ff527d8: 00 00 00 00

  0x3ff527dc: 00 00 f1 f1

=0x3ff527e0: f1 f1 04 f4

  0x3ff527e4: f4 f4 f2 f2

  0x3ff527e8: f2 f2 04 f4

[Bug other/55333] [x32] StackTrace::FastUnwindStack wrong x32

2012-11-14 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



Summary|[x32] 8 asan test failures  |[x32]

   ||StackTrace::FastUnwindStack

   ||wrong x32



--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2012-11-15 03:38:05 
UTC ---

For x32, hardware frame pointer size is 64-bit, not 32-bit.


[Bug other/55304] libsanitizer can't be used with GCC autoconf

2012-11-15 Thread hjl.tools at gmail dot com


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



--- Comment #8 from H.J. Lu hjl.tools at gmail dot com 2012-11-15 14:11:54 
UTC ---

(In reply to comment #7)

 That's strange but on x86 I see 

 

 CDPATH=${ZSH_VERSION+.}:  cd ../../../libsanitizer  /bin/sh

 /export/users/izamyati/tmp_gcc/missing --run aclocal-1.11 -I .. -I ../config

 configure.ac:5: error: Please use exactly Autoconf 2.64 instead of 2.68.

 ../config/override.m4:12: _GCC_AUTOCONF_VERSION_CHECK is expanded from...

 configure.ac:5: the top level

 autom4te: m4 failed with exit status: 1

 aclocal-1.11: autom4te failed with exit status: 1

 make[2]: *** [../../../libsanitizer/aclocal.m4] Error 1

 

 during build for following configuration

 

 ../configure --disable-bootstrap --enable-clocale=gnu --with-system-zlib

 --enable-shared --with-demangler-in-ld --with-fpmath=sse

 --enable-languages=c,c++,fortran 

 

 My head is at r193515.

 

 Did I miss anything?



You must run



# ./contrib/gcc_update --touch


[Bug rtl-optimization/55342] [LRA,x86] Non-optimal code for simple loop with LRA

2012-11-15 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 CC||hjl.tools at gmail dot com,

   ||ubizjak at gmail dot com,

   ||vmakarov at redhat dot com

   Target Milestone|--- |4.8.0


[Bug bootstrap/53866] [4.8 Regression] lto-bootstrap failed at -O3

2012-11-15 Thread hjl.tools at gmail dot com


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



--- Comment #7 from H.J. Lu hjl.tools at gmail dot com 2012-11-15 20:31:18 
UTC ---

Revision gave 193535:



/export/gnu/import/git/gcc/gcc/c/c-parser.c: In function

\u2018c_parser_postfix_expression_after_primary(c_parser*, unsigned int,

c_expr)\u2019: 

/export/gnu/import/git/gcc/gcc/c/c-parser.c:6917:16: error:

\u2018origtypes\u2019 may be used uninitialized in this function

[-Werror=maybe-uninitialized]

   origtypes);


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-15 Thread hjl.tools at gmail dot com


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



--- Comment #4 from H.J. Lu hjl.tools at gmail dot com 2012-11-16 00:34:07 
UTC ---

Revision 193543 gave:



lto1: internal compiler error: Segmentation fault

0xb37547 crash_signal

../../src-trunk/gcc/toplev.c:334

0x6c0763 resolve_addr_in_expr

../../src-trunk/gcc/dwarf2out.c:22440

0x6eb6e2 resolve_addr

../../src-trunk/gcc/dwarf2out.c:22636

0x6eb77b resolve_addr

../../src-trunk/gcc/dwarf2out.c:22687

0x6eb77b resolve_addr

../../src-trunk/gcc/dwarf2out.c:22687

0x6eb77b resolve_addr

../../src-trunk/gcc/dwarf2out.c:22687

0x6eb77b resolve_addr

../../src-trunk/gcc/dwarf2out.c:22687

0x6eb77b resolve_addr

../../src-trunk/gcc/dwarf2out.c:22687

0x6eb77b resolve_addr

../../src-trunk/gcc/dwarf2out.c:22687

0x6eb77b resolve_addr

../../src-trunk/gcc/dwarf2out.c:22687

0x6ec76b dwarf2out_finish

../../src-trunk/gcc/dwarf2out.c:23309

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.

make[7]: *** [/tmp/ccAUJBBj.ltrans24.ltrans.o] Error 1

make[7]: *** Waiting for unfinished jobs

lto-wrapper: make returned 2 exit status

/usr/local/x86_64-unknown-linux-gnu/bin/ld: lto-wrapper failed

collect2: error: ld returned 1 exit status

make[6]: *** [cc1plus] Error 1


[Bug other/55333] libsanitizer StackTrace::FastUnwindStack wrong x32

2012-11-16 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED

   Target Milestone|--- |4.8.0



--- Comment #3 from H.J. Lu hjl.tools at gmail dot com 2012-11-16 12:03:16 
UTC ---

Fixed.


[Bug other/55313] libsanitizer cannot be installed

2012-11-16 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|NEW |WAITING

 CC||hjl.tools at gmail dot com



--- Comment #3 from H.J. Lu hjl.tools at gmail dot com 2012-11-16 15:36:22 
UTC ---

Please provide complete configure option.


[Bug other/55313] libsanitizer cannot be installed

2012-11-16 Thread hjl.tools at gmail dot com


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



--- Comment #4 from H.J. Lu hjl.tools at gmail dot com 2012-11-16 15:38:42 
UTC ---

BTW, it works for me with



--enable-languages=c,c++ --disable-bootstrap --prefix=/usr/gcc-4.8.0

--with-local-prefix=/usr/local --enable-gnu-indirect-function

--disable-multilib --with-fpmath=sse


[Bug other/55358] New: Valgrind errors

2012-11-16 Thread hjl.tools at gmail dot com


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



 Bug #: 55358

   Summary: Valgrind errors

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: other

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com





With revision 193546, valgrind reports:



==25552== Invalid read of size 8

==25552==at 0x38F3A88D5F: __GI_mempcpy (in /usr/lib64/libc-2.15.so)

==25552==by 0x38F3A785DD: _IO_default_xsputn (in /usr/lib64/libc-2.15.so)

==25552==by 0x38F3A76940: _IO_file_xsputn@@GLIBC_2.2.5 (in

/usr/lib64/libc-2.15.so)

==25552==by 0x38F3A6C4FC: fwrite (in /usr/lib64/libc-2.15.so)

==25552==by 0x622AD7: ggc_pch_write_object(ggc_pch_data*, _IO_FILE*, void*,

void*, unsigned long, bool) (ggc-page.c:2322)

==25552==by 0x74D8C1: gt_pch_save(_IO_FILE*) (ggc-common.c:593) 

==25552==by 0x610027: c_common_write_pch() (c-pch.c:184)

==25552==by 0x548D45: cp_write_global_declarations() (decl2.c:3948)

==25552==by 0x8A252C: compile_file() (toplev.c:559)

==25552==by 0x8A4087: toplev_main(int, char**) (toplev.c:1881)

==25552==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==25552==  Address 0x1089a7d8 is not stack'd, malloc'd or (recently) free'd



==25552== Invalid read of size 8

==25552==at 0x4A0A33A: memcpy@@GLIBC_2.14 (mc_replace_strmem.c:881)

==25552==by 0x74D84B: gt_pch_save(_IO_FILE*) (ggc-common.c:583)

==25552==by 0x610027: c_common_write_pch() (c-pch.c:184)

==25552==by 0x548D45: cp_write_global_declarations() (decl2.c:3948)

==25552==by 0x8A252C: compile_file() (toplev.c:559)

==25552==by 0x8A4087: toplev_main(int, char**) (toplev.c:1881)

==25552==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==25552==  Address 0xce8 is not stack'd, malloc'd or (recently) free'd



==25565== Invalid write of size 8

==25565==at 0x4A0A23B: memcpy@@GLIBC_2.14 (mc_replace_strmem.c:881)

==25565==by 0x74D8E3: gt_pch_save(_IO_FILE*) (ggc-common.c:595)

==25565==by 0x610027: c_common_write_pch() (c-pch.c:184)

==25565==by 0x548D45: cp_write_global_declarations() (decl2.c:3948)

==25565==by 0x8A252C: compile_file() (toplev.c:559)

==25565==by 0x8A4087: toplev_main(int, char**) (toplev.c:1881)

==25565==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==25565==  Address 0xfb40778 is not stack'd, malloc'd or (recently) free'd



==26359== Invalid read of size 4

==26359==at 0xB58AEE: rest_of_handle_ree() (ree.c:617)

==26359==by 0x74ADA3: execute_one_pass(opt_pass*) (passes.c:2339)

==26359==by 0x74B174: execute_pass_list(opt_pass*) (passes.c:2400)

==26359==by 0x74B186: execute_pass_list(opt_pass*) (passes.c:2401)

==26359==by 0x74B186: execute_pass_list(opt_pass*) (passes.c:2401)

==26359==by 0x5AB16D: expand_function(cgraph_node*) (cgraphunit.c:1643)

==26359==by 0x5AC786: compile() (cgraphunit.c:1747)

==26359==by 0x5ACBA9: finalize_compilation_unit() (cgraphunit.c:2122)

==26359==by 0x4E47DF: c_write_global_declarations() (c-decl.c:10128)

==26359==by 0x7D7F4C: compile_file() (toplev.c:559)

==26359==by 0x7D9AA7: toplev_main(int, char**) (toplev.c:1881)

==26359==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==26359==  Address 0x4e10d51 is 2,785 bytes inside a block of size 2,788

alloc'd

==26359==at 0x4A06B0F: calloc (vg_replace_malloc.c:593)

==26359==by 0xC0F708: xcalloc (xmalloc.c:162)

==26359==by 0xB59070: rest_of_handle_ree() (ree.c:886)


[Bug rtl-optimization/55360] [TileGX] Passing structure by value on stack needlessly writes to and reads from memory

2012-11-16 Thread hjl.tools at gmail dot com


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



--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2012-11-16 23:46:25 
UTC ---

Is this related to PR 28831?


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-17 Thread hjl.tools at gmail dot com


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



--- Comment #6 from H.J. Lu hjl.tools at gmail dot com 2012-11-17 15:47:56 
UTC ---

[hjl@gnu-mic-2 gcc]$ cat /tmp/x.c

int

main ()

{

}

[hjl@gnu-mic-2 gcc]$ ./xgcc -B./ -c -flto /tmp/x.c

==17373== Invalid read of size 8

==17373==at 0x8E3FE6: streamer_pack_tree_bitfields(output_block*,

bitpack_d*, tree_node*) (tree-streamer-out.c:263)

==17373==by 0x71FA5F: lto_output_tree(output_block*, tree_node*, bool,

bool) (lto-streamer-out.c:316)

==17373==by 0x71F06B: write_global_stream(output_block*,

lto_tree_ref_encoder*) (lto-streamer-out.c:1057)

==17373==by 0x721798: produce_asm_for_decls() (lto-streamer-out.c:1101)

==17373==by 0x74A477: ipa_write_summaries_2(opt_pass*, lto_out_decl_state*)

(passes.c:2430)

==17373==by 0x74B34D: ipa_write_summaries() (passes.c:2460)

==17373==by 0x5ACA9B: compile() (cgraphunit.c:1908)

==17373==by 0x5ACBA9: finalize_compilation_unit() (cgraphunit.c:2122)

==17373==by 0x4E47DF: c_write_global_declarations() (c-decl.c:10128)

==17373==by 0x7D7F4C: compile_file() (toplev.c:559)

==17373==by 0x7D9AA7: toplev_main(int, char**) (toplev.c:1881)

==17373==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17373==  Address 0xb57c9da is not stack'd, malloc'd or (recently) free'd

==17373== 

==17373== Invalid read of size 8

==17373==at 0x8E4103: streamer_pack_tree_bitfields(output_block*,

bitpack_d*, tree_node*) (tree-streamer-out.c:271)

==17373==by 0x71FA5F: lto_output_tree(output_block*, tree_node*, bool,

bool) (lto-streamer-out.c:316)

==17373==by 0x71F06B: write_global_stream(output_block*,

lto_tree_ref_encoder*) (lto-streamer-out.c:1057)

==17373==by 0x721798: produce_asm_for_decls() (lto-streamer-out.c:1101)

==17373==by 0x74A477: ipa_write_summaries_2(opt_pass*, lto_out_decl_state*)

(passes.c:2430)

==17373==by 0x74B34D: ipa_write_summaries() (passes.c:2460)

==17373==by 0x5ACA9B: compile() (cgraphunit.c:1908)

==17373==by 0x5ACBA9: finalize_compilation_unit() (cgraphunit.c:2122)

==17373==by 0x4E47DF: c_write_global_declarations() (c-decl.c:10128)

==17373==by 0x7D7F4C: compile_file() (toplev.c:559)

==17373==by 0x7D9AA7: toplev_main(int, char**) (toplev.c:1881)

==17373==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17373==  Address 0xb57c9db is not stack'd, malloc'd or (recently) free'd

==17373== 

[hjl@gnu-mic-2 gcc]$


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-17 Thread hjl.tools at gmail dot com


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



--- Comment #7 from H.J. Lu hjl.tools at gmail dot com 2012-11-17 16:15:50 
UTC ---

When I add --db-attach=yes, valgrind doesn't report any

error.


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-17 Thread hjl.tools at gmail dot com


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



--- Comment #8 from H.J. Lu hjl.tools at gmail dot com 2012-11-17 16:30:20 
UTC ---

==17631== Invalid read of size 8

==17631==at 0x6B2522: output_symtab() (lto-cgraph.c:589)

==17631==by 0x6B87B5: lto_output() (lto-streamer-out.c:1000)

==17631==by 0x6E2307: ipa_write_optimization_summaries_1(opt_pass*,

lto_out_decl_state*) (passes.c:2542)

==17631==by 0x6E3257:

ipa_write_optimization_summaries(lto_symtab_encoder_d*) (passes.c:2589)

==17631==by 0x4EA5AA: lto_main() (lto.c:2693)

==17631==by 0x76FC45: compile_file() (toplev.c:545)

==17631==by 0x7717E7: toplev_main(int, char**) (toplev.c:1881)

==17631==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17631==  Address 0xb5caccc is not stack'd, malloc'd or (recently) free'd

==17631== 

==17631== Invalid read of size 8

==17631==at 0x87BDA6: streamer_pack_tree_bitfields(output_block*,

bitpack_d*, tree_node*) (tree-streamer-out.c:263)

==17631==by 0x6B779F: lto_output_tree(output_block*, tree_node*, bool,

bool) (lto-streamer-out.c:316)

==17631==by 0x6B6DAB: write_global_stream(output_block*,

lto_tree_ref_encoder*) (lto-streamer-out.c:1057)

==17631==by 0x6B94D8: produce_asm_for_decls() (lto-streamer-out.c:1101)

==17631==by 0x6E2307: ipa_write_optimization_summaries_1(opt_pass*,

lto_out_decl_state*) (passes.c:2542)

==17631==by 0x6E3257:

ipa_write_optimization_summaries(lto_symtab_encoder_d*) (passes.c:2589)

==17631==by 0x4EA5AA: lto_main() (lto.c:2693)

==17631==by 0x76FC45: compile_file() (toplev.c:545)

==17631==by 0x7717E7: toplev_main(int, char**) (toplev.c:1881)

==17631==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17631==  Address 0xb5afeda is not stack'd, malloc'd or (recently) free'd

==17631== 

==17631== Invalid read of size 8

==17631==at 0x87BEC3: streamer_pack_tree_bitfields(output_block*,

bitpack_d*, tree_node*) (tree-streamer-out.c:271)

==17631==by 0x6B779F: lto_output_tree(output_block*, tree_node*, bool,

bool) (lto-streamer-out.c:316)

==17631==by 0x6B6DAB: write_global_stream(output_block*,

lto_tree_ref_encoder*) (lto-streamer-out.c:1057)

==17631==by 0x6B94D8: produce_asm_for_decls() (lto-streamer-out.c:1101)

==17631==by 0x6E2307: ipa_write_optimization_summaries_1(opt_pass*,

lto_out_decl_state*) (passes.c:2542)

==17631==by 0x6E3257:

ipa_write_optimization_summaries(lto_symtab_encoder_d*) (passes.c:2589)

==17631==by 0x4EA5AA: lto_main() (lto.c:2693)

==17631==by 0x76FC45: compile_file() (toplev.c:545)

==17631==by 0x7717E7: toplev_main(int, char**) (toplev.c:1881)

==17631==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17631==  Address 0xb5afedb is not stack'd, malloc'd or (recently) free'd

==17631== 

==17631== Invalid read of size 8

==17631==at 0x87BFFE: streamer_pack_tree_bitfields(output_block*,

bitpack_d*, tree_node*) (tree-streamer-out.c:230)

==17631==by 0x6B779F: lto_output_tree(output_block*, tree_node*, bool,

bool) (lto-streamer-out.c:316)

==17631==by 0x6B6DAB: write_global_stream(output_block*,

lto_tree_ref_encoder*) (lto-streamer-out.c:1057)

==17631==by 0x6B94D8: produce_asm_for_decls() (lto-streamer-out.c:1101)

==17631==by 0x6E2307: ipa_write_optimization_summaries_1(opt_pass*,

lto_out_decl_state*) (passes.c:2542)

==17631==by 0x6E3257:

ipa_write_optimization_summaries(lto_symtab_encoder_d*) (passes.c:2589)

==17631==by 0x4EA5AA: lto_main() (lto.c:2693)

==17631==by 0x76FC45: compile_file() (toplev.c:545)

==17631==by 0x7717E7: toplev_main(int, char**) (toplev.c:1881)

==17631==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17631==  Address 0xb5c8f69 is not stack'd, malloc'd or (recently) free'd

==17631== 

==17631== Invalid read of size 8

==17631==at 0x87BDA6: streamer_pack_tree_bitfields(output_block*,

bitpack_d*, tree_node*) (tree-streamer-out.c:263)

==17631==by 0x6B779F: lto_output_tree(output_block*, tree_node*, bool,

bool) (lto-streamer-out.c:316)

==17631==by 0x6B6DAB: write_global_stream(output_block*,

lto_tree_ref_encoder*) (lto-streamer-out.c:1057)

==17631==by 0x6B951F: produce_asm_for_decls() (lto-streamer-out.c:1101)

==17631==by 0x6E2307: ipa_write_optimization_summaries_1(opt_pass*,

lto_out_decl_state*) (passes.c:2542)

==17631==by 0x6E3257:

ipa_write_optimization_summaries(lto_symtab_encoder_d*) (passes.c:2589)

==17631==by 0x4EA5AA: lto_main() (lto.c:2693)

==17631==by 0x76FC45: compile_file() (toplev.c:545)

==17631==by 0x7717E7: toplev_main(int, char**) (toplev.c:1881)

==17631==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17631==  Address 0xb5c55da is not stack'd, malloc'd or (recently) free'd

==17631== 

==17631== Invalid read of size 8

==17631==at 0x87BEC3: streamer_pack_tree_bitfields(output_block*,

bitpack_d*, tree_node*) (tree-streamer

[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-17 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 CC||hubicka at gcc dot gnu.org



--- Comment #9 from H.J. Lu hjl.tools at gmail dot com 2012-11-17 16:47:54 
UTC ---

==17715== Invalid read of size 8

==17715==at 0x6B2522: output_symtab() (lto-cgraph.c:589)

==17715==by 0x6B87B5: lto_output() (lto-streamer-out.c:1000)

==17715==by 0x6E2307: ipa_write_optimization_summaries_1(opt_pass*,

lto_out_decl_state*) (passes.c:2542)

==17715==by 0x6E3257:

ipa_write_optimization_summaries(lto_symtab_encoder_d*) (passes.c:2589)

==17715==by 0x4EA5AA: lto_main() (lto.c:2693)

==17715==by 0x76FC45: compile_file() (toplev.c:545)

==17715==by 0x7717E7: toplev_main(int, char**) (toplev.c:1881)

==17715==by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)

==17715==  Address 0xb5caccc is not stack'd, malloc'd or (recently) free'd



 588   bp = bitpack_create (ob-main_stream);

 589   bp_pack_value (bp, ref-use, 2);

 590   streamer_write_bitpack (bp);

 591   nref = lto_symtab_encoder_lookup (encoder, ref-referred);

 592   gcc_assert (nref != LCC_NOT_FOUND);

 593   streamer_write_hwi_stream (ob-main_stream, nref);



(gdb) p ref

$1 = (ipa_ref *) 0xb5cacb0

(gdb) p ref-use

$2 = IPA_REF_LOAD

(gdb) p ref-use

$3 = (ipa_ref_use *) 0xb5caccc

(gdb)


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-17 Thread hjl.tools at gmail dot com


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



--- Comment #10 from H.J. Lu hjl.tools at gmail dot com 2012-11-17 17:20:19 
UTC ---

There is a bad memory access in LTO.


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-17 Thread hjl.tools at gmail dot com


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



--- Comment #11 from H.J. Lu hjl.tools at gmail dot com 2012-11-17 17:30:25 
UTC ---

It can be reproduced with LTO bootstrap on hjl/valgrind branch at



http://gcc.gnu.org/git/?p=gcc.git;a=summary



with --enable-checking=valgrind.


[Bug other/55354] [asan] by default, the asan run-time should be linked statically, not dynamically

2012-11-17 Thread hjl.tools at gmail dot com


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



--- Comment #7 from H.J. Lu hjl.tools at gmail dot com 2012-11-17 20:35:57 
UTC ---

(In reply to comment #6)

 Answering my own question: we can get static linking with 

  -Wl,-Bstatic -lasan -Wl,-Bdynamic -ldl -lpthread 

 



The -static-libasan option was added by



http://gcc.gnu.org/ml/gcc-cvs/2012-11/msg00536.html


[Bug bootstrap/55370] New: [4.8 Regression] Bad libgcc.map

2012-11-17 Thread hjl.tools at gmail dot com


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



 Bug #: 55370

   Summary: [4.8 Regression] Bad libgcc.map

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: bootstrap

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com





On Linux/x86-64, I got



/usr/local/bin/ld: warning: wildcard match appears in both version 'GCC_3.0'

and 'GCC_4.8.0' in script



libgcc.map has



GCC_3.0 {

  global:

...

  local:

*;

};

...

GCC_4.8.0 {

  global:

__cpu_model;

__cpu_indicator_init;



  local:

*;

};


[Bug bootstrap/55370] [4.8 Regression] Bad libgcc.map

2012-11-17 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



   Target Milestone|--- |4.8.0


[Bug middle-end/55371] New: [asan] False -Werror=uninitialized

2012-11-17 Thread hjl.tools at gmail dot com

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

 Bug #: 55371
   Summary: [asan] False -Werror=uninitialized
Classification: Unclassified
   Product: gcc
   Version: 4.8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: hjl.to...@gmail.com


[hjl@gnu-tools-1 gcc]$
/export/build/gnu/gcc-asan/build-x86_64-linux/./prev-gcc/g++
-B/export/build/gnu/gcc-asan/build-x86_64-linux/./prev-gcc/
-B/usr/gcc-4.8.0/x86_64-unknown-linux-gnu/bin/ -nostdinc++
-B/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-B/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-B/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libsanitizer/asan/.libs
-I/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu
-I/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include
-I/export/gnu/import/git/sources/gcc/libstdc++-v3/libsupc++
-L/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-L/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-c   -g -O2 -faddress-sanitizer -DIN_GCC   -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common 
-DHAVE_CONFIG_H -I. -I. -I/export/gnu/import/git/sources/gcc/gcc
-I/export/gnu/import/git/sources/gcc/gcc/.
-I/export/gnu/import/git/sources/gcc/gcc/../include
-I/export/gnu/import/git/sources/gcc/gcc/../libcpp/include 
-I/export/gnu/import/git/sources/gcc/gcc/../libdecnumber
-I/export/gnu/import/git/sources/gcc/gcc/../libdecnumber/bid -I../libdecnumber
-I/export/gnu/import/git/sources/gcc/gcc/../libbacktrace   
/export/gnu/import/git/sources/gcc/gcc/explow.c -o explow.o
/export/gnu/import/git/sources/gcc/gcc/explow.c: In function ‘rtx_def*
plus_constant(machine_mode, rtx, long int)’:
/export/gnu/import/git/sources/gcc/gcc/explow.c:84:7: error: ‘y’ may be used
uninitialized in this function [-Werror=uninitialized]
   rtx y;
   ^
cc1plus: all warnings being treated as errors
[hjl@gnu-tools-1 gcc]$
/export/build/gnu/gcc-asan/build-x86_64-linux/./prev-gcc/g++
-B/export/build/gnu/gcc-asan/build-x86_64-linux/./prev-gcc/
-B/usr/gcc-4.8.0/x86_64-unknown-linux-gnu/bin/ -nostdinc++
-B/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-B/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-B/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libsanitizer/asan/.libs
-I/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu
-I/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include
-I/export/gnu/import/git/sources/gcc/libstdc++-v3/libsupc++
-L/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-L/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-c   -g -O2  -DIN_GCC   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables
-W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror
-fno-common  -DHAVE_CONFIG_H -I. -I. -I/export/gnu/import/git/sources/gcc/gcc
-I/export/gnu/import/git/sources/gcc/gcc/.
-I/export/gnu/import/git/sources/gcc/gcc/../include
-I/export/gnu/import/git/sources/gcc/gcc/../libcpp/include 
-I/export/gnu/import/git/sources/gcc/gcc/../libdecnumber
-I/export/gnu/import/git/sources/gcc/gcc/../libdecnumber/bid -I../libdecnumber
-I/export/gnu/import/git/sources/gcc/gcc/../libbacktrace   
/export/gnu/import/git/sources/gcc/gcc/explow.c -o explow.o
[hjl@gnu-tools-1 gcc]$


[Bug other/55374] New: [asan] Can't link static libasan with static libstdc++

2012-11-17 Thread hjl.tools at gmail dot com


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



 Bug #: 55374

   Summary: [asan] Can't link static libasan with static libstdc++

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: other

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com





On hjl/asan git branch, under Linux/x86-64, configured with



--enable-clocale=gnu --with-system-zlib --with-demangler-in-ld

--enable-languages=c,c++  --prefix=/usr/gcc-4.8.0

--with-local-prefix=/usr/local --enable-gnu-indirect-function --disable-werror

--with-build-config=bootstrap-asan --with-fpmath=sse



I got



/export/build/gnu/gcc-asan/build-x86_64-linux/./prev-gcc/g++

-B/export/build/gnu/gcc-asan/build-x86_64-linux/./prev-gcc/

-B/usr/gcc-4.8.0/x86_64-unknown-linux-gnu/bin/ -nostdinc++

-B/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs

-B/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs

-B/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libsanitizer/asan/.libs

-I/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu

-I/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include

-I/export/gnu/import/git/sources/gcc/libstdc++-v3/libsupc++

-L/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs

-L/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs

  -g -O2 -faddress-sanitizer -DIN_GCC   -fno-exceptions -fno-rtti

-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings

-Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long

-Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H

-static-libstdc++ -static-libgcc -faddress-sanitizer -static-libasan  -o cc1

c/c-lang.o c-family/stub-objc.o attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o

c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o c-family/c-common.o

c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o

c-family/c-gimplify.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o

c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o

c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o

tree-mudflap.o i386-c.o glibc-c.o \

  cc1-checksum.o libbackend.a main.o tree-browser.o libcommon-target.a

libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a

../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a

../libiberty/libiberty.a ../libdecnumber/libdecnumber.a   -lmpc -lmpfr -lgmp

-rdynamic  -lz

/usr/local/bin/ld: error:

/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libsanitizer/asan/.libs/libasan.a(asan_new_delete.o):

multiple definition of 'operator delete(void*)'

/usr/local/bin/ld:

/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.a(del_op.o):

previous definition here

collect2: error: ld returned 1 exit status


[Bug other/55374] [asan] Can't link static libasan with static libstdc++

2012-11-17 Thread hjl.tools at gmail dot com


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



--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2012-11-18 01:18:07 
UTC ---

-Bstatic -lasan -Bdynamic must be placed before -Bstatic -lstdc++ -Bdynamic.


[Bug other/55374] [asan] Can't link static libasan with static libstdc++

2012-11-17 Thread hjl.tools at gmail dot com


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



--- Comment #2 from H.J. Lu hjl.tools at gmail dot com 2012-11-18 01:29:57 
UTC ---

Even without -static-libasan, shouldn't -lasan be placed before

-lstdc++?



[hjl@gnu-tools-1 prev-gcc]$ ./g++ -B./  -faddress-sanitizer x.o

-B../prev-x86_64-unknown-linux-gnu/libsanitizer/asan/.libs/

-B../prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/ -v

Reading specs from ./specs

COLLECT_GCC=./g++

COLLECT_LTO_WRAPPER=./lto-wrapper

Target: x86_64-unknown-linux-gnu

Configured with: /export/gnu/import/git/sources/gcc/configure

--enable-clocale=gnu --with-system-zlib --with-demangler-in-ld

--enable-languages=c,c++ --prefix=/usr/gcc-4.8.0 --with-local-prefix=/usr/local

--enable-gnu-indirect-function --disable-werror

--with-build-config=bootstrap-asan --with-fpmath=sse

Thread model: posix

gcc version 4.8.0 20121117 (experimental) (GCC) 

COMPILER_PATH=./:../prev-x86_64-unknown-linux-gnu/libsanitizer/asan/.libs/:../prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/

LIBRARY_PATH=./:../prev-x86_64-unknown-linux-gnu/libsanitizer/asan/.libs/:../prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/:/lib/../lib64/:/usr/lib/../lib64/:/lib/:/usr/lib/

COLLECT_GCC_OPTIONS='-B' './' '-faddress-sanitizer' '-B'

'../prev-x86_64-unknown-linux-gnu/libsanitizer/asan/.libs/' '-B'

'../prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/' '-v'

'-shared-libgcc' '-mtune=generic' '-march=x86-64'

 ./collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker

/lib64/ld-linux-x86-64.so.2 /lib/../lib64/crt1.o /lib/../lib64/crti.o

./crtbegin.o -L. -L../prev-x86_64-unknown-linux-gnu/libsanitizer/asan/.libs

-L../prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/lib/../lib64

-L/usr/lib/../lib64 x.o -lstdc++ -lm -lasan -lgcc_s -lgcc -lc -lgcc_s -lgcc

./crtend.o /lib/../lib64/crtn.o

[hjl@gnu-tools-1 prev-gcc]$


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-18 Thread hjl.tools at gmail dot com

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

--- Comment #12 from H.J. Lu hjl.tools at gmail dot com 2012-11-18 13:15:59 
UTC ---
I got

/tmp/cc5sWfOD.s: Assembler messages:
/tmp/cc5sWfOD.s:824391: Error: invalid character (0xf7) in mnemonic
make[7]: *** [/tmp/ccpgVF41.ltrans24.ltrans.o] Error 1
lto-wrapper: make returned 2 exit status
/usr/local/bin/ld: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[6]: *** [cc1] Error 1
make[6]: *** Waiting for unfinished jobs

In .section .debug_info,,@progbits, there are

 824390 .byte   0x30
 824391 ÷ÿÿè^H¨=:
 824392 .uleb128 0x7


[Bug driver/55379] New: -static -static-libasan doesn't create static binary

2012-11-18 Thread hjl.tools at gmail dot com


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



 Bug #: 55379

   Summary: -static -static-libasan doesn't create static binary

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: driver

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com





[hjl@gnu-tools-1 gcc]$ ./xgcc -B./ x.o  -o x  -faddress-sanitizer

-B../x86_64-unknown-linux-gnu/libsanitizer/asan/.libs/ -static-libasan 

[hjl@gnu-tools-1 gcc]$ ldd a.out 

linux-vdso.so.1 =  (0x7fffc6991000)

libstdc++.so.6 = /lib64/libstdc++.so.6 (0x00334120)

libm.so.6 = /lib64/libm.so.6 (0x00333820)

libgomp.so.1 = /lib64/libgomp.so.1 (0x003343e0)

libgcc_s.so.1 = /lib64/libgcc_s.so.1 (0x00333aa0)

libpthread.so.0 = /lib64/libpthread.so.0 (0x003337a0)

libc.so.6 = /lib64/libc.so.6 (0x00333720)

/lib64/ld-linux-x86-64.so.2 (0x003336e0)

librt.so.1 = /lib64/librt.so.1 (0x003337e0)

[hjl@gnu-tools-1 gcc]$


[Bug driver/55379] -static -static-libasan doesn't create static binary

2012-11-18 Thread hjl.tools at gmail dot com


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



--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2012-11-18 14:52:24 
UTC ---

It should be



[hjl@gnu-tools-1 gcc]$ ./xgcc -B./ x.o  -o x  -faddress-sanitizer

-B../x86_64-unknown-linux-gnu/libsanitizer/asan/.libs/ -static-libasan -static

[hjl@gnu-tools-1 gcc]$ ldd a.out 

linux-vdso.so.1 =  (0x7fff91699000)

libstdc++.so.6 = /lib64/libstdc++.so.6 (0x00334120)

libm.so.6 = /lib64/libm.so.6 (0x00333820)

libgomp.so.1 = /lib64/libgomp.so.1 (0x003343e0)

libgcc_s.so.1 = /lib64/libgcc_s.so.1 (0x00333aa0)

libpthread.so.0 = /lib64/libpthread.so.0 (0x003337a0)

libc.so.6 = /lib64/libc.so.6 (0x00333720)

/lib64/ld-linux-x86-64.so.2 (0x003336e0)

librt.so.1 = /lib64/librt.so.1 (0x003337e0)

[hjl@gnu-tools-1 gcc]$


[Bug driver/55379] -static -static-libasan pass -Bdynamic to linker

2012-11-18 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



Summary|-static -static-libasan |-static -static-libasan

   |doesn't create static   |pass -Bdynamic  to linker

   |binary  |



--- Comment #2 from H.J. Lu hjl.tools at gmail dot com 2012-11-18 14:55:57 
UTC ---

[hjl@gnu-tools-1 gcc]$ ./xgcc -B./ x.o  -o x  -faddress-sanitizer

-B../x86_64-unknown-linux-gnu/libsanitizer/asan/.libs/ -static-libasan -static 

-v

Reading specs from ./specs

COLLECT_GCC=./xgcc

COLLECT_LTO_WRAPPER=./lto-wrapper

Target: x86_64-unknown-linux-gnu

Configured with: /export/gnu/import/git/sources/gcc/configure

--enable-languages=c,c++ --disable-bootstrap --prefix=/usr/gcc-4.8.0

--with-local-prefix=/usr/local --enable-gnu-indirect-function --with-fpmath=sse

: (reconfigured) /export/gnu/import/git/sources/gcc/configure

--disable-bootstrap --prefix=/usr/gcc-4.8.0 --with-local-prefix=/usr/local

--enable-gnu-indirect-function --with-fpmath=sse CFLAGS=-g CXXFLAGS=-g

--enable-languages=c,c++,lto --no-create --no-recursion

Thread model: posix

gcc version 4.8.0 20121117 (experimental) (GCC) 

COMPILER_PATH=./:../x86_64-unknown-linux-gnu/libsanitizer/asan/.libs/

LIBRARY_PATH=./:../x86_64-unknown-linux-gnu/libsanitizer/asan/.libs/:/lib/../lib64/:/usr/lib/../lib64/:/lib/:/usr/lib/

COLLECT_GCC_OPTIONS='-B' './' '-o' 'x' '-faddress-sanitizer' '-B'

'../x86_64-unknown-linux-gnu/libsanitizer/asan/.libs/' '-static-libasan'

'-static' '-v' '-mtune=generic' '-march=x86-64'

 ./collect2 -m elf_x86_64 -static -o x /lib/../lib64/crt1.o

/lib/../lib64/crti.o ./crtbeginT.o -L.

-L../x86_64-unknown-linux-gnu/libsanitizer/asan/.libs -L/lib/../lib64

-L/usr/lib/../lib64 x.o -Bstatic -lasan -Bdynamic --start-group -lgcc -lgcc_eh

-lc --end-group ./crtend.o /lib/../lib64/crtn.o

[hjl@gnu-tools-1 gcc]$


[Bug bootstrap/55380] New: All search_line_fast implementations read beyond buffer

2012-11-18 Thread hjl.tools at gmail dot com


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



 Bug #: 55380

   Summary: All search_line_fast implementations read beyond

buffer

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: bootstrap

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com

Depends on: 54691





Similar to PR 54691, GCC built with -faddress-sanitizer leads

to



==7876== ERROR: AddressSanitizer heap-buffer-overflow on address 0x7f3484513ff0

at pc 0x1e792db bp 0x7fffbed86340 sp 0x7fffbed86338

READ of size 16 at 0x7f3484513ff0 thread T0

#0 0x1e792da

(/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/cc1+0x1e792da)

0x7f3484513ff0 is located 0 bytes to the right of 4021-byte region

[0x7f3484513040,0x7f3484513ff5)

allocated by thread T0 here:

#0 0x1f2d48c

(/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/cc1+0x1f2d48c)

#1 0x1f2609c

(/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/cc1+0x1f2609c)

Shadow byte and word:

  0x1fe6908a27fe: 5

  0x1fe6908a27f8: 00 00 00 00 00 00 05 fb



[hjl@gnu-tools-1 gcc]$ addr2line -e cc1 0x1e792da 

/export/gnu/import/git/sources/gcc/libcpp/lex.c:393

[hjl@gnu-tools-1 gcc]$ 



All search_line_fast implementations read beyond buffer.


[Bug driver/55379] -static -static-libasan pass -Bdynamic to linker

2012-11-18 Thread hjl.tools at gmail dot com


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



--- Comment #4 from H.J. Lu hjl.tools at gmail dot com 2012-11-18 19:35:21 
UTC ---

(In reply to comment #3)

 Note: fully static linking is not supported by libsanitizer at all and I don't

 think it will. 

 Reason: on linux asan uses dlsym(RTLD_NEXT, ...) and on Mac it uses 

 (will soon use) function inerposition. 

 Neither works for fully static binaries, afaict.



Then we should issue an error if -static is used with -faddress-sanitizer.


[Bug other/55313] libsanitizer cannot be installed

2012-11-19 Thread hjl.tools at gmail dot com


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



--- Comment #6 from H.J. Lu hjl.tools at gmail dot com 2012-11-19 20:54:53 
UTC ---

It works for me on Fedora 17 with



--enable-clocale=gnu --with-system-zlib --with-demangler-in-ld

--enable-languages=c,ada,c++  --prefix=/usr/gcc-4.8.0

--with-local-prefix=/usr/local --enable-gnu-indirect-function

--build=x86_64-pc-linux-gnu --disable-libmudflap --disable-libstdcxx-pch

--disable-libada --enable-checking=yes,rtl

--with-bugurl=URL:mailto:rep...@adacore.com --disable-multilib

--with-fpmath=sse



Please show me the outputs of



# tail x86_64-pc-linux-gnu/libsanitizer/asan/libasan.la 

# tail x86_64-pc-linux-gnu/libstdc++-v3/src/libstdc++.la 



Are you using Debian?  What is the minimum configure option

to trigger this?


[Bug c/55397] New: [asan] -faddress-sanitizer should define a CPP macro

2012-11-19 Thread hjl.tools at gmail dot com


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



 Bug #: 55397

   Summary: [asan] -faddress-sanitizer should define a CPP macro

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: c

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com





See:



http://gcc.gnu.org/ml/gcc-patches/2012-11/msg01601.html


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-19 Thread hjl.tools at gmail dot com


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



--- Comment #13 from H.J. Lu hjl.tools at gmail dot com 2012-11-19 21:04:12 
UTC ---

On hjl/asan branch, I got



(gdb) r

Starting program:

/export/build/gnu/gcc-lto-asan/build-x86_64-linux/prev-gcc/cc1 -fpreprocessed

/tmp/x.i -quiet -dumpbase x.i -mtune=generic -march=x86-64 -auxbase x -version

-flto -o x.s

[Thread debugging using libthread_db enabled]

Using host libthread_db library /lib64/libthread_db.so.1.

GNU C (GCC) version 4.8.0 20121117 (experimental) (x86_64-unknown-linux-gnu)

compiled by GNU C version 4.8.0 20121117 (experimental), GMP version 5.0.2,

MPFR version 3.1.0, MPC version 0.9

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

GNU C (GCC) version 4.8.0 20121117 (experimental) (x86_64-unknown-linux-gnu)

compiled by GNU C version 4.8.0 20121117 (experimental), GMP version 5.0.2,

MPFR version 3.1.0, MPC version 0.9

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

Compiler executable checksum: 0e1eacd90672aa3f29692f9d3d99b1be

=



Breakpoint 5, __asan_report_error (pc=25644090, bp=140737488345632, 

sp=140737488345624, addr=34167900, is_write=optimized out, access_size=4)

at /export/gnu/import/git/gcc/libsanitizer/asan/asan_report.cc:464

464 bug_descr, (void*)addr, pc, bp, sp);

(gdb) bt

#0  __asan_report_error (pc=25644090, bp=140737488345632, sp=140737488345624, 

addr=34167900, is_write=optimized out, access_size=4)

at /export/gnu/import/git/gcc/libsanitizer/asan/asan_report.cc:464

#1  0x01f6bc04 in __asan::__asan_report_load4 (addr=optimized out)

at /export/gnu/import/git/gcc/libsanitizer/asan/asan_rtl.cc:194

#2  0x01874c3a in lto_write_options ()

at /export/gnu/import/git/gcc/gcc/lto-opts.c:92

#3  0x0135e932 in produce_asm_for_decls ()

at /export/gnu/import/git/gcc/gcc/lto-streamer-out.c:1407

#4  0x012a3458 in ipa_write_summaries_2(opt_pass*, lto_out_decl_state*)

[clone .565573] (pass=0x2689880 pass_ipa_lto_finish_out, 

state=0x718cce40) at /export/gnu/import/git/gcc/gcc/passes.c:2430

#5  0x0135b2a0 in ipa_write_summaries_1 (encoder=0x77d6c5c0)

at /export/gnu/import/git/gcc/gcc/passes.c:2460

#6  ipa_write_summaries () at /export/gnu/import/git/gcc/gcc/passes.c:2514

#7  0x00b16399 in ipa_passes ()

at /export/gnu/import/git/gcc/gcc/cgraphunit.c:1908

#8  compile () at /export/gnu/import/git/gcc/gcc/cgraphunit.c:1994

#9  0x00b16d2a in finalize_compilation_unit ()

at /export/gnu/import/git/gcc/gcc/cgraphunit.c:2122

#10 0x00b17271 in c_write_global_declarations ()

at /export/gnu/import/git/gcc/gcc/c/c-decl.c:10128

#11 0x00b2c258 in compile_file ()

---Type return to continue, or q return to quit---

at /export/gnu/import/git/gcc/gcc/toplev.c:559

#12 0x00b2e4b0 in do_compile ()

at /export/gnu/import/git/gcc/gcc/toplev.c:1881

#13 toplev_main (argc=14, argv=0x7fffe108)

at /export/gnu/import/git/gcc/gcc/toplev.c:1957

#14 0x0038f3a21675 in __libc_start_main () from /lib64/libc.so.6

#15 0x0056df51 in _start ()

(gdb) c

Continuing.

==1834== ERROR: AddressSanitizer global-buffer-overflow on address

0x02095c5c at pc 0x1874c3a bp 0x7fffda20 sp 0x7fffda18

READ of size 4 at 0x02095c5c thread T0

#0 0x1874c39

(/export/build/gnu/gcc-lto-asan/build-x86_64-linux/prev-gcc/cc1+0x1874c39)

0x02095c5c is located 4 bytes to the left of global variable '__FUNCTION__

(/tmp/ccHvMX0o.ltrans5.o)' (0x2095c60) of size 22

  '__FUNCTION__ (/tmp/ccHvMX0o.ltrans5.o)' is ascii string

'c_parser_if_statement'

0x02095c5c is located 30 bytes to the right of global variable

'__FUNCTION__ (/tmp/ccHvMX0o.ltrans5.o)' (0x2095c20) of size 30

  '__FUNCTION__ (/tmp/ccHvMX0o.ltrans5.o)' is ascii string

'c_parser_declaration_or_fndef'

Shadow byte and word:

  0x10412b8b: f9

  0x10412b88: f9 f9 f9 f9 00 00 06 f9

More shadow bytes:

  0x10412b68: f9 f9 f9 f9 00 00 03 f9

  0x10412b70: f9 f9 f9 f9 00 00 06 f9

  0x10412b78: f9 f9 f9 f9 00 00 03 f9

  0x10412b80: f9 f9 f9 f9 00 00 00 06

=0x10412b88: f9 f9 f9 f9 00 00 06 f9

  0x10412b90: f9 f9 f9 f9 00 00 00 02

  0x10412b98: f9 f9 f9 f9 00 00 00 01

  0x10412ba0: f9 f9 f9 f9 00 00 06 f9

  0x10412ba8: f9 f9 f9 f9 00 00 04 f9

Stats: 2M malloced (2M for red zones) by 3332 calls

Stats: 0M realloced by 285 calls

Stats: 1M freed by 1187 calls

Stats: 0M really freed by 0 calls

Stats: 8M (2059 full pages) mmaped in 16 calls

  mmaps   by size class: 7:4095; 8:2047; 9:1023; 10:511; 11:255; 12:128; 13:64;

14:32; 15:16; 16:8; 17:20; 18:2; 

  mallocs by size class: 7:2075; 8:747; 9:65; 10:95; 11:226; 12:52; 13:44;

14:1; 15:5; 16:1; 17:20; 18:1; 

  frees   by size class: 7:457; 8:359; 9:46; 10:80; 11:154; 12:46; 13

[Bug other/55313] libsanitizer cannot be installed

2012-11-19 Thread hjl.tools at gmail dot com


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



--- Comment #8 from H.J. Lu hjl.tools at gmail dot com 2012-11-20 00:14:50 
UTC ---

I tried



../gcc/configure --enable-clocale=gnu --with-system-zlib --with-demangler-in-ld

--enable-languages=c,ada,c++  --prefix=/usr/gnat --with-local-prefix=/usr/local

--enable-gnu-indirect-function --build=x86_64-pc-linux-gnu --disable-libmudflap

--disable-libstdcxx-pch --disable-libada --enable-checking=yes,rtl

--with-bugurl=URL:mailto:rep...@adacore.com --disable-multilib 



and it works for me.


[Bug middle-end/55407] New: stack-buffer-overflow in compute_working_sets

2012-11-19 Thread hjl.tools at gmail dot com


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



 Bug #: 55407

   Summary: stack-buffer-overflow in compute_working_sets

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: middle-end

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com





hjl@gnu-mic-2 gcc]$ cat /tmp/y.i

extern void abort (void);

extern void exit (int);



int expect_do1 = 1, expect_do2 = 2;



static int doit(int x){

  __label__ lbl1;

  __label__ lbl2;

  static int jtab_init = 0;

  static void *jtab[2];



  if(!jtab_init) {

jtab[0] = lbl1;

jtab[1] = lbl2;

jtab_init = 1;

  }

  goto *jtab[x];

lbl1:

  return 1;

lbl2:

  return 2;

}



static void do1(void) {

  if (doit(0) != expect_do1)

abort ();

}



static void do2(void){

  if (doit(1) != expect_do2)

abort ();

}



int main(void){

  do1();

  do2();

  exit(0);

}

[hjl@gnu-mic-2 gcc]$ ./xgcc -B./ -O3  -fprofile-arcs /tmp/y.i  

[hjl@gnu-mic-2 gcc]$ ./a.out

[hjl@gnu-mic-2 gcc]$ ./xgcc -B./ -O3 -S -fbranch-probabilities /tmp/y.i

=

==18365== ERROR: AddressSanitizer stack-buffer-overflow on address

0x79a5ee70 at pc 0xeeef8a bp 0x79a5e950 sp 0x79a5e948

READ of size 8 at 0x79a5ee70 thread T0

#0 0xeeef89

(/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/cc1+0xeeef89)

Address 0x79a5ee70 is located at offset 1184 in frame

compute_branch_probabilities of T0's stack:

  This frame has 2 object(s):

[32, 112) 'hist_br_prob'

[160, 1184) 'working_set_cum_values'

HINT: this may be a false positive if your program uses some custom stack

unwind mechanism

  (longjmp and C++ exceptions *are* supported)

Shadow byte and word:

  0x1f34bdce: f3

  0x1f34bdc8: 00 00 00 00 00 00 f3 f3

More shadow bytes:

  0x1f34bda8: 00 00 00 00 00 00 00 00

  0x1f34bdb0: 00 00 00 00 00 00 00 00

  0x1f34bdb8: 00 00 00 00 00 00 00 00

  0x1f34bdc0: 00 00 00 00 00 00 00 00

=0x1f34bdc8: 00 00 00 00 00 00 f3 f3

  0x1f34bdd0: f3 f3 00 00 00 00 00 00

  0x1f34bdd8: 00 00 00 00 00 00 00 00

  0x1f34bde0: 00 00 00 00 00 00 00 00

  0x1f34bde8: 00 00 00 00 00 00 00 00

Stats: 2M malloced (2M for red zones) by 5642 calls

Stats: 0M realloced by 344 calls

Stats: 2M freed by 3566 calls

Stats: 0M really freed by 0 calls

Stats: 8M (2059 full pages) mmaped in 16 calls

  mmaps   by size class: 7:4095; 8:2047; 9:1023; 10:511; 11:255; 12:384;

13:128; 14:32; 15:48; 16:8; 18:2; 

  mallocs by size class: 7:3557; 8:1180; 9:156; 10:80; 11:213; 12:305; 13:89;

14:17; 15:43; 16:1; 18:1; 

  frees   by size class: 7:2011; 8:794; 9:122; 10:73; 11:142; 12:301; 13:64;

14:17; 15:42; 

  rfrees  by size class: 

Stats: malloc large: 45 small slow: 115

==18365== ABORTING

[hjl@gnu-mic-2 gcc]$ 

(gdb) bt

#0  __asan_report_error (pc=15658890, bp=140737488343840, sp=140737488343832, 

addr=140737488345152, is_write=optimized out, access_size=8)

at /export/gnu/import/git/gcc/libsanitizer/asan/asan_report.cc:464

#1  0x01f2b2a4 in __asan::__asan_report_load8 (addr=optimized out)

at /export/gnu/import/git/gcc/libsanitizer/asan/asan_rtl.cc:195

#2  0x00eeef8a in compute_working_sets ()

at /export/gnu/import/git/gcc/gcc/profile.c:294

#3  get_exec_counts (lineno_checksum=0, cfg_checksum=0)

at /export/gnu/import/git/gcc/gcc/profile.c:377

#4  compute_branch_probabilities (cfg_checksum=cfg_checksum@entry=4088700122, 

lineno_checksum=lineno_checksum@entry=728892799)

at /export/gnu/import/git/gcc/gcc/profile.c:611

#5  0x00ef1e76 in branch_prob ()

at /export/gnu/import/git/gcc/gcc/profile.c:1371

#6  0x01207d7b in tree_profiling ()

at /export/gnu/import/git/gcc/gcc/tree-profile.c:483

#7  0x00eb4f84 in execute_one_pass (

pass=pass@entry=0x264a680 pass_ipa_tree_profile)

at /export/gnu/import/git/gcc/gcc/passes.c:2339

#8  0x00eb6653 in execute_ipa_pass_list (

pass=0x264a680 pass_ipa_tree_profile)

at /export/gnu/import/git/gcc/gcc/passes.c:2705

#9  0x0087cf79 in ipa_passes ()

---Type return to continue, or q return to quit---

at /export/gnu/import/git/gcc/gcc/cgraphunit.c:1871

#10 compile () at /export/gnu/import/git/gcc/gcc/cgraphunit.c:1994

#11 0x0087e58a in finalize_compilation_unit ()

at /export/gnu/import/git/gcc/gcc/cgraphunit.c:2122

#12 0x0059aec1 in c_write_global_declarations ()

at /export/gnu/import/git/gcc/gcc/c/c-decl.c:10128

#13 0x0107b11a in compile_file ()

at /export/gnu/import/git/gcc/gcc/toplev.c:559

#14 0x0107f407 in do_compile ()

at /export/gnu/import/git/gcc/gcc/toplev.c:1881

#15 toplev_main (argc=15, argv=0x7fffe0d8)

at 

[Bug c/55397] [asan] -faddress-sanitizer should define a CPP macro

2012-11-19 Thread hjl.tools at gmail dot com


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



--- Comment #4 from H.J. Lu hjl.tools at gmail dot com 2012-11-20 05:37:18 
UTC ---

(In reply to comment #3)

 

 If we end up implementing a macro, may I ask it to be named 
 ADDRESS_SANITIZER? 

 This name is already used in a few places (Chromium, WebKit, etc).



It should have `_' prefix.


[Bug middle-end/55407] stack-buffer-overflow in compute_working_sets

2012-11-21 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||DUPLICATE



--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2012-11-21 14:28:00 
UTC ---

Dup.



*** This bug has been marked as a duplicate of bug 55417 ***


[Bug gcov-profile/55417] [4.8 Regression] AddressSanitizer reports stack-buffer-overflow in profiling code

2012-11-21 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 CC||hjl.tools at gmail dot com



--- Comment #3 from H.J. Lu hjl.tools at gmail dot com 2012-11-21 14:28:01 
UTC ---

*** Bug 55407 has been marked as a duplicate of this bug. ***


[Bug gcov-profile/55417] [4.8 Regression] AddressSanitizer reports stack-buffer-overflow in profiling code

2012-11-21 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |NEW

   Last reconfirmed||2012-11-21

 Ever Confirmed|0   |1



--- Comment #4 from H.J. Lu hjl.tools at gmail dot com 2012-11-21 14:29:02 
UTC ---

There is a simple testcase in PR 55407.


[Bug c/55397] [asan] -faddress-sanitizer should define a CPP macro

2012-11-21 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED

   Target Milestone|--- |4.8.0



--- Comment #7 from H.J. Lu hjl.tools at gmail dot com 2012-11-21 20:28:52 
UTC ---

Fixed.


[Bug testsuite/55440] New: Plugin tests is compiled with wrong CFLAGS

2012-11-21 Thread hjl.tools at gmail dot com


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



 Bug #: 55440

   Summary: Plugin tests is compiled with wrong CFLAGS

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: testsuite

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com





When bootstrapping with asan:



STAGE2_CFLAGS += -fsanitize=address

STAGE3_CFLAGS += -fsanitize=address

POSTSTAGE1_LDFLAGS += -fsanitize=address -static-libasan \

  -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/.libs



all plugin tests fails with



spawn -ignore SIGHUP

/export/build/gnu/gcc-asan/build-x86_64-linux/./prev-gcc/g++

-B/export/build/gnu/gcc-asan/build-x86_64-linux/./prev-gcc/

-B/usr/local/x86_64-unknown-linux-gnu/bin/ -nostdinc++

-B/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs

-B/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs

-I/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu

-I/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include

-I/export/gnu/import/git/gcc/libstdc++-v3/libsupc++

-L/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs

-L/export/build/gnu/gcc-asan/build-x86_64-linux/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs

-O2 -g -fsanitize=address

/export/gnu/import/git/gcc/gcc/testsuite/g++.dg/plugin/dumb_plugin.c -I.

-I/export/gnu/import/git/gcc/gcc/testsuite

-I/export/gnu/import/git/gcc/gcc/testsuite/../../gcc

-I/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/testsuite/g++/../../../gcc

-I/export/gnu/import/git/gcc/gcc/testsuite/../../include

-I/export/gnu/import/git/gcc/gcc/testsuite/../../libcpp/include

-I/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/testsuite/g++/../../../intl

-DIN_GCC -fPIC -shared -o dumb_plugin.so^M

/usr/local/x86_64-unknown-linux-gnu/bin/ld: cannot find -lasan^M 



There are 2 problems:



1. plugin DSO is dlopened by linker, not GCC. Compiling it with asan may

not work correctly.  linker may not find asan DSO at run-time.

2. If we want to use BOOT CFLAGS to compile plugin DSO, we should also

use BOOT LDFLAGS to create plugin DSO.



But I don't think plugin DSO should be compiled with BOOT CFLAGS.


[Bug sanitizer/55313] libsanitizer cannot be installed

2012-11-22 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|REOPENED|WAITING



--- Comment #10 from H.J. Lu hjl.tools at gmail dot com 2012-11-22 14:15:14 
UTC ---

(In reply to comment #9)

 OK, the problem is that we change the prefix at installation time (by setting

 the prefix variable on the make install command line).

 



Does make install DESTDIR==foobar work for you?


[Bug sanitizer/55379] -static -static-libasan pass -Bdynamic to linker

2012-11-22 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



   Target Milestone|--- |4.8.0



--- Comment #8 from H.J. Lu hjl.tools at gmail dot com 2012-11-22 15:18:26 
UTC ---

Fixed.


[Bug sanitizer/55379] -static -static-libasan pass -Bdynamic to linker

2012-11-22 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|NEW |RESOLVED

 Resolution||FIXED



--- Comment #9 from H.J. Lu hjl.tools at gmail dot com 2012-11-22 15:19:00 
UTC ---

Fixed.


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-23 Thread hjl.tools at gmail dot com


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



--- Comment #15 from H.J. Lu hjl.tools at gmail dot com 2012-11-23 20:32:35 
UTC ---

I still got the same failure as in comment #13 with revision

193763.


[Bug sanitizer/55450] libtool: install: error: cannot install `libtsan.la' to a directory not ending in /usr/lib/gcc/x86_64-pc-linux-gnu/

2012-11-23 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 CC||dodji at gcc dot gnu.org,

   ||dvyukov at gcc dot gnu.org,

   ||jakub at gcc dot gnu.org,

   ||kcc at gcc dot gnu.org

  Component|other   |sanitizer

 Resolution||FIXED

   Target Milestone|--- |4.8.0



--- Comment #2 from H.J. Lu hjl.tools at gmail dot com 2012-11-23 21:16:27 
UTC ---

Fixed.


[Bug sanitizer/55313] libsanitizer cannot be installed

2012-11-23 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|WAITING |RESOLVED

 Resolution||WONTFIX



--- Comment #11 from H.J. Lu hjl.tools at gmail dot com 2012-11-23 23:11:21 
UTC ---

The reason for relink_command is that libsanitizer depends on

libstdc++.la.  make install DESTDIR==foobar works for me.


[Bug bootstrap/55455] New: [4.8 Regression] Failed to bootstrap

2012-11-23 Thread hjl.tools at gmail dot com


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



 Bug #: 55455

   Summary: [4.8 Regression] Failed to bootstrap

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: bootstrap

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com





On Linux/i686, revision 193770 gave:



../../../src-trunk/libquadmath/printf/printf_fphex.c:28:36: fatal error:

quadmath-rounding-mode.h: No such file or directory

 #include quadmath-rounding-mode.h

^

compilation terminated.


[Bug middle-end/55456] New: [4.8 Regression] 454.calculix in SPEC CPU 2006 is miscompiled

2012-11-23 Thread hjl.tools at gmail dot com


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



 Bug #: 55456

   Summary: [4.8 Regression] 454.calculix in SPEC CPU 2006 is

miscompiled

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: middle-end

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com

CC: areg.melikadam...@gmail.com





On Linux/i686, revision 193723 miscompiled

454.calculix in SPEC CPU 2006 with



-O3 -funroll-loops -msse2 -mfpmath=sse -ffast-math -ffixed-form 



454.calculix is compiled into an infinite loop.


[Bug bootstrap/55455] [4.8 Regression] Failed to bootstrap

2012-11-23 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED

   Target Milestone|--- |4.8.0



--- Comment #2 from H.J. Lu hjl.tools at gmail dot com 2012-11-24 02:02:55 
UTC ---

Fixed.


[Bug middle-end/55456] [4.8 Regression] 454.calculix in SPEC CPU 2006 is miscompiled

2012-11-23 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 CC||vmakarov at redhat dot com

   Target Milestone|--- |4.8.0



--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2012-11-24 06:58:38 
UTC ---

It is caused by revision 193310:



http://gcc.gnu.org/ml/gcc-cvs/2012-11/msg00257.html


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-24 Thread hjl.tools at gmail dot com


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



--- Comment #17 from H.J. Lu hjl.tools at gmail dot com 2012-11-24 16:39:00 
UTC ---

LTO miscompiled:



  /* Skip frontend and driver specific options here.  */

  if (!(cl_options[option-opt_index].flags 

(CL_COMMON|CL_TARGET|CL_LTO)))continue;



with



extern const struct cl_option cl_options[];



Stage 1 GCC shows



Starting program:

/export/build/gnu/gcc-lto-asan/build-x86_64-linux/stage1-gcc/cc1 -fpreprocessed

/tmp/x.i -quiet -dumpbase x.i -mtune=generic -march=x86-64 -auxbase x -version

-flto -o x.s



Breakpoint 6, main (argc=14, argv=0x7fffe0f8)

at /export/gnu/import/git/gcc/gcc/main.c:36

36  return toplev_main (argc, argv);

(gdb) p cl_options_count

$6 = 1246

(gdb) p ((struct cl_option *) cl_options)[0]

$7 = {opt_text = 0x13ef100 -###, help = 0x0, missing_argument_error = 0x0, 

  warn_message = 0x0, alias_arg = 0x0, neg_alias_arg = 0x0, 

  alias_target = 1246, back_chain = 1246, opt_len = 3 '\003', neg_index = -1, 

  flags = 524288, cl_disabled = 0, cl_separate_nargs = 0, 

  cl_separate_alias = 0, cl_negative_alias = 0, cl_no_driver_arg = 0, 

  cl_reject_driver = 0, cl_reject_negative = 0, cl_missing_ok = 0, 

  cl_uinteger = 0, cl_host_wide_int = 0, cl_tolower = 0, cl_report = 0, 

  flag_var_offset = 65535, var_enum = 0, var_type = CLVC_BOOLEAN, 

  var_value = 0}

(gdb) p cl_options[0]

$8 = {opt_text = 0x13ef100 -###, help = 0x0, missing_argument_error = 0x0, 

  warn_message = 0x0, alias_arg = 0x0, neg_alias_arg = 0x0, 

  alias_target = 1246, back_chain = 1246, opt_len = 3 '\003', neg_index = -1, 

  flags = 524288, cl_disabled = 0, cl_separate_nargs = 0, 

  cl_separate_alias = 0, cl_negative_alias = 0, cl_no_driver_arg = 0, 

  cl_reject_driver = 0, cl_reject_negative = 0, cl_missing_ok = 0, 

  cl_uinteger = 0, cl_host_wide_int = 0, cl_tolower = 0, cl_report = 0, 

  flag_var_offset = 65535, var_enum = 0, var_type = CLVC_BOOLEAN, 

  var_value = 0}

(gdb) 



Stage 2 GCC shows



Starting program:

/export/build/gnu/gcc-lto-asan/build-x86_64-linux/prev-gcc/cc1 -fpreprocessed

/tmp/x.i -quiet -dumpbase x.i -mtune=generic -march=x86-64 -auxbase x -version

-flto -o x.s

[Thread debugging using libthread_db enabled]

Using host libthread_db library /lib64/libthread_db.so.1.



Breakpoint 6, main (argc=14, argv=0x7fffe108)

at /export/gnu/import/git/gcc/gcc/main.c:36

36  return toplev_main (argc, argv);

(gdb) p ((struct cl_option *) cl_options)[0]

$24 = {

  opt_text = 0x432d2d002323232d Address 0x432d2d002323232d out of bounds, 

  help = 0x485441505353414c Address 0x485441505353414c out of bounds, 

  missing_argument_error = 0x772d6c6c612d2d00 Address 0x772d6c6c612d2d00 out

of bounds, 

  warn_message = 0x73676e696e7261 Address 0x73676e696e7261 out of bounds, 

  alias_arg = 0x2d0069736e612d2d Address 0x2d0069736e612d2d out of bounds, 

  neg_alias_arg = 0x6c626d657373612d Address 0x6c626d657373612d out of

bounds, alias_target = 101, back_chain = 11565, opt_len = 97 'a', 

  neg_index = 1627419762, flags = 1919251315, cl_disabled = 0, 

  cl_separate_nargs = 2, cl_separate_alias = 0, cl_negative_alias = 1, 

  cl_no_driver_arg = 1, cl_reject_driver = 1, cl_reject_negative = 0, 

  cl_missing_ok = 1, cl_uinteger = 0, cl_host_wide_int = 0, cl_tolower = 1, 

  cl_report = 0, flag_var_offset = 28271, var_enum = 27936, 

  var_type = 1735289203, var_value = 3242718661498139237}

(gdb)


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-24 Thread hjl.tools at gmail dot com


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



--- Comment #18 from H.J. Lu hjl.tools at gmail dot com 2012-11-24 16:49:43 
UTC ---

I think LTO is confused



extern const struct cl_option cl_options[];



with



extern const struct cl_option cl_options*;


[Bug bootstrap/54795] [4.8 Regression] Random profiledbootstrap failure with LTO

2012-11-24 Thread hjl.tools at gmail dot com


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



--- Comment #19 from H.J. Lu hjl.tools at gmail dot com 2012-11-24 17:03:13 
UTC ---

The same issue can be reproduced with this patch:



diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c

index a235f41..cd3730b 100644

--- a/gcc/lto-opts.c

+++ b/gcc/lto-opts.c

@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public

License

 along with GCC; see the file COPYING3.  If not see

 http://www.gnu.org/licenses/.  */



+#define BAD_LTO

 #include config.h

 #include system.h

 #include coretypes.h

diff --git a/gcc/opts.h b/gcc/opts.h

index b6a4361..14a31e4 100644

--- a/gcc/opts.h

+++ b/gcc/opts.h

@@ -122,7 +122,11 @@ struct cl_option_state {

   char ch;

 };



+#ifdef BAD_LTO

+extern const struct cl_option *cl_options;

+#else

 extern const struct cl_option cl_options[];

+#endif

 extern const unsigned int cl_options_count;

 extern const char *const lang_names[];

 extern const unsigned int cl_lang_count;


[Bug bootstrap/54795] [4.8 Regression] LTO miscompiled external array access

2012-11-24 Thread hjl.tools at gmail dot com


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



--- Comment #21 from H.J. Lu hjl.tools at gmail dot com 2012-11-25 07:33:50 
UTC ---

This was introduced between revision 191465 and revision 191714.


[Bug lto/54795] [4.8 Regression] LTO miscompiled external array access

2012-11-25 Thread hjl.tools at gmail dot com


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



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



  Component|bootstrap   |lto



--- Comment #22 from H.J. Lu hjl.tools at gmail dot com 2012-11-25 17:55:21 
UTC ---

This is caused by revision 191466:



http://gcc.gnu.org/ml/gcc-cvs/2012-09/msg00623.html


[Bug other/54691] [4.8 Regression] --enable-checking=valgrind doesn't build

2012-11-25 Thread hjl.tools at gmail dot com


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



--- Comment #12 from H.J. Lu hjl.tools at gmail dot com 2012-11-25 22:15:22 
UTC ---

This patch:



http://gcc.gnu.org/ml/gcc-patches/2012-11/msg01973.html



works.


[Bug lto/54795] [4.8 Regression] LTO miscompiled external array access

2012-11-25 Thread hjl.tools at gmail dot com


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



--- Comment #23 from H.J. Lu hjl.tools at gmail dot com 2012-11-25 22:36:48 
UTC ---

Another problem with revision 191466 is we lost

debug info on cl_options.  With revision 191465,

I got



(gdb) whatis cl_options

type = const struct cl_option [1221]

(gdb) 



After revision 191466, I got



(gdb) whatis cl_option

type = cl_option

(gdb)


[Bug lto/54795] [4.8 Regression] LTO miscompiled external array access

2012-11-25 Thread hjl.tools at gmail dot com


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



--- Comment #24 from H.J. Lu hjl.tools at gmail dot com 2012-11-25 22:39:57 
UTC ---

(In reply to comment #23)

 Another problem with revision 191466 is we lost

 debug info on cl_options.  With revision 191465,

 I got

 

 (gdb) whatis cl_options

 type = const struct cl_option [1221]

 (gdb) 

 

 After revision 191466, I got

 

 (gdb) whatis cl_option

 type = cl_option

 (gdb)



It was



(gdb) whatis cl_options

type = data variable, no debug info

(gdb) whatis cl_enums

type = data variable, no debug info

(gdb)  whatis cl_enums_count

type = data variable, no debug info

(gdb)


[Bug lto/55466] New: [4.8 Regression] Revision 191466 destroyed DWARF debug info

2012-11-25 Thread hjl.tools at gmail dot com


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



 Bug #: 55466

   Summary: [4.8 Regression] Revision 191466 destroyed DWARF debug

info

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: lto

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com

CC: hubi...@gcc.gnu.org





On Linux/x86-64, after revision 191466:



http://gcc.gnu.org/ml/gcc-cvs/2012-09/msg00623.html



GCC configured with



--enable-bootstrap --with-build-config=bootstrap-lto



lost debug info on data:



gnu-mic-2:pts/4[441] gdb gcc/cc1

GNU gdb (GDB) 7.5.50.20121119-cvs

Copyright (C) 2012 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.  Type show copying

and show warranty for details.

This GDB was configured as x86_64-unknown-linux-gnu.

For bug reporting instructions, please see:

http://www.gnu.org/software/gdb/bugs/...

Reading symbols from

/export/project/git/gcc-regression-bootstrap/master/191466/bld/gcc/cc1...done.

(gdb) whatis global_options

type = data variable, no debug info

(gdb) whatis cl_options

type = data variable, no debug info

(gdb) whatis cl_enums

type = data variable, no debug info

(gdb)  whatis cl_enums_count

type = data variable, no debug info

(gdb) whatis global_options_set

type = data variable, no debug info

(gdb) whatis sched_max_luid

type = data variable, no debug info

(gdb)


[Bug lto/54795] [4.8 Regression] LTO miscompiled external array access

2012-11-26 Thread hjl.tools at gmail dot com


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



--- Comment #26 from H.J. Lu hjl.tools at gmail dot com 2012-11-26 13:29:17 
UTC ---

(In reply to comment #25)

 This means that somewhere there is a cl_option definition that may prevail

 that has size 1.  lto_symtab_resolve_symbols is supposed to pick the

 largest one.  The cl_options definition that matters is in options.c,

 created

 

 const struct cl_option cl_options[] = { ... }

 

 maybe it's size isn't finished?



Isn't just we lost debug info on arrays. We lost debug

info on all data variables.  You can pick one and verify

it.



 Also

 

   || (DECL_SIZE (prevailing-symbol.decl) == DECL_SIZE 
 (e-symbol.decl)

 

 is fragile - use tree_int_cst_eq.  I suppose we don't have anything

 like a testcase?



I don't have a testcase, except for GCC itself.


[Bug driver/55470] New: Enable both ld and gold in gcc

2012-11-26 Thread hjl.tools at gmail dot com


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



 Bug #: 55470

   Summary: Enable both ld and gold in gcc

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: driver

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: hjl.to...@gmail.com

CC: dnovi...@google.com, d...@debian.org, ni...@redhat.com





This patch:



http://gcc.gnu.org/ml/gcc-patches/2011-06/msg02076.html



enables both ld and gold in gcc.  It was suggested for

trunk:



http://gcc.gnu.org/ml/gcc-patches/2011-06/msg02121.html


  1   2   3   4   5   6   7   8   9   10   >