]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/22171 (gcc-4.0-20050623 internal compiler error in linux...
authorMark Mitchell <mark@codesourcery.com>
Fri, 24 Jun 2005 13:24:00 +0000 (13:24 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 24 Jun 2005 13:24:00 +0000 (13:24 +0000)
PR 22171
* tree-ssa-operands.c (get_expr_operands): Check s_ann for NULL
before use.

PR 22171
* gcc.dg/tree-ssa/pr22171.c: New test.

From-SVN: r101291

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr22171.c [new file with mode: 0644]
gcc/tree-ssa-operands.c

index 0a8f91e8038530abe3650f538586789493a535d3..68212f211fe3b42beeae7140419232329b03fba8 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-24  Mark Mitchell  <mark@codesourcery.com>
+
+       PR 22171
+       * tree-ssa-operands (get_expr_operands): Check s_ann for NULL
+       before use.
+
 2005-06-23  Mark Mitchell  <mark@codesourcery.com>
 
        Backport:
index 14a447baa59e14bb2ec139bf1d586e957c64ce98..fb4ed47452acc2d7100b8a742892c1580f8959b7 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-24  Mark Mitchell  <mark@codesourcery.com>
+
+       PR 22171
+       * gcc.dg/tree-ssa/pr22171.c: New test.
+
 2005-06-23  Mark Mitchell  <mark@codesourcery.com>
 
        Backport:
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr22171.c b/gcc/testsuite/gcc.dg/tree-ssa/pr22171.c
new file mode 100644 (file)
index 0000000..6a26c56
--- /dev/null
@@ -0,0 +1,28 @@
+/* { dg-options "-O2" } */
+
+static unsigned int old_serial_port_irq[10];
+
+static struct uart_8250_port {
+  volatile unsigned int slock;
+  unsigned int irq;
+} serial8250_ports[10];
+
+static __inline__ __attribute__((always_inline)) int irq_canonicalize(int irq)
+{
+  return ((irq == 2) ? 9 : irq);
+}
+
+void serial8250_isa_init_ports(void)
+{
+  struct uart_8250_port *up;
+  int i;
+
+  for (i = 0, up = serial8250_ports; i < 10; i++, up++)
+    up->irq = irq_canonicalize(old_serial_port_irq[i]);
+}
+
+int main(void)
+{
+  serial8250_isa_init_ports();
+  return 0;
+}
index b78c592f8d1e36506d0f4b5bb450be9191cd8518..7e1ff813ccbe3adeab6a647a7d2a5697daaa13d1 100644 (file)
@@ -1135,7 +1135,7 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
 
       if (code == COMPONENT_REF) 
        {
-         if (TREE_THIS_VOLATILE (TREE_OPERAND (expr, 1)))
+         if (s_ann && TREE_THIS_VOLATILE (TREE_OPERAND (expr, 1)))
            s_ann->has_volatile_ops = true; 
          get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_none);
        }