public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/31568] New: ICE with invalid %y operand (inline-asm)
@ 2007-04-13 22:05 pinskia at gcc dot gnu dot org
2007-07-09 8:50 ` [Bug target/31568] " pinskia at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-04-13 22:05 UTC (permalink / raw)
To: gcc-bugs
Testcase:
int f(int *a)
{
asm("%y0" : "=m"(a[2]) );
}
This should instead produce an error with recommending the Z constraint.
--
Summary: ICE with invalid %y operand (inline-asm)
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc*-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31568
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/31568] ICE with invalid %y operand (inline-asm)
2007-04-13 22:05 [Bug target/31568] New: ICE with invalid %y operand (inline-asm) pinskia at gcc dot gnu dot org
@ 2007-07-09 8:50 ` pinskia at gcc dot gnu dot org
2008-07-14 12:43 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-09 8:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2007-07-09 08:50 -------
I have a patch for this when I get back in August.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-07-09 08:50:46
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31568
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/31568] ICE with invalid %y operand (inline-asm)
2007-04-13 22:05 [Bug target/31568] New: ICE with invalid %y operand (inline-asm) pinskia at gcc dot gnu dot org
2007-07-09 8:50 ` [Bug target/31568] " pinskia at gcc dot gnu dot org
@ 2008-07-14 12:43 ` pinskia at gcc dot gnu dot org
2008-07-15 12:54 ` pinskia at gcc dot gnu dot org
2008-07-15 12:54 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-07-14 12:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2008-07-14 12:43 -------
Testing this patch right now:
Index: testsuite/gcc.target/powerpc/asm-y.c
===================================================================
--- testsuite/gcc.target/powerpc/asm-y.c (revision 0)
+++ testsuite/gcc.target/powerpc/asm-y.c (revision 0)
@@ -0,0 +1,11 @@
+/* { 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]));
+}
Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c (revision 137784)
+++ config/rs6000/rs6000.c (working copy)
@@ -12288,9 +12288,13 @@ print_operand (FILE *file, rtx x, int co
fprintf (file, "0,%s", reg_names[REGNO (tmp)]);
else
{
- gcc_assert (GET_CODE (tmp) == PLUS
- && REG_P (XEXP (tmp, 0))
- && REG_P (XEXP (tmp, 1)));
+ if (!GET_CODE (tmp) == PLUS
+ || !REG_P (XEXP (tmp, 0))
+ || !REG_P (XEXP (tmp, 1)))
+ {
+ output_operand_lossage ("invalid %%y value, try using the 'Z'
constraint");
+ break;
+ }
if (REGNO (XEXP (tmp, 0)) == 0)
fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (tmp, 1)) ],
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31568
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/31568] ICE with invalid %y operand (inline-asm)
2007-04-13 22:05 [Bug target/31568] New: ICE with invalid %y operand (inline-asm) pinskia at gcc dot gnu dot org
2007-07-09 8:50 ` [Bug target/31568] " pinskia at gcc dot gnu dot org
2008-07-14 12:43 ` pinskia at gcc dot gnu dot org
@ 2008-07-15 12:54 ` pinskia at gcc dot gnu dot org
2008-07-15 12:54 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-07-15 12:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2008-07-15 12:53 -------
Fixed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31568
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug target/31568] ICE with invalid %y operand (inline-asm)
2007-04-13 22:05 [Bug target/31568] New: ICE with invalid %y operand (inline-asm) pinskia at gcc dot gnu dot org
` (2 preceding siblings ...)
2008-07-15 12:54 ` pinskia at gcc dot gnu dot org
@ 2008-07-15 12:54 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-07-15 12:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2008-07-15 12:53 -------
Subject: Bug 31568
Author: pinskia
Date: Tue Jul 15 12:52:56 2008
New Revision: 137837
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=137837
Log:
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.
Added:
trunk/gcc/testsuite/gcc.target/powerpc/asm-y.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/rs6000.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31568
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-07-15 12:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-13 22:05 [Bug target/31568] New: ICE with invalid %y operand (inline-asm) pinskia at gcc dot gnu dot org
2007-07-09 8:50 ` [Bug target/31568] " pinskia at gcc dot gnu dot org
2008-07-14 12:43 ` pinskia at gcc dot gnu dot org
2008-07-15 12:54 ` pinskia at gcc dot gnu dot org
2008-07-15 12:54 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).