public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/101261] New: clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition
@ 2021-06-29 17:02 johnnybit at gmail dot com
  2021-06-29 17:13 ` [Bug middle-end/101261] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: johnnybit at gmail dot com @ 2021-06-29 17:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101261

            Bug ID: 101261
           Summary: clones for target_clones attribute cannot be created
                    when compilling with -fno-semantic-interposition
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: johnnybit at gmail dot com
  Target Milestone: ---

darktable's user reported problem building darktable with "optimized" flags and
I could confirm the error is present on GCC 10.3.0

When compilling whole darktable with CFLAGS set to 
`-march=native -O3 -fno-semantic-interposition -flto=3 -fno-plt
-fgraphite-identity -floop-nest-optimize -fuse-linker-plugin -pipe -Wl,-O1
-Wl,--as-needed`

the compiler errors with:

src/common/iop_profile.c:1015:6: error: clones for «target_clones» attribute
cannot be created
 1015 | void dt_ioppr_transform_image_colorspace(struct dt_iop_module_t *self,
const float *const image_in,
      |      ^

I've managed to narrow it down and it was enough to just set the
-fno-semantic-interposition flag to make darktable compillation error out on
the same point.

I haven't been able to create minimum reproducer for this problem (single file
project compiles and runs ok)

for details please check https://github.com/darktable-org/darktable/issues/9303

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/101261] clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition
  2021-06-29 17:02 [Bug c/101261] New: clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition johnnybit at gmail dot com
@ 2021-06-29 17:13 ` pinskia at gcc dot gnu.org
  2021-06-30  4:38 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-06-29 17:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101261

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
  if (node->definition
      && (node->alias || !tree_versionable_function_p (node->decl)))

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/101261] clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition
  2021-06-29 17:02 [Bug c/101261] New: clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition johnnybit at gmail dot com
  2021-06-29 17:13 ` [Bug middle-end/101261] " pinskia at gcc dot gnu.org
@ 2021-06-30  4:38 ` marxin at gcc dot gnu.org
  2021-08-13  8:24 ` marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-30  4:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101261

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
                 CC|                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2021-06-30

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
I'll take a look.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/101261] clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition
  2021-06-29 17:02 [Bug c/101261] New: clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition johnnybit at gmail dot com
  2021-06-29 17:13 ` [Bug middle-end/101261] " pinskia at gcc dot gnu.org
  2021-06-30  4:38 ` marxin at gcc dot gnu.org
@ 2021-08-13  8:24 ` marxin at gcc dot gnu.org
  2021-08-13  8:36 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-08-13  8:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101261

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Can you please attach the problematic pre-processed source file (using -E
option)?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/101261] clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition
  2021-06-29 17:02 [Bug c/101261] New: clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition johnnybit at gmail dot com
                   ` (2 preceding siblings ...)
  2021-08-13  8:24 ` marxin at gcc dot gnu.org
@ 2021-08-13  8:36 ` marxin at gcc dot gnu.org
  2021-08-13  9:01 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-08-13  8:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101261

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Good, I was able to create a test-case, now I'm reducing it..

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/101261] clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition
  2021-06-29 17:02 [Bug c/101261] New: clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition johnnybit at gmail dot com
                   ` (3 preceding siblings ...)
  2021-08-13  8:36 ` marxin at gcc dot gnu.org
@ 2021-08-13  9:01 ` marxin at gcc dot gnu.org
  2021-08-13 13:44 ` [Bug ipa/101261] " cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-08-13  9:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101261

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Reduced test-case:

$ cat iop_profile.i
void
__attribute__((target_clones("default", "avx2")))
dt_ioppr_transform_image_colorspace()
{
  dt_ioppr_transform_image_colorspace();
}

$ gcc iop_profile.i -fno-semantic-interposition -c -fPIC
iop_profile.i:3:1: error: clones for ‘target_clones’ attribute cannot be
created
    3 | dt_ioppr_transform_image_colorspace()
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
iop_profile.i:3:1: note: ‘target_clones’ cannot be combined with ‘alias’
attribute

I've got a patch candidate.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug ipa/101261] clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition
  2021-06-29 17:02 [Bug c/101261] New: clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition johnnybit at gmail dot com
                   ` (4 preceding siblings ...)
  2021-08-13  9:01 ` marxin at gcc dot gnu.org
@ 2021-08-13 13:44 ` cvs-commit at gcc dot gnu.org
  2021-08-13 13:45 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-13 13:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101261

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>:

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

