public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/59326] New: FAIL: gcc.dg/vect/vect-simd-clone-*.c
@ 2013-11-28  9:16 dominiq at lps dot ens.fr
  2013-11-28 11:08 ` [Bug lto/59326] " jakub at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-11-28  9:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59326

            Bug ID: 59326
           Summary: FAIL: gcc.dg/vect/vect-simd-clone-*.c
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dominiq at lps dot ens.fr
                CC: jakub at gcc dot gnu.org

The tests gcc.dg/vect/vect-simd-clone-*.c fail along two lines

(1) see http://gcc.gnu.org/ml/gcc-testresults/2013-11/msg02083.html

FAIL: gcc.dg/vect/vect-simd-clone-1.c -flto -ffat-lto-objects (internal
compiler error)
FAIL: gcc.dg/vect/vect-simd-clone-1.c -flto -ffat-lto-objects (test for excess
errors)
UNRESOLVED: gcc.dg/vect/vect-simd-clone-1.c -flto -ffat-lto-objects compilation
failed to produce executable
...
FAIL: gcc.dg/vect/vect-simd-clone-9.c -flto -ffat-lto-objects (internal
compiler error)
FAIL: gcc.dg/vect/vect-simd-clone-9.c -flto -ffat-lto-objects (test for excess
errors)
UNRESOLVED: gcc.dg/vect/vect-simd-clone-9.c -flto -ffat-lto-objects compilation
failed to produce executable

The ICE is of the kind

/opt/gcc/_clean/gcc/testsuite/gcc.dg/vect/vect-simd-clone-1.c:56:1: internal
compiler error: tree code 'omp_clause' is not supported in LTO streams

These ICEs can be silenced with a line such as 

/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */

I have no idea about the short-term plans, but it seems that a regular
error/sorry would be better.

(2) With -fopenmp-simd, AVX instructions are always emitted even on target that
does not support it, see
http://gcc.gnu.org/ml/gcc-testresults/2013-11/msg02085.html

FAIL: gcc.dg/vect/vect-simd-clone-1.c (test for excess errors)
UNRESOLVED: gcc.dg/vect/vect-simd-clone-1.c compilation failed to produce
executable
...
FAIL: gcc.dg/vect/vect-simd-clone-8.c (test for excess errors)
UNRESOLVED: gcc.dg/vect/vect-simd-clone-8.c compilation failed to produce
executable


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

* [Bug lto/59326] FAIL: gcc.dg/vect/vect-simd-clone-*.c
  2013-11-28  9:16 [Bug c/59326] New: FAIL: gcc.dg/vect/vect-simd-clone-*.c dominiq at lps dot ens.fr
@ 2013-11-28 11:08 ` jakub at gcc dot gnu.org
  2013-11-28 11:25 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-28 11:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59326

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |lto
   Target Milestone|---                         |4.9.0


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

* [Bug lto/59326] FAIL: gcc.dg/vect/vect-simd-clone-*.c
  2013-11-28  9:16 [Bug c/59326] New: FAIL: gcc.dg/vect/vect-simd-clone-*.c dominiq at lps dot ens.fr
  2013-11-28 11:08 ` [Bug lto/59326] " jakub at gcc dot gnu.org
@ 2013-11-28 11:25 ` jakub at gcc dot gnu.org
  2013-11-28 13:24 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-28 11:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59326

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 31317
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31317&action=edit
gcc49-pr59326.patch

Untested LTO streaming of OMP_CLAUSEs.


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

* [Bug lto/59326] FAIL: gcc.dg/vect/vect-simd-clone-*.c
  2013-11-28  9:16 [Bug c/59326] New: FAIL: gcc.dg/vect/vect-simd-clone-*.c dominiq at lps dot ens.fr
  2013-11-28 11:08 ` [Bug lto/59326] " jakub at gcc dot gnu.org
  2013-11-28 11:25 ` jakub at gcc dot gnu.org
