]> 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:26:54 +0000 (23:26 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 24 May 2002 21:26:54 +0000 (23:26 +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: r53855

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

index 964a27fab1e020e079cc9a0ea6804859d3ba94de..d66135c09a280ba828375afc807c2eb26ee8c0e2 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  David Edelsohn  <edelsohn@gnu.org>
 
        * config/rs6000/aix43.h (LINK_SPEC): Add PE initializer.
index 34eda6cfd7020020b5636489ef4a280c5043166e..d86ed5e7c71a977ed900f46aac74a5ea1f0dbb90 100644 (file)
@@ -3021,6 +3021,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 226aec5d7292b2ece1ea853c2d5a719084892960..24cc0dbf6ed0279339022f0812f55c29ab7ec704 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;
+}