commit r12-2900-gfa28520fadb9405f4387ceb419b0b7fc3ba0a61f
Author: Martin Liska <mliska@suse.cz>
Date:   Fri Aug 13 11:10:56 2021 +0200

    ipa: do not make localaliases for target_clones [PR101261]

            PR ipa/101261

    gcc/ChangeLog:

            * symtab.c (symtab_node::noninterposable_alias): Do not create
              local aliases for target_clone functions as the clonning pass
              rejects aliases.

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/pr101261.c: New test.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug ipa/101261] clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition
  2021-06-29 17:02 [Bug c/101261] New: clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition johnnybit at gmail dot com
                   ` (5 preceding siblings ...)
  2021-08-13 13:44 ` [Bug ipa/101261] " cvs-commit at gcc dot gnu.org
@ 2021-08-13 13:45 ` marxin at gcc dot gnu.org
  2021-08-16 11:14 ` cvs-commit at gcc dot gnu.org
  2021-08-16 11:16 ` marxin at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-08-13 13:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101261

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |12.0

--- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed on master so far.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug ipa/101261] clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition
  2021-06-29 17:02 [Bug c/101261] New: clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition johnnybit at gmail dot com
                   ` (6 preceding siblings ...)
  2021-08-13 13:45 ` marxin at gcc dot gnu.org
@ 2021-08-16 11:14 ` cvs-commit at gcc dot gnu.org
  2021-08-16 11:16 ` marxin at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-16 11:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101261

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Martin Liska
<marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:076b214b1431630aa1c37c13f0bbea85a91a32e8

commit r11-8869-g076b214b1431630aa1c37c13f0bbea85a91a32e8
Author: Martin Liska <mliska@suse.cz>
Date:   Fri Aug 13 11:10:56 2021 +0200

    ipa: do not make localaliases for target_clones [PR101261]

            PR ipa/101261

    gcc/ChangeLog:

            * symtab.c (symtab_node::noninterposable_alias): Do not create
              local aliases for target_clone functions as the clonning pass
              rejects aliases.

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/pr101261.c: New test.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug ipa/101261] clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition
  2021-06-29 17:02 [Bug c/101261] New: clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition johnnybit at gmail dot com
                   ` (7 preceding siblings ...)
  2021-08-16 11:14 ` cvs-commit at gcc dot gnu.org
@ 2021-08-16 11:16 ` marxin at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-08-16 11:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101261

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
      Known to work|                            |11.2.1

--- Comment #9 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed in gcc-11 branch, I'm not planning backport that more.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-08-16 11:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29 17:02 [Bug c/101261] New: clones for target_clones attribute cannot be created when compilling with -fno-semantic-interposition johnnybit at gmail dot com
2021-06-29 17:13 ` [Bug middle-end/101261] " pinskia at gcc dot gnu.org
2021-06-30  4:38 ` marxin at gcc dot gnu.org
2021-08-13  8:24 ` marxin at gcc dot gnu.org
2021-08-13  8:36 ` marxin at gcc dot gnu.org
2021-08-13  9:01 ` marxin at gcc dot gnu.org
2021-08-13 13:44 ` [Bug ipa/101261] " cvs-commit at gcc dot gnu.org
2021-08-13 13:45 ` marxin at gcc dot gnu.org
2021-08-16 11:14 ` cvs-commit at gcc dot gnu.org
2021-08-16 11:16 ` marxin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).