@@ -3794,6 +3794,23 @@ rs6000_option_override_internal (bool global_init_p)
& OPTION_MASK_DIRECT_MOVE))
rs6000_isa_flags |= ~rs6000_isa_flags_explicit & OPTION_MASK_STRICT_ALIGN;
+ /* Some options can enable OPTION_MASK_VSX implicitly, but the implicit
+ enablement is after the below checking and adjustment for TARGET_VSX,
+ it can result in some unexpected situation, like PR108240 without
+ hard float but vsx support, which is supposed to be checked and then
+ prevented in the below handlings for TARGET_VSX. So for any options
+ which can imply OPTION_MASK_VSX later, we want to imply it first here
+ to make the following checking take effects. */
+ if (!(rs6000_isa_flags_explicit & OPTION_MASK_VSX)
+ && (TARGET_P9_VECTOR
+ || TARGET_MODULO
+ || TARGET_P9_MISC
+ || TARGET_P9_MINMAX
+ || TARGET_P8_VECTOR
+ || TARGET_DIRECT_MOVE
+ || TARGET_CRYPTO))
+ rs6000_isa_flags |= OPTION_MASK_VSX;
+
/* Add some warnings for VSX. */
if (TARGET_VSX)
{
new file mode 100644
@@ -0,0 +1,27 @@
+! { dg-options "-mmodulo -mcpu=401" }
+! This need one explicit 64 bit option on 64 bit environment
+! to avoid possible error or warning message.
+! { dg-additional-options "-m64" { target lp64 } }
+
+! Verify there is no ICE on 64 bit environment.
+
+program main
+ implicit none
+ integer, parameter :: n=4
+ character(len=4), dimension(n,n) :: c
+ integer, dimension(n,n) :: a
+ integer, dimension(2) :: res1, res2
+ real, dimension(n,n) :: r
+ integer :: i,j
+ character(len=4,kind=4), dimension(n,n) :: c4
+
+ call random_number (r)
+ a = int(r*100)
+
+ do j=1,n
+ do i=1,n
+ write (*,*) a(i,j)
+ end do
+ end do
+
+end program main