[Bug fortran/82973] [8 regression] ICE in output_constant_pool_2, at varasm.c:3896 on aarch64

2017-11-23 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82973

Ramana Radhakrishnan  changed:

   What|Removed |Added

 CC||ramana at gcc dot gnu.org
Summary|ICE in  |[8 regression] ICE in
   |output_constant_pool_2, at  |output_constant_pool_2, at
   |varasm.c:3896 on aarch64|varasm.c:3896 on aarch64

--- Comment #3 from Ramana Radhakrishnan  ---
Confirmed.

I can't provoke this on GCC 7 though. Are you sure this is coming out GCC 7
rather than trunk ?

[Bug fortran/82973] [8 regression] ICE in output_constant_pool_2, at varasm.c:3896 on aarch64

2017-12-04 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82973

Wilco  changed:

   What|Removed |Added

 CC||wilco at gcc dot gnu.org

--- Comment #4 from Wilco  ---
(In reply to Martin Liška from comment #0)
> Trunk does with cross compiler:
> 
> $ aarch64-linux-gnu-gcc
> /home/marxin/Programming/gcc/gcc/testsuite/gfortran.dg/intrinsic_modulo_1.
> f90 -frounding-math -Ofast -c
> during RTL pass: final
> /home/marxin/Programming/gcc/gcc/testsuite/gfortran.dg/intrinsic_modulo_1.
> f90:37:0:
> 
>  end program main
>  
> internal compiler error: in output_constant_pool_2, at varasm.c:3896
> 0xee97bb output_constant_pool_2
>   .././../gcc/varasm.c:3896
> 0xee974d output_constant_pool_2
>   .././../gcc/varasm.c:3929
> 0xee9846 output_constant_pool_1
>   .././../gcc/varasm.c:3997
> 0xef85d9 output_constant_pool_contents
>   .././../gcc/varasm.c:4134
> 0xef9003 output_constant_pool
>   .././../gcc/varasm.c:4162
> 0xef9003 assemble_end_function(tree_node*, char const*)
>   .././../gcc/varasm.c:1912
> 0x8b0f3f rest_of_handle_final
>   .././../gcc/final.c:4488
> 0x8b0f3f execute
>   .././../gcc/final.c:4551

Well this doesn't look like a proper vector constant after cse1:

(insn 871 1529 917 122 (set (reg:V4SF 60 v28 [orig:143 vect__115.44 ] [143])
(mem/u/c:V4SF (lo_sum:DI (reg:DI 2 x2 [822])
(symbol_ref/u:DI ("*.LC3") [flags 0x2])) [0  S16
A128]){*aarch64_simd_movv4sf}
 (expr_list:REG_EQUIV (const_vector:V4SF [
(mult:SF (const_double:SF 5.0e+0 [0x0.ap+3])
(const_double:SF
3.3e-1
[0x0.aaabp-1]))
(mult:SF (const_double:SF 5.0e+0 [0x0.ap+3])
(const_double:SF
-3.3e-1
[-0x0.aaabp-1]))
(const_double:SF 5.0e+0 [0x0.ap+3])
(const_double:SF -5.0e+0 [-0x0.ap+3])
])

It believes the multiply is a constant but doesn't fold it due to
-frounding-math... I can work around it in the back-end by rejecting illegal
vector constants but I think the mid-end really shouldn't create these.