[Bug target/85900] [9 Regression] ICEs after revision r260547 on darwin.

2018-05-28 Thread hjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85900

--- Comment #9 from hjl at gcc dot gnu.org  ---
Author: hjl
Date: Mon May 28 13:44:18 2018
New Revision: 260849

URL: https://gcc.gnu.org/viewcvs?rev=260849=gcc=rev
Log:
Don't mark IFUNC resolver as only called directly

Since IFUNC resolver is called indirectly, don't mark IFUNC resolver as
only called directly.  This patch adds ifunc_resolver to cgraph_node,
sets ifunc_resolver for ifunc attribute and checks ifunc_resolver
instead of looking up ifunc attribute.

gcc/

Backport from mainline
2018-05-26  H.J. Lu  

PR target/85900
PR target/85345
* varasm.c (assemble_alias): Lookup ifunc attribute on error.

2018-05-24  H.J. Lu  

PR target/85900
PR target/85345
* varasm.c (assemble_alias): Check ifunc_resolver only on
FUNCTION_DECL.

2018-05-22  H.J. Lu  

PR target/85345
* cgraph.h (cgraph_node::create): Set ifunc_resolver for ifunc
attribute.
(cgraph_node::create_alias): Likewise.
(cgraph_node::get_availability): Check ifunc_resolver instead
of looking up ifunc attribute.
* cgraphunit.c (maybe_diag_incompatible_alias): Likewise.
* varasm.c (do_assemble_alias): Likewise.
(assemble_alias): Likewise.
(default_binds_local_p_3): Likewise.
* cgraph.h (cgraph_node): Add ifunc_resolver.
(cgraph_node::only_called_directly_or_aliased_p): Return false
for IFUNC resolver.
* lto-cgraph.c (input_node): Set ifunc_resolver for ifunc
attribute.
* symtab.c (symtab_node::verify_base): Verify that ifunc_resolver
is equivalent to lookup_attribute ("ifunc", DECL_ATTRIBUTES (decl)).
(symtab_node::binds_to_current_def_p): Check ifunc_resolver
instead of looking up ifunc attribute.

gcc/testsuite/

Backport from mainline
2018-05-24  Rainer Orth  

* gcc.target/i386/pr85345.c: Require ifunc support.

2018-05-22  H.J. Lu  

PR target/85345
* gcc.target/i386/pr85345.c: New test.

Added:
branches/gcc-8-branch/gcc/testsuite/gcc.target/i386/pr85345.c
Modified:
branches/gcc-8-branch/gcc/ChangeLog
branches/gcc-8-branch/gcc/cgraph.c
branches/gcc-8-branch/gcc/cgraph.h
branches/gcc-8-branch/gcc/cgraphunit.c
branches/gcc-8-branch/gcc/lto-cgraph.c
branches/gcc-8-branch/gcc/symtab.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog
branches/gcc-8-branch/gcc/varasm.c

[Bug target/85900] [9 Regression] ICEs after revision r260547 on darwin.

2018-05-26 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85900

H.J. Lu  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from H.J. Lu  ---
Fixed.

[Bug target/85900] [9 Regression] ICEs after revision r260547 on darwin.

2018-05-26 Thread hjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85900

--- Comment #7 from hjl at gcc dot gnu.org  ---
Author: hjl
Date: Sat May 26 11:35:31 2018
New Revision: 260792

URL: https://gcc.gnu.org/viewcvs?rev=260792=gcc=rev
Log:
 Don't check ifunc_resolver on error

Since ifunc_resolver isn't set when an error is detected, we should
lookup ifunc attribute in this case.

PR target/85900
PR target/85345
* varasm.c (assemble_alias): Lookup ifunc attribute on error.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/varasm.c

[Bug target/85900] [9 Regression] ICEs after revision r260547 on darwin.

2018-05-26 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85900

--- Comment #6 from Dominique d'Humieres  ---
> This patch fixes the ICE and related problems I have spotted. Full testing
> in progress.

Back to "normal"!

[Bug target/85900] [9 Regression] ICEs after revision r260547 on darwin.

