[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2024-05-15 Thread ro at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

Rainer Orth  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|WAITING |RESOLVED

--- Comment #16 from Rainer Orth  ---
Actually close as fixed.

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2024-05-15 Thread ro at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

Rainer Orth  changed:

   What|Removed |Added

   Assignee|ro at CeBiTec dot Uni-Bielefeld.DE |ro at gcc dot gnu.org
   Target Milestone|--- |15.0
URL||https://gcc.gnu.org/piperma
   ||il/gcc-patches/2024-May/651
   ||780.html

--- Comment #15 from Rainer Orth  ---
Fixed for GCC 15.

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2024-05-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

--- Comment #14 from GCC Commits  ---
The master branch has been updated by Rainer Orth :

https://gcc.gnu.org/g:ff105c39bde43bdb57615e3a4c7af71fbef5f26e

commit r15-511-gff105c39bde43bdb57615e3a4c7af71fbef5f26e
Author: Rainer Orth 
Date:   Wed May 15 13:23:08 2024 +0200

testsuite: Require lto-plugin in gcc.dg/ipa/ipa-icf-38.c [PR85656]

gcc.dg/ipa/ipa-icf-38.c currently FAILs on Solaris (SPARC and x86, 32
and 64-bit):

FAIL: gcc.dg/ipa/ipa-icf-38.c scan-ltrans-tree-dump-not optimized "Function
bar"

As it turns out, this only happens when the Solaris linker is used; with
GNU ld the test PASSes just fine.  In fact, that happens because gld
supports the lto-plugin while ld does not: in a Solaris build with gld,
the test FAILs the same way as with ld when -fno-use-linker-plugin is
passed, so this patch requires linker_plugin.

Tested on i386-pc-solaris2.11 (ld and gld) and x86_64-pc-linux-gnu.

2024-05-15  Rainer Orth  

gcc/testsuite:
PR ipa/85656
* gcc.dg/ipa/ipa-icf-38.c: Require linker_plugin.

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2023-08-20 Thread fxcoudert at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

Francois-Xavier Coudert  changed:

   What|Removed |Added

 CC||fxcoudert at gcc dot gnu.org

--- Comment #13 from Francois-Xavier Coudert  ---
That test case also fails on darwin. Adding:

diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
index 452e1b88514..57c5262dd4a 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
@@ -1,4 +1,5 @@
 /* { dg-do link } */
+/* { dg-require-alias "" } */
 /* { dg-options "-O2 -fdump-ipa-icf-optimized -flto -fdump-tree-optimized" }
*/
 /* { dg-require-effective-target lto } */
 /* { dg-additional-sources "ipa-icf-38a.c" }*/

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2019-03-13 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

--- Comment #12 from John David Anglin  ---
Created attachment 45962
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45962=edit
Tree dump

For
FAIL: gcc.dg/ipa/ipa-icf-38.c scan-ltrans-tree-dump-not optimized "Function
bar"
on hppa64-hp-hpux11.11.

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2018-07-20 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

--- Comment #11 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
Just for the record: according to gcc-testresults, the test also FAILs
on hppa64-hp-hpux11.11.

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2018-07-20 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

--- Comment #10 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
I haven't yet gotten around to looking closer, sorry.

I'll report once I've found something.

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2018-07-20 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

--- Comment #9 from Martin Liška  ---
Rainer?

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2018-06-04 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

--- Comment #8 from Martin Liška  ---
Ok and can you please analyze why this return true:

  1139/* Creating a symtab alias is the optimal way to merge.
  1140   It however can not be used in the following cases:
  1141  
  1142   1) if ORIGINAL and ALIAS may be possibly compared for address
equality.
  1143   2) if ORIGINAL is in a section that may be discarded by linker or
if
  1144  it is an external functions where we can not create an alias
  1145  (ORIGINAL_DISCARDABLE)
  1146   3) if target do not support symbol aliases.
  1147   4) original and alias lie in different comdat groups.
  1148  
  1149   If we can not produce alias, we will turn ALIAS into WRAPPER of
ORIGINAL
  1150   and/or redirect all callers from ALIAS to ORIGINAL.  */
  1151if ((original_address_matters && alias_address_matters)
  1152|| (original_discardable
  1153&& (!DECL_COMDAT_GROUP (alias->decl)
  1154|| (DECL_COMDAT_GROUP (alias->decl)
  1155!= DECL_COMDAT_GROUP (original->decl
  1156|| original_discarded
  1157|| !sem_item::target_supports_symbol_aliases_p ()
  1158|| DECL_COMDAT_GROUP (alias->decl) != DECL_COMDAT_GROUP
(original->decl))
  1159  {

Thanks.

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2018-05-18 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

--- Comment #7 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #6 from Martin Liška  ---
[...]
> So can you please debug why we go into following branch:
>   1277if (!create_wrapper
>   1278&& !alias->call_for_symbol_and_aliases
> (cgraph_node::has_thunk_p,
>   1279NULL, true)
>   1280&& !alias->can_remove_if_no_direct_calls_p ())
>   1281  {
>   1282if (dump_file)
>   1283  fprintf (dump_file, "Not unifying; can not make wrapper 
> and
> "
>   1284   "function has other uses than direct calls\n\n");
>   1285return false;
>   1286  }
>
> I'm curious why can_remove_if_no_direct_calls_p returns false.

It took me a bit figuring out which of the two lto1 invocations was the
interesting one, then rebuilding with -g3 -O0 to be able to see anything
useful in gdb.

Here's what I found:

ipa-icf.c:1280 (sem_function::merge)

  && !alias->can_remove_if_no_direct_calls_p ())

cgraph.c:2848 (cgraph_node::can_remove_if_no_direct_calls_p)

  return !call_for_symbol_and_aliases (nonremovable_p, NULL, true);

cgraph.h:3213 (cgraph_node::call_for_symbol_and_aliases)

  if (callback (this, data))
return true;

cgraph.c:2829 (nonremovable_p)

  return !node->can_remove_if_no_direct_calls_and_refs_p ();

cgraph.h:2924 (cgraph_node::can_remove_if_no_direct_calls_and_refs_p)

  /* Only COMDAT functions can be removed if externally visible.  */
  if (externally_visible
  && (!DECL_COMDAT (decl)
  || forced_by_abi
  || used_from_object_file_p ()))
return false;

externally_visible = 1 and If I'm not mistaken, decl is not comdat, thus
return false:

 
unit-size 
align:32 warn_if_not_align:0 symtab:0 alias-set 1 canonical-type
faefb3c0 precision:32 min  max 
pointer_to_this >
QI
size 
unit-size 
align:8 warn_if_not_align:0 symtab:0 alias-set -1 structural-equality
arg-types >
pointer_to_this >
readonly addressable nothrow public static function-specific-target
function-specific-opt uninlinable QI
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/ipa/ipa-icf-38a.c:6:5 align:8
warn_if_not_align:0 context 
attributes > initial 
result 
ignored SI
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/ipa/ipa-icf-38a.c:6:5 size
 unit-size 
align:32 warn_if_not_align:0 context >
struct-function fa52b1a0>

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2018-05-15 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

Martin Liška  changed:

   What|Removed |Added

 Status|ASSIGNED|WAITING

--- Comment #6 from Martin Liška  ---
(In reply to r...@cebitec.uni-bielefeld.de from comment #5)
> > --- Comment #4 from Martin Liška  ---
> [...]
> > According to log file alias support is mission on solaris. Thus following 
> > patch
> > should fix that by skipping the test:
> >
> > diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
> > b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
> > index 85531ab1cf3..45525844551 100644
> > --- a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
> > +++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
> > @@ -1,4 +1,5 @@
> >  /* { dg-do link } */
> > +/* { dg-require-alias "" } */
> >  /* { dg-options "-O2 -fdump-ipa-icf -flto -fdump-tree-fixup_cfg4" } */
> >  /* { dg-require-effective-target lto } */
> >  /* { dg-additional-sources "ipa-icf-38a.c" }*/
> >
> > Can you please verify that?
> 
> The patch doesn't make a difference as Solaris *does* support attribute
> alias, even when using as and ld.  However, I noticed that the
> unmodified test PASSes when using gas/gld instead, so there is a
> toolchain difference that causes this failure.

So can you please debug why we go into following branch:
  1277if (!create_wrapper
  1278&& !alias->call_for_symbol_and_aliases
(cgraph_node::has_thunk_p,
  1279NULL, true)
  1280&& !alias->can_remove_if_no_direct_calls_p ())
  1281  {
  1282if (dump_file)
  1283  fprintf (dump_file, "Not unifying; can not make wrapper and
"
  1284   "function has other uses than direct calls\n\n");
  1285return false;
  1286  }

I'm curious why can_remove_if_no_direct_calls_p returns false.

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2018-05-14 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

--- Comment #5 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #4 from Martin Liška  ---
[...]
> According to log file alias support is mission on solaris. Thus following 
> patch
> should fix that by skipping the test:
>
> diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
> b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
> index 85531ab1cf3..45525844551 100644
> --- a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
> +++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
> @@ -1,4 +1,5 @@
>  /* { dg-do link } */
> +/* { dg-require-alias "" } */
>  /* { dg-options "-O2 -fdump-ipa-icf -flto -fdump-tree-fixup_cfg4" } */
>  /* { dg-require-effective-target lto } */
>  /* { dg-additional-sources "ipa-icf-38a.c" }*/
>
> Can you please verify that?

The patch doesn't make a difference as Solaris *does* support attribute
alias, even when using as and ld.  However, I noticed that the
unmodified test PASSes when using gas/gld instead, so there is a
toolchain difference that causes this failure.

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2018-05-11 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

--- Comment #4 from Martin Liška  ---
(In reply to Rainer Orth from comment #3)
> Created attachment 44108 [details]
> i386-pc-solaris2.11 ipa-icf-38.exe.wpa.073i.icf
> 
> It's only one part that fails
> 
> FAIL: gcc.dg/ipa/ipa-icf-38.c scan-ltrans-tree-dump-not fixup_cfg4 "Function
> bar"
> 
> which was introduced by
> 
> 2018-05-02  Tom de Vries  
> 
> PR testsuite/85106
> * gcc.dg/ipa/ipa-icf-38.c: Use scan-ltrans-tree-dump.
> [...]

According to log file alias support is mission on solaris. Thus following patch
should fix that by skipping the test:

diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
index 85531ab1cf3..45525844551 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
@@ -1,4 +1,5 @@
 /* { dg-do link } */
+/* { dg-require-alias "" } */
 /* { dg-options "-O2 -fdump-ipa-icf -flto -fdump-tree-fixup_cfg4" } */
 /* { dg-require-effective-target lto } */
 /* { dg-additional-sources "ipa-icf-38a.c" }*/

Can you please verify that?

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2018-05-11 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

Martin Liška  changed:

   What|Removed |Added

 Status|WAITING |ASSIGNED
  Known to fail||9.0

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2018-05-10 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

--- Comment #3 from Rainer Orth  ---
Created attachment 44108
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44108=edit
i386-pc-solaris2.11 ipa-icf-38.exe.wpa.073i.icf

It's only one part that fails

FAIL: gcc.dg/ipa/ipa-icf-38.c scan-ltrans-tree-dump-not fixup_cfg4 "Function
bar"

which was introduced by

2018-05-02  Tom de Vries  

PR testsuite/85106
* gcc.dg/ipa/ipa-icf-38.c: Use scan-ltrans-tree-dump.
[...]

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2018-05-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

Martin Liška  changed:

   What|Removed |Added

 Status|ASSIGNED|WAITING

--- Comment #2 from Martin Liška  ---
Can you please attach WPA ICF dump file. It should say why it's failing.
And do you know how long has been that failing?

[Bug ipa/85656] gcc.dg/ipa/ipa-icf-38.c FAILs

2018-05-09 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85656

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2018-05-09
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Mine.