[Bug lto/82027] [7/8 Regression] wrong code with -O3 -flto

2017-12-26 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82027

Alexandre Oliva  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||aoliva at gcc dot gnu.org
 Resolution|--- |FIXED
   Assignee|unassigned at gcc dot gnu.org  |jamborm at gcc dot 
gnu.org

--- Comment #15 from Alexandre Oliva  ---
AFAICT this is fixed; thanks, Martin!

[Bug lto/82027] [7/8 Regression] wrong code with -O3 -flto

2017-12-22 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82027

--- Comment #14 from Martin Jambor  ---
Author: jamborm
Date: Fri Dec 22 18:28:59 2017
New Revision: 255983

URL: https://gcc.gnu.org/viewcvs?rev=255983&root=gcc&view=rev
Log:
[PR 82027] Also stream opt_info of former_clones

2017-12-22  Martin Jambor  

PR lto/82027
* lto-cgraph.c (output_cgraph_opt_summary_p): Also check former
clones.

testsuite/
* g++.dg/lto/pr82027_0.C: New test.


Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/lto/pr82027_0.C
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/lto-cgraph.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug lto/82027] [7/8 Regression] wrong code with -O3 -flto

2017-12-22 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82027

--- Comment #13 from Martin Jambor  ---
Author: jamborm
Date: Fri Dec 22 17:03:16 2017
New Revision: 255978

URL: https://gcc.gnu.org/viewcvs?rev=255978&root=gcc&view=rev
Log:
[PR 82027] Also stream opt_info of former_clones

2017-12-22  Martin Jambor  

PR lto/82027
* lto-cgraph.c (output_cgraph_opt_summary_p): Also check former
clones.

testsuite/
* g++.dg/lto/pr82027_0.C: New test.


Added:
trunk/gcc/testsuite/g++.dg/lto/pr82027_0.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/lto-cgraph.c
trunk/gcc/testsuite/ChangeLog

[Bug lto/82027] [7/8 Regression] wrong code with -O3 -flto

2017-12-21 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82027

--- Comment #12 from Martin Jambor  ---
Thanks,  I have submitted the patch to the mailing list:

https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01457.html

[Bug lto/82027] [7/8 Regression] wrong code with -O3 -flto

2017-12-21 Thread ssbssa at yahoo dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82027

--- Comment #11 from Domani Hannes  ---
(In reply to Martin Jambor from comment #10)
> OK, so I did not realize that duplicate_thunk_for_node does not set
> clone_of but former_clone of, which is of course what it must do.  I
> have checked and this is the only place where we currently set
> former_clone_of in WPA, and therefore I am testing the following fix:
> 
> diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
> index a19f8a13dfb..ed3df15b143 100644
> --- a/gcc/lto-cgraph.c
> +++ b/gcc/lto-cgraph.c
> @@ -1958,7 +1958,7 @@ input_offload_tables (bool do_force_output)
>  static int
>  output_cgraph_opt_summary_p (struct cgraph_node *node)
>  {
> -  return (node->clone_of
> +  return ((node->clone_of || node->former_clone_of)
>   && (node->clone.tree_map
>   || node->clone.args_to_skip
>   || node->clone.combined_args_to_skip));

I can confirm that this fixes the crash in my original (non-reduced)
application.