[Bug target/61925] [4.8/4.9/5 Regression] internal error when using vectorization on CPU without SSE

2015-02-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61925

--- Comment #9 from Jakub Jelinek jakub at gcc dot gnu.org ---
Author: jakub
Date: Wed Feb 11 10:04:14 2015
New Revision: 220609

URL: https://gcc.gnu.org/viewcvs?rev=220609root=gccview=rev
Log:
PR target/61925
* config/i386/i386.c (ix86_reset_to_default_globals): Removed.
(ix86_reset_previous_fndecl): Restore it here, unconditionally.
(ix86_set_current_function): Rewritten.
(ix86_add_new_builtins): Temporarily clear current_target_pragma
when creating builtin fndecls.

* gcc.target/i386/pr61925-1.c: New test.
* gcc.target/i386/pr61925-2.c: New test.
* gcc.target/i386/pr61925-3.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/i386/pr61925-1.c
trunk/gcc/testsuite/gcc.target/i386/pr61925-2.c
trunk/gcc/testsuite/gcc.target/i386/pr61925-3.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.c
trunk/gcc/testsuite/ChangeLog


[Bug target/61925] [4.8/4.9/5 Regression] internal error when using vectorization on CPU without SSE

2015-01-28 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61925

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #6 from Jakub Jelinek jakub at gcc dot gnu.org ---
The first testcase in #c4 got fixed with r217633.


[Bug target/61925] [4.8/4.9/5 Regression] internal error when using vectorization on CPU without SSE

2015-01-28 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61925

--- Comment #7 from Jakub Jelinek jakub at gcc dot gnu.org ---
So, it seems this is a complete mess.
The reason why we ICE is that the target pragma support is broken.

The main issue I see is that ix86_reset_to_default_globals doesn't actually
reset to defaults (== target_option_default_node), but to the current target
pragma (== target_option_current_node), and that even only if
ix86_previous_fndecl was previously non-NULL and had non-NULL target specific
option.  And then ix86_set_current_function for some strange reason special
cases the defaults (i.e. NULL or == target_option_default_node), both for the
old and new, rather than the current target pragma (==
target_option_current_node).  So, the important question is, is there any
reason
why in between functions the target options (both in global_options and target
globals) should be set to something other than the defaults (==
target_option_default_node)?  I mean, it is hard to guess in what state it is
anyway, as ix86_set_current_function when going to NULL will keep it at the
latest state, so say __attribute__((target (avx2))) function definition in
a #pragma GCC target (avx) region will keep it in avx2 state afterwards
anyway.
Also, I wonder about the start of
ix86_pragma_target_parse, shouldn't prev_tree be set to
target_option_current_node rather than whatever happens to be in global_options
at that point?
Or is keeping global_options to match the current active target pragma needed
for say vector type modes?  If yes, then we should arrange for
target_option_current_node != target_option_default_node case that whenever we
ix86_set_current_function to NULL, we also restore global_options to that.

And there is another thing - I've noticed nested
ix86_valid_target_attribute_tree calls, the thing is when we are in pragma
target, decl_attributes call this function again, and that happens even when
calling ix86_add_new_builtins from this function.  I wonder if we shouldn't
temporarily clear current_target_pragma, I think the target builtin decls don't
really need that and if pragma GCC target isn't used (but target attribute
instead), it isn't done anyway.


[Bug target/61925] [4.8/4.9/5 Regression] internal error when using vectorization on CPU without SSE

2015-01-28 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61925

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

   Assignee|rguenth at gcc dot gnu.org |jakub at gcc dot gnu.org

--- Comment #8 from Jakub Jelinek jakub at gcc dot gnu.org ---
Created attachment 34608
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34608action=edit
gcc5-pr61925.patch

Untested fix that keeps the current #pragma GCC target options in
global_options if outside of functions.  Passed make check-gcc \
RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} i386.exp'
so far.


[Bug target/61925] [4.8/4.9/5 Regression] internal error when using vectorization on CPU without SSE

2014-12-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61925

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|4.8.4   |4.8.5

--- Comment #5 from Jakub Jelinek jakub at gcc dot gnu.org ---
GCC 4.8.4 has been released.


[Bug target/61925] [4.8/4.9/5 Regression] internal error when using vectorization on CPU without SSE

2014-11-25 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61925

--- Comment #4 from Richard Biener rguenth at gcc dot gnu.org ---
On trunk I get

vector.c:6:1: error: unrecognizable insn:
(insn 3 2 4 2 (set (reg/v:TI 101 [ a ])
(mem/c:TI (plus:SI (reg/f:SI 81 virtual-incoming-args)
(const_int 16 [0x10])) [1 a+0 S16 A128])) vector.c:4 -1
 (expr_list:REG_EQUIV (mem/c:TI (plus:SI (reg/f:SI 81
virtual-incoming-args)
(const_int 16 [0x10])) [1 a+0 S16 A128])
(nil)))

instead.

Reduced testcase for the convert_move ICE on the branches, ICEs at -m32
-march=i386:

#pragma GCC push_options
#pragma GCC target(sse)   
typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); 
typedef long long __m128i __attribute__ ((__vector_size__ (16),
__may_alias__));
__m128i _mm_castps_si128(__m128 __A) { }
#pragma GCC pop_options 
__attribute__((vector_size(16))) int   
f(__attribute__((vector_size(16))) int a, 
__attribute__((vector_size(16))) int b)   
{   
  return a + b; 
}

this seems to be fixed on trunk.

Reduced testcase for the ICE on trunk, ICEs at -m32 -march=i386:

#pragma GCC push_options
#pragma GCC target(sse)   
typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); 
extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__,
__artificial__)) _mm_undefined_ps (void) {  
  } 
#pragma GCC target(sse2)
#pragma GCC pop_options 
__attribute__((vector_size(16))) int f(__attribute__((vector_size(16))) int a,
__attribute__((vector_size(16))) int b) {   
   return a + b;
  }   

thus it requires a sse2 target attribute.

Would be interesting to know what fixed the convert_move ICE on trunk.


[Bug target/61925] [4.8/4.9/5 Regression] internal error when using vectorization on CPU without SSE

2014-11-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61925

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P2
 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org

--- Comment #3 from Richard Biener rguenth at gcc dot gnu.org ---
I will have a look.