@ 2013-11-28 13:24 ` rguenth at gcc dot gnu.org
  2013-11-28 13:26 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-28 13:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59326

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm.  So apart from missing support for OMP_CLAUSE in hash_tree and more
important
in compare_tree_sccs_1 (all OMP_CLAUSE trees are currently considered equal
and thus merged).

The issue with the IPA cloning pass not running is that -fopenmp and
-fopenmp-simd are not LTO language frontend options and thus not handed
down to WPA or LTRANS stage.  Thus checking flag_openmp or flag_openmp_simd
(or probably flag_enable_cilkplus) in the IPA pass gate function will not
work (it's never set).

You either need to make those flags work for LTO or by other means
compute whether to execute the pass.  Hacks:

Index: gcc/omp-low.c
===================================================================
--- gcc/omp-low.c       (revision 205484)
+++ gcc/omp-low.c       (working copy)
@@ -11765,7 +11765,7 @@ public:

   /* opt_pass methods: */
   bool gate () { return flag_openmp || flag_openmp_simd
-                       || flag_enable_cilkplus; }
+                       || flag_enable_cilkplus || flag_ltrans; }
   unsigned int execute () { return ipa_omp_simd_clone (); }
 };

Index: gcc/lto/lto.c
===================================================================
--- gcc/lto/lto.c       (revision 205484)
+++ gcc/lto/lto.c       (working copy)
@@ -1402,6 +1410,11 @@ compare_tree_sccs_1 (tree t1, tree t2, t
                   TREE_STRING_LENGTH (t1)) != 0)
       return false;

+  /* Do not merge OMP_CLAUSE trees.
+     ???  No technical reason not to, just implement proper compare.  */
+  if (code == OMP_CLAUSE)
+    return false;
+
 #undef compare_values


with those I get

lto1: internal compiler error: Segmentation fault
0xaed293 crash_signal
  /space/rguenther/src/svn/trunk/gcc/toplev.c:336
0xb6a4d4 copy_forbidden
  /space/rguenther/src/svn/trunk/gcc/tree-inline.c:3261
0xb6edcd tree_versionable_function_p(tree_node*)
  /space/rguenther/src/svn/trunk/gcc/tree-inline.c:5100
0x6ce38e cgraph_function_versioning(cgraph_node*, vec<cgraph_edge*, va_heap,
vl_ptr>, vec<ipa_replace_map*, va_gc, vl_embed>*, bitmap_head_def*, bool,
bitmap_head_def*, basic_block_def*, char const*)
  /space/rguenther/src/svn/trunk/gcc/cgraphclones.c:848
0x9cae4f simd_clone_create
  /space/rguenther/src/svn/trunk/gcc/omp-low.c:10916
0x9ce798 expand_simd_clones
  /space/rguenther/src/svn/trunk/gcc/omp-low.c:11698
0x9ce92c ipa_omp_simd_clone
  /space/rguenther/src/svn/trunk/gcc/omp-low.c:11738
0x9ce9d0 execute
  /space/rguenther/src/svn/trunk/gcc/omp-low.c:11769

appearantly that's the cgraph_get_body stuff Honza mentioned.


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

* [Bug lto/59326] FAIL: gcc.dg/vect/vect-simd-clone-*.c
  2013-11-28  9:16 [Bug c/59326] New: FAIL: gcc.dg/vect/vect-simd-clone-*.c dominiq at lps dot ens.fr
                   ` (2 preceding siblings ...)
  2013-11-28 13:24 ` rguenth at gcc dot gnu.org
@ 2013-11-28 13:26 ` rguenth at gcc dot gnu.org
  2013-11-28 13:32 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-28 13:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59326

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-28
     Ever confirmed|0                           |1

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fix for that:

Index: gcc/omp-low.c
===================================================================
--- gcc/omp-low.c       (revision 205484)
+++ gcc/omp-low.c       (working copy)
@@ -11734,8 +11734,13 @@ static unsigned int
 ipa_omp_simd_clone (void)
 {
   struct cgraph_node *node;
-  FOR_EACH_FUNCTION (node)
-    expand_simd_clones (node);
+  FOR_EACH_DEFINED_FUNCTION (node)
+    {
+      if (!cgraph_function_with_gimple_body_p (node))
+       continue;
+      cgraph_get_body (node);
+      expand_simd_clones (node);
+    }
   return 0;
 }


and now it magically works.


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

* [Bug lto/59326] FAIL: gcc.dg/vect/vect-simd-clone-*.c
  2013-11-28  9:16 [Bug c/59326] New: FAIL: gcc.dg/vect/vect-simd-clone-*.c dominiq at lps dot ens.fr
                   ` (3 preceding siblings ...)
  2013-11-28 13:26 ` rguenth at gcc dot gnu.org
