From: Jakub Jelinek Date: Wed, 25 Apr 2001 09:57:00 +0000 (+0200) Subject: emit-rtl.c (subreg_hard_regno): Only do HARD_REGNO_MODE_OK check if check_mode is... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0607953c7d37d3bacac58b2db4c25da953d1c4ce;p=gcc.git emit-rtl.c (subreg_hard_regno): Only do HARD_REGNO_MODE_OK check if check_mode is non-zero. * emit-rtl.c (subreg_hard_regno): Only do HARD_REGNO_MODE_OK check if check_mode is non-zero. * gcc.dg/20010423-1.c: New test. From-SVN: r41537 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e22d747c2ce..661a51bd8f9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-04-25 Jakub Jelinek + + * emit-rtl.c (subreg_hard_regno): Only do HARD_REGNO_MODE_OK check + if check_mode is non-zero. + 2001-04-25 Jakub Jelinek * config/i386/i386.c (ix86_expand_int_movcc): If overlap between diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 2acb55547fa..480ff15ee98 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -719,7 +719,7 @@ subreg_hard_regno (x, check_mode) base_regno = REGNO (reg); if (base_regno >= FIRST_PSEUDO_REGISTER) abort (); - if (! HARD_REGNO_MODE_OK (base_regno, GET_MODE (reg))) + if (check_mode && ! HARD_REGNO_MODE_OK (base_regno, GET_MODE (reg))) abort (); /* Catch non-congruent offsets too. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d53a32e1c9d..f4c2fd1eb68 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-04-25 Jakub Jelinek + + * gcc.dg/20010423-1.c: New test. + 2001-04-25 Jakub Jelinek * gcc.c-torture/execute/20010422-1.c: New test. diff --git a/gcc/testsuite/gcc.dg/20010423-1.c b/gcc/testsuite/gcc.dg/20010423-1.c new file mode 100644 index 00000000000..06af789ba53 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20010423-1.c @@ -0,0 +1,17 @@ +/* { dg-do compile { target ia64-*-* } } */ +/* { dg-options "-O2" } */ + +int __sync_fetch_and_add_si (int *, int); + +inline unsigned int +bar (volatile unsigned int *mem, unsigned int val) +{ + return __sync_fetch_and_add_si((int *)mem, (int)val); +} + +volatile unsigned int x; + +void foo (unsigned short *a) +{ + *a = bar (&x, 1) + 1; +}