aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2004-12-23 16:09:01 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2004-12-23 16:09:01 +0000
commitfaa003343e09656a6b0174c00305073823f2fd0c (patch)
tree82261656f3a9fd3eadfadd7364f74402670803bc /gcc
parent579eab589756ecf43ea7b1466d2946506b66c948 (diff)
downloadgcc-faa003343e09656a6b0174c00305073823f2fd0c.zip
gcc-faa003343e09656a6b0174c00305073823f2fd0c.tar.gz
gcc-faa003343e09656a6b0174c00305073823f2fd0c.tar.bz2
re PR target/16819 (ICE with empty struct as arg)
gcc/ChangeLog: PR target/16819 * calls.c (load_register_parameters): Don't call use_regs when nregs is zero. gcc/testsuite/ChangeLog: PR target/16891 * gcc.dg/empty2.c: New. From-SVN: r92551
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/calls.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/empty2.c15
4 files changed, 28 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e593949..10de8a5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2004-12-23 Alexandre Oliva <aoliva@redhat.com>
+
+ PR target/16819
+ * calls.c (load_register_parameters): Don't call use_regs when
+ nregs is zero.
+
2004-12-23 Eric Botcazou <ebotcazou@libertysurf.fr>
PR middle-end/17746
diff --git a/gcc/calls.c b/gcc/calls.c
index 3c4d13e..946e5bd 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1554,8 +1554,8 @@ load_register_parameters (struct arg_data *args, int num_actuals,
use_group_regs (call_fusage, reg);
else if (nregs == -1)
use_reg (call_fusage, reg);
- else
- use_regs (call_fusage, REGNO (reg), nregs == 0 ? 1 : nregs);
+ else if (nregs > 0)
+ use_regs (call_fusage, REGNO (reg), nregs);
}
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index dd249f3..45620fd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-12-23 Alexandre Oliva <aoliva@redhat.com>
+
+ PR target/16891
+ * gcc.dg/empty2.c: New.
+
2004-12-23 Richard Henderson <rth@redhat.com>
* lib/target-supports.exp (check_effective_target_vect_no_align):
diff --git a/gcc/testsuite/gcc.dg/empty2.c b/gcc/testsuite/gcc.dg/empty2.c
new file mode 100644
index 0000000..7b91fb2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/empty2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+double d=0;
+
+struct A {} a;
+
+void foo(struct A x)
+{
+ d=0;
+}
+
+void bar()
+{
+ if (d) foo(a);
+}