Commit cb8cc791 by Andrew Pinski Committed by Andrew Pinski

re PR target/31568 (ICE with invalid %y operand (inline-asm))

2008-07-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR target/31568
        * config/rs6000/rs6000.c (print_operand <case 'y'>): Don't use
        gcc_assert, instead call output_operand_lossage.

2008-07-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR target/31568
        * gcc.target/powerpc/asm-y.c: New testcase.

From-SVN: r137837
parent f73c3e7c
2008-07-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR target/31568
* config/rs6000/rs6000.c (print_operand <case 'y'>): Don't use
gcc_assert, instead call output_operand_lossage.
2008-07-15 Kai Tietz <kai.tietz@onevision.com> 2008-07-15 Kai Tietz <kai.tietz@onevision.com>
* builtins.c (std_canonical_va_list): Treat structure based * builtins.c (std_canonical_va_list): Treat structure based
......
...@@ -12288,9 +12288,13 @@ print_operand (FILE *file, rtx x, int code) ...@@ -12288,9 +12288,13 @@ print_operand (FILE *file, rtx x, int code)
fprintf (file, "0,%s", reg_names[REGNO (tmp)]); fprintf (file, "0,%s", reg_names[REGNO (tmp)]);
else else
{ {
gcc_assert (GET_CODE (tmp) == PLUS if (!GET_CODE (tmp) == PLUS
&& REG_P (XEXP (tmp, 0)) || !REG_P (XEXP (tmp, 0))
&& REG_P (XEXP (tmp, 1))); || !REG_P (XEXP (tmp, 1)))
{
output_operand_lossage ("invalid %%y value, try using the 'Z' constraint");
break;
}
if (REGNO (XEXP (tmp, 0)) == 0) if (REGNO (XEXP (tmp, 0)) == 0)
fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (tmp, 1)) ], fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (tmp, 1)) ],
......
2008-07-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR target/31568
* gcc.target/powerpc/asm-y.c: New testcase.
2008-07-14 Eric Botcazou <ebotcazou@adacore.com> 2008-07-14 Eric Botcazou <ebotcazou@adacore.com>
* case_optimization1.ad[sb]: New test. * case_optimization1.ad[sb]: New test.
......
/* { dg-do compile } */
/* { dg-options "-O1" } */
/* Test that %yN does not cause an internal error if used incorrectly. */
int f(int *a)
{
asm ("#%y0" : "=m"(a[2])); /* { dg-error "try using the 'Z' constraint" } */
asm ("#%y0" : "=m"(a[1])); /* { dg-error "try using the 'Z' constraint" } */
asm ("#%y0" : "=m"(a[0]));
}
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