[Bug lto/68820] [6 regression] FAIL: gcc.c-torture/execute/builtins/memops-asm.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects

2016-01-18 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68820

Jan Hubicka  changed:

   What|Removed |Added

   Assignee|hubicka at gcc dot gnu.org |unassigned at gcc dot 
gnu.org

--- Comment #10 from Jan Hubicka  ---
OK, this reproduces for me.  We get:
Merging nodes for my_memcpy. Candidates:
my_memcpy/4 (my_memcpy) @0x76cc7450
  Type: function definition analyzed
  Visibility: force_output externally_visible public
  next sharing asm name: 36
  References: 
  Referring: 
  Read from file: memops-asm-lib.o
  First run: 0
  Function flags:
  Called by: 
  Calls: 
*my_memcpy/36 (memcpy) @0x76cc9a10
  Type: function
  Visibility: external public
  next sharing asm name: 35
  previous sharing asm name: 4
  References: 
  Referring: 
  Read from file: memops-asm.o
  First run: 0
  Function flags:
  Called by: main_test/31 (1.00 per call) 
  Calls: 
*my_memcpy/35 (__builtin_memcpy) @0x76cc9b80
  Type: function
  Visibility: external public
  previous sharing asm name: 36
  References: 
  Referring: 
  Read from file: memops-asm.o
  First run: 0
  Function flags:
  Called by: main_test/31 (1.00 per call) 
  Calls: 
Not merging decls; DECL_BUILT_IN mismatch
Not merging decls; DECL_BUILT_IN mismatch

which is expected, one memcpy and __builtin_memcpy are builtins while my_memcpy
is not.

Now at ltrans time we have:

memcpy/8 (memcpy) @0x76ccb450   
  Type: function definition analyzed
  Visibility: externally_visible public 
  References: inside_main/0 (read)  
  Referring:
  Read from file: oo.ltrans0.o  
  First run: 0  
  Function flags:   
  Called by:
  Calls: abort/13

i.e. unused memcpy and 

my_memcpy/4 (my_memcpy) @0x76cc1e60 
  Type: function definition analyzed
  Visibility: force_output externally_visible public
  References:   
  Referring: *my_memcpy/36 (alias)  
  Read from file: oo.ltrans0.o  
  First run: 0  
  Function flags: nonfreeing_fn 
  Called by:
  Calls:
*my_memcpy/36 (memcpy) @0x76cc1cf0  
  Type: function definition analyzed alias transparent_alias
  Visibility: externally_visible external public
  References: my_memcpy/4 (alias)   
  Referring:
  Read from file: oo.ltrans0.o  
  First run: 0  
  Function flags:   
  Called by: main_test/31 (1.00 per call) main_test/31 (1.00 per call)  
  Calls:
i.e. used my_memcpy

Then we get to:
(gdb) bt
#0  expand_builtin_memcpy_args (dest=0x76923fe0, src=0x76923ca0,
len=0x76918b88, target=target@entry=0x769391e0,
exp=exp@entry=0x7692eab0)
at ../../gcc/builtins.c:2904
#1  0x005db286 in expand_builtin_memcpy (target=0x769391e0,
exp=0x7692eab0) at ../../gcc/builtins.c:2991
#2  expand_builtin (exp=0x7692eab0, target=0x769391e0, subtarget=0x0,
mode=DImode, ignore=0) at ../../gcc/builtins.c:5963
#3  0x006c7bf4 in expand_expr_real_1 (exp=0x7692eab0,
target=, tmode=DImode, modifier=EXPAND_NORMAL,
alt_rtl=, 
inner_reference_p=inner_reference_p@entry=false) at ../../gcc/expr.c:10563
#4  0x006c94a9 in expand_expr_real (exp=exp@entry=0x7692eab0,
target=, tmode=,
modifier=modifier@entry=EXPAND_NORMAL, 
alt_rtl=alt_rtl@entry=0x7fffe2b0,
inner_reference_p=inner_reference_p@entry=false) at ../../gcc/expr.c:7947
#5  0x006d070a in store_expr_with_bounds (exp=exp@entry=0x7692eab0,
target=target@entry=0x769391e0, call_param_p=call_param_p@entry=0, 
nontemporal=nontemporal@entry=false, reverse=reverse@entry=false,
btarget=btarget@entry=0x76918bd0) at 

[Bug lto/68820] [6 regression] FAIL: gcc.c-torture/execute/builtins/memops-asm.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects

2016-01-18 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68820

--- Comment #11 from Jan Hubicka  ---
... and in case anyone is curious, with -fuse-linker-plugin we inline the
memcpys as we work out the block size. This is why they pass.

[Bug lto/68820] [6 regression] FAIL: gcc.c-torture/execute/builtins/memops-asm.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects

2016-01-15 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68820

