diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-15 21:52:53 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-15 21:52:53 +0000 |
commit | 9bd348de6e15365f0ca3ab1e809909835dbe29ea (patch) | |
tree | 442faf97b50015de3052a61cf9357c79ecc13982 /libmudflap | |
parent | 0e4b796aa652afb53fb2112ca224b55fa8d8e30c (diff) | |
download | gcc-9bd348de6e15365f0ca3ab1e809909835dbe29ea.tar.gz |
PR libmudflap/36397
* tree-mudflap.c (mf_xform_derefs_1): Handle VIEW_CONVERT_EXPR.
* testsuite/libmudflap.c/pass64-frag.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140374 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libmudflap')
-rw-r--r-- | libmudflap/ChangeLog | 5 | ||||
-rw-r--r-- | libmudflap/testsuite/libmudflap.c/pass64-frag.c | 38 |
2 files changed, 43 insertions, 0 deletions
diff --git a/libmudflap/ChangeLog b/libmudflap/ChangeLog index e9eec1050f4..6a879243c9c 100644 --- a/libmudflap/ChangeLog +++ b/libmudflap/ChangeLog @@ -1,3 +1,8 @@ +2008-09-15 Jakub Jelinek <jakub@redhat.com> + + PR libmudflap/36397 + * testsuite/libmudflap.c/pass64-frag.c: New test. + 2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * Makefile.in: Regenerate. diff --git a/libmudflap/testsuite/libmudflap.c/pass64-frag.c b/libmudflap/testsuite/libmudflap.c/pass64-frag.c new file mode 100644 index 00000000000..856eec0fa7e --- /dev/null +++ b/libmudflap/testsuite/libmudflap.c/pass64-frag.c @@ -0,0 +1,38 @@ +/* PR libmudflap/36397 */ +/* { dg-do run } */ +/* { dg-options "-O -fmudflap -fno-strict-aliasing -lmudflap" } */ + +struct A +{ + int a[2]; +}; + +long long int x; + +int __attribute__ ((noinline)) +baz (long long int *x) +{ + return *x; +} + +int __attribute__ ((noinline)) +foo (int i) +{ + if (i > 10) + return baz (&x); + return ((struct A *) &x)->a[i]; +} + +int +main (void) +{ + if (sizeof (long long) == 2 * sizeof (int) + && sizeof (long long) == sizeof (struct A)) + { + struct A a = { .a[0] = 10, .a[1] = 20 }; + __builtin_memcpy (&x, &a, sizeof (x)); + if (foo (0) != 10 || foo (1) != 20) + __builtin_abort (); + } + return 0; +} |