@ 2013-11-28 13:32 ` jakub at gcc dot gnu.org
  2013-11-28 13:37 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-28 13:32 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59326

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> Fix for that:
> 
> Index: gcc/omp-low.c
> ===================================================================
> --- gcc/omp-low.c       (revision 205484)
> +++ gcc/omp-low.c       (working copy)
> @@ -11734,8 +11734,13 @@ static unsigned int
>  ipa_omp_simd_clone (void)
>  {
>    struct cgraph_node *node;
> -  FOR_EACH_FUNCTION (node)
> -    expand_simd_clones (node);
> +  FOR_EACH_DEFINED_FUNCTION (node)
> +    {
> +      if (!cgraph_function_with_gimple_body_p (node))
> +       continue;
> +      cgraph_get_body (node);
> +      expand_simd_clones (node);
> +    }
>    return 0;
>  }
> 
> 
> and now it magically works.

But then it won't handle the !node->definition cloning (it isn't actually
cloning in that case, just creating another DECL_EXTERNAL FUNCTION_DECL with
adjusted arguments).  So it really needs to be FOR_EACH_FUNCTION, but perhaps
can avoid the cgraph_function_with_gimple_body_p/cgraph_get_body stuff if
!node->definition.


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

* [Bug lto/59326] FAIL: gcc.dg/vect/vect-simd-clone-*.c
  2013-11-28  9:16 [Bug c/59326] New: FAIL: gcc.dg/vect/vect-simd-clone-*.c dominiq at lps dot ens.fr
                   ` (4 preceding siblings ...)
  2013-11-28 13:32 ` jakub at gcc dot gnu.org
@ 2013-11-28 13:37 ` jakub at gcc dot gnu.org
  2013-11-29 10:36 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-28 13:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59326

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> But then it won't handle the !node->definition cloning (it isn't actually
> cloning in that case, just creating another DECL_EXTERNAL FUNCTION_DECL with
> adjusted arguments).  So it really needs to be FOR_EACH_FUNCTION, but
> perhaps can avoid the cgraph_function_with_gimple_body_p/cgraph_get_body
> stuff if !node->definition.

Plus the DECL_ATTRIBUTES are there even without cgraph_get_body, right?
If yes, then the two new functions should go into expand_simd_clones after we
see whether we want to clone it at all, so perhaps best into simd_clone_create
's node->definition case right before cgraph_function_versioning.


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

* [Bug lto/59326] FAIL: gcc.dg/vect/vect-simd-clone-*.c
  2013-11-28  9:16 [Bug c/59326] New: FAIL: gcc.dg/vect/vect-simd-clone-*.c dominiq at lps dot ens.fr
                   ` (5 preceding siblings ...)
  2013-11-28 13:37 ` jakub at gcc dot gnu.org
@ 2013-11-29 10:36 ` jakub at gcc dot gnu.org
  2013-11-29 10:41 ` jakub at gcc dot gnu.org
  2013-12-02 23:12 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-29 10:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59326

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Fri Nov 29 10:36:10 2013
New Revision: 205512

URL: http://gcc.gnu.org/viewcvs?rev=205512&root=gcc&view=rev
Log:
    PR lto/59326
    * tree-core.h (enum omp_clause_schedule_kind): Add
    OMP_CLAUSE_SCHEDULE_LAST.
    (enum omp_clause_default_kind): Add OMP_CLAUSE_DEFAULT_LAST.
    (enum omp_clause_depend_kind): Add OMP_CLAUSE_DEPEND_LAST.
    (enum omp_clause_map_kind): Add OMP_CLAUSE_MAP_LAST.
    (enum omp_clause_proc_bind_kind): Add OMP_CLAUSE_PROC_BIND_LAST.
    * lto-streamer-out.c (lto_is_streamable): Allow streaming
    OMP_CLAUSE.
    (DFS_write_tree_body): Handle OMP_CLAUSE.
    * tree-streamer-out.c (pack_ts_omp_clause_value_fields): New
    function.
    (streamer_pack_tree_bitfields): Call it for OMP_CLAUSE.
    (write_ts_omp_clause_tree_pointers): New function.
    (streamer_write_tree_body): Call it for OMP_CLAUSE.
    (streamer_write_tree_header): For OMP_CLAUSE stream OMP_CLAUSE_CODE.
    * tree-streamer-in.c (unpack_ts_omp_clause_value_fields): New
    function.
    (unpack_value_fields): Call it for OMP_CLAUSE.
    (streamer_alloc_tree): Handle OMP_CLAUSE.
    (lto_input_ts_omp_clause_tree_pointers): New function.
    (streamer_read_tree_body): Call it for OMP_CLAUSE.