2018-05-25 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85900

--- Comment #5 from Dominique d'Humieres  ---
> A patch is posted at
>
> https://gcc.gnu.org/ml/gcc-patches/2018-05/msg01495.html

This patch fixes the ICE and related problems I have spotted. Full testing in
progress.

Thanks.

[Bug target/85900] [9 Regression] ICEs after revision r260547 on darwin.

2018-05-25 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85900

--- Comment #4 from H.J. Lu  ---
(In reply to Dominique d'Humieres from comment #3)
> Revision r260683 fixes the ICE for the test gcc.dg/torture/pr48044.c, but
> not for the second one in comment 0:

A patch is posted at

https://gcc.gnu.org/ml/gcc-patches/2018-05/msg01495.html

[Bug target/85900] [9 Regression] ICEs after revision r260547 on darwin.

2018-05-25 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85900

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-05-25
 Ever confirmed|0   |1

--- Comment #3 from Dominique d'Humieres  ---
Revision r260683 fixes the ICE for the test gcc.dg/torture/pr48044.c, but not
for the second one in comment 0:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=1, address=0x4)
frame #0: 0x00010121f078 cc1`assemble_alias(tree_node*, tree_node*) at
varasm.c:5921
   5918   if (!DECL_WEAK (decl))
   5919 {
   5920   if (TREE_CODE (decl) == FUNCTION_DECL
-> 5921   && cgraph_node::get (decl)->ifunc_resolver)
   5922 error_at (DECL_SOURCE_LOCATION (decl),
   5923   "ifunc is not supported in this configuration");
   5924   else
Target 0: (cc1) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=1, address=0x4)
  * frame #0: 0x00010121f078 cc1`assemble_alias(tree_node*, tree_node*) at
varasm.c:5921
frame #1: 0x000100abe828
cc1`rest_of_decl_compilation(decl=0x000145957200, top_level=,
at_end=0) at passes.c:193
frame #2: 0x00010001b3cf cc1`finish_decl(decl=0x000145957200,
init_loc=, init=, origtype=,
asmspec_tree=) at c-decl.c:5120
frame #3: 0x000100077688
cc1`::c_parser_declaration_or_fndef(parser=0x00014580f168,
fndef_ok=, static_assert_ok=, empty_ok=,
nested=, start_attr_ok=,
objc_foreach_object_declaration=,
omp_declare_simd_clauses=vec @ 0x7ffeefbff008,
oacc_routine_data=, fallthru_attr_p=) at
c-parser.c:2175
frame #4: 0x00010007f54e
cc1`::c_parser_external_declaration(parser=0x00014580f168) at
c-parser.c:1643
frame #5: 0x00010007fde4 cc1`c_parse_file() at c-parser.c:1524
frame #6: 0x0001000d393e cc1`c_common_parse_file() at c-opts.c:1132
frame #7: 0x000100bbacda cc1`::compile_file() at toplev.c:455
frame #8: 0x0001012348ab cc1`toplev::main(int, char**) at toplev.c:2132
frame #9: 0x0001012363ee cc1`main(argc=2, argv=0x7ffeefbff250) at
main.c:39

[Bug target/85900] [9 Regression] ICEs after revision r260547 on darwin.

2018-05-24 Thread hjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85900

--- Comment #2 from hjl at gcc dot gnu.org  ---
Author: hjl
Date: Thu May 24 19:51:09 2018
New Revision: 260683

URL: https://gcc.gnu.org/viewcvs?rev=260683=gcc=rev
Log:
Check ifunc_resolver only on FUNCTION_DECL

Since ifunc_resolver is only valid on FUNCTION_DECL, check ifunc_resolver
only on FUNCTION_DECL.

PR target/85900
PR target/85345
* varasm.c (assemble_alias): Check ifunc_resolver only on
FUNCTION_DECL.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/varasm.c

[Bug target/85900] [9 Regression] ICEs after revision r260547 on darwin.

2018-05-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85900

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1
   Target Milestone|--- |9.0

--- Comment #1 from Richard Biener  ---
Note the rev. is going to be backported so watch out there as well.