From 475e57f00bc6aec9e9954e940b9f365d027b611b Mon Sep 17 00:00:00 2001 From: amylaar Date: Mon, 28 Oct 2013 12:19:16 +0000 Subject: [PATCH] gcc/testsuite: 2013-10-28 Claudiu Zissulescu Joern Rennecke * gcc.target/arc/jump-around-jump.c: New test. gcc: 2013-10-28 Joern Rennecke * config/arc/arc.c (arc_ccfsm_post_advance): Add comment about TYPE_RETURN. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204123 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 + gcc/config/arc/arc.c | 2 + gcc/testsuite/ChangeLog | 5 + gcc/testsuite/gcc.target/arc/jump-around-jump.c | 123 ++++++++++++++++++++++++ 4 files changed, 135 insertions(+) create mode 100644 gcc/testsuite/gcc.target/arc/jump-around-jump.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 461439a..47041b2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-10-28 Joern Rennecke + + * config/arc/arc.c (arc_ccfsm_post_advance): + Add comment about TYPE_RETURN. + 2013-10-28 Bin Cheng * tree-ssa-loop-ivopts.c (strip_offset_1): Change parameter type. diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 7c39d53..6ddd486 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -3720,6 +3720,8 @@ arc_ccfsm_post_advance (rtx insn, struct arc_ccfsm *state) && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC && ((type = get_attr_type (insn)) == TYPE_BRANCH || (type == TYPE_UNCOND_BRANCH + /* ??? Maybe should also handle TYPE_RETURN here, + but we don't have a testcase for that. */ && ARC_CCFSM_BRANCH_DELETED_P (state)))) { if (ARC_CCFSM_BRANCH_DELETED_P (state)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 12028b4..2853ec4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-10-28 Claudiu Zissulescu + Joern Rennecke + + * gcc.target/arc/jump-around-jump.c: New test. + 2013-10-27 Tom de Vries * gcc.target/arm/require-pic-register-loc.c: New test. diff --git a/gcc/testsuite/gcc.target/arc/jump-around-jump.c b/gcc/testsuite/gcc.target/arc/jump-around-jump.c new file mode 100644 index 0000000..1b45328 --- /dev/null +++ b/gcc/testsuite/gcc.target/arc/jump-around-jump.c @@ -0,0 +1,123 @@ +/* { dg-do compile } */ +/* { dg-options "-Os -mlock -mswape -mrtsc -fno-reorder-blocks" } */ + +/* This caused an ICE in arc_ifcvt when the 1->3 state change was not + implemented for TYPE_UNCOND_BRANCH in arc_ccfsm_post_advance. */ + +typedef long __kernel_long_t; +typedef __kernel_long_t __kernel_time_t; + +struct timespec { + __kernel_time_t tv_sec; + long tv_nsec; +}; + + +struct module; +struct device { + struct device *parent; +}; + +struct rtc_time { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; +}; +struct rtc_wkalrm { + unsigned char enabled; + unsigned char pending; + struct rtc_time time; +}; + +struct rtc_class_ops { + int (*open)(struct device *); + void (*release)(struct device *); + int (*ioctl)(struct device *, unsigned int, unsigned long); + int (*read_time)(struct device *, struct rtc_time *); + int (*set_time)(struct device *, struct rtc_time *); + int (*read_alarm)(struct device *, struct rtc_wkalrm *); + int (*set_alarm)(struct device *, struct rtc_wkalrm *); + //int (*proc)(struct device *, struct seq_file *); + int (*set_mmss)(struct device *, unsigned long secs); + int (*read_callback)(struct device *, int data); + int (*alarm_irq_enable)(struct device *, unsigned int enabled); +}; + +struct rtc_device +{ + struct device dev; + struct module *owner; + + int id; + char name[20]; + + const struct rtc_class_ops *ops; + // struct mutex ops_lock; + + // struct cdev char_dev; + unsigned long flags; + + unsigned long irq_data; + //spinlock_t irq_lock; + //wait_queue_head_t irq_queue; + //struct fasync_struct *async_queue; + + //struct rtc_task *irq_task; + //spinlock_t irq_task_lock; + int irq_freq; + int max_user_freq; + + //struct timerqueue_head timerqueue; + //struct rtc_timer aie_timer; + //struct rtc_timer uie_rtctimer; + //struct hrtimer pie_timer; + int pie_enabled; + //struct work_struct irqwork; + + int uie_unsupported; + + + //struct work_struct uie_task; + //struct timer_list uie_timer; + + unsigned int oldsecs; + unsigned int uie_irq_active:1; + unsigned int stop_uie_polling:1; + unsigned int uie_task_active:1; + unsigned int uie_timer_active:1; + +}; + +extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); +extern struct rtc_device *rtc_class_open(const char *name); +extern void rtc_class_close(struct rtc_device *rtc); + + +int rtc_set_ntp_time(struct timespec now) +{ + struct rtc_device *rtc; + struct rtc_time tm; + int err = -19; + + if (now.tv_nsec < (1000000000L >> 1)) + rtc_time_to_tm(now.tv_sec, &tm); + else + rtc_time_to_tm(now.tv_sec + 1, &tm); + + rtc = rtc_class_open("rtc0"); + if (rtc) { + + + if (rtc->ops && (rtc->ops->set_time || rtc->ops->set_mmss)) + err = rtc_set_time(rtc, &tm); + rtc_class_close(rtc); + } + + return err; +} -- 2.7.4