--- Comment #9 from Uroš Bizjak  ---
(In reply to Jan Hubicka from comment #8)
> this does not reproduce for me at PPC nor x86-64. Are there any compilation
> farm machines that reproduce it?

-fno-use-linker-plugin is needed.

Following will trigger the abort on Fedora 23 (otherwise OK with the plugin):

$ /ssd/uros/gcc-build/gcc/xgcc -B /ssd/uros/gcc-build/gcc -O2 -g -flto
-fno-use-linker-plugin -c memops-asm.c

$ /ssd/uros/gcc-build/gcc/xgcc -B /ssd/uros/gcc-build/gcc -O2 -g -flto
-fno-use-linker-plugin -c main.c

$ /ssd/uros/gcc-build/gcc/xgcc -B /ssd/uros/gcc-build/gcc -O2 -g -flto
-fno-use-linker-plugin -c memops-asm-lib.c

$ /ssd/uros/gcc-build/gcc/xgcc -B /ssd/uros/gcc-build/gcc -O2 -g -flto
-fno-use-linker-plugin main.o memops-asm-lib.o memops-asm.o

[uros@localhost mem]$ ./a.out
Aborted (core dumped)

(gdb) r
Starting program: /home/uros/test/mem/a.out 

Program received signal SIGABRT, Aborted.
0x77a4fa98 in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x77a4fa98 in raise () from /lib64/libc.so.6
#1  0x77a5169a in abort () from /lib64/libc.so.6
#2  0x00400967 in memcpy (d=d@entry=0x601120 , s=s@entry=0x601080
, n=) at memops-asm-lib.c:67
#3  0x00400773 in main_test () at memops-asm.c:37
#4  0x004004d3 in main () at main.c:10

The problem is in the call to memcpy, my_memcpy should be called instead.

[Bug lto/68820] [6 regression] FAIL: gcc.c-torture/execute/builtins/memops-asm.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects

2016-01-14 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68820

--- Comment #8 from Jan Hubicka  ---
this does not reproduce for me at PPC nor x86-64. Are there any compilation
farm machines that reproduce it?

[Bug lto/68820] [6 regression] FAIL: gcc.c-torture/execute/builtins/memops-asm.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects

2016-01-14 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68820

Uroš Bizjak  changed:

   What|Removed |Added

 CC||ubizjak at gmail dot com

--- Comment #7 from Uroš Bizjak  ---
Also CentOS 5.11 with GNU ld version 2.17.50.0.6-26.el5 20061020.

[Bug lto/68820] [6 regression] FAIL: gcc.c-torture/execute/builtins/memops-asm.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects

2016-01-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68820

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug lto/68820] [6 regression] FAIL: gcc.c-torture/execute/builtins/memops-asm.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects

2015-12-28 Thread thopre01 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68820

Thomas Preud'homme  changed:

   What|Removed |Added

 Target|ia64-*-*,   |ia64-*-*,
   |x86_64-apple-darwin14   |x86_64-apple-darwin14,
   ||arm-none-eabi
 CC||thopre01 at gcc dot gnu.org

--- Comment #6 from Thomas Preud'homme  ---
arm-none-eabi as well.

[Bug lto/68820] [6 regression] FAIL: gcc.c-torture/execute/builtins/memops-asm.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects

2015-12-14 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68820

Rainer Orth  changed:

   What|Removed |Added

 CC||ro at gcc dot gnu.org

--- Comment #5 from Rainer Orth  ---
Solaris/x86 has it too, both with ld and gld.

[Bug lto/68820] [6 regression] FAIL: gcc.c-torture/execute/builtins/memops-asm.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects

2015-12-13 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68820

Dominique d'Humieres  changed:

   What|Removed |Added

 CC||vries at gcc dot gnu.org

--- Comment #4 from Dominique d'Humieres  ---
*** Bug 68883 has been marked as a duplicate of this bug. ***

[Bug lto/68820] [6 regression] FAIL: gcc.c-torture/execute/builtins/memops-asm.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects

2015-12-11 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68820

Eric Botcazou  changed:

   What|Removed |Added

 CC||ebotcazou at gcc dot gnu.org

--- Comment #3 from Eric Botcazou  ---
SPARC/Solaris with system linker has it as well

[Bug lto/68820] [6 regression] FAIL: gcc.c-torture/execute/builtins/memops-asm.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects

2015-12-10 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68820

Jan Hubicka  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |hubicka at gcc dot 
gnu.org

--- Comment #2 from Jan Hubicka  ---
Mine..

I wonder what makes this target specific...

[Bug lto/68820] [6 regression] FAIL: gcc.c-torture/execute/builtins/memops-asm.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects

2015-12-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68820

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |6.0

[Bug lto/68820] [6 regression] FAIL: gcc.c-torture/execute/builtins/memops-asm.c execution, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects

2015-12-09 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68820

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-12-09
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres  ---
Confirmed on x86_64-apple-darwin14.