Commit 3767f512 by Janis Johnson Committed by Janis Johnson

re PR target/42416 (ICE in rs6000_bulitin_vec_perm for 177.mesa with -mvsx)

	PR target/42416
	* config/rs6000/rs6000.c (rs6000_override_options): On targets
	that support VSX, warn for -mno-altivec if vsx is not disabled,
	and disable vsx.
	* gcc.target/powerpc/warn-1.c: New test.
	* gcc.target/powerpc/warn-2.c: New test.

From-SVN: r155816
parent a6ffbb9c
2010-01-11 Janis Johnson <janis187@us.ibm.com>
PR target/42416
* config/rs6000/rs6000.c (rs6000_override_options): On targets
that support VSX, warn for -mno-altivec if vsx is not disabled,
and disable vsx.
2010-01-11 Joseph Myers <joseph@codesourcery.com> 2010-01-11 Joseph Myers <joseph@codesourcery.com>
Shujing Zhao <pearly.zhao@oracle.com> Shujing Zhao <pearly.zhao@oracle.com>
......
...@@ -2407,8 +2407,7 @@ rs6000_override_options (const char *default_cpu) ...@@ -2407,8 +2407,7 @@ rs6000_override_options (const char *default_cpu)
} }
} }
/* Add some warnings for VSX. Enable -maltivec unless the user explicitly /* Add some warnings for VSX. */
used -mno-altivec */
if (TARGET_VSX) if (TARGET_VSX)
{ {
const char *msg = NULL; const char *msg = NULL;
...@@ -2429,14 +2428,20 @@ rs6000_override_options (const char *default_cpu) ...@@ -2429,14 +2428,20 @@ rs6000_override_options (const char *default_cpu)
msg = N_("-mvsx used with little endian code"); msg = N_("-mvsx used with little endian code");
else if (TARGET_AVOID_XFORM > 0) else if (TARGET_AVOID_XFORM > 0)
msg = N_("-mvsx needs indexed addressing"); msg = N_("-mvsx needs indexed addressing");
else if (!TARGET_ALTIVEC && (target_flags_explicit & MASK_ALTIVEC))
{
if (target_flags_explicit & MASK_VSX)
msg = N_("-mvsx and -mno-altivec are incompatible");
else
msg = N_("-mno-altivec disables vsx");
}
if (msg) if (msg)
{ {
warning (0, msg); warning (0, msg);
target_flags &= ~ MASK_VSX; target_flags &= ~ MASK_VSX;
} }
else if (TARGET_VSX && !TARGET_ALTIVEC else if (TARGET_VSX && !TARGET_ALTIVEC)
&& (target_flags_explicit & MASK_ALTIVEC) == 0)
target_flags |= MASK_ALTIVEC; target_flags |= MASK_ALTIVEC;
} }
......
2010-01-11 Janis Johnson <janis187@us.ibm.com>
PR target/42416
* gcc.target/powerpc/warn-1.c: New test.
* gcc.target/powerpc/warn-2.c: New test.
2010-01-11 Uros Bizjak <ubizjak@gmail.com> 2010-01-11 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/x86_64/abi/avx/asm-support.S (snapshot_ret): Preserve * gcc.target/x86_64/abi/avx/asm-support.S (snapshot_ret): Preserve
......
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-options "-O -mvsx -mno-altivec" } */
/* { dg-warning "-mvsx and -mno-altivec are incompatible" "" { target *-*-* } 1 } */
double
foo (double *x, double *y)
{
double z[2];
int i;
for (i = 0; i < 2; i++)
z[i] = x[i] + y[i];
return z[0] * z[1];
}
/* { dg-final { scan-assembler-not "xsadddp" } } */
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-options "-O -mcpu=power7 -mno-altivec" } */
/* { dg-warning "-mno-altivec disables vsx" "" { target *-*-* } 1 } */
double
foo (double *x, double *y)
{
double z[2];
int i;
for (i = 0; i < 2; i++)
z[i] = x[i] + y[i];
return z[0] * z[1];
}
/* { dg-final { scan-assembler-not "xsadddp" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment