summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/sh
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-19 18:19:39 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-19 18:19:39 +0000
commite56043cd2c207982e812ce6fcecb7353dea58363 (patch)
tree01a6f37ad5a9ae6b18bdc20f052b04e19b4255c0 /gcc/testsuite/gcc.target/sh
parent2e02a1a4548f2ee1ea519c88e68b20621ad16fcc (diff)
downloadgcc-e56043cd2c207982e812ce6fcecb7353dea58363.tar.gz
2010-09-19 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 164348, with some improvements in gcc/melt-runtime.[ch] 2010-09-19 Basile Starynkevitch <basile@starynkevitch.net> [[merged with trunk rev.164348, so improved MELT runtime!]] * gcc/melt-runtime.h: improved comments. (melt_debug_garbcoll, melt_debuggc_eprintf): Moved from melt-runtime.c. (melt_obmag_string): New declaration. (struct meltobject_st, struct meltclosure_st, struct meltroutine_st, struct meltmixbigint_st, struct meltstring_st): using GTY variable_size and @@MELTGTY@@ comment. (melt_mark_special): added debug print. * gcc/melt-runtime.c: Improved comments. Include bversion.h, realmpfr.h, gimple-pretty-print.h. (ggc_force_collect) Declared external. (melt_forward_counter): Added. (melt_obmag_string): New function. (melt_alptr_1, melt_alptr_2, melt_break_alptr_1_at) (melt_break_alptr_2_at, melt_break_alptr_1,melt_break_alptr_1) (melt_allocate_young_gc_zone, melt_free_young_gc_zone): New. (delete_special, meltgc_make_special): Improved debug printf and use melt_break_alptr_1... (ggc_alloc_*) macros defined for backport to GCC 4.5 (melt_forwarded_copy): Don't clear the new destination zone in old GGC heap. (meltgc_add_out_raw_len): Use ggc_alloc_atomic. (meltgc_raw_new_mappointers, meltgc_raw_put_mappointers) (meltgc_raw_remove_mappointers): Corrected length argument to ggc_alloc_cleared_vec_entrypointermelt_st. (melt_really_initialize): Call melt_allocate_young_gc_zone. (melt_initialize): Set flag_plugin_added. (melt_val2passflag): TODO_verify_loops only in GCC 4.5 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@164424 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/sh')
-rw-r--r--gcc/testsuite/gcc.target/sh/pr43417.c36
-rw-r--r--gcc/testsuite/gcc.target/sh/rte-delay-slot.c33
-rw-r--r--gcc/testsuite/gcc.target/sh/sh4a-memmovua.c2
3 files changed, 70 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.target/sh/pr43417.c b/gcc/testsuite/gcc.target/sh/pr43417.c
new file mode 100644
index 00000000000..081ff46b998
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/pr43417.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -m4" } */
+
+int pid_count = 0;
+main (int argc, char *argv[])
+{
+ unsigned int c;
+ unsigned long long maxbytes = 0;
+ extern char *optarg;
+ int i;
+ int pid_cntr;
+ int pid;
+ int pid_list[1000];
+ while ((c = getopt (argc, argv, "c:b:p:wvh")) != (-1))
+ {
+ switch ((char) c)
+ {
+ case 'b':
+ maxbytes = atoll (optarg);
+ }
+ }
+ pid = fork ();
+ while ((pid != 0) && (maxbytes > 1024 * 1024 * 1024))
+ {
+ maxbytes = maxbytes - (1024 * 1024 * 1024);
+ pid = fork ();
+ if (pid != 0)
+ pid_cntr++;
+ pid_list[i] = pid;
+ }
+ while ((pid_count < pid_cntr))
+ {
+ }
+ kill (pid_list[i], 9);
+}
+
diff --git a/gcc/testsuite/gcc.target/sh/rte-delay-slot.c b/gcc/testsuite/gcc.target/sh/rte-delay-slot.c
new file mode 100644
index 00000000000..eca5db94355
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/rte-delay-slot.c
@@ -0,0 +1,33 @@
+/* { dg-do compile { target "sh-*-*" } } */
+/* { dg-options "-O2" } */
+/* { dg-skip-if "" { "sh*-*-*" } "*" "-m1 -m2*" } */
+/* { dg-final { scan-assembler-not "\trte\t\n\tmov.l\t@r15\\+" } } */
+
+/* This test checks if the compiler generates a pop instruction
+ in the delay slot after rte. For the sh and sh2, the rte
+ instruction reads the return pc from the stack and any pop
+ in the delay slot crashes the hardware.
+
+ Incorrect code generated
+ mov.l @r15+,r1
+ rte
+ mov.l @r15+,r14
+
+ The right code should be
+
+ mov.l @r15+,r1
+ mov.l @r15+,r14
+ rte
+ nop
+*/
+void INT_MTU2_1_TGIA1 (void)
+ __attribute__ ((interrupt_handler));
+void
+INT_MTU2_1_TGIA1 (void)
+{
+ volatile int i = 0;
+ volatile int x, y;
+
+ for (i = 0; i < 10; i++)
+ y = y + x;
+}
diff --git a/gcc/testsuite/gcc.target/sh/sh4a-memmovua.c b/gcc/testsuite/gcc.target/sh/sh4a-memmovua.c
index ec5c0bdab59..359dd8feb90 100644
--- a/gcc/testsuite/gcc.target/sh/sh4a-memmovua.c
+++ b/gcc/testsuite/gcc.target/sh/sh4a-memmovua.c
@@ -2,7 +2,7 @@
32-bit-aligned addresses. */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O" } */
-/* { dg-final { scan-assembler-times "\tmovua\\.l\t(.*)+" 2 } } */
+/* { dg-final { scan-assembler-times "\tmovua\\.l\t" 2 } } */
#ifdef __SH4A__
#include <string.h>