lto/
    * lto.c (mentions_vars_p_omp_clause): New function.
    (mentions_vars_p): Call it for OMP_CLAUSE.  Remove break;
    after return stmts.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lto-streamer-out.c
    trunk/gcc/lto/ChangeLog
    trunk/gcc/lto/lto.c
    trunk/gcc/tree-core.h
    trunk/gcc/tree-streamer-in.c
    trunk/gcc/tree-streamer-out.c


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

* [Bug lto/59326] FAIL: gcc.dg/vect/vect-simd-clone-*.c
  2013-11-28  9:16 [Bug c/59326] New: FAIL: gcc.dg/vect/vect-simd-clone-*.c dominiq at lps dot ens.fr
                   ` (6 preceding siblings ...)
  2013-11-29 10:36 ` jakub at gcc dot gnu.org
@ 2013-11-29 10:41 ` jakub at gcc dot gnu.org
  2013-12-02 23:12 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-29 10:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59326

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Fri Nov 29 10:41:12 2013
New Revision: 205514

URL: http://gcc.gnu.org/viewcvs?rev=205514&root=gcc&view=rev
Log:
    PR lto/59326
    * omp-low.c (simd_clone_create): Return NULL if for definition
    !cgraph_function_with_gimple_body_p (old_node).  Call cgraph_get_body
    before calling cgraph_function_versioning.
    (expand_simd_clones): Look for "omp declare simd" attribute first.
    Don't check targetm.simd_clone.compute_vecsize_and_simdlen here.
    Punt if node->global.inlined_to.
    (pass_omp_simd_clone::gate): Also enable if in_lto_p && !flag_wpa.
    Disable pass if targetm.simd_clone.compute_vecsize_and_simdlen is NULL.
    * lto-streamer-out.c (hash_tree): Handle OMP_CLAUSE.
lto/
    * lto.c (compare_tree_sccs_1): Handle OMP_CLAUSE.
testsuite/
    * gcc.dg/vect/vect-simd-clone-12.c: New test.
    * gcc.dg/vect/vect-simd-clone-12a.c: New test.
    * gcc.dg/vect/vect-simd-clone-10a.c: Remove extern keywords.

Added:
    trunk/gcc/testsuite/gcc.dg/vect/vect-simd-clone-12.c
    trunk/gcc/testsuite/gcc.dg/vect/vect-simd-clone-12a.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lto-streamer-out.c
    trunk/gcc/lto/ChangeLog
    trunk/gcc/lto/lto.c
    trunk/gcc/omp-low.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/vect/vect-simd-clone-10a.c


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

* [Bug lto/59326] FAIL: gcc.dg/vect/vect-simd-clone-*.c
  2013-11-28  9:16 [Bug c/59326] New: FAIL: gcc.dg/vect/vect-simd-clone-*.c dominiq at lps dot ens.fr
                   ` (7 preceding siblings ...)
  2013-11-29 10:41 ` jakub at gcc dot gnu.org
@ 2013-12-02 23:12 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-12-02 23:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59326

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2013-12-02 23:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-28  9:16 [Bug c/59326] New: FAIL: gcc.dg/vect/vect-simd-clone-*.c dominiq at lps dot ens.fr
2013-11-28 11:08 ` [Bug lto/59326] " jakub at gcc dot gnu.org
2013-11-28 11:25 ` jakub at gcc dot gnu.org
2013-11-28 13:24 ` rguenth at gcc dot gnu.org
2013-11-28 13:26 ` rguenth at gcc dot gnu.org
2013-11-28 13:32 ` jakub at gcc dot gnu.org
2013-11-28 13:37 ` jakub at gcc dot gnu.org
2013-11-29 10:36 ` jakub at gcc dot gnu.org
2013-11-29 10:41 ` jakub at gcc dot gnu.org
2013-12-02 23:12 ` jakub 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).