]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR other/6782 (Specifing "-fverbose-asm" option throws ICE.)
authorJakub Jelinek <jakub@redhat.com>
Fri, 24 May 2002 21:40:25 +0000 (23:40 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 24 May 2002 21:40:25 +0000 (23:40 +0200)
PR other/6782
* final.c (get_mem_expr_from_op): Return 0 if op is NULL.

* gcc.dg/verbose-asm.c: New test.

From-SVN: r53856

gcc/ChangeLog
gcc/final.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/verbose-asm.c [new file with mode: 0644]

index cfcc5fbeb047d6effddaa537e7cd7877072f7026..fc69284ef3f3732a95f905f828ce5696712e17fb 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-24  Jakub Jelinek  <jakub@redhat.com>
+
+       PR other/6782
+       * final.c (get_mem_expr_from_op): Return 0 if op is NULL.
+
 2002-05-24  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        PR preprocessor/6780
index 07e96197a66e43493e0a9e38ba4f700f7ba71e10..25a4e84c423aa474ec640bb77982b22bda88859c 100644 (file)
@@ -3171,6 +3171,9 @@ get_mem_expr_from_op (op, paddressp)
 
   *paddressp = 0;
 
+  if (op == NULL)
+    return 0;
+
   if (GET_CODE (op) == REG && ORIGINAL_REGNO (op) >= FIRST_PSEUDO_REGISTER)
     return REGNO_DECL (ORIGINAL_REGNO (op));
   else if (GET_CODE (op) != MEM)
index deabe47ee7aa667d5b734859fb0c2bf70c5f4826..82ea6baac64784bb5d57115f7f6fe1ba8cf76980 100644 (file)
@@ -1,3 +1,7 @@
+2002-05-24  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.dg/verbose-asm.c: New test.
+
 2002-05-24  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * gcc.dg/cpp/paste12.c: New test.
diff --git a/gcc/testsuite/gcc.dg/verbose-asm.c b/gcc/testsuite/gcc.dg/verbose-asm.c
new file mode 100644 (file)
index 0000000..7d105d3
--- /dev/null
@@ -0,0 +1,27 @@
+/* Test whether -fverbose-asm works.  */
+/* { dg-do compile } */
+/* { dg-options "-fverbose-asm" } */
+
+void foo (int *x)
+{
+  (*x)++;
+}
+
+int bar (int *y)
+{
+  int a, b;
+  b = 10;
+  a = 26;
+  foo (&a);
+  a += 10;
+  foo (&a);
+  *y--;
+  return b;
+}
+   
+int
+main (int argc, char *argv [])
+{
+  bar (&argc);
+  return 0;
+}