diff options
author | Jakub Jelinek <jakub@redhat.com> | 2002-02-13 22:49:32 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2002-02-13 22:49:32 +0100 |
commit | 21117a1708776b7a9544408d9e744703d4f7efbf (patch) | |
tree | cada0d42f2026624bec10c3f530c67f6c43ed81b /gcc | |
parent | ec65b2e3daacfb67c039ca955e62450015f8eea1 (diff) | |
download | gcc-21117a1708776b7a9544408d9e744703d4f7efbf.zip gcc-21117a1708776b7a9544408d9e744703d4f7efbf.tar.gz gcc-21117a1708776b7a9544408d9e744703d4f7efbf.tar.bz2 |
re PR c/5681 (gcc 3.0.3 produces wrong assembler code)
PR c/5681:
* expr.c (safe_from_p): Pass VOIDmode to true_dependence instead of
GET_MODE (x).
* gcc.c-torture/execute/20020213-1.c: New test.
From-SVN: r49746
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/expr.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20020213-1.c | 34 |
4 files changed, 43 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ca7c17a..dba5334 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2002-02-13 Jakub Jelinek <jakub@redhat.com> + PR c/5681: + * expr.c (safe_from_p): Pass VOIDmode to true_dependence instead of + GET_MODE (x). + +2002-02-13 Jakub Jelinek <jakub@redhat.com> + PR optimization/5547: * config/i386/i386.c (i386_simplify_dwarf_addr): Simplify all valid IA-32 address modes involving non-scaled %ebx and @@ -5728,7 +5728,7 @@ safe_from_p (x, exp, top_p) are memory and they conflict. */ return ! (rtx_equal_p (x, exp_rtl) || (GET_CODE (x) == MEM && GET_CODE (exp_rtl) == MEM - && true_dependence (exp_rtl, GET_MODE (x), x, + && true_dependence (exp_rtl, VOIDmode, x, rtx_addr_varies_p))); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 58118cf..0ae7fc4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -2,6 +2,8 @@ * g++.dg/other/debug3.C: New test. + * gcc.c-torture/execute/20020213-1.c: New test. + 2002-02-13 Richard Smith <richard@ex-parrot.com> * g++.old-deja/g++.other/thunk1.C: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/20020213-1.c b/gcc/testsuite/gcc.c-torture/execute/20020213-1.c new file mode 100644 index 0000000..f9fefee --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20020213-1.c @@ -0,0 +1,34 @@ +/* PR c/5681 + This testcase failed on IA-32 at -O0, because safe_from_p + incorrectly assumed it is safe to first write into a.a2 b-1 + and then read the original value from it. */ + +int bar (float); + +struct A { + float a1; + int a2; +} a; + +int b; + +void foo (void) +{ + a.a2 = bar (a.a1); + a.a2 = a.a2 < b - 1 ? a.a2 : b - 1; + if (a.a2 >= b - 1) + abort (); +} + +int bar (float x) +{ + return 2241; +} + +int main() +{ + a.a1 = 1.0f; + b = 3384; + foo (); + return 0; +} |