Bug 82301 - [8 regression] Updated test case g++.dg/ext/attr-ifunc-1.C (and others) in r253041 segfault on powerpc64
Summary: [8 regression] Updated test case g++.dg/ext/attr-ifunc-1.C (and others) in r2...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 8.0
: P3 normal
Target Milestone: 8.0
Assignee: Martin Sebor
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-09-22 19:17 UTC by seurer
Modified: 2018-05-19 14:22 UTC (History)
4 users (show)

See Also:
Host: powerpc64-unknown-linux-gnu
Target: powerpc64-unknown-linux-gnu, x86_64-*-*
Build: powerpc64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2017-09-22 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description seurer 2017-09-22 19:17:27 UTC
A bunch of test cases were updated at or just before r253041 and they fail on powerpc64.  Just BE, LE works fine.

> FAIL: g++.dg/ext/attr-ifunc-1.C  -std=gnu++11 execution test
> FAIL: g++.dg/ext/attr-ifunc-1.C  -std=gnu++14 execution test
> FAIL: g++.dg/ext/attr-ifunc-1.C  -std=gnu++98 execution test
> FAIL: g++.dg/ext/attr-ifunc-2.C  -std=gnu++11 execution test
> FAIL: g++.dg/ext/attr-ifunc-2.C  -std=gnu++14 execution test
> FAIL: g++.dg/ext/attr-ifunc-2.C  -std=gnu++98 execution test
> FAIL: g++.dg/ext/attr-ifunc-3.C  -std=gnu++11 execution test
> FAIL: g++.dg/ext/attr-ifunc-3.C  -std=gnu++14 execution test
> FAIL: g++.dg/ext/attr-ifunc-3.C  -std=gnu++98 execution test
> FAIL: g++.dg/ext/attr-ifunc-4.C  -std=gnu++11 execution test
> FAIL: g++.dg/ext/attr-ifunc-4.C  -std=gnu++14 execution test
> FAIL: g++.dg/ext/attr-ifunc-4.C  -std=gnu++98 execution test

They seem to be segfaulting:

(gdb) run
Starting program: /home/seurer/gcc/build/gcc-test2/./attr-ifunc-1.exe 

Program received signal SIGSEGV, Segmentation fault.
0x0000000010000680 in Klass::resolver () at /home/seurer/gcc/gcc-test2/gcc/testsuite/g++.dg/ext/attr-ifunc-1.C:26
26	  return &Klass::implementation;
(gdb) where
#0  0x0000000010000680 in Klass::resolver () at /home/seurer/gcc/gcc-test2/gcc/testsuite/g++.dg/ext/attr-ifunc-1.C:26
#1  0x00003fffb7fc2fb0 in resolve_ifunc (sym_map=0x3fffb7ff1ed0, map=0x3fffb7ff1ed0, value=<optimized out>) at ../sysdeps/powerpc/powerpc64/dl-machine.h:630
#2  elf_machine_rela (skip_ifunc=<optimized out>, reloc_addr_arg=0x10010e88, version=<optimized out>, sym=<optimized out>, reloc=0x100003c0, map=0x3fffb7ff1ed0)
    at ../sysdeps/powerpc/powerpc64/dl-machine.h:691
#3  elf_dynamic_do_Rela (skip_ifunc=<optimized out>, lazy=<optimized out>, nrelative=<optimized out>, relsize=<optimized out>, reladdr=<optimized out>, 
    map=0x3fffb7ff1ed0) at do-rel.h:137
#4  _dl_relocate_object (scope=0x3fffb7ff2248, reloc_mode=<optimized out>, consider_profiling=<optimized out>) at dl-reloc.c:259
#5  0x00003fffb7fb73b8 in dl_main (phdr=<optimized out>, phnum=<optimized out>, user_entry=0x3fffffffea70, auxv=<optimized out>) at rtld.c:2313
#6  0x00003fffb7fd2634 in _dl_sysdep_start (start_argptr=<optimized out>, dl_main=@0x3fffb7ff0140: 0x3fffb7fb5400 <dl_main>) at ../elf/dl-sysdep.c:244
#7  0x00003fffb7fb3f48 in _dl_start_final (arg=arg@entry=0x3ffffffff150, info=info@entry=0x3fffffffebd0) at rtld.c:412
#8  0x00003fffb7fb4c28 in _dl_start (arg=0x3ffffffff150) at rtld.c:640
#9  0x00003fffb7fb3c10 in ._start () from /lib64/ld64.so.1


Some of these at least used to be marked as unsupported.
Comment 1 Martin Sebor 2017-09-22 19:30:20 UTC
The changes in r253041 are incorrect and cause failures on some other targets as well (e.g., i386).  I'm working on a fix.
Comment 2 Martin Sebor 2017-09-25 01:04:29 UTC
Patch posted for review:
https://gcc.gnu.org/ml/gcc-patches/2017-09/msg01603.html
Comment 3 Richard Biener 2017-09-25 07:57:08 UTC
Also seen on x86_64-linux.
Comment 4 Martin Sebor 2017-10-12 17:38:27 UTC
Author: msebor
Date: Thu Oct 12 17:37:56 2017
New Revision: 253688

URL: https://gcc.gnu.org/viewcvs?rev=253688&root=gcc&view=rev
Log:
PR c/82301 - Updated test case g++.dg/ext/attr-ifunc-1.C (and others) in r253041 segfault on powerpc64
PR c/82435 - new __attribute__((alias)) warning gets in the way

gcc/ChangeLog:

	PR other/82301
	PR c/82435
	* cgraphunit.c (maybe_diag_incompatible_alias): New function.
	(handle_alias_pairs): Call it.
	* common.opt (-Wattribute-alias): New option.
	* doc/extend.texi (ifunc attribute): Discuss C++ specifics.
	* doc/invoke.texi (-Wattribute-alias): Document.

gcc/testsuite/ChangeLog:

	PR other/82301
	PR c/82435
	* g++.dg/ext/attr-ifunc-1.C: Update.
	* g++.dg/ext/attr-ifunc-2.C: Same.
	* g++.dg/ext/attr-ifunc-3.C: Same.
	* g++.dg/ext/attr-ifunc-4.C: Same.
	* g++.dg/ext/attr-ifunc-5.C: Same.
	* g++.dg/ext/attr-ifunc-6.C: New test.
	* g++.old-deja/g++.abi/vtable2.C: Update.
	* gcc.dg/attr-ifunc-6.c: New test.
	* gcc.dg/attr-ifunc-7.c: New test.
	* gcc.dg/pr81854.c: Update.
	* lib/target-supports.exp: Update.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cgraphunit.c
    trunk/gcc/common.opt
    trunk/gcc/doc/extend.texi
    trunk/gcc/doc/invoke.texi
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/ext/attr-ifunc-1.C
    trunk/gcc/testsuite/g++.dg/ext/attr-ifunc-2.C
    trunk/gcc/testsuite/g++.dg/ext/attr-ifunc-3.C
    trunk/gcc/testsuite/g++.dg/ext/attr-ifunc-4.C
    trunk/gcc/testsuite/g++.dg/ext/attr-ifunc-5.C
    trunk/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C
    trunk/gcc/testsuite/gcc.dg/pr81854.c
    trunk/gcc/testsuite/lib/target-supports.exp
Comment 5 Martin Sebor 2017-10-12 17:39:02 UTC
Fixed in r253688.